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/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2001-02-19 22:02:23 +00:00
|
|
|
#include "gdk.h" /* gdk_rectangle_intersect */
|
1999-11-11 22:12:27 +00:00
|
|
|
#include "gdkevents.h"
|
|
|
|
#include "gdkpixmap.h"
|
|
|
|
#include "gdkwindow.h"
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
#include "gdkdisplay.h"
|
1999-11-20 01:22:57 +00:00
|
|
|
#include "gdkprivate-win32.h"
|
2000-11-11 18:39:57 +00:00
|
|
|
#include "gdkinput-win32.h"
|
1999-11-20 01:22:57 +00:00
|
|
|
|
|
|
|
static gboolean gdk_window_gravity_works (void);
|
|
|
|
static void gdk_window_set_static_win_gravity (GdkWindow *window,
|
|
|
|
gboolean on);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
static GdkColormap* gdk_window_impl_win32_get_colormap (GdkDrawable *drawable);
|
|
|
|
static void gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
|
|
|
|
GdkColormap *cmap);
|
|
|
|
static void gdk_window_impl_win32_get_size (GdkDrawable *drawable,
|
|
|
|
gint *width,
|
|
|
|
gint *height);
|
2000-12-30 20:06:14 +00:00
|
|
|
static GdkRegion* gdk_window_impl_win32_get_visible_region (GdkDrawable *drawable);
|
2000-07-25 17:31:05 +00:00
|
|
|
static void gdk_window_impl_win32_init (GdkWindowImplWin32 *window);
|
|
|
|
static void gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass);
|
|
|
|
static void gdk_window_impl_win32_finalize (GObject *object);
|
|
|
|
|
|
|
|
static gpointer parent_class = NULL;
|
|
|
|
|
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
|
|
|
GdkWindow *_gdk_parent_root = NULL;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
GType
|
2001-10-28 21:28:51 +00:00
|
|
|
_gdk_window_impl_win32_get_type (void)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
static GType object_type = 0;
|
|
|
|
|
|
|
|
if (!object_type)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
static const GTypeInfo object_info =
|
|
|
|
{
|
|
|
|
sizeof (GdkWindowImplWin32Class),
|
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gdk_window_impl_win32_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GdkWindowImplWin32),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gdk_window_impl_win32_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
object_type = g_type_register_static (GDK_TYPE_DRAWABLE_IMPL_WIN32,
|
|
|
|
"GdkWindowImplWin32",
|
2000-11-11 18:39:57 +00:00
|
|
|
&object_info, 0);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
return object_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
GType
|
|
|
|
_gdk_window_impl_get_type (void)
|
|
|
|
{
|
2001-10-28 21:28:51 +00:00
|
|
|
return _gdk_window_impl_win32_get_type ();
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
static void
|
|
|
|
gdk_window_impl_win32_init (GdkWindowImplWin32 *impl)
|
|
|
|
{
|
|
|
|
impl->width = 1;
|
|
|
|
impl->height = 1;
|
|
|
|
|
|
|
|
impl->hcursor = NULL;
|
|
|
|
impl->hint_flags = 0;
|
|
|
|
impl->extension_events_selected = FALSE;
|
|
|
|
}
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
|
1999-11-20 01:22:57 +00:00
|
|
|
static void
|
2000-07-25 17:31:05 +00:00
|
|
|
gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
|
|
|
|
|
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
|
|
|
object_class->finalize = gdk_window_impl_win32_finalize;
|
|
|
|
|
|
|
|
drawable_class->set_colormap = gdk_window_impl_win32_set_colormap;
|
|
|
|
drawable_class->get_colormap = gdk_window_impl_win32_get_colormap;
|
|
|
|
drawable_class->get_size = gdk_window_impl_win32_get_size;
|
2000-12-30 20:06:14 +00:00
|
|
|
|
|
|
|
/* Visible and clip regions are the same */
|
|
|
|
drawable_class->get_clip_region = gdk_window_impl_win32_get_visible_region;
|
|
|
|
drawable_class->get_visible_region = gdk_window_impl_win32_get_visible_region;
|
2000-07-25 17:31:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_window_impl_win32_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GdkWindowObject *wrapper;
|
|
|
|
GdkDrawableImplWin32 *draw_impl;
|
|
|
|
GdkWindowImplWin32 *window_impl;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (object));
|
|
|
|
|
|
|
|
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (object);
|
|
|
|
window_impl = GDK_WINDOW_IMPL_WIN32 (object);
|
|
|
|
|
|
|
|
wrapper = (GdkWindowObject*) draw_impl->wrapper;
|
|
|
|
|
|
|
|
if (!GDK_WINDOW_DESTROYED (wrapper))
|
1999-11-20 01:22:57 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
gdk_win32_handle_table_remove (draw_impl->handle);
|
1999-11-20 01:22:57 +00:00
|
|
|
}
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (window_impl->hcursor != NULL)
|
|
|
|
{
|
2002-01-11 23:56:28 +00:00
|
|
|
if (GetCursor () == window_impl->hcursor)
|
|
|
|
SetCursor (NULL);
|
2000-11-12 15:46:55 +00:00
|
|
|
if (!DestroyCursor (window_impl->hcursor))
|
|
|
|
WIN32_GDI_FAILED("DestroyCursor");
|
2000-07-25 17:31:05 +00:00
|
|
|
window_impl->hcursor = NULL;
|
|
|
|
}
|
2000-07-04 06:12:54 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
1999-11-20 01:22:57 +00:00
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
static GdkColormap*
|
|
|
|
gdk_window_impl_win32_get_colormap (GdkDrawable *drawable)
|
1999-11-20 01:22:57 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkDrawableImplWin32 *drawable_impl;
|
1999-11-20 01:22:57 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (drawable), NULL);
|
|
|
|
|
|
|
|
drawable_impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!((GdkWindowObject *) drawable_impl->wrapper)->input_only &&
|
|
|
|
drawable_impl->colormap == NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 20:38:35 +00:00
|
|
|
drawable_impl->colormap = gdk_colormap_get_system ();
|
2001-01-07 18:00:15 +00:00
|
|
|
gdk_colormap_ref (drawable_impl->colormap);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
return drawable_impl->colormap;
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
static void
|
|
|
|
gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
|
|
|
|
GdkColormap *cmap)
|
|
|
|
{
|
|
|
|
GdkWindowImplWin32 *impl;
|
|
|
|
GdkDrawableImplWin32 *draw_impl;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (drawable));
|
1999-11-20 01:22:57 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (drawable);
|
|
|
|
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
|
1999-11-20 01:22:57 +00:00
|
|
|
|
2001-11-09 21:52:52 +00:00
|
|
|
/* chain up */
|
|
|
|
GDK_DRAWABLE_CLASS (parent_class)->set_colormap (drawable, cmap);
|
1999-11-20 01:22:57 +00:00
|
|
|
|
2001-11-09 21:52:52 +00:00
|
|
|
if (cmap)
|
|
|
|
{
|
|
|
|
/* XXX */
|
|
|
|
g_print("gdk_window_impl_win32_set_colormap: XXX\n");
|
|
|
|
}
|
2000-07-25 17:31:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_window_impl_win32_get_size (GdkDrawable *drawable,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (drawable));
|
|
|
|
|
|
|
|
if (width)
|
|
|
|
*width = GDK_WINDOW_IMPL_WIN32 (drawable)->width;
|
|
|
|
if (height)
|
|
|
|
*height = GDK_WINDOW_IMPL_WIN32 (drawable)->height;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-12-30 20:06:14 +00:00
|
|
|
static GdkRegion*
|
|
|
|
gdk_window_impl_win32_get_visible_region (GdkDrawable *drawable)
|
|
|
|
{
|
|
|
|
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (drawable);
|
|
|
|
GdkRectangle result_rect;
|
|
|
|
|
|
|
|
result_rect.x = 0;
|
|
|
|
result_rect.y = 0;
|
|
|
|
result_rect.width = impl->width;
|
|
|
|
result_rect.height = impl->height;
|
|
|
|
|
|
|
|
gdk_rectangle_intersect (&result_rect, &impl->position_info.clip_rect, &result_rect);
|
|
|
|
|
|
|
|
return gdk_region_rectangle (&result_rect);
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
void
|
2000-07-25 17:31:05 +00:00
|
|
|
_gdk_windowing_window_init (void)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private;
|
|
|
|
GdkWindowImplWin32 *impl;
|
|
|
|
GdkDrawableImplWin32 *draw_impl;
|
|
|
|
RECT rect;
|
1999-11-11 22:12:27 +00:00
|
|
|
guint width;
|
|
|
|
guint height;
|
|
|
|
|
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
|
|
|
g_assert (_gdk_parent_root == NULL);
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
|
|
|
|
width = rect.right - rect.left;
|
|
|
|
height = rect.bottom - rect.top;
|
|
|
|
|
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_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL);
|
|
|
|
private = (GdkWindowObject *)_gdk_parent_root;
|
2000-07-25 17:31:05 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
|
|
|
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (private->impl);
|
1999-11-20 01:22:57 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
draw_impl->handle = gdk_root_window;
|
|
|
|
draw_impl->wrapper = GDK_DRAWABLE (private);
|
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
|
|
|
draw_impl->colormap = gdk_colormap_get_system ();
|
|
|
|
gdk_colormap_ref (draw_impl->colormap);
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
private->window_type = GDK_WINDOW_ROOT;
|
|
|
|
private->depth = gdk_visual_get_system ()->depth;
|
|
|
|
impl->width = width;
|
|
|
|
impl->height = height;
|
1999-11-20 01:22:57 +00:00
|
|
|
|
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_win32_handle_table_insert (&gdk_root_window, _gdk_parent_root);
|
2000-07-25 17:31:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The Win API function AdjustWindowRect may return negative values
|
|
|
|
* resulting in obscured title bars. This helper function is coreccting it.
|
|
|
|
*/
|
2001-10-28 21:28:51 +00:00
|
|
|
static BOOL
|
2000-07-25 17:31:05 +00:00
|
|
|
SafeAdjustWindowRectEx (RECT* lpRect,
|
|
|
|
DWORD dwStyle,
|
|
|
|
BOOL bMenu,
|
|
|
|
DWORD dwExStyle)
|
|
|
|
{
|
|
|
|
if (!AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle))
|
|
|
|
{
|
|
|
|
WIN32_API_FAILED ("AdjustWindowRectEx");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (lpRect->left < 0)
|
|
|
|
{
|
|
|
|
lpRect->right -= lpRect->left;
|
|
|
|
lpRect->left = 0;
|
|
|
|
}
|
|
|
|
if (lpRect->top < 0)
|
|
|
|
{
|
|
|
|
lpRect->bottom -= lpRect->top;
|
|
|
|
lpRect->top = 0;
|
|
|
|
}
|
|
|
|
return TRUE;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* RegisterGdkClass
|
|
|
|
* is a wrapper function for RegisterWindowClassEx.
|
|
|
|
* It creates at least one unique class for every
|
|
|
|
* GdkWindowType. If support for single window-specific icons
|
|
|
|
* is ever needed (e.g Dialog specific), every such window should
|
|
|
|
* get its own class
|
|
|
|
*/
|
2001-10-28 21:28:51 +00:00
|
|
|
static ATOM
|
2000-07-25 17:31:05 +00:00
|
|
|
RegisterGdkClass (GdkWindowType wtype)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
static ATOM klassTOPLEVEL = 0;
|
|
|
|
static ATOM klassDIALOG = 0;
|
|
|
|
static ATOM klassCHILD = 0;
|
|
|
|
static ATOM klassTEMP = 0;
|
|
|
|
static HICON hAppIcon = NULL;
|
|
|
|
static WNDCLASSEX wcl;
|
|
|
|
ATOM klass = 0;
|
|
|
|
|
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
|
|
|
wcl.cbSize = sizeof (WNDCLASSEX);
|
1999-11-11 22:12:27 +00:00
|
|
|
wcl.style = 0; /* DON'T set CS_<H,V>REDRAW. It causes total redraw
|
|
|
|
* on WM_SIZE and WM_MOVE. Flicker, Performance!
|
|
|
|
*/
|
2001-10-28 21:28:51 +00:00
|
|
|
wcl.lpfnWndProc = _gdk_win32_window_procedure;
|
1999-11-11 22:12:27 +00:00
|
|
|
wcl.cbClsExtra = 0;
|
|
|
|
wcl.cbWndExtra = 0;
|
2000-07-23 21:43:23 +00:00
|
|
|
wcl.hInstance = gdk_app_hmodule;
|
1999-11-11 22:12:27 +00:00
|
|
|
wcl.hIcon = 0;
|
|
|
|
/* initialize once! */
|
|
|
|
if (0 == hAppIcon)
|
|
|
|
{
|
2002-08-26 20:00:36 +00:00
|
|
|
gchar sLoc [MAX_PATH+1];
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2002-08-26 20:00:36 +00:00
|
|
|
if (0 != GetModuleFileName (gdk_app_hmodule, sLoc, MAX_PATH))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
hAppIcon = ExtractIcon (gdk_app_hmodule, sLoc, 0);
|
1999-11-11 22:12:27 +00:00
|
|
|
if (0 == hAppIcon)
|
|
|
|
{
|
2002-08-26 20:00:36 +00:00
|
|
|
if (0 != GetModuleFileName (gdk_dll_hinstance, sLoc, MAX_PATH))
|
2001-10-29 06:50:55 +00:00
|
|
|
hAppIcon = ExtractIcon (gdk_dll_hinstance, sLoc, 0);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
2001-10-29 06:50:55 +00:00
|
|
|
if (0 == hAppIcon)
|
|
|
|
hAppIcon = LoadIcon (NULL, IDI_APPLICATION);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
wcl.lpszMenuName = NULL;
|
|
|
|
wcl.hIconSm = 0;
|
|
|
|
|
|
|
|
/* initialize once per class */
|
2001-03-10 18:13:03 +00:00
|
|
|
/*
|
|
|
|
* HB: Setting the background brush leads to flicker, because we
|
|
|
|
* don't get asked how to clear the background. This is not what
|
|
|
|
* we want, at least not for input_only windows ...
|
|
|
|
*/
|
1999-11-11 22:12:27 +00:00
|
|
|
#define ONCE_PER_CLASS() \
|
|
|
|
wcl.hIcon = CopyIcon (hAppIcon); \
|
|
|
|
wcl.hIconSm = CopyIcon (hAppIcon); \
|
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
|
|
|
wcl.hbrBackground = NULL; \
|
1999-11-11 22:12:27 +00:00
|
|
|
wcl.hCursor = LoadCursor (NULL, IDC_ARROW);
|
|
|
|
|
|
|
|
switch (wtype)
|
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
|
|
|
{
|
|
|
|
case GDK_WINDOW_TOPLEVEL:
|
|
|
|
if (0 == klassTOPLEVEL)
|
|
|
|
{
|
|
|
|
wcl.lpszClassName = "gdkWindowToplevel";
|
|
|
|
|
|
|
|
ONCE_PER_CLASS();
|
|
|
|
klassTOPLEVEL = RegisterClassEx (&wcl);
|
|
|
|
}
|
|
|
|
klass = klassTOPLEVEL;
|
|
|
|
break;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
case GDK_WINDOW_CHILD:
|
|
|
|
if (0 == klassCHILD)
|
2000-07-25 17:31:05 +00:00
|
|
|
{
|
|
|
|
wcl.lpszClassName = "gdkWindowChild";
|
|
|
|
|
|
|
|
wcl.style |= CS_PARENTDC; /* MSDN: ... enhances system performance. */
|
|
|
|
ONCE_PER_CLASS();
|
|
|
|
klassCHILD = RegisterClassEx (&wcl);
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
klass = klassCHILD;
|
|
|
|
break;
|
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
|
|
|
|
|
|
|
case GDK_WINDOW_DIALOG:
|
|
|
|
if (0 == klassDIALOG)
|
|
|
|
{
|
|
|
|
wcl.lpszClassName = "gdkWindowDialog";
|
|
|
|
wcl.style |= CS_SAVEBITS;
|
|
|
|
ONCE_PER_CLASS();
|
|
|
|
klassDIALOG = RegisterClassEx (&wcl);
|
|
|
|
}
|
|
|
|
klass = klassDIALOG;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_WINDOW_TEMP:
|
|
|
|
if (0 == klassTEMP)
|
|
|
|
{
|
|
|
|
wcl.lpszClassName = "gdkWindowTemp";
|
|
|
|
wcl.style |= CS_SAVEBITS;
|
|
|
|
ONCE_PER_CLASS();
|
|
|
|
klassTEMP = RegisterClassEx (&wcl);
|
|
|
|
}
|
|
|
|
klass = klassTEMP;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-02-13 14:52:47 +00:00
|
|
|
if (klass == 0)
|
|
|
|
{
|
|
|
|
WIN32_API_FAILED ("RegisterClassEx");
|
|
|
|
g_error ("That is a fatal error");
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
return klass;
|
1999-11-20 01:22:57 +00:00
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
GdkWindow*
|
|
|
|
gdk_window_new (GdkWindow *parent,
|
|
|
|
GdkWindowAttr *attributes,
|
|
|
|
gint attributes_mask)
|
|
|
|
{
|
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
|
|
|
HANDLE hparent;
|
|
|
|
ATOM klass = 0;
|
|
|
|
DWORD dwStyle, dwExStyle;
|
|
|
|
RECT rect;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkWindow *window;
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private;
|
|
|
|
GdkWindowImplWin32 *impl;
|
|
|
|
GdkDrawableImplWin32 *draw_impl;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkVisual *visual;
|
|
|
|
int width, height;
|
|
|
|
int x, y;
|
|
|
|
char *title;
|
|
|
|
char *mbtitle;
|
|
|
|
|
|
|
|
g_return_val_if_fail (attributes != NULL, NULL);
|
|
|
|
|
|
|
|
if (!parent)
|
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
|
|
|
parent = _gdk_parent_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL);
|
|
|
|
|
2000-12-30 20:06:14 +00:00
|
|
|
GDK_NOTE (MISC,
|
|
|
|
g_print ("gdk_window_new: %s\n",
|
|
|
|
(attributes->window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
|
|
|
|
(attributes->window_type == GDK_WINDOW_CHILD ? "CHILD" :
|
|
|
|
(attributes->window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
|
|
|
|
(attributes->window_type == GDK_WINDOW_TEMP ? "TEMP" :
|
|
|
|
"???"))))));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (parent))
|
1999-11-11 22:12:27 +00:00
|
|
|
return NULL;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
hparent = GDK_WINDOW_HWND (parent);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
window = g_object_new (GDK_TYPE_WINDOW, NULL);
|
|
|
|
private = (GdkWindowObject *)window;
|
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
|
|
|
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (private->impl);
|
|
|
|
draw_impl->wrapper = GDK_DRAWABLE (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2001-10-24 14:15:50 +00:00
|
|
|
/* Windows with a foreign parent are treated as if they are children
|
|
|
|
* of the root window, except for actual creation.
|
|
|
|
*/
|
|
|
|
if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_FOREIGN)
|
|
|
|
parent = _gdk_parent_root;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
private->parent = (GdkWindowObject *)parent;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (attributes_mask & GDK_WA_X)
|
|
|
|
x = attributes->x;
|
|
|
|
else
|
|
|
|
x = CW_USEDEFAULT;
|
|
|
|
|
|
|
|
if (attributes_mask & GDK_WA_Y)
|
|
|
|
y = attributes->y;
|
|
|
|
else if (attributes_mask & GDK_WA_X)
|
|
|
|
y = 100; /* ??? We must put it somewhere... */
|
|
|
|
else
|
|
|
|
y = 0; /* x is CW_USEDEFAULT, y doesn't matter then */
|
|
|
|
|
|
|
|
private->x = x;
|
|
|
|
private->y = y;
|
|
|
|
impl->width = (attributes->width > 1) ? (attributes->width) : (1);
|
|
|
|
impl->height = (attributes->height > 1) ? (attributes->height) : (1);
|
|
|
|
impl->extension_events_selected = FALSE;
|
|
|
|
private->window_type = attributes->window_type;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
_gdk_window_init_position (GDK_WINDOW (private));
|
|
|
|
if (impl->position_info.big)
|
|
|
|
private->guffaw_gravity = TRUE;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (attributes_mask & GDK_WA_VISUAL)
|
|
|
|
visual = attributes->visual;
|
|
|
|
else
|
|
|
|
visual = gdk_visual_get_system ();
|
|
|
|
|
|
|
|
if (attributes_mask & GDK_WA_TITLE)
|
|
|
|
title = attributes->title;
|
|
|
|
else
|
|
|
|
title = g_get_prgname ();
|
2000-12-30 20:06:14 +00:00
|
|
|
if (!title || !*title)
|
1999-12-11 23:04:55 +00:00
|
|
|
title = "GDK client window";
|
1999-11-11 22:12:27 +00:00
|
|
|
|
Remove the event_mask, it is now in GdkWindowObject.
2002-03-01 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkwindow-win32.h (struct _GdkWindowImplWin32): Remove
the event_mask, it is now in GdkWindowObject.
* gdk/win32/gdkwindow-win32.c: Change accordingly. Set the
GDK_STRUCTURE_MASK in gdk_window_set_events(), as it is always set
in gdk_window_new(), too. (Bug#72921)
* gdk/win32/gdkevents-win32.c: Change accordingly here, too.
(vk_from_char): New function, calculates the virtual keycode
corresponding to the char in a WM_CHAR message.
(build_keypress_event, build_keyrelease_event): Use it.
(build_keypress_event): Call ImmReleaseContext() after using the
input context. This might plug a memory or resource leak.
(build_key_event_state): Remove #if 0 code.
(gdk_event_translate): Actually, it would be preferrable to always
handle just the WM_KEYDOWN and WM_KEYUP messages, not WM_CHAR at
all, and thus drop the contorted logic with ignore_wm_char etc.
* gdk/win32/gdkkeys-win32.c: (gdk_keymap_get_entries_for_keyval):
Debugging output.
(gdk_keymap_translate_keyboard_state): Return correct value. (But
_gtk_key_hash_lookup() doesn't check the return value...)
2002-02-28 23:38:55 +00:00
|
|
|
private->event_mask = GDK_STRUCTURE_MASK | attributes->event_mask;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2001-10-24 14:15:50 +00:00
|
|
|
if (private->parent && private->parent->guffaw_gravity)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* XXX ??? */
|
|
|
|
}
|
|
|
|
|
|
|
|
if (attributes->wclass == GDK_INPUT_OUTPUT)
|
|
|
|
{
|
|
|
|
dwExStyle = 0;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
private->input_only = FALSE;
|
|
|
|
private->depth = visual->depth;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
if (attributes_mask & GDK_WA_COLORMAP)
|
2000-07-25 17:31:05 +00:00
|
|
|
{
|
|
|
|
draw_impl->colormap = attributes->colormap;
|
|
|
|
gdk_colormap_ref (attributes->colormap);
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-25 17:31:05 +00:00
|
|
|
{
|
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
|
|
|
draw_impl->colormap = gdk_colormap_get_system ();
|
2000-07-25 17:31:05 +00:00
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
dwExStyle = WS_EX_TRANSPARENT;
|
2000-07-25 17:31:05 +00:00
|
|
|
private->depth = 0;
|
|
|
|
private->input_only = TRUE;
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
draw_impl->colormap = gdk_colormap_get_system ();
|
|
|
|
gdk_colormap_ref (draw_impl->colormap);
|
|
|
|
GDK_NOTE (MISC, g_print ("...GDK_INPUT_ONLY, system colormap\n"));
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2001-10-24 14:15:50 +00:00
|
|
|
if (private->parent)
|
|
|
|
private->parent->children = g_list_prepend (private->parent->children, window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
switch (private->window_type)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
case GDK_WINDOW_TOPLEVEL:
|
|
|
|
dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN;
|
2000-07-25 17:31:05 +00:00
|
|
|
hparent = gdk_root_window;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
case GDK_WINDOW_CHILD:
|
|
|
|
dwStyle = WS_CHILDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
case GDK_WINDOW_DIALOG:
|
|
|
|
dwStyle = WS_OVERLAPPED | WS_MINIMIZEBOX | WS_SYSMENU | WS_CAPTION | WS_THICKFRAME | WS_CLIPCHILDREN;
|
2000-01-18 22:03:59 +00:00
|
|
|
#if 0
|
1999-11-11 22:12:27 +00:00
|
|
|
dwExStyle |= WS_EX_TOPMOST; /* //HB: want this? */
|
2000-01-18 22:03:59 +00:00
|
|
|
#endif
|
2000-07-25 17:31:05 +00:00
|
|
|
hparent = gdk_root_window;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
case GDK_WINDOW_TEMP:
|
2001-08-04 13:17:33 +00:00
|
|
|
dwStyle = WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
|
|
|
/* a temp window is not necessarily a top level window */
|
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
|
|
|
dwStyle |= (_gdk_parent_root == parent ? WS_POPUP : WS_CHILDWINDOW);
|
1999-11-11 22:12:27 +00:00
|
|
|
dwExStyle |= WS_EX_TOOLWINDOW;
|
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
case GDK_WINDOW_ROOT:
|
|
|
|
g_error ("cannot make windows of type GDK_WINDOW_ROOT");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
klass = RegisterGdkClass (private->window_type);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (private->window_type != GDK_WINDOW_CHILD)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
if (x == CW_USEDEFAULT)
|
|
|
|
{
|
|
|
|
rect.left = 100;
|
|
|
|
rect.top = 100;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rect.left = x;
|
|
|
|
rect.top = y;
|
|
|
|
}
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
rect.right = rect.left + impl->width;
|
|
|
|
rect.bottom = rect.top + impl->height;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-02-13 14:52:47 +00:00
|
|
|
SafeAdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (x != CW_USEDEFAULT)
|
|
|
|
{
|
|
|
|
x = rect.left;
|
|
|
|
y = rect.top;
|
|
|
|
}
|
|
|
|
width = rect.right - rect.left;
|
|
|
|
height = rect.bottom - rect.top;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
width = impl->width;
|
|
|
|
height = impl->height;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2001-01-07 18:00:15 +00:00
|
|
|
mbtitle = g_locale_from_utf8 (title, -1, NULL, NULL, NULL);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-10-09 19:49:42 +00:00
|
|
|
#ifdef WITHOUT_WM_CREATE
|
2000-07-25 17:31:05 +00:00
|
|
|
draw_impl->handle = CreateWindowEx (dwExStyle,
|
|
|
|
MAKEINTRESOURCE(klass),
|
|
|
|
mbtitle,
|
|
|
|
dwStyle,
|
2001-09-21 19:58:35 +00:00
|
|
|
impl->position_info.x, impl->position_info.y,
|
|
|
|
impl->position_info.width, impl->position_info.height,
|
2000-07-25 17:31:05 +00:00
|
|
|
hparent,
|
|
|
|
NULL,
|
|
|
|
gdk_app_hmodule,
|
|
|
|
NULL);
|
2000-10-09 19:49:42 +00:00
|
|
|
#else
|
|
|
|
{
|
|
|
|
HWND hwndNew =
|
|
|
|
CreateWindowEx (dwExStyle,
|
|
|
|
MAKEINTRESOURCE(klass),
|
|
|
|
mbtitle,
|
|
|
|
dwStyle,
|
2001-09-21 19:58:35 +00:00
|
|
|
impl->position_info.x, impl->position_info.y,
|
|
|
|
impl->position_info.width, impl->position_info.height,
|
2000-10-09 19:49:42 +00:00
|
|
|
hparent,
|
|
|
|
NULL,
|
|
|
|
gdk_app_hmodule,
|
|
|
|
window);
|
|
|
|
if (GDK_WINDOW_HWND (window) != hwndNew)
|
|
|
|
{
|
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
|
|
|
g_warning("gdk_window_new: gdk_event_translate::WM_CREATE (%p, %p) HWND mismatch.",
|
|
|
|
GDK_WINDOW_HWND (window),
|
|
|
|
hwndNew);
|
2000-10-09 19:49:42 +00:00
|
|
|
|
|
|
|
/* HB: IHMO due to a race condition the handle was increased by
|
|
|
|
* one, which causes much trouble. Because I can't find the
|
|
|
|
* real bug, try to workaround it ...
|
|
|
|
* To reproduce: compile with MSVC 5, DEBUG=1
|
|
|
|
*/
|
|
|
|
# if 0
|
|
|
|
gdk_win32_handle_table_remove (GDK_WINDOW_HWND (window));
|
|
|
|
GDK_WINDOW_HWND (window) = hwndNew;
|
|
|
|
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
|
|
|
|
# else
|
|
|
|
/* the old behaviour, but with warning */
|
|
|
|
GDK_WINDOW_HWND (window) = hwndNew;
|
|
|
|
# endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gdk_drawable_ref (window);
|
|
|
|
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
|
|
|
|
#endif
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
GDK_NOTE (MISC,
|
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
|
|
|
g_print ("... \"%s\" %dx%d@+%d+%d %p = %p\n",
|
1999-11-11 22:12:27 +00:00
|
|
|
mbtitle,
|
|
|
|
width, height, (x == CW_USEDEFAULT ? -9999 : x), y,
|
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
|
|
|
hparent,
|
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_WINDOW_HWND (window)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_free (mbtitle);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (draw_impl->handle == NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("CreateWindowEx");
|
2000-07-25 17:31:05 +00:00
|
|
|
g_object_unref ((GObject *) window);
|
1999-11-11 22:12:27 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2000-10-09 19:49:42 +00:00
|
|
|
#ifdef WITHOUT_WM_CREATE
|
1999-11-20 01:22:57 +00:00
|
|
|
gdk_drawable_ref (window);
|
2000-10-09 19:49:42 +00:00
|
|
|
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
|
|
|
|
#endif
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
|
|
|
|
(attributes->cursor) :
|
|
|
|
NULL));
|
|
|
|
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
|
|
|
GdkWindow *
|
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_window_foreign_new_for_display (GdkDisplay *display,
|
|
|
|
GdkNativeWindow anid)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GdkWindow *window;
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private;
|
|
|
|
GdkWindowImplWin32 *impl;
|
|
|
|
GdkDrawableImplWin32 *draw_impl;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
HANDLE parent;
|
|
|
|
RECT rect;
|
|
|
|
POINT point;
|
|
|
|
|
2002-06-20 23:59:27 +00:00
|
|
|
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
|
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
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
window = g_object_new (GDK_TYPE_WINDOW, NULL);
|
|
|
|
private = (GdkWindowObject *)window;
|
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
|
|
|
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (private->impl);
|
|
|
|
draw_impl->wrapper = GDK_DRAWABLE (window);
|
2000-11-12 15:46:55 +00:00
|
|
|
parent = GetParent ((HWND)anid);
|
2000-07-25 17:31:05 +00:00
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
private->parent = gdk_win32_handle_table_lookup ((GdkNativeWindow) parent);
|
2001-10-24 14:15:50 +00:00
|
|
|
if (!private->parent || GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_FOREIGN)
|
|
|
|
private->parent = (GdkWindowObject *)_gdk_parent_root;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
2001-10-24 14:15:50 +00:00
|
|
|
private->parent->children = g_list_prepend (private->parent->children, window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
draw_impl->handle = (HWND) anid;
|
1999-11-11 22:12:27 +00:00
|
|
|
GetClientRect ((HWND) anid, &rect);
|
|
|
|
point.x = rect.left;
|
|
|
|
point.y = rect.right;
|
|
|
|
ClientToScreen ((HWND) anid, &point);
|
2000-07-25 17:31:05 +00:00
|
|
|
if (parent != gdk_root_window)
|
1999-11-11 22:12:27 +00:00
|
|
|
ScreenToClient (parent, &point);
|
|
|
|
private->x = point.x;
|
|
|
|
private->y = point.y;
|
2000-07-25 17:31:05 +00:00
|
|
|
impl->width = rect.right - rect.left;
|
|
|
|
impl->height = rect.bottom - rect.top;
|
|
|
|
private->window_type = GDK_WINDOW_FOREIGN;
|
|
|
|
private->destroyed = FALSE;
|
Remove the event_mask, it is now in GdkWindowObject.
2002-03-01 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkwindow-win32.h (struct _GdkWindowImplWin32): Remove
the event_mask, it is now in GdkWindowObject.
* gdk/win32/gdkwindow-win32.c: Change accordingly. Set the
GDK_STRUCTURE_MASK in gdk_window_set_events(), as it is always set
in gdk_window_new(), too. (Bug#72921)
* gdk/win32/gdkevents-win32.c: Change accordingly here, too.
(vk_from_char): New function, calculates the virtual keycode
corresponding to the char in a WM_CHAR message.
(build_keypress_event, build_keyrelease_event): Use it.
(build_keypress_event): Call ImmReleaseContext() after using the
input context. This might plug a memory or resource leak.
(build_key_event_state): Remove #if 0 code.
(gdk_event_translate): Actually, it would be preferrable to always
handle just the WM_KEYDOWN and WM_KEYUP messages, not WM_CHAR at
all, and thus drop the contorted logic with ignore_wm_char etc.
* gdk/win32/gdkkeys-win32.c: (gdk_keymap_get_entries_for_keyval):
Debugging output.
(gdk_keymap_translate_keyboard_state): Return correct value. (But
_gtk_key_hash_lookup() doesn't check the return value...)
2002-02-28 23:38:55 +00:00
|
|
|
private->event_mask = GDK_ALL_EVENTS_MASK; /* XXX */
|
2001-03-09 16:43:19 +00:00
|
|
|
if (IsWindowVisible ((HWND) anid))
|
|
|
|
private->state &= (~GDK_WINDOW_STATE_WITHDRAWN);
|
|
|
|
else
|
|
|
|
private->state |= GDK_WINDOW_STATE_WITHDRAWN;
|
2000-07-25 17:31:05 +00:00
|
|
|
private->depth = gdk_visual_get_system ()->depth;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
1999-11-20 01:22:57 +00:00
|
|
|
gdk_drawable_ref (window);
|
2000-10-09 19:49:42 +00:00
|
|
|
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup and
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
2001-10-18 20:23:17 +00:00
|
|
|
GdkWindow*
|
|
|
|
gdk_window_lookup (GdkNativeWindow hwnd)
|
|
|
|
{
|
|
|
|
return (GdkWindow*) gdk_win32_handle_table_lookup (hwnd);
|
|
|
|
}
|
|
|
|
|
2000-05-16 21:27:10 +00:00
|
|
|
void
|
|
|
|
_gdk_windowing_window_destroy (GdkWindow *window,
|
|
|
|
gboolean recursing,
|
|
|
|
gboolean foreign_destroy)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private = (GdkWindowObject *)window;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("_gdk_windowing_window_destroy %p\n",
|
|
|
|
GDK_WINDOW_HWND (window)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-05-16 21:27:10 +00:00
|
|
|
if (private->extension_events != 0)
|
2002-08-02 20:22:49 +00:00
|
|
|
_gdk_input_window_destroy (window);
|
2000-05-16 21:27:10 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (private->window_type == GDK_WINDOW_FOREIGN)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-05-16 21:27:10 +00:00
|
|
|
if (!foreign_destroy && (private->parent != NULL))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
/* It's somebody else's window, but in our hierarchy,
|
2000-05-16 21:27:10 +00:00
|
|
|
* so reparent it to the root window, and then call
|
|
|
|
* DestroyWindow() on it.
|
|
|
|
*/
|
|
|
|
gdk_window_hide (window);
|
|
|
|
gdk_window_reparent (window, NULL, 0, 0);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-05-16 21:27:10 +00:00
|
|
|
/* Is this too drastic? Many (most?) applications
|
|
|
|
* quit if any window receives WM_QUIT I think.
|
|
|
|
* OTOH, I don't think foreign windows are much
|
|
|
|
* used, so the question is maybe academic.
|
|
|
|
*/
|
2000-07-25 17:31:05 +00:00
|
|
|
PostMessage (GDK_WINDOW_HWND (window), WM_QUIT, 0, 0);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
2000-05-16 21:27:10 +00:00
|
|
|
else if (!recursing && !foreign_destroy)
|
2001-07-28 23:02:02 +00:00
|
|
|
{
|
|
|
|
private->destroyed = TRUE;
|
|
|
|
DestroyWindow (GDK_WINDOW_HWND (window));
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-05-16 21:27:10 +00:00
|
|
|
/* This function is called when the window really gone.
|
|
|
|
*/
|
1999-11-11 22:12:27 +00:00
|
|
|
void
|
|
|
|
gdk_window_destroy_notify (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
2000-11-12 15:46:55 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
1999-11-20 01:22:57 +00:00
|
|
|
GDK_NOTE (EVENTS,
|
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
|
|
|
g_print ("gdk_window_destroy_notify: %p %s\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
2000-07-25 17:31:05 +00:00
|
|
|
(GDK_WINDOW_DESTROYED (window) ? "(destroyed)" : "")));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_TYPE(window) != GDK_WINDOW_FOREIGN)
|
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
|
|
|
g_warning ("window %p unexpectedly destroyed",
|
|
|
|
GDK_WINDOW_HWND (window));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-05-16 21:27:10 +00:00
|
|
|
_gdk_window_destroy (window, TRUE);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
gdk_win32_handle_table_remove (GDK_WINDOW_HWND (window));
|
1999-11-20 01:22:57 +00:00
|
|
|
gdk_drawable_unref (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2001-08-19 18:34:59 +00:00
|
|
|
static void
|
|
|
|
show_window_internal (GdkWindow *window,
|
|
|
|
gboolean raise)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private;
|
|
|
|
|
2001-08-19 18:34:59 +00:00
|
|
|
private = GDK_WINDOW_OBJECT (window);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!private->destroyed)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_show: %p\n",
|
|
|
|
GDK_WINDOW_HWND (window)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2001-03-09 16:43:19 +00:00
|
|
|
private->state &= (~GDK_WINDOW_STATE_WITHDRAWN);
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
|
|
|
SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOPMOST, 0, 0, 0, 0,
|
1999-11-11 22:12:27 +00:00
|
|
|
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
|
|
|
#if 0
|
1999-11-20 01:22:57 +00:00
|
|
|
/* Don't put on toolbar */
|
2000-07-25 17:31:05 +00:00
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
|
1999-11-11 22:12:27 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-01-17 22:26:19 +00:00
|
|
|
if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT)
|
|
|
|
{
|
|
|
|
SetWindowPos(GDK_WINDOW_HWND (window), HWND_TOP, 0, 0, 0, 0,
|
|
|
|
SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOSIZE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-03-31 19:33:49 +00:00
|
|
|
GdkWindow *parent = GDK_WINDOW (private->parent);
|
2001-01-17 22:26:19 +00:00
|
|
|
|
2001-08-04 13:17:33 +00:00
|
|
|
/* Todo: GDK_WINDOW_STATE_STICKY */
|
|
|
|
if (private->state & GDK_WINDOW_STATE_ICONIFIED)
|
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMINIMIZED);
|
|
|
|
else if (private->state & GDK_WINDOW_STATE_MAXIMIZED)
|
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
|
|
|
}
|
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
|
|
|
if (parent == _gdk_parent_root)
|
2001-01-17 22:26:19 +00:00
|
|
|
SetForegroundWindow (GDK_WINDOW_HWND (window));
|
2001-08-19 18:34:59 +00:00
|
|
|
if (raise)
|
|
|
|
BringWindowToTop (GDK_WINDOW_HWND (window));
|
1999-11-11 22:12:27 +00:00
|
|
|
#if 0
|
2001-01-17 22:26:19 +00:00
|
|
|
ShowOwnedPopups (GDK_WINDOW_HWND (window), TRUE);
|
1999-11-11 22:12:27 +00:00
|
|
|
#endif
|
2001-01-17 22:26:19 +00:00
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-08-19 18:34:59 +00:00
|
|
|
void
|
|
|
|
gdk_window_show_unraised (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
show_window_internal (window, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_show (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
show_window_internal (window, TRUE);
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
void
|
|
|
|
gdk_window_hide (GdkWindow *window)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
private = (GdkWindowObject*) window;
|
|
|
|
if (!private->destroyed)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_hide: %p\n",
|
|
|
|
GDK_WINDOW_HWND (window)));
|
2000-07-25 17:31:05 +00:00
|
|
|
|
2001-03-09 16:43:19 +00:00
|
|
|
private->state |= GDK_WINDOW_STATE_WITHDRAWN;
|
2001-11-09 21:52:52 +00:00
|
|
|
|
|
|
|
_gdk_window_clear_update_area (window);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
|
|
|
|
ShowOwnedPopups (GDK_WINDOW_HWND (window), FALSE);
|
|
|
|
|
2001-01-17 22:26:19 +00:00
|
|
|
if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT)
|
|
|
|
{
|
|
|
|
SetWindowPos(GDK_WINDOW_HWND (window), HWND_BOTTOM, 0, 0, 0, 0,
|
|
|
|
SWP_HIDEWINDOW | SWP_NOREDRAW | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_withdraw (GdkWindow *window)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
g_return_if_fail (window != NULL);
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
private = (GdkWindowObject*) window;
|
|
|
|
if (!private->destroyed)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_withdraw: %p\n",
|
|
|
|
GDK_WINDOW_HWND (window)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
gdk_window_hide (window); /* ??? */
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_move (GdkWindow *window,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private = (GdkWindowObject *)window;
|
|
|
|
GdkWindowImplWin32 *impl;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
2000-07-25 17:31:05 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
|
|
|
|
2001-08-19 18:34:59 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
|
|
|
{
|
|
|
|
if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD)
|
|
|
|
_gdk_window_move_resize_child (window, x, y,
|
|
|
|
impl->width, impl->height);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
|
|
|
x, y, impl->width, impl->height,
|
|
|
|
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER))
|
|
|
|
WIN32_API_FAILED ("SetWindowPos");
|
|
|
|
}
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_resize (GdkWindow *window,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private = (GdkWindowObject*) window;
|
|
|
|
GdkWindowImplWin32 *impl;
|
|
|
|
int x, y;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
2000-07-25 17:31:05 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (width < 1)
|
1999-11-11 22:12:27 +00:00
|
|
|
width = 1;
|
2000-07-25 17:31:05 +00:00
|
|
|
if (height < 1)
|
1999-11-11 22:12:27 +00:00
|
|
|
height = 1;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
|
|
|
|
2001-08-19 18:34:59 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2001-08-19 18:34:59 +00:00
|
|
|
if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD)
|
|
|
|
_gdk_window_move_resize_child (window, private->x, private->y,
|
|
|
|
width, height);
|
|
|
|
else
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
POINT pt;
|
|
|
|
RECT rect;
|
|
|
|
DWORD dwStyle;
|
|
|
|
DWORD dwExStyle;
|
|
|
|
|
|
|
|
pt.x = 0;
|
|
|
|
pt.y = 0;
|
2000-07-25 17:31:05 +00:00
|
|
|
ClientToScreen (GDK_WINDOW_HWND (window), &pt);
|
1999-11-11 22:12:27 +00:00
|
|
|
rect.left = pt.x;
|
|
|
|
rect.top = pt.y;
|
|
|
|
rect.right = pt.x + width;
|
|
|
|
rect.bottom = pt.y + height;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
|
|
|
dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
1999-11-11 22:12:27 +00:00
|
|
|
if (!AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("AdjustWindowRectEx");
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
x = rect.left;
|
|
|
|
y = rect.top;
|
|
|
|
width = rect.right - rect.left;
|
|
|
|
height = rect.bottom - rect.top;
|
2001-08-19 18:34:59 +00:00
|
|
|
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
|
|
|
x, y, width, height,
|
|
|
|
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER))
|
|
|
|
WIN32_API_FAILED ("SetWindowPos");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
private->resize_count += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_move_resize (GdkWindow *window,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private = (GdkWindowObject*) window;
|
|
|
|
GdkWindowImplWin32 *impl;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
2000-07-25 17:31:05 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (width < 1)
|
1999-11-11 22:12:27 +00:00
|
|
|
width = 1;
|
2000-07-25 17:31:05 +00:00
|
|
|
if (height < 1)
|
1999-11-11 22:12:27 +00:00
|
|
|
height = 1;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!private->destroyed)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
RECT rect;
|
|
|
|
DWORD dwStyle;
|
|
|
|
DWORD dwExStyle;
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_move_resize: %p %dx%d@+%d+%d\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
2000-11-11 18:39:57 +00:00
|
|
|
width, height, x, y));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD)
|
|
|
|
_gdk_window_move_resize_child (window, x, y, width, height);
|
|
|
|
else
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
rect.left = x;
|
|
|
|
rect.top = y;
|
|
|
|
rect.right = x + width;
|
|
|
|
rect.bottom = y + height;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
|
|
|
dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
|
|
|
if (!AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
|
|
|
|
WIN32_API_FAILED ("AdjustWindowRectEx");
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("...SetWindowPos(%p,%ldx%ld@+%ld+%ld)\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
2000-07-25 17:31:05 +00:00
|
|
|
rect.right - rect.left, rect.bottom - rect.top,
|
|
|
|
rect.left, rect.top));
|
2001-08-19 18:34:59 +00:00
|
|
|
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
|
|
|
|
rect.left, rect.top,
|
|
|
|
rect.right - rect.left, rect.bottom - rect.top,
|
|
|
|
SWP_NOACTIVATE | SWP_NOZORDER))
|
|
|
|
WIN32_API_FAILED ("SetWindowPos");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_reparent (GdkWindow *window,
|
|
|
|
GdkWindow *new_parent,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *window_private;
|
|
|
|
GdkWindowObject *parent_private;
|
|
|
|
GdkWindowObject *old_parent_private;
|
|
|
|
GdkWindowImplWin32 *impl;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
2001-11-09 21:52:52 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
g_return_if_fail (new_parent == NULL || GDK_IS_WINDOW (new_parent));
|
|
|
|
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_ROOT);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (!new_parent)
|
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
|
|
|
new_parent = _gdk_parent_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
window_private = (GdkWindowObject*) window;
|
|
|
|
old_parent_private = (GdkWindowObject *) window_private->parent;
|
|
|
|
parent_private = (GdkWindowObject*) new_parent;
|
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (window_private->impl);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window) && !GDK_WINDOW_DESTROYED (new_parent))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_reparent: %p %p\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
|
|
|
GDK_WINDOW_HWND (new_parent)));
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!SetParent (GDK_WINDOW_HWND (window),
|
|
|
|
GDK_WINDOW_HWND (new_parent)))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("SetParent");
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!MoveWindow (GDK_WINDOW_HWND (window),
|
|
|
|
x, y, impl->width, impl->height, TRUE))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("MoveWindow");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2001-10-24 14:15:50 +00:00
|
|
|
|
|
|
|
/* From here on, we treat parents of type GDK_WINDOW_FOREIGN like
|
|
|
|
* the root window
|
|
|
|
*/
|
|
|
|
if (GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
|
|
|
|
new_parent = _gdk_parent_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
window_private->parent = (GdkWindowObject *)new_parent;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (old_parent_private)
|
1999-11-20 01:22:57 +00:00
|
|
|
old_parent_private->children =
|
|
|
|
g_list_remove (old_parent_private->children, window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if ((old_parent_private &&
|
|
|
|
(!old_parent_private->guffaw_gravity != !parent_private->guffaw_gravity)) ||
|
|
|
|
(!old_parent_private && parent_private->guffaw_gravity))
|
|
|
|
gdk_window_set_static_win_gravity (window, parent_private->guffaw_gravity);
|
|
|
|
|
|
|
|
parent_private->children = g_list_prepend (parent_private->children, window);
|
2001-11-09 21:52:52 +00:00
|
|
|
_gdk_window_init_position (GDK_WINDOW (window_private));
|
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_windowing_window_clear_area (GdkWindow *window,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowImplWin32 *impl;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
|
|
|
|
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
HDC hdc;
|
|
|
|
|
2000-01-18 22:03:59 +00:00
|
|
|
if (width == 0)
|
2000-07-25 17:31:05 +00:00
|
|
|
width = impl->width - x;
|
2000-01-18 22:03:59 +00:00
|
|
|
if (height == 0)
|
2000-07-25 17:31:05 +00:00
|
|
|
height = impl->height - y;
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("_gdk_windowing_window_clear_area: "
|
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
|
|
|
"%p %dx%d@+%d+%d\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
2000-11-11 18:39:57 +00:00
|
|
|
width, height, x, y));
|
2000-07-25 17:31:05 +00:00
|
|
|
hdc = GetDC (GDK_WINDOW_HWND (window));
|
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
|
|
|
IntersectClipRect (hdc, x, y, x + width + 1, y + height + 1);
|
2000-07-25 17:31:05 +00:00
|
|
|
SendMessage (GDK_WINDOW_HWND (window), WM_ERASEBKGND, (WPARAM) hdc, 0);
|
2002-01-11 23:56:28 +00:00
|
|
|
if (!ReleaseDC (GDK_WINDOW_HWND (window), hdc))
|
|
|
|
WIN32_GDI_FAILED ("ReleaseDC");
|
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_windowing_window_clear_area_e (GdkWindow *window,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
RECT rect;
|
|
|
|
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("_gdk_windowing_window_clear_area_e: "
|
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
|
|
|
"%p %dx%d@+%d+%d\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
2000-11-11 18:39:57 +00:00
|
|
|
width, height, x, y));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
rect.left = x;
|
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
|
|
|
rect.right = x + width + 1;
|
1999-11-11 22:12:27 +00:00
|
|
|
rect.top = y;
|
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
|
|
|
rect.bottom = y + height + 1;
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!InvalidateRect (GDK_WINDOW_HWND (window), &rect, TRUE))
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("InvalidateRect");
|
2000-07-25 17:31:05 +00:00
|
|
|
UpdateWindow (GDK_WINDOW_HWND (window));
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_raise (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_raise: %p\n",
|
|
|
|
GDK_WINDOW_HWND (window)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!BringWindowToTop (GDK_WINDOW_HWND (window)))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("BringWindowToTop");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_lower (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_lower: %p\n",
|
|
|
|
GDK_WINDOW_HWND (window)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!SetWindowPos (GDK_WINDOW_HWND (window), HWND_BOTTOM, 0, 0, 0, 0,
|
1999-11-11 22:12:27 +00:00
|
|
|
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("SetWindowPos");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_hints (GdkWindow *window,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint min_width,
|
|
|
|
gint min_height,
|
|
|
|
gint max_width,
|
|
|
|
gint max_height,
|
|
|
|
gint flags)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowImplWin32 *impl;
|
1999-11-11 22:12:27 +00:00
|
|
|
WINDOWPLACEMENT size_hints;
|
|
|
|
RECT rect;
|
|
|
|
DWORD dwStyle;
|
|
|
|
DWORD dwExStyle;
|
|
|
|
int diff;
|
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_hints: %p %dx%d..%dx%d @+%d+%d\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
1999-11-11 22:12:27 +00:00
|
|
|
min_width, min_height, max_width, max_height,
|
|
|
|
x, y));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl->hint_flags = flags;
|
1999-11-11 22:12:27 +00:00
|
|
|
size_hints.length = sizeof (size_hints);
|
|
|
|
|
|
|
|
if (flags)
|
|
|
|
{
|
2001-11-09 21:52:52 +00:00
|
|
|
GdkGeometry geom;
|
|
|
|
gint geom_mask = 0;
|
|
|
|
|
|
|
|
geom.min_width = min_width;
|
|
|
|
geom.min_height = min_height;
|
|
|
|
geom.max_width = max_width;
|
|
|
|
geom.max_height = max_height;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
if (flags & GDK_HINT_POS)
|
2000-11-11 18:39:57 +00:00
|
|
|
{
|
|
|
|
if (!GetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints))
|
|
|
|
WIN32_API_FAILED ("GetWindowPlacement");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GDK_NOTE (MISC, g_print ("...rcNormalPosition:"
|
|
|
|
" (%ld,%ld)--(%ld,%ld)\n",
|
|
|
|
size_hints.rcNormalPosition.left,
|
|
|
|
size_hints.rcNormalPosition.top,
|
|
|
|
size_hints.rcNormalPosition.right,
|
|
|
|
size_hints.rcNormalPosition.bottom));
|
|
|
|
/* What are the corresponding window coordinates for client
|
|
|
|
* area coordinates x, y
|
|
|
|
*/
|
|
|
|
rect.left = x;
|
|
|
|
rect.top = y;
|
|
|
|
rect.right = rect.left + 200; /* dummy */
|
|
|
|
rect.bottom = rect.top + 200;
|
|
|
|
dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
|
|
|
dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
|
|
|
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
|
|
|
|
size_hints.flags = 0;
|
|
|
|
size_hints.showCmd = SW_SHOWNA;
|
|
|
|
|
|
|
|
/* Set the normal position hint to that location, with unchanged
|
|
|
|
* width and height.
|
|
|
|
*/
|
|
|
|
diff = size_hints.rcNormalPosition.left - rect.left;
|
|
|
|
size_hints.rcNormalPosition.left = rect.left;
|
|
|
|
size_hints.rcNormalPosition.right -= diff;
|
|
|
|
diff = size_hints.rcNormalPosition.top - rect.top;
|
|
|
|
size_hints.rcNormalPosition.top = rect.top;
|
|
|
|
size_hints.rcNormalPosition.bottom -= diff;
|
|
|
|
GDK_NOTE (MISC, g_print ("...setting: (%ld,%ld)--(%ld,%ld)\n",
|
|
|
|
size_hints.rcNormalPosition.left,
|
|
|
|
size_hints.rcNormalPosition.top,
|
|
|
|
size_hints.rcNormalPosition.right,
|
|
|
|
size_hints.rcNormalPosition.bottom));
|
|
|
|
if (!SetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints))
|
|
|
|
WIN32_API_FAILED ("SetWindowPlacement");
|
|
|
|
impl->hint_x = rect.left;
|
|
|
|
impl->hint_y = rect.top;
|
|
|
|
}
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (flags & GDK_HINT_MIN_SIZE)
|
2001-11-09 21:52:52 +00:00
|
|
|
geom_mask |= GDK_HINT_MIN_SIZE;
|
1999-11-20 01:22:57 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
if (flags & GDK_HINT_MAX_SIZE)
|
2001-11-09 21:52:52 +00:00
|
|
|
geom_mask |= GDK_HINT_MAX_SIZE;
|
|
|
|
|
|
|
|
gdk_window_set_geometry_hints (window, &geom, geom_mask);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_geometry_hints (GdkWindow *window,
|
|
|
|
GdkGeometry *geometry,
|
|
|
|
GdkWindowHints geom_mask)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowImplWin32 *impl;
|
1999-11-11 22:12:27 +00:00
|
|
|
WINDOWPLACEMENT size_hints;
|
|
|
|
RECT rect;
|
|
|
|
DWORD dwStyle;
|
|
|
|
DWORD dwExStyle;
|
2001-11-09 21:52:52 +00:00
|
|
|
gint new_width = 0, new_height = 0;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
1999-11-11 22:12:27 +00:00
|
|
|
size_hints.length = sizeof (size_hints);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl->hint_flags = geom_mask;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_POS)
|
2001-08-04 13:17:33 +00:00
|
|
|
; /* even the X11 mplementation doesn't care */
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_MIN_SIZE)
|
|
|
|
{
|
|
|
|
rect.left = 0;
|
|
|
|
rect.top = 0;
|
|
|
|
rect.right = geometry->min_width;
|
|
|
|
rect.bottom = geometry->min_height;
|
2000-07-25 17:31:05 +00:00
|
|
|
dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
|
|
|
dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
1999-11-11 22:12:27 +00:00
|
|
|
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
|
2000-07-25 17:31:05 +00:00
|
|
|
impl->hint_min_width = rect.right - rect.left;
|
|
|
|
impl->hint_min_height = rect.bottom - rect.top;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* Also check if he current size of the window is in bounds */
|
2000-07-25 17:31:05 +00:00
|
|
|
GetClientRect (GDK_WINDOW_HWND (window), &rect);
|
2001-11-09 21:52:52 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
if (rect.right < geometry->min_width
|
|
|
|
&& rect.bottom < geometry->min_height)
|
2001-11-09 21:52:52 +00:00
|
|
|
{
|
|
|
|
new_width = geometry->min_width; new_height = geometry->min_height;
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (rect.right < geometry->min_width)
|
2001-11-09 21:52:52 +00:00
|
|
|
{
|
|
|
|
new_width = geometry->min_width; new_height = rect.bottom;
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (rect.bottom < geometry->min_height)
|
2001-11-09 21:52:52 +00:00
|
|
|
{
|
|
|
|
new_width = rect.right; new_height = geometry->min_height;
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_MAX_SIZE)
|
|
|
|
{
|
|
|
|
rect.left = 0;
|
|
|
|
rect.top = 0;
|
|
|
|
rect.right = geometry->max_width;
|
|
|
|
rect.bottom = geometry->max_height;
|
2000-07-25 17:31:05 +00:00
|
|
|
dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
|
|
|
dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
2000-11-30 23:39:50 +00:00
|
|
|
/* HB: dont' know why AdjustWindowRectEx is called here, ... */
|
|
|
|
SafeAdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
|
2000-07-25 17:31:05 +00:00
|
|
|
impl->hint_max_width = rect.right - rect.left;
|
|
|
|
impl->hint_max_height = rect.bottom - rect.top;
|
2000-11-30 23:39:50 +00:00
|
|
|
/* ... but negative sizes are always wrong */
|
|
|
|
if (impl->hint_max_width < 0) impl->hint_max_width = G_MAXSHORT;
|
|
|
|
if (impl->hint_max_height < 0) impl->hint_max_height = G_MAXSHORT;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* Again, check if the window is too large currently. */
|
2000-07-25 17:31:05 +00:00
|
|
|
GetClientRect (GDK_WINDOW_HWND (window), &rect);
|
1999-11-11 22:12:27 +00:00
|
|
|
if (rect.right > geometry->max_width
|
|
|
|
&& rect.bottom > geometry->max_height)
|
2001-11-09 21:52:52 +00:00
|
|
|
{
|
|
|
|
new_width = geometry->max_width; new_height = geometry->max_height;
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (rect.right > geometry->max_width)
|
2001-11-09 21:52:52 +00:00
|
|
|
{
|
|
|
|
new_width = geometry->max_width; new_height = rect.bottom;
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (rect.bottom > geometry->max_height)
|
2001-11-09 21:52:52 +00:00
|
|
|
{
|
|
|
|
new_width = rect.right; new_height = geometry->max_height;
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2001-11-09 21:52:52 +00:00
|
|
|
|
|
|
|
/* finally apply new size constraints */
|
|
|
|
if (new_width != 0 && new_height != 0)
|
|
|
|
gdk_window_resize (window, new_width, new_height);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* I don't know what to do when called with zero base_width and height. */
|
|
|
|
if (geom_mask & GDK_HINT_BASE_SIZE
|
|
|
|
&& geometry->base_width > 0
|
|
|
|
&& geometry->base_height > 0)
|
2000-11-11 18:39:57 +00:00
|
|
|
{
|
|
|
|
if (!GetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints))
|
|
|
|
WIN32_API_FAILED ("GetWindowPlacement");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_geometry_hints:"
|
|
|
|
" rcNormalPosition: (%ld,%ld)--(%ld,%ld)\n",
|
|
|
|
size_hints.rcNormalPosition.left,
|
|
|
|
size_hints.rcNormalPosition.top,
|
|
|
|
size_hints.rcNormalPosition.right,
|
|
|
|
size_hints.rcNormalPosition.bottom));
|
|
|
|
size_hints.rcNormalPosition.right =
|
|
|
|
size_hints.rcNormalPosition.left + geometry->base_width;
|
|
|
|
size_hints.rcNormalPosition.bottom =
|
|
|
|
size_hints.rcNormalPosition.top + geometry->base_height;
|
|
|
|
GDK_NOTE (MISC, g_print ("...setting: rcNormal: (%ld,%ld)--(%ld,%ld)\n",
|
|
|
|
size_hints.rcNormalPosition.left,
|
|
|
|
size_hints.rcNormalPosition.top,
|
|
|
|
size_hints.rcNormalPosition.right,
|
|
|
|
size_hints.rcNormalPosition.bottom));
|
|
|
|
if (!SetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints))
|
|
|
|
WIN32_API_FAILED ("SetWindowPlacement");
|
|
|
|
}
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_RESIZE_INC)
|
|
|
|
{
|
|
|
|
/* XXX */
|
|
|
|
}
|
|
|
|
|
|
|
|
if (geom_mask & GDK_HINT_ASPECT)
|
|
|
|
{
|
|
|
|
/* XXX */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_title (GdkWindow *window,
|
|
|
|
const gchar *title)
|
|
|
|
{
|
2000-12-30 20:06:14 +00:00
|
|
|
char *mbtitle;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
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_return_if_fail (title != NULL);
|
2000-10-22 17:16:42 +00:00
|
|
|
|
|
|
|
/* Empty window titles not allowed, so set it to just a period. */
|
|
|
|
if (!title[0])
|
|
|
|
title = ".";
|
1999-11-11 22:12:27 +00:00
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_title: %p %s\n",
|
|
|
|
GDK_WINDOW_HWND (window), title));
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-01-18 22:03:59 +00:00
|
|
|
/* As the title is in UTF-8 we must translate it
|
1999-11-11 22:12:27 +00:00
|
|
|
* to the system codepage.
|
|
|
|
*/
|
2001-01-07 18:00:15 +00:00
|
|
|
mbtitle = g_locale_from_utf8 (title, -1, NULL, NULL, NULL);
|
2000-12-30 20:06:14 +00:00
|
|
|
if (!SetWindowText (GDK_WINDOW_HWND (window), mbtitle))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("SetWindowText");
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-12-30 20:06:14 +00:00
|
|
|
g_free (mbtitle);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_role (GdkWindow *window,
|
|
|
|
const gchar *role)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_role: %p %s\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
2000-11-11 18:39:57 +00:00
|
|
|
(role ? role : "NULL")));
|
1999-11-11 22:12:27 +00:00
|
|
|
/* XXX */
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_transient_for (GdkWindow *window,
|
|
|
|
GdkWindow *parent)
|
|
|
|
{
|
2001-08-04 13:17:33 +00:00
|
|
|
HWND window_id, parent_id;
|
|
|
|
LONG style;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_transient_for: %p %p\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
|
|
|
GDK_WINDOW_HWND (parent)));
|
2001-08-04 13:17:33 +00:00
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window) || GDK_WINDOW_DESTROYED (parent))
|
|
|
|
return;
|
|
|
|
|
|
|
|
window_id = GDK_WINDOW_HWND (window);
|
|
|
|
parent_id = GDK_WINDOW_HWND (parent);
|
|
|
|
|
|
|
|
if ((style = GetWindowLong (window_id, GWL_STYLE)) == 0)
|
|
|
|
WIN32_API_FAILED ("GetWindowLong");
|
|
|
|
|
|
|
|
style |= WS_POPUP;
|
|
|
|
#if 0 /* not sure if we want to do this */
|
|
|
|
style &= ~(WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (!SetWindowLong (window_id, GWL_STYLE, style))
|
|
|
|
WIN32_API_FAILED ("SetWindowLong");
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
#if 0 /* not sure if we want to do this, clipping to parent size! */
|
2001-08-04 13:17:33 +00:00
|
|
|
if (!SetParent (window_id, parent_id))
|
|
|
|
WIN32_API_FAILED ("SetParent");
|
2001-08-19 18:34:59 +00:00
|
|
|
#else /* make the modal window topmost instead */
|
|
|
|
if (!SetWindowPos (window_id, HWND_TOPMOST, 0, 0, 0, 0,
|
|
|
|
SWP_NOMOVE | SWP_NOSIZE))
|
|
|
|
WIN32_API_FAILED ("SetWindowPos");
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
#endif
|
2001-08-04 13:17:33 +00:00
|
|
|
|
|
|
|
if (!RedrawWindow (window_id, NULL, NULL,
|
|
|
|
RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW))
|
|
|
|
WIN32_API_FAILED ("RedrawWindow");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_background (GdkWindow *window,
|
|
|
|
GdkColor *color)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private = (GdkWindowObject *)window;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_background: %p %s\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
2000-07-25 17:31:05 +00:00
|
|
|
gdk_win32_color_to_string (color)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
private->bg_color = *color;
|
|
|
|
|
|
|
|
if (private->bg_pixmap &&
|
|
|
|
private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
|
|
|
|
private->bg_pixmap != GDK_NO_BG)
|
|
|
|
{
|
|
|
|
gdk_drawable_unref (private->bg_pixmap);
|
|
|
|
private->bg_pixmap = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_back_pixmap (GdkWindow *window,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
gint parent_relative)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private = (GdkWindowObject *)window;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
2000-07-25 17:31:05 +00:00
|
|
|
g_return_if_fail (pixmap == NULL || !parent_relative);
|
2002-05-14 19:45:08 +00:00
|
|
|
g_return_if_fail (pixmap == NULL || gdk_drawable_get_depth (window) == gdk_drawable_get_depth (pixmap));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (private->bg_pixmap &&
|
|
|
|
private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
|
|
|
|
private->bg_pixmap != GDK_NO_BG)
|
|
|
|
gdk_drawable_unref (private->bg_pixmap);
|
|
|
|
|
|
|
|
if (parent_relative)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
private->bg_pixmap = GDK_PARENT_RELATIVE_BG;
|
2002-01-01 22:17:09 +00:00
|
|
|
GDK_NOTE (MISC, g_print (G_STRLOC ": setting background pixmap to parent_relative\n"));
|
2000-07-25 17:31:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (pixmap)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
gdk_drawable_ref (pixmap);
|
|
|
|
private->bg_pixmap = pixmap;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
private->bg_pixmap = GDK_NO_BG;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_cursor (GdkWindow *window,
|
|
|
|
GdkCursor *cursor)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowImplWin32 *impl;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkCursorPrivate *cursor_private;
|
2002-06-10 20:27:15 +00:00
|
|
|
GdkWindowObject *parent_window;
|
2000-07-25 17:31:05 +00:00
|
|
|
HCURSOR hcursor;
|
2001-02-11 11:00:14 +00:00
|
|
|
HCURSOR hprevcursor;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
1999-11-11 22:12:27 +00:00
|
|
|
cursor_private = (GdkCursorPrivate*) cursor;
|
|
|
|
|
2002-01-11 23:56:28 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!cursor)
|
|
|
|
hcursor = NULL;
|
|
|
|
else
|
|
|
|
hcursor = cursor_private->hcursor;
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_cursor: %p %p\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
|
|
|
hcursor));
|
2002-01-11 23:56:28 +00:00
|
|
|
|
|
|
|
/* First get the old cursor, if any (we wait to free the old one
|
|
|
|
* since it may be the current cursor set in the Win32 API right
|
|
|
|
* now).
|
|
|
|
*/
|
|
|
|
hprevcursor = impl->hcursor;
|
|
|
|
|
|
|
|
if (hcursor == NULL)
|
|
|
|
impl->hcursor = NULL;
|
|
|
|
else
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2002-01-11 23:56:28 +00:00
|
|
|
/* We must copy the cursor as it is OK to destroy the GdkCursor
|
|
|
|
* while still in use for some window. See for instance
|
|
|
|
* gimp_change_win_cursor() which calls gdk_window_set_cursor
|
|
|
|
* (win, cursor), and immediately afterwards gdk_cursor_destroy
|
|
|
|
* (cursor).
|
|
|
|
*/
|
|
|
|
if ((impl->hcursor = CopyCursor (hcursor)) == NULL)
|
|
|
|
WIN32_API_FAILED ("CopyCursor");
|
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
|
|
|
GDK_NOTE (MISC, g_print ("...CopyCursor (%p) = %p\n",
|
|
|
|
hcursor, impl->hcursor));
|
2002-01-11 23:56:28 +00:00
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2002-06-10 20:27:15 +00:00
|
|
|
/* If the pointer is over our window, set new cursor if given */
|
2002-01-11 23:56:28 +00:00
|
|
|
if (gdk_window_get_pointer(window, NULL, NULL, NULL) == window)
|
2002-06-10 20:27:15 +00:00
|
|
|
if (impl->hcursor != NULL)
|
|
|
|
SetCursor (impl->hcursor);
|
2000-07-04 06:12:54 +00:00
|
|
|
|
2002-01-11 23:56:28 +00:00
|
|
|
/* Destroy the previous cursor: Need to make sure it's no longer in
|
|
|
|
* use before we destroy it, in case we're not over our window but
|
|
|
|
* the cursor is still set to our old one.
|
|
|
|
*/
|
|
|
|
if (hprevcursor != NULL)
|
|
|
|
{
|
|
|
|
if (GetCursor() == hprevcursor)
|
2002-06-10 20:27:15 +00:00
|
|
|
{
|
|
|
|
/* Look for a suitable cursor to use instead */
|
|
|
|
hcursor = NULL;
|
|
|
|
parent_window = GDK_WINDOW_OBJECT (window)->parent;
|
|
|
|
while (hcursor == NULL)
|
|
|
|
{
|
|
|
|
if (parent_window)
|
|
|
|
{
|
|
|
|
impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl);
|
|
|
|
hcursor = impl->hcursor;
|
|
|
|
parent_window = parent_window->parent;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hcursor = LoadCursor (NULL, IDC_ARROW);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SetCursor (hcursor);
|
|
|
|
}
|
2001-02-11 11:00:14 +00:00
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("...DestroyCursor (%p)\n",
|
|
|
|
hprevcursor));
|
2002-01-11 23:56:28 +00:00
|
|
|
|
|
|
|
if (!DestroyCursor (hprevcursor))
|
|
|
|
WIN32_API_FAILED ("DestroyCursor");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_get_geometry (GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gint *width,
|
|
|
|
gint *height,
|
|
|
|
gint *depth)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (!window)
|
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
|
|
|
window = _gdk_parent_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
RECT rect;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GetClientRect (GDK_WINDOW_HWND (window), &rect))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("GetClientRect");
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (x)
|
|
|
|
*x = rect.left;
|
|
|
|
if (y)
|
|
|
|
*y = rect.top;
|
|
|
|
if (width)
|
|
|
|
*width = rect.right - rect.left;
|
|
|
|
if (height)
|
|
|
|
*height = rect.bottom - rect.top;
|
|
|
|
if (depth)
|
|
|
|
*depth = gdk_drawable_get_visual (window)->depth;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdk_window_get_origin (GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y)
|
|
|
|
{
|
|
|
|
gint return_val;
|
|
|
|
gint tx = 0;
|
|
|
|
gint ty = 0;
|
|
|
|
|
|
|
|
g_return_val_if_fail (window != NULL, 0);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
POINT pt;
|
|
|
|
|
|
|
|
pt.x = 0;
|
|
|
|
pt.y = 0;
|
2000-07-25 17:31:05 +00:00
|
|
|
ClientToScreen (GDK_WINDOW_HWND (window), &pt);
|
1999-11-11 22:12:27 +00:00
|
|
|
tx = pt.x;
|
|
|
|
ty = pt.y;
|
|
|
|
return_val = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return_val = 0;
|
|
|
|
|
|
|
|
if (x)
|
|
|
|
*x = tx;
|
|
|
|
if (y)
|
|
|
|
*y = ty;
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_get_origin: %p: +%d+%d\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
2000-11-11 18:39:57 +00:00
|
|
|
tx, ty));
|
1999-11-11 22:12:27 +00:00
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gdk_window_get_deskrelative_origin (GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y)
|
|
|
|
{
|
|
|
|
return gdk_window_get_origin (window, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_get_root_origin (GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y)
|
|
|
|
{
|
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
|
|
|
GdkRectangle rect;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
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
|
|
|
gdk_window_get_frame_extents (window, &rect);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (x)
|
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
|
|
|
*x = rect.x;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
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
|
|
|
if (y)
|
|
|
|
*y = rect.y;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2001-03-31 19:33:49 +00:00
|
|
|
void
|
|
|
|
gdk_window_get_frame_extents (GdkWindow *window,
|
|
|
|
GdkRectangle *rect)
|
|
|
|
{
|
|
|
|
GdkWindowObject *private;
|
|
|
|
HWND hwnd;
|
|
|
|
RECT r;
|
|
|
|
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
g_return_if_fail (rect != NULL);
|
|
|
|
|
|
|
|
private = GDK_WINDOW_OBJECT (window);
|
|
|
|
|
2001-03-31 19:33:49 +00:00
|
|
|
rect->x = 0;
|
|
|
|
rect->y = 0;
|
|
|
|
rect->width = 1;
|
|
|
|
rect->height = 1;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
while (private->parent && ((GdkWindowObject*) private->parent)->parent)
|
|
|
|
private = (GdkWindowObject*) private->parent;
|
|
|
|
|
2001-03-31 19:33:49 +00:00
|
|
|
hwnd = GDK_WINDOW_HWND (window);
|
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
|
|
|
|
2001-03-31 19:33:49 +00:00
|
|
|
/* find the frame window */
|
|
|
|
while (HWND_DESKTOP != GetParent (hwnd))
|
|
|
|
{
|
|
|
|
hwnd = GetParent (hwnd);
|
|
|
|
g_return_if_fail (NULL != hwnd);
|
|
|
|
}
|
|
|
|
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
if (!GetWindowRect (hwnd, &r))
|
2001-03-31 19:33:49 +00:00
|
|
|
WIN32_API_FAILED ("GetWindowRect");
|
|
|
|
|
|
|
|
rect->x = r.left;
|
|
|
|
rect->y = r.right;
|
|
|
|
rect->width = r.right - r.left;
|
|
|
|
rect->height = r.bottom - r.top;
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkWindow*
|
2001-07-05 13:41:34 +00:00
|
|
|
_gdk_windowing_window_get_pointer (GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GdkWindow *return_val;
|
2002-01-11 23:56:28 +00:00
|
|
|
POINT screen_point, point;
|
1999-11-11 22:12:27 +00:00
|
|
|
HWND hwnd, hwndc;
|
|
|
|
|
|
|
|
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
|
|
if (!window)
|
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
|
|
|
window = _gdk_parent_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
return_val = NULL;
|
2002-01-11 23:56:28 +00:00
|
|
|
GetCursorPos (&screen_point);
|
|
|
|
point = screen_point;
|
2000-07-25 17:31:05 +00:00
|
|
|
ScreenToClient (GDK_WINDOW_HWND (window), &point);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (x)
|
|
|
|
*x = point.x;
|
|
|
|
if (y)
|
|
|
|
*y = point.y;
|
|
|
|
|
|
|
|
hwnd = WindowFromPoint (point);
|
2002-01-11 23:56:28 +00:00
|
|
|
if (hwnd != NULL)
|
|
|
|
{
|
|
|
|
gboolean done = FALSE;
|
|
|
|
|
|
|
|
while (!done)
|
|
|
|
{
|
|
|
|
point = screen_point;
|
|
|
|
ScreenToClient (hwnd, &point);
|
|
|
|
hwndc = ChildWindowFromPoint (hwnd, point);
|
|
|
|
if (hwndc == NULL)
|
|
|
|
done = TRUE;
|
|
|
|
else if (hwndc == hwnd)
|
|
|
|
done = TRUE;
|
|
|
|
else
|
|
|
|
hwnd = hwndc;
|
|
|
|
}
|
|
|
|
|
2002-02-10 13:18:51 +00:00
|
|
|
return_val = gdk_window_lookup ((GdkNativeWindow) hwnd);
|
2002-01-11 23:56:28 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return_val = NULL;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
if (mask)
|
|
|
|
{
|
|
|
|
BYTE kbd[256];
|
|
|
|
|
|
|
|
GetKeyboardState (kbd);
|
|
|
|
*mask = 0;
|
|
|
|
if (kbd[VK_SHIFT] & 0x80)
|
|
|
|
*mask |= GDK_SHIFT_MASK;
|
|
|
|
if (kbd[VK_CAPITAL] & 0x80)
|
|
|
|
*mask |= GDK_LOCK_MASK;
|
|
|
|
if (kbd[VK_CONTROL] & 0x80)
|
|
|
|
*mask |= GDK_CONTROL_MASK;
|
|
|
|
if (kbd[VK_MENU] & 0x80)
|
|
|
|
*mask |= GDK_MOD1_MASK;
|
|
|
|
if (kbd[VK_LBUTTON] & 0x80)
|
|
|
|
*mask |= GDK_BUTTON1_MASK;
|
|
|
|
if (kbd[VK_MBUTTON] & 0x80)
|
|
|
|
*mask |= GDK_BUTTON2_MASK;
|
|
|
|
if (kbd[VK_RBUTTON] & 0x80)
|
|
|
|
*mask |= GDK_BUTTON3_MASK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
GdkWindow*
|
2001-11-18 02:15:52 +00:00
|
|
|
_gdk_windowing_window_at_pointer (GdkScreen *screen,
|
|
|
|
gint *win_x,
|
|
|
|
gint *win_y)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GdkWindow *window;
|
|
|
|
POINT point, pointc;
|
|
|
|
HWND hwnd, hwndc;
|
|
|
|
RECT rect;
|
|
|
|
|
|
|
|
GetCursorPos (&pointc);
|
|
|
|
point = pointc;
|
|
|
|
hwnd = WindowFromPoint (point);
|
|
|
|
|
|
|
|
if (hwnd == NULL)
|
|
|
|
{
|
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
|
|
|
window = _gdk_parent_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
if (win_x)
|
|
|
|
*win_x = pointc.x;
|
|
|
|
if (win_y)
|
|
|
|
*win_y = pointc.y;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
|
|
|
ScreenToClient (hwnd, &point);
|
|
|
|
|
|
|
|
do {
|
|
|
|
hwndc = ChildWindowFromPoint (hwnd, point);
|
|
|
|
ClientToScreen (hwnd, &point);
|
|
|
|
ScreenToClient (hwndc, &point);
|
|
|
|
} while (hwndc != hwnd && (hwnd = hwndc, 1));
|
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (window && (win_x || win_y))
|
|
|
|
{
|
|
|
|
GetClientRect (hwnd, &rect);
|
|
|
|
if (win_x)
|
|
|
|
*win_x = point.x - rect.left;
|
|
|
|
if (win_y)
|
|
|
|
*win_y = point.y - rect.top;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_at_pointer: +%ld+%ld %p%s\n",
|
2000-11-11 18:39:57 +00:00
|
|
|
point.x, point.y,
|
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
|
|
|
hwnd,
|
1999-11-11 22:12:27 +00:00
|
|
|
(window == NULL ? " NULL" : "")));
|
|
|
|
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
|
|
|
GdkEventMask
|
|
|
|
gdk_window_get_events (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (window != NULL, 0);
|
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
return 0;
|
|
|
|
|
Remove the event_mask, it is now in GdkWindowObject.
2002-03-01 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkwindow-win32.h (struct _GdkWindowImplWin32): Remove
the event_mask, it is now in GdkWindowObject.
* gdk/win32/gdkwindow-win32.c: Change accordingly. Set the
GDK_STRUCTURE_MASK in gdk_window_set_events(), as it is always set
in gdk_window_new(), too. (Bug#72921)
* gdk/win32/gdkevents-win32.c: Change accordingly here, too.
(vk_from_char): New function, calculates the virtual keycode
corresponding to the char in a WM_CHAR message.
(build_keypress_event, build_keyrelease_event): Use it.
(build_keypress_event): Call ImmReleaseContext() after using the
input context. This might plug a memory or resource leak.
(build_key_event_state): Remove #if 0 code.
(gdk_event_translate): Actually, it would be preferrable to always
handle just the WM_KEYDOWN and WM_KEYUP messages, not WM_CHAR at
all, and thus drop the contorted logic with ignore_wm_char etc.
* gdk/win32/gdkkeys-win32.c: (gdk_keymap_get_entries_for_keyval):
Debugging output.
(gdk_keymap_translate_keyboard_state): Return correct value. (But
_gtk_key_hash_lookup() doesn't check the return value...)
2002-02-28 23:38:55 +00:00
|
|
|
return GDK_WINDOW_OBJECT (window)->event_mask;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_events (GdkWindow *window,
|
|
|
|
GdkEventMask event_mask)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
|
Remove the event_mask, it is now in GdkWindowObject.
2002-03-01 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkwindow-win32.h (struct _GdkWindowImplWin32): Remove
the event_mask, it is now in GdkWindowObject.
* gdk/win32/gdkwindow-win32.c: Change accordingly. Set the
GDK_STRUCTURE_MASK in gdk_window_set_events(), as it is always set
in gdk_window_new(), too. (Bug#72921)
* gdk/win32/gdkevents-win32.c: Change accordingly here, too.
(vk_from_char): New function, calculates the virtual keycode
corresponding to the char in a WM_CHAR message.
(build_keypress_event, build_keyrelease_event): Use it.
(build_keypress_event): Call ImmReleaseContext() after using the
input context. This might plug a memory or resource leak.
(build_key_event_state): Remove #if 0 code.
(gdk_event_translate): Actually, it would be preferrable to always
handle just the WM_KEYDOWN and WM_KEYUP messages, not WM_CHAR at
all, and thus drop the contorted logic with ignore_wm_char etc.
* gdk/win32/gdkkeys-win32.c: (gdk_keymap_get_entries_for_keyval):
Debugging output.
(gdk_keymap_translate_keyboard_state): Return correct value. (But
_gtk_key_hash_lookup() doesn't check the return value...)
2002-02-28 23:38:55 +00:00
|
|
|
/* gdk_window_new() always sets the GDK_STRUCTURE_MASK, so better
|
|
|
|
* set it here, too. Not that I know or remember why it is
|
|
|
|
* necessary, will have to test some day.
|
|
|
|
*/
|
|
|
|
GDK_WINDOW_OBJECT (window)->event_mask = GDK_STRUCTURE_MASK | event_mask;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_shape_combine_mask (GdkWindow *window,
|
|
|
|
GdkBitmap *mask,
|
|
|
|
gint x, gint y)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (!mask)
|
|
|
|
{
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %p none\n",
|
|
|
|
GDK_WINDOW_HWND (window)));
|
2000-07-25 17:31:05 +00:00
|
|
|
SetWindowRgn (GDK_WINDOW_HWND (window), NULL, TRUE);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
HRGN hrgn;
|
|
|
|
DWORD dwStyle;
|
|
|
|
DWORD dwExStyle;
|
|
|
|
RECT rect;
|
|
|
|
|
|
|
|
/* Convert mask bitmap to region */
|
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
|
|
|
hrgn = _gdk_win32_bitmap_to_region (mask);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
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
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %p %p\n",
|
|
|
|
GDK_WINDOW_HWND (window),
|
|
|
|
GDK_WINDOW_HWND (mask)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* SetWindowRgn wants window (not client) coordinates */
|
2000-07-25 17:31:05 +00:00
|
|
|
dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
|
|
|
dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
|
|
|
GetClientRect (GDK_WINDOW_HWND (window), &rect);
|
1999-11-11 22:12:27 +00:00
|
|
|
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
|
|
|
|
OffsetRgn (hrgn, -rect.left, -rect.top);
|
|
|
|
|
|
|
|
OffsetRgn (hrgn, x, y);
|
|
|
|
|
|
|
|
/* If this is a top-level window, add the title bar to the region */
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
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
|
|
|
HRGN tmp = CreateRectRgn (0, 0, rect.right - rect.left, -rect.top);
|
|
|
|
CombineRgn (hrgn, hrgn, tmp, RGN_OR);
|
|
|
|
DeleteObject (tmp);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
SetWindowRgn (GDK_WINDOW_HWND (window), hrgn, TRUE);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_override_redirect (GdkWindow *window,
|
|
|
|
gboolean override_redirect)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
g_warning ("gdk_window_set_override_redirect not implemented");
|
|
|
|
}
|
|
|
|
|
2001-09-21 19:58:35 +00:00
|
|
|
void
|
|
|
|
gdk_window_set_icon_list (GdkWindow *window,
|
|
|
|
GList *pixbufs)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* We could convert it to a hIcon and DrawIcon () it when getting
|
|
|
|
* a WM_PAINT with IsIconic, but is it worth it ? Same probably
|
|
|
|
* goes for gdk_window_set_icon (). Patches accepted :-) --hb
|
|
|
|
* Or do we only need to deliver the Icon on WM_GETICON ?
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
void
|
|
|
|
gdk_window_set_icon (GdkWindow *window,
|
|
|
|
GdkWindow *icon_window,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
|
2000-02-13 14:52:47 +00:00
|
|
|
/* Nothing to do, really. As we share window classes between windows
|
|
|
|
* we can't have window-specific icons, sorry. Don't print any warning
|
|
|
|
* either.
|
|
|
|
*/
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-03-16 21:58:35 +00:00
|
|
|
gdk_window_set_icon_name (GdkWindow *window,
|
|
|
|
const gchar *name)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!SetWindowText (GDK_WINDOW_HWND (window), name))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("SetWindowText");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_group (GdkWindow *window,
|
|
|
|
GdkWindow *leader)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
g_return_if_fail (leader != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (leader));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window) || GDK_WINDOW_DESTROYED (leader))
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
g_warning ("gdk_window_set_group not implemented");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_decorations (GdkWindow *window,
|
|
|
|
GdkWMDecoration decorations)
|
|
|
|
{
|
|
|
|
LONG style, exstyle;
|
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
|
|
|
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
style &= (WS_OVERLAPPED|WS_POPUP|WS_CHILD|WS_MINIMIZE|WS_VISIBLE|WS_DISABLED
|
|
|
|
|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZE);
|
|
|
|
|
|
|
|
exstyle &= (WS_EX_TOPMOST|WS_EX_TRANSPARENT);
|
|
|
|
|
|
|
|
if (decorations & GDK_DECOR_ALL)
|
|
|
|
style |= (WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
|
|
|
|
if (decorations & GDK_DECOR_BORDER)
|
|
|
|
style |= (WS_BORDER);
|
|
|
|
if (decorations & GDK_DECOR_RESIZEH)
|
|
|
|
style |= (WS_THICKFRAME);
|
|
|
|
if (decorations & GDK_DECOR_TITLE)
|
|
|
|
style |= (WS_CAPTION);
|
|
|
|
if (decorations & GDK_DECOR_MENU)
|
|
|
|
style |= (WS_SYSMENU);
|
|
|
|
if (decorations & GDK_DECOR_MINIMIZE)
|
|
|
|
style |= (WS_MINIMIZEBOX);
|
|
|
|
if (decorations & GDK_DECOR_MAXIMIZE)
|
|
|
|
style |= (WS_MAXIMIZEBOX);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, style);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_functions (GdkWindow *window,
|
|
|
|
GdkWMFunction functions)
|
|
|
|
{
|
|
|
|
LONG style, exstyle;
|
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
|
|
|
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
style &= (WS_OVERLAPPED|WS_POPUP|WS_CHILD|WS_MINIMIZE|WS_VISIBLE|WS_DISABLED
|
|
|
|
|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZE|WS_CAPTION|WS_BORDER
|
|
|
|
|WS_SYSMENU);
|
|
|
|
|
|
|
|
exstyle &= (WS_EX_TOPMOST|WS_EX_TRANSPARENT);
|
|
|
|
|
|
|
|
if (functions & GDK_FUNC_ALL)
|
|
|
|
style |= (WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
|
|
|
|
if (functions & GDK_FUNC_RESIZE)
|
|
|
|
style |= (WS_THICKFRAME);
|
|
|
|
if (functions & GDK_FUNC_MOVE)
|
|
|
|
style |= (WS_THICKFRAME);
|
|
|
|
if (functions & GDK_FUNC_MINIMIZE)
|
|
|
|
style |= (WS_MINIMIZEBOX);
|
|
|
|
if (functions & GDK_FUNC_MAXIMIZE)
|
|
|
|
style |= (WS_MAXIMIZEBOX);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, style);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* propagate the shapes from all child windows of a GDK window to the parent
|
|
|
|
* window. Shamelessly ripped from Enlightenment's code
|
|
|
|
*
|
|
|
|
* - Raster
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
|
|
|
QueryTree (HWND hwnd,
|
|
|
|
HWND **children,
|
|
|
|
gint *nchildren)
|
|
|
|
{
|
|
|
|
guint i, n;
|
|
|
|
HWND child;
|
|
|
|
|
|
|
|
n = 0;
|
|
|
|
do {
|
|
|
|
if (n == 0)
|
|
|
|
child = GetWindow (hwnd, GW_CHILD);
|
|
|
|
else
|
|
|
|
child = GetWindow (child, GW_HWNDNEXT);
|
|
|
|
if (child != NULL)
|
|
|
|
n++;
|
|
|
|
} while (child != NULL);
|
|
|
|
|
|
|
|
if (n > 0)
|
|
|
|
{
|
|
|
|
*children = g_new (HWND, n);
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
{
|
|
|
|
if (i == 0)
|
|
|
|
child = GetWindow (hwnd, GW_CHILD);
|
|
|
|
else
|
|
|
|
child = GetWindow (child, GW_HWNDNEXT);
|
|
|
|
*children[i] = child;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_propagate_shapes (HANDLE win,
|
|
|
|
gboolean merge)
|
|
|
|
{
|
|
|
|
RECT emptyRect;
|
|
|
|
HRGN region, childRegion;
|
|
|
|
HWND *list = NULL;
|
|
|
|
gint i, num;
|
|
|
|
|
|
|
|
SetRectEmpty (&emptyRect);
|
|
|
|
region = CreateRectRgnIndirect (&emptyRect);
|
|
|
|
if (merge)
|
|
|
|
GetWindowRgn (win, region);
|
|
|
|
|
|
|
|
QueryTree (win, &list, &num);
|
|
|
|
if (list != NULL)
|
|
|
|
{
|
|
|
|
WINDOWPLACEMENT placement;
|
|
|
|
|
|
|
|
placement.length = sizeof (WINDOWPLACEMENT);
|
|
|
|
/* go through all child windows and combine regions */
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
GetWindowPlacement (list[i], &placement);
|
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
|
|
|
if (placement.showCmd == SW_SHOWNORMAL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
childRegion = CreateRectRgnIndirect (&emptyRect);
|
|
|
|
GetWindowRgn (list[i], childRegion);
|
|
|
|
CombineRgn (region, region, childRegion, RGN_OR);
|
|
|
|
DeleteObject (childRegion);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SetWindowRgn (win, region, TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
DeleteObject (region);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_child_shapes (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
gdk_propagate_shapes (GDK_WINDOW_HWND (window), FALSE);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_merge_child_shapes (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
return;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
gdk_propagate_shapes (GDK_WINDOW_HWND (window), TRUE);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Support for windows that can be guffaw-scrolled
|
|
|
|
* (See http://www.gtk.org/~otaylor/whitepapers/guffaw-scrolling.txt)
|
|
|
|
*/
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gdk_window_gravity_works (void)
|
|
|
|
{
|
|
|
|
enum { UNKNOWN, NO, YES };
|
|
|
|
static gint gravity_works = UNKNOWN;
|
|
|
|
|
|
|
|
if (gravity_works == UNKNOWN)
|
|
|
|
{
|
|
|
|
GdkWindowAttr attr;
|
|
|
|
GdkWindow *parent;
|
|
|
|
GdkWindow *child;
|
|
|
|
gint y;
|
|
|
|
|
|
|
|
attr.window_type = GDK_WINDOW_TEMP;
|
|
|
|
attr.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
attr.x = 0;
|
|
|
|
attr.y = 0;
|
|
|
|
attr.width = 100;
|
|
|
|
attr.height = 100;
|
|
|
|
attr.event_mask = 0;
|
|
|
|
|
|
|
|
parent = gdk_window_new (NULL, &attr, GDK_WA_X | GDK_WA_Y);
|
|
|
|
|
|
|
|
attr.window_type = GDK_WINDOW_CHILD;
|
|
|
|
child = gdk_window_new (parent, &attr, GDK_WA_X | GDK_WA_Y);
|
|
|
|
|
|
|
|
gdk_window_set_static_win_gravity (child, TRUE);
|
|
|
|
|
|
|
|
gdk_window_resize (parent, 100, 110);
|
|
|
|
gdk_window_move (parent, 0, -10);
|
|
|
|
gdk_window_move_resize (parent, 0, 0, 100, 100);
|
|
|
|
|
|
|
|
gdk_window_resize (parent, 100, 110);
|
|
|
|
gdk_window_move (parent, 0, -10);
|
|
|
|
gdk_window_move_resize (parent, 0, 0, 100, 100);
|
|
|
|
|
|
|
|
gdk_window_get_geometry (child, NULL, &y, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
gdk_window_destroy (parent);
|
|
|
|
gdk_window_destroy (child);
|
|
|
|
|
|
|
|
gravity_works = ((y == -20) ? YES : NO);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (gravity_works == YES);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_window_set_static_bit_gravity (GdkWindow *window, gboolean on)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
|
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_static_bit_gravity: Not implemented\n"));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_window_set_static_win_gravity (GdkWindow *window, gboolean on)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
|
2002-03-06 00:36:08 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_static_win_gravity: Not implemented\n"));
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************
|
|
|
|
* gdk_window_set_static_gravities:
|
|
|
|
* Set the bit gravity of the given window to static,
|
|
|
|
* and flag it so all children get static subwindow
|
|
|
|
* gravity.
|
|
|
|
* arguments:
|
|
|
|
* window: window for which to set static gravity
|
|
|
|
* use_static: Whether to turn static gravity on or off.
|
|
|
|
* results:
|
|
|
|
* Does the XServer support static gravity?
|
|
|
|
*************************************************************/
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gdk_window_set_static_gravities (GdkWindow *window,
|
|
|
|
gboolean use_static)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GdkWindowObject *private = (GdkWindowObject *)window;
|
1999-11-11 22:12:27 +00:00
|
|
|
GList *tmp_list;
|
|
|
|
|
|
|
|
g_return_val_if_fail (window != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
|
|
if (!use_static == !private->guffaw_gravity)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (use_static && !gdk_window_gravity_works ())
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
private->guffaw_gravity = use_static;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
gdk_window_set_static_bit_gravity (window, use_static);
|
|
|
|
|
|
|
|
tmp_list = private->children;
|
|
|
|
while (tmp_list)
|
|
|
|
{
|
|
|
|
gdk_window_set_static_win_gravity (window, use_static);
|
|
|
|
|
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2001-03-09 16:43:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Setting window states
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_window_iconify (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
{
|
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Flip our client side flag, the real work happens on map. */
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
0,
|
|
|
|
GDK_WINDOW_STATE_ICONIFIED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_deiconify (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
{
|
|
|
|
gdk_window_show (window);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Flip our client side flag, the real work happens on map. */
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
GDK_WINDOW_STATE_ICONIFIED,
|
|
|
|
0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_stick (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
{
|
|
|
|
/* "stick" means stick to all desktops _and_ do not scroll with the
|
|
|
|
* viewport. i.e. glue to the monitor glass in all cases.
|
|
|
|
*/
|
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
|
|
|
g_warning ("gdk_window_stick (%p) ???", GDK_WINDOW_HWND (window));
|
2001-03-09 16:43:19 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Flip our client side flag, the real work happens on map. */
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
0,
|
|
|
|
GDK_WINDOW_STATE_STICKY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_unstick (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
{
|
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
|
|
|
g_warning ("gdk_window_unstick (%p) ???", GDK_WINDOW_HWND (window));
|
2001-03-09 16:43:19 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Flip our client side flag, the real work happens on map. */
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
GDK_WINDOW_STATE_STICKY,
|
|
|
|
0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_maximize (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
|
|
|
else
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
0,
|
|
|
|
GDK_WINDOW_STATE_MAXIMIZED);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_unmaximize (GdkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
|
|
|
else
|
|
|
|
gdk_synthesize_window_state (window,
|
|
|
|
GDK_WINDOW_STATE_MAXIMIZED,
|
|
|
|
0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_focus (GdkWindow *window,
|
|
|
|
guint32 timestamp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
2002-03-06 00:36:08 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_focus: %p\n", GDK_WINDOW_HWND (window)));
|
|
|
|
|
2001-03-09 16:43:19 +00:00
|
|
|
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
2002-03-06 00:36:08 +00:00
|
|
|
SetFocus (GDK_WINDOW_HWND (window));
|
2001-03-09 16:43:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_modal_hint (GdkWindow *window,
|
|
|
|
gboolean modal)
|
|
|
|
{
|
|
|
|
GdkWindowObject *private;
|
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
private = (GdkWindowObject*) window;
|
|
|
|
|
|
|
|
private->modal_hint = modal;
|
|
|
|
|
|
|
|
if (GDK_WINDOW_IS_MAPPED (window))
|
|
|
|
if (!SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOPMOST,
|
|
|
|
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
|
|
|
|
WIN32_API_FAILED ("SetWindowPos");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_set_type_hint (GdkWindow *window,
|
|
|
|
GdkWindowTypeHint hint)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (hint)
|
|
|
|
{
|
|
|
|
case GDK_WINDOW_TYPE_HINT_DIALOG:
|
|
|
|
break;
|
|
|
|
case GDK_WINDOW_TYPE_HINT_MENU:
|
|
|
|
break;
|
|
|
|
case GDK_WINDOW_TYPE_HINT_TOOLBAR:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_warning ("Unknown hint %d passed to gdk_window_set_type_hint", hint);
|
|
|
|
/* Fall thru */
|
|
|
|
case GDK_WINDOW_TYPE_HINT_NORMAL:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* XXX ???
|
|
|
|
*/
|
2002-03-06 00:36:08 +00:00
|
|
|
GDK_NOTE (MISC, g_print ("gdk_window_set_type_hint (%p)\n",
|
|
|
|
GDK_WINDOW_HWND (window)));
|
2001-03-09 16:43:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_shape_combine_region (GdkWindow *window,
|
|
|
|
GdkRegion *shape_region,
|
|
|
|
gint offset_x,
|
|
|
|
gint offset_y)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* XXX: even on X implemented conditional ... */
|
|
|
|
}
|
2001-03-31 19:33:49 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_begin_resize_drag (GdkWindow *window,
|
|
|
|
GdkWindowEdge edge,
|
|
|
|
gint button,
|
|
|
|
gint root_x,
|
|
|
|
gint root_y,
|
|
|
|
guint32 timestamp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* XXX: isn't all this default on win32 ... */
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_window_begin_move_drag (GdkWindow *window,
|
|
|
|
gint button,
|
|
|
|
gint root_x,
|
|
|
|
gint root_y,
|
|
|
|
guint32 timestamp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* XXX: isn't all this default on win32 ... */
|
2001-07-05 13:41:34 +00:00
|
|
|
}
|
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
|
|
|
|
|
|
|
GdkWindow *
|
|
|
|
gdk_window_lookup_for_display (GdkDisplay *display, GdkNativeWindow anid)
|
|
|
|
{
|
2002-06-20 23:59:27 +00:00
|
|
|
g_return_val_if_fail (display == gdk_display_get_default(), NULL);
|
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
|
|
|
|
|
|
|
return gdk_window_lookup (anid);
|
|
|
|
}
|