? 122110.diff
? 122117-1.diff
? 122742.diff
? Keyboard.kbd
? automatic-scanning.xam
? core.21726
? direct-selection.xam
? dwell-selection.xam
? gok.desktop
? inverse-scanning.xam
? 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-word-completion-changes.txt
? gok/keyboard-geometry
Index: gok.glade2
===================================================================
RCS file: /cvs/gnome/gok/gok.glade2,v
retrieving revision 1.10
diff -u -r1.10 gok.glade2
--- gok.glade2	28 Jun 2003 16:10:28 -0000	1.10
+++ gok.glade2	26 Sep 2003 07:23:47 -0000
@@ -1713,7 +1713,7 @@
 			  <signal name="toggled" handler="on_core_pointer_button_toggled" last_modification_time="Mon, 17 Feb 2003 22:57:51 GMT"/>
 			</widget>
 			<packing>
-			  <property name="padding">2</property>
+			  <property name="padding">0</property>
 			  <property name="expand">False</property>
 			  <property name="fill">False</property>
 			</packing>
@@ -1739,7 +1739,7 @@
 			      <signal name="toggled" handler="on_xinput_device_button_toggled" last_modification_time="Mon, 17 Feb 2003 22:59:01 GMT"/>
 			    </widget>
 			    <packing>
-			      <property name="padding">0</property>
+			      <property name="padding">1</property>
 			      <property name="expand">False</property>
 			      <property name="fill">False</property>
 			    </packing>
@@ -1804,7 +1804,7 @@
 			  <signal name="toggled" handler="on_joystick_button_toggled" last_modification_time="Mon, 17 Feb 2003 22:58:52 GMT"/>
 			</widget>
 			<packing>
-			  <property name="padding">0</property>
+			  <property name="padding">2</property>
 			  <property name="expand">False</property>
 			  <property name="fill">False</property>
 			</packing>
Index: gok/gok-key.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-key.c,v
retrieving revision 1.70
diff -u -r1.70 gok-key.c
--- gok/gok-key.c	19 Sep 2003 13:58:18 -0000	1.70
+++ gok/gok-key.c	26 Sep 2003 07:23:51 -0000
@@ -378,7 +378,7 @@
   pKey = gok_key_new (prevKey, NULL, pKeyboard);
   numlock_mask = gok_key_get_numlock_mask (display);
   is_modifier = FALSE;
-  pKey->has_text = TRUE; /* TODO: handle non-textual keyboard keys! */
+  pKey->has_text = TRUE; /* TODO: handle non-textual keyboard key caps! */
   pKey->Top = row;
   pBounds = &pGeom->shapes[keyp->shape_ndx].bounds;
   pKey->Bottom = row + MAX (1, (pBounds->y2 - pBounds->y1)/(pBounds->x2 - pBounds->x1));
Index: gok/gok-keyboard.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-keyboard.c,v
retrieving revision 1.98
diff -u -r1.98 gok-keyboard.c
--- gok/gok-keyboard.c	19 Sep 2003 15:36:44 -0000	1.98
+++ gok/gok-keyboard.c	26 Sep 2003 07:23:56 -0000
@@ -54,7 +54,10 @@
 #define NUM_INTERESTING_ROLES 5
 #define GOK_KEYBOARD_MAX_ROWS 24
 
-#define CORE_KEYBOARD "Keyboard"
+#define CORE_KEYBOARD N_("Keyboard")
+#define ALPHA_KEYBOARD N_("Keyboard")
+/*#define ALPHA_KEYBOARD N_("Alpha")*/
+#define FREQ_KEYBOARD N_("Alpha-Frequency")
 
 #define GOK_KEYBOARD_DOCK_BORDERPIX 5
 
@@ -400,25 +403,116 @@
 	return m_XkbDisplay;
 }
 
+
 /**
-* gok_keyboard_get_core:
-*
-* Returns: a pointer to a #GokKeyboard representing the core system 
-* keyboard device, with the same row/column geometry and key symbols.
-**/
-GokKeyboard *
-gok_keyboard_get_core ()
+ * gok_keyboard_add_keys_from_charstrings:
+ *
+ *
+ **/
+static void
+gok_keyboard_add_keys_from_charstrings (GokKeyboard *pKeyboard, 
+					gchar *level0_string,
+					gchar *level1_string,
+					gchar *level2_string,
+					gchar *level3_string)
 {
-	GokKeyboard *pKeyboard;
+	GokKey *pKey = pKeyboard->pKeyFirst;
+	while (pKey->pKeyNext) 
+	{
+		pKey = pKey->pKeyNext;
+	}
+	if (level0_string)
+	{
+	        level0_string = g_utf8_strchr (level0_string, -1, '|');
+		if (level0_string) ++level0_string; /* works because '|' is one byte */
+	}
+
+	if (!(level0_string && g_utf8_validate (level0_string, -1, NULL)) || 
+	    (level1_string && !g_utf8_validate (level1_string, -1, NULL)) || 
+	    (level2_string && !g_utf8_validate (level2_string, -1, NULL)) || 
+	    (level3_string && !g_utf8_validate (level3_string, -1, NULL))) 
+	{
+		return;
+	}
+
+	if (*level1_string) 
+	{
+		gok_modifier_add ("shift");
+	        level1_string = g_utf8_strchr (level1_string, -1, '|');
+		if (level1_string) ++level1_string; /* works because '|' is one byte */
+	}
+	if (*level2_string)
+	{
+		gok_modifier_add ("level2");
+	        level2_string = g_utf8_strchr (level2_string, -1, '|');
+		if (level2_string) ++level2_string; /* works because '|' is one byte */
+	}
+	if (*level3_string)
+	{
+		gok_modifier_add ("level3");
+	        level3_string = g_utf8_strchr (level3_string, -1, '|');
+		if (level3_string) ++level3_string; /* works because '|' is one byte */
+	}
+
+	while (*level0_string)
+	{
+		gchar utf8_char[7];
+		pKey = gok_key_new (pKey, NULL, pKeyboard);
+		pKey->has_text = TRUE;
+		pKey->Type = KEYTYPE_NORMAL;
+		pKey->is_repeatable = TRUE;
+		pKey->Style = KEYSTYLE_NORMAL;
+		pKey->FontSize = -1;
+		pKey->FontSizeGroup = FONT_SIZE_GROUP_GLYPH;
+		utf8_char [g_unichar_to_utf8 (g_utf8_get_char (level0_string), utf8_char)] = '\0';
+		gok_keylabel_new (pKey, utf8_char, NULL);
+		pKey->pOutput = gok_output_new (OUTPUT_KEYSTRING, utf8_char, SPI_KEY_STRING);
+		/* FIXME: need this to work for other levels too! */
+		level0_string = g_utf8_find_next_char (level0_string, NULL);
+		if (*level1_string)
+		{
+			utf8_char [g_unichar_to_utf8 (g_utf8_get_char (level1_string), utf8_char)] = '\0';
+			gok_keylabel_new (pKey, utf8_char, "shift");
+			level1_string = g_utf8_find_next_char (level1_string, NULL);
+		}
+		if (*level2_string)
+		{
+			utf8_char [g_unichar_to_utf8 (g_utf8_get_char (level2_string), utf8_char)] = '\0';
+			gok_keylabel_new (pKey, utf8_char, "level2");
+			level2_string = g_utf8_find_next_char (level2_string, NULL);
+		}
+		if (*level3_string)
+		{
+			utf8_char [g_unichar_to_utf8 (g_utf8_get_char (level3_string), utf8_char)] = '\0';
+			gok_keylabel_new (pKey, utf8_char, "level3");
+			level3_string = g_utf8_find_next_char (level3_string, NULL);
+		}
+	}
+}
+
+/**
+ * gok_keyboard_compose_create:
+ *
+ * Creates a new compose (i.e. alphanumeric) keyboard with name
+ * @keyboard_name, including word-completion and 'back' keys if
+ * appropriate in the current GOK context/configuration.
+ **/
+static GokKeyboard*
+gok_keyboard_compose_create (gchar *keyboard_name)
+{
+	GokKeyboard *pKeyboard = gok_keyboard_new ();
 	GokKey *pKey;
-	gok_log_enter();
-	pKeyboard = gok_keyboard_new ();
-	gok_keyboard_set_name (pKeyboard, CORE_KEYBOARD);
+	Accessible *acc_with_text;
+	gok_keyboard_set_name (pKeyboard, _(keyboard_name));
 	pKeyboard->bRequiresLayout = FALSE;
 	pKeyboard->bLaidOut = TRUE;
 	pKeyboard->bSupportsWordCompletion = TRUE;
 	pKeyboard->bSupportsCommandPrediction = FALSE;
-	if (!gok_main_get_login ()) {
+	acc_with_text = gok_spy_get_accessibleWithText ();
+	if (!gok_main_get_login () || 
+	    (acc_with_text && Accessible_getRole (acc_with_text) 
+	     == SPI_ROLE_PASSWORD_TEXT)) 
+	{
 		pKeyboard->bSupportsWordCompletion = FALSE;
 		pKey = gok_key_new (NULL, NULL, pKeyboard);
 		pKey->Type = KEYTYPE_BRANCHBACK;
@@ -431,6 +525,127 @@
 		pKey->Right = 1;
 		gok_keylabel_new (pKey, _("Back"), NULL);
 	}
+	return pKeyboard;
+}
+
+
+/**
+ * gok_keyboard_get_alpha:
+ *
+ * Returns: a pointer to a #GokKeyboard which contains the current locale/LANG's
+ * alphabet in "sorted" (e.g. alphabetical) order.
+ **/
+GokKeyboard*
+gok_keyboard_get_alpha ()
+{
+	GokKeyboard *pKeyboard;
+	GokKey *pKey;
+	gok_log_enter();
+	pKeyboard = gok_keyboard_compose_create (ALPHA_KEYBOARD);
+	/*
+	 * Note to Translators: the following strings should contain your LANG/locale's 
+	 * alphabet or, in the case of LANGs with a very large glyph set, a set of
+	 * character-primitives which can be used to compose your language's character set.
+	 * Each string below corresponds to the characters associated with a particular
+	 * "shift level" in the XKB keyboard definition.
+	 * The prefix before the '|' character is just a context string and need not be
+	 * translated.
+	 *
+	 * For languages where 'case' is used, the first string should contain 
+	 * the lowercase alphabet, the second string the uppercase alphabet.  
+	 * Note that unless your locale clearly requires that digits and/or punctuation
+	 * precede alphabetic characters, we prefer that digits and punctuation are placed 
+	 * at the end of the string for GOK's purposes.
+	 * The third string is not used in the C locale but corresponds to a shift
+	 * level of '2' which is often associated with the AltGr key on physical keyboards.
+	 *
+	 * The order in which punctuation occurs is not critical, but if there is a 
+	 * "standard" layout for your locale's physical keyboards it is nice to place
+	 * the punctuation in the order in which it appears on physical keycaps.
+	 * For instance, since Shift-plus-digits for "1,2,3,4" on a US keyboard 
+	 * produce "!, \", 3, $", etc., it is convenient to list these punctuation marks
+	 * in the same order in the "level 1" string as we do below for the C locale.
+	 *
+	 * For languages
+	 * which use shift or level modifiers to select between different glyphs, the meaning
+	 * of 'level' above, and as interpreted by the X server, may be slightly different.
+	 * If you have questions or comments about the intent of this string please contact
+	 * billh@gnome.org or david.bolter@utoronto.ca for more information.
+	 *
+	 */
+	gok_keyboard_add_keys_from_charstrings (pKeyboard, 
+						_("level 0|abcdefghijklmnopqrstuvwxyz1234567890-=[];'#\\,./"),
+						_("level 1|ABCDEFGHIJKLMNOPQRSTUVWXYZ!\"3$%^&*()_+{}:@~<>?"),
+						_("level 2|"),
+						_("level 3|")); /* no level 2 or 3 in C locale */
+
+
+	pKeyboard->bRequiresLayout = TRUE;
+	pKeyboard->bLaidOut = FALSE;
+	gok_keyboard_count_rows_columns (pKeyboard);
+	gok_log ("created core keyboard with %d rows and %d columns\n",
+		 gok_keyboard_get_number_rows (pKeyboard), 
+		 gok_keyboard_get_number_columns (pKeyboard));
+	gok_log_leave();
+	return pKeyboard;
+}
+
+/**
+ * gok_keyboard_get_alpha_by_frequency:
+ *
+ * Returns: a pointer to a #GokKeyboard which contains the current locale/LANG's
+ * alphabet arranged with the most-frequently-occurring characters at the 
+ * upper left; reduces total user input effort when in scanning input modes.
+ **/
+GokKeyboard *
+gok_keyboard_get_alpha_by_frequency ()
+{
+	/* 
+	 * TODO: Lay out the keys according to scan-operations required, 
+	 *   instead of in the order in which they are added
+	 */
+	GokKeyboard *pKeyboard;
+	GokKey *pKey;
+	gok_log_enter();
+	pKeyboard = gok_keyboard_compose_create (ALPHA_KEYBOARD);
+	/*
+	 * Note to Translators: the following strings should contain your LANG/locale's 
+	 * alphabet or, in the case of LANGs with a very large glyph set, a set of
+	 * character-primitives which can be used to compose your language's character set. 
+	 * This string should contain all of the glyphs in the "level #|abcde..." strings
+	 * but they should appear in 'frequency order', that is, the most frequently occurring
+	 * characters in your locale should appear at the front of the list.
+	 * (Put digits after characters, and punctuation last).
+	 * If level 0 and level 1 refer to upper-and-lower-case in your locale, 
+	 * the characters in these two strings should occur in the same relative order.
+	 */
+	gok_keyboard_add_keys_from_charstrings (pKeyboard, 
+						_("level 0|etaonrishdlfcmugypwbvkxjqz`1234567890-=\\[];'<,./"),
+						_("level 1|ETAONRISHDLFCMUGYPWBVKXJQZ~!@#$%^&*()_+|{}:\"><>?"),
+						_("level 2|\0"),
+						_("level 3|\0")); /* no level 2 or 3 in C locale */
+	pKeyboard->bRequiresLayout = TRUE;
+	pKeyboard->bLaidOut = FALSE;
+	gok_keyboard_count_rows_columns (pKeyboard);
+	gok_log ("created core keyboard with %d rows and %d columns\n",
+		 gok_keyboard_get_number_rows (pKeyboard), 
+		 gok_keyboard_get_number_columns (pKeyboard));
+	gok_log_leave();
+	return pKeyboard;
+}
+
+/**
+* gok_keyboard_get_core:
+*
+* Returns: a pointer to a #GokKeyboard representing the core system 
+* keyboard device, with the same row/column geometry and key symbols.
+**/
+GokKeyboard *
+gok_keyboard_get_core ()
+{
+	GokKeyboard *pKeyboard;
+	gok_log_enter();
+	pKeyboard = gok_keyboard_compose_create (CORE_KEYBOARD);
 	gok_keyboard_add_keys_from_xkb_geom (pKeyboard, 
 					     gok_keyboard_get_xkb_desc ());
 	gok_keyboard_count_rows_columns (pKeyboard);
Index: gok/gok-keyboard.h
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-keyboard.h,v
retrieving revision 1.39
diff -u -r1.39 gok-keyboard.h
--- gok/gok-keyboard.h	30 Jun 2003 12:43:22 -0000	1.39
+++ gok/gok-keyboard.h	26 Sep 2003 07:23:56 -0000
@@ -124,6 +124,8 @@
 GokKeyboard* gok_keyboard_new (void);
 GokKeyboard* gok_keyboard_read (gchar* Filename);
 GokKeyboard* gok_keyboard_get_core (void);
+GokKeyboard* gok_keyboard_get_alpha (void);
+GokKeyboard* gok_keyboard_get_alpha_by_frequency (void);
 Display*     gok_keyboard_get_display (void);
 void gok_keyboard_delete (GokKeyboard* pKeyboard, gboolean bForce);
 void gok_keyboard_delete_key (GokKey* pKey, GokKeyboard* pKeyboard);
Index: gok/gok-scanner.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-scanner.c,v
retrieving revision 1.62
diff -u -r1.62 gok-scanner.c
--- gok/gok-scanner.c	12 Sep 2003 11:54:50 -0000	1.62
+++ gok/gok-scanner.c	26 Sep 2003 07:24:00 -0000
@@ -2142,6 +2142,7 @@
 {
 	m_pKeyEntered = pKey;
 
+	gok_main_raise_window ();
 	gok_scanner_timer_start_dwell();
 		
 	gok_scanner_perform_effects (m_pEffectsOnKeyEnter);
@@ -2411,6 +2412,7 @@
 **/
 void gok_scanner_on_switch1_down ()
 {
+	gok_main_raise_window ();
 	gok_scanner_perform_effects (m_pEffectsOnSwitch1Down);
 }
 
@@ -2431,6 +2433,7 @@
 **/
 void gok_scanner_on_switch2_down ()
 {
+	gok_main_raise_window ();
 	gok_scanner_perform_effects (m_pEffectsOnSwitch2Down);
 }
 
@@ -2451,6 +2454,7 @@
 **/
 void gok_scanner_on_switch3_down ()
 {
+	gok_main_raise_window ();
 	gok_scanner_perform_effects (m_pEffectsOnSwitch3Down);
 }
 
@@ -2471,6 +2475,7 @@
 **/
 void gok_scanner_on_switch4_down ()
 {
+	gok_main_raise_window ();
 	gok_scanner_perform_effects (m_pEffectsOnSwitch4Down);
 }
 
@@ -2491,6 +2496,7 @@
 **/
 void gok_scanner_on_switch5_down ()
 {
+	gok_main_raise_window ();
 	gok_scanner_perform_effects (m_pEffectsOnSwitch5Down);
 }
 
Index: gok/gok-spy.c
===================================================================
RCS file: /cvs/gnome/gok/gok/gok-spy.c,v
retrieving revision 1.91
diff -u -r1.91 gok-spy.c
--- gok/gok-spy.c	28 Aug 2003 14:46:15 -0000	1.91
+++ gok/gok-spy.c	26 Sep 2003 07:24:03 -0000
@@ -1272,7 +1272,6 @@
 	EventNode* en; 
 	gok_log_enter();
 	gok_spy_accessible_ref(event->source);
-	
 	en = (EventNode*)g_malloc(sizeof(EventNode));
 	en->paccessible = event->source;
 	en->type = GOKSPY_FOCUS_EVENT;
Index: gok/main.c
===================================================================
RCS file: /cvs/gnome/gok/gok/main.c,v
retrieving revision 1.111
diff -u -r1.111 main.c
--- gok/main.c	18 Sep 2003 16:01:52 -0000	1.111
+++ gok/main.c	26 Sep 2003 07:24:06 -0000
@@ -641,8 +641,7 @@
 		gok_scanner_start();
 	}
 
-	/* hack to make sure gok is not occluded - seems to be unstable*/
-	gdk_window_raise (m_pWindowMain->window);
+	gok_main_raise_window ();
 
 	gok_log_leave();	
 }
@@ -715,9 +714,8 @@
 
 	if (state == 0)
 	{
-		/* hack to make sure gok is not occluded - TODO: seems to be unstable*/
-		gdk_window_raise (m_pWindowMain->window);
-		
+		gok_main_raise_window ();
+
 		switch (button)
 		{
 			case 1:
@@ -769,6 +767,20 @@
 }
 
 /**
+ * gok_main_raise_window:
+ * hack to make sure gok is not occluded - TODO: seems to be unstable
+ *
+ **/
+void
+gok_main_raise_window (void)
+{
+	if (m_pWindowMain && m_pWindowMain->window) 
+	{
+		gdk_window_raise (m_pWindowMain->window);
+	}
+}
+
+/**
 * gok_main_mouse_button_listener
 * @button: Mouse button number that has changed state.
 * @state: State of the button.
@@ -784,8 +796,7 @@
 
 	if (state == 0)
 	{
-		/* hack to make sure gok is not occluded - TODO: seems to be unstable*/
-		gdk_window_raise (m_pWindowMain->window);
+		gok_main_raise_window ();
 
 		/* TODO: account for reversed button order, which is possible! 
 		 * i.e. leftbutton == 3, etc.
@@ -1126,8 +1137,7 @@
 	gok_scanner_stop();
 
 	/* raise the window as a precaution */
-	if (m_pWindowMain && m_pWindowMain->window)
-		gdk_window_raise (m_pWindowMain->window);
+	gok_main_raise_window ();
 
 	/* create new keys for dynamic keyboards */
 	if (pKeyboard->bDynamicallyCreated == TRUE)
@@ -1364,7 +1374,8 @@
 
 	/* create the default "core" keyboard (aka qwerty keyboard) */
 	if (gok_data_get_use_xkb_kbd ()) {
-		pKeyboard = pKeyboardFirst = gok_keyboard_get_core ();
+		/* pKeyboard = pKeyboardFirst = gok_keyboard_get_core ();*/
+		pKeyboard = pKeyboardFirst = gok_keyboard_get_alpha_by_frequency (); /* TESTING ONLY!!!! */
 		pKeyboard->pKeyboardPrevious = NULL;
 		pKeyboardPrevious = pKeyboard;
 	}
Index: gok/main.h
===================================================================
RCS file: /cvs/gnome/gok/gok/main.h,v
retrieving revision 1.34
diff -u -r1.34 main.h
--- gok/main.h	15 Jul 2003 15:21:05 -0000	1.34
+++ gok/main.h	26 Sep 2003 07:24:06 -0000
@@ -36,6 +36,7 @@
 GtkWidget* gok_main_create_window (gboolean is_dock);
 void gok_main_set_cursor (GdkCursor *cursor);
 gint gok_main_open(gint argc, gchar *argv[]);
+void gok_main_raise_window (void);
 GokKeyboard *gok_main_keyboard_find_byname (const gchar* NameKeyboard);
 gboolean gok_main_display_scan (GokKeyboard* pKeyboard, char* NameKeyboard, KeyboardTypes keyboardType, KeyboardLayouts layoutType);
 gboolean gok_main_display_scan_previous (void);
