1999-11-11 22:12:27 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
Massive changes. Too many to list here, but I'll try a summary:
2002-02-17 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Massive changes. Too many to list here, but I'll
try a summary:
1) Unify GdkPixmap and GdkImage implementation: For each
GdkPixmap, allocate a GdkImage, and vice versa.
GdkPixmapImplWin32Data has a pointer to the GdkImage.
GdkImage::windowing_data is a pointer to the GdkPixmap.
This simplifies many pixmap and image related functions a lot, and
reduces duplicated code snippets. For instance, there is only one
place in gdk/win32 where CreateDIBSection() is called, in the
function _gdk_win32_new_pixmap(). Converting a bitmap (GdkPixmap)
to a Windows region is almost trivial, with the bitmap bits being
readily accessible in the associated GdkImage.
All blitting between GdkPixmaps, GdkWindows and GdkImages goes
through handled the _gdk_win32_blit() function, which calls
different functions to handle the cases of blitting from pixmaps,
inside windows (scrolling), or from windows, which all require
somewhat different handling.
2) Support 256-color mode. This has long been very broken, now it
works more or less OK. Keep the logical palette for each colormap
as small as possible while allocating and freeing colors. Select
and realize the logical palette associated with a GdkColormap into
a DC before drawing or blitting.
When the display is in 256-color mode, make it possible for the
user to override the size of the palette(s) used with either the
GDK_WIN32_MAX_COLORS environment variable, or a -max-colors
command line option. It is possible to reduce the palette size all
the way down to using just the 16 static colors (which causes the
system visual to be of type GDK_VISUAL_STATIC_COLOR. This could
possibly be useful if one desperately wants to avoid color
flashing. (Note that in order for this to work properly, an as of
yet not commited fix to gdkrgb.c is needed.)
Handle the palette messages. On WM_PALETTECHANGED, call
UpdateColors() for the given window hierarchy. Do this only if a
window in some other top-level window hierarchy caused the palette
change (realized a palette). Do this max five times in a row (an
arbitrarily chosen limit), though, otherwise redraw by generating
expose events. On WM_QUERYNEWPALETTE, cause a redraw of the whole
window hierarchy by generating GDK_EXPOSE events.
3) Code cleanup in general. For instance, remove the "emulated"
X11 structs ColormapStruct, Visual and XStandardColormap. Use the
new GDK_DEBUG_* flags for debugging output in the relevant source
files. Remove the unused colormap hash table in gdkcolor-win32.c
4) Plug some resource leaks.
2002-02-14 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdnd-win32.c (gdk_dropfiles_filter): Use
g_filename_to_uri() to actually create legal URIs in the
text/uri-list data.
2002-02-17 00:25:05 +00:00
|
|
|
* Copyright (C) 1998-2002 Tor Lillqvist
|
1999-11-11 22:12:27 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1999-11-11 22:12:27 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1999-11-11 22:12:27 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1999-11-11 22:12:27 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-11-11 22:12:27 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
1999-11-11 22:12:27 +00:00
|
|
|
#include <stdio.h>
|
2000-10-25 18:07:12 +00:00
|
|
|
#include <stdlib.h>
|
1999-11-11 22:12:27 +00:00
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
#include "gdkfont.h"
|
2001-11-23 16:05:39 +00:00
|
|
|
#include "gdkpango.h" /* gdk_pango_context_get() */
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
#include "gdkdisplay.h"
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
#include "gdkprivate-win32.h"
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
static GHashTable *font_name_hash = NULL;
|
|
|
|
static GHashTable *fontset_name_hash = NULL;
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_font_hash_insert (GdkFontType type,
|
|
|
|
GdkFont *font,
|
|
|
|
const gchar *font_name)
|
|
|
|
{
|
1999-11-19 01:09:13 +00:00
|
|
|
GdkFontPrivateWin32 *private = (GdkFontPrivateWin32 *) font;
|
1999-11-11 22:12:27 +00:00
|
|
|
GHashTable **hashp = (type == GDK_FONT_FONT) ?
|
|
|
|
&font_name_hash : &fontset_name_hash;
|
|
|
|
|
|
|
|
if (!*hashp)
|
|
|
|
*hashp = g_hash_table_new (g_str_hash, g_str_equal);
|
|
|
|
|
|
|
|
private->names = g_slist_prepend (private->names, g_strdup (font_name));
|
|
|
|
g_hash_table_insert (*hashp, private->names->data, font);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_font_hash_remove (GdkFontType type,
|
|
|
|
GdkFont *font)
|
|
|
|
{
|
1999-11-19 01:09:13 +00:00
|
|
|
GdkFontPrivateWin32 *private = (GdkFontPrivateWin32 *) font;
|
1999-11-11 22:12:27 +00:00
|
|
|
GSList *tmp_list;
|
|
|
|
GHashTable *hash = (type == GDK_FONT_FONT) ?
|
|
|
|
font_name_hash : fontset_name_hash;
|
|
|
|
|
|
|
|
tmp_list = private->names;
|
|
|
|
while (tmp_list)
|
|
|
|
{
|
|
|
|
g_hash_table_remove (hash, tmp_list->data);
|
|
|
|
g_free (tmp_list->data);
|
|
|
|
|
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_free (private->names);
|
|
|
|
private->names = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GdkFont *
|
|
|
|
gdk_font_hash_lookup (GdkFontType type,
|
|
|
|
const gchar *font_name)
|
|
|
|
{
|
|
|
|
GdkFont *result;
|
|
|
|
GHashTable *hash = (type == GDK_FONT_FONT) ?
|
|
|
|
font_name_hash : fontset_name_hash;
|
|
|
|
|
|
|
|
if (!hash)
|
|
|
|
return NULL;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result = g_hash_table_lookup (hash, font_name);
|
|
|
|
if (result)
|
|
|
|
gdk_font_ref (result);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-02 15:49:55 +00:00
|
|
|
#ifdef G_ENABLE_DEBUG
|
1999-11-11 22:12:27 +00:00
|
|
|
static const char *
|
|
|
|
charset_name (DWORD charset)
|
|
|
|
{
|
|
|
|
switch (charset)
|
|
|
|
{
|
|
|
|
case ANSI_CHARSET: return "ansi";
|
|
|
|
case DEFAULT_CHARSET: return "default";
|
|
|
|
case SYMBOL_CHARSET: return "symbol";
|
|
|
|
case SHIFTJIS_CHARSET: return "shiftjis";
|
|
|
|
case HANGEUL_CHARSET: return "hangeul";
|
|
|
|
case GB2312_CHARSET: return "gb2312";
|
|
|
|
case CHINESEBIG5_CHARSET: return "big5";
|
|
|
|
case JOHAB_CHARSET: return "johab";
|
|
|
|
case HEBREW_CHARSET: return "hebrew";
|
|
|
|
case ARABIC_CHARSET: return "arabic";
|
|
|
|
case GREEK_CHARSET: return "greek";
|
|
|
|
case TURKISH_CHARSET: return "turkish";
|
|
|
|
case VIETNAMESE_CHARSET: return "vietnamese";
|
|
|
|
case THAI_CHARSET: return "thai";
|
|
|
|
case EASTEUROPE_CHARSET: return "easteurope";
|
|
|
|
case RUSSIAN_CHARSET: return "russian";
|
|
|
|
case MAC_CHARSET: return "mac";
|
|
|
|
case BALTIC_CHARSET: return "baltic";
|
|
|
|
}
|
|
|
|
return "unknown";
|
|
|
|
}
|
2011-11-02 15:49:55 +00:00
|
|
|
#endif
|
1999-11-11 22:12:27 +00:00
|
|
|
|
1999-11-25 00:27:11 +00:00
|
|
|
/* This table classifies Unicode characters according to the Microsoft
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
* Unicode subset numbering. This is based on the table in "Developing
|
1999-11-25 00:27:11 +00:00
|
|
|
* International Software for Windows 95 and Windows NT". This is almost,
|
|
|
|
* but not quite, the same as the official Unicode block table in
|
|
|
|
* Blocks.txt from ftp.unicode.org. The bit number field is the bitfield
|
|
|
|
* number as in the FONTSIGNATURE struct's fsUsb field.
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
* There are some grave bugs in the table in the books. For instance
|
2000-07-11 21:42:15 +00:00
|
|
|
* it claims there are Hangul at U+3400..U+4DFF while this range in
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
* fact contains CJK Unified Ideographs Extension A. Also, the whole
|
|
|
|
* block of Hangul Syllables U+AC00..U+D7A3 is missing from the book.
|
1999-11-25 00:27:11 +00:00
|
|
|
*/
|
1999-12-05 23:26:46 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
U_BASIC_LATIN = 0,
|
|
|
|
U_LATIN_1_SUPPLEMENT = 1,
|
|
|
|
U_LATIN_EXTENDED_A = 2,
|
|
|
|
U_LATIN_EXTENDED_B = 3,
|
|
|
|
U_IPA_EXTENSIONS = 4,
|
|
|
|
U_SPACING_MODIFIER_LETTERS = 5,
|
|
|
|
U_COMBINING_DIACRITICAL_MARKS = 6,
|
|
|
|
U_BASIC_GREEK = 7,
|
|
|
|
U_GREEK_SYMBOLS_AND_COPTIC = 8,
|
|
|
|
U_CYRILLIC = 9,
|
|
|
|
U_ARMENIAN = 10,
|
|
|
|
U_HEBREW_EXTENDED = 12,
|
|
|
|
U_BASIC_HEBREW = 11,
|
|
|
|
U_BASIC_ARABIC = 13,
|
|
|
|
U_ARABIC_EXTENDED = 14,
|
|
|
|
U_DEVANAGARI = 15,
|
|
|
|
U_BENGALI = 16,
|
|
|
|
U_GURMUKHI = 17,
|
|
|
|
U_GUJARATI = 18,
|
|
|
|
U_ORIYA = 19,
|
|
|
|
U_TAMIL = 20,
|
|
|
|
U_TELUGU = 21,
|
|
|
|
U_KANNADA = 22,
|
|
|
|
U_MALAYALAM = 23,
|
|
|
|
U_THAI = 24,
|
|
|
|
U_LAO = 25,
|
|
|
|
U_GEORGIAN_EXTENDED = 27,
|
|
|
|
U_BASIC_GEORGIAN = 26,
|
|
|
|
U_HANGUL_JAMO = 28,
|
|
|
|
U_LATIN_EXTENDED_ADDITIONAL = 29,
|
|
|
|
U_GREEK_EXTENDED = 30,
|
|
|
|
U_GENERAL_PUNCTUATION = 31,
|
|
|
|
U_SUPERSCRIPTS_AND_SUBSCRIPTS = 32,
|
|
|
|
U_CURRENCY_SYMBOLS = 33,
|
|
|
|
U_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS = 34,
|
|
|
|
U_LETTERLIKE_SYMBOLS = 35,
|
|
|
|
U_NUMBER_FORMS = 36,
|
|
|
|
U_ARROWS = 37,
|
|
|
|
U_MATHEMATICAL_OPERATORS = 38,
|
|
|
|
U_MISCELLANEOUS_TECHNICAL = 39,
|
|
|
|
U_CONTROL_PICTURES = 40,
|
|
|
|
U_OPTICAL_CHARACTER_RECOGNITION = 41,
|
|
|
|
U_ENCLOSED_ALPHANUMERICS = 42,
|
|
|
|
U_BOX_DRAWING = 43,
|
|
|
|
U_BLOCK_ELEMENTS = 44,
|
|
|
|
U_GEOMETRIC_SHAPES = 45,
|
|
|
|
U_MISCELLANEOUS_SYMBOLS = 46,
|
|
|
|
U_DINGBATS = 47,
|
|
|
|
U_CJK_SYMBOLS_AND_PUNCTUATION = 48,
|
|
|
|
U_HIRAGANA = 49,
|
|
|
|
U_KATAKANA = 50,
|
|
|
|
U_BOPOMOFO = 51,
|
|
|
|
U_HANGUL_COMPATIBILITY_JAMO = 52,
|
|
|
|
U_CJK_MISCELLANEOUS = 53,
|
|
|
|
U_ENCLOSED_CJK = 54,
|
|
|
|
U_CJK_COMPATIBILITY = 55,
|
|
|
|
U_HANGUL = 56,
|
|
|
|
U_HANGUL_SUPPLEMENTARY_A = 57,
|
|
|
|
U_HANGUL_SUPPLEMENTARY_B = 58,
|
|
|
|
U_CJK_UNIFIED_IDEOGRAPHS = 59,
|
|
|
|
U_PRIVATE_USE_AREA = 60,
|
|
|
|
U_CJK_COMPATIBILITY_IDEOGRAPHS = 61,
|
|
|
|
U_ALPHABETIC_PRESENTATION_FORMS = 62,
|
|
|
|
U_ARABIC_PRESENTATION_FORMS_A = 63,
|
|
|
|
U_COMBINING_HALF_MARKS = 64,
|
|
|
|
U_CJK_COMPATIBILITY_FORMS = 65,
|
|
|
|
U_SMALL_FORM_VARIANTS = 66,
|
|
|
|
U_ARABIC_PRESENTATION_FORMS_B = 67,
|
|
|
|
U_SPECIALS = 69,
|
1999-12-12 01:32:53 +00:00
|
|
|
U_HALFWIDTH_AND_FULLWIDTH_FORMS = 68,
|
|
|
|
U_LAST_PLUS_ONE
|
1999-12-05 23:26:46 +00:00
|
|
|
} unicode_subset;
|
|
|
|
|
1999-11-25 00:27:11 +00:00
|
|
|
static struct {
|
|
|
|
wchar_t low, high;
|
1999-12-05 23:26:46 +00:00
|
|
|
unicode_subset bit;
|
1999-11-25 00:27:11 +00:00
|
|
|
gchar *name;
|
|
|
|
} utab[] =
|
|
|
|
{
|
1999-12-05 23:26:46 +00:00
|
|
|
{ 0x0000, 0x007E,
|
|
|
|
U_BASIC_LATIN, "Basic Latin" },
|
|
|
|
{ 0x00A0, 0x00FF,
|
|
|
|
U_LATIN_1_SUPPLEMENT, "Latin-1 Supplement" },
|
|
|
|
{ 0x0100, 0x017F,
|
|
|
|
U_LATIN_EXTENDED_A, "Latin Extended-A" },
|
|
|
|
{ 0x0180, 0x024F,
|
|
|
|
U_LATIN_EXTENDED_B, "Latin Extended-B" },
|
|
|
|
{ 0x0250, 0x02AF,
|
|
|
|
U_IPA_EXTENSIONS, "IPA Extensions" },
|
|
|
|
{ 0x02B0, 0x02FF,
|
|
|
|
U_SPACING_MODIFIER_LETTERS, "Spacing Modifier Letters" },
|
|
|
|
{ 0x0300, 0x036F,
|
|
|
|
U_COMBINING_DIACRITICAL_MARKS, "Combining Diacritical Marks" },
|
|
|
|
{ 0x0370, 0x03CF,
|
|
|
|
U_BASIC_GREEK, "Basic Greek" },
|
|
|
|
{ 0x03D0, 0x03FF,
|
|
|
|
U_GREEK_SYMBOLS_AND_COPTIC, "Greek Symbols and Coptic" },
|
|
|
|
{ 0x0400, 0x04FF,
|
|
|
|
U_CYRILLIC, "Cyrillic" },
|
|
|
|
{ 0x0530, 0x058F,
|
|
|
|
U_ARMENIAN, "Armenian" },
|
|
|
|
{ 0x0590, 0x05CF,
|
|
|
|
U_HEBREW_EXTENDED, "Hebrew Extended" },
|
|
|
|
{ 0x05D0, 0x05FF,
|
|
|
|
U_BASIC_HEBREW, "Basic Hebrew" },
|
|
|
|
{ 0x0600, 0x0652,
|
|
|
|
U_BASIC_ARABIC, "Basic Arabic" },
|
|
|
|
{ 0x0653, 0x06FF,
|
|
|
|
U_ARABIC_EXTENDED, "Arabic Extended" },
|
|
|
|
{ 0x0900, 0x097F,
|
|
|
|
U_DEVANAGARI, "Devanagari" },
|
|
|
|
{ 0x0980, 0x09FF,
|
|
|
|
U_BENGALI, "Bengali" },
|
|
|
|
{ 0x0A00, 0x0A7F,
|
|
|
|
U_GURMUKHI, "Gurmukhi" },
|
|
|
|
{ 0x0A80, 0x0AFF,
|
|
|
|
U_GUJARATI, "Gujarati" },
|
|
|
|
{ 0x0B00, 0x0B7F,
|
|
|
|
U_ORIYA, "Oriya" },
|
|
|
|
{ 0x0B80, 0x0BFF,
|
|
|
|
U_TAMIL, "Tamil" },
|
|
|
|
{ 0x0C00, 0x0C7F,
|
|
|
|
U_TELUGU, "Telugu" },
|
|
|
|
{ 0x0C80, 0x0CFF,
|
|
|
|
U_KANNADA, "Kannada" },
|
|
|
|
{ 0x0D00, 0x0D7F,
|
|
|
|
U_MALAYALAM, "Malayalam" },
|
|
|
|
{ 0x0E00, 0x0E7F,
|
|
|
|
U_THAI, "Thai" },
|
|
|
|
{ 0x0E80, 0x0EFF,
|
|
|
|
U_LAO, "Lao" },
|
|
|
|
{ 0x10A0, 0x10CF,
|
|
|
|
U_GEORGIAN_EXTENDED, "Georgian Extended" },
|
|
|
|
{ 0x10D0, 0x10FF,
|
|
|
|
U_BASIC_GEORGIAN, "Basic Georgian" },
|
|
|
|
{ 0x1100, 0x11FF,
|
|
|
|
U_HANGUL_JAMO, "Hangul Jamo" },
|
|
|
|
{ 0x1E00, 0x1EFF,
|
|
|
|
U_LATIN_EXTENDED_ADDITIONAL, "Latin Extended Additional" },
|
|
|
|
{ 0x1F00, 0x1FFF,
|
|
|
|
U_GREEK_EXTENDED, "Greek Extended" },
|
|
|
|
{ 0x2000, 0x206F,
|
|
|
|
U_GENERAL_PUNCTUATION, "General Punctuation" },
|
|
|
|
{ 0x2070, 0x209F,
|
|
|
|
U_SUPERSCRIPTS_AND_SUBSCRIPTS, "Superscripts and Subscripts" },
|
|
|
|
{ 0x20A0, 0x20CF,
|
|
|
|
U_CURRENCY_SYMBOLS, "Currency Symbols" },
|
|
|
|
{ 0x20D0, 0x20FF,
|
|
|
|
U_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS, "Combining Diacritical Marks for Symbols" },
|
|
|
|
{ 0x2100, 0x214F,
|
|
|
|
U_LETTERLIKE_SYMBOLS, "Letterlike Symbols" },
|
|
|
|
{ 0x2150, 0x218F,
|
|
|
|
U_NUMBER_FORMS, "Number Forms" },
|
|
|
|
{ 0x2190, 0x21FF,
|
|
|
|
U_ARROWS, "Arrows" },
|
|
|
|
{ 0x2200, 0x22FF,
|
|
|
|
U_MATHEMATICAL_OPERATORS, "Mathematical Operators" },
|
|
|
|
{ 0x2300, 0x23FF,
|
|
|
|
U_MISCELLANEOUS_TECHNICAL, "Miscellaneous Technical" },
|
|
|
|
{ 0x2400, 0x243F,
|
|
|
|
U_CONTROL_PICTURES, "Control Pictures" },
|
|
|
|
{ 0x2440, 0x245F,
|
|
|
|
U_OPTICAL_CHARACTER_RECOGNITION, "Optical Character Recognition" },
|
|
|
|
{ 0x2460, 0x24FF,
|
|
|
|
U_ENCLOSED_ALPHANUMERICS, "Enclosed Alphanumerics" },
|
|
|
|
{ 0x2500, 0x257F,
|
|
|
|
U_BOX_DRAWING, "Box Drawing" },
|
|
|
|
{ 0x2580, 0x259F,
|
|
|
|
U_BLOCK_ELEMENTS, "Block Elements" },
|
|
|
|
{ 0x25A0, 0x25FF,
|
|
|
|
U_GEOMETRIC_SHAPES, "Geometric Shapes" },
|
|
|
|
{ 0x2600, 0x26FF,
|
|
|
|
U_MISCELLANEOUS_SYMBOLS, "Miscellaneous Symbols" },
|
|
|
|
{ 0x2700, 0x27BF,
|
|
|
|
U_DINGBATS, "Dingbats" },
|
|
|
|
{ 0x3000, 0x303F,
|
|
|
|
U_CJK_SYMBOLS_AND_PUNCTUATION, "CJK Symbols and Punctuation" },
|
|
|
|
{ 0x3040, 0x309F,
|
|
|
|
U_HIRAGANA, "Hiragana" },
|
|
|
|
{ 0x30A0, 0x30FF,
|
|
|
|
U_KATAKANA, "Katakana" },
|
|
|
|
{ 0x3100, 0x312F,
|
|
|
|
U_BOPOMOFO, "Bopomofo" },
|
|
|
|
{ 0x3130, 0x318F,
|
|
|
|
U_HANGUL_COMPATIBILITY_JAMO, "Hangul Compatibility Jamo" },
|
|
|
|
{ 0x3190, 0x319F,
|
|
|
|
U_CJK_MISCELLANEOUS, "CJK Miscellaneous" },
|
|
|
|
{ 0x3200, 0x32FF,
|
|
|
|
U_ENCLOSED_CJK, "Enclosed CJK" },
|
|
|
|
{ 0x3300, 0x33FF,
|
|
|
|
U_CJK_COMPATIBILITY, "CJK Compatibility" },
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
/* The book claims:
|
|
|
|
* U+3400..U+3D2D = Hangul
|
|
|
|
* U+3D2E..U+44B7 = Hangul Supplementary A
|
|
|
|
* U+44B8..U+4DFF = Hangul Supplementary B
|
|
|
|
* but actually in Unicode
|
|
|
|
* U+3400..U+4DB5 = CJK Unified Ideographs Extension A
|
|
|
|
*/
|
|
|
|
{ 0x3400, 0x4DB5,
|
|
|
|
U_CJK_UNIFIED_IDEOGRAPHS, "CJK Unified Ideographs Extension A" },
|
1999-12-05 23:26:46 +00:00
|
|
|
{ 0x4E00, 0x9FFF,
|
|
|
|
U_CJK_UNIFIED_IDEOGRAPHS, "CJK Unified Ideographs" },
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
/* This was missing completely from the book's table. */
|
|
|
|
{ 0xAC00, 0xD7A3,
|
|
|
|
U_HANGUL, "Hangul Syllables" },
|
1999-12-05 23:26:46 +00:00
|
|
|
{ 0xE000, 0xF8FF,
|
|
|
|
U_PRIVATE_USE_AREA, "Private Use Area" },
|
|
|
|
{ 0xF900, 0xFAFF,
|
|
|
|
U_CJK_COMPATIBILITY_IDEOGRAPHS, "CJK Compatibility Ideographs" },
|
|
|
|
{ 0xFB00, 0xFB4F,
|
|
|
|
U_ALPHABETIC_PRESENTATION_FORMS, "Alphabetic Presentation Forms" },
|
|
|
|
{ 0xFB50, 0xFDFF,
|
|
|
|
U_ARABIC_PRESENTATION_FORMS_A, "Arabic Presentation Forms-A" },
|
|
|
|
{ 0xFE20, 0xFE2F,
|
|
|
|
U_COMBINING_HALF_MARKS, "Combining Half Marks" },
|
|
|
|
{ 0xFE30, 0xFE4F,
|
|
|
|
U_CJK_COMPATIBILITY_FORMS, "CJK Compatibility Forms" },
|
|
|
|
{ 0xFE50, 0xFE6F,
|
|
|
|
U_SMALL_FORM_VARIANTS, "Small Form Variants" },
|
|
|
|
{ 0xFE70, 0xFEFE,
|
|
|
|
U_ARABIC_PRESENTATION_FORMS_B, "Arabic Presentation Forms-B" },
|
|
|
|
{ 0xFEFF, 0xFEFF,
|
|
|
|
U_SPECIALS, "Specials" },
|
|
|
|
{ 0xFF00, 0xFFEF,
|
|
|
|
U_HALFWIDTH_AND_FULLWIDTH_FORMS, "Halfwidth and Fullwidth Forms" },
|
|
|
|
{ 0xFFF0, 0xFFFD,
|
|
|
|
U_SPECIALS, "Specials" }
|
1999-11-25 00:27:11 +00:00
|
|
|
};
|
|
|
|
|
2011-11-02 15:49:55 +00:00
|
|
|
#ifdef G_ENABLE_DEBUG
|
1999-11-25 00:27:11 +00:00
|
|
|
static void
|
|
|
|
print_unicode_subranges (FONTSIGNATURE *fsp)
|
|
|
|
{
|
|
|
|
int i;
|
2001-12-28 21:52:04 +00:00
|
|
|
gboolean checked[G_N_ELEMENTS (utab)];
|
1999-11-25 00:27:11 +00:00
|
|
|
gboolean need_comma = FALSE;
|
|
|
|
|
|
|
|
memset (checked, 0, sizeof (checked));
|
|
|
|
|
2001-12-28 21:52:04 +00:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (utab); i++)
|
1999-11-25 00:27:11 +00:00
|
|
|
if (!checked[i]
|
|
|
|
&& (fsp->fsUsb[utab[i].bit/32] & (1 << (utab[i].bit % 32))))
|
|
|
|
{
|
|
|
|
g_print ("%s %s", (need_comma ? "," : ""), utab[i].name);
|
|
|
|
need_comma = TRUE;
|
|
|
|
checked[i] = TRUE;
|
|
|
|
}
|
1999-12-05 23:26:46 +00:00
|
|
|
if (!need_comma)
|
|
|
|
g_print (" none!");
|
1999-11-25 00:27:11 +00:00
|
|
|
g_print ("\n");
|
|
|
|
}
|
2011-11-02 15:49:55 +00:00
|
|
|
#endif
|
1999-11-25 00:27:11 +00:00
|
|
|
|
1999-12-05 23:26:46 +00:00
|
|
|
static gboolean
|
|
|
|
check_unicode_subranges (UINT charset,
|
|
|
|
FONTSIGNATURE *fsp)
|
|
|
|
{
|
1999-12-12 01:32:53 +00:00
|
|
|
gint i;
|
1999-12-05 23:26:46 +00:00
|
|
|
gboolean retval = FALSE;
|
|
|
|
|
1999-12-12 01:32:53 +00:00
|
|
|
/* If the fsUsb bit array has at least one of the bits set, trust it */
|
|
|
|
for (i = 0; i < U_LAST_PLUS_ONE; i++)
|
|
|
|
if (i != U_PRIVATE_USE_AREA && (fsp->fsUsb[i/32] & (1 << (i % 32))))
|
|
|
|
return FALSE;
|
1999-12-05 23:26:46 +00:00
|
|
|
|
|
|
|
/* Otherwise, guess what subranges there should be in the font */
|
|
|
|
fsp->fsUsb[0] = fsp->fsUsb[1] = fsp->fsUsb[2] = fsp->fsUsb[3] = 0;
|
|
|
|
|
|
|
|
#define set_bit(bitno) (fsp->fsUsb[(bitno)/32] |= (1 << ((bitno) % 32)))
|
|
|
|
|
|
|
|
/* Set Unicode subrange bits based on code pages supported.
|
|
|
|
* This is mostly just guesswork.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define check_cp(bit) (fsp->fsCsb[0] & (bit))
|
|
|
|
|
|
|
|
if (check_cp(FS_LATIN1))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_LATIN2))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_CYRILLIC))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_CYRILLIC);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_GREEK))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_TURKISH))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_HEBREW))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
set_bit (U_BASIC_HEBREW);
|
|
|
|
set_bit (U_HEBREW_EXTENDED);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_ARABIC))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
set_bit (U_BASIC_ARABIC);
|
|
|
|
set_bit (U_ARABIC_EXTENDED);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_BALTIC))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_VIETNAMESE))
|
|
|
|
{
|
|
|
|
/* ??? */
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_THAI))
|
|
|
|
{
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_THAI);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_JISJAPAN))
|
|
|
|
{
|
|
|
|
/* Based on MS Gothic */
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_CJK_SYMBOLS_AND_PUNCTUATION);
|
|
|
|
set_bit (U_HIRAGANA);
|
|
|
|
set_bit (U_KATAKANA);
|
|
|
|
set_bit (U_CJK_UNIFIED_IDEOGRAPHS);
|
|
|
|
set_bit (U_HALFWIDTH_AND_FULLWIDTH_FORMS);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_CHINESESIMP))
|
|
|
|
{
|
|
|
|
/* Based on MS Hei */
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_HIRAGANA);
|
|
|
|
set_bit (U_KATAKANA);
|
|
|
|
set_bit (U_BOPOMOFO);
|
|
|
|
set_bit (U_CJK_UNIFIED_IDEOGRAPHS);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_WANSUNG)
|
|
|
|
|| check_cp (FS_JOHAB)) /* ??? */
|
|
|
|
{
|
|
|
|
/* Based on GulimChe. I wonder if all Korean fonts
|
|
|
|
* really support this large range of Unicode subranges?
|
|
|
|
*/
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_SPACING_MODIFIER_LETTERS);
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
set_bit (U_CYRILLIC);
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
set_bit (U_HANGUL_JAMO);
|
1999-12-05 23:26:46 +00:00
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_SUPERSCRIPTS_AND_SUBSCRIPTS);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_NUMBER_FORMS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_ENCLOSED_ALPHANUMERICS);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
set_bit (U_CJK_SYMBOLS_AND_PUNCTUATION);
|
|
|
|
set_bit (U_HIRAGANA);
|
|
|
|
set_bit (U_KATAKANA);
|
|
|
|
set_bit (U_HANGUL_COMPATIBILITY_JAMO);
|
|
|
|
set_bit (U_ENCLOSED_CJK);
|
|
|
|
set_bit (U_CJK_COMPATIBILITY_FORMS);
|
|
|
|
set_bit (U_HANGUL);
|
|
|
|
set_bit (U_CJK_UNIFIED_IDEOGRAPHS);
|
|
|
|
set_bit (U_CJK_COMPATIBILITY_IDEOGRAPHS);
|
|
|
|
set_bit (U_HALFWIDTH_AND_FULLWIDTH_FORMS);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_CHINESETRAD))
|
|
|
|
{
|
|
|
|
/* Based on MingLiU */
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_CJK_SYMBOLS_AND_PUNCTUATION);
|
|
|
|
set_bit (U_BOPOMOFO);
|
|
|
|
set_bit (U_CJK_UNIFIED_IDEOGRAPHS);
|
|
|
|
set_bit (U_CJK_COMPATIBILITY_IDEOGRAPHS);
|
|
|
|
set_bit (U_SMALL_FORM_VARIANTS);
|
|
|
|
set_bit (U_HALFWIDTH_AND_FULLWIDTH_FORMS);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
|
|
|
if (check_cp (FS_SYMBOL) || charset == MAC_CHARSET)
|
|
|
|
{
|
|
|
|
/* Non-Unicode encoding, I guess. Pretend it covers
|
|
|
|
* the single-byte range of values.
|
|
|
|
*/
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
retval = TRUE;
|
|
|
|
}
|
1999-12-12 01:32:53 +00:00
|
|
|
|
|
|
|
if (retval)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
GDK_NOTE (MISC, g_print ("... No code page bits set!\n"));
|
|
|
|
|
|
|
|
/* Sigh. Not even any code page bits were set. Guess based on
|
|
|
|
* charset, then. These somewhat optimistic guesses are based on the
|
|
|
|
* table in Appendix M in the book "Developing ..." mentioned
|
|
|
|
* above.
|
1999-12-05 23:26:46 +00:00
|
|
|
*/
|
|
|
|
switch (charset)
|
|
|
|
{
|
|
|
|
case ANSI_CHARSET:
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
set_bit (U_SPACING_MODIFIER_LETTERS);
|
|
|
|
set_bit (U_COMBINING_DIACRITICAL_MARKS);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_SUPERSCRIPTS_AND_SUBSCRIPTS);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
#if 0 /* I find this too hard to believe... */
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
set_bit (U_CYRILLIC);
|
|
|
|
set_bit (U_BASIC_HEBREW);
|
|
|
|
set_bit (U_HEBREW_EXTENDED);
|
|
|
|
set_bit (U_BASIC_ARABIC);
|
|
|
|
set_bit (U_ARABIC_EXTENDED);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_NUMBER_FORMS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_ENCLOSED_ALPHANUMERICS);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
set_bit (U_HIRAGANA);
|
|
|
|
set_bit (U_KATAKANA);
|
|
|
|
set_bit (U_BOPOMOFO);
|
|
|
|
set_bit (U_HANGUL_COMPATIBILITY_JAMO);
|
|
|
|
set_bit (U_CJK_MISCELLANEOUS);
|
|
|
|
set_bit (U_CJK_COMPATIBILITY);
|
|
|
|
set_bit (U_HANGUL);
|
|
|
|
set_bit (U_HANGUL_SUPPLEMENTARY_A);
|
|
|
|
set_bit (U_CJK_COMPATIBILITY_IDEOGRAPHS);
|
|
|
|
set_bit (U_ALPHABETIC_PRESENTATION_FORMS);
|
|
|
|
set_bit (U_SMALL_FORM_VARIANTS);
|
|
|
|
set_bit (U_ARABIC_PRESENTATION_FORMS_B);
|
|
|
|
set_bit (U_HALFWIDTH_AND_FULLWIDTH_FORMS);
|
|
|
|
set_bit (U_SPECIALS);
|
|
|
|
#endif
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case SYMBOL_CHARSET:
|
|
|
|
/* Unggh */
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case SHIFTJIS_CHARSET:
|
|
|
|
case HANGEUL_CHARSET:
|
|
|
|
case GB2312_CHARSET:
|
|
|
|
case CHINESEBIG5_CHARSET:
|
|
|
|
case JOHAB_CHARSET:
|
|
|
|
/* The table really does claim these "locales" (it doesn't
|
|
|
|
* talk about charsets per se) cover the same Unicode
|
|
|
|
* subranges
|
|
|
|
*/
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
set_bit (U_SPACING_MODIFIER_LETTERS);
|
|
|
|
set_bit (U_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS);
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
set_bit (U_CYRILLIC);
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
set_bit (U_HANGUL_JAMO);
|
1999-12-05 23:26:46 +00:00
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_SUPERSCRIPTS_AND_SUBSCRIPTS);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_NUMBER_FORMS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_ENCLOSED_ALPHANUMERICS);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
set_bit (U_CJK_SYMBOLS_AND_PUNCTUATION);
|
|
|
|
set_bit (U_HIRAGANA);
|
|
|
|
set_bit (U_KATAKANA);
|
|
|
|
set_bit (U_BOPOMOFO);
|
|
|
|
set_bit (U_HANGUL_COMPATIBILITY_JAMO);
|
|
|
|
set_bit (U_CJK_MISCELLANEOUS);
|
|
|
|
set_bit (U_CJK_COMPATIBILITY);
|
|
|
|
set_bit (U_HANGUL);
|
|
|
|
set_bit (U_HANGUL_SUPPLEMENTARY_A);
|
|
|
|
set_bit (U_CJK_UNIFIED_IDEOGRAPHS);
|
|
|
|
set_bit (U_CJK_COMPATIBILITY_IDEOGRAPHS);
|
|
|
|
set_bit (U_ALPHABETIC_PRESENTATION_FORMS);
|
|
|
|
set_bit (U_SMALL_FORM_VARIANTS);
|
|
|
|
set_bit (U_ARABIC_PRESENTATION_FORMS_B);
|
|
|
|
set_bit (U_SPECIALS);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case HEBREW_CHARSET:
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
set_bit (U_SPACING_MODIFIER_LETTERS);
|
|
|
|
set_bit (U_BASIC_HEBREW);
|
|
|
|
set_bit (U_HEBREW_EXTENDED);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case ARABIC_CHARSET:
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
set_bit (U_SPACING_MODIFIER_LETTERS);
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
set_bit (U_BASIC_ARABIC);
|
|
|
|
set_bit (U_ARABIC_EXTENDED);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
set_bit (U_HALFWIDTH_AND_FULLWIDTH_FORMS);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case GREEK_CHARSET:
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_SUPERSCRIPTS_AND_SUBSCRIPTS);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case TURKISH_CHARSET:
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
set_bit (U_SPACING_MODIFIER_LETTERS);
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_SUPERSCRIPTS_AND_SUBSCRIPTS);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case VIETNAMESE_CHARSET:
|
|
|
|
case THAI_CHARSET:
|
|
|
|
/* These are not in the table, so I have no idea */
|
|
|
|
break;
|
|
|
|
case BALTIC_CHARSET:
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
set_bit (U_SPACING_MODIFIER_LETTERS);
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_SUPERSCRIPTS_AND_SUBSCRIPTS);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case EASTEUROPE_CHARSET:
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_LATIN_EXTENDED_A);
|
|
|
|
set_bit (U_LATIN_EXTENDED_B);
|
|
|
|
set_bit (U_SPACING_MODIFIER_LETTERS);
|
|
|
|
set_bit (U_BASIC_GREEK);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_SUPERSCRIPTS_AND_SUBSCRIPTS);
|
|
|
|
set_bit (U_CURRENCY_SYMBOLS);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
case RUSSIAN_CHARSET:
|
|
|
|
set_bit (U_BASIC_LATIN);
|
|
|
|
set_bit (U_LATIN_1_SUPPLEMENT);
|
|
|
|
set_bit (U_CYRILLIC);
|
|
|
|
set_bit (U_GENERAL_PUNCTUATION);
|
|
|
|
set_bit (U_LETTERLIKE_SYMBOLS);
|
|
|
|
set_bit (U_ARROWS);
|
|
|
|
set_bit (U_MATHEMATICAL_OPERATORS);
|
|
|
|
set_bit (U_MISCELLANEOUS_TECHNICAL);
|
|
|
|
set_bit (U_BOX_DRAWING);
|
|
|
|
set_bit (U_BLOCK_ELEMENTS);
|
|
|
|
set_bit (U_GEOMETRIC_SHAPES);
|
|
|
|
set_bit (U_MISCELLANEOUS_SYMBOLS);
|
|
|
|
retval = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef set_bit
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
static GdkWin32SingleFont *
|
|
|
|
gdk_font_load_logfont (LOGFONT *lfp)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GdkWin32SingleFont *singlefont;
|
|
|
|
HFONT hfont;
|
|
|
|
LOGFONT logfont;
|
|
|
|
CHARSETINFO csi;
|
1999-11-25 00:27:11 +00:00
|
|
|
HGDIOBJ oldfont;
|
2000-07-25 20:38:35 +00:00
|
|
|
int tries;
|
1999-12-05 23:26:46 +00:00
|
|
|
gchar face[100];
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
for (tries = 0; ; tries++)
|
|
|
|
{
|
2000-10-25 18:07:12 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("... trying %ld,%ld,%ld,%ld,"
|
|
|
|
"%ld,%d,%d,%d,"
|
2000-07-25 20:38:35 +00:00
|
|
|
"%d,%d,%d,"
|
|
|
|
"%d,%#.02x,\"%s\"\n",
|
|
|
|
lfp->lfHeight, lfp->lfWidth,
|
|
|
|
lfp->lfEscapement, lfp->lfOrientation,
|
|
|
|
lfp->lfWeight, lfp->lfItalic,
|
|
|
|
lfp->lfUnderline, lfp->lfStrikeOut,
|
|
|
|
lfp->lfCharSet,
|
|
|
|
lfp->lfOutPrecision, lfp->lfClipPrecision,
|
|
|
|
lfp->lfQuality, lfp->lfPitchAndFamily,
|
|
|
|
lfp->lfFaceName));
|
|
|
|
hfont = CreateFontIndirect (lfp);
|
|
|
|
|
|
|
|
if (hfont != NULL)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* If we fail, try some similar fonts often found on Windows. */
|
|
|
|
if (tries == 0)
|
|
|
|
{
|
2006-02-20 08:52:19 +00:00
|
|
|
if (g_ascii_strcasecmp (lfp->lfFaceName, "helvetica") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
strcpy (lfp->lfFaceName, "arial");
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (lfp->lfFaceName, "new century schoolbook") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
strcpy (lfp->lfFaceName, "century schoolbook");
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (lfp->lfFaceName, "courier") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
strcpy (lfp->lfFaceName, "courier new");
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (lfp->lfFaceName, "lucida") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
strcpy (lfp->lfFaceName, "lucida sans unicode");
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (lfp->lfFaceName, "lucidatypewriter") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
strcpy (lfp->lfFaceName, "lucida console");
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (lfp->lfFaceName, "times") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
strcpy (lfp->lfFaceName, "times new roman");
|
|
|
|
}
|
|
|
|
else if (tries == 1)
|
|
|
|
{
|
2006-02-20 08:52:19 +00:00
|
|
|
if (g_ascii_strcasecmp (lfp->lfFaceName, "courier") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
{
|
|
|
|
strcpy (lfp->lfFaceName, "");
|
|
|
|
lfp->lfPitchAndFamily |= FF_MODERN;
|
|
|
|
}
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (lfp->lfFaceName, "times new roman") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
{
|
|
|
|
strcpy (lfp->lfFaceName, "");
|
|
|
|
lfp->lfPitchAndFamily |= FF_ROMAN;
|
|
|
|
}
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (lfp->lfFaceName, "helvetica") == 0
|
|
|
|
|| g_ascii_strcasecmp (lfp->lfFaceName, "lucida") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
{
|
|
|
|
strcpy (lfp->lfFaceName, "");
|
|
|
|
lfp->lfPitchAndFamily |= FF_SWISS;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
strcpy (lfp->lfFaceName, "");
|
|
|
|
lfp->lfPitchAndFamily = (lfp->lfPitchAndFamily & 0x0F) | FF_DONTCARE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
tries++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!hfont)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
singlefont = g_new (GdkWin32SingleFont, 1);
|
|
|
|
singlefont->hfont = hfont;
|
|
|
|
GetObject (singlefont->hfont, sizeof (logfont), &logfont);
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
oldfont = SelectObject (_gdk_display_hdc, singlefont->hfont);
|
2000-07-25 20:38:35 +00:00
|
|
|
memset (&singlefont->fs, 0, sizeof (singlefont->fs));
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
singlefont->charset = GetTextCharsetInfo (_gdk_display_hdc, &singlefont->fs, 0);
|
|
|
|
GetTextFace (_gdk_display_hdc, sizeof (face), face);
|
|
|
|
SelectObject (_gdk_display_hdc, oldfont);
|
2008-08-04 23:21:36 +00:00
|
|
|
if (TranslateCharsetInfo ((DWORD *) (gintptr) singlefont->charset, &csi,
|
2000-07-25 20:38:35 +00:00
|
|
|
TCI_SRCCHARSET)
|
|
|
|
&& singlefont->charset != MAC_CHARSET)
|
|
|
|
singlefont->codepage = csi.ciACP;
|
|
|
|
else
|
|
|
|
singlefont->codepage = 0;
|
|
|
|
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
GDK_NOTE (MISC, (g_print ("... = %p %s cs %s cp%d\n",
|
|
|
|
singlefont->hfont, face,
|
2000-07-25 20:38:35 +00:00
|
|
|
charset_name (singlefont->charset),
|
|
|
|
singlefont->codepage),
|
|
|
|
g_print ("... Unicode subranges:"),
|
|
|
|
print_unicode_subranges (&singlefont->fs)));
|
|
|
|
if (check_unicode_subranges (singlefont->charset, &singlefont->fs))
|
|
|
|
GDK_NOTE (MISC, (g_print ("... Guesstimated Unicode subranges:"),
|
|
|
|
print_unicode_subranges (&singlefont->fs)));
|
|
|
|
|
|
|
|
return singlefont;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GdkWin32SingleFont *
|
|
|
|
gdk_font_load_internal (const gchar *font_name)
|
|
|
|
{
|
|
|
|
LOGFONT logfont;
|
|
|
|
|
|
|
|
char *fn;
|
|
|
|
int numfields, n1, n2;
|
1999-11-11 22:12:27 +00:00
|
|
|
char foundry[32], family[100], weight[32], slant[32], set_width[32],
|
|
|
|
spacing[32], registry[32], encoding[32];
|
|
|
|
char pixel_size[10], point_size[10], res_x[10], res_y[10], avg_width[10];
|
|
|
|
int c;
|
|
|
|
char *p;
|
|
|
|
int logpixelsy;
|
|
|
|
|
|
|
|
g_return_val_if_fail (font_name != NULL, NULL);
|
|
|
|
|
|
|
|
GDK_NOTE (MISC, g_print ("gdk_font_load_internal: %s\n", font_name));
|
|
|
|
|
|
|
|
numfields = sscanf (font_name,
|
|
|
|
"-%30[^-]-%100[^-]-%30[^-]-%30[^-]-%30[^-]-%n",
|
|
|
|
foundry,
|
|
|
|
family,
|
|
|
|
weight,
|
|
|
|
slant,
|
|
|
|
set_width,
|
|
|
|
&n1);
|
|
|
|
if (numfields == 0)
|
|
|
|
{
|
|
|
|
/* Probably a plain Windows font name */
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfHeight = 0;
|
|
|
|
logfont.lfWidth = 0;
|
|
|
|
logfont.lfEscapement = 0;
|
|
|
|
logfont.lfOrientation = 0;
|
|
|
|
logfont.lfWeight = FW_DONTCARE;
|
|
|
|
logfont.lfItalic = FALSE;
|
|
|
|
logfont.lfUnderline = FALSE;
|
|
|
|
logfont.lfStrikeOut = FALSE;
|
|
|
|
logfont.lfCharSet = ANSI_CHARSET;
|
2000-08-12 19:51:05 +00:00
|
|
|
logfont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
|
|
|
logfont.lfQuality = PROOF_QUALITY;
|
|
|
|
logfont.lfPitchAndFamily = DEFAULT_PITCH;
|
2001-01-15 22:12:31 +00:00
|
|
|
fn = g_filename_from_utf8 (font_name, -1, NULL, NULL, NULL);
|
2000-07-25 20:38:35 +00:00
|
|
|
strcpy (logfont.lfFaceName, fn);
|
|
|
|
g_free (fn);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else if (numfields != 5)
|
|
|
|
{
|
|
|
|
g_warning ("gdk_font_load: font name %s illegal", font_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* It must be a XLFD name */
|
|
|
|
|
|
|
|
/* Check for hex escapes in the font family,
|
2000-02-03 01:19:03 +00:00
|
|
|
* put in there by logfont_to_xlfd. Convert them in-place.
|
1999-11-11 22:12:27 +00:00
|
|
|
*/
|
|
|
|
p = family;
|
|
|
|
while (*p)
|
|
|
|
{
|
|
|
|
if (*p == '%' && isxdigit (p[1]) && isxdigit (p[2]))
|
|
|
|
{
|
|
|
|
sscanf (p+1, "%2x", &c);
|
|
|
|
*p = c;
|
|
|
|
strcpy (p+1, p+3);
|
|
|
|
}
|
|
|
|
p++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Skip add_style which often is empty in the requested font name */
|
|
|
|
while (font_name[n1] && font_name[n1] != '-')
|
|
|
|
n1++;
|
|
|
|
numfields++;
|
|
|
|
|
|
|
|
numfields += sscanf (font_name + n1,
|
|
|
|
"-%8[^-]-%8[^-]-%8[^-]-%8[^-]-%30[^-]-%8[^-]-%30[^-]-%30[^-]%n",
|
|
|
|
pixel_size,
|
|
|
|
point_size,
|
|
|
|
res_x,
|
|
|
|
res_y,
|
|
|
|
spacing,
|
|
|
|
avg_width,
|
|
|
|
registry,
|
|
|
|
encoding,
|
|
|
|
&n2);
|
|
|
|
|
|
|
|
if (numfields != 14 || font_name[n1 + n2] != '\0')
|
|
|
|
{
|
|
|
|
g_warning ("gdk_font_load: font name %s illegal", font_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
logpixelsy = GetDeviceCaps (_gdk_display_hdc, LOGPIXELSY);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (strcmp (pixel_size, "*") == 0)
|
|
|
|
if (strcmp (point_size, "*") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfHeight = 0;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2005-04-21 10:39:39 +00:00
|
|
|
logfont.lfHeight = -(int) (((double) atoi (point_size))/720.*logpixelsy);
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2005-04-21 10:39:39 +00:00
|
|
|
logfont.lfHeight = -atoi (pixel_size);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWidth = 0;
|
|
|
|
logfont.lfEscapement = 0;
|
|
|
|
logfont.lfOrientation = 0;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2006-02-20 08:52:19 +00:00
|
|
|
if (g_ascii_strcasecmp (weight, "thin") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_THIN;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "extralight") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_EXTRALIGHT;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "ultralight") == 0)
|
1999-11-11 22:12:27 +00:00
|
|
|
#ifdef FW_ULTRALIGHT
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_ULTRALIGHT;
|
1999-11-11 22:12:27 +00:00
|
|
|
#else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_EXTRALIGHT; /* In fact, FW_ULTRALIGHT really is
|
|
|
|
* defined as FW_EXTRALIGHT anyway.
|
|
|
|
*/
|
1999-11-11 22:12:27 +00:00
|
|
|
#endif
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "light") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_LIGHT;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "normal") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_NORMAL;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "regular") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_REGULAR;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "medium") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_MEDIUM;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "semibold") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_SEMIBOLD;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "demibold") == 0)
|
1999-11-11 22:12:27 +00:00
|
|
|
#ifdef FW_DEMIBOLD
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_DEMIBOLD;
|
1999-11-11 22:12:27 +00:00
|
|
|
#else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_SEMIBOLD; /* As above */
|
1999-11-11 22:12:27 +00:00
|
|
|
#endif
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "bold") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_BOLD;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "extrabold") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_EXTRABOLD;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "ultrabold") == 0)
|
1999-11-11 22:12:27 +00:00
|
|
|
#ifdef FW_ULTRABOLD
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_ULTRABOLD;
|
1999-11-11 22:12:27 +00:00
|
|
|
#else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_EXTRABOLD; /* As above */
|
1999-11-11 22:12:27 +00:00
|
|
|
#endif
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "heavy") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_HEAVY;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (weight, "black") == 0)
|
1999-11-11 22:12:27 +00:00
|
|
|
#ifdef FW_BLACK
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_BLACK;
|
1999-11-11 22:12:27 +00:00
|
|
|
#else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_HEAVY; /* As above */
|
1999-11-11 22:12:27 +00:00
|
|
|
#endif
|
|
|
|
else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfWeight = FW_DONTCARE;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2006-02-20 08:52:19 +00:00
|
|
|
if (g_ascii_strcasecmp (slant, "italic") == 0
|
|
|
|
|| g_ascii_strcasecmp (slant, "oblique") == 0
|
|
|
|
|| g_ascii_strcasecmp (slant, "i") == 0
|
|
|
|
|| g_ascii_strcasecmp (slant, "o") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfItalic = TRUE;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfItalic = FALSE;
|
|
|
|
logfont.lfUnderline = FALSE;
|
|
|
|
logfont.lfStrikeOut = FALSE;
|
2006-02-20 08:52:19 +00:00
|
|
|
if (g_ascii_strcasecmp (registry, "iso8859") == 0)
|
1999-11-11 22:12:27 +00:00
|
|
|
if (strcmp (encoding, "1") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = ANSI_CHARSET;
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (strcmp (encoding, "2") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = EASTEUROPE_CHARSET;
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (strcmp (encoding, "7") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = GREEK_CHARSET;
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (strcmp (encoding, "8") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = HEBREW_CHARSET;
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (strcmp (encoding, "9") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = TURKISH_CHARSET;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = ANSI_CHARSET; /* XXX ??? */
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (registry, "jisx0208.1983") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = SHIFTJIS_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (registry, "ksc5601.1987") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = HANGEUL_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (registry, "gb2312.1980") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = GB2312_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (registry, "big5") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = CHINESEBIG5_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (registry, "windows") == 0
|
|
|
|
|| g_ascii_strcasecmp (registry, "microsoft") == 0)
|
|
|
|
if (g_ascii_strcasecmp (encoding, "symbol") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = SYMBOL_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "shiftjis") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = SHIFTJIS_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "gb2312") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = GB2312_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "hangeul") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = HANGEUL_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "big5") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = CHINESEBIG5_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "johab") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = JOHAB_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "hebrew") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = HEBREW_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "arabic") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = ARABIC_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "greek") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = GREEK_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "turkish") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = TURKISH_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "easteurope") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = EASTEUROPE_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "russian") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = RUSSIAN_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "mac") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = MAC_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "baltic") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = BALTIC_CHARSET;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (encoding, "cp1251") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = RUSSIAN_CHARSET;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = ANSI_CHARSET; /* XXX ??? */
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfCharSet = ANSI_CHARSET; /* XXX ??? */
|
|
|
|
logfont.lfOutPrecision = OUT_TT_PRECIS;
|
|
|
|
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
|
|
|
logfont.lfQuality = PROOF_QUALITY;
|
2006-02-20 08:52:19 +00:00
|
|
|
if (g_ascii_strcasecmp (spacing, "m") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfPitchAndFamily = FIXED_PITCH;
|
2006-02-20 08:52:19 +00:00
|
|
|
else if (g_ascii_strcasecmp (spacing, "p") == 0)
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfPitchAndFamily = VARIABLE_PITCH;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-25 20:38:35 +00:00
|
|
|
logfont.lfPitchAndFamily = DEFAULT_PITCH;
|
2001-01-15 22:12:31 +00:00
|
|
|
fn = g_filename_from_utf8 (family, -1, NULL, NULL, NULL);
|
2000-07-25 20:38:35 +00:00
|
|
|
strcpy (logfont.lfFaceName, fn);
|
|
|
|
g_free (fn);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
1999-12-05 23:26:46 +00:00
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
return gdk_font_load_logfont (&logfont);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
static GdkFont *
|
|
|
|
gdk_font_from_one_singlefont (GdkWin32SingleFont *singlefont)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GdkFont *font;
|
1999-11-19 01:09:13 +00:00
|
|
|
GdkFontPrivateWin32 *private;
|
1999-11-11 22:12:27 +00:00
|
|
|
HGDIOBJ oldfont;
|
|
|
|
TEXTMETRIC textmetric;
|
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
private = g_new (GdkFontPrivateWin32, 1);
|
1999-11-11 22:12:27 +00:00
|
|
|
font = (GdkFont*) private;
|
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
private->base.ref_count = 1;
|
1999-11-11 22:12:27 +00:00
|
|
|
private->names = NULL;
|
|
|
|
private->fonts = g_slist_append (NULL, singlefont);
|
|
|
|
|
|
|
|
/* Pretend all fonts are fontsets... Gtktext and gtkentry work better
|
|
|
|
* that way, they use wide chars, which is necessary for non-ASCII
|
|
|
|
* chars to work. (Yes, even Latin-1, as we use Unicode internally.)
|
|
|
|
*/
|
|
|
|
font->type = GDK_FONT_FONTSET;
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
oldfont = SelectObject (_gdk_display_hdc, singlefont->hfont);
|
|
|
|
GetTextMetrics (_gdk_display_hdc, &textmetric);
|
|
|
|
SelectObject (_gdk_display_hdc, oldfont);
|
1999-11-11 22:12:27 +00:00
|
|
|
font->ascent = textmetric.tmAscent;
|
|
|
|
font->descent = textmetric.tmDescent;
|
|
|
|
|
1999-12-05 23:26:46 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("... asc %d desc %d\n",
|
|
|
|
font->ascent, font->descent));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
return font;
|
|
|
|
}
|
|
|
|
|
|
|
|
GdkFont*
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
gdk_font_load_for_display (GdkDisplay *display,
|
|
|
|
const gchar *font_name)
|
2000-07-25 20:38:35 +00:00
|
|
|
{
|
|
|
|
GdkFont *font;
|
2001-07-28 23:02:02 +00:00
|
|
|
GdkFontPrivateWin32 *private;
|
|
|
|
GdkWin32SingleFont *singlefont;
|
|
|
|
HGDIOBJ oldfont;
|
|
|
|
TEXTMETRIC textmetric;
|
2000-07-25 20:38:35 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (font_name != NULL, NULL);
|
2002-06-20 23:59:27 +00:00
|
|
|
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
|
2000-07-25 20:38:35 +00:00
|
|
|
|
|
|
|
font = gdk_font_hash_lookup (GDK_FONT_FONTSET, font_name);
|
|
|
|
if (font)
|
|
|
|
return font;
|
|
|
|
|
2001-07-28 23:02:02 +00:00
|
|
|
private = g_new (GdkFontPrivateWin32, 1);
|
|
|
|
font = (GdkFont*) private;
|
|
|
|
|
|
|
|
singlefont = gdk_font_load_internal (font_name);
|
|
|
|
|
|
|
|
private->base.ref_count = 1;
|
|
|
|
private->names = NULL;
|
|
|
|
private->fonts = g_slist_append (NULL, singlefont);
|
|
|
|
|
|
|
|
/* Pretend all fonts are fontsets... Gtktext and gtkentry work better
|
|
|
|
* that way, they use wide chars, which is necessary for non-ASCII
|
|
|
|
* chars to work. (Yes, even Latin-1, as we use Unicode internally.)
|
|
|
|
*/
|
|
|
|
font->type = GDK_FONT_FONTSET;
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
oldfont = SelectObject (_gdk_display_hdc, singlefont->hfont);
|
|
|
|
GetTextMetrics (_gdk_display_hdc, &textmetric);
|
|
|
|
SelectObject (_gdk_display_hdc, oldfont);
|
2001-07-28 23:02:02 +00:00
|
|
|
font->ascent = textmetric.tmAscent;
|
|
|
|
font->descent = textmetric.tmDescent;
|
|
|
|
|
|
|
|
GDK_NOTE (MISC, g_print ("... asc %d desc %d\n",
|
|
|
|
font->ascent, font->descent));
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
gdk_font_hash_insert (GDK_FONT_FONTSET, font, font_name);
|
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
return gdk_font_from_one_singlefont (gdk_font_load_internal (font_name));
|
|
|
|
}
|
|
|
|
|
|
|
|
GdkFont*
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
gdk_font_from_description_for_display (GdkDisplay *display,
|
|
|
|
PangoFontDescription *font_desc)
|
2000-07-25 20:38:35 +00:00
|
|
|
{
|
2005-08-10 02:31:51 +00:00
|
|
|
LOGFONT logfont;
|
|
|
|
int size;
|
2000-07-25 20:38:35 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (font_desc != NULL, NULL);
|
2002-06-20 23:59:27 +00:00
|
|
|
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
|
2000-07-25 20:38:35 +00:00
|
|
|
|
2005-08-10 02:31:51 +00:00
|
|
|
size = PANGO_PIXELS (pango_font_description_get_size (font_desc));
|
|
|
|
|
2005-08-10 11:02:29 +00:00
|
|
|
logfont.lfHeight = - MulDiv (size,
|
|
|
|
GetDeviceCaps (_gdk_display_hdc, LOGPIXELSY),
|
|
|
|
72);
|
2005-08-10 02:31:51 +00:00
|
|
|
logfont.lfWidth = 0;
|
|
|
|
logfont.lfEscapement = 0;
|
|
|
|
logfont.lfOrientation = 0;
|
|
|
|
logfont.lfWeight = FW_DONTCARE;
|
|
|
|
logfont.lfItalic = FALSE;
|
|
|
|
logfont.lfUnderline = FALSE;
|
|
|
|
logfont.lfStrikeOut = FALSE;
|
|
|
|
logfont.lfCharSet = ANSI_CHARSET;
|
|
|
|
logfont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
|
|
|
|
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
|
|
|
logfont.lfQuality = PROOF_QUALITY;
|
|
|
|
logfont.lfPitchAndFamily = DEFAULT_PITCH;
|
|
|
|
strcpy (logfont.lfFaceName, "Arial");
|
|
|
|
|
|
|
|
return gdk_font_from_one_singlefont (gdk_font_load_logfont (&logfont));
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GdkFont*
|
2000-03-16 21:58:35 +00:00
|
|
|
gdk_fontset_load (const gchar *fontset_name)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GdkFont *font;
|
1999-11-19 01:09:13 +00:00
|
|
|
GdkFontPrivateWin32 *private;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkWin32SingleFont *singlefont;
|
|
|
|
HGDIOBJ oldfont;
|
|
|
|
TEXTMETRIC textmetric;
|
|
|
|
gchar *fs;
|
|
|
|
gchar *b, *p, *s;
|
|
|
|
|
|
|
|
g_return_val_if_fail (fontset_name != NULL, NULL);
|
|
|
|
|
|
|
|
font = gdk_font_hash_lookup (GDK_FONT_FONTSET, fontset_name);
|
|
|
|
if (font)
|
|
|
|
return font;
|
|
|
|
|
|
|
|
s = fs = g_strdup (fontset_name);
|
|
|
|
while (*s && isspace (*s))
|
|
|
|
s++;
|
|
|
|
|
|
|
|
g_return_val_if_fail (*s, NULL);
|
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
private = g_new (GdkFontPrivateWin32, 1);
|
1999-11-11 22:12:27 +00:00
|
|
|
font = (GdkFont*) private;
|
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
private->base.ref_count = 1;
|
1999-11-11 22:12:27 +00:00
|
|
|
private->names = NULL;
|
|
|
|
private->fonts = NULL;
|
|
|
|
|
|
|
|
font->type = GDK_FONT_FONTSET;
|
|
|
|
font->ascent = 0;
|
|
|
|
font->descent = 0;
|
|
|
|
|
|
|
|
while (TRUE)
|
|
|
|
{
|
|
|
|
if ((p = strchr (s, ',')) != NULL)
|
|
|
|
b = p;
|
|
|
|
else
|
|
|
|
b = s + strlen (s);
|
|
|
|
|
|
|
|
while (isspace (b[-1]))
|
|
|
|
b--;
|
|
|
|
*b = '\0';
|
|
|
|
singlefont = gdk_font_load_internal (s);
|
|
|
|
if (singlefont)
|
|
|
|
{
|
|
|
|
private->fonts = g_slist_append (private->fonts, singlefont);
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
oldfont = SelectObject (_gdk_display_hdc, singlefont->hfont);
|
|
|
|
GetTextMetrics (_gdk_display_hdc, &textmetric);
|
|
|
|
SelectObject (_gdk_display_hdc, oldfont);
|
1999-11-11 22:12:27 +00:00
|
|
|
font->ascent = MAX (font->ascent, textmetric.tmAscent);
|
|
|
|
font->descent = MAX (font->descent, textmetric.tmDescent);
|
|
|
|
}
|
|
|
|
if (p)
|
|
|
|
{
|
|
|
|
s = p + 1;
|
|
|
|
while (*s && isspace (*s))
|
|
|
|
s++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
if (!*s)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (fs);
|
|
|
|
|
|
|
|
gdk_font_hash_insert (GDK_FONT_FONTSET, font, fontset_name);
|
|
|
|
|
|
|
|
return font;
|
|
|
|
}
|
|
|
|
|
2003-08-07 03:30:38 +00:00
|
|
|
GdkFont*
|
|
|
|
gdk_fontset_load_for_display (GdkDisplay *display,
|
|
|
|
const gchar *fontset_name)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
return gdk_fontset_load (fontset_name);
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
void
|
1999-11-19 01:09:13 +00:00
|
|
|
_gdk_font_destroy (GdkFont *font)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
1999-11-19 01:09:13 +00:00
|
|
|
GdkFontPrivateWin32 *private = (GdkFontPrivateWin32 *) font;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkWin32SingleFont *singlefont;
|
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
singlefont = (GdkWin32SingleFont *) private->fonts->data;
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("_gdk_font_destroy %p\n",
|
|
|
|
singlefont->hfont));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
gdk_font_hash_remove (font->type, font);
|
|
|
|
|
|
|
|
switch (font->type)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
1999-11-19 01:09:13 +00:00
|
|
|
case GDK_FONT_FONT:
|
2000-07-23 21:43:23 +00:00
|
|
|
DeleteObject (singlefont->hfont);
|
1999-11-19 01:09:13 +00:00
|
|
|
break;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
case GDK_FONT_FONTSET:
|
|
|
|
list = private->fonts;
|
|
|
|
while (list)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
1999-11-19 01:09:13 +00:00
|
|
|
singlefont = (GdkWin32SingleFont *) list->data;
|
2000-07-23 21:43:23 +00:00
|
|
|
DeleteObject (singlefont->hfont);
|
1999-11-19 01:09:13 +00:00
|
|
|
|
|
|
|
list = list->next;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
1999-11-19 01:09:13 +00:00
|
|
|
g_slist_free (private->fonts);
|
|
|
|
break;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
1999-11-19 01:09:13 +00:00
|
|
|
g_free (font);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
1999-11-20 01:22:57 +00:00
|
|
|
gint
|
|
|
|
_gdk_font_strlen (GdkFont *font,
|
|
|
|
const gchar *str)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (font != NULL, -1);
|
|
|
|
g_return_val_if_fail (str != NULL, -1);
|
|
|
|
|
|
|
|
return strlen (str);
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
gint
|
|
|
|
gdk_font_id (const GdkFont *font)
|
|
|
|
{
|
1999-11-19 01:09:13 +00:00
|
|
|
const GdkFontPrivateWin32 *private;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (font != NULL, 0);
|
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
private = (const GdkFontPrivateWin32 *) font;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2008-08-04 23:21:36 +00:00
|
|
|
/* FIXME: What to do on Win64? */
|
1999-11-11 22:12:27 +00:00
|
|
|
if (font->type == GDK_FONT_FONT)
|
2008-08-04 23:21:36 +00:00
|
|
|
return (gint) (gintptr) ((GdkWin32SingleFont *) private->fonts->data)->hfont;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-11-09 21:52:52 +00:00
|
|
|
gboolean
|
1999-11-11 22:12:27 +00:00
|
|
|
gdk_font_equal (const GdkFont *fonta,
|
|
|
|
const GdkFont *fontb)
|
|
|
|
{
|
1999-11-19 01:09:13 +00:00
|
|
|
const GdkFontPrivateWin32 *privatea;
|
|
|
|
const GdkFontPrivateWin32 *privateb;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (fonta != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (fontb != NULL, FALSE);
|
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
privatea = (const GdkFontPrivateWin32 *) fonta;
|
|
|
|
privateb = (const GdkFontPrivateWin32 *) fontb;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (fonta->type == GDK_FONT_FONT && fontb->type == GDK_FONT_FONT)
|
2000-07-23 21:43:23 +00:00
|
|
|
return (((GdkWin32SingleFont *) privatea->fonts->data)->hfont
|
|
|
|
== ((GdkWin32SingleFont *) privateb->fonts->data)->hfont);
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (fonta->type == GDK_FONT_FONTSET && fontb->type == GDK_FONT_FONTSET)
|
|
|
|
{
|
|
|
|
GSList *lista = privatea->fonts;
|
|
|
|
GSList *listb = privateb->fonts;
|
|
|
|
|
|
|
|
while (lista && listb)
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
if (((GdkWin32SingleFont *) lista->data)->hfont
|
|
|
|
!= ((GdkWin32SingleFont *) listb->data)->hfont)
|
2003-03-08 20:49:00 +00:00
|
|
|
return FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
lista = lista->next;
|
|
|
|
listb = listb->next;
|
|
|
|
}
|
|
|
|
if (lista || listb)
|
2003-03-08 20:49:00 +00:00
|
|
|
return FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2003-03-08 20:49:00 +00:00
|
|
|
return TRUE;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else
|
2003-03-08 20:49:00 +00:00
|
|
|
return FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the Unicode Subset bitfield number for a Unicode character */
|
|
|
|
|
|
|
|
static int
|
|
|
|
unicode_classify (wchar_t wc)
|
|
|
|
{
|
|
|
|
int min = 0;
|
2001-12-28 21:52:04 +00:00
|
|
|
int max = G_N_ELEMENTS (utab) - 1;
|
1999-11-11 22:12:27 +00:00
|
|
|
int mid;
|
|
|
|
|
|
|
|
while (max >= min)
|
|
|
|
{
|
|
|
|
mid = (min + max) / 2;
|
|
|
|
if (utab[mid].high < wc)
|
|
|
|
min = mid + 1;
|
|
|
|
else if (wc < utab[mid].low)
|
|
|
|
max = mid - 1;
|
|
|
|
else if (utab[mid].low <= wc && wc <= utab[mid].high)
|
|
|
|
return utab[mid].bit;
|
|
|
|
else
|
2001-12-28 21:52:04 +00:00
|
|
|
break;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2001-12-28 21:52:04 +00:00
|
|
|
/* Fallback... returning -1 might cause problems. Returning
|
|
|
|
* U_BASIC_LATIN won't help handling strange characters, but won't
|
|
|
|
* do harm either.
|
|
|
|
*/
|
|
|
|
return U_BASIC_LATIN;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-28 21:28:51 +00:00
|
|
|
_gdk_wchar_text_handle (GdkFont *font,
|
1999-11-11 22:12:27 +00:00
|
|
|
const wchar_t *wcstr,
|
|
|
|
int wclen,
|
|
|
|
void (*handler)(GdkWin32SingleFont *,
|
|
|
|
const wchar_t *,
|
|
|
|
int,
|
|
|
|
void *),
|
|
|
|
void *arg)
|
|
|
|
{
|
1999-11-19 01:09:13 +00:00
|
|
|
GdkFontPrivateWin32 *private;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkWin32SingleFont *singlefont;
|
|
|
|
GSList *list;
|
2000-10-25 18:07:12 +00:00
|
|
|
int block;
|
1999-11-11 22:12:27 +00:00
|
|
|
const wchar_t *start, *end, *wcp;
|
|
|
|
|
|
|
|
wcp = wcstr;
|
|
|
|
end = wcp + wclen;
|
1999-11-19 01:09:13 +00:00
|
|
|
private = (GdkFontPrivateWin32 *) font;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
1999-11-19 01:09:13 +00:00
|
|
|
g_assert (private->base.ref_count > 0);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2001-10-28 21:28:51 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("_gdk_wchar_text_handle: "));
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
while (wcp < end)
|
|
|
|
{
|
|
|
|
/* Split Unicode string into pieces of the same class */
|
|
|
|
start = wcp;
|
|
|
|
block = unicode_classify (*wcp);
|
|
|
|
while (wcp + 1 < end && unicode_classify (wcp[1]) == block)
|
|
|
|
wcp++;
|
|
|
|
|
|
|
|
/* Find a font in the fontset that can handle this class */
|
|
|
|
list = private->fonts;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
singlefont = (GdkWin32SingleFont *) list->data;
|
|
|
|
|
|
|
|
if (singlefont->fs.fsUsb[block/32] & (1 << (block % 32)))
|
|
|
|
break;
|
|
|
|
|
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!list)
|
|
|
|
singlefont = NULL;
|
|
|
|
|
2008-08-04 23:21:36 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("%" G_GSIZE_FORMAT ":%" G_GSIZE_FORMAT ":%d:%p ",
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
start-wcstr, wcp-wcstr, block,
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
(singlefont ? singlefont->hfont : 0)));
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
/* Call the callback function */
|
|
|
|
(*handler) (singlefont, start, wcp+1 - start, arg);
|
|
|
|
wcp++;
|
|
|
|
}
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("\n"));
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
SIZE total;
|
|
|
|
} gdk_text_size_arg;
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_text_size_handler (GdkWin32SingleFont *singlefont,
|
|
|
|
const wchar_t *wcstr,
|
|
|
|
int wclen,
|
|
|
|
void *argp)
|
|
|
|
{
|
|
|
|
SIZE this_size;
|
|
|
|
HGDIOBJ oldfont;
|
|
|
|
gdk_text_size_arg *arg = (gdk_text_size_arg *) argp;
|
|
|
|
|
|
|
|
if (!singlefont)
|
|
|
|
return;
|
|
|
|
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
if ((oldfont = SelectObject (_gdk_display_hdc, singlefont->hfont)) == NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("SelectObject");
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
}
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
GetTextExtentPoint32W (_gdk_display_hdc, wcstr, wclen, &this_size);
|
|
|
|
SelectObject (_gdk_display_hdc, oldfont);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
arg->total.cx += this_size.cx;
|
1999-12-06 23:48:08 +00:00
|
|
|
arg->total.cy = MAX (arg->total.cy, this_size.cy);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdk_text_width (GdkFont *font,
|
|
|
|
const gchar *text,
|
|
|
|
gint text_length)
|
|
|
|
{
|
Delete leftover declarations of the obsolete Win32-only functions
2002-09-20 Tor Lillqvist <tml@iki.fi>
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
Win32-only functions gdk_font_full_name_get() and
gdk_font_full_name_free().
* gdk/gdk.def: Delete from here, too.
* gdk/win32/gdkfont-win32.c (logfont_to_xlfd,
gdk_font_full_name_get, gdk_font_full_name_free): Delete
implementation, and helper functions.
(pattern_match, InnerEnumFontFamExProc, EnumFontFamExProc,
gdk_font_list_new, gdk_font_list_free): Delete unused functions.
(gdk_text_width, gdk_text_width_wc) Instead of code duplication,
let gdk_text_extents() and gdk_text_extents_wc() do the job.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values):
Don't use the above removed functions in debugging output.
* gdk/win32/gdkdisplay-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkselection-win32.c
* gdk/win32/gdkinput-win32.h
* gdk/win32/gdkinput.c: Make it compile again, pass a GdkDisplay in
a couple of places.
2002-09-19 23:27:10 +00:00
|
|
|
gint width = -1;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
Delete leftover declarations of the obsolete Win32-only functions
2002-09-20 Tor Lillqvist <tml@iki.fi>
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
Win32-only functions gdk_font_full_name_get() and
gdk_font_full_name_free().
* gdk/gdk.def: Delete from here, too.
* gdk/win32/gdkfont-win32.c (logfont_to_xlfd,
gdk_font_full_name_get, gdk_font_full_name_free): Delete
implementation, and helper functions.
(pattern_match, InnerEnumFontFamExProc, EnumFontFamExProc,
gdk_font_list_new, gdk_font_list_free): Delete unused functions.
(gdk_text_width, gdk_text_width_wc) Instead of code duplication,
let gdk_text_extents() and gdk_text_extents_wc() do the job.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values):
Don't use the above removed functions in debugging output.
* gdk/win32/gdkdisplay-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkselection-win32.c
* gdk/win32/gdkinput-win32.h
* gdk/win32/gdkinput.c: Make it compile again, pass a GdkDisplay in
a couple of places.
2002-09-19 23:27:10 +00:00
|
|
|
gdk_text_extents (font, text, text_length, NULL, NULL, &width, NULL, NULL);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
Delete leftover declarations of the obsolete Win32-only functions
2002-09-20 Tor Lillqvist <tml@iki.fi>
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
Win32-only functions gdk_font_full_name_get() and
gdk_font_full_name_free().
* gdk/gdk.def: Delete from here, too.
* gdk/win32/gdkfont-win32.c (logfont_to_xlfd,
gdk_font_full_name_get, gdk_font_full_name_free): Delete
implementation, and helper functions.
(pattern_match, InnerEnumFontFamExProc, EnumFontFamExProc,
gdk_font_list_new, gdk_font_list_free): Delete unused functions.
(gdk_text_width, gdk_text_width_wc) Instead of code duplication,
let gdk_text_extents() and gdk_text_extents_wc() do the job.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values):
Don't use the above removed functions in debugging output.
* gdk/win32/gdkdisplay-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkselection-win32.c
* gdk/win32/gdkinput-win32.h
* gdk/win32/gdkinput.c: Make it compile again, pass a GdkDisplay in
a couple of places.
2002-09-19 23:27:10 +00:00
|
|
|
return width;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdk_text_width_wc (GdkFont *font,
|
|
|
|
const GdkWChar *text,
|
|
|
|
gint text_length)
|
|
|
|
{
|
Delete leftover declarations of the obsolete Win32-only functions
2002-09-20 Tor Lillqvist <tml@iki.fi>
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
Win32-only functions gdk_font_full_name_get() and
gdk_font_full_name_free().
* gdk/gdk.def: Delete from here, too.
* gdk/win32/gdkfont-win32.c (logfont_to_xlfd,
gdk_font_full_name_get, gdk_font_full_name_free): Delete
implementation, and helper functions.
(pattern_match, InnerEnumFontFamExProc, EnumFontFamExProc,
gdk_font_list_new, gdk_font_list_free): Delete unused functions.
(gdk_text_width, gdk_text_width_wc) Instead of code duplication,
let gdk_text_extents() and gdk_text_extents_wc() do the job.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values):
Don't use the above removed functions in debugging output.
* gdk/win32/gdkdisplay-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkselection-win32.c
* gdk/win32/gdkinput-win32.h
* gdk/win32/gdkinput.c: Make it compile again, pass a GdkDisplay in
a couple of places.
2002-09-19 23:27:10 +00:00
|
|
|
gint width = -1;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
Delete leftover declarations of the obsolete Win32-only functions
2002-09-20 Tor Lillqvist <tml@iki.fi>
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
Win32-only functions gdk_font_full_name_get() and
gdk_font_full_name_free().
* gdk/gdk.def: Delete from here, too.
* gdk/win32/gdkfont-win32.c (logfont_to_xlfd,
gdk_font_full_name_get, gdk_font_full_name_free): Delete
implementation, and helper functions.
(pattern_match, InnerEnumFontFamExProc, EnumFontFamExProc,
gdk_font_list_new, gdk_font_list_free): Delete unused functions.
(gdk_text_width, gdk_text_width_wc) Instead of code duplication,
let gdk_text_extents() and gdk_text_extents_wc() do the job.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values):
Don't use the above removed functions in debugging output.
* gdk/win32/gdkdisplay-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkselection-win32.c
* gdk/win32/gdkinput-win32.h
* gdk/win32/gdkinput.c: Make it compile again, pass a GdkDisplay in
a couple of places.
2002-09-19 23:27:10 +00:00
|
|
|
gdk_text_extents_wc (font, text, text_length, NULL, NULL, &width, NULL, NULL);
|
gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/*.c: Rename all global variables and functions to
start with underscore.
Merge from stable:
More work on the Win32 backend. The cause of some scrolling
problems was that SetWindowPos() and ScrollWindowEx() don't blit
those parts of the window they think are invalid. As we didn't
keep Windows's update region in synch with GDK's, Windows thought
those areas that in fact had been updated were invalid. Calling
ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
be an elegant and efficient solution, removing from Windows's
update region those areas we are about to repaint proactively.
In some cases garbage leftover values were used for the clip
origin in GdkGCWin32. This showed up as odd blank areas around the
pixmaps included in the Text Widget in gtk-demo.
Having the clip region either as a GdkRegion or a HRGN in
GdkGCWin32 was unnecessary, it's better to just use a HRGN.
The translation and antiexpose queue handling in
gdkgeometry-win32.c seems unnecessary (and not implementable in
the same way as on X11 anyway, no serial numbers) on Windows,
ifdeffed out.
Don't (try to) do guffaw scrolling as there is no static window
gravity on Windows. Guffaw scrolling would be unnecessary anyway,
as there is the ScrollWindow() API. This improves the behaviour of
the Text Widget demo in gtk-demo a lot. But I have no idea how the
lack of static win gravity should be handled in other places where
the X11 code uses it. Especially _gdk_window_move_resize_child().
There is still some problem in expose handling. By moving an
obscuring window back and forth over testgtk's main window, for
instance, every now and then you typically get narrow vertical or
horizontal strips of pixels that haven't been properly redrawn
after being exposed. A fencepost error somewhere?
Otherwise, all of testgtk and gtk-demo except "big windows" now
seem to work pretty well.
Bug #79720 should be fixed now.
* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
gdk_win32_print_hpalette)
* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
Move all debugging helper functions to gdkmain-win32.c.
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
Rewrite. Make static. Must take tile origin parameters, too.
(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
_gdk_win32_draw_tiles(). Remove #if 0 code.
(blit_inside_window): Don't call ScrollDC(), that didn't work at
all like I thought. A simple call to BitBlt() is enough.
* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
latin_locale_loaded variable.
(_gdk_win32_get_next_tick): New function. Used to make sure
timestamps of events are always increasing, both in events
generated from the window procedure and in events gotten via
PeekMessage(). Not sure whether this is actually useful, but it
seemed as a good idea.
(real_window_procedure): Don't use a local GdkEventPrivate
variable. Don't attempt any compression of configure or expose
events here, handled elsewhere.
(erase_background): Accumulate window offsets when traversing up
the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
correct alignment of background pixmaps. Don't fill with
BLACK_BRUSH if GDK_NO_BG.
(gdk_event_get_graphics_expose): A bit more verbose debugging output.
(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
WM_PAINT handler, don't check for empty update rect. When we get a
WM_PAINT, the update region isn't empty. And if it for some
strange reason is, that will be handled later anyway. Call
GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
empty the update region).
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkinput-win32.c:
Use _gdk_win32_get_next_tick().
* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.
(gdk_text_size): Remove, unused.
* gdk/win32/gdkgc-win32.c: Set clip origins to zero
when appropriate.
(gdk_gc_copy): Increase refcount on colormap if present.
(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
combine it with clip region after selecting into the DC.
(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.
(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
extracted from gdk_win32_hdc_get().
* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
handling.
(gdk_window_copy_area_scroll): Increase clipRect to avoid
ScrollWindowEx() not scrolling pixels it thinks are invalid.
Scroll also children with the ScrollWindowEx() call. No need to
call gdk_window_move() on the children.
(gdk_window_scroll): Don't do guffaw scrolling.
(gdk_window_compute_position): Fix typo, used win32_y where x was
intended.
(gdk_window_premove, gdk_window_postmove,
gdk_window_clip_changed): Add debugging output.
(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
on the region.
(_gdk_window_process_expose): No use for the serial number
parameter now. Instead of a rectangle, take a region parameter, as
Windows gives us one in WM_PAINT.
* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
_gdk_win32_gdkregion_to_string): New debugging functions.
(static_printf): Helper function for the above. sprintfs into a
static circular buffer, return value should be used "soon".
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
leak, free list after use.
(gdk_window_gravity_works): Remove, we know that there is no such
thing on Windows.
(gdk_window_set_static_bit_gravity,
gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
anything anyway.
(_gdk_windowing_window_init, gdk_window_foreign_new): Call
_gdk_window_init_position() like in the X11 backend.
(gdk_window_reparent): Don't call the now nonexistent
gdk_window_set_static_win_gravity(). No idea what should be done
instead.
(gdk_window_get_geometry): The returned x and y should be relative
to parent. Used to be always zero..
(gdk_window_set_static_gravities): Return FALSE if trying to set
static gravity.
* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
GdkGCWin32. Only use the HRGN hcliprgn. Declare new
functions.
* gdk/win32/*.c: Use new debugging functions.
* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
|
|
|
|
Delete leftover declarations of the obsolete Win32-only functions
2002-09-20 Tor Lillqvist <tml@iki.fi>
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
Win32-only functions gdk_font_full_name_get() and
gdk_font_full_name_free().
* gdk/gdk.def: Delete from here, too.
* gdk/win32/gdkfont-win32.c (logfont_to_xlfd,
gdk_font_full_name_get, gdk_font_full_name_free): Delete
implementation, and helper functions.
(pattern_match, InnerEnumFontFamExProc, EnumFontFamExProc,
gdk_font_list_new, gdk_font_list_free): Delete unused functions.
(gdk_text_width, gdk_text_width_wc) Instead of code duplication,
let gdk_text_extents() and gdk_text_extents_wc() do the job.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values):
Don't use the above removed functions in debugging output.
* gdk/win32/gdkdisplay-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkselection-win32.c
* gdk/win32/gdkinput-win32.h
* gdk/win32/gdkinput.c: Make it compile again, pass a GdkDisplay in
a couple of places.
2002-09-19 23:27:10 +00:00
|
|
|
return width;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_text_extents (GdkFont *font,
|
|
|
|
const gchar *text,
|
|
|
|
gint text_length,
|
|
|
|
gint *lbearing,
|
|
|
|
gint *rbearing,
|
|
|
|
gint *width,
|
|
|
|
gint *ascent,
|
|
|
|
gint *descent)
|
|
|
|
{
|
|
|
|
gdk_text_size_arg arg;
|
gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
2004-07-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
* gdk/win32/gdkfont-win32.c (gdk_text_extents)
* gdk/win32/gdkproperty-win32.c (find_common_locale,
gdk_property_change)
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Use
g_utf8_to_utf16() instead of the removed _gdk_utf8_to_ucs2() (see
below).
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init)
* gdk/win3/gdkprivate-win32.h: Add a variable for the TARGETS
atom. Initialize it. Declare it. Drop the variable for the
COMPOUND_TEXT atom.
* gdk/win32/gdkim-win32.c (gdk_wcstombs): Don't return UTF-8. This
function is supposed to return the string in the locale's charset
and encoding. Use g_convert().
(gdk_mbstowcs): Similarily, don't take an UTF-8 string, but a
string in the locale's charset. Use g_convert().
(_gdk_ucs2_to_utf8, _gdk_utf8_to_wcs, _gdk_utf8_to_ucs2):
Delete. The UCS-2 functions didn't handle surrogates anyway. Use
GLib's UTF-16 functions instead. Windows uses UTF-16.
* gdk/win32/gdkprivate-win32.h: Remove declarations of the deleted
functions mentioned above.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Use CF_TEXT
also if the string is of type STRING, i.e. ISO-8859-1, and the
current codepage is 1252, and contains no C1 chars. Accept
also UTF8_STRING.
* gdk/win32/gdkselection-win32.c (_gdk_selection_property_store):
Mark as static. When storing STRING data, convert to
Latin-1. (#140537)
(gdk_selection_owner_set_for_display): Now that STRING is always
ISO-8859-1, use UTF8_STRING when sending the selection request
to ourselves.
(gdk_selection_convert): Handle also UTF8_STRING. (#140537, John
Ehresman)
(gdk_text_property_to_text_list_for_display): Make work more like
X11 version. Do obey the encoding parameter.
(gdk_string_to_compound_text_for_display,
gdk_utf8_to_compound_text_for_display): Don't even pretend
supporting COMPOUND_TEXT.
(gdk_utf8_to_string_target): Convert to ISO-8859-1, like on X11.
(sanitize_utf8): Zero-terminate string.
2004-07-07 00:10:03 +00:00
|
|
|
glong wlen;
|
|
|
|
wchar_t *wcstr, wc;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (font != NULL);
|
|
|
|
g_return_if_fail (text != NULL);
|
|
|
|
|
|
|
|
if (text_length == 0)
|
|
|
|
{
|
|
|
|
if (lbearing)
|
|
|
|
*lbearing = 0;
|
|
|
|
if (rbearing)
|
|
|
|
*rbearing = 0;
|
|
|
|
if (width)
|
|
|
|
*width = 0;
|
|
|
|
if (ascent)
|
|
|
|
*ascent = 0;
|
|
|
|
if (descent)
|
|
|
|
*descent = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_assert (font->type == GDK_FONT_FONT || font->type == GDK_FONT_FONTSET);
|
|
|
|
|
|
|
|
arg.total.cx = arg.total.cy = 0;
|
|
|
|
|
1999-12-18 02:03:13 +00:00
|
|
|
if (text_length == 1)
|
|
|
|
{
|
gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
2004-07-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
* gdk/win32/gdkfont-win32.c (gdk_text_extents)
* gdk/win32/gdkproperty-win32.c (find_common_locale,
gdk_property_change)
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Use
g_utf8_to_utf16() instead of the removed _gdk_utf8_to_ucs2() (see
below).
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init)
* gdk/win3/gdkprivate-win32.h: Add a variable for the TARGETS
atom. Initialize it. Declare it. Drop the variable for the
COMPOUND_TEXT atom.
* gdk/win32/gdkim-win32.c (gdk_wcstombs): Don't return UTF-8. This
function is supposed to return the string in the locale's charset
and encoding. Use g_convert().
(gdk_mbstowcs): Similarily, don't take an UTF-8 string, but a
string in the locale's charset. Use g_convert().
(_gdk_ucs2_to_utf8, _gdk_utf8_to_wcs, _gdk_utf8_to_ucs2):
Delete. The UCS-2 functions didn't handle surrogates anyway. Use
GLib's UTF-16 functions instead. Windows uses UTF-16.
* gdk/win32/gdkprivate-win32.h: Remove declarations of the deleted
functions mentioned above.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Use CF_TEXT
also if the string is of type STRING, i.e. ISO-8859-1, and the
current codepage is 1252, and contains no C1 chars. Accept
also UTF8_STRING.
* gdk/win32/gdkselection-win32.c (_gdk_selection_property_store):
Mark as static. When storing STRING data, convert to
Latin-1. (#140537)
(gdk_selection_owner_set_for_display): Now that STRING is always
ISO-8859-1, use UTF8_STRING when sending the selection request
to ourselves.
(gdk_selection_convert): Handle also UTF8_STRING. (#140537, John
Ehresman)
(gdk_text_property_to_text_list_for_display): Make work more like
X11 version. Do obey the encoding parameter.
(gdk_string_to_compound_text_for_display,
gdk_utf8_to_compound_text_for_display): Don't even pretend
supporting COMPOUND_TEXT.
(gdk_utf8_to_string_target): Convert to ISO-8859-1, like on X11.
(sanitize_utf8): Zero-terminate string.
2004-07-07 00:10:03 +00:00
|
|
|
wc = (guchar) text[0];
|
|
|
|
_gdk_wchar_text_handle (font, &wc, 1, gdk_text_size_handler, &arg);
|
1999-12-18 02:03:13 +00:00
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
1999-12-18 02:03:13 +00:00
|
|
|
{
|
gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
2004-07-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
* gdk/win32/gdkfont-win32.c (gdk_text_extents)
* gdk/win32/gdkproperty-win32.c (find_common_locale,
gdk_property_change)
* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Use
g_utf8_to_utf16() instead of the removed _gdk_utf8_to_ucs2() (see
below).
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init)
* gdk/win3/gdkprivate-win32.h: Add a variable for the TARGETS
atom. Initialize it. Declare it. Drop the variable for the
COMPOUND_TEXT atom.
* gdk/win32/gdkim-win32.c (gdk_wcstombs): Don't return UTF-8. This
function is supposed to return the string in the locale's charset
and encoding. Use g_convert().
(gdk_mbstowcs): Similarily, don't take an UTF-8 string, but a
string in the locale's charset. Use g_convert().
(_gdk_ucs2_to_utf8, _gdk_utf8_to_wcs, _gdk_utf8_to_ucs2):
Delete. The UCS-2 functions didn't handle surrogates anyway. Use
GLib's UTF-16 functions instead. Windows uses UTF-16.
* gdk/win32/gdkprivate-win32.h: Remove declarations of the deleted
functions mentioned above.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Use CF_TEXT
also if the string is of type STRING, i.e. ISO-8859-1, and the
current codepage is 1252, and contains no C1 chars. Accept
also UTF8_STRING.
* gdk/win32/gdkselection-win32.c (_gdk_selection_property_store):
Mark as static. When storing STRING data, convert to
Latin-1. (#140537)
(gdk_selection_owner_set_for_display): Now that STRING is always
ISO-8859-1, use UTF8_STRING when sending the selection request
to ourselves.
(gdk_selection_convert): Handle also UTF8_STRING. (#140537, John
Ehresman)
(gdk_text_property_to_text_list_for_display): Make work more like
X11 version. Do obey the encoding parameter.
(gdk_string_to_compound_text_for_display,
gdk_utf8_to_compound_text_for_display): Don't even pretend
supporting COMPOUND_TEXT.
(gdk_utf8_to_string_target): Convert to ISO-8859-1, like on X11.
(sanitize_utf8): Zero-terminate string.
2004-07-07 00:10:03 +00:00
|
|
|
wcstr = g_utf8_to_utf16 (text, text_length, NULL, &wlen, NULL);
|
|
|
|
_gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, &arg);
|
|
|
|
g_free (wcstr);
|
1999-12-18 02:03:13 +00:00
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* XXX This is quite bogus */
|
|
|
|
if (lbearing)
|
|
|
|
*lbearing = 0;
|
|
|
|
if (rbearing)
|
1999-12-06 23:48:08 +00:00
|
|
|
*rbearing = arg.total.cx;
|
|
|
|
/* What should be the difference between width and rbearing? */
|
1999-11-11 22:12:27 +00:00
|
|
|
if (width)
|
|
|
|
*width = arg.total.cx;
|
|
|
|
if (ascent)
|
1999-12-06 23:48:08 +00:00
|
|
|
*ascent = arg.total.cy + 1;
|
1999-11-11 22:12:27 +00:00
|
|
|
if (descent)
|
|
|
|
*descent = font->descent + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_text_extents_wc (GdkFont *font,
|
|
|
|
const GdkWChar *text,
|
|
|
|
gint text_length,
|
|
|
|
gint *lbearing,
|
|
|
|
gint *rbearing,
|
|
|
|
gint *width,
|
|
|
|
gint *ascent,
|
|
|
|
gint *descent)
|
|
|
|
{
|
|
|
|
gdk_text_size_arg arg;
|
|
|
|
wchar_t *wcstr;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (font != NULL);
|
|
|
|
g_return_if_fail (text != NULL);
|
|
|
|
|
|
|
|
if (text_length == 0)
|
|
|
|
{
|
|
|
|
if (lbearing)
|
|
|
|
*lbearing = 0;
|
|
|
|
if (rbearing)
|
|
|
|
*rbearing = 0;
|
|
|
|
if (width)
|
|
|
|
*width = 0;
|
|
|
|
if (ascent)
|
|
|
|
*ascent = 0;
|
|
|
|
if (descent)
|
|
|
|
*descent = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_assert (font->type == GDK_FONT_FONT || font->type == GDK_FONT_FONTSET);
|
|
|
|
|
|
|
|
if (sizeof (wchar_t) != sizeof (GdkWChar))
|
|
|
|
{
|
|
|
|
wcstr = g_new (wchar_t, text_length);
|
|
|
|
for (i = 0; i < text_length; i++)
|
|
|
|
wcstr[i] = text[i];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
wcstr = (wchar_t *) text;
|
|
|
|
|
|
|
|
arg.total.cx = arg.total.cy = 0;
|
|
|
|
|
2001-10-28 21:28:51 +00:00
|
|
|
_gdk_wchar_text_handle (font, wcstr, text_length,
|
1999-11-11 22:12:27 +00:00
|
|
|
gdk_text_size_handler, &arg);
|
|
|
|
|
|
|
|
if (sizeof (wchar_t) != sizeof (GdkWChar))
|
|
|
|
g_free (wcstr);
|
|
|
|
|
|
|
|
/* XXX This is quite bogus */
|
|
|
|
if (lbearing)
|
|
|
|
*lbearing = 0;
|
|
|
|
if (rbearing)
|
1999-12-06 23:48:08 +00:00
|
|
|
*rbearing = arg.total.cx;
|
1999-11-11 22:12:27 +00:00
|
|
|
if (width)
|
|
|
|
*width = arg.total.cx;
|
|
|
|
if (ascent)
|
1999-12-06 23:48:08 +00:00
|
|
|
*ascent = arg.total.cy + 1;
|
1999-11-11 22:12:27 +00:00
|
|
|
if (descent)
|
|
|
|
*descent = font->descent + 1;
|
|
|
|
}
|
2004-03-05 23:26:07 +00:00
|
|
|
|
|
|
|
GdkDisplay*
|
|
|
|
gdk_font_get_display (GdkFont* font)
|
|
|
|
{
|
|
|
|
return _gdk_display;
|
|
|
|
}
|