]> Pileus Git - ~andy/gtk/commitdiff
gdk/gdkkeys.c (gdk_keyval_convert_case) If the keyval to be converted is
authorTor Lillqvist <tml@iki.fi>
Fri, 1 Mar 2002 22:09:27 +0000 (22:09 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 1 Mar 2002 22:09:27 +0000 (22:09 +0000)
2002-03-01  Tor Lillqvist  <tml@iki.fi>

* 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.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c

index c7cc61f552b394ee8028cb9e3fb0e1edd1523d59..9a096367ed00f80e0c73a55466bd962271556cf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2002-03-01  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <otaylor@redhat.com>
 
        * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant)
index c7cc61f552b394ee8028cb9e3fb0e1edd1523d59..9a096367ed00f80e0c73a55466bd962271556cf6 100644 (file)
@@ -1,3 +1,16 @@
+2002-03-01  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <otaylor@redhat.com>
 
        * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant)
index c7cc61f552b394ee8028cb9e3fb0e1edd1523d59..9a096367ed00f80e0c73a55466bd962271556cf6 100644 (file)
@@ -1,3 +1,16 @@
+2002-03-01  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <otaylor@redhat.com>
 
        * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant)
index c7cc61f552b394ee8028cb9e3fb0e1edd1523d59..9a096367ed00f80e0c73a55466bd962271556cf6 100644 (file)
@@ -1,3 +1,16 @@
+2002-03-01  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <otaylor@redhat.com>
 
        * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant)
index c7cc61f552b394ee8028cb9e3fb0e1edd1523d59..9a096367ed00f80e0c73a55466bd962271556cf6 100644 (file)
@@ -1,3 +1,16 @@
+2002-03-01  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <otaylor@redhat.com>
 
        * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant)
index c7cc61f552b394ee8028cb9e3fb0e1edd1523d59..9a096367ed00f80e0c73a55466bd962271556cf6 100644 (file)
@@ -1,3 +1,16 @@
+2002-03-01  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <otaylor@redhat.com>
 
        * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant)
index c7cc61f552b394ee8028cb9e3fb0e1edd1523d59..9a096367ed00f80e0c73a55466bd962271556cf6 100644 (file)
@@ -1,3 +1,16 @@
+2002-03-01  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <otaylor@redhat.com>
 
        * gdk/gdkpolyreg-generic.c: Fix some reported (but not significant)
index 03ad2da00390bd9d05dd156de346ae291efe3e17..f2607b7ed354bd9994d3f2f673f6d704299e7a23 100644 (file)
@@ -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)
index 9d2677b44b719d8b9a3dac6e63f7a63ea7ce9a81..027090f2da9786682b504ace73ba5906e7325465 100644 (file)
@@ -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);