? .xvpics
? ChangeLog.save
? Keyboard.kbd
? autom4te.cache
? checked.png
? gok-0.7.5.tar.gz
? gok-component-state.diff
? gok-diff
? gok-diffy
? gok-dock-help-about.diff
? gok-edit-patch.diff
? gok-hide.patch
? gok-i18n-wc-patch.diff
? gok-keyboard.c-DIFF
? gok-mouse-control.diff
? gok-no-queues.diff
? word-complete-backspace.diff
? docs/reference/gok-decl-list.txt
? docs/reference/gok-decl.txt
? docs/reference/gok-undocumented.txt
? docs/reference/gok-unused.txt
? docs/reference/gok.args
? docs/reference/gok.hierarchy
? docs/reference/gok.signals
? docs/reference/html
? docs/reference/html-build.stamp
? docs/reference/html.stamp
? docs/reference/scan-build.stamp
? docs/reference/sgml
? docs/reference/sgml-build.stamp
? docs/reference/sgml.stamp
? docs/reference/tmpl-build.stamp
? docs/reference/tmpl.stamp
? gok/gok-spy.c.save
? gok/gok_spy.save.c
? gok/keyboard-geometry
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gok/ChangeLog,v
retrieving revision 1.226
diff -u -r1.226 ChangeLog
--- ChangeLog	12 Jun 2003 13:34:40 -0000	1.226
+++ ChangeLog	12 Jun 2003 14:56:22 -0000
@@ -1,6 +1,14 @@
 2003-06-12  Bill Haneman <bill.haneman@sun.com>
 	
+	* gok/gok-output.h:
+	Changed OUTPUT_KEYSYM, etc. from #defines to an enum,
+	GokOutputType.  Added OUTPUT_KEYSTRING.
+
 	* gok/gok-output.c:
+	(gok_output_send_to_system): Handle new "KEYSTRING" output type,
+	using at-spi keystring synthesis API.
+	(gok_output_new): Create new output type.
+	
 	* gok/gok-word-complete.h:
 	(gok_wordcomplete_predict): 
 	Changed to take a const gunichar instead of a const gchar.
@@ -8,7 +16,6 @@
 	* gok/gok-word-complete.c:
 	m_pWordPart: delete fixed array, use pointer word_part instead.
 	Correct spelling of 'separators'. 
-	(): New convenience method.
 	(gok_wordcomplete_predict): 
 	Use UTF-8 concatenation of word_part when adding letters amd use
 	g_utf8_strlen when deciding its length.
@@ -24,7 +31,7 @@
 	tokens that contain non-breaking-space.  (May need to revisit
 	this if we do spell-checking per-se on documents that include
 	NBS in them for purely visual reasons).
-	
+	(gok_wordcomplete_get_output): Make UTF-8 safe; use KEYSTRING output type.
 	(gok_wordcomplete_endWord): free and NULL word_part.
 
 2003-06-11  Padraig O'Briain <padraig.obriain@sun.com>
Index: gok/gok-output.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-output.c,v
retrieving revision 1.13
diff -u -r1.13 gok-output.c
--- gok/gok-output.c	12 Jun 2003 13:34:41 -0000	1.13
+++ gok/gok-output.c	12 Jun 2003 14:56:23 -0000
@@ -80,7 +80,7 @@
 /**
 * gok_output_new
 * @Type: Type of output (e.g. keysym or keycode).
-* @Name: Keycode or Keysym string.
+* @Name: Keycode, Keysym, or UTF-8 string.
 * @Flag:
 *
 * Creates a new GokOutput and initializes it to the given values.
@@ -235,6 +235,20 @@
 			        keysym = XKeycodeToKeysym (gok_main_display (), 
 							   keycode, index);
 				gok_wordcomplete_predict (gok_output_unichar_from_keysym (keysym));
+			}
+		}
+		if (pOutput->Type == OUTPUT_KEYSTRING)
+		{
+			gok_log ("Sending a string");
+			gok_log ("pOutput->Name = SPI_KEY_STRING = %s", pOutput->Name);
+
+			SPI_generateKeyboardEvent (0, pOutput->Name, SPI_KEY_STRING);
+
+			/* update the word prediction keys with the new output */
+			if (bWordCompletion == TRUE)
+			{
+				/* TODO: allow word completion with substring insertion */
+				gok_wordcomplete_predict (0);
 			}
 		}
 		else if (pOutput->Type == OUTPUT_EXEC)
Index: gok/gok-output.h
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-output.h,v
retrieving revision 1.5
diff -u -r1.5 gok-output.h
--- gok/gok-output.h	11 Oct 2002 19:00:04 -0000	1.5
+++ gok/gok-output.h	12 Jun 2003 14:56:23 -0000
@@ -27,13 +27,16 @@
 #include <gnome.h>
 #include <cspi/spi.h>
 
-#define OUTPUT_KEYSYM 0
-#define OUTPUT_KEYCODE 1
-#define OUTPUT_EXEC 2
-
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
+
+typedef enum {
+	OUTPUT_KEYSYM,
+	OUTPUT_KEYCODE,
+	OUTPUT_KEYSTRING,
+	OUTPUT_EXEC
+} GokOutputType;
 
 /* an output */
 typedef struct GokOutput{
Index: gok/gok-word-complete.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-word-complete.c,v
retrieving revision 1.17
diff -u -r1.17 gok-word-complete.c
--- gok/gok-word-complete.c	12 Jun 2003 13:34:41 -0000	1.17
+++ gok/gok-word-complete.c	12 Jun 2003 14:56:23 -0000
@@ -334,11 +334,6 @@
 	GokOutput* pOutputNew;
 	GokOutput* pOutputListEnd;
 	gchar* LabelText;
-	gchar letterOutput[2];
-	gint countPartWord = 0;
-	gint countOutputWord;
-	gint indexBuffer;
-	gint indexOutputWord;
 	
 	g_assert (pKey != NULL);
 
@@ -364,28 +359,18 @@
 	m_pOutputListStart = NULL;
 	pOutputListEnd = NULL;
 
-	/* 
-	 * Danger, mix of ascii and utf8 methods used.  routine below uses ascii because,
-	 * for the moment, it uses byte (i.e. gchar) indexing into the arrays.
-	 * Stylistically bad, should make use of g_utf8 manipulation APIs instead.
-	 */ 
-	if (word_part)
-		countPartWord = strlen (word_part);
-	countOutputWord = strlen (LabelText);
-	if (countOutputWord > countPartWord)
+	if (word_part && (g_utf8_strlen (word_part, -1) < g_utf8_strlen (LabelText, -1)))
 	{
-		indexOutputWord = countPartWord;
-		
-		/* move the word completion to the buffer */
-		for (indexBuffer = 0; indexBuffer < (countOutputWord - countPartWord); indexBuffer++)
-		{
-			/* create a series of outputs for the predicted word */
-			letterOutput[0] = LabelText[indexOutputWord++];
-			letterOutput[1] = 0;
-			/* FIXME!!! keysyms are not characters, this will work for some ASCII 
-			 * but will cause real problems for UTF-8.
-			 */
-			pOutputNew = gok_output_new (OUTPUT_KEYSYM, letterOutput, SPI_KEY_SYM);
+		gchar *cp;
+                /* 
+		 * note that this won't match if the decompositions don't match. Should we
+		 * decompose to canonical first ? 
+		 */ 
+		cp = strstr (LabelText, word_part); 
+		/* sanity check: is our word_part found in our label? */
+		if (cp) {
+			gint offset = strlen (word_part); /* in bytes, not chars */
+			pOutputNew = gok_output_new (OUTPUT_KEYSTRING, cp + offset, SPI_KEY_STRING);
 			if (m_pOutputListStart == NULL)
 			{
 				m_pOutputListStart = pOutputNew;
@@ -396,6 +381,10 @@
 				pOutputListEnd->pOutputNext = pOutputNew;
 				pOutputListEnd = pOutputNew;
 			}
+		}
+		else {
+			/* if not then we are doing a 'replace', handle that via EditableText. */
+			g_warning ("Sorry, string replacement is not yet implemented.");
 		}
 	}
 
