diff --git a/ChangeLog b/ChangeLog index c7cc61f552..9a096367ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-03-01 Tor Lillqvist + + * gdk/gdkkeys.c (gdk_keyval_convert_case) + * gdk/x11/gdkkeys-x11.c (gdk_keyval_convert_case): If the keyval + to be converted is one of those that consist of a Unicode + character plus our special flag bit, use the + g_unichar_to{lower,upper} functions (Bug#73112). + + * gdk/gdkkeys.c (gdk_keyval_convert_case): Drop the #ifdefs for + the GDK keysym symbols. As we include gdkkeysyms.h, we know they + are there. And if GDK keysyms some day are added/removed, this + function needs changes, too, anyway. + Fri Mar 1 17:00:28 2002 Owen Taylor * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant) diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index c7cc61f552..9a096367ed 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,16 @@ +2002-03-01 Tor Lillqvist + + * gdk/gdkkeys.c (gdk_keyval_convert_case) + * gdk/x11/gdkkeys-x11.c (gdk_keyval_convert_case): If the keyval + to be converted is one of those that consist of a Unicode + character plus our special flag bit, use the + g_unichar_to{lower,upper} functions (Bug#73112). + + * gdk/gdkkeys.c (gdk_keyval_convert_case): Drop the #ifdefs for + the GDK keysym symbols. As we include gdkkeysyms.h, we know they + are there. And if GDK keysyms some day are added/removed, this + function needs changes, too, anyway. + Fri Mar 1 17:00:28 2002 Owen Taylor * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c7cc61f552..9a096367ed 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +2002-03-01 Tor Lillqvist + + * gdk/gdkkeys.c (gdk_keyval_convert_case) + * gdk/x11/gdkkeys-x11.c (gdk_keyval_convert_case): If the keyval + to be converted is one of those that consist of a Unicode + character plus our special flag bit, use the + g_unichar_to{lower,upper} functions (Bug#73112). + + * gdk/gdkkeys.c (gdk_keyval_convert_case): Drop the #ifdefs for + the GDK keysym symbols. As we include gdkkeysyms.h, we know they + are there. And if GDK keysyms some day are added/removed, this + function needs changes, too, anyway. + Fri Mar 1 17:00:28 2002 Owen Taylor * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant) diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c7cc61f552..9a096367ed 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +2002-03-01 Tor Lillqvist + + * gdk/gdkkeys.c (gdk_keyval_convert_case) + * gdk/x11/gdkkeys-x11.c (gdk_keyval_convert_case): If the keyval + to be converted is one of those that consist of a Unicode + character plus our special flag bit, use the + g_unichar_to{lower,upper} functions (Bug#73112). + + * gdk/gdkkeys.c (gdk_keyval_convert_case): Drop the #ifdefs for + the GDK keysym symbols. As we include gdkkeysyms.h, we know they + are there. And if GDK keysyms some day are added/removed, this + function needs changes, too, anyway. + Fri Mar 1 17:00:28 2002 Owen Taylor * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant) diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c7cc61f552..9a096367ed 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +2002-03-01 Tor Lillqvist + + * gdk/gdkkeys.c (gdk_keyval_convert_case) + * gdk/x11/gdkkeys-x11.c (gdk_keyval_convert_case): If the keyval + to be converted is one of those that consist of a Unicode + character plus our special flag bit, use the + g_unichar_to{lower,upper} functions (Bug#73112). + + * gdk/gdkkeys.c (gdk_keyval_convert_case): Drop the #ifdefs for + the GDK keysym symbols. As we include gdkkeysyms.h, we know they + are there. And if GDK keysyms some day are added/removed, this + function needs changes, too, anyway. + Fri Mar 1 17:00:28 2002 Owen Taylor * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c7cc61f552..9a096367ed 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +2002-03-01 Tor Lillqvist + + * gdk/gdkkeys.c (gdk_keyval_convert_case) + * gdk/x11/gdkkeys-x11.c (gdk_keyval_convert_case): If the keyval + to be converted is one of those that consist of a Unicode + character plus our special flag bit, use the + g_unichar_to{lower,upper} functions (Bug#73112). + + * gdk/gdkkeys.c (gdk_keyval_convert_case): Drop the #ifdefs for + the GDK keysym symbols. As we include gdkkeysyms.h, we know they + are there. And if GDK keysyms some day are added/removed, this + function needs changes, too, anyway. + Fri Mar 1 17:00:28 2002 Owen Taylor * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c7cc61f552..9a096367ed 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +2002-03-01 Tor Lillqvist + + * gdk/gdkkeys.c (gdk_keyval_convert_case) + * gdk/x11/gdkkeys-x11.c (gdk_keyval_convert_case): If the keyval + to be converted is one of those that consist of a Unicode + character plus our special flag bit, use the + g_unichar_to{lower,upper} functions (Bug#73112). + + * gdk/gdkkeys.c (gdk_keyval_convert_case): Drop the #ifdefs for + the GDK keysym symbols. As we include gdkkeysyms.h, we know they + are there. And if GDK keysyms some day are added/removed, this + function needs changes, too, anyway. + Fri Mar 1 17:00:28 2002 Owen Taylor * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant) diff --git a/gdk/gdkkeys.c b/gdk/gdkkeys.c index 03ad2da003..f2607b7ed3 100644 --- a/gdk/gdkkeys.c +++ b/gdk/gdkkeys.c @@ -118,9 +118,18 @@ gdk_keyval_convert_case (guint symbol, guint xlower = symbol; guint xupper = symbol; + /* Check for directly encoded 24-bit UCS characters: */ + if ((symbol & 0xff000000) == 0x01000000) + { + if (lower) + *lower = gdk_unicode_to_keyval (g_unichar_tolower (symbol & 0x00ffffff)); + if (upper) + *upper = gdk_unicode_to_keyval (g_unichar_toupper (symbol & 0x00ffffff)); + return; + } + switch (symbol >> 8) { -#if defined (GDK_A) && defined (GDK_Ooblique) case 0: /* Latin 1 */ if ((symbol >= GDK_A) && (symbol <= GDK_Z)) xlower += (GDK_a - GDK_A); @@ -135,9 +144,7 @@ gdk_keyval_convert_case (guint symbol, else if ((symbol >= GDK_oslash) && (symbol <= GDK_thorn)) xupper -= (GDK_oslash - GDK_Ooblique); break; -#endif /* LATIN1 */ -#if defined (GDK_Aogonek) && defined (GDK_tcedilla) case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (symbol == GDK_Aogonek) @@ -161,9 +168,7 @@ gdk_keyval_convert_case (guint symbol, else if (symbol >= GDK_racute && symbol <= GDK_tcedilla) xupper -= (GDK_racute - GDK_Racute); break; -#endif /* LATIN2 */ -#if defined (GDK_Hstroke) && defined (GDK_Cabovedot) case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (symbol >= GDK_Hstroke && symbol <= GDK_Hcircumflex) @@ -179,9 +184,7 @@ gdk_keyval_convert_case (guint symbol, else if (symbol >= GDK_cabovedot && symbol <= GDK_scircumflex) xupper -= (GDK_cabovedot - GDK_Cabovedot); break; -#endif /* LATIN3 */ -#if defined (GDK_Rcedilla) && defined (GDK_Amacron) case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (symbol >= GDK_Rcedilla && symbol <= GDK_Tslash) @@ -197,9 +200,7 @@ gdk_keyval_convert_case (guint symbol, else if (symbol >= GDK_amacron && symbol <= GDK_umacron) xupper -= (GDK_amacron - GDK_Amacron); break; -#endif /* LATIN4 */ -#if defined (GDK_Serbian_DJE) && defined (GDK_Cyrillic_yu) case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (symbol >= GDK_Serbian_DJE && symbol <= GDK_Serbian_DZE) @@ -211,9 +212,7 @@ gdk_keyval_convert_case (guint symbol, else if (symbol >= GDK_Cyrillic_yu && symbol <= GDK_Cyrillic_hardsign) xupper += (GDK_Cyrillic_YU - GDK_Cyrillic_yu); break; -#endif /* CYRILLIC */ -#if defined (GDK_Greek_ALPHAaccent) && defined (GDK_Greek_finalsmallsigma) case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (symbol >= GDK_Greek_ALPHAaccent && symbol <= GDK_Greek_OMEGAaccent) @@ -228,7 +227,6 @@ gdk_keyval_convert_case (guint symbol, symbol != GDK_Greek_finalsmallsigma) xupper -= (GDK_Greek_alpha - GDK_Greek_ALPHA); break; -#endif /* GREEK */ } if (lower) diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c index 9d2677b44b..027090f2da 100644 --- a/gdk/x11/gdkkeys-x11.c +++ b/gdk/x11/gdkkeys-x11.c @@ -892,6 +892,16 @@ gdk_keyval_convert_case (guint symbol, KeySym xlower = 0; KeySym xupper = 0; + /* Check for directly encoded 24-bit UCS characters: */ + if ((symbol & 0xff000000) == 0x01000000) + { + if (lower) + *lower = gdk_unicode_to_keyval (g_unichar_tolower (symbol & 0x00ffffff)); + if (upper) + *upper = gdk_unicode_to_keyval (g_unichar_toupper (symbol & 0x00ffffff)); + return; + } + if (symbol) XConvertCase (symbol, &xlower, &xupper);