commit -- [patch] replace XLib calls with GDK


Subject: commit -- [patch] replace XLib calls with GDK
From: Paul Rohr (paul@abisource.com)
Date: Wed Mar 22 2000 - 20:45:29 CST


replace XLib calls with GDK, courtesy of Aaron Lehmann <aaronl@vitelus.com>

  M src/af/gr/unix/gr_UnixGraphics.cpp

At 04:20 AM 3/22/00 +0000, Aaron Lehmann wrote:
>People have pointed out that AbiWord on Unix uses a small bit of XLib for
>drawing and measuring text. Since I love playing with GDK, I went ahead
>and wrote a patch to eliminate all use of XLib that I could find. I can't
>detect a visible difference with this patch in speed or quality (and I
>am suprized - I don't know any XLib and I barely know GDK). Anyway, this
>patch probably should be tested a bit before it is commited, but It Works
>Fine Here :). If any GDK work needs to be done in the future, contact
>me... GDK is fun.

The only additional test I could think of was to make sure that hi-bit
unicode characters are getting copied and drawn correctly.

- XChar2b *pNChars = new XChar2b[iLength];
 
+ // Blargh... GDK wants strings in 32 bits, we use 16 internally
+ GdkWChar *pNChars = new GdkWChar[iLength];
+
         for (int i = 0; i < iLength; i++)
     {
- pNChars[i].byte1 = pChars[i + iCharOffset] & 0xff00;
- pNChars[i].byte2 = pChars[i + iCharOffset] & 0x00ff;
+ pNChars[i] = pChars[i + iCharOffset];
     }

Given platform-specific font headaches, the following documents may not be a
definitive test, but it'd sure be a confidence booster:

  abi/test/wp/Spelling.abw
  abi/test/wp/Unicode1.abw

Other than that, this looks like a pretty tight patch, and since Martin
vouched for it, I've gone ahead and committed it.

Paul



This archive was generated by hypermail 2b25 : Wed Mar 22 2000 - 20:39:58 CST