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
|
|
|
|
2002-12-15 01:49:01 +00:00
|
|
|
#include <glib/gprintf.h>
|
1999-11-11 22:12:27 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <io.h>
|
|
|
|
|
|
|
|
#include "gdk.h"
|
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
|
|
|
#include "gdkregion-generic.h"
|
2000-07-25 17:31:05 +00:00
|
|
|
#include "gdkkeysyms.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 "gdkinternals.h"
|
2004-09-05 21:15:58 +00:00
|
|
|
#include "gdkintl.h"
|
1999-11-20 01:22:57 +00:00
|
|
|
#include "gdkprivate-win32.h"
|
2000-07-25 17:31:05 +00:00
|
|
|
#include "gdkinput-win32.h"
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
#include <objbase.h>
|
|
|
|
|
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
|
|
|
#include <imm.h>
|
|
|
|
|
1999-11-20 01:22:57 +00:00
|
|
|
static gboolean gdk_synchronize = FALSE;
|
|
|
|
|
2004-10-01 19:53:55 +00:00
|
|
|
static gboolean dummy;
|
|
|
|
|
2006-04-03 20:36:52 +00:00
|
|
|
const GOptionEntry _gdk_windowing_args[] = {
|
2004-09-19 05:40:00 +00:00
|
|
|
{ "sync", 0, 0, G_OPTION_ARG_NONE, &gdk_synchronize,
|
2004-09-05 21:15:58 +00:00
|
|
|
/* Description of --sync in --help output */ N_("Don't batch GDI requests"), NULL },
|
|
|
|
{ "no-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
|
2004-10-01 19:53:55 +00:00
|
|
|
/* Description of --no-wintab in --help output */ N_("Don't use the Wintab API for tablet support"), NULL },
|
2004-09-05 21:15:58 +00:00
|
|
|
{ "ignore-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
|
|
|
|
/* Description of --ignore-wintab in --help output */ N_("Same as --no-wintab"), NULL },
|
2004-10-01 19:53:55 +00:00
|
|
|
{ "use-wintab", 0, 0, G_OPTION_ARG_NONE, &dummy,
|
|
|
|
/* Description of --use-wintab in --help output */ N_("Do use the Wintab API [default]"), NULL },
|
2004-09-05 21:15:58 +00:00
|
|
|
{ "max-colors", 0, 0, G_OPTION_ARG_INT, &_gdk_max_colors,
|
|
|
|
/* Description of --max-colors=COLORS in --help output */ N_("Size of the palette in 8 bit mode"),
|
|
|
|
/* Placeholder in --max-colors=COLORS in --help output */ N_("COLORS") },
|
1999-11-20 01:22:57 +00:00
|
|
|
{ NULL }
|
|
|
|
};
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
int __stdcall
|
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
|
|
|
DllMain (HINSTANCE hinstDLL,
|
|
|
|
DWORD dwReason,
|
|
|
|
LPVOID reserved)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
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_dll_hinstance = hinstDLL;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
void
|
Make gtk argument parsing use goption. Add gtk_get_option_group and
2004-09-05 Anders Carlsson <andersca@gnome.org>
* gdk/gdk.c: (gdk_arg_class_cb), (gdk_arg_name_cb),
(gdk_add_option_entries_libgtk_only), (gdk_pre_parse_libgtk_only),
(gdk_parse_args):
* gdk/gdk.h:
* gdk/gdkinternals.h:
* gdk/linux-fb/gdkmain-fb.c: (_gdk_windowing_init):
* gdk/win32/gdkmain-win32.c: (_gdk_windowing_init):
* gdk/x11/gdkdisplay-x11.c: (gdk_display_open):
* gdk/x11/gdkmain-x11.c: (_gdk_windowing_init):
* gtk/gtkmain.c: (gtk_arg_debug_cb), (gtk_arg_no_debug_cb),
(gtk_arg_module_cb), (gtk_arg_warnings_cb),
(do_pre_parse_initialization), (do_post_parse_initialization),
(pre_parse_hook), (post_parse_hook), (gtk_get_option_group),
(gtk_init_with_args), (gtk_parse_args):
* gtk/gtkmain.h:
Make gtk argument parsing use goption. Add gtk_get_option_group and
gtk_init_with_args.
* tests/testtreemodel.c: (main):
Use gtk_init_with_args.
2004-09-05 15:09:55 +00:00
|
|
|
_gdk_windowing_init (void)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
Implement the functions that until now just were non-functional stubs. For
2002-02-26 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkkeys-win32.c: Implement the functions that until
now just were non-functional stubs. For "hardware keycodes", we
use Windows virtual keycodes. Not scancodes, although that at
first might seem more low-level and a better match to X11
keycodes.
The Windows API is really mixed up and confused with respect to
scancodes and virtual keycodes. (Surprised?) Some scancodes are
generated by two keys on the keyboard (!), and although the
keyboard messages do have a flag to indicate which key the user
pressed, other API that take a scan code as input don't let you
specify which actual key you mean.
(update_keymap): Function to build a X11-like representation of
the keyboard. Each key has four keysyms: two levels (nonshifted
and shifted) and two groups (normal and with AltGr).
(gdk_keymap_get_direction): Use the codepage corresponding to the
thread's input locale, not the system codepage.
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwindow-win32.h
* gdk/win32/gdkwindow-win32.c: Remove the input_locale and
charset_info fields from GdkWindowImplWin32. Input locale is
per-thread in Windows, and as GDK on Windows really only works
when the GDI interaction all happens in just one thread anyway,
this state can be global. Use globals _gdk_input_locale and
_gdk_input_codepage instead. Set these based on the thread's input
locale (keyboard layout, or which IME is active).
* gdk/win32/gdkevents-win32.c: Set the group and hardware_keycode
fields in GDK key events. On input locale change messages, set
the global state variables, and inform update_keymap() that it
has to rebuild the keymap.
2002-02-26 01:18:27 +00:00
|
|
|
gchar buf[10];
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
if (getenv ("GDK_IGNORE_WINTAB") != 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
|
|
|
_gdk_input_ignore_wintab = TRUE;
|
2004-04-10 08:43:36 +00:00
|
|
|
else if (getenv ("GDK_USE_WINTAB") != NULL)
|
|
|
|
_gdk_input_ignore_wintab = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
1999-11-20 01:22:57 +00:00
|
|
|
if (gdk_synchronize)
|
|
|
|
GdiSetBatchLimit (1);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
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_app_hmodule = GetModuleHandle (NULL);
|
|
|
|
_gdk_display_hdc = CreateDC ("DISPLAY", NULL, NULL, NULL);
|
Implement the functions that until now just were non-functional stubs. For
2002-02-26 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkkeys-win32.c: Implement the functions that until
now just were non-functional stubs. For "hardware keycodes", we
use Windows virtual keycodes. Not scancodes, although that at
first might seem more low-level and a better match to X11
keycodes.
The Windows API is really mixed up and confused with respect to
scancodes and virtual keycodes. (Surprised?) Some scancodes are
generated by two keys on the keyboard (!), and although the
keyboard messages do have a flag to indicate which key the user
pressed, other API that take a scan code as input don't let you
specify which actual key you mean.
(update_keymap): Function to build a X11-like representation of
the keyboard. Each key has four keysyms: two levels (nonshifted
and shifted) and two groups (normal and with AltGr).
(gdk_keymap_get_direction): Use the codepage corresponding to the
thread's input locale, not the system codepage.
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwindow-win32.h
* gdk/win32/gdkwindow-win32.c: Remove the input_locale and
charset_info fields from GdkWindowImplWin32. Input locale is
per-thread in Windows, and as GDK on Windows really only works
when the GDI interaction all happens in just one thread anyway,
this state can be global. Use globals _gdk_input_locale and
_gdk_input_codepage instead. Set these based on the thread's input
locale (keyboard layout, or which IME is active).
* gdk/win32/gdkevents-win32.c: Set the group and hardware_keycode
fields in GDK key events. On input locale change messages, set
the global state variables, and inform update_keymap() that it
has to rebuild the keymap.
2002-02-26 01:18:27 +00:00
|
|
|
_gdk_input_locale = GetKeyboardLayout (0);
|
gdk/win32/gdkprivate-win32.h New flags _gdk_input_locale_is_ime and
2003-07-25 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: New flags _gdk_input_locale_is_ime
and _gdk_keyboard_has_altgr.
* gdk/win32/gdkevents-win32.c: Lots of changes. Most important
ones detailled here.
Code that has been ifdeffed out for a long time removed. Remove
some really old doc comments that were left behind for some public
functions, the official ones are in the X11 backend anyway. Change
GDK_WINDOW_OBJECT() calls to GdkWindowObject casts. Reformat
multi-line boolean expressions to have the operators at ends of
lines.
As mouse capture with SetCapture() indeed seems to work OK, no
need to have the correspoinding macro USE_SETCAPTURE and ifdefs.
Ifdef out the gdk-ping-msg stuff. I don't remember why it was
needed at some time, and things seem to work fine now without
(knock on wood).
Ifdef out the search for some Latin locale keyboard layout being
loaded. Not used currently, but might be needed after all, if we
decide that we want to be able to generate ASCII control character
events with a non-Latin keyboard.
(assign_object): New helper function, handles the g_object_ref()
and unref() calls when assigning GObject pointers.
(generate_crossing_events): Also generate the GDK_NOTIFY_INTERIOR
enter event when the pointer has moved to an ancestor window. Was
left out by mistake.
(gdk_window_is_ancestor): Renamed from gdk_window_is_child().
(gdk_pointer_grab, gdk_pointer_ungrab): Implement the confine_to
functionality, using ClipCursor().
(find_window_for_mouse_event): Splice part of code into new
function find_real_window_for_grabbed_mouse_event().
(fixup_event, append_event, apply_filters): New functions, code
refactored out from elsewhere.
(synthesize_enter_or_leave_event, synthesize_leave_event,
synthesize_enter_event,
synthesize_leave_events,synthesize_enter_events): Also take a
GdkCrossingMode parameter, in preparation to generating
GDK_CROSSING_GRAB and GDK_CROSSING_UNGRAB events.
(fixup_event, append_event, fill_key_event_string): New functions,
code refactoring.
(vk_from_char, build_keypress_event, build_keyrelease_event):
Removed as part of dropping WM_CHAR handling.
(build_key_event_state,gdk_event_translate): Call
GetKeyboardState(), once, for each keyboard message, instead of
several calls to GetKeyState() here and there.
(gdk_event_translate): Fix bugs #104516, #104662, #115902. While
at it, do some major refactoring, and some fixes for potential
problems noticed while going through the code.
Don't handle WM_CHAR at all. Only handle WM_KEYDOWN and
WM_KEYUP. Don't need the state variables related to whether to
wait for WM_CHAR or not, and whether the current key is
AltGr. Remove lots of complexity. Thus don't need the
use_ime_composition flag.
Not handling WM_CHAR means dead key handling will have to be taken
care of by GTK, but that seems to work fine, so no worry.
Another side-effect is that Alt+keypad digits don't work any
longer, but it's better to learn to use GTK's ISO14755 support is
anyway.
Be more careful in checking whether AltGr is involved. Only
attempt to handle it if the keyboard actually has it. And
explicitly check for *left* Control plus *right* Alt being
pressed. Still, allow (left) Alt and/or (right) Control with AltGr
chars.
Handle keys using similar code as in the X11 backend. As we have
built a keymap in gdkkeys-win32.c anyway, use it by calling
gdk_keymap_translate_keyboard_state() to look up the keysym from
the virtual key code and keyboard state. Build the key event
string in exactly the same way as the X11 backend.
If an IME is being used, don't generate GDK events for keys
between receiving WM_IME_STARTCOMPOSITION and
WM_IME_ENDCOMPOSITION, as those keys are for the IME.
For WM_IME_COMPOSITION, handle all the Unicode chars returned from
the IME, not just the first one.
gdk_event_translate() is still quite complex, could split the
message handler cases out into separate functions.
On mouse events, when the mouse is grabbed, use
find_real_window_for_grabbed_mouse_event() in order to be able to
generate correct crossing events.
No longer take a pre-allocated GdkEvent as parameter. Instead,
allocate events as needed and append them to the queue. (This is
different from how gdk_event_translate() in the X11 backend
works.) This change made the code much clearer, especially in the
cases where we have to generate several GDK events for one Windows
message. Return FALSE if DefWindowProc() should be called, TRUE
if not. If DefWindowProc() should not be called, also return the
value to be returned from the window procedure.
(Previously, the interaction with gdk_event_translate()'s caller
was much more complex, when we had to indicate whether the
already-queued event should be left in the queue or removed, and
in addition also had to indicate whether to call DefWindowProc()
or not, and what value to return from the window procedure if
not.)
Don't use a separate "private" variable required to be pointing to
the GdkWindowObject of the "window" variable at all times. Just
use casts, even if looks a bit uglier.
Notice destroyed windows as early as possible, and break out of
the messsage switch.
Use _gdk_pointer_root as current_window when the pointer is
outside GDK's top-level windows.
On WM_INPUTLANGCHANGE, set _gdk_input_locale_is_ime as
appropriate, based on ImmIsIME().
(gdk_event_translate, gdk_event_send_client_message_for_display,
gdk_screen_broadcast_client_message): Implement client messages.
Use a registered Windows message to pass GDK client messages. Note
that the amount of user data is restricted to four bytes, as it is
carried in the LPARAM. (The WPARAM is used for the message type
"atom".)
(real_window_procedure): Adapt for new gdk_event_translate()
interface.
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Set
_gdk_input_locale_is_ime initially.
* gdk/win32/gdkwindow-win32.c: Use g_object_ref()/unref() instead
of g_colormap_ref()/unref().
(gdk_window_new): Made code a bit more like the X11 one, pretend
to handle screens (although we just have one for now).
* gdk/x11/gdkevents-x11.c
(gdk_event_send_client_message_for_display,
gdk_screen_broadcast_client_message): Document the user data
limitation on Win32.
* gdk/win32/gdkevents-win32.c (print_event): More complete enter
and leave notify detail output.
* gdk/win32/gdkkeys-win32.c (update_keymap): Make dead keys
visible to GDK and GTK. Store the corresponding GDK_dead_* keysym
for those, so that the GtkIMContextCimple compose tables will
work. Deduce if the keyboard layout has the AltGr key, and set the
above flag accordingly.
2003-07-26 01:54:59 +00:00
|
|
|
_gdk_input_locale_is_ime = ImmIsIME (_gdk_input_locale);
|
Implement the functions that until now just were non-functional stubs. For
2002-02-26 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkkeys-win32.c: Implement the functions that until
now just were non-functional stubs. For "hardware keycodes", we
use Windows virtual keycodes. Not scancodes, although that at
first might seem more low-level and a better match to X11
keycodes.
The Windows API is really mixed up and confused with respect to
scancodes and virtual keycodes. (Surprised?) Some scancodes are
generated by two keys on the keyboard (!), and although the
keyboard messages do have a flag to indicate which key the user
pressed, other API that take a scan code as input don't let you
specify which actual key you mean.
(update_keymap): Function to build a X11-like representation of
the keyboard. Each key has four keysyms: two levels (nonshifted
and shifted) and two groups (normal and with AltGr).
(gdk_keymap_get_direction): Use the codepage corresponding to the
thread's input locale, not the system codepage.
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwindow-win32.h
* gdk/win32/gdkwindow-win32.c: Remove the input_locale and
charset_info fields from GdkWindowImplWin32. Input locale is
per-thread in Windows, and as GDK on Windows really only works
when the GDI interaction all happens in just one thread anyway,
this state can be global. Use globals _gdk_input_locale and
_gdk_input_codepage instead. Set these based on the thread's input
locale (keyboard layout, or which IME is active).
* gdk/win32/gdkevents-win32.c: Set the group and hardware_keycode
fields in GDK key events. On input locale change messages, set
the global state variables, and inform update_keymap() that it
has to rebuild the keymap.
2002-02-26 01:18:27 +00:00
|
|
|
GetLocaleInfo (MAKELCID (LOWORD (_gdk_input_locale), SORT_DEFAULT),
|
|
|
|
LOCALE_IDEFAULTANSICODEPAGE,
|
|
|
|
buf, sizeof (buf));
|
|
|
|
_gdk_input_codepage = atoi (buf);
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("input_locale:%p, codepage:%d\n",
|
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_input_locale, _gdk_input_codepage));
|
Implement the functions that until now just were non-functional stubs. For
2002-02-26 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkkeys-win32.c: Implement the functions that until
now just were non-functional stubs. For "hardware keycodes", we
use Windows virtual keycodes. Not scancodes, although that at
first might seem more low-level and a better match to X11
keycodes.
The Windows API is really mixed up and confused with respect to
scancodes and virtual keycodes. (Surprised?) Some scancodes are
generated by two keys on the keyboard (!), and although the
keyboard messages do have a flag to indicate which key the user
pressed, other API that take a scan code as input don't let you
specify which actual key you mean.
(update_keymap): Function to build a X11-like representation of
the keyboard. Each key has four keysyms: two levels (nonshifted
and shifted) and two groups (normal and with AltGr).
(gdk_keymap_get_direction): Use the codepage corresponding to the
thread's input locale, not the system codepage.
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwindow-win32.h
* gdk/win32/gdkwindow-win32.c: Remove the input_locale and
charset_info fields from GdkWindowImplWin32. Input locale is
per-thread in Windows, and as GDK on Windows really only works
when the GDI interaction all happens in just one thread anyway,
this state can be global. Use globals _gdk_input_locale and
_gdk_input_codepage instead. Set these based on the thread's input
locale (keyboard layout, or which IME is active).
* gdk/win32/gdkevents-win32.c: Set the group and hardware_keycode
fields in GDK key events. On input locale change messages, set
the global state variables, and inform update_keymap() that it
has to rebuild the keymap.
2002-02-26 01:18:27 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
CoInitialize (NULL);
|
|
|
|
|
Bug 559408 - Transparency lost when images are copied between GTK+ and the
2009-01-29 Tor Lillqvist <tml@novell.com>
Bug 559408 - Transparency lost when images are copied between GTK+
and the clipboard on Windows
The code in gdkselection-win32.c is simplified quite a lot. When
an image is stored on the clipboard from GTK+, only the "PNG" and
CF_DIB formats are advertised. PNG is our preferred format because
it can losslessly represent any image that gdk-pixbuf can handle,
even with alpha, unambiguously. CF_DIB is also advertised because
of its ubiquitous support in Windows software.
Delayed rendering is used as before, so for other data than text
nothing is actually stored on the clipboard until some app asks
for it.
It's pointless to advertise images formats like "image/png" or
"image/x-MS-bmp" that no other Windows application is going to
look for anyway. Likewise it's pointless to store text under
formats like "text/plain" or "UTF8_STRING". Just store
CF_UNICODETEXT. CF_TEXT will be available as a synthesized format
anyways.
Office 2007 offers and asks for images in PNG format using the
registered clipboard format name "PNG", so we do likewise. If the
"PNG" format is available that is preferred when copying to GTK+
from the clipboard.
Unfortunately Word 2007 still uses CF_DIB without handling
alpha. But PowerPoint 2007 uses PNG if available and handles alpha
correctly. Both Word and Powerpoint offer PNG with alpha nicely.
Firefox and IE7 offer images that contain alpha as 32-bit version
3 BI_RGB DIBs with the undocumented "extra" bytes actually being
alpha. Also, alpha is premultiplied into the RGB bytes, presumably
because that is how AlphaBlend() wants such DIBs. That is also
taken care of. At least for Firefox it easy to be sure that a
CF_DIB on the clipboard is from Firefox.
Also some general stylistic cleanup, comment improvements, and
improvements of debugging printout especially in the clipboard
handling. Those are not detailled below.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkgmain-win32.c: Move some globals that were used
only in gdkselection-win32.c to be local to that file.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Don't
bother checking if text to be placed on the clipboard consists of
only ASCII.
* gdk/win32/gdkselection-win32.c: Add static variables for a list
of GdkPixbuf-supported formats, well-known registered clipboard
formats for images, and for GdkAtoms for well-known image and text
formats.
(_gdk_win32_selection_init): Initialize above static variables.
(selection_property_store) (gdk_selection_property_get)
(_gdk_selection_property_delete): Don't use a FIFO of GdkSelProps
for a window after all, it breaks testtext. See bug #163844.
(gdk_selection_convert): When converting to the TARGETS format,
i.e. when the caller wants to know what clipboard formats are
available, if PNG is available we report just that and skip
CF_DIB, JPEG and GIF even if advertised.
If CF_UNICODETEXT is available, report only UTF8_STRING.
When converting to the UTF8_STRING format, i.e. when the caller
wants text from the clipboard, try just CF_UNICODETEXT. There is
no point in trying CF_TEXT as Windows will synthesize
CF_UNICODETEXT from CF_TEXT anyway, if some app has stored just
CF_TEXT.
When converting to the image/bmp format, i.e. when the caller
wants an CF_DIB image from the clipboard, we check if the DIB is a
version 3 32-bit BI_RGB one that is likely to actually contain
alpha in the "extra" bytes. Such a DIB is likely to have
premultiplied alpha even, at least in the case of Firefox 3 and
IE7. We then edit the DIB in-place into a version 5 one in
BI_BITFIELDS format and undo the alpha premultiplication.
In any case, prepend a BMP file header before letting go of the
data which will be fed to the gdk-pixbuf bmp loader by upper
levels.
(gdk_win32_selection_add_targets): If some kind of pixmap image
format is being added, actually advertise just PNG and
CF_DIB. Note that alpha won't be stored on the clipboard through
CF_DIB. This is because gdk-pixbuf's bmp loader doesn't save
alpha. Furthermore, few if any non-GTK+ Windows apps seem to
understand a version 5 DIB with proper alpha anyway.
(_gdk_win32_selection_convert_to_dib): Simplified muchly.
svn path=/trunk/; revision=22255
2009-01-30 01:16:47 +00:00
|
|
|
_gdk_selection = gdk_atom_intern ("GDK_SELECTION", FALSE);
|
gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Add more
2005-11-01 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Add more
pre-interned GdkAtoms and pre-registered clipboard formats. Sort
their declarations, definitions and assignments into a more
logical and consistent order.
* gdk/win32/gdkmain-win32.c (_gdk_win32_cf_to_string): Include the
CF_ prefix for the predefined clipboard format names. Put quotes
around registered format names to distinguish them.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Return
immediately with a warning if the property type is STRING, TEXT,
COMPOUND_TEXT or SAVE_TARGETS, as these are X11-specific that we
should never pretend to handle on Win32. Handle only UTF8_STRING
here, other formats with delayed rendering. Use \uc1 instead of
\uc0 when generating Rich Text Format for easier testability on
XP, where WordPad misinterprets \uc0 encoded characters. Add more
GDK_NOTE debugging output for Clipboard operations.
* gdk/win32/gdkselection-win32.c: Debugging printout improvements.
(gdk_selection_convert): Don't pretent to handle STRING, just
UTF8_STRING. Streamline error handling, don't unnecessarily have a
GError which then isn't used for anything anyway if it gets set.
(gdk_win32_selection_add_targets): Skip also STRING, TEXT,
COMPOUND_TEXT and SAVE_TARGETS in addition to UTF8_STRING.
2005-11-01 15:29:59 +00:00
|
|
|
_wm_transient_for = gdk_atom_intern ("WM_TRANSIENT_FOR", FALSE);
|
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
|
|
|
_targets = gdk_atom_intern ("TARGETS", FALSE);
|
gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Add more
2005-11-01 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Add more
pre-interned GdkAtoms and pre-registered clipboard formats. Sort
their declarations, definitions and assignments into a more
logical and consistent order.
* gdk/win32/gdkmain-win32.c (_gdk_win32_cf_to_string): Include the
CF_ prefix for the predefined clipboard format names. Put quotes
around registered format names to distinguish them.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Return
immediately with a warning if the property type is STRING, TEXT,
COMPOUND_TEXT or SAVE_TARGETS, as these are X11-specific that we
should never pretend to handle on Win32. Handle only UTF8_STRING
here, other formats with delayed rendering. Use \uc1 instead of
\uc0 when generating Rich Text Format for easier testability on
XP, where WordPad misinterprets \uc0 encoded characters. Add more
GDK_NOTE debugging output for Clipboard operations.
* gdk/win32/gdkselection-win32.c: Debugging printout improvements.
(gdk_selection_convert): Don't pretent to handle STRING, just
UTF8_STRING. Streamline error handling, don't unnecessarily have a
GError which then isn't used for anything anyway if it gets set.
(gdk_win32_selection_add_targets): Skip also STRING, TEXT,
COMPOUND_TEXT and SAVE_TARGETS in addition to UTF8_STRING.
2005-11-01 15:29:59 +00:00
|
|
|
_save_targets = gdk_atom_intern ("SAVE_TARGETS", FALSE);
|
|
|
|
_utf8_string = gdk_atom_intern ("UTF8_STRING", FALSE);
|
|
|
|
_text = gdk_atom_intern ("TEXT", FALSE);
|
|
|
|
_compound_text = gdk_atom_intern ("COMPOUND_TEXT", FALSE);
|
2005-04-04 00:12:26 +00:00
|
|
|
_text_uri_list = gdk_atom_intern ("text/uri-list", FALSE);
|
|
|
|
|
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
|
|
|
_local_dnd = gdk_atom_intern ("LocalDndSelection", FALSE);
|
|
|
|
_gdk_win32_dropfiles = gdk_atom_intern ("DROPFILES_DND", FALSE);
|
|
|
|
_gdk_ole2_dnd = gdk_atom_intern ("OLE2_DND", FALSE);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2001-10-28 21:28:51 +00:00
|
|
|
_gdk_win32_selection_init ();
|
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
|
|
|
void
|
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_win32_api_failed (const gchar *where,
|
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
|
|
|
gint line,
|
|
|
|
const gchar *api)
|
2000-02-13 14:52:47 +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
|
|
|
gchar *msg = g_win32_error_message (GetLastError ());
|
|
|
|
g_warning ("%s:%d: %s failed: %s", where, line, api, msg);
|
|
|
|
g_free (msg);
|
|
|
|
}
|
2000-02-13 14:52:47 +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
|
|
|
void
|
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_other_api_failed (const gchar *where,
|
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
|
|
|
gint line,
|
|
|
|
const gchar *api)
|
|
|
|
{
|
|
|
|
g_warning ("%s:%d: %s failed", where, line, api);
|
2000-02-13 14:52:47 +00:00
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
void
|
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_set_use_xshm (gboolean use_xshm)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Always on */
|
|
|
|
}
|
|
|
|
|
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
|
|
|
gboolean
|
1999-11-11 22:12:27 +00:00
|
|
|
gdk_get_use_xshm (void)
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
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_screen_get_width (GdkScreen *screen)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2009-02-14 18:23:54 +00:00
|
|
|
//return GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (_gdk_root)->impl)->width;
|
|
|
|
return GDK_WINDOW_OBJECT (_gdk_root)->width;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
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_screen_get_height (GdkScreen *screen)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2009-02-14 18:23:54 +00:00
|
|
|
//return GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (_gdk_root)->impl)->height;
|
|
|
|
return GDK_WINDOW_OBJECT (_gdk_root)->height;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
gint
|
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_screen_get_width_mm (GdkScreen *screen)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2005-07-27 06:28:20 +00:00
|
|
|
return (double) gdk_screen_get_width (screen) / GetDeviceCaps (_gdk_display_hdc, LOGPIXELSX) * 25.4;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
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_screen_get_height_mm (GdkScreen *screen)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2005-07-27 06:28:20 +00:00
|
|
|
return (double) gdk_screen_get_height (screen) / GetDeviceCaps (_gdk_display_hdc, LOGPIXELSY) * 25.4;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
void
|
2002-09-30 19:38:12 +00:00
|
|
|
_gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
|
|
|
|
const gchar *sm_client_id)
|
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
|
|
|
{
|
|
|
|
g_warning("gdk_set_sm_client_id %s", sm_client_id ? sm_client_id : "NULL");
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
void
|
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_display_beep (GdkDisplay *display)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2002-06-20 23:59:27 +00:00
|
|
|
g_return_if_fail (display == gdk_display_get_default());
|
1999-11-11 22:12:27 +00:00
|
|
|
Beep(1000, 50);
|
|
|
|
}
|
|
|
|
|
1999-11-20 01:22:57 +00:00
|
|
|
void
|
Make gdkx.h the only installed header from gdk/x11. All structures in
Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com>
Make gdkx.h the only installed header from gdk/x11.
All structures in gdk/x11 are opaque.
* gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h:
Don't install gdk{drawable,pixmap,window}-x11.h.
* gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c:
Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11,
GdkVisualClass into C files.
* gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static.
* gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c,
gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c}
Add public functions to replace previously exported direct
structure access.
gdk_x11_colormap_get_{xdisplay,xcolormap}
gdk_x11_cursor_get_{xdisplay,xcursor},
gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual,
gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage},
gdk_x11_gc_get_{xdisplay,ximage}
* gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo,
GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals.
Fix a number of variables and functions that were exported
"accidentally" from GDK.
* gdk/**.[ch]: gdk => _gdk for gdk_visual_init,
gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit,
gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data,
gdk_event_notify, gdk_queued_events, gdk_queued_tail,
gdk_event_new, gdk_events_queue, gdk_events_unqueue,
gdk_event_queue_find_first, gdk_event_queue_remove_link,
gdk_event_queue_append, gdk_event_button_generate,
gdk_debug_flags, gdk_default_filters, gdk_parent_root.
* gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c,
gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}:
gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks,
gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window,
gdk_use_xshm, gdk_input_ignore_core.
* gdk/x11/xsettings-common.h (xsettings_list_insert): Add
#defines to namespace functions into the private _gdk_
namespace.
* gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window ()
to replace gdk_parent_root exported variable. Adjust and
deprecate GDK_ROOT_PARENT().
* demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix
GDK_ROOT_PARENT usage, remove includes of port-specific
headers.
* gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for
_gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core,
gdk_input_devices, _gdk_input_windows, gdk_init_input_core.
* gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c}
docs/Changes-2.0.txt: Remove gdk_wm_protocols,
gdk_wm_delete_window functions, gdk_wm_take_focus,
use gdk_atom_intern() instead.
* gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h}
gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h}
gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h}
gtk/gtkselection.c
Unexport gdk_selection_property, just use
gdk_atom_intern ("GDK_SELECTION").
* gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}:
Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type,
GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate,
GdkVisualprivate, gdk_x11_gc_flush.
Make a number of public exports of variables into functions
to increase encapsulation.
* gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h
gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer,
move to gdkinternals.h. Add gdk_device_get_core_pointer ().
* gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h
docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code,
gdk_error_warnings.
* gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h}
docs/Changes-2.0.txt:
s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen()
s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow()
Add gdk_x11_get_default_xdisplay().
* gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c
win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c
gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class,
Don't export gdk_progclass, move --class command line
option and handling to common portion of GDK.
Miscellaneous fixes:
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix
g_return_val_if_fail that should have been g_return_if_fail.
* gdk/gdkinternals.h gdk/gdkprivate.h: Move
gdk_synthesize_window_state() to the semi-public gdkprivate.h.
* gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded
X11 dependency.
* gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO:
Remove unused gdk_key_repeat_disable/restore.
* linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c
x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def:
Remove unused gdk_null_window_warnings variable.
* gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox;
it can be retrieved from the repository; it is too far
from functional to be worth having people check out;
it would be easier to start from scratch, I suspect.
* gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID().
* gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c
gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c:
Fix some accidentally global variables and unused global variables.
* gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c
gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c:
Fix some accidentally global variables and unused global variables.
Add some space for future expansion to multihead.
* gdk/gdkdrawable.h: Add four reserved function pointers
for future expansion of GdkDrawableClass.
* gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer
where we can put a GdkScreen * later.
2001-09-07 21:50:20 +00:00
|
|
|
_gdk_windowing_exit (void)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2001-10-28 21:28:51 +00:00
|
|
|
_gdk_win32_dnd_exit ();
|
1999-11-20 01:22:57 +00:00
|
|
|
CoUninitialize ();
|
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
|
|
|
DeleteDC (_gdk_display_hdc);
|
|
|
|
_gdk_display_hdc = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2002-11-16 21:51:47 +00:00
|
|
|
gchar *
|
|
|
|
gdk_get_display (void)
|
|
|
|
{
|
|
|
|
return g_strdup (gdk_display_get_name (gdk_display_get_default ()));
|
|
|
|
}
|
|
|
|
|
2002-01-17 20:45:23 +00:00
|
|
|
void
|
|
|
|
gdk_error_trap_push (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdk_error_trap_pop (void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2002-11-02 05:37:04 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
gdk_notify_startup_complete (void)
|
|
|
|
{
|
|
|
|
}
|
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
|
|
|
|
2007-03-15 16:48:26 +00:00
|
|
|
void
|
|
|
|
gdk_notify_startup_complete_with_id (const gchar* startup_id)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_startup_id (GdkWindow *window,
|
|
|
|
const gchar *startup_id)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
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
|
|
|
#ifdef G_ENABLE_DEBUG
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Like g_strdup_printf, but to a static buffer. Return value does not
|
|
|
|
* have to be g_free()d. The buffer is of bounded size and reused
|
|
|
|
* cyclically. Thus the return value is valid only until that part of
|
|
|
|
* the buffer happens to get reused. This doesn't matter as this
|
|
|
|
* function's return value is used in debugging output right after the call,
|
|
|
|
* and the return value isn't used after that.
|
|
|
|
*/
|
|
|
|
static gchar *
|
|
|
|
static_printf (const gchar *format,
|
2005-04-04 00:12:26 +00:00
|
|
|
...)
|
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
|
|
|
{
|
|
|
|
static gchar buf[10000];
|
|
|
|
gchar *msg;
|
|
|
|
static gchar *bufp = buf;
|
|
|
|
gchar *retval;
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start (args, format);
|
|
|
|
msg = g_strdup_vprintf (format, args);
|
|
|
|
va_end (args);
|
|
|
|
|
|
|
|
g_assert (strlen (msg) < sizeof (buf));
|
|
|
|
|
|
|
|
if (bufp + strlen (msg) + 1 > buf + sizeof (buf))
|
|
|
|
bufp = buf;
|
|
|
|
retval = bufp;
|
|
|
|
|
|
|
|
strcpy (bufp, msg);
|
|
|
|
bufp += strlen (msg) + 1;
|
|
|
|
g_free (msg);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_color_to_string (const GdkColor *color)
|
|
|
|
{
|
|
|
|
return static_printf ("(%.04x,%.04x,%.04x):%.06x",
|
|
|
|
color->red, color->green,
|
|
|
|
color->blue, color->pixel);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
|
|
|
|
const int nentries)
|
|
|
|
{
|
|
|
|
char buf[20];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < nentries; i++)
|
|
|
|
g_print (" %3d %02x: %02x %02x %02x%s\n",
|
|
|
|
i, i,
|
|
|
|
pep[i].peRed, pep[i].peGreen, pep[i].peBlue,
|
|
|
|
(pep[i].peFlags == 0 ? "" :
|
|
|
|
(pep[i].peFlags == PC_EXPLICIT ? " PC_EXPLICIT" :
|
|
|
|
(pep[i].peFlags == PC_NOCOLLAPSE ? " PC_NOCOLLAPSE" :
|
|
|
|
(pep[i].peFlags == PC_RESERVED ? " PC_RESERVED" :
|
2002-12-15 01:49:01 +00:00
|
|
|
(g_sprintf (buf, " %d", pep[i].peFlags), buf))))));
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gdk_win32_print_system_palette (void)
|
|
|
|
{
|
|
|
|
PALETTEENTRY *pe;
|
|
|
|
int k;
|
|
|
|
|
|
|
|
k = GetSystemPaletteEntries (_gdk_display_hdc, 0, 0, NULL);
|
|
|
|
pe = g_new (PALETTEENTRY, k);
|
|
|
|
k = GetSystemPaletteEntries (_gdk_display_hdc, 0, k, pe);
|
|
|
|
|
|
|
|
if (!k)
|
|
|
|
g_print ("GetSystemPaletteEntries failed: %s\n",
|
|
|
|
g_win32_error_message (GetLastError ()));
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_print ("System palette: %d entries\n", k);
|
|
|
|
_gdk_win32_print_paletteentries (pe, k);
|
|
|
|
}
|
|
|
|
g_free (pe);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
palette_size (HPALETTE hpal)
|
|
|
|
{
|
|
|
|
WORD npal = 0;
|
|
|
|
|
|
|
|
if (!GetObject (hpal, sizeof (npal), &npal))
|
|
|
|
WIN32_GDI_FAILED ("GetObject (HPALETTE)");
|
|
|
|
|
|
|
|
return npal;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gdk_win32_print_hpalette (HPALETTE hpal)
|
|
|
|
{
|
|
|
|
PALETTEENTRY *pe;
|
|
|
|
gint n, npal;
|
|
|
|
|
|
|
|
npal = palette_size (hpal);
|
|
|
|
pe = g_new (PALETTEENTRY, npal);
|
|
|
|
n = GetPaletteEntries (hpal, 0, npal, pe);
|
|
|
|
|
|
|
|
if (!n)
|
|
|
|
g_print ("HPALETTE %p: GetPaletteEntries failed: %s\n",
|
|
|
|
hpal, g_win32_error_message (GetLastError ()));
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_print ("HPALETTE %p: %d (%d) entries\n", hpal, n, npal);
|
|
|
|
_gdk_win32_print_paletteentries (pe, n);
|
|
|
|
}
|
|
|
|
g_free (pe);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gdk_win32_print_dc (HDC hdc)
|
|
|
|
{
|
|
|
|
HGDIOBJ obj;
|
|
|
|
LOGBRUSH logbrush;
|
|
|
|
EXTLOGPEN extlogpen;
|
|
|
|
HRGN hrgn;
|
|
|
|
RECT rect;
|
|
|
|
int flag;
|
|
|
|
|
Merge from stable:
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
2002-12-09 00:43:42 +00:00
|
|
|
g_print ("%p:\n", hdc);
|
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
|
|
|
obj = GetCurrentObject (hdc, OBJ_BRUSH);
|
|
|
|
GetObject (obj, sizeof (LOGBRUSH), &logbrush);
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
g_print ("brush: %s color=%06lx hatch=%p\n",
|
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_win32_lbstyle_to_string (logbrush.lbStyle),
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
logbrush.lbColor, (gpointer) logbrush.lbHatch);
|
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
|
|
|
obj = GetCurrentObject (hdc, OBJ_PEN);
|
|
|
|
GetObject (obj, sizeof (EXTLOGPEN), &extlogpen);
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
g_print ("pen: %s %s %s %s w=%d %s\n",
|
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_win32_pstype_to_string (extlogpen.elpPenStyle),
|
|
|
|
_gdk_win32_psstyle_to_string (extlogpen.elpPenStyle),
|
|
|
|
_gdk_win32_psendcap_to_string (extlogpen.elpPenStyle),
|
|
|
|
_gdk_win32_psjoin_to_string (extlogpen.elpPenStyle),
|
2008-08-04 23:21:36 +00:00
|
|
|
(int) extlogpen.elpWidth,
|
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_win32_lbstyle_to_string (extlogpen.elpBrushStyle));
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
g_print ("rop2: %s textcolor=%06lx\n",
|
|
|
|
_gdk_win32_rop2_to_string (GetROP2 (hdc)),
|
|
|
|
GetTextColor (hdc));
|
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
|
|
|
hrgn = CreateRectRgn (0, 0, 0, 0);
|
|
|
|
if ((flag = GetClipRgn (hdc, hrgn)) == -1)
|
|
|
|
WIN32_API_FAILED ("GetClipRgn");
|
|
|
|
else if (flag == 0)
|
|
|
|
g_print ("no clip region\n");
|
|
|
|
else if (flag == 1)
|
|
|
|
{
|
|
|
|
GetRgnBox (hrgn, &rect);
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
g_print ("clip region: %p bbox: %s\n",
|
|
|
|
hrgn, _gdk_win32_rect_to_string (&rect));
|
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
|
|
|
}
|
|
|
|
DeleteObject (hrgn);
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_cap_style_to_string (GdkCapStyle cap_style)
|
|
|
|
{
|
|
|
|
switch (cap_style)
|
|
|
|
{
|
|
|
|
#define CASE(x) case GDK_CAP_##x: return #x
|
|
|
|
CASE (NOT_LAST);
|
|
|
|
CASE (BUTT);
|
|
|
|
CASE (ROUND);
|
|
|
|
CASE (PROJECTING);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", cap_style);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_fill_style_to_string (GdkFill fill)
|
|
|
|
{
|
|
|
|
switch (fill)
|
|
|
|
{
|
|
|
|
#define CASE(x) case GDK_##x: return #x
|
|
|
|
CASE (SOLID);
|
|
|
|
CASE (TILED);
|
|
|
|
CASE (STIPPLED);
|
|
|
|
CASE (OPAQUE_STIPPLED);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", fill);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_function_to_string (GdkFunction function)
|
|
|
|
{
|
|
|
|
switch (function)
|
|
|
|
{
|
|
|
|
#define CASE(x) case GDK_##x: return #x
|
|
|
|
CASE (COPY);
|
|
|
|
CASE (INVERT);
|
|
|
|
CASE (XOR);
|
|
|
|
CASE (CLEAR);
|
|
|
|
CASE (AND);
|
|
|
|
CASE (AND_REVERSE);
|
|
|
|
CASE (AND_INVERT);
|
|
|
|
CASE (NOOP);
|
|
|
|
CASE (OR);
|
|
|
|
CASE (EQUIV);
|
|
|
|
CASE (OR_REVERSE);
|
|
|
|
CASE (COPY_INVERT);
|
|
|
|
CASE (OR_INVERT);
|
|
|
|
CASE (NAND);
|
|
|
|
CASE (SET);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", function);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_join_style_to_string (GdkJoinStyle join_style)
|
|
|
|
{
|
|
|
|
switch (join_style)
|
|
|
|
{
|
|
|
|
#define CASE(x) case GDK_JOIN_##x: return #x
|
|
|
|
CASE (MITER);
|
|
|
|
CASE (ROUND);
|
|
|
|
CASE (BEVEL);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", join_style);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_line_style_to_string (GdkLineStyle line_style)
|
|
|
|
{
|
|
|
|
switch (line_style)
|
|
|
|
{
|
|
|
|
#define CASE(x) case GDK_LINE_##x: return #x
|
|
|
|
CASE(SOLID);
|
|
|
|
CASE(ON_OFF_DASH);
|
|
|
|
CASE(DOUBLE_DASH);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", line_style);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-03-11 14:09:13 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol)
|
|
|
|
{
|
|
|
|
switch (protocol)
|
|
|
|
{
|
|
|
|
#define CASE(x) case GDK_DRAG_PROTO_##x: return #x
|
|
|
|
CASE (MOTIF);
|
|
|
|
CASE (XDND);
|
|
|
|
CASE (ROOTWIN);
|
|
|
|
CASE (NONE);
|
|
|
|
CASE (WIN32_DROPFILES);
|
|
|
|
CASE (OLE2);
|
|
|
|
CASE (LOCAL);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", protocol);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask)
|
|
|
|
{
|
|
|
|
gchar buf[400];
|
|
|
|
gchar *bufp = buf;
|
|
|
|
gchar *s = "";
|
|
|
|
|
Merge from stable:
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
2002-12-09 00:43:42 +00:00
|
|
|
buf[0] = '\0';
|
|
|
|
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
#define BIT(x) \
|
|
|
|
if (mask & GDK_GC_##x) \
|
2002-12-15 01:49:01 +00:00
|
|
|
(bufp += g_sprintf (bufp, "%s" #x, s), s = "|")
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
|
|
|
|
BIT (FOREGROUND);
|
|
|
|
BIT (BACKGROUND);
|
|
|
|
BIT (FONT);
|
|
|
|
BIT (FUNCTION);
|
|
|
|
BIT (FILL);
|
|
|
|
BIT (TILE);
|
|
|
|
BIT (STIPPLE);
|
|
|
|
BIT (CLIP_MASK);
|
|
|
|
BIT (SUBWINDOW);
|
|
|
|
BIT (TS_X_ORIGIN);
|
|
|
|
BIT (TS_Y_ORIGIN);
|
|
|
|
BIT (CLIP_X_ORIGIN);
|
|
|
|
BIT (CLIP_Y_ORIGIN);
|
|
|
|
BIT (EXPOSURES);
|
|
|
|
BIT (LINE_WIDTH);
|
|
|
|
BIT (LINE_STYLE);
|
|
|
|
BIT (CAP_STYLE);
|
|
|
|
BIT (JOIN_STYLE);
|
|
|
|
#undef BIT
|
|
|
|
|
|
|
|
return static_printf ("%s", buf);
|
|
|
|
}
|
|
|
|
|
Merge from stable:
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
stipple_gc. More checks for errors. Use correct ternary ROP when
blitting the foreground into the tile pixmap onto those pixels
where the stipple is set. (I didn't notice that I had used the
wrong one, as it didn't matter on Win2k, where DIB sections
apparently are zeroed upon creation. But on Win98 they have random
initial contents. Thanks to Hans Breuer for reporting this.)
(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
generic_draw() if drawing a filled figure.
* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
(_gdk_win32_window_state_to_string): New debugging output helper
function.
* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
unmapping on X11. Set window state correctly for all three of
SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
("minimized" in Windows terminology) window still has the
"maximized" property, i.e. when deiconified, it will reappear as
maximized. (#10557)
* gdk/win32/gdkprivate-win32.h: Declare new function.
(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.
* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
situations. Add parameter to tell whether deiconifying. Code
reorg: Return early when appropriate instead of using nested if
statements. If just deiconifying without raising, restore active
window. (#10557)
(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
gdk_window_focus): Use _gdk_win32_window_state_to_string() in
debugging output.
(gdk_window_iconify): Restore active window after calling
ShowWindow(). Otherwise the "next" window gets activated.
(gdk_window_stick, gdk_window_unstick): Don't output any warnings.
(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
with GWL_HWNDPARENT, which despite its name sets the *owner*
window, which should be exactly what we want. The PSDK
documentation is said to be misleading. testgtk's modal window
test now works much better. (#50586)
2002-12-09 00:43:42 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_window_state_to_string (GdkWindowState state)
|
|
|
|
{
|
|
|
|
gchar buf[100];
|
|
|
|
gchar *bufp = buf;
|
|
|
|
gchar *s = "";
|
|
|
|
|
|
|
|
buf[0] = '\0';
|
|
|
|
|
|
|
|
#define BIT(x) \
|
|
|
|
if (state & GDK_WINDOW_STATE_ ## x) \
|
|
|
|
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
|
|
|
|
|
|
|
|
/* For clarity, also show the complement of WITHDRAWN, i.e. "MAPPED" */
|
|
|
|
if (!(state & GDK_WINDOW_STATE_WITHDRAWN))
|
|
|
|
(bufp += sprintf (bufp, "MAPPED"), s = "|");
|
|
|
|
|
|
|
|
BIT (WITHDRAWN);
|
|
|
|
BIT (ICONIFIED);
|
|
|
|
BIT (MAXIMIZED);
|
|
|
|
BIT (STICKY);
|
|
|
|
#undef BIT
|
|
|
|
|
|
|
|
return static_printf ("%s", buf);
|
|
|
|
}
|
|
|
|
|
2008-03-10 15:48:06 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_window_style_to_string (LONG style)
|
|
|
|
{
|
|
|
|
gchar buf[1000];
|
|
|
|
gchar *bufp = buf;
|
|
|
|
gchar *s = "";
|
|
|
|
|
|
|
|
buf[0] = '\0';
|
|
|
|
|
|
|
|
#define BIT(x) \
|
2008-10-05 00:00:10 +00:00
|
|
|
if (style & WS_ ## x) \
|
2008-03-10 15:48:06 +00:00
|
|
|
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
|
|
|
|
|
|
|
|
/* Note that many of the WS_* macros are in face several bits.
|
|
|
|
* Handle just the individual bits here. Sort as in w32api's
|
|
|
|
* winuser.h.
|
|
|
|
*/
|
|
|
|
BIT (BORDER);
|
|
|
|
BIT (CHILD);
|
|
|
|
BIT (CLIPCHILDREN);
|
|
|
|
BIT (CLIPSIBLINGS);
|
|
|
|
BIT (DISABLED);
|
|
|
|
BIT (DLGFRAME);
|
|
|
|
BIT (GROUP);
|
|
|
|
BIT (HSCROLL);
|
|
|
|
BIT (ICONIC);
|
|
|
|
BIT (MAXIMIZE);
|
|
|
|
BIT (MAXIMIZEBOX);
|
|
|
|
BIT (MINIMIZE);
|
|
|
|
BIT (MINIMIZEBOX);
|
|
|
|
BIT (POPUP);
|
|
|
|
BIT (SIZEBOX);
|
|
|
|
BIT (SYSMENU);
|
|
|
|
BIT (TABSTOP);
|
|
|
|
BIT (THICKFRAME);
|
|
|
|
BIT (VISIBLE);
|
|
|
|
BIT (VSCROLL);
|
|
|
|
#undef BIT
|
|
|
|
|
|
|
|
return static_printf ("%s", buf);
|
|
|
|
}
|
|
|
|
|
2008-10-05 00:00:10 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_window_exstyle_to_string (LONG style)
|
|
|
|
{
|
|
|
|
gchar buf[1000];
|
|
|
|
gchar *bufp = buf;
|
|
|
|
gchar *s = "";
|
|
|
|
|
|
|
|
buf[0] = '\0';
|
|
|
|
|
|
|
|
#define BIT(x) \
|
|
|
|
if (style & WS_EX_ ## x) \
|
|
|
|
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
|
|
|
|
|
|
|
|
/* Note that many of the WS_EX_* macros are in face several bits.
|
|
|
|
* Handle just the individual bits here. Sort as in w32api's
|
|
|
|
* winuser.h.
|
|
|
|
*/
|
|
|
|
BIT (ACCEPTFILES);
|
|
|
|
BIT (APPWINDOW);
|
|
|
|
BIT (CLIENTEDGE);
|
|
|
|
BIT (COMPOSITED);
|
|
|
|
BIT (CONTEXTHELP);
|
|
|
|
BIT (CONTROLPARENT);
|
|
|
|
BIT (DLGMODALFRAME);
|
|
|
|
BIT (LAYERED);
|
|
|
|
BIT (LAYOUTRTL);
|
|
|
|
BIT (LEFTSCROLLBAR);
|
|
|
|
BIT (MDICHILD);
|
|
|
|
BIT (NOACTIVATE);
|
|
|
|
BIT (NOINHERITLAYOUT);
|
|
|
|
BIT (NOPARENTNOTIFY);
|
|
|
|
BIT (RIGHT);
|
|
|
|
BIT (RTLREADING);
|
|
|
|
BIT (STATICEDGE);
|
|
|
|
BIT (TOOLWINDOW);
|
|
|
|
BIT (TOPMOST);
|
|
|
|
BIT (TRANSPARENT);
|
|
|
|
BIT (WINDOWEDGE);
|
|
|
|
#undef BIT
|
|
|
|
|
|
|
|
return static_printf ("%s", buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_window_pos_bits_to_string (UINT flags)
|
|
|
|
{
|
|
|
|
gchar buf[1000];
|
|
|
|
gchar *bufp = buf;
|
|
|
|
gchar *s = "";
|
|
|
|
|
|
|
|
buf[0] = '\0';
|
|
|
|
|
|
|
|
#define BIT(x) \
|
|
|
|
if (flags & SWP_ ## x) \
|
|
|
|
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
|
|
|
|
|
|
|
|
BIT (DRAWFRAME);
|
|
|
|
BIT (FRAMECHANGED);
|
|
|
|
BIT (HIDEWINDOW);
|
|
|
|
BIT (NOACTIVATE);
|
|
|
|
BIT (NOCOPYBITS);
|
|
|
|
BIT (NOMOVE);
|
|
|
|
BIT (NOSIZE);
|
|
|
|
BIT (NOREDRAW);
|
|
|
|
BIT (NOZORDER);
|
|
|
|
BIT (SHOWWINDOW);
|
|
|
|
BIT (NOOWNERZORDER);
|
|
|
|
BIT (NOSENDCHANGING);
|
|
|
|
BIT (DEFERERASE);
|
|
|
|
BIT (ASYNCWINDOWPOS);
|
|
|
|
#undef BIT
|
|
|
|
|
|
|
|
return static_printf ("%s", buf);
|
|
|
|
}
|
|
|
|
|
2009-03-11 14:09:13 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_drag_action_to_string (GdkDragAction actions)
|
|
|
|
{
|
|
|
|
gchar buf[100];
|
|
|
|
gchar *bufp = buf;
|
|
|
|
gchar *s = "";
|
|
|
|
|
|
|
|
buf[0] = '\0';
|
|
|
|
|
|
|
|
#define BIT(x) \
|
|
|
|
if (actions & GDK_ACTION_ ## x) \
|
|
|
|
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
|
|
|
|
|
|
|
|
BIT (DEFAULT);
|
|
|
|
BIT (COPY);
|
|
|
|
BIT (MOVE);
|
|
|
|
BIT (LINK);
|
|
|
|
BIT (PRIVATE);
|
|
|
|
BIT (ASK);
|
|
|
|
#undef BIT
|
|
|
|
|
|
|
|
return static_printf ("%s", buf);
|
|
|
|
}
|
|
|
|
|
Reflect recent renamings and removals of functions.
2002-11-15 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def: Reflect recent renamings and removals of functions.
Merge from stable:
Start implementing all fill styles (i.e. tiled, stippled, and
opaque stippled in addition to the plain solid style) in the Win32
backend in an elegant and generic way. For now only did the
draw_rectangle() and draw_glyphs() methods. The rest will
follow. Previously some of the drawing methods implemented opaque
stippling, but not tiles or non-opaque stippling.
Seems to work fine, now the check marks show up in check buttons,
the stippled background and stippled text in gtk-demo's Text
Widget look as they should, and GtkText's line wrap arrow shows
correctly instead of an ugly rectangle. [This refers to the stable
branch, haven't actually checked HEAD.]
The implementation does do a lot of pixmap handling and blitting
back and forth, especially on Win9x. But performance is hopefully
not an issue. I don't think many applications do a lot of tiled or
stippled drawing.
* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
calls a GDI function and prints a warning if it failed. Also
API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
GDI_CALL (BlaBla, ()). Declare new functions.
* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.
(generic_draw): New function that handles all the blitting
necessary to implement tiles and stipples. A function that
actually draws stuff is passed as a parameter to
generic_draw(). If the fill style is solid, it is called
directly, to draw on the destination drawable. Otherwise it is
called to draw on a temporary mask bitmap, which then is used in
blitting operations. The tiles and/or stipples are rendered into
another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
it is used, otherwise a sequence of BitBlt() is used to do the
final composition onto the destination drawable.
(draw_tiles_lowlevel, draw_tiles): Some renaming and code
reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().
(rop2_to_rop3): New function, does binary->ternary rop mapping.
(blit_from_pixmap, blit_inside_window, blit_from_window): Use
rop2_to_rop3(). Previously used SRCCOPY always...
(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
gdk_win32_draw_glyphs): Split functionality into two functions,
with generic_draw() doing its magic inbetween.
* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
was ifdeffed out and wouldn't have done anything even if
enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
have any effect any more anyway after all the changes GTK+ has
gone through in the last years. Remove some #if 0 code.
* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
to NULL in case a GC is copied while it has a Windows DC active.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.
* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
option. If there is a PRETEND_WIN9X envvar, set windows_version as
if on Win9x.
* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
used or exported. Make a bit more like the X11 version. Hopefully
I didn't break the fragile palettized display ("pseudocolor")
code.
* gdk/win32/gdkgc-win32.c: Various debugging output improvements.
(predraw_set_foreground): Check whether
tile/stipple origins are valid when calling SetBrushOrgEx().
(gdk_win32_hdc_get): Ifdef out code that tries to handle the
stipple by converting it into a region, and combining the clip
region with that. A stipple shouldn't work like that, it should
replicate in x and y directions. Stipples are now handled by
generic_draw() in gdkdrawable-win32.c.
* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
gdk_win32_rop2_to_string): New debugging functions.
(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_rop2_to_string (int rop2)
|
|
|
|
{
|
|
|
|
switch (rop2)
|
|
|
|
{
|
|
|
|
#define CASE(x) case R2_##x: return #x
|
|
|
|
CASE (BLACK);
|
|
|
|
CASE (COPYPEN);
|
|
|
|
CASE (MASKNOTPEN);
|
|
|
|
CASE (MASKPEN);
|
|
|
|
CASE (MASKPENNOT);
|
|
|
|
CASE (MERGENOTPEN);
|
|
|
|
CASE (MERGEPEN);
|
|
|
|
CASE (MERGEPENNOT);
|
|
|
|
CASE (NOP);
|
|
|
|
CASE (NOT);
|
|
|
|
CASE (NOTCOPYPEN);
|
|
|
|
CASE (NOTMASKPEN);
|
|
|
|
CASE (NOTMERGEPEN);
|
|
|
|
CASE (NOTXORPEN);
|
|
|
|
CASE (WHITE);
|
|
|
|
CASE (XORPEN);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%x", rop2);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
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
|
|
|
gchar *
|
|
|
|
_gdk_win32_lbstyle_to_string (UINT brush_style)
|
|
|
|
{
|
|
|
|
switch (brush_style)
|
|
|
|
{
|
|
|
|
#define CASE(x) case BS_##x: return #x
|
|
|
|
CASE (DIBPATTERN);
|
|
|
|
CASE (DIBPATTERNPT);
|
|
|
|
CASE (HATCHED);
|
|
|
|
CASE (HOLLOW);
|
|
|
|
CASE (PATTERN);
|
|
|
|
CASE (SOLID);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", brush_style);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_pstype_to_string (DWORD pen_style)
|
|
|
|
{
|
|
|
|
switch (pen_style & PS_TYPE_MASK)
|
|
|
|
{
|
|
|
|
case PS_GEOMETRIC: return "GEOMETRIC";
|
|
|
|
case PS_COSMETIC: return "COSMETIC";
|
|
|
|
default: return static_printf ("illegal_%d", pen_style & PS_TYPE_MASK);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_psstyle_to_string (DWORD pen_style)
|
|
|
|
{
|
|
|
|
switch (pen_style & PS_STYLE_MASK)
|
|
|
|
{
|
|
|
|
#define CASE(x) case PS_##x: return #x
|
2005-07-27 06:28:20 +00:00
|
|
|
CASE (ALTERNATE);
|
|
|
|
CASE (SOLID);
|
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
|
|
|
CASE (DASH);
|
2005-07-27 06:28:20 +00:00
|
|
|
CASE (DOT);
|
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
|
|
|
CASE (DASHDOT);
|
|
|
|
CASE (DASHDOTDOT);
|
|
|
|
CASE (NULL);
|
|
|
|
CASE (USERSTYLE);
|
2005-07-27 06:28:20 +00:00
|
|
|
CASE (INSIDEFRAME);
|
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
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", pen_style & PS_STYLE_MASK);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_psendcap_to_string (DWORD pen_style)
|
|
|
|
{
|
|
|
|
switch (pen_style & PS_ENDCAP_MASK)
|
|
|
|
{
|
|
|
|
#define CASE(x) case PS_ENDCAP_##x: return #x
|
|
|
|
CASE (ROUND);
|
|
|
|
CASE (SQUARE);
|
2005-07-27 06:28:20 +00:00
|
|
|
CASE (FLAT);
|
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
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", pen_style & PS_ENDCAP_MASK);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_psjoin_to_string (DWORD pen_style)
|
|
|
|
{
|
|
|
|
switch (pen_style & PS_JOIN_MASK)
|
|
|
|
{
|
|
|
|
#define CASE(x) case PS_JOIN_##x: return #x
|
2005-07-27 06:28:20 +00:00
|
|
|
CASE (ROUND);
|
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
|
|
|
CASE (BEVEL);
|
|
|
|
CASE (MITER);
|
|
|
|
#undef CASE
|
|
|
|
default: return static_printf ("illegal_%d", pen_style & PS_JOIN_MASK);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_message_to_string (UINT msg)
|
|
|
|
{
|
|
|
|
switch (msg)
|
|
|
|
{
|
|
|
|
#define CASE(x) case x: return #x
|
|
|
|
CASE (WM_NULL);
|
|
|
|
CASE (WM_CREATE);
|
|
|
|
CASE (WM_DESTROY);
|
|
|
|
CASE (WM_MOVE);
|
|
|
|
CASE (WM_SIZE);
|
|
|
|
CASE (WM_ACTIVATE);
|
|
|
|
CASE (WM_SETFOCUS);
|
|
|
|
CASE (WM_KILLFOCUS);
|
|
|
|
CASE (WM_ENABLE);
|
|
|
|
CASE (WM_SETREDRAW);
|
|
|
|
CASE (WM_SETTEXT);
|
|
|
|
CASE (WM_GETTEXT);
|
|
|
|
CASE (WM_GETTEXTLENGTH);
|
|
|
|
CASE (WM_PAINT);
|
|
|
|
CASE (WM_CLOSE);
|
|
|
|
CASE (WM_QUERYENDSESSION);
|
|
|
|
CASE (WM_QUERYOPEN);
|
|
|
|
CASE (WM_ENDSESSION);
|
|
|
|
CASE (WM_QUIT);
|
|
|
|
CASE (WM_ERASEBKGND);
|
|
|
|
CASE (WM_SYSCOLORCHANGE);
|
|
|
|
CASE (WM_SHOWWINDOW);
|
|
|
|
CASE (WM_WININICHANGE);
|
|
|
|
CASE (WM_DEVMODECHANGE);
|
|
|
|
CASE (WM_ACTIVATEAPP);
|
|
|
|
CASE (WM_FONTCHANGE);
|
|
|
|
CASE (WM_TIMECHANGE);
|
|
|
|
CASE (WM_CANCELMODE);
|
|
|
|
CASE (WM_SETCURSOR);
|
|
|
|
CASE (WM_MOUSEACTIVATE);
|
|
|
|
CASE (WM_CHILDACTIVATE);
|
|
|
|
CASE (WM_QUEUESYNC);
|
|
|
|
CASE (WM_GETMINMAXINFO);
|
|
|
|
CASE (WM_PAINTICON);
|
|
|
|
CASE (WM_ICONERASEBKGND);
|
|
|
|
CASE (WM_NEXTDLGCTL);
|
|
|
|
CASE (WM_SPOOLERSTATUS);
|
|
|
|
CASE (WM_DRAWITEM);
|
|
|
|
CASE (WM_MEASUREITEM);
|
|
|
|
CASE (WM_DELETEITEM);
|
|
|
|
CASE (WM_VKEYTOITEM);
|
|
|
|
CASE (WM_CHARTOITEM);
|
|
|
|
CASE (WM_SETFONT);
|
|
|
|
CASE (WM_GETFONT);
|
|
|
|
CASE (WM_SETHOTKEY);
|
|
|
|
CASE (WM_GETHOTKEY);
|
|
|
|
CASE (WM_QUERYDRAGICON);
|
|
|
|
CASE (WM_COMPAREITEM);
|
|
|
|
CASE (WM_GETOBJECT);
|
|
|
|
CASE (WM_COMPACTING);
|
|
|
|
CASE (WM_WINDOWPOSCHANGING);
|
|
|
|
CASE (WM_WINDOWPOSCHANGED);
|
|
|
|
CASE (WM_POWER);
|
|
|
|
CASE (WM_COPYDATA);
|
|
|
|
CASE (WM_CANCELJOURNAL);
|
|
|
|
CASE (WM_NOTIFY);
|
|
|
|
CASE (WM_INPUTLANGCHANGEREQUEST);
|
|
|
|
CASE (WM_INPUTLANGCHANGE);
|
|
|
|
CASE (WM_TCARD);
|
|
|
|
CASE (WM_HELP);
|
|
|
|
CASE (WM_USERCHANGED);
|
|
|
|
CASE (WM_NOTIFYFORMAT);
|
|
|
|
CASE (WM_CONTEXTMENU);
|
|
|
|
CASE (WM_STYLECHANGING);
|
|
|
|
CASE (WM_STYLECHANGED);
|
|
|
|
CASE (WM_DISPLAYCHANGE);
|
|
|
|
CASE (WM_GETICON);
|
|
|
|
CASE (WM_SETICON);
|
|
|
|
CASE (WM_NCCREATE);
|
|
|
|
CASE (WM_NCDESTROY);
|
|
|
|
CASE (WM_NCCALCSIZE);
|
|
|
|
CASE (WM_NCHITTEST);
|
|
|
|
CASE (WM_NCPAINT);
|
|
|
|
CASE (WM_NCACTIVATE);
|
|
|
|
CASE (WM_GETDLGCODE);
|
|
|
|
CASE (WM_SYNCPAINT);
|
|
|
|
CASE (WM_NCMOUSEMOVE);
|
|
|
|
CASE (WM_NCLBUTTONDOWN);
|
|
|
|
CASE (WM_NCLBUTTONUP);
|
|
|
|
CASE (WM_NCLBUTTONDBLCLK);
|
|
|
|
CASE (WM_NCRBUTTONDOWN);
|
|
|
|
CASE (WM_NCRBUTTONUP);
|
|
|
|
CASE (WM_NCRBUTTONDBLCLK);
|
|
|
|
CASE (WM_NCMBUTTONDOWN);
|
|
|
|
CASE (WM_NCMBUTTONUP);
|
|
|
|
CASE (WM_NCMBUTTONDBLCLK);
|
|
|
|
CASE (WM_NCXBUTTONDOWN);
|
|
|
|
CASE (WM_NCXBUTTONUP);
|
|
|
|
CASE (WM_NCXBUTTONDBLCLK);
|
|
|
|
CASE (WM_KEYDOWN);
|
|
|
|
CASE (WM_KEYUP);
|
|
|
|
CASE (WM_CHAR);
|
|
|
|
CASE (WM_DEADCHAR);
|
|
|
|
CASE (WM_SYSKEYDOWN);
|
|
|
|
CASE (WM_SYSKEYUP);
|
|
|
|
CASE (WM_SYSCHAR);
|
|
|
|
CASE (WM_SYSDEADCHAR);
|
|
|
|
CASE (WM_KEYLAST);
|
|
|
|
CASE (WM_IME_STARTCOMPOSITION);
|
|
|
|
CASE (WM_IME_ENDCOMPOSITION);
|
|
|
|
CASE (WM_IME_COMPOSITION);
|
|
|
|
CASE (WM_INITDIALOG);
|
|
|
|
CASE (WM_COMMAND);
|
|
|
|
CASE (WM_SYSCOMMAND);
|
|
|
|
CASE (WM_TIMER);
|
|
|
|
CASE (WM_HSCROLL);
|
|
|
|
CASE (WM_VSCROLL);
|
|
|
|
CASE (WM_INITMENU);
|
|
|
|
CASE (WM_INITMENUPOPUP);
|
|
|
|
CASE (WM_MENUSELECT);
|
|
|
|
CASE (WM_MENUCHAR);
|
|
|
|
CASE (WM_ENTERIDLE);
|
|
|
|
CASE (WM_MENURBUTTONUP);
|
|
|
|
CASE (WM_MENUDRAG);
|
|
|
|
CASE (WM_MENUGETOBJECT);
|
|
|
|
CASE (WM_UNINITMENUPOPUP);
|
|
|
|
CASE (WM_MENUCOMMAND);
|
|
|
|
CASE (WM_CHANGEUISTATE);
|
|
|
|
CASE (WM_UPDATEUISTATE);
|
|
|
|
CASE (WM_QUERYUISTATE);
|
|
|
|
CASE (WM_CTLCOLORMSGBOX);
|
|
|
|
CASE (WM_CTLCOLOREDIT);
|
|
|
|
CASE (WM_CTLCOLORLISTBOX);
|
|
|
|
CASE (WM_CTLCOLORBTN);
|
|
|
|
CASE (WM_CTLCOLORDLG);
|
|
|
|
CASE (WM_CTLCOLORSCROLLBAR);
|
|
|
|
CASE (WM_CTLCOLORSTATIC);
|
|
|
|
CASE (WM_MOUSEMOVE);
|
|
|
|
CASE (WM_LBUTTONDOWN);
|
|
|
|
CASE (WM_LBUTTONUP);
|
|
|
|
CASE (WM_LBUTTONDBLCLK);
|
|
|
|
CASE (WM_RBUTTONDOWN);
|
|
|
|
CASE (WM_RBUTTONUP);
|
|
|
|
CASE (WM_RBUTTONDBLCLK);
|
|
|
|
CASE (WM_MBUTTONDOWN);
|
|
|
|
CASE (WM_MBUTTONUP);
|
|
|
|
CASE (WM_MBUTTONDBLCLK);
|
|
|
|
CASE (WM_MOUSEWHEEL);
|
|
|
|
CASE (WM_XBUTTONDOWN);
|
|
|
|
CASE (WM_XBUTTONUP);
|
|
|
|
CASE (WM_XBUTTONDBLCLK);
|
|
|
|
CASE (WM_PARENTNOTIFY);
|
|
|
|
CASE (WM_ENTERMENULOOP);
|
|
|
|
CASE (WM_EXITMENULOOP);
|
|
|
|
CASE (WM_NEXTMENU);
|
|
|
|
CASE (WM_SIZING);
|
|
|
|
CASE (WM_CAPTURECHANGED);
|
|
|
|
CASE (WM_MOVING);
|
|
|
|
CASE (WM_POWERBROADCAST);
|
|
|
|
CASE (WM_DEVICECHANGE);
|
|
|
|
CASE (WM_MDICREATE);
|
|
|
|
CASE (WM_MDIDESTROY);
|
|
|
|
CASE (WM_MDIACTIVATE);
|
|
|
|
CASE (WM_MDIRESTORE);
|
|
|
|
CASE (WM_MDINEXT);
|
|
|
|
CASE (WM_MDIMAXIMIZE);
|
|
|
|
CASE (WM_MDITILE);
|
|
|
|
CASE (WM_MDICASCADE);
|
|
|
|
CASE (WM_MDIICONARRANGE);
|
|
|
|
CASE (WM_MDIGETACTIVE);
|
|
|
|
CASE (WM_MDISETMENU);
|
|
|
|
CASE (WM_ENTERSIZEMOVE);
|
|
|
|
CASE (WM_EXITSIZEMOVE);
|
|
|
|
CASE (WM_DROPFILES);
|
|
|
|
CASE (WM_MDIREFRESHMENU);
|
|
|
|
CASE (WM_IME_SETCONTEXT);
|
|
|
|
CASE (WM_IME_NOTIFY);
|
|
|
|
CASE (WM_IME_CONTROL);
|
|
|
|
CASE (WM_IME_COMPOSITIONFULL);
|
|
|
|
CASE (WM_IME_SELECT);
|
|
|
|
CASE (WM_IME_CHAR);
|
|
|
|
CASE (WM_IME_REQUEST);
|
|
|
|
CASE (WM_IME_KEYDOWN);
|
|
|
|
CASE (WM_IME_KEYUP);
|
|
|
|
CASE (WM_MOUSEHOVER);
|
|
|
|
CASE (WM_MOUSELEAVE);
|
|
|
|
CASE (WM_NCMOUSEHOVER);
|
|
|
|
CASE (WM_NCMOUSELEAVE);
|
|
|
|
CASE (WM_CUT);
|
|
|
|
CASE (WM_COPY);
|
|
|
|
CASE (WM_PASTE);
|
|
|
|
CASE (WM_CLEAR);
|
|
|
|
CASE (WM_UNDO);
|
|
|
|
CASE (WM_RENDERFORMAT);
|
|
|
|
CASE (WM_RENDERALLFORMATS);
|
|
|
|
CASE (WM_DESTROYCLIPBOARD);
|
|
|
|
CASE (WM_DRAWCLIPBOARD);
|
|
|
|
CASE (WM_PAINTCLIPBOARD);
|
|
|
|
CASE (WM_VSCROLLCLIPBOARD);
|
|
|
|
CASE (WM_SIZECLIPBOARD);
|
|
|
|
CASE (WM_ASKCBFORMATNAME);
|
|
|
|
CASE (WM_CHANGECBCHAIN);
|
|
|
|
CASE (WM_HSCROLLCLIPBOARD);
|
|
|
|
CASE (WM_QUERYNEWPALETTE);
|
|
|
|
CASE (WM_PALETTEISCHANGING);
|
|
|
|
CASE (WM_PALETTECHANGED);
|
|
|
|
CASE (WM_HOTKEY);
|
|
|
|
CASE (WM_PRINT);
|
|
|
|
CASE (WM_PRINTCLIENT);
|
|
|
|
CASE (WM_APPCOMMAND);
|
|
|
|
CASE (WM_HANDHELDFIRST);
|
|
|
|
CASE (WM_HANDHELDLAST);
|
|
|
|
CASE (WM_AFXFIRST);
|
|
|
|
CASE (WM_AFXLAST);
|
|
|
|
CASE (WM_PENWINFIRST);
|
|
|
|
CASE (WM_PENWINLAST);
|
|
|
|
CASE (WM_APP);
|
Merge from stable:
2003-12-14 Tor Lillqvist <tml@iki.fi>
Merge from stable:
* gdk/gdkdisplaymanager.c: Mark default_display static.
* gdk/win32/gdkdnd-win32.c: Mark current_dest_drag static.
* gdk/win32/gdkkeys-win32.c: Disable some overly verbose debugging
output.
* gdk/win32/gdkevents-win32.c: Clean up the debugging output from
--gdk-debug=events. In general, output just one line of debugging
output for each Windows message, plus one line for each GDK event
generated. Indent all lines according to window procedure nesting
level.
(inner_window_procedure): Rename from real_window_procedure.
(find_real_window_for_grabbed_mouse_event): Don't get misled when
the point is in the non-client (decoration) area of the window
returned by WindowFromPoint(). Return the root window in that
case.
(build_pointer_event_state): Test also MK_XBUTTON1 and
MK_XBUTTON2 (buttons 4 and 5).
(synthesize_enter_event): Track the mouse leaving the window in
the event being generated, not the one mentioned in the Windows
message.
(propagate): Test for NULL parent earlier. Improves event
generation from a grabbed pointer. Part of fix for #107320.
(handle_stuff_while_moving_or_resizing): New function, to
dispatch the main loop (once).
(resize_timer_proc): New function, set to be called by an inerval
timer during resizes/moves. Calls handle_stuff_while_moving_or_resizing().
(gdk_event_translate): Drop unused return_exposes parameter.
Handle WM_XBUTTONDOWN and UP messages (buttons 4 and 5).
On WM_SYSKEYUP, generate a key release event also for just the Alt
key.
On WM_MOUSELEAVE, generate a leave event of type
GDK_NOTIFY_ANCESTOR (and not UNKNOWN) if the mouse left a
top-level window, and left the app completely.
On WM_ENTERSIZEMOVE, set a flag, and start an interval timer that
calls resize_timer_proc() at regular intervals. On
WM_EXITSIZEMOVE, kill the timer.
On WM_WINDOWPOSCHANGED, generate a configure event if necessary,
and dispatch the main loop (by calling
handle_stuff_while_moving_or_resizing()). Fixes #99540, idea by
Herman Bloggs.
* gdk/win32/gdkmain-win32.c (_gdk_win32_message_to_string): Handle
also wintab messages.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_skip_taskbar_hint):
Instead of using WS_EX_TOOLWINDOW, implement by setting/unsetting
the window's owner. Fixes #118093, reported by Maxime Romano.
2003-12-14 01:57:54 +00:00
|
|
|
CASE (WT_PACKET);
|
|
|
|
CASE (WT_CSRCHANGE);
|
|
|
|
CASE (WT_PROXIMITY);
|
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
|
|
|
#undef CASE
|
|
|
|
default:
|
|
|
|
if (msg >= WM_HANDHELDFIRST && msg <= WM_HANDHELDLAST)
|
|
|
|
return static_printf ("WM_HANDHELDFIRST+%d", msg - WM_HANDHELDFIRST);
|
|
|
|
else if (msg >= WM_AFXFIRST && msg <= WM_AFXLAST)
|
|
|
|
return static_printf ("WM_AFXFIRST+%d", msg - WM_AFXFIRST);
|
|
|
|
else if (msg >= WM_PENWINFIRST && msg <= WM_PENWINLAST)
|
|
|
|
return static_printf ("WM_PENWINFIRST+%d", msg - WM_PENWINFIRST);
|
|
|
|
else if (msg >= WM_USER && msg <= 0x7FFF)
|
|
|
|
return static_printf ("WM_USER+%d", msg - WM_USER);
|
|
|
|
else if (msg >= 0xC000 && msg <= 0xFFFF)
|
|
|
|
return static_printf ("reg-%#x", msg);
|
|
|
|
else
|
|
|
|
return static_printf ("unk-%#x", msg);
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2005-03-15 02:07:08 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_key_to_string (LONG lParam)
|
|
|
|
{
|
|
|
|
char buf[100];
|
|
|
|
gchar *keyname_utf8;
|
|
|
|
|
|
|
|
if (GetKeyNameText (lParam, buf, sizeof (buf)) &&
|
|
|
|
(keyname_utf8 = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL)) != NULL)
|
|
|
|
{
|
|
|
|
gchar *retval = static_printf ("%s", keyname_utf8);
|
|
|
|
|
|
|
|
g_free (keyname_utf8);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
return static_printf ("unk-%#lx", lParam);
|
|
|
|
}
|
|
|
|
|
2005-04-04 00:12:26 +00:00
|
|
|
gchar *
|
|
|
|
_gdk_win32_cf_to_string (UINT format)
|
|
|
|
{
|
|
|
|
char buf[100];
|
|
|
|
|
|
|
|
switch (format)
|
|
|
|
{
|
gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Add more
2005-11-01 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Add more
pre-interned GdkAtoms and pre-registered clipboard formats. Sort
their declarations, definitions and assignments into a more
logical and consistent order.
* gdk/win32/gdkmain-win32.c (_gdk_win32_cf_to_string): Include the
CF_ prefix for the predefined clipboard format names. Put quotes
around registered format names to distinguish them.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Return
immediately with a warning if the property type is STRING, TEXT,
COMPOUND_TEXT or SAVE_TARGETS, as these are X11-specific that we
should never pretend to handle on Win32. Handle only UTF8_STRING
here, other formats with delayed rendering. Use \uc1 instead of
\uc0 when generating Rich Text Format for easier testability on
XP, where WordPad misinterprets \uc0 encoded characters. Add more
GDK_NOTE debugging output for Clipboard operations.
* gdk/win32/gdkselection-win32.c: Debugging printout improvements.
(gdk_selection_convert): Don't pretent to handle STRING, just
UTF8_STRING. Streamline error handling, don't unnecessarily have a
GError which then isn't used for anything anyway if it gets set.
(gdk_win32_selection_add_targets): Skip also STRING, TEXT,
COMPOUND_TEXT and SAVE_TARGETS in addition to UTF8_STRING.
2005-11-01 15:29:59 +00:00
|
|
|
#define CASE(x) case CF_##x: return "CF_" #x
|
2005-04-04 00:12:26 +00:00
|
|
|
CASE (BITMAP);
|
|
|
|
CASE (DIB);
|
|
|
|
CASE (DIBV5);
|
|
|
|
CASE (DIF);
|
|
|
|
CASE (DSPBITMAP);
|
|
|
|
CASE (DSPENHMETAFILE);
|
|
|
|
CASE (DSPMETAFILEPICT);
|
|
|
|
CASE (DSPTEXT);
|
|
|
|
CASE (ENHMETAFILE);
|
|
|
|
CASE (HDROP);
|
|
|
|
CASE (LOCALE);
|
|
|
|
CASE (METAFILEPICT);
|
|
|
|
CASE (OEMTEXT);
|
|
|
|
CASE (OWNERDISPLAY);
|
|
|
|
CASE (PALETTE);
|
|
|
|
CASE (PENDATA);
|
|
|
|
CASE (RIFF);
|
|
|
|
CASE (SYLK);
|
|
|
|
CASE (TEXT);
|
|
|
|
CASE (WAVE);
|
|
|
|
CASE (TIFF);
|
|
|
|
CASE (UNICODETEXT);
|
|
|
|
default:
|
|
|
|
if (format >= CF_GDIOBJFIRST &&
|
|
|
|
format <= CF_GDIOBJLAST)
|
|
|
|
return static_printf ("CF_GDIOBJ%d", format - CF_GDIOBJFIRST);
|
|
|
|
if (format >= CF_PRIVATEFIRST &&
|
|
|
|
format <= CF_PRIVATELAST)
|
|
|
|
return static_printf ("CF_PRIVATE%d", format - CF_PRIVATEFIRST);
|
|
|
|
if (GetClipboardFormatName (format, buf, sizeof (buf)))
|
gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Add more
2005-11-01 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Add more
pre-interned GdkAtoms and pre-registered clipboard formats. Sort
their declarations, definitions and assignments into a more
logical and consistent order.
* gdk/win32/gdkmain-win32.c (_gdk_win32_cf_to_string): Include the
CF_ prefix for the predefined clipboard format names. Put quotes
around registered format names to distinguish them.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Return
immediately with a warning if the property type is STRING, TEXT,
COMPOUND_TEXT or SAVE_TARGETS, as these are X11-specific that we
should never pretend to handle on Win32. Handle only UTF8_STRING
here, other formats with delayed rendering. Use \uc1 instead of
\uc0 when generating Rich Text Format for easier testability on
XP, where WordPad misinterprets \uc0 encoded characters. Add more
GDK_NOTE debugging output for Clipboard operations.
* gdk/win32/gdkselection-win32.c: Debugging printout improvements.
(gdk_selection_convert): Don't pretent to handle STRING, just
UTF8_STRING. Streamline error handling, don't unnecessarily have a
GError which then isn't used for anything anyway if it gets set.
(gdk_win32_selection_add_targets): Skip also STRING, TEXT,
COMPOUND_TEXT and SAVE_TARGETS in addition to UTF8_STRING.
2005-11-01 15:29:59 +00:00
|
|
|
return static_printf ("'%s'", buf);
|
2005-04-04 00:12:26 +00:00
|
|
|
else
|
|
|
|
return static_printf ("unk-%#lx", format);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_data_to_string (const guchar *data,
|
|
|
|
int nbytes)
|
|
|
|
{
|
|
|
|
GString *s = g_string_new ("");
|
|
|
|
int i;
|
|
|
|
gchar *retval;
|
|
|
|
|
|
|
|
for (i = 0; i < nbytes; i++)
|
|
|
|
if (data[i] >=' ' && data[i] <= '~')
|
|
|
|
g_string_append_printf (s, "%c ", data[i]);
|
|
|
|
else
|
|
|
|
g_string_append_printf (s, "%02X ", data[i]);
|
|
|
|
|
|
|
|
retval = static_printf ("%s", s->str);
|
|
|
|
g_string_free (s, TRUE);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
2005-03-15 02:07:08 +00:00
|
|
|
|
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
|
|
|
gchar *
|
|
|
|
_gdk_win32_rect_to_string (const RECT *rect)
|
|
|
|
{
|
2005-03-16 01:38:57 +00:00
|
|
|
return static_printf ("%ldx%ld@%+ld%+ld",
|
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
|
|
|
(rect->right - rect->left), (rect->bottom - rect->top),
|
|
|
|
rect->left, rect->top);
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect)
|
|
|
|
{
|
2005-03-16 01:38:57 +00:00
|
|
|
return static_printf ("%dx%d@%+d%+d",
|
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
|
|
|
rect->width, rect->height,
|
|
|
|
rect->x, rect->y);
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_gdkregion_to_string (const GdkRegion *rgn)
|
|
|
|
{
|
2005-03-16 01:38:57 +00:00
|
|
|
return static_printf ("%dx%d@%+d%+d",
|
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
|
|
|
(rgn->extents.x2 - rgn->extents.x1),
|
|
|
|
(rgn->extents.y2 - rgn->extents.y1),
|
|
|
|
rgn->extents.x1, rgn->extents.y1);
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_win32_drawable_description (GdkDrawable *d)
|
|
|
|
{
|
Fix for #111028, thanks to J. Ali Harlow, who writes: I found that the
2003-06-28 Tor Lillqvist <tml@iki.fi>
Fix for #111028, thanks to J. Ali Harlow, who writes:
I found that the GdkPixmap->GdkImage reference really isn't
important. It's only really there to have somewhere convenient to
store the location of the pixel data in the pixmap and as an easy
way of accessing the dimensions of that data. I have therefore put
together a fix which removes this reference entirely which seems
to solve the problem.
* gdk/win32/gdkpixmap-win32.h (struct _GdkPixmapImplWin32):
Instead of a pointer to a GdkImage, keep a pointer to the pixels
directly.
* gdk/win32/gdkimage-win32.c (_gdk_win32_setup_pixmap_image): Remove.
(_gdk_win32_new_image): New function, replacing the above. Creates
a GdkImage without any associated GdkPixmap.
(gdk_image_new_bitmap, _gdk_image_new_for_depth): Use it instead.
* gdk/win32/gdkprivate-win32.h: Remove from here, too.
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap)
* gdk/win32/gdkdrawable-win32.c (blit_from_pixmap)
* gdk/win32/gdkgc-win32.c (_gdk_win32_bitmap_to_hrgn)
* gdk/win32/gdkmain-win32.c (_gdk_win32_drawable_description):
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize,
gdk_pixmap_new, gdk_bitmap_create_from_data, gdk_pixmap_foreign_new)
Corresponding changes.
2003-06-28 01:12:51 +00:00
|
|
|
gint width, height, depth;
|
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_drawable_get_size (d, &width, &height);
|
Fix for #111028, thanks to J. Ali Harlow, who writes: I found that the
2003-06-28 Tor Lillqvist <tml@iki.fi>
Fix for #111028, thanks to J. Ali Harlow, who writes:
I found that the GdkPixmap->GdkImage reference really isn't
important. It's only really there to have somewhere convenient to
store the location of the pixel data in the pixmap and as an easy
way of accessing the dimensions of that data. I have therefore put
together a fix which removes this reference entirely which seems
to solve the problem.
* gdk/win32/gdkpixmap-win32.h (struct _GdkPixmapImplWin32):
Instead of a pointer to a GdkImage, keep a pointer to the pixels
directly.
* gdk/win32/gdkimage-win32.c (_gdk_win32_setup_pixmap_image): Remove.
(_gdk_win32_new_image): New function, replacing the above. Creates
a GdkImage without any associated GdkPixmap.
(gdk_image_new_bitmap, _gdk_image_new_for_depth): Use it instead.
* gdk/win32/gdkprivate-win32.h: Remove from here, too.
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap)
* gdk/win32/gdkdrawable-win32.c (blit_from_pixmap)
* gdk/win32/gdkgc-win32.c (_gdk_win32_bitmap_to_hrgn)
* gdk/win32/gdkmain-win32.c (_gdk_win32_drawable_description):
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize,
gdk_pixmap_new, gdk_bitmap_create_from_data, gdk_pixmap_foreign_new)
Corresponding changes.
2003-06-28 01:12:51 +00:00
|
|
|
depth = gdk_drawable_get_depth (d);
|
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
|
|
|
|
2006-08-29 23:01:53 +00:00
|
|
|
return static_printf ("%s:%p:%dx%dx%d",
|
|
|
|
G_OBJECT_TYPE_NAME (d),
|
|
|
|
GDK_DRAWABLE_HANDLE (d),
|
|
|
|
width, height, depth);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* G_ENABLE_DEBUG */
|