[Pkg-sdl-commits] r60 - in unstable/libsdl1.2/debian: . patches

Samuel Hocevar sho at costa.debian.org
Sun May 14 00:37:30 CEST 2006


Author: sho
Date: 2006-05-13 22:37:29 +0000 (Sat, 13 May 2006)
New Revision: 60

Added:
   unstable/libsdl1.2/debian/patches/016_x11_unicode_strings.diff
Modified:
   unstable/libsdl1.2/debian/changelog
   unstable/libsdl1.2/debian/patches/005_x11_keysym_fix.diff
   unstable/libsdl1.2/debian/patches/series
Log:
libsdl1.2 (1.2.9+0-1) unstable; urgency=low

  * debian/patches/005_x11_keysym_fix.diff:
    + Disabled this patch because it breaks numerous programs that assume,
      quite correctly, that a keysym actually represents the physical key
      being pressed (Closes: #347709, #3558870, #358976, #360872).

  * debian/patches/016_x11_unicode_strings.diff:
    + New patch to work around XLookupString() returning an UTF-8 sequence
      instead of the expected Latin-1 value (Closes: #361802).


Modified: unstable/libsdl1.2/debian/changelog
===================================================================
--- unstable/libsdl1.2/debian/changelog	2006-05-13 21:52:12 UTC (rev 59)
+++ unstable/libsdl1.2/debian/changelog	2006-05-13 22:37:29 UTC (rev 60)
@@ -1,4 +1,4 @@
-libsdl1.2 (1.2.9+0-1) UNRELEASED; urgency=low
+libsdl1.2 (1.2.9+0-1) unstable; urgency=low
 
   [ Aurelien Jarno ]
   * debian/control, debian/rules:
@@ -14,8 +14,17 @@
     + Build-depend on quilt instead of dbs.
     + Set policy to 3.7.2.
 
- -- Aurelien Jarno <aurel32 at debian.org>  Tue, 21 Mar 2006 16:53:05 +0100
+  * debian/patches/005_x11_keysym_fix.diff:
+    + Disabled this patch because it breaks numerous programs that assume,
+      quite correctly, that a keysym actually represents the physical key
+      being pressed (Closes: #347709, #3558870, #358976, #360872).
 
+  * debian/patches/016_x11_unicode_strings.diff:
+    + New patch to work around XLookupString() returning an UTF-8 sequence
+      instead of the expected Latin-1 value (Closes: #361802).
+
+ -- Sam Hocevar (Debian packages) <sam+deb at zoy.org>  Sat, 13 May 2006 23:12:38 +0200
+
 libsdl1.2 (1.2.9-5) unstable; urgency=low
 
   [ Sam Hocevar (Debian packages) ]

Modified: unstable/libsdl1.2/debian/patches/005_x11_keysym_fix.diff
===================================================================
--- unstable/libsdl1.2/debian/patches/005_x11_keysym_fix.diff	2006-05-13 21:52:12 UTC (rev 59)
+++ unstable/libsdl1.2/debian/patches/005_x11_keysym_fix.diff	2006-05-13 22:37:29 UTC (rev 60)
@@ -7,13 +7,13 @@
  	/* Get the raw keyboard scancode */
  	keysym->scancode = kc;
 -	xsym = XKeycodeToKeysym(display, kc, 0);
-+	if ( xkey ) {
-+		/* Until we handle the IM protocol, use XLookupString() */
-+		unsigned char keybuf[32];
-+		XLookupString(xkey, keybuf, sizeof(keybuf), &xsym, NULL);
-+	} else {
++//	if ( xkey ) {
++//		/* Until we handle the IM protocol, use XLookupString() */
++//		unsigned char keybuf[32];
++//		XLookupString(xkey, keybuf, sizeof(keybuf), &xsym, NULL);
++//	} else {
 +		xsym = XKeycodeToKeysym(display, kc, 0);
-+	}
++//	}
  #ifdef DEBUG_KEYS
  	fprintf(stderr, "Translating key 0x%.4x (%d)\n", xsym, kc);
  #endif

Added: unstable/libsdl1.2/debian/patches/016_x11_unicode_strings.diff
===================================================================
--- unstable/libsdl1.2/debian/patches/016_x11_unicode_strings.diff	2006-05-13 21:52:12 UTC (rev 59)
+++ unstable/libsdl1.2/debian/patches/016_x11_unicode_strings.diff	2006-05-13 22:37:29 UTC (rev 60)
@@ -0,0 +1,71 @@
+Index: libsdl1.2-1.2.9+0/src/video/x11/SDL_x11events.c
+===================================================================
+--- libsdl1.2-1.2.9+0.orig/src/video/x11/SDL_x11events.c	2006-05-14 00:24:00.000000000 +0200
++++ libsdl1.2-1.2.9+0/src/video/x11/SDL_x11events.c	2006-05-14 00:29:21.000000000 +0200
+@@ -65,6 +65,24 @@
+ SDL_keysym *X11_TranslateKey(Display *display, XKeyEvent *xkey, KeyCode kc,
+ 			     SDL_keysym *keysym);
+ 
++static char const UTF8_trailing[256] =
++{
++    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
++    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
++};
++
++static Uint32 const UTF8_offsets[6] =
++{
++    0x00000000UL, 0x00003080UL, 0x000E2080UL,
++    0x03C82080UL, 0xFA082080UL, 0x82082080UL
++};
++
+ /* Check to see if this is a repeated key.
+    (idea shamelessly lifted from GII -- thanks guys! :)
+  */
+@@ -696,6 +714,7 @@
+ 		static XComposeStatus state;
+ 		/* Until we handle the IM protocol, use XLookupString() */
+ 		unsigned char keybuf[32];
++		int chars;
+ 
+ #define BROKEN_XFREE86_INTERNATIONAL_KBD
+ /* This appears to be a magical flag that is used with AltGr on
+@@ -710,15 +729,25 @@
+ 		}
+ #endif
+ 		/* Look up the translated value for the key event */
+-		if ( XLookupString(xkey, (char *)keybuf, sizeof(keybuf),
+-							NULL, &state) ) {
+-			/*
+-			 * FIXME,: XLookupString() may yield more than one
+-			 * character, so we need a mechanism to allow for
+-			 * this (perhaps generate null keypress events with
+-			 * a unicode value)
+-			 */
++		chars = XLookupString(xkey, (char *)keybuf, sizeof(keybuf),
++							NULL, &state);
++		if ( chars == 1 )
++			/* Latin-1 */
+ 			keysym->unicode = keybuf[0];
++		else if ( chars > 1 ) {
++			/* UTF-8 */
++			int bytes = UTF8_trailing[(int)keybuf[0]];
++			Uint32 u = 0;
++
++			switch(bytes)
++			{
++				case 3: u += (uint8_t)*s++; u <<= 6;
++				case 2: u += (uint8_t)*s++; u <<= 6;
++				case 1: u += (uint8_t)*s++; u <<= 6;
++				case 0: u += (uint8_t)*s++;
++			}
++			
++			keysym->unicode = u - UTF8_offsets[bytes];
+ 		}
+ 	}
+ 	return(keysym);

Modified: unstable/libsdl1.2/debian/patches/series
===================================================================
--- unstable/libsdl1.2/debian/patches/series	2006-05-13 21:52:12 UTC (rev 59)
+++ unstable/libsdl1.2/debian/patches/series	2006-05-13 22:37:29 UTC (rev 60)
@@ -19,3 +19,4 @@
 013_hermes_pic_support.diff
 014_missing_mmx_blit.diff
 015_kfreebsd_gnu.diff
+016_x11_unicode_strings.diff




More information about the Pkg-sdl-commits mailing list