? Keyboard.kbd
? autom4te.cache
? diff
? gok-0.7.1.tar.gz
? gok-patch.diff
? gok-wordcomplete-patch.diff
? gok.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/keyboard-geometry
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gok/ChangeLog,v
retrieving revision 1.196
diff -u -r1.196 ChangeLog
--- ChangeLog	13 May 2003 15:56:04 -0000	1.196
+++ ChangeLog	16 May 2003 17:42:22 -0000
@@ -1,3 +1,11 @@
+2003-05-16  Bill Haneman <bill.haneman@sun.com>
+
+	* gok/gok-spy.c:
+	Uncomment some of David's code for listening to 
+	window:activate and window:deactivate events.
+
+	Fixes bugs #88033, #112507, possibly others TBD.
+
 2003-05-13  Calum Benson  <calum.benson@sun.com>
 
 	* gok.glade2:
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gok/Makefile.am,v
retrieving revision 1.29
diff -u -r1.29 Makefile.am
--- Makefile.am	14 Feb 2003 15:42:16 -0000	1.29
+++ Makefile.am	16 May 2003 17:42:22 -0000
@@ -1,4 +1,4 @@
-SUBDIRS = gok po help omf-install docs
+SUBDIRS = gok help po omf-install docs
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = gok-1.0.pc
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gok/configure.in,v
retrieving revision 1.39
diff -u -r1.39 configure.in
--- configure.in	5 May 2003 14:20:14 -0000	1.39
+++ configure.in	16 May 2003 17:42:22 -0000
@@ -2,9 +2,9 @@
 
 GOK_MAJOR_VERSION=0
 GOK_MINOR_VERSION=7
-GOK_MICRO_VERSION=1
-GOK_INTERFACE_AGE=1
-GOK_BINARY_AGE=0
+GOK_MICRO_VERSION=2
+GOK_INTERFACE_AGE=2
+GOK_BINARY_AGE=2
 GOK_VERSION="$GOK_MAJOR_VERSION.$GOK_MINOR_VERSION.$GOK_MICRO_VERSION"
 AM_INIT_AUTOMAKE(gok, $GOK_VERSION)
 AC_SUBST(GOK_MAJOR_VERSION)
Index: dictionary.txt
===================================================================
RCS file: /cvs/gnome/gok/dictionary.txt,v
retrieving revision 1.1
diff -u -r1.1 dictionary.txt
--- dictionary.txt	30 Jan 2002 22:00:08 -0000	1.1
+++ dictionary.txt	16 May 2003 17:42:24 -0000
@@ -689,7 +689,7 @@
 number	131	2
 numbers	32	2
 numerical	8	2
-numerous	7	2
+numerous	70	2
 nuclear	20	2
 nursing	12	2
 nutrition	6	2
@@ -758,6 +758,7 @@
 heard	8	2
 heat	9	2
 heavy	7	2
+hello	200	2
 help	87	2
 helpful	7	2
 held	30	2
@@ -2041,6 +2042,7 @@
 dead	6	2
 deadline	17	2
 deadlines	5	2
+dear    50      2
 death	17	2
 deal	16	2
 dealing	9	2
@@ -2199,6 +2201,7 @@
 linda	11	2
 linguistic	7	2
 linguistics	11	2
+linux   5       2
 light	29	2
 limit	9	2
 limited	26	2
Index: gok/gok-data.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-data.c,v
retrieving revision 1.31
diff -u -r1.31 gok-data.c
--- gok/gok-data.c	14 Feb 2003 15:42:17 -0000	1.31
+++ gok/gok-data.c	16 May 2003 17:42:26 -0000
@@ -1071,3 +1071,15 @@
 	return codeReturned;
 }
 
+gdouble
+gok_data_get_valuator_sensitivity (void)
+{
+	/* TODO: implement in gconf */
+	return 1.0;
+}
+
+void 
+gok_data_set_valuator_sensitivity (gdouble multiplier)
+{
+	/* TODO: implement in gconf */
+}
Index: gok/gok-data.h
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-data.h,v
retrieving revision 1.20
diff -u -r1.20 gok-data.h
--- gok/gok-data.h	28 Feb 2003 16:11:09 -0000	1.20
+++ gok/gok-data.h	16 May 2003 17:42:26 -0000
@@ -103,6 +103,8 @@
 void gok_data_set_drive_corepointer (gboolean bTrueFalse);
 gboolean gok_data_get_use_xkb_kbd (void);
 void gok_data_set_use_xkb_kbd (gboolean bTrueFalse);
+gdouble gok_data_get_valuator_sensitivity ();
+void gok_data_set_valuator_sensitivity (gdouble multiplier);
 
 #ifdef __cplusplus
 }
Index: gok/gok-key.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-key.c,v
retrieving revision 1.48
diff -u -r1.48 gok-key.c
--- gok/gok-key.c	12 Mar 2003 22:04:58 -0000	1.48
+++ gok/gok-key.c	16 May 2003 17:42:27 -0000
@@ -288,7 +288,9 @@
                 GTK_WIDGET (pKey->pButton)->style->ythickness;
 }
 
-static gchar *
+/**
+ **/
+gchar *
 gok_key_modifier_for_keycode (Display *display, XkbDescPtr xkb, int keycode)
 {
 	gint group = gok_key_get_effective_group ();
Index: gok/gok-key.h
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-key.h,v
retrieving revision 1.33
diff -u -r1.33 gok-key.h
--- gok/gok-key.h	12 Mar 2003 22:04:58 -0000	1.33
+++ gok/gok-key.h	16 May 2003 17:42:27 -0000
@@ -190,6 +190,8 @@
 gboolean gok_key_contains_point (GokKey *pKey, gint x, gint y);
 void gok_key_set_effective_group (gint group);
 gint gok_key_get_effective_group (void);
+gchar *gok_key_modifier_for_keycode (Display *display, 
+				     XkbDescPtr xkb, int keycode);
 
 #ifdef __cplusplus
 }
Index: gok/gok-output.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-output.c,v
retrieving revision 1.11
diff -u -r1.11 gok-output.c
--- gok/gok-output.c	11 Mar 2003 20:55:33 -0000	1.11
+++ gok/gok-output.c	16 May 2003 17:42:28 -0000
@@ -193,10 +193,18 @@
 
 			SPI_generateKeyboardEvent ((long) keycode, NULL, pOutput->Flag);
 			/* update the word prediction keys with the new output */
-			if (bWordCompletion == TRUE)
+			if (bWordCompletion == TRUE && 
+			    !gok_key_modifier_for_keycode (
+				    gok_main_display (),
+				    gok_keyboard_get_xkb_desc (),
+				    keycode)) 
 			{
-			        int index = 0;
-				/* TODO: calculate the proper index based on mods */
+				gulong mask = gok_spy_get_modmask ();
+			        int index = (mask & ShiftMask) ?
+					((mask & LockMask) ? 0 : 1) : 
+					((mask & LockMask) ? 1 : 0);
+
+				/* TODO: get the correct index from XKB */
 			        keysym = XKeycodeToKeysym (gok_main_display (), 
 							   keycode, index);
 				gok_wordcomplete_predict (keysym);
Index: gok/gok-scanner.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-scanner.c,v
retrieving revision 1.51
diff -u -r1.51 gok-scanner.c
--- gok/gok-scanner.c	24 Mar 2003 17:31:52 -0000	1.51
+++ gok/gok-scanner.c	16 May 2003 17:42:29 -0000
@@ -1,6 +1,6 @@
 /* gok-scanner.c
 *
-* Copyright 2002 Sun Microsystems, Inc.,
+* Copyright 2002 Sun Microsystems, Inc.
 * Copyright 2002 University Of Toronto
 *
 * This library is free software; you can redistribute it and/or
@@ -2154,8 +2154,9 @@
 	gint x=0, y=0;
 	if ((n_axes >= 2) && pWindow->window) {
 		gint o_x, o_y;
-		x = motion_data[0] - m_OffsetX;
-		y = motion_data[1] - m_OffsetY;
+		gdouble multiplier = gok_data_get_valuator_sensitivity ();
+		x = motion_data[0] * multiplier - m_OffsetX;
+		y = motion_data[1] * multiplier - m_OffsetY;
 		gdk_window_get_origin (pWindow->window, &o_x, &o_y);
 		if (!gok_data_get_drive_corepointer ()) {
 			gok_pointer_clip_to_window (&x, &y, pWindow->window, 
Index: gok/gok-spy.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-spy.c,v
retrieving revision 1.59
diff -u -r1.59 gok-spy.c
--- gok/gok-spy.c	9 Apr 2003 14:26:30 -0000	1.59
+++ gok/gok-spy.c	16 May 2003 17:42:30 -0000
@@ -126,6 +126,7 @@
 static gint explicitrefs;
 static gint explicitunrefs;
 static gint implicitrefs;
+static gulong keyboardmods;
 
 static guint spy_handler_id = 0;
 
@@ -585,9 +586,6 @@
 			gok_log("GOKSPY_FOCUS_EVENT");
 			gok_spy_process_accessible(en->paccessible);
 			break;
-		/*
-		 *  TODO: revisit this after CSUN
-		 *
 		case GOKSPY_DEFUNCT_EVENT:
 			gok_log("GOKSPY_DEFUNCT_EVENT");
 			gok_spy_accessible_unref (m_ptheWindowAccessible);
@@ -601,7 +599,6 @@
 			gok_spy_accessible_ref (m_ptheWindowAccessible);
 			((AppChangeListenerCB)(m_ptheWindowChangeListener))(m_ptheWindowAccessible);
 			break;
-		*/
 		case GOKSPY_WINDOW_DEACTIVATE_EVENT:
 			gok_log("GOKSPY_WINDOW_DEACTIVATE_EVENT");
 
@@ -1157,6 +1154,15 @@
         return is_switch_trigger;
 }
 
+/**
+ * gok_spy_get_modmask:
+ **/
+gulong gok_spy_get_modmask (void)
+{
+	return keyboardmods;
+}
+
+
 /** 
  * gok_spy_modifier_listener:
  * @event: the keyboard modifier event.
@@ -1167,10 +1173,13 @@
 void gok_spy_modifier_listener(const AccessibleEvent *event, void *user_data)
 {
 	const struct gok_modifier_keymask *m;
+       
+	keyboardmods = event->detail2;
 
 	gok_log_enter();
 	gok_log ("event->detail2 = %d", event->detail2);
 
+	
 	for (m = gok_modifier_keymasks; m->name != NULL; m++)
 	{
 		if (event->detail2 & m->keymask)
Index: gok/gok-spy.h
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-spy.h,v
retrieving revision 1.17
diff -u -r1.17 gok-spy.h
--- gok/gok-spy.h	19 Dec 2002 16:35:56 -0000	1.17
+++ gok/gok-spy.h	16 May 2003 17:42:30 -0000
@@ -48,6 +48,8 @@
 void gok_spy_register_mousebuttonlistener(MouseButtonListener* callback); 
 void gok_spy_deregister_mousebuttonlistener(MouseButtonListener* callback); 
 
+gulong gok_spy_get_modmask (void);
+
 /* gboolean gok_spy_is_desktop(Accessible* pAccessible); */
 /* gboolean gok_spy_accessible_is_desktopChild(Accessible* accessible);*/
 /* AccessibleNode* gok_spy_get_applications( void ); */
Index: gok/gok-word-complete.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-word-complete.c,v
retrieving revision 1.15
diff -u -r1.15 gok-word-complete.c
--- gok/gok-word-complete.c	11 Oct 2002 19:00:04 -0000	1.15
+++ gok/gok-word-complete.c	16 May 2003 17:42:31 -0000
@@ -165,7 +165,7 @@
 	/* clear the current word predictions */
 	gok_wordcomplete_clear_keys();
 
-	/* is this an end-word character? */
+	/* is this an end-word character? FIXME unicode */
 	if ((letter == ' ') ||
 		(letter == 13) || /* enter */
 		(letter == '\t'))
@@ -288,6 +288,7 @@
 **/
 gboolean gok_wordcomplete_add_new_word (const gchar* pWord)
 {
+	/* TODO : implement */
 	return TRUE;
 }
 
Index: gok/main.c
===================================================================
RCS file: /cvs/gnome/gok/gok/main.c,v
retrieving revision 1.88
diff -u -r1.88 main.c
--- gok/main.c	21 Apr 2003 15:29:10 -0000	1.88
+++ gok/main.c	16 May 2003 17:42:32 -0000
@@ -527,6 +527,7 @@
         GtkWidget *window = gok_main_get_main_window ();
 	Display *display;
 	GdkWindow *root;
+	gint dx, dy;
 	if (window) 
 	{
 		display = GDK_WINDOW_XDISPLAY (window->window);
@@ -537,17 +538,13 @@
 			mods, timestamp);
 		gok_log_leave ();
 		gok_scanner_input_motion (motion_data, n_axes);
-		
-		/* 
-		 * TODO:
-		 * XWarpPointer is apparently too slow to do every time we get a 
-		 * motion event, so if we want to support "cursor latching" we need 
-		 * to coalesce these events.
-		 */
+
+		dx = motion_data[0] * gok_data_get_valuator_sensitivity ();
+		dy = motion_data[1] * gok_data_get_valuator_sensitivity ();
 		if (gok_data_get_drive_corepointer ()) {
 			XWarpPointer (display, None, 
 				      GDK_WINDOW_XWINDOW (root),
-				      0, 0, 0, 0, motion_data[0], motion_data[1]);
+				      0, 0, 0, 0, dx, dy);
 		}
 	}
 }
Index: gok/word-complete.c
===================================================================
RCS file: /cvs/gnome/gok/gok/word-complete.c,v
retrieving revision 1.9
diff -u -r1.9 word-complete.c
--- gok/word-complete.c	6 May 2003 21:48:51 -0000	1.9
+++ gok/word-complete.c	16 May 2003 17:42:32 -0000
@@ -32,6 +32,14 @@
 #include <ctype.h>
 #include "gok-log.h"
 
+typedef enum 
+{
+	WORD_CASE_LOWER,
+	WORD_CASE_INITIAL_CAPS,
+	WORD_CASE_ALL_CAPS,
+	WORD_CASE_TITLE
+} WordPredictionCaseType;
+
 /* this will hold the string of predictions that is returned to the caller */
 static gchar m_buffer [MAXWORDLENGTH * MAXPREDICTIONS + MAXPREDICTIONS + 1];
 
@@ -322,6 +330,103 @@
 	pParentNode->pFirstChildNode = NULL;
 }
 
+/**
+ * DetermineCase:
+ **/
+static WordPredictionCaseType
+DetermineCase (const gchar *pWord)
+{
+	gunichar c;
+	const gchar *p = pWord;
+	if (g_utf8_validate (pWord, -1, NULL))
+	{
+		c = g_utf8_get_char (pWord); 
+		if (g_unichar_isupper (c)) 
+		{
+			int i, len = g_utf8_strlen (pWord, -1);
+			if (len == 1) 
+				return WORD_CASE_INITIAL_CAPS;
+			for (i = 0; i < len; i++ )
+			{
+				p = g_utf8_offset_to_pointer (pWord, i);
+				c = g_utf8_get_char (p);
+				if (g_unichar_islower (c))
+					return WORD_CASE_INITIAL_CAPS;
+			}
+			return WORD_CASE_ALL_CAPS;
+		}
+		else if (g_unichar_istitle (c))
+		{
+			/* FIXME: this isn't quite right;
+			 * we're only checking the first char 
+			 */
+			return WORD_CASE_TITLE;
+		}
+	}
+	return WORD_CASE_LOWER;
+}
+
+/**
+ * ApplyCase:
+ **/
+static void
+ApplyCase (gchar **pWord, WordPredictionCaseType caseType)
+{
+	/* 
+	 * FIXME: requires a significant rework before unicode
+	 * characters can work with this framework.
+	 */
+	gunichar c;
+	int i, len;
+
+	switch (caseType) {
+	case WORD_CASE_TITLE:
+	case WORD_CASE_INITIAL_CAPS:
+		**pWord = g_ascii_toupper (**pWord);
+		break;
+	case WORD_CASE_ALL_CAPS:
+		len = strlen (*pWord);
+/*		fprintf (stderr, "length %d\n", len);*/
+		for (i = 0; i < len; i++) 
+		{
+			(*pWord)[i] = g_ascii_toupper ((*pWord)[i]);
+		}
+		break;
+	case WORD_CASE_LOWER:
+/*		fprintf (stderr, "lower case\n");*/
+	default:
+		break;
+	}
+}
+
+/**
+ * WordCompleteApplyCase:
+ *
+ **/
+static void
+WordCompleteApplyCase (const gchar *pWord, gchar **pPredictions, gint num)
+{
+	int i;
+	WordPredictionCaseType caseType = WORD_CASE_LOWER;
+
+	caseType = DetermineCase (pWord);
+/*	fprintf (stderr, "case of [%s] is %d;", pWord, caseType);*/
+	if (caseType != WORD_CASE_LOWER)
+	{
+		gchar *p;
+		ApplyCase (pPredictions, caseType);
+		p = strchr (*pPredictions, '\t');
+		while (p)
+		{
+			++p;
+/*			fprintf (stderr, "applycase at %p\n", p);*/
+			ApplyCase (&p, caseType);
+			p = strchr (p, '\t');
+		}
+	}
+}
+
+
 /*
  * WordCompletePredict
  *
@@ -442,6 +547,10 @@
 	{
 	  return 1; /* indicates no predictions made */
 	}
+
+	/* post-process the predictions to match the case of the input */
+	WordCompleteApplyCase (pWord, pPredictions, numberPredictions);
+
 	return 0; /* predictions made! */
 }
 
