summaryrefslogtreecommitdiff
path: root/gdk/win32/gdkim-win32.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>1999-11-08 00:09:29 +0000
committerTor Lillqvist <tml@src.gnome.org>1999-11-08 00:09:29 +0000
commit0ad4aa57d696dbff96e35e571925330afa1ad2d1 (patch)
tree8d5d782a4e903a2dd97c3194ef247bf7ca271465 /gdk/win32/gdkim-win32.c
parent559a8c86912e1cbdf06e6a441a0a6e5576337341 (diff)
downloadgtk+-0ad4aa57d696dbff96e35e571925330afa1ad2d1.tar.gz
New font private structures, related to fontsets.
1999-11-07 Tor Lillqvist <tml@iki.fi> * gdk/win32/gdkprivate.h: New font private structures, related to fontsets. * gdk/win32/gdkfont.c: New functions gdk_font_list_new() and gdk_font_list_free(). On X11, will just be wrappers to XListFonts() and XFreeFontNames(). On Win32, the code previously in gtkfontsel.c is now here. New function gdk_font_xlfd_create(). On X11 will get the FONT property of the font (for GDK_FONT_FONTs), or call XBaseFontNameListOfFontSet (for GDK_FONT_FONTSETs), on Win32 builds a XLFD style name from the font information in the LOGFONT struct(s). New function gdk_font_xlfd_free(), which correspondingly frees the string returned by gdk_font_xlfd_create(). Implement fontsets on Win32. Add a function that iterates over a wide char string and calls a callback function for each substring of wide chars from the same Unicode subrange (and thus probably available in the same real font). Improve the XLFD emulation a bit. * gdk/win32/gdkim.c (gdk_nmbstowchar_ts): Small bugfix. * gdk/win32/gdkevents.c: Workaround for suspected bug on Win2k Beta3, WM_IME_CHAR messages don't seem to contain the composed multi-byte char as with the Active IMM on Win9x. Oh well, handle WM_IME_COMPOSITION with GCS_RESULTSTR instead, use ImmGetCompositionStringW() to get the composed Unicode chars. * gdk/win32/gdkgc.c * gdk/win32/gdkdraw.c: Changes needed because of the font private struct changes. * gdk/win32/gdk.def: Add the new functions.
Diffstat (limited to 'gdk/win32/gdkim-win32.c')
-rw-r--r--gdk/win32/gdkim-win32.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdk/win32/gdkim-win32.c b/gdk/win32/gdkim-win32.c
index 0d55317655..a9083b96e3 100644
--- a/gdk/win32/gdkim-win32.c
+++ b/gdk/win32/gdkim-win32.c
@@ -337,13 +337,15 @@ gdk_nmbstowchar_ts (wchar_t *dest,
gint src_len,
gint dest_max)
{
+ wchar_t *wcp;
guchar *cp, *end;
gint n;
+ wcp = dest;
cp = (guchar *) src;
end = cp + src_len;
n = 0;
- while (cp != end && dest != dest + dest_max)
+ while (cp != end && wcp != dest + dest_max)
{
gint i, mask = 0, len;
guchar c = *cp;
@@ -369,19 +371,19 @@ gdk_nmbstowchar_ts (wchar_t *dest,
if (cp + len > end)
return -1;
- *dest = (cp[0] & mask);
+ *wcp = (cp[0] & mask);
for (i = 1; i < len; i++)
{
if ((cp[i] & 0xc0) != 0x80)
return -1;
- *dest <<= 6;
- *dest |= (cp[i] & 0x3f);
+ *wcp <<= 6;
+ *wcp |= (cp[i] & 0x3f);
}
- if (*dest == 0xFFFF)
+ if (*wcp == 0xFFFF)
return -1;
cp += len;
- dest++;
+ wcp++;
n++;
}
if (cp != end)