summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>1999-10-05 19:04:48 +0000
committerTor Lillqvist <tml@src.gnome.org>1999-10-05 19:04:48 +0000
commitd23e3848a93e052763c6290528312b9f1e332df2 (patch)
treed16177a910b5a1648fac1105b9a2b900851b0275
parent069932c2a8744a5352537c6fa3b462e3e58997ea (diff)
downloadgtk+-d23e3848a93e052763c6290528312b9f1e332df2.tar.gz
Corresponding changes as in X11 backend.
1999-10-05 Tor Lillqvist <tml@iki.fi> * gdk/win32/*.[ch]: Corresponding changes as in X11 backend. * gdk/win32/gdkcompat.c: New file, actually provide an implementation for the deprecated functions. (Just temporarily.) * gtk/gtkfilesel.c: Fix an #ifdef syntax botch. * gtk/makefile.{cygwin,msc}: Update gdk_headers. * gdk/win32/gdk.def gtk/gtk.def: Updates.
-rw-r--r--ChangeLog13
-rw-r--r--ChangeLog.pre-2-013
-rw-r--r--ChangeLog.pre-2-1013
-rw-r--r--ChangeLog.pre-2-213
-rw-r--r--ChangeLog.pre-2-413
-rw-r--r--ChangeLog.pre-2-613
-rw-r--r--ChangeLog.pre-2-813
-rw-r--r--gdk/win32/gdk-win32.def5
-rw-r--r--gdk/win32/gdk.c4
-rw-r--r--gdk/win32/gdk.def5
-rw-r--r--gdk/win32/gdkcursor-win32.c6
-rw-r--r--gdk/win32/gdkcursor.c6
-rw-r--r--gdk/win32/gdkdnd-win32.c4
-rw-r--r--gdk/win32/gdkdnd.c4
-rw-r--r--gdk/win32/gdkdraw.c184
-rw-r--r--gdk/win32/gdkdrawable-win32.c184
-rw-r--r--gdk/win32/gdkevents-win32.c235
-rw-r--r--gdk/win32/gdkevents.c235
-rw-r--r--gdk/win32/gdkgc-win32.c55
-rw-r--r--gdk/win32/gdkgc.c55
-rw-r--r--gdk/win32/gdkimage-win32.c41
-rw-r--r--gdk/win32/gdkimage.c41
-rw-r--r--gdk/win32/gdkinput-win32.c41
-rw-r--r--gdk/win32/gdkinput.c41
-rw-r--r--gdk/win32/gdkmain-win32.c4
-rw-r--r--gdk/win32/gdkpixmap-win32.c137
-rw-r--r--gdk/win32/gdkpixmap.c137
-rw-r--r--gdk/win32/gdkprivate-win32.h68
-rw-r--r--gdk/win32/gdkprivate.h68
-rw-r--r--gdk/win32/gdkproperty-win32.c22
-rw-r--r--gdk/win32/gdkproperty.c22
-rw-r--r--gdk/win32/gdkselection-win32.c55
-rw-r--r--gdk/win32/gdkselection.c55
-rw-r--r--gdk/win32/gdkwin32.h6
-rw-r--r--gdk/win32/gdkwindow-win32.c850
-rw-r--r--gdk/win32/gdkwindow.c850
-rw-r--r--gdk/win32/gdkx.h6
-rw-r--r--gdk/win32/makefile.cygwin3
-rw-r--r--gdk/win32/makefile.msc1
-rwxr-xr-xgtk/gtk.def6
-rw-r--r--gtk/gtkfilesel.c2
-rw-r--r--gtk/makefile.cygwin23
-rwxr-xr-xgtk/makefile.msc23
43 files changed, 1702 insertions, 1873 deletions
diff --git a/ChangeLog b/ChangeLog
index e28d43125a..c9cd1d1b00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+1999-10-05 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/*.[ch]: Corresponding changes as in X11 backend.
+
+ * gdk/win32/gdkcompat.c: New file, actually provide an
+ implementation for the deprecated functions. (Just temporarily.)
+
+ * gtk/gtkfilesel.c: Fix an #ifdef syntax botch.
+
+ * gtk/makefile.{cygwin,msc}: Update gdk_headers.
+
+ * gdk/win32/gdk.def gtk/gtk.def: Updates.
+
1999-10-05 Kjartan Maraas <kmaraas@online.no>
* configure.in: Added "uk" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index e28d43125a..c9cd1d1b00 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,16 @@
+1999-10-05 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/*.[ch]: Corresponding changes as in X11 backend.
+
+ * gdk/win32/gdkcompat.c: New file, actually provide an
+ implementation for the deprecated functions. (Just temporarily.)
+
+ * gtk/gtkfilesel.c: Fix an #ifdef syntax botch.
+
+ * gtk/makefile.{cygwin,msc}: Update gdk_headers.
+
+ * gdk/win32/gdk.def gtk/gtk.def: Updates.
+
1999-10-05 Kjartan Maraas <kmaraas@online.no>
* configure.in: Added "uk" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index e28d43125a..c9cd1d1b00 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,16 @@
+1999-10-05 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/*.[ch]: Corresponding changes as in X11 backend.
+
+ * gdk/win32/gdkcompat.c: New file, actually provide an
+ implementation for the deprecated functions. (Just temporarily.)
+
+ * gtk/gtkfilesel.c: Fix an #ifdef syntax botch.
+
+ * gtk/makefile.{cygwin,msc}: Update gdk_headers.
+
+ * gdk/win32/gdk.def gtk/gtk.def: Updates.
+
1999-10-05 Kjartan Maraas <kmaraas@online.no>
* configure.in: Added "uk" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index e28d43125a..c9cd1d1b00 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,16 @@
+1999-10-05 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/*.[ch]: Corresponding changes as in X11 backend.
+
+ * gdk/win32/gdkcompat.c: New file, actually provide an
+ implementation for the deprecated functions. (Just temporarily.)
+
+ * gtk/gtkfilesel.c: Fix an #ifdef syntax botch.
+
+ * gtk/makefile.{cygwin,msc}: Update gdk_headers.
+
+ * gdk/win32/gdk.def gtk/gtk.def: Updates.
+
1999-10-05 Kjartan Maraas <kmaraas@online.no>
* configure.in: Added "uk" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index e28d43125a..c9cd1d1b00 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,16 @@
+1999-10-05 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/*.[ch]: Corresponding changes as in X11 backend.
+
+ * gdk/win32/gdkcompat.c: New file, actually provide an
+ implementation for the deprecated functions. (Just temporarily.)
+
+ * gtk/gtkfilesel.c: Fix an #ifdef syntax botch.
+
+ * gtk/makefile.{cygwin,msc}: Update gdk_headers.
+
+ * gdk/win32/gdk.def gtk/gtk.def: Updates.
+
1999-10-05 Kjartan Maraas <kmaraas@online.no>
* configure.in: Added "uk" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index e28d43125a..c9cd1d1b00 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,16 @@
+1999-10-05 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/*.[ch]: Corresponding changes as in X11 backend.
+
+ * gdk/win32/gdkcompat.c: New file, actually provide an
+ implementation for the deprecated functions. (Just temporarily.)
+
+ * gtk/gtkfilesel.c: Fix an #ifdef syntax botch.
+
+ * gtk/makefile.{cygwin,msc}: Update gdk_headers.
+
+ * gdk/win32/gdk.def gtk/gtk.def: Updates.
+
1999-10-05 Kjartan Maraas <kmaraas@online.no>
* configure.in: Added "uk" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index e28d43125a..c9cd1d1b00 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,16 @@
+1999-10-05 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/*.[ch]: Corresponding changes as in X11 backend.
+
+ * gdk/win32/gdkcompat.c: New file, actually provide an
+ implementation for the deprecated functions. (Just temporarily.)
+
+ * gtk/gtkfilesel.c: Fix an #ifdef syntax botch.
+
+ * gtk/makefile.{cygwin,msc}: Update gdk_headers.
+
+ * gdk/win32/gdk.def gtk/gtk.def: Updates.
+
1999-10-05 Kjartan Maraas <kmaraas@online.no>
* configure.in: Added "uk" to ALL_LINGUAS.
diff --git a/gdk/win32/gdk-win32.def b/gdk/win32/gdk-win32.def
index 89b100b8b0..877c12d345 100644
--- a/gdk/win32/gdk-win32.def
+++ b/gdk/win32/gdk-win32.def
@@ -80,6 +80,11 @@ EXPORTS
gdk_draw_string
gdk_draw_text
gdk_draw_text_wc
+ gdk_drawable_get_colormap
+ gdk_drawable_get_size
+ gdk_drawable_get_type
+ gdk_drawable_get_visual
+ gdk_drawable_set_colormap
gdk_drawable_set_data
gdk_error_code
gdk_error_trap_pop
diff --git a/gdk/win32/gdk.c b/gdk/win32/gdk.c
index 83e20930a3..5a44835c5d 100644
--- a/gdk/win32/gdk.c
+++ b/gdk/win32/gdk.c
@@ -333,7 +333,7 @@ gdk_screen_width (void)
{
gint return_val;
- return_val = gdk_root_parent.width;
+ return_val = gdk_root_parent.drawable.width;
return return_val;
}
@@ -358,7 +358,7 @@ gdk_screen_height (void)
{
gint return_val;
- return_val = gdk_root_parent.height;
+ return_val = gdk_root_parent.drawable.height;
return return_val;
}
diff --git a/gdk/win32/gdk.def b/gdk/win32/gdk.def
index 89b100b8b0..877c12d345 100644
--- a/gdk/win32/gdk.def
+++ b/gdk/win32/gdk.def
@@ -80,6 +80,11 @@ EXPORTS
gdk_draw_string
gdk_draw_text
gdk_draw_text_wc
+ gdk_drawable_get_colormap
+ gdk_drawable_get_size
+ gdk_drawable_get_type
+ gdk_drawable_get_visual
+ gdk_drawable_set_colormap
gdk_drawable_set_data
gdk_error_code
gdk_error_trap_pop
diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c
index 9c4534fe9f..78623a25f2 100644
--- a/gdk/win32/gdkcursor-win32.c
+++ b/gdk/win32/gdkcursor-win32.c
@@ -147,7 +147,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
{
GdkCursorPrivate *private;
GdkCursor *cursor;
- GdkPixmapPrivate *source_private, *mask_private;
+ GdkDrawablePrivate *source_private, *mask_private;
GdkImage *source_image, *mask_image;
HCURSOR xcursor;
guchar *p, *q, *XORmask, *ANDmask;
@@ -158,8 +158,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
g_return_val_if_fail (source != NULL, NULL);
g_return_val_if_fail (mask != NULL, NULL);
- source_private = (GdkPixmapPrivate *) source;
- mask_private = (GdkPixmapPrivate *) mask;
+ source_private = (GdkDrawablePrivate *) source;
+ mask_private = (GdkDrawablePrivate *) mask;
g_return_val_if_fail (source_private->width == mask_private->width
&& source_private->height == mask_private->height,
diff --git a/gdk/win32/gdkcursor.c b/gdk/win32/gdkcursor.c
index 9c4534fe9f..78623a25f2 100644
--- a/gdk/win32/gdkcursor.c
+++ b/gdk/win32/gdkcursor.c
@@ -147,7 +147,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
{
GdkCursorPrivate *private;
GdkCursor *cursor;
- GdkPixmapPrivate *source_private, *mask_private;
+ GdkDrawablePrivate *source_private, *mask_private;
GdkImage *source_image, *mask_image;
HCURSOR xcursor;
guchar *p, *q, *XORmask, *ANDmask;
@@ -158,8 +158,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
g_return_val_if_fail (source != NULL, NULL);
g_return_val_if_fail (mask != NULL, NULL);
- source_private = (GdkPixmapPrivate *) source;
- mask_private = (GdkPixmapPrivate *) mask;
+ source_private = (GdkDrawablePrivate *) source;
+ mask_private = (GdkDrawablePrivate *) mask;
g_return_val_if_fail (source_private->width == mask_private->width
&& source_private->height == mask_private->height,
diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
index 4589129173..5a220c6423 100644
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -733,7 +733,7 @@ gdk_drag_find_window (GdkDragContext *context,
GdkDragProtocol *protocol)
{
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
- GdkWindowPrivate *drag_window_private = (GdkWindowPrivate *) drag_window;
+ GdkDrawablePrivate *drag_window_private = (GdkDrawablePrivate*) drag_window;
HWND recipient;
POINT pt;
@@ -833,7 +833,7 @@ gdk_destroy_filter (GdkXEvent *xev,
void
gdk_window_register_dnd (GdkWindow *window)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *) window;
+ GdkDrawablePrivate *private = (GdkDrawablePrivate *) window;
#ifdef OLE2_DND
target_drag_context *context;
HRESULT hres;
diff --git a/gdk/win32/gdkdnd.c b/gdk/win32/gdkdnd.c
index 4589129173..5a220c6423 100644
--- a/gdk/win32/gdkdnd.c
+++ b/gdk/win32/gdkdnd.c
@@ -733,7 +733,7 @@ gdk_drag_find_window (GdkDragContext *context,
GdkDragProtocol *protocol)
{
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
- GdkWindowPrivate *drag_window_private = (GdkWindowPrivate *) drag_window;
+ GdkDrawablePrivate *drag_window_private = (GdkDrawablePrivate*) drag_window;
HWND recipient;
POINT pt;
@@ -833,7 +833,7 @@ gdk_destroy_filter (GdkXEvent *xev,
void
gdk_window_register_dnd (GdkWindow *window)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *) window;
+ GdkDrawablePrivate *private = (GdkDrawablePrivate *) window;
#ifdef OLE2_DND
target_drag_context *context;
HRESULT hres;
diff --git a/gdk/win32/gdkdraw.c b/gdk/win32/gdkdraw.c
index 0904fc1ce1..34b7a8cba8 100644
--- a/gdk/win32/gdkdraw.c
+++ b/gdk/win32/gdkdraw.c
@@ -30,27 +30,137 @@
#include "gdkdrawable.h"
#include "gdkprivate.h"
+#include "gdkwindow.h"
+#include "gdkx.h"
#ifndef G_PI
#define G_PI 3.14159265358979323846
#endif
+/* Manipulation of drawables
+ */
+void
+gdk_drawable_set_data (GdkDrawable *drawable,
+ const gchar *key,
+ gpointer data,
+ GDestroyNotify destroy_func)
+{
+ g_dataset_set_data_full (drawable, key, data, destroy_func);
+}
+
+void
+gdk_drawable_get_data (GdkDrawable *drawable,
+ const gchar *key)
+{
+ g_dataset_get_data (drawable, key);
+}
+
+GdkDrawableType
+gdk_drawable_get_type (GdkDrawable *drawable)
+{
+ g_return_val_if_fail (drawable != NULL, (GdkDrawableType) -1);
+
+ return GDK_DRAWABLE_TYPE (drawable);
+}
+
+void
+gdk_drawable_get_size (GdkDrawable *drawable,
+ gint *width,
+ gint *height)
+{
+ GdkDrawablePrivate *drawable_private;
+
+ g_return_if_fail (drawable != NULL);
+
+ drawable_private = (GdkDrawablePrivate*) drawable;
+
+ if (width)
+ *width = drawable_private->width;
+ if (height)
+ *height = drawable_private->height;
+}
+
+void
+gdk_drawable_set_colormap (GdkDrawable *drawable,
+ GdkColormap *colormap)
+{
+ GdkDrawablePrivate *drawable_private;
+ GdkColormapPrivate *colormap_private;
+
+ g_return_if_fail (drawable != NULL);
+ g_return_if_fail (colormap != NULL);
+
+ drawable_private = (GdkDrawablePrivate*) drawable;
+ colormap_private = (GdkColormapPrivate*) colormap;
+
+ if (!GDK_DRAWABLE_DESTROYED (drawable))
+ {
+ if (GDK_IS_WINDOW (drawable))
+ {
+ g_return_if_fail (colormap_private->visual !=
+ ((GdkColormapPrivate*)(drawable_private->colormap))->visual);
+ /* XXX ??? */
+ GDK_NOTE (MISC, g_print ("gdk_drawable_set_colormap: %#x %#x\n",
+ GDK_DRAWABLE_XID (drawable),
+ colormap_private->xcolormap));
+ }
+ if (drawable_private->colormap)
+ gdk_colormap_unref (drawable_private->colormap);
+ drawable_private->colormap = colormap;
+ gdk_colormap_ref (drawable_private->colormap);
+
+ if (GDK_IS_WINDOW (drawable) &&
+ drawable_private->window_type != GDK_WINDOW_TOPLEVEL)
+ gdk_window_add_colormap_windows (drawable);
+ }
+}
+
+GdkColormap*
+gdk_drawable_get_colormap (GdkDrawable *drawable)
+{
+ GdkDrawablePrivate *drawable_private;
+
+ g_return_val_if_fail (drawable != NULL, NULL);
+ drawable_private = (GdkDrawablePrivate*) drawable;
+
+ if (!GDK_DRAWABLE_DESTROYED (drawable))
+ {
+ if (drawable_private->colormap == NULL)
+ return gdk_colormap_get_system (); /* XXX ??? */
+ else
+ return drawable_private->colormap;
+ }
+
+ return NULL;
+}
+
+GdkVisual*
+gdk_drawable_get_visual (GdkDrawable *drawable)
+{
+ GdkColormap *colormap;
+
+ g_return_val_if_fail (drawable != NULL, NULL);
+
+ colormap = gdk_drawable_get_colormap (drawable);
+ return colormap ? gdk_colormap_get_visual (colormap) : NULL;
+}
+
void
gdk_draw_point (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
@@ -74,16 +184,16 @@ gdk_draw_line (GdkDrawable *drawable,
gint x2,
gint y2)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
@@ -115,7 +225,7 @@ gdk_draw_rectangle (GdkDrawable *drawable,
gint width,
gint height)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
HGDIOBJ oldpen, oldbrush;
@@ -123,9 +233,9 @@ gdk_draw_rectangle (GdkDrawable *drawable,
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@@ -187,7 +297,7 @@ gdk_draw_arc (GdkDrawable *drawable,
gint angle1,
gint angle2)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
int nXStartArc, nYStartArc, nXEndArc, nYEndArc;
@@ -195,9 +305,9 @@ gdk_draw_arc (GdkDrawable *drawable,
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@@ -262,7 +372,7 @@ gdk_draw_polygon (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
POINT *pts;
@@ -271,9 +381,9 @@ gdk_draw_polygon (GdkDrawable *drawable,
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
GDK_NOTE (MISC, g_print ("gdk_draw_polygon: %#x (%d) %d\n",
@@ -341,7 +451,7 @@ gdk_draw_text (GdkDrawable *drawable,
const gchar *text,
gint text_length)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkFontPrivate *font_private;
GdkGCPrivate *gc_private;
HDC hdc;
@@ -353,9 +463,9 @@ gdk_draw_text (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
g_return_if_fail (text != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
@@ -392,7 +502,7 @@ gdk_draw_text_wc (GdkDrawable *drawable,
const GdkWChar *text,
gint text_length)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkFontPrivate *font_private;
GdkGCPrivate *gc_private;
gint i;
@@ -403,9 +513,9 @@ gdk_draw_text_wc (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
g_return_if_fail (text != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
@@ -451,8 +561,8 @@ gdk_draw_pixmap (GdkDrawable *drawable,
gint width,
gint height)
{
- GdkWindowPrivate *drawable_private;
- GdkWindowPrivate *src_private;
+ GdkDrawablePrivate *drawable_private;
+ GdkDrawablePrivate *src_private;
GdkGCPrivate *gc_private;
HDC hdc;
HDC srcdc;
@@ -464,10 +574,10 @@ gdk_draw_pixmap (GdkDrawable *drawable,
g_return_if_fail (src != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- src_private = (GdkWindowPrivate*) src;
- if (drawable_private->destroyed || src_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable) || GDK_DRAWABLE_DESTROYED (src))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
+ src_private = (GdkDrawablePrivate*) src;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@@ -490,7 +600,7 @@ gdk_draw_pixmap (GdkDrawable *drawable,
SetRectEmpty (&r);
outside_rgn = CreateRectRgnIndirect (&r);
- if (drawable_private->window_type != GDK_WINDOW_PIXMAP)
+ if (drawable_private->window_type != GDK_DRAWABLE_PIXMAP)
{
/* If we are drawing on a window, calculate the region that is
* outside the source pixmap, and invalidate that, causing it to
@@ -539,7 +649,7 @@ gdk_draw_pixmap (GdkDrawable *drawable,
/* Strangely enough, this function is called also to bitblt
* from a window.
*/
- if (src_private->window_type == GDK_WINDOW_PIXMAP)
+ if (src_private->window_type == GDK_DRAWABLE_PIXMAP)
{
if ((srcdc = CreateCompatibleDC (hdc)) == NULL)
g_warning ("gdk_draw_pixmap: CreateCompatibleDC failed");
@@ -636,7 +746,7 @@ gdk_draw_points (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
int i;
@@ -645,9 +755,9 @@ gdk_draw_points (GdkDrawable *drawable,
g_return_if_fail ((points != NULL) && (npoints > 0));
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
@@ -673,7 +783,7 @@ gdk_draw_segments (GdkDrawable *drawable,
GdkSegment *segs,
gint nsegs)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
int i;
@@ -685,9 +795,9 @@ gdk_draw_segments (GdkDrawable *drawable,
g_return_if_fail (segs != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
@@ -713,7 +823,7 @@ gdk_draw_lines (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
POINT *pts;
@@ -726,7 +836,9 @@ gdk_draw_lines (GdkDrawable *drawable,
g_return_if_fail (points != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
+ if (GDK_DRAWABLE_DESTROYED (drawable))
+ return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index 0904fc1ce1..34b7a8cba8 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -30,27 +30,137 @@
#include "gdkdrawable.h"
#include "gdkprivate.h"
+#include "gdkwindow.h"
+#include "gdkx.h"
#ifndef G_PI
#define G_PI 3.14159265358979323846
#endif
+/* Manipulation of drawables
+ */
+void
+gdk_drawable_set_data (GdkDrawable *drawable,
+ const gchar *key,
+ gpointer data,
+ GDestroyNotify destroy_func)
+{
+ g_dataset_set_data_full (drawable, key, data, destroy_func);
+}
+
+void
+gdk_drawable_get_data (GdkDrawable *drawable,
+ const gchar *key)
+{
+ g_dataset_get_data (drawable, key);
+}
+
+GdkDrawableType
+gdk_drawable_get_type (GdkDrawable *drawable)
+{
+ g_return_val_if_fail (drawable != NULL, (GdkDrawableType) -1);
+
+ return GDK_DRAWABLE_TYPE (drawable);
+}
+
+void
+gdk_drawable_get_size (GdkDrawable *drawable,
+ gint *width,
+ gint *height)
+{
+ GdkDrawablePrivate *drawable_private;
+
+ g_return_if_fail (drawable != NULL);
+
+ drawable_private = (GdkDrawablePrivate*) drawable;
+
+ if (width)
+ *width = drawable_private->width;
+ if (height)
+ *height = drawable_private->height;
+}
+
+void
+gdk_drawable_set_colormap (GdkDrawable *drawable,
+ GdkColormap *colormap)
+{
+ GdkDrawablePrivate *drawable_private;
+ GdkColormapPrivate *colormap_private;
+
+ g_return_if_fail (drawable != NULL);
+ g_return_if_fail (colormap != NULL);
+
+ drawable_private = (GdkDrawablePrivate*) drawable;
+ colormap_private = (GdkColormapPrivate*) colormap;
+
+ if (!GDK_DRAWABLE_DESTROYED (drawable))
+ {
+ if (GDK_IS_WINDOW (drawable))
+ {
+ g_return_if_fail (colormap_private->visual !=
+ ((GdkColormapPrivate*)(drawable_private->colormap))->visual);
+ /* XXX ??? */
+ GDK_NOTE (MISC, g_print ("gdk_drawable_set_colormap: %#x %#x\n",
+ GDK_DRAWABLE_XID (drawable),
+ colormap_private->xcolormap));
+ }
+ if (drawable_private->colormap)
+ gdk_colormap_unref (drawable_private->colormap);
+ drawable_private->colormap = colormap;
+ gdk_colormap_ref (drawable_private->colormap);
+
+ if (GDK_IS_WINDOW (drawable) &&
+ drawable_private->window_type != GDK_WINDOW_TOPLEVEL)
+ gdk_window_add_colormap_windows (drawable);
+ }
+}
+
+GdkColormap*
+gdk_drawable_get_colormap (GdkDrawable *drawable)
+{
+ GdkDrawablePrivate *drawable_private;
+
+ g_return_val_if_fail (drawable != NULL, NULL);
+ drawable_private = (GdkDrawablePrivate*) drawable;
+
+ if (!GDK_DRAWABLE_DESTROYED (drawable))
+ {
+ if (drawable_private->colormap == NULL)
+ return gdk_colormap_get_system (); /* XXX ??? */
+ else
+ return drawable_private->colormap;
+ }
+
+ return NULL;
+}
+
+GdkVisual*
+gdk_drawable_get_visual (GdkDrawable *drawable)
+{
+ GdkColormap *colormap;
+
+ g_return_val_if_fail (drawable != NULL, NULL);
+
+ colormap = gdk_drawable_get_colormap (drawable);
+ return colormap ? gdk_colormap_get_visual (colormap) : NULL;
+}
+
void
gdk_draw_point (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
@@ -74,16 +184,16 @@ gdk_draw_line (GdkDrawable *drawable,
gint x2,
gint y2)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
@@ -115,7 +225,7 @@ gdk_draw_rectangle (GdkDrawable *drawable,
gint width,
gint height)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
HGDIOBJ oldpen, oldbrush;
@@ -123,9 +233,9 @@ gdk_draw_rectangle (GdkDrawable *drawable,
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@@ -187,7 +297,7 @@ gdk_draw_arc (GdkDrawable *drawable,
gint angle1,
gint angle2)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
int nXStartArc, nYStartArc, nXEndArc, nYEndArc;
@@ -195,9 +305,9 @@ gdk_draw_arc (GdkDrawable *drawable,
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@@ -262,7 +372,7 @@ gdk_draw_polygon (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
POINT *pts;
@@ -271,9 +381,9 @@ gdk_draw_polygon (GdkDrawable *drawable,
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
GDK_NOTE (MISC, g_print ("gdk_draw_polygon: %#x (%d) %d\n",
@@ -341,7 +451,7 @@ gdk_draw_text (GdkDrawable *drawable,
const gchar *text,
gint text_length)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkFontPrivate *font_private;
GdkGCPrivate *gc_private;
HDC hdc;
@@ -353,9 +463,9 @@ gdk_draw_text (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
g_return_if_fail (text != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
@@ -392,7 +502,7 @@ gdk_draw_text_wc (GdkDrawable *drawable,
const GdkWChar *text,
gint text_length)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkFontPrivate *font_private;
GdkGCPrivate *gc_private;
gint i;
@@ -403,9 +513,9 @@ gdk_draw_text_wc (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
g_return_if_fail (text != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
@@ -451,8 +561,8 @@ gdk_draw_pixmap (GdkDrawable *drawable,
gint width,
gint height)
{
- GdkWindowPrivate *drawable_private;
- GdkWindowPrivate *src_private;
+ GdkDrawablePrivate *drawable_private;
+ GdkDrawablePrivate *src_private;
GdkGCPrivate *gc_private;
HDC hdc;
HDC srcdc;
@@ -464,10 +574,10 @@ gdk_draw_pixmap (GdkDrawable *drawable,
g_return_if_fail (src != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- src_private = (GdkWindowPrivate*) src;
- if (drawable_private->destroyed || src_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable) || GDK_DRAWABLE_DESTROYED (src))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
+ src_private = (GdkDrawablePrivate*) src;
gc_private = (GdkGCPrivate*) gc;
if (width == -1)
@@ -490,7 +600,7 @@ gdk_draw_pixmap (GdkDrawable *drawable,
SetRectEmpty (&r);
outside_rgn = CreateRectRgnIndirect (&r);
- if (drawable_private->window_type != GDK_WINDOW_PIXMAP)
+ if (drawable_private->window_type != GDK_DRAWABLE_PIXMAP)
{
/* If we are drawing on a window, calculate the region that is
* outside the source pixmap, and invalidate that, causing it to
@@ -539,7 +649,7 @@ gdk_draw_pixmap (GdkDrawable *drawable,
/* Strangely enough, this function is called also to bitblt
* from a window.
*/
- if (src_private->window_type == GDK_WINDOW_PIXMAP)
+ if (src_private->window_type == GDK_DRAWABLE_PIXMAP)
{
if ((srcdc = CreateCompatibleDC (hdc)) == NULL)
g_warning ("gdk_draw_pixmap: CreateCompatibleDC failed");
@@ -636,7 +746,7 @@ gdk_draw_points (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
int i;
@@ -645,9 +755,9 @@ gdk_draw_points (GdkDrawable *drawable,
g_return_if_fail ((points != NULL) && (npoints > 0));
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
@@ -673,7 +783,7 @@ gdk_draw_segments (GdkDrawable *drawable,
GdkSegment *segs,
gint nsegs)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
int i;
@@ -685,9 +795,9 @@ gdk_draw_segments (GdkDrawable *drawable,
g_return_if_fail (segs != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
@@ -713,7 +823,7 @@ gdk_draw_lines (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
HDC hdc;
POINT *pts;
@@ -726,7 +836,9 @@ gdk_draw_lines (GdkDrawable *drawable,
g_return_if_fail (points != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
+ if (GDK_DRAWABLE_DESTROYED (drawable))
+ return;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
hdc = gdk_gc_predraw (drawable_private, gc_private);
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index fd2c6cf020..653e62ba79 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -114,13 +114,13 @@ static GdkWindow *button_window[2]; /* The last 2 windows to receive button
*/
static guint button_number[2]; /* The last 2 buttons to be pressed.
*/
-static GdkWindowPrivate *p_grab_window = NULL; /* Window that currently
- * holds the pointer grab
- */
+static GdkWindow *p_grab_window = NULL; /* Window that currently
+ * holds the pointer grab
+ */
-static GdkWindowPrivate *k_grab_window = NULL; /* Window the holds the
- * keyboard grab
- */
+static GdkWindow *k_grab_window = NULL; /* Window the holds the
+ * keyboard grab
+ */
static GList *client_filters; /* Filters for client messages */
@@ -772,26 +772,24 @@ gdk_pointer_grab (GdkWindow * window,
GdkCursor * cursor,
guint32 time)
{
- GdkWindowPrivate *window_private;
HWND xwindow;
HWND xconfine_to;
HCURSOR xcursor;
- GdkWindowPrivate *confine_to_private;
GdkCursorPrivate *cursor_private;
gint return_val;
g_return_val_if_fail (window != NULL, 0);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
+ g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0);
- window_private = (GdkWindowPrivate*) window;
- confine_to_private = (GdkWindowPrivate*) confine_to;
cursor_private = (GdkCursorPrivate*) cursor;
- xwindow = window_private->xwindow;
+ xwindow = GDK_DRAWABLE_XID (window);
- if (!confine_to || confine_to_private->destroyed)
+ if (!confine_to || GDK_DRAWABLE_DESTROYED (confine_to))
xconfine_to = NULL;
else
- xconfine_to = confine_to_private->xwindow;
+ xconfine_to = GDK_DRAWABLE_XID (confine_to);
if (!cursor)
xcursor = NULL;
@@ -809,7 +807,7 @@ gdk_pointer_grab (GdkWindow * window,
if (return_val == Success)
{
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
GDK_NOTE (EVENTS, g_print ("gdk_pointer_grab: %#x %s %#x\n",
xwindow,
@@ -832,7 +830,7 @@ gdk_pointer_grab (GdkWindow * window,
if (return_val == GrabSuccess)
{
- p_grab_window = window_private;
+ p_grab_window = window;
p_grab_cursor = xcursor;
}
@@ -914,17 +912,15 @@ gdk_keyboard_grab (GdkWindow * window,
gint owner_events,
guint32 time)
{
- GdkWindowPrivate *window_private;
gint return_val;
g_return_val_if_fail (window != NULL, 0);
-
- window_private = (GdkWindowPrivate*) window;
+ g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
GDK_NOTE (EVENTS, g_print ("gdk_keyboard_grab %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
k_grab_owner_events = owner_events != 0;
return_val = GrabSuccess;
@@ -933,7 +929,7 @@ gdk_keyboard_grab (GdkWindow * window,
return_val = AlreadyGrabbed;
if (return_val == GrabSuccess)
- k_grab_window = window_private;
+ k_grab_window = window;
return return_val;
}
@@ -1164,6 +1160,9 @@ gdk_event_translate (GdkEvent *event,
MINMAXINFO *lpmmi;
GdkWindowPrivate *curWnd_private;
GdkEventMask mask;
+ GdkDrawablePrivate *pixmap_private;
+ HDC bgdc;
+ HGDIOBJ oldbitmap;
int button;
int i, j;
gchar buf[256];
@@ -1221,7 +1220,7 @@ gdk_event_translate (GdkEvent *event,
event->any.window = window;
- if (window_private && window_private->destroyed)
+ if (window_private && GDK_DRAWABLE_DESTROYED (window))
{
}
else
@@ -1250,7 +1249,7 @@ gdk_event_translate (GdkEvent *event,
event->selection.property = gdk_selection_property;
event->selection.time = xevent->time;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
/* Will pass through switch below without match */
}
@@ -1267,7 +1266,7 @@ gdk_event_translate (GdkEvent *event,
event->selection.requestor = (guint32) xevent->hwnd;
event->selection.time = xevent->time;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
/* Again, will pass through switch below without match */
}
@@ -1281,7 +1280,7 @@ gdk_event_translate (GdkEvent *event,
event->selection.selection = xevent->wParam;
event->selection.time = xevent->time;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
/* Once again, we will pass through switch below without match */
}
@@ -1368,14 +1367,14 @@ gdk_event_translate (GdkEvent *event,
ignore_WM_CHAR = TRUE;
keyup_or_down:
- if (k_grab_window != NULL
- && !k_grab_owner_events)
+ if (k_grab_window != NULL && !k_grab_owner_events)
{
/* Keyboard is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS,
g_print ("...grabbed, owner_events FALSE, "
- "sending to %#x\n", k_grab_window->xwindow));
- event->key.window = (GdkWindow *) k_grab_window;
+ "sending to %#x\n",
+ GDK_DRAWABLE_XID (k_grab_window)));
+ event->key.window = k_grab_window;
}
else if (window_private
&& (((xevent->message == WM_KEYUP
@@ -1386,14 +1385,14 @@ gdk_event_translate (GdkEvent *event,
&& !(window_private->event_mask & GDK_KEY_PRESS_MASK))))
{
/* Owner window doesn't want it */
- if (k_grab_window != NULL
- && k_grab_owner_events)
+ if (k_grab_window != NULL && k_grab_owner_events)
{
/* Keyboard is grabbed with owner_events TRUE */
GDK_NOTE (EVENTS,
g_print ("...grabbed, owner_events TRUE, doesn't want it, "
- "sending to %#x\n", k_grab_window->xwindow));
- event->key.window = (GdkWindow *) k_grab_window;
+ "sending to %#x\n",
+ GDK_DRAWABLE_XID (k_grab_window)));
+ event->key.window = k_grab_window;
}
else
{
@@ -1407,7 +1406,7 @@ gdk_event_translate (GdkEvent *event,
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto keyup_or_down;
}
}
@@ -1619,7 +1618,7 @@ gdk_event_translate (GdkEvent *event,
event->key.state |= GDK_CONTROL_MASK;
if (xevent->wParam != VK_MENU && GetKeyState (VK_MENU) < 0)
event->key.state |= GDK_MOD1_MASK;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
event->key.string = NULL;
event->key.length = 0;
break;
@@ -1643,27 +1642,27 @@ gdk_event_translate (GdkEvent *event,
* wants key presses but still wants releases to be propagated,
* for instance.
*/
- if (k_grab_window != NULL
- && !k_grab_owner_events)
+ if (k_grab_window != NULL && !k_grab_owner_events)
{
/* Keyboard is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS,
g_print ("...grabbed, owner_events FALSE, "
- "sending to %#x\n", k_grab_window->xwindow));
- event->key.window = (GdkWindow *) k_grab_window;
+ "sending to %#x\n",
+ GDK_DRAWABLE_XID (k_grab_window)));
+ event->key.window = k_grab_window;
}
else if (window_private
&& !(window_private->event_mask & (GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK)))
{
/* Owner window doesn't want it */
- if (k_grab_window != NULL
- && k_grab_owner_events)
+ if (k_grab_window != NULL && k_grab_owner_events)
{
/* Keyboard is grabbed with owner_events TRUE */
GDK_NOTE (EVENTS,
g_print ("...grabbed, owner_events TRUE, doesn't want it, "
- "sending to %#x\n", k_grab_window->xwindow));
- event->key.window = (GdkWindow *) k_grab_window;
+ "sending to %#x\n",
+ GDK_DRAWABLE_XID (k_grab_window)));
+ event->key.window = k_grab_window;
}
else
{
@@ -1678,12 +1677,12 @@ gdk_event_translate (GdkEvent *event,
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto wm_char;
}
}
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val && (window_private->event_mask & GDK_KEY_RELEASE_MASK))
{
/* Return the release event, and maybe append the press
@@ -1819,8 +1818,7 @@ gdk_event_translate (GdkEvent *event,
else
mask = 0; /* ??? */
- if (p_grab_window != NULL
- && !p_grab_owner_events)
+ if (p_grab_window != NULL && !p_grab_owner_events)
{
/* Pointer is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events FALSE\n"));
@@ -1829,16 +1827,15 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it */
break;
else
- event->button.window = (GdkWindow *) p_grab_window;
+ event->button.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else if (window_private
&& !(mask & GDK_BUTTON_PRESS_MASK))
{
/* Owner window doesn't want it */
- if (p_grab_window != NULL
- && p_grab_owner_events)
+ if (p_grab_window != NULL && p_grab_owner_events)
{
/* Pointer is grabbed wíth owner_events TRUE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events TRUE, doesn't want it\n"));
@@ -1847,9 +1844,9 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it either */
break;
else
- event->button.window = (GdkWindow *) p_grab_window;
+ event->button.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else
{
@@ -1861,15 +1858,15 @@ gdk_event_translate (GdkEvent *event,
break;
pt.x = LOWORD (xevent->lParam);
pt.y = HIWORD (xevent->lParam);
- ClientToScreen (window_private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
gdk_window_unref (window);
window = window_private->parent;
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
- ScreenToClient (window_private->xwindow, &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
xevent->lParam = MAKELPARAM (pt.x, pt.y);
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto buttondown; /* What did Dijkstra say? */
}
}
@@ -1946,17 +1943,17 @@ gdk_event_translate (GdkEvent *event,
button_number[1] = -1;
button_number[0] = event->button.button;
}
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val
&& p_grab_window != NULL
- && event->any.window == (GdkWindow *) p_grab_window
- && p_grab_window != window_private)
+ && event->any.window == p_grab_window
+ && p_grab_window != window)
{
/* Translate coordinates to grabber */
pt.x = event->button.x;
pt.y = event->button.y;
- ClientToScreen (window_private->xwindow, &pt);
- ScreenToClient (p_grab_window->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
event->button.x = pt.x;
event->button.y = pt.y;
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
@@ -1999,8 +1996,7 @@ gdk_event_translate (GdkEvent *event,
else
mask = 0;
- if (p_grab_window != NULL
- && !p_grab_owner_events)
+ if (p_grab_window != NULL && !p_grab_owner_events)
{
/* Pointer is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events FALSE\n"));
@@ -2009,16 +2005,15 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it */
break;
else
- event->button.window = (GdkWindow *) p_grab_window;
+ event->button.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else if (window_private
&& !(mask & GDK_BUTTON_RELEASE_MASK))
{
/* Owner window doesn't want it */
- if (p_grab_window != NULL
- && p_grab_owner_events)
+ if (p_grab_window != NULL && p_grab_owner_events)
{
/* Pointer is grabbed wíth owner_events TRUE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events TRUE, doesn't want it\n"));
@@ -2027,9 +2022,9 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it */
break;
else
- event->button.window = (GdkWindow *) p_grab_window;
+ event->button.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else
{
@@ -2040,15 +2035,15 @@ gdk_event_translate (GdkEvent *event,
break;
pt.x = LOWORD (xevent->lParam);
pt.y = HIWORD (xevent->lParam);
- ClientToScreen (window_private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
gdk_window_unref (window);
window = window_private->parent;
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
- ScreenToClient (window_private->xwindow, &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
xevent->lParam = MAKELPARAM (pt.x, pt.y);
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto buttonup;
}
}
@@ -2075,17 +2070,17 @@ gdk_event_translate (GdkEvent *event,
event->button.button = button;
event->button.source = GDK_SOURCE_MOUSE;
event->button.deviceid = GDK_CORE_POINTER;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val
&& p_grab_window != NULL
- && event->any.window == (GdkWindow *) p_grab_window
- && p_grab_window != window_private)
+ && event->any.window == p_grab_window
+ && p_grab_window != window)
{
/* Translate coordinates to grabber */
pt.x = event->button.x;
pt.y = event->button.y;
- ClientToScreen (window_private->xwindow, &pt);
- ScreenToClient (p_grab_window->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
event->button.x = pt.x;
event->button.y = pt.y;
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
@@ -2148,8 +2143,7 @@ gdk_event_translate (GdkEvent *event,
else
mask = 0;
- if (p_grab_window
- && !p_grab_owner_events)
+ if (p_grab_window && !p_grab_owner_events)
{
/* Pointer is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS,
@@ -2166,9 +2160,9 @@ gdk_event_translate (GdkEvent *event,
&& (mask & GDK_BUTTON3_MOTION_MASK))))
break;
else
- event->motion.window = (GdkWindow *) p_grab_window;
+ event->motion.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else if (window_private
&& !((mask & GDK_POINTER_MOTION_MASK)
@@ -2182,8 +2176,7 @@ gdk_event_translate (GdkEvent *event,
&& (mask & GDK_BUTTON3_MOTION_MASK))))
{
/* Owner window doesn't want it */
- if (p_grab_window != NULL
- && p_grab_owner_events)
+ if (p_grab_window != NULL && p_grab_owner_events)
{
/* Pointer is grabbed wíth owner_events TRUE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events TRUE, doesn't want it\n"));
@@ -2200,9 +2193,9 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it either */
break;
else
- event->motion.window = (GdkWindow *) p_grab_window;
+ event->motion.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else
{
@@ -2213,15 +2206,15 @@ gdk_event_translate (GdkEvent *event,
break;
pt.x = LOWORD (xevent->lParam);
pt.y = HIWORD (xevent->lParam);
- ClientToScreen (window_private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
gdk_window_unref (window);
window = window_private->parent;
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
- ScreenToClient (window_private->xwindow, &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
xevent->lParam = MAKELPARAM (pt.x, pt.y);
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto mousemotion;
}
}
@@ -2254,17 +2247,17 @@ gdk_event_translate (GdkEvent *event,
event->motion.source = GDK_SOURCE_MOUSE;
event->motion.deviceid = GDK_CORE_POINTER;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val
&& p_grab_window != NULL
- && event->any.window == (GdkWindow *) p_grab_window
- && p_grab_window != window_private)
+ && event->any.window == p_grab_window
+ && p_grab_window != window)
{
/* Translate coordinates to grabber */
pt.x = event->motion.x;
pt.y = event->motion.y;
- ClientToScreen (window_private->xwindow, &pt);
- ScreenToClient (p_grab_window->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
event->motion.x = pt.x;
event->motion.y = pt.y;
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
@@ -2319,7 +2312,7 @@ gdk_event_translate (GdkEvent *event,
event->focus_change.type = GDK_FOCUS_CHANGE;
event->focus_change.window = window;
event->focus_change.in = (xevent->message == WM_SETFOCUS);
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#if 0
case WM_ACTIVATE:
@@ -2335,9 +2328,9 @@ gdk_event_translate (GdkEvent *event,
GDK_NOTE (EVENTS, g_print ("WM_ERASEBKGND: %#x dc %#x\n",
xevent->hwnd, xevent->wParam));
- if (!window_private || window_private->destroyed)
+ if (!window_private || GDK_DRAWABLE_DESTROYED (window))
break;
- colormap_private = (GdkColormapPrivate *) window_private->colormap;
+ colormap_private = (GdkColormapPrivate *) window_private->drawable.colormap;
hdc = (HDC) xevent->wParam;
if (colormap_private
&& colormap_private->xcolormap->rc_palette)
@@ -2393,11 +2386,7 @@ gdk_event_translate (GdkEvent *event,
}
else if (window_private->bg_type == GDK_WIN32_BG_PIXMAP)
{
- GdkPixmapPrivate *pixmap_private;
- HDC bgdc;
- HGDIOBJ oldbitmap;
-
- pixmap_private = (GdkPixmapPrivate *) window_private->bg_pixmap;
+ pixmap_private = (GdkDrawablePrivate*) window_private->bg_pixmap;
GetClipBox (hdc, &rect);
if (pixmap_private->width <= 8
@@ -2493,7 +2482,7 @@ gdk_event_translate (GdkEvent *event,
event->expose.area.height = paintstruct.rcPaint.bottom - paintstruct.rcPaint.top;
event->expose.count = 0;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val)
{
GList *list = queued_events;
@@ -2523,7 +2512,7 @@ gdk_event_translate (GdkEvent *event,
SetCursor (p_grab_cursor);
}
else if (window_private
- && !window_private->destroyed
+ && !GDK_DRAWABLE_DESTROYED (window)
&& window_private->xcursor)
{
GDK_NOTE (EVENTS, g_print ("...SetCursor(%#x)\n",
@@ -2548,7 +2537,7 @@ gdk_event_translate (GdkEvent *event,
event->any.type = GDK_MAP;
event->any.window = window;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#endif
@@ -2566,14 +2555,14 @@ gdk_event_translate (GdkEvent *event,
event->any.window = window;
if (event->any.type == GDK_UNMAP
- && p_grab_window == window_private)
+ && p_grab_window == window)
gdk_pointer_ungrab (xevent->time);
if (event->any.type == GDK_UNMAP
- && k_grab_window == window_private)
+ && k_grab_window == window)
gdk_keyboard_ungrab (xevent->time);
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#endif
case WM_SIZE:
@@ -2597,20 +2586,20 @@ gdk_event_translate (GdkEvent *event,
event->any.type = GDK_UNMAP;
event->any.window = window;
- if (p_grab_window == window_private)
+ if (p_grab_window == window)
gdk_pointer_ungrab (xevent->time);
- if (k_grab_window == window_private)
+ if (k_grab_window == window)
gdk_keyboard_ungrab (xevent->time);
- return_val = !window_private->destroyed;
+ return_val = !GDK_DRAWABLE_DESTROYED (window);
#endif
}
else if (window_private != NULL
&& (xevent->wParam == SIZE_RESTORED
|| xevent->wParam == SIZE_MAXIMIZED)
#if 1
- && window_private->window_type != GDK_WINDOW_CHILD
+ && GDK_DRAWABLE_TYPE (window) != GDK_WINDOW_CHILD
#endif
)
{
@@ -2628,12 +2617,12 @@ gdk_event_translate (GdkEvent *event,
event->configure.height = HIWORD (xevent->lParam);
window_private->x = event->configure.x;
window_private->y = event->configure.y;
- window_private->width = event->configure.width;
- window_private->height = event->configure.height;
+ window_private->drawable.width = event->configure.width;
+ window_private->drawable.height = event->configure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
- return_val = !window_private->destroyed;
+ return_val = !GDK_DRAWABLE_DESTROYED (window);
if (return_val
&& window_private->extension_events != 0
&& gdk_input_vtable.configure_event)
@@ -2740,7 +2729,7 @@ gdk_event_translate (GdkEvent *event,
&& !(window_private->event_mask & GDK_STRUCTURE_MASK))
break;
if (window_private != NULL
- && window_private->window_type != GDK_WINDOW_CHILD)
+ && GDK_DRAWABLE_TYPE (window) != GDK_WINDOW_CHILD)
{
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
@@ -2751,10 +2740,10 @@ gdk_event_translate (GdkEvent *event,
event->configure.height = rect.bottom;
window_private->x = event->configure.x;
window_private->y = event->configure.y;
- window_private->width = event->configure.width;
- window_private->height = event->configure.height;
+ window_private->drawable.width = event->configure.width;
+ window_private->drawable.height = event->configure.height;
- return_val = !window_private->destroyed;
+ return_val = !GDK_DRAWABLE_DESTROYED (window);
}
break;
@@ -2763,7 +2752,7 @@ gdk_event_translate (GdkEvent *event,
event->any.type = GDK_DELETE;
event->any.window = window;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#if 0
@@ -2806,7 +2795,7 @@ gdk_event_translate (GdkEvent *event,
event->selection.property = gdk_selection_property;
event->selection.requestor = (guint32) xevent->hwnd;
event->selection.time = xevent->time;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
#else
/* Test code, to see if SetClipboardData works when called from
* the window procedure.
@@ -2836,13 +2825,13 @@ gdk_event_translate (GdkEvent *event,
curWnd = NULL;
}
- if (p_grab_window == window_private)
+ if (p_grab_window == window)
gdk_pointer_ungrab (xevent->time);
- if (k_grab_window == window_private)
+ if (k_grab_window == window)
gdk_keyboard_ungrab (xevent->time);
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#ifdef HAVE_WINTAB
diff --git a/gdk/win32/gdkevents.c b/gdk/win32/gdkevents.c
index fd2c6cf020..653e62ba79 100644
--- a/gdk/win32/gdkevents.c
+++ b/gdk/win32/gdkevents.c
@@ -114,13 +114,13 @@ static GdkWindow *button_window[2]; /* The last 2 windows to receive button
*/
static guint button_number[2]; /* The last 2 buttons to be pressed.
*/
-static GdkWindowPrivate *p_grab_window = NULL; /* Window that currently
- * holds the pointer grab
- */
+static GdkWindow *p_grab_window = NULL; /* Window that currently
+ * holds the pointer grab
+ */
-static GdkWindowPrivate *k_grab_window = NULL; /* Window the holds the
- * keyboard grab
- */
+static GdkWindow *k_grab_window = NULL; /* Window the holds the
+ * keyboard grab
+ */
static GList *client_filters; /* Filters for client messages */
@@ -772,26 +772,24 @@ gdk_pointer_grab (GdkWindow * window,
GdkCursor * cursor,
guint32 time)
{
- GdkWindowPrivate *window_private;
HWND xwindow;
HWND xconfine_to;
HCURSOR xcursor;
- GdkWindowPrivate *confine_to_private;
GdkCursorPrivate *cursor_private;
gint return_val;
g_return_val_if_fail (window != NULL, 0);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
+ g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0);
- window_private = (GdkWindowPrivate*) window;
- confine_to_private = (GdkWindowPrivate*) confine_to;
cursor_private = (GdkCursorPrivate*) cursor;
- xwindow = window_private->xwindow;
+ xwindow = GDK_DRAWABLE_XID (window);
- if (!confine_to || confine_to_private->destroyed)
+ if (!confine_to || GDK_DRAWABLE_DESTROYED (confine_to))
xconfine_to = NULL;
else
- xconfine_to = confine_to_private->xwindow;
+ xconfine_to = GDK_DRAWABLE_XID (confine_to);
if (!cursor)
xcursor = NULL;
@@ -809,7 +807,7 @@ gdk_pointer_grab (GdkWindow * window,
if (return_val == Success)
{
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
GDK_NOTE (EVENTS, g_print ("gdk_pointer_grab: %#x %s %#x\n",
xwindow,
@@ -832,7 +830,7 @@ gdk_pointer_grab (GdkWindow * window,
if (return_val == GrabSuccess)
{
- p_grab_window = window_private;
+ p_grab_window = window;
p_grab_cursor = xcursor;
}
@@ -914,17 +912,15 @@ gdk_keyboard_grab (GdkWindow * window,
gint owner_events,
guint32 time)
{
- GdkWindowPrivate *window_private;
gint return_val;
g_return_val_if_fail (window != NULL, 0);
-
- window_private = (GdkWindowPrivate*) window;
+ g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
GDK_NOTE (EVENTS, g_print ("gdk_keyboard_grab %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
k_grab_owner_events = owner_events != 0;
return_val = GrabSuccess;
@@ -933,7 +929,7 @@ gdk_keyboard_grab (GdkWindow * window,
return_val = AlreadyGrabbed;
if (return_val == GrabSuccess)
- k_grab_window = window_private;
+ k_grab_window = window;
return return_val;
}
@@ -1164,6 +1160,9 @@ gdk_event_translate (GdkEvent *event,
MINMAXINFO *lpmmi;
GdkWindowPrivate *curWnd_private;
GdkEventMask mask;
+ GdkDrawablePrivate *pixmap_private;
+ HDC bgdc;
+ HGDIOBJ oldbitmap;
int button;
int i, j;
gchar buf[256];
@@ -1221,7 +1220,7 @@ gdk_event_translate (GdkEvent *event,
event->any.window = window;
- if (window_private && window_private->destroyed)
+ if (window_private && GDK_DRAWABLE_DESTROYED (window))
{
}
else
@@ -1250,7 +1249,7 @@ gdk_event_translate (GdkEvent *event,
event->selection.property = gdk_selection_property;
event->selection.time = xevent->time;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
/* Will pass through switch below without match */
}
@@ -1267,7 +1266,7 @@ gdk_event_translate (GdkEvent *event,
event->selection.requestor = (guint32) xevent->hwnd;
event->selection.time = xevent->time;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
/* Again, will pass through switch below without match */
}
@@ -1281,7 +1280,7 @@ gdk_event_translate (GdkEvent *event,
event->selection.selection = xevent->wParam;
event->selection.time = xevent->time;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
/* Once again, we will pass through switch below without match */
}
@@ -1368,14 +1367,14 @@ gdk_event_translate (GdkEvent *event,
ignore_WM_CHAR = TRUE;
keyup_or_down:
- if (k_grab_window != NULL
- && !k_grab_owner_events)
+ if (k_grab_window != NULL && !k_grab_owner_events)
{
/* Keyboard is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS,
g_print ("...grabbed, owner_events FALSE, "
- "sending to %#x\n", k_grab_window->xwindow));
- event->key.window = (GdkWindow *) k_grab_window;
+ "sending to %#x\n",
+ GDK_DRAWABLE_XID (k_grab_window)));
+ event->key.window = k_grab_window;
}
else if (window_private
&& (((xevent->message == WM_KEYUP
@@ -1386,14 +1385,14 @@ gdk_event_translate (GdkEvent *event,
&& !(window_private->event_mask & GDK_KEY_PRESS_MASK))))
{
/* Owner window doesn't want it */
- if (k_grab_window != NULL
- && k_grab_owner_events)
+ if (k_grab_window != NULL && k_grab_owner_events)
{
/* Keyboard is grabbed with owner_events TRUE */
GDK_NOTE (EVENTS,
g_print ("...grabbed, owner_events TRUE, doesn't want it, "
- "sending to %#x\n", k_grab_window->xwindow));
- event->key.window = (GdkWindow *) k_grab_window;
+ "sending to %#x\n",
+ GDK_DRAWABLE_XID (k_grab_window)));
+ event->key.window = k_grab_window;
}
else
{
@@ -1407,7 +1406,7 @@ gdk_event_translate (GdkEvent *event,
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto keyup_or_down;
}
}
@@ -1619,7 +1618,7 @@ gdk_event_translate (GdkEvent *event,
event->key.state |= GDK_CONTROL_MASK;
if (xevent->wParam != VK_MENU && GetKeyState (VK_MENU) < 0)
event->key.state |= GDK_MOD1_MASK;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
event->key.string = NULL;
event->key.length = 0;
break;
@@ -1643,27 +1642,27 @@ gdk_event_translate (GdkEvent *event,
* wants key presses but still wants releases to be propagated,
* for instance.
*/
- if (k_grab_window != NULL
- && !k_grab_owner_events)
+ if (k_grab_window != NULL && !k_grab_owner_events)
{
/* Keyboard is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS,
g_print ("...grabbed, owner_events FALSE, "
- "sending to %#x\n", k_grab_window->xwindow));
- event->key.window = (GdkWindow *) k_grab_window;
+ "sending to %#x\n",
+ GDK_DRAWABLE_XID (k_grab_window)));
+ event->key.window = k_grab_window;
}
else if (window_private
&& !(window_private->event_mask & (GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK)))
{
/* Owner window doesn't want it */
- if (k_grab_window != NULL
- && k_grab_owner_events)
+ if (k_grab_window != NULL && k_grab_owner_events)
{
/* Keyboard is grabbed with owner_events TRUE */
GDK_NOTE (EVENTS,
g_print ("...grabbed, owner_events TRUE, doesn't want it, "
- "sending to %#x\n", k_grab_window->xwindow));
- event->key.window = (GdkWindow *) k_grab_window;
+ "sending to %#x\n",
+ GDK_DRAWABLE_XID (k_grab_window)));
+ event->key.window = k_grab_window;
}
else
{
@@ -1678,12 +1677,12 @@ gdk_event_translate (GdkEvent *event,
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto wm_char;
}
}
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val && (window_private->event_mask & GDK_KEY_RELEASE_MASK))
{
/* Return the release event, and maybe append the press
@@ -1819,8 +1818,7 @@ gdk_event_translate (GdkEvent *event,
else
mask = 0; /* ??? */
- if (p_grab_window != NULL
- && !p_grab_owner_events)
+ if (p_grab_window != NULL && !p_grab_owner_events)
{
/* Pointer is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events FALSE\n"));
@@ -1829,16 +1827,15 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it */
break;
else
- event->button.window = (GdkWindow *) p_grab_window;
+ event->button.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else if (window_private
&& !(mask & GDK_BUTTON_PRESS_MASK))
{
/* Owner window doesn't want it */
- if (p_grab_window != NULL
- && p_grab_owner_events)
+ if (p_grab_window != NULL && p_grab_owner_events)
{
/* Pointer is grabbed wíth owner_events TRUE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events TRUE, doesn't want it\n"));
@@ -1847,9 +1844,9 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it either */
break;
else
- event->button.window = (GdkWindow *) p_grab_window;
+ event->button.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else
{
@@ -1861,15 +1858,15 @@ gdk_event_translate (GdkEvent *event,
break;
pt.x = LOWORD (xevent->lParam);
pt.y = HIWORD (xevent->lParam);
- ClientToScreen (window_private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
gdk_window_unref (window);
window = window_private->parent;
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
- ScreenToClient (window_private->xwindow, &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
xevent->lParam = MAKELPARAM (pt.x, pt.y);
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto buttondown; /* What did Dijkstra say? */
}
}
@@ -1946,17 +1943,17 @@ gdk_event_translate (GdkEvent *event,
button_number[1] = -1;
button_number[0] = event->button.button;
}
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val
&& p_grab_window != NULL
- && event->any.window == (GdkWindow *) p_grab_window
- && p_grab_window != window_private)
+ && event->any.window == p_grab_window
+ && p_grab_window != window)
{
/* Translate coordinates to grabber */
pt.x = event->button.x;
pt.y = event->button.y;
- ClientToScreen (window_private->xwindow, &pt);
- ScreenToClient (p_grab_window->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
event->button.x = pt.x;
event->button.y = pt.y;
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
@@ -1999,8 +1996,7 @@ gdk_event_translate (GdkEvent *event,
else
mask = 0;
- if (p_grab_window != NULL
- && !p_grab_owner_events)
+ if (p_grab_window != NULL && !p_grab_owner_events)
{
/* Pointer is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events FALSE\n"));
@@ -2009,16 +2005,15 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it */
break;
else
- event->button.window = (GdkWindow *) p_grab_window;
+ event->button.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else if (window_private
&& !(mask & GDK_BUTTON_RELEASE_MASK))
{
/* Owner window doesn't want it */
- if (p_grab_window != NULL
- && p_grab_owner_events)
+ if (p_grab_window != NULL && p_grab_owner_events)
{
/* Pointer is grabbed wíth owner_events TRUE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events TRUE, doesn't want it\n"));
@@ -2027,9 +2022,9 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it */
break;
else
- event->button.window = (GdkWindow *) p_grab_window;
+ event->button.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else
{
@@ -2040,15 +2035,15 @@ gdk_event_translate (GdkEvent *event,
break;
pt.x = LOWORD (xevent->lParam);
pt.y = HIWORD (xevent->lParam);
- ClientToScreen (window_private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
gdk_window_unref (window);
window = window_private->parent;
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
- ScreenToClient (window_private->xwindow, &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
xevent->lParam = MAKELPARAM (pt.x, pt.y);
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto buttonup;
}
}
@@ -2075,17 +2070,17 @@ gdk_event_translate (GdkEvent *event,
event->button.button = button;
event->button.source = GDK_SOURCE_MOUSE;
event->button.deviceid = GDK_CORE_POINTER;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val
&& p_grab_window != NULL
- && event->any.window == (GdkWindow *) p_grab_window
- && p_grab_window != window_private)
+ && event->any.window == p_grab_window
+ && p_grab_window != window)
{
/* Translate coordinates to grabber */
pt.x = event->button.x;
pt.y = event->button.y;
- ClientToScreen (window_private->xwindow, &pt);
- ScreenToClient (p_grab_window->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
event->button.x = pt.x;
event->button.y = pt.y;
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
@@ -2148,8 +2143,7 @@ gdk_event_translate (GdkEvent *event,
else
mask = 0;
- if (p_grab_window
- && !p_grab_owner_events)
+ if (p_grab_window && !p_grab_owner_events)
{
/* Pointer is grabbed with owner_events FALSE */
GDK_NOTE (EVENTS,
@@ -2166,9 +2160,9 @@ gdk_event_translate (GdkEvent *event,
&& (mask & GDK_BUTTON3_MOTION_MASK))))
break;
else
- event->motion.window = (GdkWindow *) p_grab_window;
+ event->motion.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else if (window_private
&& !((mask & GDK_POINTER_MOTION_MASK)
@@ -2182,8 +2176,7 @@ gdk_event_translate (GdkEvent *event,
&& (mask & GDK_BUTTON3_MOTION_MASK))))
{
/* Owner window doesn't want it */
- if (p_grab_window != NULL
- && p_grab_owner_events)
+ if (p_grab_window != NULL && p_grab_owner_events)
{
/* Pointer is grabbed wíth owner_events TRUE */
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events TRUE, doesn't want it\n"));
@@ -2200,9 +2193,9 @@ gdk_event_translate (GdkEvent *event,
/* Grabber doesn't want it either */
break;
else
- event->motion.window = (GdkWindow *) p_grab_window;
+ event->motion.window = p_grab_window;
GDK_NOTE (EVENTS, g_print ("...sending to %#x\n",
- p_grab_window->xwindow));
+ GDK_DRAWABLE_XID (p_grab_window)));
}
else
{
@@ -2213,15 +2206,15 @@ gdk_event_translate (GdkEvent *event,
break;
pt.x = LOWORD (xevent->lParam);
pt.y = HIWORD (xevent->lParam);
- ClientToScreen (window_private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
gdk_window_unref (window);
window = window_private->parent;
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
- ScreenToClient (window_private->xwindow, &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
xevent->lParam = MAKELPARAM (pt.x, pt.y);
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
- window_private->xwindow));
+ GDK_DRAWABLE_XID (window)));
goto mousemotion;
}
}
@@ -2254,17 +2247,17 @@ gdk_event_translate (GdkEvent *event,
event->motion.source = GDK_SOURCE_MOUSE;
event->motion.deviceid = GDK_CORE_POINTER;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val
&& p_grab_window != NULL
- && event->any.window == (GdkWindow *) p_grab_window
- && p_grab_window != window_private)
+ && event->any.window == p_grab_window
+ && p_grab_window != window)
{
/* Translate coordinates to grabber */
pt.x = event->motion.x;
pt.y = event->motion.y;
- ClientToScreen (window_private->xwindow, &pt);
- ScreenToClient (p_grab_window->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
event->motion.x = pt.x;
event->motion.y = pt.y;
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
@@ -2319,7 +2312,7 @@ gdk_event_translate (GdkEvent *event,
event->focus_change.type = GDK_FOCUS_CHANGE;
event->focus_change.window = window;
event->focus_change.in = (xevent->message == WM_SETFOCUS);
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#if 0
case WM_ACTIVATE:
@@ -2335,9 +2328,9 @@ gdk_event_translate (GdkEvent *event,
GDK_NOTE (EVENTS, g_print ("WM_ERASEBKGND: %#x dc %#x\n",
xevent->hwnd, xevent->wParam));
- if (!window_private || window_private->destroyed)
+ if (!window_private || GDK_DRAWABLE_DESTROYED (window))
break;
- colormap_private = (GdkColormapPrivate *) window_private->colormap;
+ colormap_private = (GdkColormapPrivate *) window_private->drawable.colormap;
hdc = (HDC) xevent->wParam;
if (colormap_private
&& colormap_private->xcolormap->rc_palette)
@@ -2393,11 +2386,7 @@ gdk_event_translate (GdkEvent *event,
}
else if (window_private->bg_type == GDK_WIN32_BG_PIXMAP)
{
- GdkPixmapPrivate *pixmap_private;
- HDC bgdc;
- HGDIOBJ oldbitmap;
-
- pixmap_private = (GdkPixmapPrivate *) window_private->bg_pixmap;
+ pixmap_private = (GdkDrawablePrivate*) window_private->bg_pixmap;
GetClipBox (hdc, &rect);
if (pixmap_private->width <= 8
@@ -2493,7 +2482,7 @@ gdk_event_translate (GdkEvent *event,
event->expose.area.height = paintstruct.rcPaint.bottom - paintstruct.rcPaint.top;
event->expose.count = 0;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
if (return_val)
{
GList *list = queued_events;
@@ -2523,7 +2512,7 @@ gdk_event_translate (GdkEvent *event,
SetCursor (p_grab_cursor);
}
else if (window_private
- && !window_private->destroyed
+ && !GDK_DRAWABLE_DESTROYED (window)
&& window_private->xcursor)
{
GDK_NOTE (EVENTS, g_print ("...SetCursor(%#x)\n",
@@ -2548,7 +2537,7 @@ gdk_event_translate (GdkEvent *event,
event->any.type = GDK_MAP;
event->any.window = window;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#endif
@@ -2566,14 +2555,14 @@ gdk_event_translate (GdkEvent *event,
event->any.window = window;
if (event->any.type == GDK_UNMAP
- && p_grab_window == window_private)
+ && p_grab_window == window)
gdk_pointer_ungrab (xevent->time);
if (event->any.type == GDK_UNMAP
- && k_grab_window == window_private)
+ && k_grab_window == window)
gdk_keyboard_ungrab (xevent->time);
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#endif
case WM_SIZE:
@@ -2597,20 +2586,20 @@ gdk_event_translate (GdkEvent *event,
event->any.type = GDK_UNMAP;
event->any.window = window;
- if (p_grab_window == window_private)
+ if (p_grab_window == window)
gdk_pointer_ungrab (xevent->time);
- if (k_grab_window == window_private)
+ if (k_grab_window == window)
gdk_keyboard_ungrab (xevent->time);
- return_val = !window_private->destroyed;
+ return_val = !GDK_DRAWABLE_DESTROYED (window);
#endif
}
else if (window_private != NULL
&& (xevent->wParam == SIZE_RESTORED
|| xevent->wParam == SIZE_MAXIMIZED)
#if 1
- && window_private->window_type != GDK_WINDOW_CHILD
+ && GDK_DRAWABLE_TYPE (window) != GDK_WINDOW_CHILD
#endif
)
{
@@ -2628,12 +2617,12 @@ gdk_event_translate (GdkEvent *event,
event->configure.height = HIWORD (xevent->lParam);
window_private->x = event->configure.x;
window_private->y = event->configure.y;
- window_private->width = event->configure.width;
- window_private->height = event->configure.height;
+ window_private->drawable.width = event->configure.width;
+ window_private->drawable.height = event->configure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
- return_val = !window_private->destroyed;
+ return_val = !GDK_DRAWABLE_DESTROYED (window);
if (return_val
&& window_private->extension_events != 0
&& gdk_input_vtable.configure_event)
@@ -2740,7 +2729,7 @@ gdk_event_translate (GdkEvent *event,
&& !(window_private->event_mask & GDK_STRUCTURE_MASK))
break;
if (window_private != NULL
- && window_private->window_type != GDK_WINDOW_CHILD)
+ && GDK_DRAWABLE_TYPE (window) != GDK_WINDOW_CHILD)
{
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
@@ -2751,10 +2740,10 @@ gdk_event_translate (GdkEvent *event,
event->configure.height = rect.bottom;
window_private->x = event->configure.x;
window_private->y = event->configure.y;
- window_private->width = event->configure.width;
- window_private->height = event->configure.height;
+ window_private->drawable.width = event->configure.width;
+ window_private->drawable.height = event->configure.height;
- return_val = !window_private->destroyed;
+ return_val = !GDK_DRAWABLE_DESTROYED (window);
}
break;
@@ -2763,7 +2752,7 @@ gdk_event_translate (GdkEvent *event,
event->any.type = GDK_DELETE;
event->any.window = window;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#if 0
@@ -2806,7 +2795,7 @@ gdk_event_translate (GdkEvent *event,
event->selection.property = gdk_selection_property;
event->selection.requestor = (guint32) xevent->hwnd;
event->selection.time = xevent->time;
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
#else
/* Test code, to see if SetClipboardData works when called from
* the window procedure.
@@ -2836,13 +2825,13 @@ gdk_event_translate (GdkEvent *event,
curWnd = NULL;
}
- if (p_grab_window == window_private)
+ if (p_grab_window == window)
gdk_pointer_ungrab (xevent->time);
- if (k_grab_window == window_private)
+ if (k_grab_window == window)
gdk_keyboard_ungrab (xevent->time);
- return_val = window_private && !window_private->destroyed;
+ return_val = window_private && !GDK_DRAWABLE_DESTROYED (window);
break;
#ifdef HAVE_WINTAB
diff --git a/gdk/win32/gdkgc-win32.c b/gdk/win32/gdkgc-win32.c
index 9971501f0e..e1cbf8552b 100644
--- a/gdk/win32/gdkgc-win32.c
+++ b/gdk/win32/gdkgc-win32.c
@@ -25,11 +25,13 @@
*/
#include "config.h"
+
#include <string.h>
#include "gdkgc.h"
#include "gdkpixmap.h"
#include "gdkprivate.h"
+#include "gdkx.h"
GdkGC*
gdk_gc_new (GdkWindow *window)
@@ -42,7 +44,6 @@ gdk_gc_new_with_values (GdkWindow *window,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
- GdkWindowPrivate *window_private;
GdkGC *gc;
GdkGCPrivate *private;
static GdkColor black;
@@ -58,8 +59,7 @@ gdk_gc_new_with_values (GdkWindow *window,
g_return_val_if_fail (window != NULL, NULL);
- window_private = (GdkWindowPrivate*) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
private = g_new (GdkGCPrivate, 1);
@@ -141,7 +141,7 @@ gdk_gc_new_with_values (GdkWindow *window,
{
private->tile = values->tile;
gdk_pixmap_ref (private->tile);
- GDK_NOTE (MISC, g_print (" tile=%#x", ((GdkPixmapPrivate *)private->tile)->xwindow));
+ GDK_NOTE (MISC, g_print (" tile=%#x", GDK_DRAWABLE_XID (private->tile)));
}
else
private->tile = NULL;
@@ -150,7 +150,7 @@ gdk_gc_new_with_values (GdkWindow *window,
{
private->stipple = values->stipple;
gdk_pixmap_ref (private->stipple);
- GDK_NOTE (MISC, g_print (" stipple=%#x", ((GdkPixmapPrivate *)private->stipple)->xwindow));
+ GDK_NOTE (MISC, g_print (" stipple=%#x", GDK_DRAWABLE_XID (private->stipple)));
}
else
private->stipple = NULL;
@@ -158,7 +158,7 @@ gdk_gc_new_with_values (GdkWindow *window,
if (values_mask & GDK_GC_CLIP_MASK)
{
private->clip_region =
- BitmapToRegion (((GdkPixmapPrivate *)values->clip_mask)->xwindow);
+ BitmapToRegion ((HBITMAP) GDK_DRAWABLE_XID (values->clip_mask));
GDK_NOTE (MISC, g_print (" clip=%#x", private->clip_region));
}
else
@@ -388,7 +388,7 @@ gdk_gc_get_values (GdkGC *gc,
if ((hdc = CreateCompatibleDC (NULL)) == NULL)
g_warning ("gdk_gc_get_values: CreateCompatibleDC failed");
if ((oldbitmap =
- SelectObject (hdc, ((GdkPixmapPrivate *) pixmap)->xwindow)) == NULL)
+ SelectObject (hdc, GDK_DRAWABLE_XID (pixmap))) == NULL)
g_warning ("gdk_gc_get_values: SelectObject #1 failed");
hbr = GetStockObject (BLACK_BRUSH);
if (!FillRect (hdc, &rect, hbr))
@@ -560,7 +560,6 @@ gdk_gc_set_tile (GdkGC *gc,
GdkPixmap *tile)
{
GdkGCPrivate *private;
- GdkPixmapPrivate *pixmap_private;
HBITMAP pixmap;
g_return_if_fail (gc != NULL);
@@ -570,10 +569,7 @@ gdk_gc_set_tile (GdkGC *gc,
pixmap = NULL;
if (tile)
- {
- pixmap_private = (GdkPixmapPrivate*) tile;
- pixmap = pixmap_private->xwindow;
- }
+ pixmap = GDK_DRAWABLE_XID (tile);
if (private->tile != NULL)
gdk_pixmap_unref (private->tile);
@@ -591,7 +587,6 @@ gdk_gc_set_stipple (GdkGC *gc,
GdkPixmap *stipple)
{
GdkGCPrivate *private;
- GdkPixmapPrivate *pixmap_private;
HBITMAP pixmap;
g_return_if_fail (gc != NULL);
@@ -601,10 +596,7 @@ gdk_gc_set_stipple (GdkGC *gc,
pixmap = NULL;
if (stipple)
- {
- pixmap_private = (GdkPixmapPrivate*) stipple;
- pixmap = pixmap_private->xwindow;
- }
+ pixmap = GDK_DRAWABLE_XID (stipple);
if (private->stipple != NULL)
gdk_pixmap_unref (private->stipple);
@@ -663,12 +655,9 @@ gdk_gc_set_clip_mask (GdkGC *gc,
if (mask)
{
- GdkWindowPrivate *mask_private;
-
- mask_private = (GdkWindowPrivate*) mask;
- if (mask_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (mask))
return;
- xmask = mask_private->xwindow;
+ xmask = GDK_DRAWABLE_XID (mask);
}
else
xmask = NULL;
@@ -910,11 +899,11 @@ gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
}
HDC
-gdk_gc_predraw (GdkWindowPrivate *window_private,
- GdkGCPrivate *gc_private)
+gdk_gc_predraw (GdkDrawablePrivate *drawable_private,
+ GdkGCPrivate *gc_private)
{
GdkColormapPrivate *colormap_private =
- (GdkColormapPrivate *) window_private->colormap;
+ (GdkColormapPrivate *) drawable_private->colormap;
COLORREF bg;
COLORREF fg;
LOGBRUSH logbrush;
@@ -923,7 +912,7 @@ gdk_gc_predraw (GdkWindowPrivate *window_private,
g_assert (gc_private->xgc == NULL);
- if (window_private->window_type == GDK_WINDOW_PIXMAP)
+ if (drawable_private->window_type == GDK_DRAWABLE_PIXMAP)
{
if ((gc_private->xgc = CreateCompatibleDC (NULL)) == NULL)
g_warning ("gdk_gc_predraw: CreateCompatibleDC failed");
@@ -931,19 +920,19 @@ gdk_gc_predraw (GdkWindowPrivate *window_private,
if ((gc_private->saved_dc = SaveDC (gc_private->xgc)) == 0)
g_warning ("gdk_gc_predraw: SaveDC #1 failed");
- if (SelectObject (gc_private->xgc, window_private->xwindow) == NULL)
+ if (SelectObject (gc_private->xgc, drawable_private->xwindow) == NULL)
g_warning ("gdk_gc_predraw: SelectObject #1 failed");
}
else
{
- if ((gc_private->xgc = GetDC (window_private->xwindow)) == NULL)
+ if ((gc_private->xgc = GetDC (drawable_private->xwindow)) == NULL)
g_warning ("gdk_gc_predraw: GetDC failed");
if ((gc_private->saved_dc = SaveDC (gc_private->xgc)) == 0)
g_warning ("gdk_gc_predraw: SaveDC #2 failed");
}
- gc_private->hwnd = window_private->xwindow;
+ gc_private->hwnd = drawable_private->xwindow;
if (colormap_private == NULL)
{
@@ -1097,13 +1086,13 @@ gdk_gc_predraw (GdkWindowPrivate *window_private,
}
void
-gdk_gc_postdraw (GdkWindowPrivate *window_private,
- GdkGCPrivate *gc_private)
+gdk_gc_postdraw (GdkDrawablePrivate *drawable_private,
+ GdkGCPrivate *gc_private)
{
HGDIOBJ hpen;
HGDIOBJ hbr;
GdkColormapPrivate *colormap_private =
- (GdkColormapPrivate *) window_private->colormap;
+ (GdkColormapPrivate *) drawable_private->colormap;
if ((hpen = GetCurrentObject (gc_private->xgc, OBJ_PEN)) == NULL)
g_warning ("gdk_gc_postdraw: GetCurrentObject #1 failed");
@@ -1123,7 +1112,7 @@ gdk_gc_postdraw (GdkWindowPrivate *window_private,
g_warning ("gdk_gc_postraw: UnrealizeObject failed");
}
#endif
- if (window_private->window_type == GDK_WINDOW_PIXMAP)
+ if (drawable_private->window_type == GDK_DRAWABLE_PIXMAP)
{
if (!DeleteDC (gc_private->xgc))
g_warning ("gdk_gc_postdraw: DeleteDC failed");
diff --git a/gdk/win32/gdkgc.c b/gdk/win32/gdkgc.c
index 9971501f0e..e1cbf8552b 100644
--- a/gdk/win32/gdkgc.c
+++ b/gdk/win32/gdkgc.c
@@ -25,11 +25,13 @@
*/
#include "config.h"
+
#include <string.h>
#include "gdkgc.h"
#include "gdkpixmap.h"
#include "gdkprivate.h"
+#include "gdkx.h"
GdkGC*
gdk_gc_new (GdkWindow *window)
@@ -42,7 +44,6 @@ gdk_gc_new_with_values (GdkWindow *window,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
- GdkWindowPrivate *window_private;
GdkGC *gc;
GdkGCPrivate *private;
static GdkColor black;
@@ -58,8 +59,7 @@ gdk_gc_new_with_values (GdkWindow *window,
g_return_val_if_fail (window != NULL, NULL);
- window_private = (GdkWindowPrivate*) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
private = g_new (GdkGCPrivate, 1);
@@ -141,7 +141,7 @@ gdk_gc_new_with_values (GdkWindow *window,
{
private->tile = values->tile;
gdk_pixmap_ref (private->tile);
- GDK_NOTE (MISC, g_print (" tile=%#x", ((GdkPixmapPrivate *)private->tile)->xwindow));
+ GDK_NOTE (MISC, g_print (" tile=%#x", GDK_DRAWABLE_XID (private->tile)));
}
else
private->tile = NULL;
@@ -150,7 +150,7 @@ gdk_gc_new_with_values (GdkWindow *window,
{
private->stipple = values->stipple;
gdk_pixmap_ref (private->stipple);
- GDK_NOTE (MISC, g_print (" stipple=%#x", ((GdkPixmapPrivate *)private->stipple)->xwindow));
+ GDK_NOTE (MISC, g_print (" stipple=%#x", GDK_DRAWABLE_XID (private->stipple)));
}
else
private->stipple = NULL;
@@ -158,7 +158,7 @@ gdk_gc_new_with_values (GdkWindow *window,
if (values_mask & GDK_GC_CLIP_MASK)
{
private->clip_region =
- BitmapToRegion (((GdkPixmapPrivate *)values->clip_mask)->xwindow);
+ BitmapToRegion ((HBITMAP) GDK_DRAWABLE_XID (values->clip_mask));
GDK_NOTE (MISC, g_print (" clip=%#x", private->clip_region));
}
else
@@ -388,7 +388,7 @@ gdk_gc_get_values (GdkGC *gc,
if ((hdc = CreateCompatibleDC (NULL)) == NULL)
g_warning ("gdk_gc_get_values: CreateCompatibleDC failed");
if ((oldbitmap =
- SelectObject (hdc, ((GdkPixmapPrivate *) pixmap)->xwindow)) == NULL)
+ SelectObject (hdc, GDK_DRAWABLE_XID (pixmap))) == NULL)
g_warning ("gdk_gc_get_values: SelectObject #1 failed");
hbr = GetStockObject (BLACK_BRUSH);
if (!FillRect (hdc, &rect, hbr))
@@ -560,7 +560,6 @@ gdk_gc_set_tile (GdkGC *gc,
GdkPixmap *tile)
{
GdkGCPrivate *private;
- GdkPixmapPrivate *pixmap_private;
HBITMAP pixmap;
g_return_if_fail (gc != NULL);
@@ -570,10 +569,7 @@ gdk_gc_set_tile (GdkGC *gc,
pixmap = NULL;
if (tile)
- {
- pixmap_private = (GdkPixmapPrivate*) tile;
- pixmap = pixmap_private->xwindow;
- }
+ pixmap = GDK_DRAWABLE_XID (tile);
if (private->tile != NULL)
gdk_pixmap_unref (private->tile);
@@ -591,7 +587,6 @@ gdk_gc_set_stipple (GdkGC *gc,
GdkPixmap *stipple)
{
GdkGCPrivate *private;
- GdkPixmapPrivate *pixmap_private;
HBITMAP pixmap;
g_return_if_fail (gc != NULL);
@@ -601,10 +596,7 @@ gdk_gc_set_stipple (GdkGC *gc,
pixmap = NULL;
if (stipple)
- {
- pixmap_private = (GdkPixmapPrivate*) stipple;
- pixmap = pixmap_private->xwindow;
- }
+ pixmap = GDK_DRAWABLE_XID (stipple);
if (private->stipple != NULL)
gdk_pixmap_unref (private->stipple);
@@ -663,12 +655,9 @@ gdk_gc_set_clip_mask (GdkGC *gc,
if (mask)
{
- GdkWindowPrivate *mask_private;
-
- mask_private = (GdkWindowPrivate*) mask;
- if (mask_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (mask))
return;
- xmask = mask_private->xwindow;
+ xmask = GDK_DRAWABLE_XID (mask);
}
else
xmask = NULL;
@@ -910,11 +899,11 @@ gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
}
HDC
-gdk_gc_predraw (GdkWindowPrivate *window_private,
- GdkGCPrivate *gc_private)
+gdk_gc_predraw (GdkDrawablePrivate *drawable_private,
+ GdkGCPrivate *gc_private)
{
GdkColormapPrivate *colormap_private =
- (GdkColormapPrivate *) window_private->colormap;
+ (GdkColormapPrivate *) drawable_private->colormap;
COLORREF bg;
COLORREF fg;
LOGBRUSH logbrush;
@@ -923,7 +912,7 @@ gdk_gc_predraw (GdkWindowPrivate *window_private,
g_assert (gc_private->xgc == NULL);
- if (window_private->window_type == GDK_WINDOW_PIXMAP)
+ if (drawable_private->window_type == GDK_DRAWABLE_PIXMAP)
{
if ((gc_private->xgc = CreateCompatibleDC (NULL)) == NULL)
g_warning ("gdk_gc_predraw: CreateCompatibleDC failed");
@@ -931,19 +920,19 @@ gdk_gc_predraw (GdkWindowPrivate *window_private,
if ((gc_private->saved_dc = SaveDC (gc_private->xgc)) == 0)
g_warning ("gdk_gc_predraw: SaveDC #1 failed");
- if (SelectObject (gc_private->xgc, window_private->xwindow) == NULL)
+ if (SelectObject (gc_private->xgc, drawable_private->xwindow) == NULL)
g_warning ("gdk_gc_predraw: SelectObject #1 failed");
}
else
{
- if ((gc_private->xgc = GetDC (window_private->xwindow)) == NULL)
+ if ((gc_private->xgc = GetDC (drawable_private->xwindow)) == NULL)
g_warning ("gdk_gc_predraw: GetDC failed");
if ((gc_private->saved_dc = SaveDC (gc_private->xgc)) == 0)
g_warning ("gdk_gc_predraw: SaveDC #2 failed");
}
- gc_private->hwnd = window_private->xwindow;
+ gc_private->hwnd = drawable_private->xwindow;
if (colormap_private == NULL)
{
@@ -1097,13 +1086,13 @@ gdk_gc_predraw (GdkWindowPrivate *window_private,
}
void
-gdk_gc_postdraw (GdkWindowPrivate *window_private,
- GdkGCPrivate *gc_private)
+gdk_gc_postdraw (GdkDrawablePrivate *drawable_private,
+ GdkGCPrivate *gc_private)
{
HGDIOBJ hpen;
HGDIOBJ hbr;
GdkColormapPrivate *colormap_private =
- (GdkColormapPrivate *) window_private->colormap;
+ (GdkColormapPrivate *) drawable_private->colormap;
if ((hpen = GetCurrentObject (gc_private->xgc, OBJ_PEN)) == NULL)
g_warning ("gdk_gc_postdraw: GetCurrentObject #1 failed");
@@ -1123,7 +1112,7 @@ gdk_gc_postdraw (GdkWindowPrivate *window_private,
g_warning ("gdk_gc_postraw: UnrealizeObject failed");
}
#endif
- if (window_private->window_type == GDK_WINDOW_PIXMAP)
+ if (drawable_private->window_type == GDK_DRAWABLE_PIXMAP)
{
if (!DeleteDC (gc_private->xgc))
g_warning ("gdk_gc_postdraw: DeleteDC failed");
diff --git a/gdk/win32/gdkimage-win32.c b/gdk/win32/gdkimage-win32.c
index 3e9d28dd69..0f2825e405 100644
--- a/gdk/win32/gdkimage-win32.c
+++ b/gdk/win32/gdkimage-win32.c
@@ -29,6 +29,7 @@
#include "gdk.h" /* For gdk_error_trap_* / gdk_flush_* */
#include "gdkimage.h"
#include "gdkprivate.h"
+#include "gdkx.h"
static void gdk_image_put_normal (GdkDrawable *drawable,
GdkGC *gc,
@@ -300,7 +301,6 @@ gdk_image_get (GdkWindow *window,
{
GdkImage *image;
GdkImagePrivate *private;
- GdkWindowPrivate *win_private;
HDC hdc, memdc;
struct {
BITMAPINFOHEADER bmiHeader;
@@ -317,12 +317,11 @@ gdk_image_get (GdkWindow *window,
g_return_val_if_fail (window != NULL, NULL);
- win_private = (GdkWindowPrivate *) window;
- if (win_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
GDK_NOTE (MISC, g_print ("gdk_image_get: %#x %dx%d@+%d+%d\n",
- win_private->xwindow, width, height, x, y));
+ GDK_DRAWABLE_XID (window), width, height, x, y));
private = g_new (GdkImagePrivate, 1);
image = (GdkImage*) private;
@@ -337,7 +336,7 @@ gdk_image_get (GdkWindow *window,
/* This function is called both to blit from a window and from
* a pixmap.
*/
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
if ((hdc = CreateCompatibleDC (NULL)) == NULL)
{
@@ -345,14 +344,14 @@ gdk_image_get (GdkWindow *window,
g_free (image);
return NULL;
}
- if ((oldbitmap1 = SelectObject (hdc, win_private->xwindow)) == NULL)
+ if ((oldbitmap1 = SelectObject (hdc, GDK_DRAWABLE_XID (window))) == NULL)
{
g_warning ("gdk_image_get: SelectObject #1 failed");
DeleteDC (hdc);
g_free (image);
return NULL;
}
- GetObject (win_private->xwindow, sizeof (BITMAP), &bm);
+ GetObject (GDK_DRAWABLE_XID (window), sizeof (BITMAP), &bm);
GDK_NOTE (MISC,
g_print ("gdk_image_get: bmWidth = %d, bmHeight = %d, bmWidthBytes = %d, bmBitsPixel = %d\n",
bm.bmWidth, bm.bmHeight, bm.bmWidthBytes, bm.bmBitsPixel));
@@ -368,7 +367,7 @@ gdk_image_get (GdkWindow *window,
}
else
{
- if ((hdc = GetDC (win_private->xwindow)) == NULL)
+ if ((hdc = GetDC (GDK_DRAWABLE_XID (window))) == NULL)
{
g_warning ("gdk_image_get: GetDC failed");
g_free (image);
@@ -388,14 +387,14 @@ gdk_image_get (GdkWindow *window,
if ((memdc = CreateCompatibleDC (hdc)) == NULL)
{
g_warning ("gdk_image_get: CreateCompatibleDC #2 failed");
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
g_free (image);
return NULL;
@@ -437,14 +436,14 @@ gdk_image_get (GdkWindow *window,
{
g_warning ("gdk_image_get: CreateDIBSection failed");
DeleteDC (memdc);
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
g_free (image);
return NULL;
@@ -455,14 +454,14 @@ gdk_image_get (GdkWindow *window,
g_warning ("gdk_image_get: SelectObject #2 failed");
DeleteObject (private->ximage);
DeleteDC (memdc);
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
g_free (image);
return NULL;
@@ -474,14 +473,14 @@ gdk_image_get (GdkWindow *window,
SelectObject (memdc, oldbitmap2);
DeleteObject (private->ximage);
DeleteDC (memdc);
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
g_free (image);
return NULL;
@@ -493,14 +492,14 @@ gdk_image_get (GdkWindow *window,
if (!DeleteDC (memdc))
g_warning ("gdk_image_get: DeleteDC failed");
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
switch (image->depth)
@@ -663,7 +662,7 @@ gdk_image_put_normal (GdkDrawable *drawable,
gint width,
gint height)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkImagePrivate *image_private;
GdkGCPrivate *gc_private;
HDC hdc;
@@ -673,10 +672,10 @@ gdk_image_put_normal (GdkDrawable *drawable,
g_return_if_fail (image != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
image_private = (GdkImagePrivate*) image;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
/* The image can in fact be "shared", so don't test */
diff --git a/gdk/win32/gdkimage.c b/gdk/win32/gdkimage.c
index 3e9d28dd69..0f2825e405 100644
--- a/gdk/win32/gdkimage.c
+++ b/gdk/win32/gdkimage.c
@@ -29,6 +29,7 @@
#include "gdk.h" /* For gdk_error_trap_* / gdk_flush_* */
#include "gdkimage.h"
#include "gdkprivate.h"
+#include "gdkx.h"
static void gdk_image_put_normal (GdkDrawable *drawable,
GdkGC *gc,
@@ -300,7 +301,6 @@ gdk_image_get (GdkWindow *window,
{
GdkImage *image;
GdkImagePrivate *private;
- GdkWindowPrivate *win_private;
HDC hdc, memdc;
struct {
BITMAPINFOHEADER bmiHeader;
@@ -317,12 +317,11 @@ gdk_image_get (GdkWindow *window,
g_return_val_if_fail (window != NULL, NULL);
- win_private = (GdkWindowPrivate *) window;
- if (win_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
GDK_NOTE (MISC, g_print ("gdk_image_get: %#x %dx%d@+%d+%d\n",
- win_private->xwindow, width, height, x, y));
+ GDK_DRAWABLE_XID (window), width, height, x, y));
private = g_new (GdkImagePrivate, 1);
image = (GdkImage*) private;
@@ -337,7 +336,7 @@ gdk_image_get (GdkWindow *window,
/* This function is called both to blit from a window and from
* a pixmap.
*/
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
if ((hdc = CreateCompatibleDC (NULL)) == NULL)
{
@@ -345,14 +344,14 @@ gdk_image_get (GdkWindow *window,
g_free (image);
return NULL;
}
- if ((oldbitmap1 = SelectObject (hdc, win_private->xwindow)) == NULL)
+ if ((oldbitmap1 = SelectObject (hdc, GDK_DRAWABLE_XID (window))) == NULL)
{
g_warning ("gdk_image_get: SelectObject #1 failed");
DeleteDC (hdc);
g_free (image);
return NULL;
}
- GetObject (win_private->xwindow, sizeof (BITMAP), &bm);
+ GetObject (GDK_DRAWABLE_XID (window), sizeof (BITMAP), &bm);
GDK_NOTE (MISC,
g_print ("gdk_image_get: bmWidth = %d, bmHeight = %d, bmWidthBytes = %d, bmBitsPixel = %d\n",
bm.bmWidth, bm.bmHeight, bm.bmWidthBytes, bm.bmBitsPixel));
@@ -368,7 +367,7 @@ gdk_image_get (GdkWindow *window,
}
else
{
- if ((hdc = GetDC (win_private->xwindow)) == NULL)
+ if ((hdc = GetDC (GDK_DRAWABLE_XID (window))) == NULL)
{
g_warning ("gdk_image_get: GetDC failed");
g_free (image);
@@ -388,14 +387,14 @@ gdk_image_get (GdkWindow *window,
if ((memdc = CreateCompatibleDC (hdc)) == NULL)
{
g_warning ("gdk_image_get: CreateCompatibleDC #2 failed");
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
g_free (image);
return NULL;
@@ -437,14 +436,14 @@ gdk_image_get (GdkWindow *window,
{
g_warning ("gdk_image_get: CreateDIBSection failed");
DeleteDC (memdc);
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
g_free (image);
return NULL;
@@ -455,14 +454,14 @@ gdk_image_get (GdkWindow *window,
g_warning ("gdk_image_get: SelectObject #2 failed");
DeleteObject (private->ximage);
DeleteDC (memdc);
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
g_free (image);
return NULL;
@@ -474,14 +473,14 @@ gdk_image_get (GdkWindow *window,
SelectObject (memdc, oldbitmap2);
DeleteObject (private->ximage);
DeleteDC (memdc);
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
g_free (image);
return NULL;
@@ -493,14 +492,14 @@ gdk_image_get (GdkWindow *window,
if (!DeleteDC (memdc))
g_warning ("gdk_image_get: DeleteDC failed");
- if (win_private->window_type == GDK_WINDOW_PIXMAP)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
DeleteDC (hdc);
}
else
{
- ReleaseDC (win_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
switch (image->depth)
@@ -663,7 +662,7 @@ gdk_image_put_normal (GdkDrawable *drawable,
gint width,
gint height)
{
- GdkWindowPrivate *drawable_private;
+ GdkDrawablePrivate *drawable_private;
GdkImagePrivate *image_private;
GdkGCPrivate *gc_private;
HDC hdc;
@@ -673,10 +672,10 @@ gdk_image_put_normal (GdkDrawable *drawable,
g_return_if_fail (image != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (drawable))
return;
image_private = (GdkImagePrivate*) image;
+ drawable_private = (GdkDrawablePrivate*) drawable;
gc_private = (GdkGCPrivate*) gc;
/* The image can in fact be "shared", so don't test */
diff --git a/gdk/win32/gdkinput-win32.c b/gdk/win32/gdkinput-win32.c
index f681d4191d..4a864c7eaa 100644
--- a/gdk/win32/gdkinput-win32.c
+++ b/gdk/win32/gdkinput-win32.c
@@ -34,6 +34,7 @@
#include "gdk.h"
#include "gdkinput.h"
#include "gdkprivate.h"
+#include "gdkx.h"
#ifdef HAVE_WINTAB
#include <wintab.h>
@@ -288,7 +289,7 @@ gdk_input_init (void)
guint32 deviceid_counter = 0;
#ifdef HAVE_WINTAB
GdkDevicePrivate *gdkdev;
- GdkWindowPrivate *window_private;
+ GdkDrawablePrivate *window_private;
GdkWindowAttr wa;
WORD specversion;
LOGCONTEXT defcontext;
@@ -340,7 +341,7 @@ gdk_input_init (void)
return;
}
gdk_window_ref (wintab_window);
- window_private = (GdkWindowPrivate *) wintab_window;
+ window_private = (GdkDrawablePrivate *) wintab_window;
for (devix = 0; devix < ndevices; devix++)
{
@@ -690,12 +691,12 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
gdouble *xtilt,
gdouble *ytilt)
{
- GdkWindowPrivate *window_private;
+ GdkDrawablePrivate *window_private;
gint x_axis, y_axis, pressure_axis, xtilt_axis, ytilt_axis;
gdouble device_width, device_height;
gdouble x_offset, y_offset, x_scale, y_scale;
- window_private = (GdkWindowPrivate *) input_window->window;
+ window_private = (GdkDrawablePrivate *) input_window->window;
x_axis = gdkdev->axis_for_use[GDK_AXIS_X];
y_axis = gdkdev->axis_for_use[GDK_AXIS_Y];
@@ -922,7 +923,7 @@ gdk_input_win32_configure_event (GdkEventConfigure *event,
g_return_if_fail (window != NULL);
gdk_input_get_root_relative_geometry
- ((((GdkWindowPrivate*) window)->xwindow), &root_x, &root_y);
+ (GDK_DRAWABLE_XID (window), &root_x, &root_y);
input_window->root_x = root_x;
input_window->root_y = root_y;
@@ -939,7 +940,7 @@ gdk_input_win32_enter_event (GdkEventCrossing *event,
g_return_if_fail (window != NULL);
gdk_input_get_root_relative_geometry
- ((((GdkWindowPrivate*) window)->xwindow), &root_x, &root_y);
+ (GDK_DRAWABLE_XID (window), &root_x, &root_y);
input_window->root_x = root_x;
input_window->root_y = root_y;
@@ -1011,7 +1012,9 @@ gdk_input_win32_other_event (GdkEvent *event,
window_private = (GdkWindowPrivate *) window;
- GDK_NOTE (EVENTS, g_print ("gdk_input_win32_other_event: window=%#x (%d,%d)\n", window_private->xwindow, x, y));
+ GDK_NOTE (EVENTS,
+ g_print ("gdk_input_win32_other_event: window=%#x (%d,%d)\n",
+ GDK_DRAWABLE_XID (window), x, y));
#else
/* ??? This code is pretty bogus */
@@ -1106,15 +1109,16 @@ gdk_input_win32_other_event (GdkEvent *event,
pt.x = x;
pt.y = y;
- ClientToScreen (window_private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
gdk_window_unref (window);
window = window_private->parent;
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
- ScreenToClient (window_private->xwindow, &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
x = pt.x;
y = pt.y;
- GDK_NOTE (EVENTS, g_print ("...propagating to %#x, (%d,%d)\n", window_private->xwindow, x, y));
+ GDK_NOTE (EVENTS, g_print ("...propagating to %#x, (%d,%d)\n",
+ GDK_DRAWABLE_XID (window), x, y));
goto dijkstra;
}
@@ -1290,11 +1294,9 @@ gdk_input_win32_grab_pointer (GdkWindow *window,
need_ungrab = FALSE;
GDK_NOTE (MISC, g_print ("gdk_input_win32_grab_pointer: %#x %d %#x\n",
- ((GdkWindowPrivate *) window)->xwindow,
+ GDK_DRAWABLE_XID (window),
owner_events,
- (confine_to ?
- ((GdkWindowPrivate *) confine_to)->xwindow :
- 0)));
+ (confine_to ? GDK_DRAWABLE_XID (confine_to) : 0)));
while (tmp_list)
{
@@ -1434,13 +1436,8 @@ gdk_input_motion_events (GdkWindow *window,
guint32 stop,
gint *nevents_return)
{
- GdkWindowPrivate *window_private;
- GdkTimeCoord *coords;
- int i;
-
g_return_val_if_fail (window != NULL, NULL);
- window_private = (GdkWindowPrivate *) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
*nevents_return = 0;
@@ -1524,9 +1521,9 @@ gdk_input_set_extension_events (GdkWindow *window,
GdkInputWindow *iw;
g_return_if_fail (window != NULL);
- window_private = (GdkWindowPrivate *) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
+ window_private = (GdkWindowPrivate *) window;
if (mode == GDK_EXTENSION_EVENTS_NONE)
mask = 0;
diff --git a/gdk/win32/gdkinput.c b/gdk/win32/gdkinput.c
index f681d4191d..4a864c7eaa 100644
--- a/gdk/win32/gdkinput.c
+++ b/gdk/win32/gdkinput.c
@@ -34,6 +34,7 @@
#include "gdk.h"
#include "gdkinput.h"
#include "gdkprivate.h"
+#include "gdkx.h"
#ifdef HAVE_WINTAB
#include <wintab.h>
@@ -288,7 +289,7 @@ gdk_input_init (void)
guint32 deviceid_counter = 0;
#ifdef HAVE_WINTAB
GdkDevicePrivate *gdkdev;
- GdkWindowPrivate *window_private;
+ GdkDrawablePrivate *window_private;
GdkWindowAttr wa;
WORD specversion;
LOGCONTEXT defcontext;
@@ -340,7 +341,7 @@ gdk_input_init (void)
return;
}
gdk_window_ref (wintab_window);
- window_private = (GdkWindowPrivate *) wintab_window;
+ window_private = (GdkDrawablePrivate *) wintab_window;
for (devix = 0; devix < ndevices; devix++)
{
@@ -690,12 +691,12 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
gdouble *xtilt,
gdouble *ytilt)
{
- GdkWindowPrivate *window_private;
+ GdkDrawablePrivate *window_private;
gint x_axis, y_axis, pressure_axis, xtilt_axis, ytilt_axis;
gdouble device_width, device_height;
gdouble x_offset, y_offset, x_scale, y_scale;
- window_private = (GdkWindowPrivate *) input_window->window;
+ window_private = (GdkDrawablePrivate *) input_window->window;
x_axis = gdkdev->axis_for_use[GDK_AXIS_X];
y_axis = gdkdev->axis_for_use[GDK_AXIS_Y];
@@ -922,7 +923,7 @@ gdk_input_win32_configure_event (GdkEventConfigure *event,
g_return_if_fail (window != NULL);
gdk_input_get_root_relative_geometry
- ((((GdkWindowPrivate*) window)->xwindow), &root_x, &root_y);
+ (GDK_DRAWABLE_XID (window), &root_x, &root_y);
input_window->root_x = root_x;
input_window->root_y = root_y;
@@ -939,7 +940,7 @@ gdk_input_win32_enter_event (GdkEventCrossing *event,
g_return_if_fail (window != NULL);
gdk_input_get_root_relative_geometry
- ((((GdkWindowPrivate*) window)->xwindow), &root_x, &root_y);
+ (GDK_DRAWABLE_XID (window), &root_x, &root_y);
input_window->root_x = root_x;
input_window->root_y = root_y;
@@ -1011,7 +1012,9 @@ gdk_input_win32_other_event (GdkEvent *event,
window_private = (GdkWindowPrivate *) window;
- GDK_NOTE (EVENTS, g_print ("gdk_input_win32_other_event: window=%#x (%d,%d)\n", window_private->xwindow, x, y));
+ GDK_NOTE (EVENTS,
+ g_print ("gdk_input_win32_other_event: window=%#x (%d,%d)\n",
+ GDK_DRAWABLE_XID (window), x, y));
#else
/* ??? This code is pretty bogus */
@@ -1106,15 +1109,16 @@ gdk_input_win32_other_event (GdkEvent *event,
pt.x = x;
pt.y = y;
- ClientToScreen (window_private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
gdk_window_unref (window);
window = window_private->parent;
gdk_window_ref (window);
window_private = (GdkWindowPrivate *) window;
- ScreenToClient (window_private->xwindow, &pt);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
x = pt.x;
y = pt.y;
- GDK_NOTE (EVENTS, g_print ("...propagating to %#x, (%d,%d)\n", window_private->xwindow, x, y));
+ GDK_NOTE (EVENTS, g_print ("...propagating to %#x, (%d,%d)\n",
+ GDK_DRAWABLE_XID (window), x, y));
goto dijkstra;
}
@@ -1290,11 +1294,9 @@ gdk_input_win32_grab_pointer (GdkWindow *window,
need_ungrab = FALSE;
GDK_NOTE (MISC, g_print ("gdk_input_win32_grab_pointer: %#x %d %#x\n",
- ((GdkWindowPrivate *) window)->xwindow,
+ GDK_DRAWABLE_XID (window),
owner_events,
- (confine_to ?
- ((GdkWindowPrivate *) confine_to)->xwindow :
- 0)));
+ (confine_to ? GDK_DRAWABLE_XID (confine_to) : 0)));
while (tmp_list)
{
@@ -1434,13 +1436,8 @@ gdk_input_motion_events (GdkWindow *window,
guint32 stop,
gint *nevents_return)
{
- GdkWindowPrivate *window_private;
- GdkTimeCoord *coords;
- int i;
-
g_return_val_if_fail (window != NULL, NULL);
- window_private = (GdkWindowPrivate *) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
*nevents_return = 0;
@@ -1524,9 +1521,9 @@ gdk_input_set_extension_events (GdkWindow *window,
GdkInputWindow *iw;
g_return_if_fail (window != NULL);
- window_private = (GdkWindowPrivate *) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
+ window_private = (GdkWindowPrivate *) window;
if (mode == GDK_EXTENSION_EVENTS_NONE)
mask = 0;
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index 83e20930a3..5a44835c5d 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -333,7 +333,7 @@ gdk_screen_width (void)
{
gint return_val;
- return_val = gdk_root_parent.width;
+ return_val = gdk_root_parent.drawable.width;
return return_val;
}
@@ -358,7 +358,7 @@ gdk_screen_height (void)
{
gint return_val;
- return_val = gdk_root_parent.height;
+ return_val = gdk_root_parent.drawable.height;
return return_val;
}
diff --git a/gdk/win32/gdkpixmap-win32.c b/gdk/win32/gdkpixmap-win32.c
index a943ba65c8..8e4e027813 100644
--- a/gdk/win32/gdkpixmap-win32.c
+++ b/gdk/win32/gdkpixmap-win32.c
@@ -33,6 +33,7 @@
#include "gdkpixmap.h"
#include "gdkprivate.h"
+#include "gdkx.h"
typedef struct
{
@@ -55,7 +56,7 @@ gdk_pixmap_new (GdkWindow *window,
gint depth)
{
GdkPixmap *pixmap;
- GdkWindowPrivate *private;
+ GdkDrawablePrivate *private;
GdkWindowPrivate *window_private;
struct {
BITMAPINFOHEADER bmiHeader;
@@ -71,73 +72,31 @@ gdk_pixmap_new (GdkWindow *window,
guchar *bits;
gint i;
+ g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
if (!window)
window = (GdkWindow*) &gdk_root_parent;
- window_private = (GdkWindowPrivate*) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
+ window_private = (GdkWindowPrivate*) window;
if (depth == -1)
- depth = gdk_window_get_visual (window)->depth;
+ depth = gdk_drawable_get_visual (window)->depth;
- GDK_NOTE (MISC, g_print ("gdk_pixmap_new: %dx%dx%d\n", width, height, depth));
+ GDK_NOTE (MISC, g_print ("gdk_pixmap_new: %dx%dx%d\n",
+ width, height, depth));
- private = g_new0 (GdkWindowPrivate, 1);
+ private = g_new0 (GdkDrawablePrivate, 1);
pixmap = (GdkPixmap*) private;
- private->window_type = GDK_WINDOW_PIXMAP;
+ private->window_type = GDK_DRAWABLE_PIXMAP;
- visual = gdk_window_get_visual (window);
-
-#if 0
- if (depth == 1)
- {
- if ((private->xwindow =
- CreateBitmap (width, height, 1, 1, NULL)) == NULL)
- {
- g_warning ("gdk_pixmap_new: CreateBitmap failed");
- g_free (private);
- return NULL;
- }
+ visual = gdk_drawable_get_visual (window);
- private->colormap = NULL;
- }
- else
- {
- if (depth != visual->depth)
- g_warning ("gdk_pixmap_new: depth %d doesn't match display depth %d",
- depth, visual->depth);
-
- if ((hdc = GetDC (window_private->xwindow)) == NULL)
- {
- g_warning ("gdk_pixmap_new: GetDC failed");
- g_free (private);
- return NULL;
- }
-
- if ((private->xwindow =
- CreateCompatibleBitmap (hdc, width, height)) == NULL)
- {
- g_warning ("gdk_pixmap_new: %dx%d CreateCompatibleBitmap failed",
- width, height);
- ReleaseDC (window_private->xwindow, hdc);
- g_free (private);
- return NULL;
- }
-
- ReleaseDC (window_private->xwindow, hdc);
-
- private->colormap = window_private->colormap;
- if (private->colormap == NULL)
- private->colormap = gdk_colormap_get_system ();
- }
-#else
-
- if ((hdc = GetDC (window_private->xwindow)) == NULL)
+ if ((hdc = GetDC (GDK_DRAWABLE_XID (window))) == NULL)
{
g_warning ("gdk_pixmap_new: GetDC failed");
g_free (private);
@@ -180,7 +139,7 @@ gdk_pixmap_new (GdkWindow *window,
}
else
{
- private->colormap = window_private->colormap;
+ private->colormap = window_private->drawable.colormap;
if (private->colormap == NULL)
private->colormap = gdk_colormap_get_system ();
@@ -210,22 +169,16 @@ gdk_pixmap_new (GdkWindow *window,
iUsage, (PVOID *) &bits, NULL, 0)) == NULL)
{
g_warning ("gdk_pixmap_new: CreateDIBSection failed: %d", GetLastError ());
- ReleaseDC (window_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
g_free (private);
return NULL;
}
- ReleaseDC (window_private->xwindow, hdc);
-
-#endif
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
GDK_NOTE (MISC, g_print ("... = %#x\n", private->xwindow));
- private->parent = NULL;
- private->x = 0;
- private->y = 0;
private->width = width;
private->height = height;
- private->resize_count = 0;
private->ref_count = 1;
private->destroyed = 0;
@@ -244,7 +197,7 @@ gdk_pixmap_create_on_shared_image (GdkImage **image_return,
{
GdkPixmap *pixmap;
GdkImagePrivate *image_private;
- GdkWindowPrivate *private;
+ GdkDrawablePrivate *private;
GdkWindowPrivate *window_private;
g_return_val_if_fail (window != NULL, NULL);
@@ -263,18 +216,14 @@ gdk_pixmap_create_on_shared_image (GdkImage **image_return,
image_private = (GdkImagePrivate *) *image_return;
- private = g_new0 (GdkWindowPrivate, 1);
+ private = g_new0 (GdkDrawablePrivate, 1);
pixmap = (GdkPixmap*) private;
private->xwindow = image_private->ximage;
- private->window_type = GDK_WINDOW_PIXMAP;
- private->colormap = window_private->colormap;
- private->parent = NULL;
- private->x = 0;
- private->y = 0;
+ private->window_type = GDK_DRAWABLE_PIXMAP;
+ private->colormap = window_private->drawable.colormap;
private->width = width;
private->height = height;
- private->resize_count = 0;
private->ref_count = 1;
private->destroyed = 0;
@@ -329,31 +278,26 @@ gdk_bitmap_create_from_data (GdkWindow *window,
gint height)
{
GdkPixmap *pixmap;
- GdkWindowPrivate *private;
- GdkWindowPrivate *window_private;
+ GdkDrawablePrivate *private;
gint i, j, bpl, aligned_bpl;
guchar *bits;
g_return_val_if_fail (data != NULL, NULL);
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
+ g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
if (!window)
window = (GdkWindow*) &gdk_root_parent;
- window_private = (GdkWindowPrivate*) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
- private = g_new0 (GdkWindowPrivate, 1);
+ private = g_new0 (GdkDrawablePrivate, 1);
pixmap = (GdkPixmap*) private;
- private->parent = NULL;
- private->window_type = GDK_WINDOW_PIXMAP;
- private->x = 0;
- private->y = 0;
+ private->window_type = GDK_DRAWABLE_PIXMAP;
private->width = width;
private->height = height;
- private->resize_count = 0;
private->ref_count = 1;
private->destroyed = FALSE;
@@ -403,7 +347,7 @@ gdk_pixmap_create_from_data (GdkWindow *window,
GDK_NOTE (MISC, g_print ("gdk_pixmap_create_from_data: %dx%dx%d = %#x\n",
width, height, depth,
- ((GdkPixmapPrivate *) result)->xwindow));
+ GDK_DRAWABLE_XID (result)));
return result;
}
@@ -646,13 +590,13 @@ gdk_xpm_destroy_notify (gpointer data)
}
static GdkPixmap *
-_gdk_pixmap_create_from_xpm (GdkWindow *window,
+_gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkColormap *colormap,
- GdkBitmap **mask,
- GdkColor *transparent_color,
- gchar * (*get_buf) (enum buffer_op op,
- gpointer handle),
- gpointer handle)
+ GdkBitmap **mask,
+ GdkColor *transparent_color,
+ gchar * (*get_buf) (enum buffer_op op,
+ gpointer handle),
+ gpointer handle)
{
GdkPixmap *pixmap = NULL;
GdkImage *image = NULL;
@@ -972,8 +916,8 @@ GdkPixmap*
gdk_pixmap_foreign_new (guint32 anid)
{
GdkPixmap *pixmap;
+ GdkDrawablePrivate *private;
GdkWindowPrivate *window_private;
- GdkWindowPrivate *private;
HBITMAP xpixmap;
SIZE size;
unsigned int x_ret, y_ret, w_ret, h_ret, bw_ret, depth_ret;
@@ -994,18 +938,14 @@ gdk_pixmap_foreign_new (guint32 anid)
h_ret = size.cy;
/* allocate a new gdk pixmap */
- private = g_new(GdkWindowPrivate, 1);
+ private = g_new (GdkDrawablePrivate, 1);
pixmap = (GdkPixmap *)private;
- private->window_type = GDK_WINDOW_PIXMAP;
+ private->window_type = GDK_DRAWABLE_PIXMAP;
private->xwindow = xpixmap;
private->colormap = NULL;
- private->parent = NULL;
- private->x = 0;
- private->y = 0;
private->width = w_ret;
private->height = h_ret;
- private->resize_count = 0;
private->ref_count = 1;
private->destroyed = 0;
@@ -1017,8 +957,9 @@ gdk_pixmap_foreign_new (guint32 anid)
GdkPixmap*
gdk_pixmap_ref (GdkPixmap *pixmap)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
+ GdkDrawablePrivate *private = (GdkDrawablePrivate *)pixmap;
g_return_val_if_fail (pixmap != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_PIXMAP (private), NULL);
private->ref_count += 1;
return pixmap;
@@ -1027,8 +968,10 @@ gdk_pixmap_ref (GdkPixmap *pixmap)
void
gdk_pixmap_unref (GdkPixmap *pixmap)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
- g_return_if_fail(pixmap != NULL);
+ GdkDrawablePrivate *private = (GdkDrawablePrivate *)pixmap;
+ g_return_if_fail (pixmap != NULL);
+ g_return_if_fail (GDK_IS_PIXMAP (private));
+ g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
diff --git a/gdk/win32/gdkpixmap.c b/gdk/win32/gdkpixmap.c
index a943ba65c8..8e4e027813 100644
--- a/gdk/win32/gdkpixmap.c
+++ b/gdk/win32/gdkpixmap.c
@@ -33,6 +33,7 @@
#include "gdkpixmap.h"
#include "gdkprivate.h"
+#include "gdkx.h"
typedef struct
{
@@ -55,7 +56,7 @@ gdk_pixmap_new (GdkWindow *window,
gint depth)
{
GdkPixmap *pixmap;
- GdkWindowPrivate *private;
+ GdkDrawablePrivate *private;
GdkWindowPrivate *window_private;
struct {
BITMAPINFOHEADER bmiHeader;
@@ -71,73 +72,31 @@ gdk_pixmap_new (GdkWindow *window,
guchar *bits;
gint i;
+ g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
if (!window)
window = (GdkWindow*) &gdk_root_parent;
- window_private = (GdkWindowPrivate*) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
+ window_private = (GdkWindowPrivate*) window;
if (depth == -1)
- depth = gdk_window_get_visual (window)->depth;
+ depth = gdk_drawable_get_visual (window)->depth;
- GDK_NOTE (MISC, g_print ("gdk_pixmap_new: %dx%dx%d\n", width, height, depth));
+ GDK_NOTE (MISC, g_print ("gdk_pixmap_new: %dx%dx%d\n",
+ width, height, depth));
- private = g_new0 (GdkWindowPrivate, 1);
+ private = g_new0 (GdkDrawablePrivate, 1);
pixmap = (GdkPixmap*) private;
- private->window_type = GDK_WINDOW_PIXMAP;
+ private->window_type = GDK_DRAWABLE_PIXMAP;
- visual = gdk_window_get_visual (window);
-
-#if 0
- if (depth == 1)
- {
- if ((private->xwindow =
- CreateBitmap (width, height, 1, 1, NULL)) == NULL)
- {
- g_warning ("gdk_pixmap_new: CreateBitmap failed");
- g_free (private);
- return NULL;
- }
+ visual = gdk_drawable_get_visual (window);
- private->colormap = NULL;
- }
- else
- {
- if (depth != visual->depth)
- g_warning ("gdk_pixmap_new: depth %d doesn't match display depth %d",
- depth, visual->depth);
-
- if ((hdc = GetDC (window_private->xwindow)) == NULL)
- {
- g_warning ("gdk_pixmap_new: GetDC failed");
- g_free (private);
- return NULL;
- }
-
- if ((private->xwindow =
- CreateCompatibleBitmap (hdc, width, height)) == NULL)
- {
- g_warning ("gdk_pixmap_new: %dx%d CreateCompatibleBitmap failed",
- width, height);
- ReleaseDC (window_private->xwindow, hdc);
- g_free (private);
- return NULL;
- }
-
- ReleaseDC (window_private->xwindow, hdc);
-
- private->colormap = window_private->colormap;
- if (private->colormap == NULL)
- private->colormap = gdk_colormap_get_system ();
- }
-#else
-
- if ((hdc = GetDC (window_private->xwindow)) == NULL)
+ if ((hdc = GetDC (GDK_DRAWABLE_XID (window))) == NULL)
{
g_warning ("gdk_pixmap_new: GetDC failed");
g_free (private);
@@ -180,7 +139,7 @@ gdk_pixmap_new (GdkWindow *window,
}
else
{
- private->colormap = window_private->colormap;
+ private->colormap = window_private->drawable.colormap;
if (private->colormap == NULL)
private->colormap = gdk_colormap_get_system ();
@@ -210,22 +169,16 @@ gdk_pixmap_new (GdkWindow *window,
iUsage, (PVOID *) &bits, NULL, 0)) == NULL)
{
g_warning ("gdk_pixmap_new: CreateDIBSection failed: %d", GetLastError ());
- ReleaseDC (window_private->xwindow, hdc);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
g_free (private);
return NULL;
}
- ReleaseDC (window_private->xwindow, hdc);
-
-#endif
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
GDK_NOTE (MISC, g_print ("... = %#x\n", private->xwindow));
- private->parent = NULL;
- private->x = 0;
- private->y = 0;
private->width = width;
private->height = height;
- private->resize_count = 0;
private->ref_count = 1;
private->destroyed = 0;
@@ -244,7 +197,7 @@ gdk_pixmap_create_on_shared_image (GdkImage **image_return,
{
GdkPixmap *pixmap;
GdkImagePrivate *image_private;
- GdkWindowPrivate *private;
+ GdkDrawablePrivate *private;
GdkWindowPrivate *window_private;
g_return_val_if_fail (window != NULL, NULL);
@@ -263,18 +216,14 @@ gdk_pixmap_create_on_shared_image (GdkImage **image_return,
image_private = (GdkImagePrivate *) *image_return;
- private = g_new0 (GdkWindowPrivate, 1);
+ private = g_new0 (GdkDrawablePrivate, 1);
pixmap = (GdkPixmap*) private;
private->xwindow = image_private->ximage;
- private->window_type = GDK_WINDOW_PIXMAP;
- private->colormap = window_private->colormap;
- private->parent = NULL;
- private->x = 0;
- private->y = 0;
+ private->window_type = GDK_DRAWABLE_PIXMAP;
+ private->colormap = window_private->drawable.colormap;
private->width = width;
private->height = height;
- private->resize_count = 0;
private->ref_count = 1;
private->destroyed = 0;
@@ -329,31 +278,26 @@ gdk_bitmap_create_from_data (GdkWindow *window,
gint height)
{
GdkPixmap *pixmap;
- GdkWindowPrivate *private;
- GdkWindowPrivate *window_private;
+ GdkDrawablePrivate *private;
gint i, j, bpl, aligned_bpl;
guchar *bits;
g_return_val_if_fail (data != NULL, NULL);
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
+ g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
if (!window)
window = (GdkWindow*) &gdk_root_parent;
- window_private = (GdkWindowPrivate*) window;
- if (window_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
- private = g_new0 (GdkWindowPrivate, 1);
+ private = g_new0 (GdkDrawablePrivate, 1);
pixmap = (GdkPixmap*) private;
- private->parent = NULL;
- private->window_type = GDK_WINDOW_PIXMAP;
- private->x = 0;
- private->y = 0;
+ private->window_type = GDK_DRAWABLE_PIXMAP;
private->width = width;
private->height = height;
- private->resize_count = 0;
private->ref_count = 1;
private->destroyed = FALSE;
@@ -403,7 +347,7 @@ gdk_pixmap_create_from_data (GdkWindow *window,
GDK_NOTE (MISC, g_print ("gdk_pixmap_create_from_data: %dx%dx%d = %#x\n",
width, height, depth,
- ((GdkPixmapPrivate *) result)->xwindow));
+ GDK_DRAWABLE_XID (result)));
return result;
}
@@ -646,13 +590,13 @@ gdk_xpm_destroy_notify (gpointer data)
}
static GdkPixmap *
-_gdk_pixmap_create_from_xpm (GdkWindow *window,
+_gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkColormap *colormap,
- GdkBitmap **mask,
- GdkColor *transparent_color,
- gchar * (*get_buf) (enum buffer_op op,
- gpointer handle),
- gpointer handle)
+ GdkBitmap **mask,
+ GdkColor *transparent_color,
+ gchar * (*get_buf) (enum buffer_op op,
+ gpointer handle),
+ gpointer handle)
{
GdkPixmap *pixmap = NULL;
GdkImage *image = NULL;
@@ -972,8 +916,8 @@ GdkPixmap*
gdk_pixmap_foreign_new (guint32 anid)
{
GdkPixmap *pixmap;
+ GdkDrawablePrivate *private;
GdkWindowPrivate *window_private;
- GdkWindowPrivate *private;
HBITMAP xpixmap;
SIZE size;
unsigned int x_ret, y_ret, w_ret, h_ret, bw_ret, depth_ret;
@@ -994,18 +938,14 @@ gdk_pixmap_foreign_new (guint32 anid)
h_ret = size.cy;
/* allocate a new gdk pixmap */
- private = g_new(GdkWindowPrivate, 1);
+ private = g_new (GdkDrawablePrivate, 1);
pixmap = (GdkPixmap *)private;
- private->window_type = GDK_WINDOW_PIXMAP;
+ private->window_type = GDK_DRAWABLE_PIXMAP;
private->xwindow = xpixmap;
private->colormap = NULL;
- private->parent = NULL;
- private->x = 0;
- private->y = 0;
private->width = w_ret;
private->height = h_ret;
- private->resize_count = 0;
private->ref_count = 1;
private->destroyed = 0;
@@ -1017,8 +957,9 @@ gdk_pixmap_foreign_new (guint32 anid)
GdkPixmap*
gdk_pixmap_ref (GdkPixmap *pixmap)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
+ GdkDrawablePrivate *private = (GdkDrawablePrivate *)pixmap;
g_return_val_if_fail (pixmap != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_PIXMAP (private), NULL);
private->ref_count += 1;
return pixmap;
@@ -1027,8 +968,10 @@ gdk_pixmap_ref (GdkPixmap *pixmap)
void
gdk_pixmap_unref (GdkPixmap *pixmap)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
- g_return_if_fail(pixmap != NULL);
+ GdkDrawablePrivate *private = (GdkDrawablePrivate *)pixmap;
+ g_return_if_fail (pixmap != NULL);
+ g_return_if_fail (GDK_IS_PIXMAP (private));
+ g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index 9fc0bae3e6..a35bd703b0 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -50,6 +50,8 @@ extern int *__imp___mb_cur_max;
#include <time.h>
+#include <gdk/gdktypes.h>
+
#include <gdk/gdkcursor.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkfont.h>
@@ -60,7 +62,11 @@ extern int *__imp___mb_cur_max;
#include <gdk/gdkvisual.h>
#include <gdk/gdkwindow.h>
-#include <gdk/gdktypes.h>
+#define GDK_DRAWABLE_TYPE(d) (((GdkDrawablePrivate *)d)->window_type)
+#define GDK_IS_WINDOW(d) (GDK_DRAWABLE_TYPE(d) <= GDK_WINDOW_TEMP || \
+ GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN)
+#define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP)
+#define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed)
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
@@ -134,8 +140,9 @@ typedef struct {
unsigned long base_pixel;
} XStandardColormap;
+typedef struct _GdkDrawablePrivate GdkDrawablePrivate;
+/* typedef struct _GdkDrawablePrivate GdkPixmapPrivate; */
typedef struct _GdkWindowPrivate GdkWindowPrivate;
-typedef struct _GdkWindowPrivate GdkPixmapPrivate;
typedef struct _GdkImagePrivate GdkImagePrivate;
typedef struct _GdkGCPrivate GdkGCPrivate;
typedef struct _GdkColormapPrivate GdkColormapPrivate;
@@ -147,20 +154,30 @@ typedef struct _GdkEventFilter GdkEventFilter;
typedef struct _GdkClientFilter GdkClientFilter;
typedef struct _GdkRegionPrivate GdkRegionPrivate;
+struct _GdkDrawablePrivate
+{
+ GdkDrawable drawable;
+
+ guint8 window_type;
+ guint ref_count;
+
+ guint16 width;
+ guint16 height;
+
+ HANDLE xwindow;
+ GdkColormap *colormap;
+
+ guint destroyed : 2;
+};
struct _GdkWindowPrivate
{
- GdkWindow window;
+ GdkDrawablePrivate drawable;
+
GdkWindow *parent;
- HANDLE xwindow;
gint16 x;
gint16 y;
- guint16 width;
- guint16 height;
guint8 resize_count;
- guint8 window_type;
- guint ref_count;
- guint destroyed : 2;
guint mapped : 1;
guint guffaw_gravity : 1;
@@ -191,7 +208,6 @@ struct _GdkWindowPrivate
gboolean extension_events_selected;
GList *filters;
- GdkColormap *colormap;
GList *children;
};
@@ -304,19 +320,6 @@ struct _GdkClientFilter {
gpointer data;
};
-#ifdef USE_XIM
-
-typedef struct _GdkICPrivate GdkICPrivate;
-
-struct _GdkICPrivate
-{
- XIC xic;
- GdkICAttr *attr;
- GdkICAttributesType mask;
-};
-
-#endif /* USE_XIM */
-
struct _GdkRegionPrivate
{
GdkRegion region;
@@ -354,10 +357,10 @@ gpointer gdk_xid_table_lookup (XID xid);
/* Internal functions */
-HDC gdk_gc_predraw (GdkWindowPrivate *window_private,
- GdkGCPrivate *gc_private);
-void gdk_gc_postdraw (GdkWindowPrivate *window_private,
- GdkGCPrivate *gc_private);
+HDC gdk_gc_predraw (GdkDrawablePrivate *drawable_private,
+ GdkGCPrivate *gc_private);
+void gdk_gc_postdraw (GdkDrawablePrivate *drawable_private,
+ GdkGCPrivate *gc_private);
HRGN BitmapToRegion (HBITMAP hBmp);
void gdk_sel_prop_store (GdkWindow *owner,
@@ -375,7 +378,6 @@ HWND gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_chi
extern gint gdk_debug_level;
extern gint gdk_show_events;
extern gint gdk_stack_trace;
-extern gchar *gdk_display_name;
extern HWND gdk_root_window;
extern HWND gdk_leader_window;
GDKVAR GdkWindowPrivate gdk_root_parent;
@@ -388,16 +390,6 @@ GDKVAR gint gdk_null_window_warnings;
extern GList *gdk_default_filters;
extern gint gdk_event_func_from_window_proc;
-#ifdef USE_XIM
-/* XIM support */
-gint gdk_im_open (void);
-void gdk_im_close (void);
-void gdk_ic_cleanup (void);
-
-extern GdkICPrivate *gdk_xim_ic; /* currently using IC */
-extern GdkWindow *gdk_xim_window; /* currently using Window */
-#endif /* USE_XIM */
-
extern HDC gdk_DC;
extern HINSTANCE gdk_DLLInstance;
extern HINSTANCE gdk_ProgInstance;
diff --git a/gdk/win32/gdkprivate.h b/gdk/win32/gdkprivate.h
index 9fc0bae3e6..a35bd703b0 100644
--- a/gdk/win32/gdkprivate.h
+++ b/gdk/win32/gdkprivate.h
@@ -50,6 +50,8 @@ extern int *__imp___mb_cur_max;
#include <time.h>
+#include <gdk/gdktypes.h>
+
#include <gdk/gdkcursor.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkfont.h>
@@ -60,7 +62,11 @@ extern int *__imp___mb_cur_max;
#include <gdk/gdkvisual.h>
#include <gdk/gdkwindow.h>
-#include <gdk/gdktypes.h>
+#define GDK_DRAWABLE_TYPE(d) (((GdkDrawablePrivate *)d)->window_type)
+#define GDK_IS_WINDOW(d) (GDK_DRAWABLE_TYPE(d) <= GDK_WINDOW_TEMP || \
+ GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN)
+#define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP)
+#define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed)
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
@@ -134,8 +140,9 @@ typedef struct {
unsigned long base_pixel;
} XStandardColormap;
+typedef struct _GdkDrawablePrivate GdkDrawablePrivate;
+/* typedef struct _GdkDrawablePrivate GdkPixmapPrivate; */
typedef struct _GdkWindowPrivate GdkWindowPrivate;
-typedef struct _GdkWindowPrivate GdkPixmapPrivate;
typedef struct _GdkImagePrivate GdkImagePrivate;
typedef struct _GdkGCPrivate GdkGCPrivate;
typedef struct _GdkColormapPrivate GdkColormapPrivate;
@@ -147,20 +154,30 @@ typedef struct _GdkEventFilter GdkEventFilter;
typedef struct _GdkClientFilter GdkClientFilter;
typedef struct _GdkRegionPrivate GdkRegionPrivate;
+struct _GdkDrawablePrivate
+{
+ GdkDrawable drawable;
+
+ guint8 window_type;
+ guint ref_count;
+
+ guint16 width;
+ guint16 height;
+
+ HANDLE xwindow;
+ GdkColormap *colormap;
+
+ guint destroyed : 2;
+};
struct _GdkWindowPrivate
{
- GdkWindow window;
+ GdkDrawablePrivate drawable;
+
GdkWindow *parent;
- HANDLE xwindow;
gint16 x;
gint16 y;
- guint16 width;
- guint16 height;
guint8 resize_count;
- guint8 window_type;
- guint ref_count;
- guint destroyed : 2;
guint mapped : 1;
guint guffaw_gravity : 1;
@@ -191,7 +208,6 @@ struct _GdkWindowPrivate
gboolean extension_events_selected;
GList *filters;
- GdkColormap *colormap;
GList *children;
};
@@ -304,19 +320,6 @@ struct _GdkClientFilter {
gpointer data;
};
-#ifdef USE_XIM
-
-typedef struct _GdkICPrivate GdkICPrivate;
-
-struct _GdkICPrivate
-{
- XIC xic;
- GdkICAttr *attr;
- GdkICAttributesType mask;
-};
-
-#endif /* USE_XIM */
-
struct _GdkRegionPrivate
{
GdkRegion region;
@@ -354,10 +357,10 @@ gpointer gdk_xid_table_lookup (XID xid);
/* Internal functions */
-HDC gdk_gc_predraw (GdkWindowPrivate *window_private,
- GdkGCPrivate *gc_private);
-void gdk_gc_postdraw (GdkWindowPrivate *window_private,
- GdkGCPrivate *gc_private);
+HDC gdk_gc_predraw (GdkDrawablePrivate *drawable_private,
+ GdkGCPrivate *gc_private);
+void gdk_gc_postdraw (GdkDrawablePrivate *drawable_private,
+ GdkGCPrivate *gc_private);
HRGN BitmapToRegion (HBITMAP hBmp);
void gdk_sel_prop_store (GdkWindow *owner,
@@ -375,7 +378,6 @@ HWND gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_chi
extern gint gdk_debug_level;
extern gint gdk_show_events;
extern gint gdk_stack_trace;
-extern gchar *gdk_display_name;
extern HWND gdk_root_window;
extern HWND gdk_leader_window;
GDKVAR GdkWindowPrivate gdk_root_parent;
@@ -388,16 +390,6 @@ GDKVAR gint gdk_null_window_warnings;
extern GList *gdk_default_filters;
extern gint gdk_event_func_from_window_proc;
-#ifdef USE_XIM
-/* XIM support */
-gint gdk_im_open (void);
-void gdk_im_close (void);
-void gdk_ic_cleanup (void);
-
-extern GdkICPrivate *gdk_xim_ic; /* currently using IC */
-extern GdkWindow *gdk_xim_window; /* currently using Window */
-#endif /* USE_XIM */
-
extern HDC gdk_DC;
extern HINSTANCE gdk_DLLInstance;
extern HINSTANCE gdk_ProgInstance;
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c
index e6bbca6311..86ee087223 100644
--- a/gdk/win32/gdkproperty-win32.c
+++ b/gdk/win32/gdkproperty-win32.c
@@ -31,6 +31,7 @@
#include "gdkproperty.h"
#include "gdkselection.h"
#include "gdkprivate.h"
+#include "gdkx.h"
GdkAtom
gdk_atom_intern (const gchar *atom_name,
@@ -132,21 +133,19 @@ gdk_property_change (GdkWindow *window,
guchar *data,
gint nelements)
{
- GdkWindowPrivate *private;
HGLOBAL hdata;
gint i, length;
gchar *prop_name, *type_name;
guchar *ptr;
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
GDK_NOTE (SELECTION,
(prop_name = gdk_atom_name (property),
type_name = gdk_atom_name (type),
g_print ("gdk_property_change: %#x %#x (%s) %#x (%s) %s %d*%d bytes %.10s\n",
- private->xwindow, property, prop_name,
+ GDK_DRAWABLE_XID (window), property, prop_name,
type, type_name,
(mode == GDK_PROP_MODE_REPLACE ? "REPLACE" :
(mode == GDK_PROP_MODE_PREPEND ? "PREPEND" :
@@ -168,8 +167,8 @@ gdk_property_change (GdkWindow *window,
length++;
#if 1
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n",
- private->xwindow));
- if (!OpenClipboard (private->xwindow))
+ GDK_DRAWABLE_XID (window)));
+ if (!OpenClipboard (GDK_DRAWABLE_XID (window)))
{
g_warning ("gdk_property_change: OpenClipboard failed");
return;
@@ -209,20 +208,21 @@ void
gdk_property_delete (GdkWindow *window,
GdkAtom property)
{
- GdkWindowPrivate *private;
gchar *prop_name, *type_name;
- extern void gdk_selection_property_delete (GdkWindowPrivate *);
+ extern void gdk_selection_property_delete (GdkWindow *);
- private = (GdkWindowPrivate*) window;
+ if (GDK_DRAWABLE_DESTROYED (window))
+ return;
GDK_NOTE (SELECTION,
(prop_name = gdk_atom_name (property),
g_print ("gdk_property_delete: %#x %#x (%s)\n",
- (window ? private->xwindow : 0), property, prop_name),
+ (window ? GDK_DRAWABLE_XID (window) : 0),
+ property, prop_name),
g_free (prop_name)));
if (property == gdk_selection_property)
- gdk_selection_property_delete (private);
+ gdk_selection_property_delete (window);
else
g_warning ("gdk_property_delete: General case not implemented");
}
diff --git a/gdk/win32/gdkproperty.c b/gdk/win32/gdkproperty.c
index e6bbca6311..86ee087223 100644
--- a/gdk/win32/gdkproperty.c
+++ b/gdk/win32/gdkproperty.c
@@ -31,6 +31,7 @@
#include "gdkproperty.h"
#include "gdkselection.h"
#include "gdkprivate.h"
+#include "gdkx.h"
GdkAtom
gdk_atom_intern (const gchar *atom_name,
@@ -132,21 +133,19 @@ gdk_property_change (GdkWindow *window,
guchar *data,
gint nelements)
{
- GdkWindowPrivate *private;
HGLOBAL hdata;
gint i, length;
gchar *prop_name, *type_name;
guchar *ptr;
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
GDK_NOTE (SELECTION,
(prop_name = gdk_atom_name (property),
type_name = gdk_atom_name (type),
g_print ("gdk_property_change: %#x %#x (%s) %#x (%s) %s %d*%d bytes %.10s\n",
- private->xwindow, property, prop_name,
+ GDK_DRAWABLE_XID (window), property, prop_name,
type, type_name,
(mode == GDK_PROP_MODE_REPLACE ? "REPLACE" :
(mode == GDK_PROP_MODE_PREPEND ? "PREPEND" :
@@ -168,8 +167,8 @@ gdk_property_change (GdkWindow *window,
length++;
#if 1
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n",
- private->xwindow));
- if (!OpenClipboard (private->xwindow))
+ GDK_DRAWABLE_XID (window)));
+ if (!OpenClipboard (GDK_DRAWABLE_XID (window)))
{
g_warning ("gdk_property_change: OpenClipboard failed");
return;
@@ -209,20 +208,21 @@ void
gdk_property_delete (GdkWindow *window,
GdkAtom property)
{
- GdkWindowPrivate *private;
gchar *prop_name, *type_name;
- extern void gdk_selection_property_delete (GdkWindowPrivate *);
+ extern void gdk_selection_property_delete (GdkWindow *);
- private = (GdkWindowPrivate*) window;
+ if (GDK_DRAWABLE_DESTROYED (window))
+ return;
GDK_NOTE (SELECTION,
(prop_name = gdk_atom_name (property),
g_print ("gdk_property_delete: %#x %#x (%s)\n",
- (window ? private->xwindow : 0), property, prop_name),
+ (window ? GDK_DRAWABLE_XID (window) : 0),
+ property, prop_name),
g_free (prop_name)));
if (property == gdk_selection_property)
- gdk_selection_property_delete (private);
+ gdk_selection_property_delete (window);
else
g_warning ("gdk_property_delete: General case not implemented");
}
diff --git a/gdk/win32/gdkselection-win32.c b/gdk/win32/gdkselection-win32.c
index 7085c94ba1..782c39da25 100644
--- a/gdk/win32/gdkselection-win32.c
+++ b/gdk/win32/gdkselection-win32.c
@@ -58,23 +58,21 @@ gdk_sel_prop_store (GdkWindow *owner,
guchar *data,
gint length)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *) owner;
GdkSelProp *prop;
- prop = g_hash_table_lookup (sel_prop_table, &private->xwindow);
+ prop = g_hash_table_lookup (sel_prop_table, &GDK_DRAWABLE_XID (owner));
if (prop != NULL)
{
g_free (prop->data);
- g_hash_table_remove (sel_prop_table, &private->xwindow);
+ g_hash_table_remove (sel_prop_table, &GDK_DRAWABLE_XID (owner));
}
prop = g_new (GdkSelProp, 1);
prop->data = data;
prop->length = length;
prop->format = format;
prop->type = type;
- g_hash_table_insert (sel_prop_table, &private->xwindow, prop);
+ g_hash_table_insert (sel_prop_table, &GDK_DRAWABLE_XID (owner), prop);
}
-
gint
gdk_selection_owner_set (GdkWindow *owner,
@@ -82,16 +80,13 @@ gdk_selection_owner_set (GdkWindow *owner,
guint32 time,
gint send_event)
{
- GdkWindowPrivate *private;
gchar *sel_name;
HWND xwindow;
- private = (GdkWindowPrivate *) owner;
-
GDK_NOTE (SELECTION,
(sel_name = gdk_atom_name (selection),
g_print ("gdk_selection_owner_set: %#x %#x (%s)\n",
- (private ? private->xwindow : 0),
+ (owner ? GDK_DRAWABLE_XID (owner) : 0),
selection, sel_name),
g_free (sel_name)));
@@ -99,7 +94,7 @@ gdk_selection_owner_set (GdkWindow *owner,
return FALSE;
if (owner != NULL)
- xwindow = private->xwindow;
+ xwindow = GDK_DRAWABLE_XID (owner);
else
xwindow = NULL;
@@ -132,7 +127,7 @@ gdk_selection_owner_set (GdkWindow *owner,
/* Send ourselves an ersatz selection request message so that
* gdk_property_change will be called to store the clipboard data.
*/
- SendMessage (private->xwindow, gdk_selection_request_msg,
+ SendMessage (xwindow, gdk_selection_request_msg,
selection, 0);
}
@@ -143,7 +138,6 @@ GdkWindow*
gdk_selection_owner_get (GdkAtom selection)
{
GdkWindow *window;
- GdkWindowPrivate *private;
gchar *sel_name;
#if 1
@@ -158,14 +152,13 @@ gdk_selection_owner_get (GdkAtom selection)
else
window = gdk_window_lookup (GetClipboardOwner ());
- private = (GdkWindowPrivate *) window;
#endif
GDK_NOTE (SELECTION,
(sel_name = gdk_atom_name (selection),
g_print ("gdk_selection_owner_get: %#x (%s) = %#x\n",
selection, sel_name,
- (private ? private->xwindow : 0)),
+ (window ? GDK_DRAWABLE_XID (window) : 0)),
g_free (sel_name)));
return window;
@@ -177,7 +170,6 @@ gdk_selection_convert (GdkWindow *requestor,
GdkAtom target,
guint32 time)
{
- GdkWindowPrivate *private;
HGLOBAL hdata;
GdkSelProp *prop;
guchar *ptr, *data, *datap, *p;
@@ -185,14 +177,14 @@ gdk_selection_convert (GdkWindow *requestor,
gchar *sel_name, *tgt_name;
g_return_if_fail (requestor != NULL);
-
- private = (GdkWindowPrivate*) requestor;
+ if (GDK_DRAWABLE_DESTROYED (requestor))
+ return;
GDK_NOTE (SELECTION,
(sel_name = gdk_atom_name (selection),
tgt_name = gdk_atom_name (target),
g_print ("gdk_selection_convert: %#x %#x (%s) %#x (%s)\n",
- private->xwindow, selection, sel_name, target, tgt_name),
+ GDK_DRAWABLE_XID (requestor), selection, sel_name, target, tgt_name),
g_free (sel_name),
g_free (tgt_name)));
@@ -203,8 +195,8 @@ gdk_selection_convert (GdkWindow *requestor,
* and store it for later.
*/
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n",
- private->xwindow));
- if (!OpenClipboard (private->xwindow))
+ GDK_DRAWABLE_XID (requestor)));
+ if (!OpenClipboard (GDK_DRAWABLE_XID (requestor)))
{
g_warning ("gdk_selection_convert: OpenClipboard failed");
return;
@@ -255,7 +247,7 @@ gdk_selection_convert (GdkWindow *requestor,
/* Send ourselves an ersatz selection notify message so that we actually
* fetch the data.
*/
- SendMessage (private->xwindow, gdk_selection_notify_msg, selection, target);
+ SendMessage (GDK_DRAWABLE_XID (requestor), gdk_selection_notify_msg, selection, target);
}
else if (selection == gdk_win32_dropfiles_atom)
{
@@ -265,15 +257,15 @@ gdk_selection_convert (GdkWindow *requestor,
*/
GdkSelProp *prop;
- prop = g_hash_table_lookup (sel_prop_table, &gdk_root_parent.xwindow);
+ prop = g_hash_table_lookup (sel_prop_table, &gdk_root_parent.drawable.xwindow);
if (prop != NULL)
{
- g_hash_table_remove (sel_prop_table, &gdk_root_parent.xwindow);
+ g_hash_table_remove (sel_prop_table, &gdk_root_parent.drawable.xwindow);
gdk_sel_prop_store (requestor, prop->type, prop->format,
prop->data, prop->length);
g_free (prop);
- SendMessage (private->xwindow, gdk_selection_notify_msg, selection, target);
+ SendMessage (GDK_DRAWABLE_XID (requestor), gdk_selection_notify_msg, selection, target);
}
}
else
@@ -288,19 +280,18 @@ gdk_selection_property_get (GdkWindow *requestor,
GdkAtom *ret_type,
gint *ret_format)
{
- GdkWindowPrivate *private;
GdkSelProp *prop;
g_return_val_if_fail (requestor != NULL, 0);
+ g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0);
- private = (GdkWindowPrivate*) requestor;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (requestor))
return 0;
GDK_NOTE (SELECTION, g_print ("gdk_selection_property_get: %#x\n",
- private->xwindow));
+ GDK_DRAWABLE_XID (requestor)));
- prop = g_hash_table_lookup (sel_prop_table, &private->xwindow);
+ prop = g_hash_table_lookup (sel_prop_table, &GDK_DRAWABLE_XID (requestor));
if (prop == NULL)
{
@@ -319,15 +310,15 @@ gdk_selection_property_get (GdkWindow *requestor,
}
void
-gdk_selection_property_delete (GdkWindowPrivate *private)
+gdk_selection_property_delete (GdkWindow *window)
{
GdkSelProp *prop;
- prop = g_hash_table_lookup (sel_prop_table, &private->xwindow);
+ prop = g_hash_table_lookup (sel_prop_table, &GDK_DRAWABLE_XID (window));
if (prop != NULL)
{
g_free (prop->data);
- g_hash_table_remove (sel_prop_table, &private->xwindow);
+ g_hash_table_remove (sel_prop_table, &GDK_DRAWABLE_XID (window));
}
else
g_warning ("huh?");
diff --git a/gdk/win32/gdkselection.c b/gdk/win32/gdkselection.c
index 7085c94ba1..782c39da25 100644
--- a/gdk/win32/gdkselection.c
+++ b/gdk/win32/gdkselection.c
@@ -58,23 +58,21 @@ gdk_sel_prop_store (GdkWindow *owner,
guchar *data,
gint length)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *) owner;
GdkSelProp *prop;
- prop = g_hash_table_lookup (sel_prop_table, &private->xwindow);
+ prop = g_hash_table_lookup (sel_prop_table, &GDK_DRAWABLE_XID (owner));
if (prop != NULL)
{
g_free (prop->data);
- g_hash_table_remove (sel_prop_table, &private->xwindow);
+ g_hash_table_remove (sel_prop_table, &GDK_DRAWABLE_XID (owner));
}
prop = g_new (GdkSelProp, 1);
prop->data = data;
prop->length = length;
prop->format = format;
prop->type = type;
- g_hash_table_insert (sel_prop_table, &private->xwindow, prop);
+ g_hash_table_insert (sel_prop_table, &GDK_DRAWABLE_XID (owner), prop);
}
-
gint
gdk_selection_owner_set (GdkWindow *owner,
@@ -82,16 +80,13 @@ gdk_selection_owner_set (GdkWindow *owner,
guint32 time,
gint send_event)
{
- GdkWindowPrivate *private;
gchar *sel_name;
HWND xwindow;
- private = (GdkWindowPrivate *) owner;
-
GDK_NOTE (SELECTION,
(sel_name = gdk_atom_name (selection),
g_print ("gdk_selection_owner_set: %#x %#x (%s)\n",
- (private ? private->xwindow : 0),
+ (owner ? GDK_DRAWABLE_XID (owner) : 0),
selection, sel_name),
g_free (sel_name)));
@@ -99,7 +94,7 @@ gdk_selection_owner_set (GdkWindow *owner,
return FALSE;
if (owner != NULL)
- xwindow = private->xwindow;
+ xwindow = GDK_DRAWABLE_XID (owner);
else
xwindow = NULL;
@@ -132,7 +127,7 @@ gdk_selection_owner_set (GdkWindow *owner,
/* Send ourselves an ersatz selection request message so that
* gdk_property_change will be called to store the clipboard data.
*/
- SendMessage (private->xwindow, gdk_selection_request_msg,
+ SendMessage (xwindow, gdk_selection_request_msg,
selection, 0);
}
@@ -143,7 +138,6 @@ GdkWindow*
gdk_selection_owner_get (GdkAtom selection)
{
GdkWindow *window;
- GdkWindowPrivate *private;
gchar *sel_name;
#if 1
@@ -158,14 +152,13 @@ gdk_selection_owner_get (GdkAtom selection)
else
window = gdk_window_lookup (GetClipboardOwner ());
- private = (GdkWindowPrivate *) window;
#endif
GDK_NOTE (SELECTION,
(sel_name = gdk_atom_name (selection),
g_print ("gdk_selection_owner_get: %#x (%s) = %#x\n",
selection, sel_name,
- (private ? private->xwindow : 0)),
+ (window ? GDK_DRAWABLE_XID (window) : 0)),
g_free (sel_name)));
return window;
@@ -177,7 +170,6 @@ gdk_selection_convert (GdkWindow *requestor,
GdkAtom target,
guint32 time)
{
- GdkWindowPrivate *private;
HGLOBAL hdata;
GdkSelProp *prop;
guchar *ptr, *data, *datap, *p;
@@ -185,14 +177,14 @@ gdk_selection_convert (GdkWindow *requestor,
gchar *sel_name, *tgt_name;
g_return_if_fail (requestor != NULL);
-
- private = (GdkWindowPrivate*) requestor;
+ if (GDK_DRAWABLE_DESTROYED (requestor))
+ return;
GDK_NOTE (SELECTION,
(sel_name = gdk_atom_name (selection),
tgt_name = gdk_atom_name (target),
g_print ("gdk_selection_convert: %#x %#x (%s) %#x (%s)\n",
- private->xwindow, selection, sel_name, target, tgt_name),
+ GDK_DRAWABLE_XID (requestor), selection, sel_name, target, tgt_name),
g_free (sel_name),
g_free (tgt_name)));
@@ -203,8 +195,8 @@ gdk_selection_convert (GdkWindow *requestor,
* and store it for later.
*/
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n",
- private->xwindow));
- if (!OpenClipboard (private->xwindow))
+ GDK_DRAWABLE_XID (requestor)));
+ if (!OpenClipboard (GDK_DRAWABLE_XID (requestor)))
{
g_warning ("gdk_selection_convert: OpenClipboard failed");
return;
@@ -255,7 +247,7 @@ gdk_selection_convert (GdkWindow *requestor,
/* Send ourselves an ersatz selection notify message so that we actually
* fetch the data.
*/
- SendMessage (private->xwindow, gdk_selection_notify_msg, selection, target);
+ SendMessage (GDK_DRAWABLE_XID (requestor), gdk_selection_notify_msg, selection, target);
}
else if (selection == gdk_win32_dropfiles_atom)
{
@@ -265,15 +257,15 @@ gdk_selection_convert (GdkWindow *requestor,
*/
GdkSelProp *prop;
- prop = g_hash_table_lookup (sel_prop_table, &gdk_root_parent.xwindow);
+ prop = g_hash_table_lookup (sel_prop_table, &gdk_root_parent.drawable.xwindow);
if (prop != NULL)
{
- g_hash_table_remove (sel_prop_table, &gdk_root_parent.xwindow);
+ g_hash_table_remove (sel_prop_table, &gdk_root_parent.drawable.xwindow);
gdk_sel_prop_store (requestor, prop->type, prop->format,
prop->data, prop->length);
g_free (prop);
- SendMessage (private->xwindow, gdk_selection_notify_msg, selection, target);
+ SendMessage (GDK_DRAWABLE_XID (requestor), gdk_selection_notify_msg, selection, target);
}
}
else
@@ -288,19 +280,18 @@ gdk_selection_property_get (GdkWindow *requestor,
GdkAtom *ret_type,
gint *ret_format)
{
- GdkWindowPrivate *private;
GdkSelProp *prop;
g_return_val_if_fail (requestor != NULL, 0);
+ g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0);
- private = (GdkWindowPrivate*) requestor;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (requestor))
return 0;
GDK_NOTE (SELECTION, g_print ("gdk_selection_property_get: %#x\n",
- private->xwindow));
+ GDK_DRAWABLE_XID (requestor)));
- prop = g_hash_table_lookup (sel_prop_table, &private->xwindow);
+ prop = g_hash_table_lookup (sel_prop_table, &GDK_DRAWABLE_XID (requestor));
if (prop == NULL)
{
@@ -319,15 +310,15 @@ gdk_selection_property_get (GdkWindow *requestor,
}
void
-gdk_selection_property_delete (GdkWindowPrivate *private)
+gdk_selection_property_delete (GdkWindow *window)
{
GdkSelProp *prop;
- prop = g_hash_table_lookup (sel_prop_table, &private->xwindow);
+ prop = g_hash_table_lookup (sel_prop_table, &GDK_DRAWABLE_XID (window));
if (prop != NULL)
{
g_free (prop->data);
- g_hash_table_remove (sel_prop_table, &private->xwindow);
+ g_hash_table_remove (sel_prop_table, &GDK_DRAWABLE_XID (window));
}
else
g_warning ("huh?");
diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h
index 34724393f7..7e8f8aded0 100644
--- a/gdk/win32/gdkwin32.h
+++ b/gdk/win32/gdkwin32.h
@@ -36,8 +36,10 @@
#define GDK_ROOT_WINDOW() ((guint32) HWND_DESKTOP)
#define GDK_ROOT_PARENT() ((GdkWindow *)&gdk_root_parent)
#define GDK_DISPLAY() NULL
-#define GDK_WINDOW_XDISPLAY(win) NULL
-#define GDK_WINDOW_XWINDOW(win) (((GdkWindowPrivate*) win)->xwindow)
+#define GDK_DRAWABLE_XDISPLAY(win) NULL
+#define GDK_DRAWABLE_XID(win) (((GdkDrawablePrivate*) win)->xwindow)
+#define GDK_WINDOW_XDISPLAY GDK_DRAWABLE_XDISPLAY
+#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID
#define GDK_IMAGE_XDISPLAY(image) NULL
#define GDK_IMAGE_XIMAGE(image) (((GdkImagePrivate*) image)->ximage)
#define GDK_GC_XDISPLAY(gc) NULL
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index a78469f123..d76694dbaa 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -35,6 +35,7 @@
#include "gdkwindow.h"
#include "gdkprivate.h"
#include "gdkinputprivate.h"
+#include "gdkx.h"
/* The Win API function AdjustWindowRect may return negative values
* resulting in obscured title bars. This helper function is coreccting it.
@@ -117,14 +118,14 @@ gdk_window_init (void)
}
#endif
- gdk_root_parent.xwindow = gdk_root_window;
- gdk_root_parent.window_type = GDK_WINDOW_ROOT;
- gdk_root_parent.window.user_data = NULL;
- gdk_root_parent.width = width;
- gdk_root_parent.height = height;
+ gdk_root_parent.drawable.xwindow = gdk_root_window;
+ gdk_root_parent.drawable.window_type = GDK_WINDOW_ROOT;
+ gdk_root_parent.drawable.drawable.user_data = NULL;
+ gdk_root_parent.drawable.width = width;
+ gdk_root_parent.drawable.height = height;
+ gdk_root_parent.drawable.ref_count = 1;
+ gdk_root_parent.drawable.colormap = NULL;
gdk_root_parent.children = NULL;
- gdk_root_parent.colormap = NULL;
- gdk_root_parent.ref_count = 1;
gdk_xid_table_insert (&gdk_root_window, &gdk_root_parent);
}
@@ -234,8 +235,8 @@ RegisterGdkClass(GdkWindowType wtype)
case GDK_WINDOW_ROOT:
g_error ("cannot make windows of type GDK_WINDOW_ROOT");
break;
- case GDK_WINDOW_PIXMAP:
- g_error ("cannot make windows of type GDK_WINDOW_PIXMAP (use gdk_pixmap_new)");
+ case GDK_DRAWABLE_PIXMAP:
+ g_error ("cannot make windows of type GDK_DRAWABLE_PIXMAP (use gdk_pixmap_new)");
break;
}
@@ -267,28 +268,28 @@ gdk_window_new (GdkWindow *parent,
parent = (GdkWindow*) &gdk_root_parent;
parent_private = (GdkWindowPrivate*) parent;
- if (parent_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (parent))
return NULL;
- xparent = parent_private->xwindow;
+ xparent = parent_private->drawable.xwindow;
private = g_new (GdkWindowPrivate, 1);
window = (GdkWindow*) private;
private->parent = parent;
- private->destroyed = FALSE;
+ private->drawable.destroyed = FALSE;
private->mapped = FALSE;
private->guffaw_gravity = FALSE;
private->resize_count = 0;
- private->ref_count = 1;
+ private->drawable.ref_count = 1;
private->x = (attributes_mask & GDK_WA_X) ? attributes->x : 0;
private->y = (attributes_mask & GDK_WA_Y) ? attributes->y : 0;
- private->width = (attributes->width > 1) ? (attributes->width) : (1);
- private->height = (attributes->height > 1) ? (attributes->height) : (1);
- private->window_type = attributes->window_type;
+ private->drawable.width = (attributes->width > 1) ? (attributes->width) : (1);
+ private->drawable.height = (attributes->height > 1) ? (attributes->height) : (1);
+ private->drawable.window_type = attributes->window_type;
private->extension_events = 0;
private->extension_events_selected = FALSE;
@@ -322,14 +323,14 @@ gdk_window_new (GdkWindow *parent,
{
dwExStyle = 0;
if (attributes_mask & GDK_WA_COLORMAP)
- private->colormap = attributes->colormap;
+ private->drawable.colormap = attributes->colormap;
else
- private->colormap = gdk_colormap_get_system ();
+ private->drawable.colormap = gdk_colormap_get_system ();
}
else
{
dwExStyle = WS_EX_TRANSPARENT;
- private->colormap = NULL;
+ private->drawable.colormap = NULL;
private->bg_type = GDK_WIN32_BG_TRANSPARENT;
private->bg_pixmap = NULL;
}
@@ -349,7 +350,7 @@ gdk_window_new (GdkWindow *parent,
if (parent_private)
parent_private->children = g_list_prepend (parent_private->children, window);
- switch (private->window_type)
+ switch (private->drawable.window_type)
{
case GDK_WINDOW_TOPLEVEL:
dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN;
@@ -370,16 +371,16 @@ gdk_window_new (GdkWindow *parent,
case GDK_WINDOW_ROOT:
g_error ("cannot make windows of type GDK_WINDOW_ROOT");
break;
- case GDK_WINDOW_PIXMAP:
- g_error ("cannot make windows of type GDK_WINDOW_PIXMAP (use gdk_pixmap_new)");
+ case GDK_DRAWABLE_PIXMAP:
+ g_error ("cannot make windows of type GDK_DRAWABLE_PIXMAP (use gdk_pixmap_new)");
break;
}
- klass = RegisterGdkClass (private->window_type);
+ klass = RegisterGdkClass (private->drawable.window_type);
if (!klass)
g_error ("RegisterClassEx failed");
- if (private->window_type != GDK_WINDOW_CHILD)
+ if (private->drawable.window_type != GDK_WINDOW_CHILD)
{
if (x == CW_USEDEFAULT)
{
@@ -392,8 +393,8 @@ gdk_window_new (GdkWindow *parent,
rect.top = y;
}
- rect.right = rect.left + private->width;
- rect.bottom = rect.top + private->height;
+ rect.right = rect.left + private->drawable.width;
+ rect.bottom = rect.top + private->drawable.height;
if (!SafeAdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
g_warning ("gdk_window_new: AdjustWindowRectEx failed");
@@ -408,11 +409,11 @@ gdk_window_new (GdkWindow *parent,
}
else
{
- width = private->width;
- height = private->height;
+ width = private->drawable.width;
+ height = private->drawable.height;
}
- private->xwindow =
+ private->drawable.xwindow =
CreateWindowEx (dwExStyle,
MAKEINTRESOURCE(klass),
title,
@@ -425,23 +426,23 @@ gdk_window_new (GdkWindow *parent,
NULL);
GDK_NOTE (MISC,
g_print ("gdk_window_create: %s %s %#x %#x %dx%d@+%d+%d %#x = %#x\n",
- (private->window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
- (private->window_type == GDK_WINDOW_CHILD ? "CHILD" :
- (private->window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
- (private->window_type == GDK_WINDOW_TEMP ? "TEMP" :
+ (private->drawable.window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
+ (private->drawable.window_type == GDK_WINDOW_CHILD ? "CHILD" :
+ (private->drawable.window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
+ (private->drawable.window_type == GDK_WINDOW_TEMP ? "TEMP" :
"???")))),
title,
dwStyle,
private->event_mask,
width, height, (x == CW_USEDEFAULT ? -9999 : x), y,
xparent,
- private->xwindow));
+ private->drawable.xwindow));
gdk_window_ref (window);
- gdk_xid_table_insert (&private->xwindow, window);
+ gdk_xid_table_insert (&private->drawable.xwindow, window);
- if (private->colormap)
- gdk_colormap_ref (private->colormap);
+ if (private->drawable.colormap)
+ gdk_colormap_ref (private->drawable.colormap);
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
(attributes->cursor) :
@@ -471,7 +472,7 @@ gdk_window_foreign_new (guint32 anid)
if (parent_private)
parent_private->children = g_list_prepend (parent_private->children, window);
- private->xwindow = (HWND) anid;
+ private->drawable.xwindow = (HWND) anid;
GetClientRect ((HWND) anid, &rect);
point.x = rect.left;
point.y = rect.right;
@@ -480,18 +481,18 @@ gdk_window_foreign_new (guint32 anid)
ScreenToClient (parent, &point);
private->x = point.x;
private->y = point.y;
- private->width = rect.right - rect.left;
- private->height = rect.bottom - rect.top;
+ private->drawable.width = rect.right - rect.left;
+ private->drawable.height = rect.bottom - rect.top;
private->resize_count = 0;
- private->ref_count = 1;
- private->window_type = GDK_WINDOW_FOREIGN;
- private->destroyed = FALSE;
- private->mapped = IsWindowVisible (private->xwindow);
+ private->drawable.ref_count = 1;
+ private->drawable.window_type = GDK_WINDOW_FOREIGN;
+ private->drawable.destroyed = FALSE;
+ private->mapped = IsWindowVisible (private->drawable.xwindow);
private->guffaw_gravity = FALSE;
private->extension_events = 0;
private->extension_events_selected = FALSE;
- private->colormap = NULL;
+ private->drawable.colormap = NULL;
private->filters = NULL;
private->children = NULL;
@@ -499,7 +500,7 @@ gdk_window_foreign_new (guint32 anid)
window->user_data = NULL;
gdk_window_ref (window);
- gdk_xid_table_insert (&private->xwindow, window);
+ gdk_xid_table_insert (&private->drawable.xwindow, window);
return window;
}
@@ -526,16 +527,16 @@ gdk_window_internal_destroy (GdkWindow *window,
private = (GdkWindowPrivate*) window;
GDK_NOTE (MISC, g_print ("gdk_window_internal_destroy %#x\n",
- private->xwindow));
+ private->drawable.xwindow));
- switch (private->window_type)
+ switch (private->drawable.window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_CHILD:
case GDK_WINDOW_DIALOG:
case GDK_WINDOW_TEMP:
case GDK_WINDOW_FOREIGN:
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
if (private->parent)
{
@@ -544,7 +545,7 @@ gdk_window_internal_destroy (GdkWindow *window,
parent_private->children = g_list_remove (parent_private->children, window);
}
- if (private->window_type != GDK_WINDOW_FOREIGN)
+ if (GDK_DRAWABLE_TYPE (window) != GDK_WINDOW_FOREIGN)
{
children = tmp = private->children;
private->children = NULL;
@@ -580,7 +581,7 @@ gdk_window_internal_destroy (GdkWindow *window,
private->filters = NULL;
}
- if (private->window_type == GDK_WINDOW_FOREIGN)
+ if (private->drawable.window_type == GDK_WINDOW_FOREIGN)
{
if (our_destroy && (private->parent != NULL))
{
@@ -596,17 +597,17 @@ gdk_window_internal_destroy (GdkWindow *window,
* OTOH, I don't think foreign windows are much
* used, so the question is maybe academic.
*/
- PostMessage (private->xwindow, WM_QUIT, 0, 0);
+ PostMessage (private->drawable.xwindow, WM_QUIT, 0, 0);
}
}
else if (xdestroy)
- DestroyWindow (private->xwindow);
+ DestroyWindow (private->drawable.xwindow);
- if (private->colormap)
- gdk_colormap_unref (private->colormap);
+ if (private->drawable.colormap)
+ gdk_colormap_unref (private->drawable.colormap);
private->mapped = FALSE;
- private->destroyed = TRUE;
+ private->drawable.destroyed = TRUE;
}
break;
@@ -614,7 +615,7 @@ gdk_window_internal_destroy (GdkWindow *window,
g_error ("attempted to destroy root window");
break;
- case GDK_WINDOW_PIXMAP:
+ case GDK_DRAWABLE_PIXMAP:
g_error ("called gdk_window_destroy on a pixmap (use gdk_pixmap_unref)");
break;
}
@@ -635,24 +636,20 @@ gdk_window_destroy (GdkWindow *window)
void
gdk_window_destroy_notify (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
- private = (GdkWindowPrivate*) window;
-
GDK_NOTE (EVENTS, g_print ("gdk_window_destroy_notify: %#x %d\n",
- private->xwindow, private->destroyed));
+ GDK_DRAWABLE_XID (window), GDK_DRAWABLE_DESTROYED (window)));
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- if (private->window_type == GDK_WINDOW_FOREIGN)
- gdk_window_internal_destroy (window, FALSE, FALSE);
- else
- g_warning ("GdkWindow %#lx unexpectedly destroyed", private->xwindow);
+ if (GDK_DRAWABLE_TYPE(window) != GDK_WINDOW_FOREIGN)
+ g_warning ("GdkWindow %#lx unexpectedly destroyed", GDK_DRAWABLE_XID (window));
+
+ gdk_window_internal_destroy (window, FALSE, FALSE);
}
- gdk_xid_table_remove (private->xwindow);
+ gdk_xid_table_remove (GDK_DRAWABLE_XID (window));
gdk_window_unref (window);
}
@@ -661,11 +658,12 @@ gdk_window_ref (GdkWindow *window)
{
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_val_if_fail (window != NULL, NULL);
-
- private->ref_count += 1;
+
+ private->drawable.ref_count += 1;
GDK_NOTE (MISC, g_print ("gdk_window_ref %#x %d\n",
- private->xwindow, private->ref_count));
+ GDK_DRAWABLE_XID (window),
+ private->drawable.ref_count));
return window;
}
@@ -676,21 +674,23 @@ gdk_window_unref (GdkWindow *window)
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
- private->ref_count -= 1;
+ private->drawable.ref_count -= 1;
GDK_NOTE (MISC, g_print ("gdk_window_unref %#x %d%s\n",
- private->xwindow, private->ref_count,
- (private->ref_count == 0 ? " freeing" : "")));
+ private->drawable.xwindow,
+ private->drawable.ref_count,
+ (private->drawable.ref_count == 0 ? " freeing" : "")));
- if (private->ref_count == 0)
+ if (private->drawable.ref_count == 0)
{
- if (private->bg_type == GDK_WIN32_BG_PIXMAP && private->bg_pixmap != NULL)
+ if (private->bg_type == GDK_WIN32_BG_PIXMAP
+ && private->bg_pixmap != NULL)
gdk_pixmap_unref (private->bg_pixmap);
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
- if (private->window_type == GDK_WINDOW_FOREIGN)
- gdk_xid_table_remove (private->xwindow);
+ if (private->drawable.window_type == GDK_WINDOW_FOREIGN)
+ gdk_xid_table_remove (private->drawable.xwindow);
else
g_warning ("losing last reference to undestroyed window");
}
@@ -707,27 +707,28 @@ gdk_window_show (GdkWindow *window)
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
- GDK_NOTE (MISC, g_print ("gdk_window_show: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_show: %#x\n",
+ private->drawable.xwindow));
private->mapped = TRUE;
- if (private->window_type == GDK_WINDOW_TEMP)
+ if (private->drawable.window_type == GDK_WINDOW_TEMP)
{
- ShowWindow (private->xwindow, SW_SHOWNOACTIVATE);
- SetWindowPos (private->xwindow, HWND_TOPMOST, 0, 0, 0, 0,
+ ShowWindow (private->drawable.xwindow, SW_SHOWNOACTIVATE);
+ SetWindowPos (private->drawable.xwindow, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
#if 0
- ShowWindow (private->xwindow, SW_HIDE); /* Don't put on toolbar */
+ ShowWindow (private->drawable.xwindow, SW_HIDE); /* Don't put on toolbar */
#endif
}
else
{
- ShowWindow (private->xwindow, SW_SHOWNORMAL);
- ShowWindow (private->xwindow, SW_RESTORE);
- SetForegroundWindow (private->xwindow);
+ ShowWindow (private->drawable.xwindow, SW_SHOWNORMAL);
+ ShowWindow (private->drawable.xwindow, SW_RESTORE);
+ SetForegroundWindow (private->drawable.xwindow);
#if 0
- ShowOwnedPopups (private->xwindow, TRUE);
+ ShowOwnedPopups (private->drawable.xwindow, TRUE);
#endif
}
}
@@ -741,19 +742,20 @@ gdk_window_hide (GdkWindow *window)
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
- GDK_NOTE (MISC, g_print ("gdk_window_hide: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_hide: %#x\n",
+ private->drawable.xwindow));
private->mapped = FALSE;
- if (private->window_type == GDK_WINDOW_TOPLEVEL)
- ShowOwnedPopups (private->xwindow, FALSE);
+ if (private->drawable.window_type == GDK_WINDOW_TOPLEVEL)
+ ShowOwnedPopups (private->drawable.xwindow, FALSE);
#if 1
- ShowWindow (private->xwindow, SW_HIDE);
+ ShowWindow (private->drawable.xwindow, SW_HIDE);
#elif 0
- ShowWindow (private->xwindow, SW_MINIMIZE);
+ ShowWindow (private->drawable.xwindow, SW_MINIMIZE);
#else
- CloseWindow (private->xwindow);
+ CloseWindow (private->drawable.xwindow);
#endif
}
}
@@ -766,9 +768,10 @@ gdk_window_withdraw (GdkWindow *window)
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
- GDK_NOTE (MISC, g_print ("gdk_window_withdraw: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_withdraw: %#x\n",
+ private->drawable.xwindow));
gdk_window_hide (window); /* XXX */
}
@@ -784,16 +787,16 @@ gdk_window_move (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
RECT rect;
GDK_NOTE (MISC, g_print ("gdk_window_move: %#x +%d+%d\n",
- private->xwindow, x, y));
+ private->drawable.xwindow, x, y));
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
- if (private->window_type != GDK_WINDOW_CHILD)
+ if (private->drawable.window_type != GDK_WINDOW_CHILD)
{
POINT ptTL, ptBR;
DWORD dwStyle;
@@ -801,18 +804,18 @@ gdk_window_move (GdkWindow *window,
ptTL.x = 0;
ptTL.y = 0;
- ClientToScreen (private->xwindow, &ptTL);
+ ClientToScreen (private->drawable.xwindow, &ptTL);
rect.left = x;
rect.top = y;
ptBR.x = rect.right;
ptBR.y = rect.bottom;
- ClientToScreen (private->xwindow, &ptBR);
+ ClientToScreen (private->drawable.xwindow, &ptBR);
rect.right = x + ptBR.x - ptTL.x;
rect.bottom = y + ptBR.y - ptTL.y;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
if (!SafeAdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
g_warning ("gdk_window_move: AdjustWindowRectEx failed");
@@ -825,10 +828,10 @@ gdk_window_move (GdkWindow *window,
private->y = y;
}
GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n",
- private->xwindow,
+ private->drawable.xwindow,
rect.right - rect.left, rect.bottom - rect.top,
x, y));
- if (!MoveWindow (private->xwindow,
+ if (!MoveWindow (private->drawable.xwindow,
x, y, rect.right - rect.left, rect.bottom - rect.top,
TRUE))
g_warning ("gdk_window_move: MoveWindow failed");
@@ -851,17 +854,17 @@ gdk_window_resize (GdkWindow *window,
private = (GdkWindowPrivate*) window;
- if (!private->destroyed &&
+ if (!private->drawable.destroyed &&
((private->resize_count > 0) ||
- (private->width != (guint16) width) ||
- (private->height != (guint16) height)))
+ (private->drawable.width != (guint16) width) ||
+ (private->drawable.height != (guint16) height)))
{
int x, y;
GDK_NOTE (MISC, g_print ("gdk_window_resize: %#x %dx%d\n",
- private->xwindow, width, height));
+ private->drawable.xwindow, width, height));
- if (private->window_type != GDK_WINDOW_CHILD)
+ if (private->drawable.window_type != GDK_WINDOW_CHILD)
{
POINT pt;
RECT rect;
@@ -870,14 +873,14 @@ gdk_window_resize (GdkWindow *window,
pt.x = 0;
pt.y = 0;
- ClientToScreen (private->xwindow, &pt);
+ ClientToScreen (private->drawable.xwindow, &pt);
rect.left = pt.x;
rect.top = pt.y;
rect.right = pt.x + width;
rect.bottom = pt.y + height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
if (!AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
g_warning ("gdk_window_resize: AdjustWindowRectEx failed");
@@ -890,15 +893,15 @@ gdk_window_resize (GdkWindow *window,
{
x = private->x;
y = private->y;
- private->width = width;
- private->height = height;
+ private->drawable.width = width;
+ private->drawable.height = height;
}
private->resize_count += 1;
GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n",
- private->xwindow, width, height, x, y));
- if (!MoveWindow (private->xwindow,
+ private->drawable.xwindow, width, height, x, y));
+ if (!MoveWindow (private->drawable.xwindow,
x, y, width, height,
TRUE))
g_warning ("gdk_window_resize: MoveWindow failed");
@@ -922,37 +925,37 @@ gdk_window_move_resize (GdkWindow *window,
height = 1;
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
RECT rect;
DWORD dwStyle;
DWORD dwExStyle;
GDK_NOTE (MISC, g_print ("gdk_window_move_resize: %#x %dx%d@+%d+%d\n",
- private->xwindow, width, height, x, y));
+ private->drawable.xwindow, width, height, x, y));
rect.left = x;
rect.top = y;
rect.right = x + width;
rect.bottom = y + height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
if (!AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
g_warning ("gdk_window_move_resize: AdjustWindowRectEx failed");
- if (private->window_type == GDK_WINDOW_CHILD)
+ if (private->drawable.window_type == GDK_WINDOW_CHILD)
{
private->x = x;
private->y = y;
- private->width = width;
- private->height = height;
+ private->drawable.width = width;
+ private->drawable.height = height;
}
GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n",
- private->xwindow,
+ private->drawable.xwindow,
rect.right - rect.left, rect.bottom - rect.top,
rect.left, rect.top));
- if (!MoveWindow (private->xwindow,
+ if (!MoveWindow (private->drawable.xwindow,
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
TRUE))
@@ -994,17 +997,17 @@ gdk_window_reparent (GdkWindow *window,
old_parent_private = (GdkWindowPrivate*)window_private->parent;
parent_private = (GdkWindowPrivate*) new_parent;
- if (!window_private->destroyed && !parent_private->destroyed)
+ if (!window_private->drawable.destroyed && !parent_private->drawable.destroyed)
{
GDK_NOTE (MISC, g_print ("gdk_window_reparent: %#x %#x\n",
- window_private->xwindow,
- parent_private->xwindow));
- if (!SetParent (window_private->xwindow, parent_private->xwindow))
+ window_private->drawable.xwindow,
+ parent_private->drawable.xwindow));
+ if (!SetParent (window_private->drawable.xwindow, parent_private->drawable.xwindow))
g_warning ("gdk_window_reparent: SetParent failed");
- if (!MoveWindow (window_private->xwindow,
+ if (!MoveWindow (window_private->drawable.xwindow,
x, y,
- window_private->width, window_private->height,
+ window_private->drawable.width, window_private->drawable.height,
TRUE))
g_warning ("gdk_window_reparent: MoveWindow failed");
}
@@ -1025,16 +1028,11 @@ gdk_window_reparent (GdkWindow *window,
void
gdk_window_clear (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
- {
- gdk_window_clear_area (window, 0, 0, private->width, private->height);
- }
+ if (!GDK_DRAWABLE_DESTROYED (window))
+ gdk_window_clear_area (window, 0, 0, -1, -1);
}
@@ -1045,13 +1043,10 @@ gdk_window_clear_area (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
HDC hdc;
@@ -1060,11 +1055,11 @@ gdk_window_clear_area (GdkWindow *window,
if (height == -1)
height = G_MAXSHORT/2;
GDK_NOTE (MISC, g_print ("gdk_window_clear_area: %#x %dx%d@+%d+%d\n",
- private->xwindow, width, height, x, y));
- hdc = GetDC (private->xwindow);
+ GDK_DRAWABLE_XID (window), width, height, x, y));
+ hdc = GetDC (GDK_DRAWABLE_XID (window));
IntersectClipRect (hdc, x, y, x + width, y + height);
- SendMessage (private->xwindow, WM_ERASEBKGND, (WPARAM) hdc, 0);
- ReleaseDC (private->xwindow, hdc);
+ SendMessage (GDK_DRAWABLE_XID (window), WM_ERASEBKGND, (WPARAM) hdc, 0);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
}
@@ -1075,86 +1070,38 @@ gdk_window_clear_area_e (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
RECT rect;
GDK_NOTE (MISC, g_print ("gdk_window_clear_area_e: %#x %dx%d@+%d+%d\n",
- private->xwindow, width, height, x, y));
+ GDK_DRAWABLE_XID (window), width, height, x, y));
rect.left = x;
rect.right = x + width;
rect.top = y;
rect.bottom = y + height;
- if (!InvalidateRect (private->xwindow, &rect, TRUE))
+ if (!InvalidateRect (GDK_DRAWABLE_XID (window), &rect, TRUE))
g_warning ("gdk_window_clear_area_e: InvalidateRect failed");
- UpdateWindow (private->xwindow);
- }
-}
-
-void
-gdk_window_copy_area (GdkWindow *window,
- GdkGC *gc,
- gint x,
- gint y,
- GdkWindow *source_window,
- gint source_x,
- gint source_y,
- gint width,
- gint height)
-{
- GdkWindowPrivate *src_private;
- GdkWindowPrivate *dest_private;
- GdkGCPrivate *gc_private;
-
- g_return_if_fail (window != NULL);
- g_return_if_fail (gc != NULL);
-
- if (source_window == NULL)
- source_window = window;
-
- src_private = (GdkWindowPrivate*) source_window;
- dest_private = (GdkWindowPrivate*) window;
- gc_private = (GdkGCPrivate*) gc;
-
- if (!src_private->destroyed && !dest_private->destroyed)
- {
- HDC hdcDest, hdcSrc;
-
- if ((hdcDest = GetDC (dest_private->xwindow)) == NULL)
- g_warning ("gdk_window_copy_area: GetDC failed");
-
- if ((hdcSrc = GetDC (src_private->xwindow)) == NULL)
- g_warning ("gdk_window_copy_area: GetDC failed");
-
- if (!BitBlt (hdcDest, x, y, width, height, hdcSrc, source_x, source_y, SRCCOPY))
- g_warning ("gdk_window_copy_area: BitBlt failed");
-
- ReleaseDC (dest_private->xwindow, hdcDest);
- ReleaseDC (src_private->xwindow, hdcSrc);
+ UpdateWindow (GDK_DRAWABLE_XID (window));
}
}
void
gdk_window_raise (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- GDK_NOTE (MISC, g_print ("gdk_window_raise: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_raise: %#x\n",
+ GDK_DRAWABLE_XID (window)));
- if (!BringWindowToTop (private->xwindow))
+ if (!BringWindowToTop (GDK_DRAWABLE_XID (window)))
g_warning ("gdk_window_raise: BringWindowToTop failed");
}
}
@@ -1162,17 +1109,15 @@ gdk_window_raise (GdkWindow *window)
void
gdk_window_lower (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- GDK_NOTE (MISC, g_print ("gdk_window_lower: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_lower: %#x\n",
+ GDK_DRAWABLE_XID (window)));
- if (!SetWindowPos (private->xwindow, HWND_BOTTOM, 0, 0, 0, 0,
+ if (!SetWindowPos (GDK_DRAWABLE_XID (window), HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE))
g_warning ("gdk_window_lower: SetWindowPos failed");
}
@@ -1205,13 +1150,15 @@ gdk_window_set_hints (GdkWindow *window,
int diff;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
+ private = (GdkWindowPrivate*) window;
+
GDK_NOTE (MISC, g_print ("gdk_window_set_hints: %#x %dx%d..%dx%d @+%d+%d\n",
- private->xwindow,
+ private->drawable.xwindow,
min_width, min_height, max_width, max_height,
x, y));
@@ -1221,7 +1168,7 @@ gdk_window_set_hints (GdkWindow *window,
if (flags)
{
if (flags & GDK_HINT_POS)
- if (!GetWindowPlacement (private->xwindow, &size_hints))
+ if (!GetWindowPlacement (private->drawable.xwindow, &size_hints))
g_warning ("gdk_window_set_hints: GetWindowPlacement failed");
else
{
@@ -1238,8 +1185,8 @@ gdk_window_set_hints (GdkWindow *window,
rect.top = y;
rect.right = rect.left + 200; /* dummy */
rect.bottom = rect.top + 200;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
size_hints.flags = 0;
size_hints.showCmd = SW_SHOWNA;
@@ -1258,7 +1205,7 @@ gdk_window_set_hints (GdkWindow *window,
size_hints.rcNormalPosition.top,
size_hints.rcNormalPosition.right,
size_hints.rcNormalPosition.bottom));
- if (!SetWindowPlacement (private->xwindow, &size_hints))
+ if (!SetWindowPlacement (private->drawable.xwindow, &size_hints))
g_warning ("gdk_window_set_hints: SetWindowPlacement failed");
private->hint_x = rect.left;
private->hint_y = rect.top;
@@ -1270,14 +1217,14 @@ gdk_window_set_hints (GdkWindow *window,
rect.top = 0;
rect.right = min_width;
rect.bottom = min_height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
private->hint_min_width = rect.right - rect.left;
private->hint_min_height = rect.bottom - rect.top;
/* Also chek if he current size of the window is in bounds. */
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
if (rect.right < min_width && rect.bottom < min_height)
gdk_window_resize (window, min_width, min_height);
else if (rect.right < min_width)
@@ -1291,13 +1238,13 @@ gdk_window_set_hints (GdkWindow *window,
rect.top = 0;
rect.right = max_width;
rect.bottom = max_height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
private->hint_max_width = rect.right - rect.left;
private->hint_max_height = rect.bottom - rect.top;
/* Again, check if the window is too large currently. */
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
if (rect.right > max_width && rect.bottom > max_height)
gdk_window_resize (window, max_width, max_height);
else if (rect.right > max_width)
@@ -1321,10 +1268,12 @@ gdk_window_set_geometry_hints (GdkWindow *window,
int diff;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
+
+ private = (GdkWindowPrivate*) window;
size_hints.length = sizeof (size_hints);
@@ -1339,14 +1288,14 @@ gdk_window_set_geometry_hints (GdkWindow *window,
rect.top = 0;
rect.right = geometry->min_width;
rect.bottom = geometry->min_height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
private->hint_min_width = rect.right - rect.left;
private->hint_min_height = rect.bottom - rect.top;
/* Also check if he current size of the window is in bounds */
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
if (rect.right < geometry->min_width
&& rect.bottom < geometry->min_height)
gdk_window_resize (window, geometry->min_width, geometry->min_height);
@@ -1362,14 +1311,14 @@ gdk_window_set_geometry_hints (GdkWindow *window,
rect.top = 0;
rect.right = geometry->max_width;
rect.bottom = geometry->max_height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
private->hint_max_width = rect.right - rect.left;
private->hint_max_height = rect.bottom - rect.top;
/* Again, check if the window is too large currently. */
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
if (rect.right > geometry->max_width
&& rect.bottom > geometry->max_height)
gdk_window_resize (window, geometry->max_width, geometry->max_height);
@@ -1383,7 +1332,7 @@ gdk_window_set_geometry_hints (GdkWindow *window,
if (geom_mask & GDK_HINT_BASE_SIZE
&& geometry->base_width > 0
&& geometry->base_height > 0)
- if (!GetWindowPlacement (private->xwindow, &size_hints))
+ if (!GetWindowPlacement (private->drawable.xwindow, &size_hints))
g_warning ("gdk_window_set_hints: GetWindowPlacement failed");
else
{
@@ -1402,7 +1351,7 @@ gdk_window_set_geometry_hints (GdkWindow *window,
size_hints.rcNormalPosition.top,
size_hints.rcNormalPosition.right,
size_hints.rcNormalPosition.bottom));
- if (!SetWindowPlacement (private->xwindow, &size_hints))
+ if (!SetWindowPlacement (private->drawable.xwindow, &size_hints))
g_warning ("gdk_window_set_hints: SetWindowPlacement failed");
}
@@ -1421,16 +1370,14 @@ void
gdk_window_set_title (GdkWindow *window,
const gchar *title)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
GDK_NOTE (MISC, g_print ("gdk_window_set_title: %#x %s\n",
- private->xwindow, title));
- if (!private->destroyed)
+ GDK_DRAWABLE_XID (window), title));
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- if (!SetWindowText (private->xwindow, title))
+ if (!SetWindowText (GDK_DRAWABLE_XID (window), title))
g_warning ("gdk_window_set_title: SetWindowText failed");
}
}
@@ -1439,14 +1386,11 @@ void
gdk_window_set_role (GdkWindow *window,
const gchar *role)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
GDK_NOTE (MISC, g_print ("gdk_window_set_role: %#x %s\n",
- private->xwindow, (role ? role : "NULL")));
+ GDK_DRAWABLE_XID (window), (role ? role : "NULL")));
/* XXX */
}
@@ -1454,16 +1398,12 @@ void
gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
- GdkWindowPrivate *private;
- GdkWindowPrivate *parent_private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- parent_private = (GdkWindowPrivate*) parent;
-
GDK_NOTE (MISC, g_print ("gdk_window_set_transient_for: %#x %#x\n",
- private->xwindow, parent_private->xwindow));
+ GDK_DRAWABLE_XID (window),
+ GDK_DRAWABLE_XID (parent)));
/* XXX */
}
@@ -1474,15 +1414,13 @@ gdk_window_set_background (GdkWindow *window,
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- GdkColormapPrivate *colormap_private =
- (GdkColormapPrivate *) private->colormap;
-
GDK_NOTE (MISC, g_print ("gdk_window_set_background: %#x %s\n",
- private->xwindow,
+ private->drawable.xwindow,
gdk_color_to_string (color)));
if (private->bg_type == GDK_WIN32_BG_PIXMAP)
@@ -1504,28 +1442,27 @@ gdk_window_set_back_pixmap (GdkWindow *window,
GdkPixmap *pixmap,
gint parent_relative)
{
- GdkWindowPrivate *window_private;
+ GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- window_private = (GdkWindowPrivate*) window;
+ private = (GdkWindowPrivate*) window;
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- GdkColormapPrivate *colormap_private =
- (GdkColormapPrivate *) window_private->colormap;
- if (window_private->bg_type == GDK_WIN32_BG_PIXMAP)
+ if (private->bg_type == GDK_WIN32_BG_PIXMAP)
{
- if (window_private->bg_pixmap != NULL)
+ if (private->bg_pixmap != NULL)
{
- gdk_pixmap_unref (window_private->bg_pixmap);
- window_private->bg_pixmap = NULL;
+ gdk_pixmap_unref (private->bg_pixmap);
+ private->bg_pixmap = NULL;
}
- window_private->bg_type = GDK_WIN32_BG_NORMAL;
+ private->bg_type = GDK_WIN32_BG_NORMAL;
}
if (parent_relative)
{
- window_private->bg_type = GDK_WIN32_BG_PARENT_RELATIVE;
+ private->bg_type = GDK_WIN32_BG_PARENT_RELATIVE;
}
else if (!pixmap)
{
@@ -1536,8 +1473,8 @@ gdk_window_set_back_pixmap (GdkWindow *window,
/* We must cache the pixmap in the WindowPrivate and
* paint it each time we get WM_ERASEBKGND
*/
- window_private->bg_type = GDK_WIN32_BG_PIXMAP;
- window_private->bg_pixmap = pixmap;
+ private->bg_type = GDK_WIN32_BG_PIXMAP;
+ private->bg_pixmap = pixmap;
gdk_pixmap_ref (pixmap);
}
}
@@ -1552,11 +1489,12 @@ gdk_window_set_cursor (GdkWindow *window,
HCURSOR xcursor;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
window_private = (GdkWindowPrivate*) window;
cursor_private = (GdkCursorPrivate*) cursor;
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
if (!cursor)
xcursor = LoadCursor (NULL, IDC_ARROW);
@@ -1564,38 +1502,8 @@ gdk_window_set_cursor (GdkWindow *window,
xcursor = cursor_private->xcursor;
GDK_NOTE (MISC, g_print ("gdk_window_set_cursor: %#x %#x\n",
- window_private->xwindow, xcursor));
+ window_private->drawable.xwindow, xcursor));
window_private->xcursor = xcursor;
- SetCursor (xcursor);
- }
-}
-
-void
-gdk_window_set_colormap (GdkWindow *window,
- GdkColormap *colormap)
-{
- GdkWindowPrivate *window_private;
- GdkColormapPrivate *colormap_private;
-
- g_return_if_fail (window != NULL);
- g_return_if_fail (colormap != NULL);
-
- window_private = (GdkWindowPrivate*) window;
- colormap_private = (GdkColormapPrivate*) colormap;
-
- if (!window_private->destroyed)
- {
- /* XXX ??? */
- GDK_NOTE (MISC, g_print ("gdk_window_set_colormap: %#x %#x\n",
- window_private->xwindow,
- colormap_private->xcolormap));
- if (window_private->colormap)
- gdk_colormap_unref (window_private->colormap);
- window_private->colormap = colormap;
- gdk_colormap_ref (window_private->colormap);
-
- if (window_private->window_type != GDK_WINDOW_TOPLEVEL)
- gdk_window_add_colormap_windows (window);
}
}
@@ -1616,18 +1524,16 @@ gdk_window_get_geometry (GdkWindow *window,
gint *height,
gint *depth)
{
- GdkWindowPrivate *window_private;
+ g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
if (!window)
window = (GdkWindow*) &gdk_root_parent;
- window_private = (GdkWindowPrivate*) window;
-
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
RECT rect;
- if (!GetClientRect (window_private->xwindow, &rect))
+ if (!GetClientRect (GDK_DRAWABLE_XID (window), &rect))
g_warning ("gdk_window_get_geometry: GetClientRect failed");
if (x)
@@ -1639,7 +1545,7 @@ gdk_window_get_geometry (GdkWindow *window,
if (height)
*height = rect.bottom - rect.top;
if (depth)
- *depth = gdk_window_get_visual (window)->depth;
+ *depth = gdk_drawable_get_visual (window)->depth;
}
}
@@ -1651,6 +1557,7 @@ gdk_window_get_position (GdkWindow *window,
GdkWindowPrivate *window_private;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
window_private = (GdkWindowPrivate*) window;
@@ -1660,100 +1567,24 @@ gdk_window_get_position (GdkWindow *window,
*y = window_private->y;
}
-void
-gdk_window_get_size (GdkWindow *window,
- gint *width,
- gint *height)
-{
- GdkWindowPrivate *window_private;
-
- g_return_if_fail (window != NULL);
-
- window_private = (GdkWindowPrivate*) window;
-
- if (width)
- *width = window_private->width;
- if (height)
- *height = window_private->height;
-}
-
-GdkVisual*
-gdk_window_get_visual (GdkWindow *window)
-{
- GdkWindowPrivate *window_private;
-
- g_return_val_if_fail (window != NULL, NULL);
-
- window_private = (GdkWindowPrivate*) window;
- /* Huh? ->parent is never set for a pixmap. We should just return
- * null immeditately. Well, do it then!
- */
- if (window_private->window_type == GDK_WINDOW_PIXMAP)
- return NULL;
-
- if (!window_private->destroyed)
- {
- if (window_private->colormap == NULL)
- return gdk_visual_get_system (); /* XXX ??? */
- else
- return ((GdkColormapPrivate *)window_private->colormap)->visual;
- }
-
- return NULL;
-}
-
-GdkColormap*
-gdk_window_get_colormap (GdkWindow *window)
-{
- GdkWindowPrivate *window_private;
-
- g_return_val_if_fail (window != NULL, NULL);
- window_private = (GdkWindowPrivate*) window;
-
- g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL);
- if (!window_private->destroyed)
- {
- if (window_private->colormap == NULL)
- return gdk_colormap_get_system (); /* XXX ??? */
- else
- return window_private->colormap;
- }
-
- return NULL;
-}
-
-GdkWindowType
-gdk_window_get_type (GdkWindow *window)
-{
- GdkWindowPrivate *window_private;
-
- g_return_val_if_fail (window != NULL, (GdkWindowType) -1);
-
- window_private = (GdkWindowPrivate*) window;
- return window_private->window_type;
-}
-
gint
gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y)
{
- GdkWindowPrivate *private;
gint return_val;
gint tx = 0;
gint ty = 0;
g_return_val_if_fail (window != NULL, 0);
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
POINT pt;
pt.x = 0;
pt.y = 0;
- ClientToScreen (private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
tx = pt.x;
ty = pt.y;
return_val = 1;
@@ -1767,7 +1598,7 @@ gdk_window_get_origin (GdkWindow *window,
*y = ty;
GDK_NOTE (MISC, g_print ("gdk_window_get_origin: %#x: +%d+%d\n",
- private->xwindow, tx, ty));
+ GDK_DRAWABLE_XID (window), tx, ty));
return return_val;
}
@@ -1788,31 +1619,32 @@ gdk_window_get_root_origin (GdkWindow *window,
POINT pt;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
if (x)
*x = 0;
if (y)
*y = 0;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
while (private->parent && ((GdkWindowPrivate*) private->parent)->parent)
private = (GdkWindowPrivate*) private->parent;
- if (private->destroyed)
+ if (private->drawable.destroyed)
return;
pt.x = 0;
pt.y = 0;
- ClientToScreen (private->xwindow, &pt);
+ ClientToScreen (private->drawable.xwindow, &pt);
if (x)
*x = pt.x;
if (y)
*y = pt.y;
GDK_NOTE (MISC, g_print ("gdk_window_get_root_origin: %#x: (%#x) +%d+%d\n",
- ((GdkWindowPrivate *) window)->xwindow,
- private->xwindow, pt.x, pt.y));
+ GDK_DRAWABLE_XID (window),
+ private->drawable.xwindow, pt.x, pt.y));
}
GdkWindow*
@@ -1821,20 +1653,19 @@ gdk_window_get_pointer (GdkWindow *window,
gint *y,
GdkModifierType *mask)
{
- GdkWindowPrivate *private;
GdkWindow *return_val;
POINT pointc, point;
HWND hwnd, hwndc;
+ g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
+
if (!window)
window = (GdkWindow*) &gdk_root_parent;
- private = (GdkWindowPrivate*) window;
-
return_val = NULL;
GetCursorPos (&pointc);
point = pointc;
- ScreenToClient (private->xwindow, &point);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &point);
if (x)
*x = point.x;
@@ -1882,14 +1713,11 @@ GdkWindow*
gdk_window_at_pointer (gint *win_x,
gint *win_y)
{
- GdkWindowPrivate *private;
GdkWindow *window;
POINT point, pointc;
HWND hwnd, hwndc;
RECT rect;
- private = &gdk_root_parent;
-
GetCursorPos (&pointc);
point = pointc;
hwnd = WindowFromPoint (point);
@@ -1934,6 +1762,7 @@ GdkWindow*
gdk_window_get_parent (GdkWindow *window)
{
g_return_val_if_fail (window != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
return ((GdkWindowPrivate*) window)->parent;
}
@@ -1941,17 +1770,11 @@ gdk_window_get_parent (GdkWindow *window)
GdkWindow*
gdk_window_get_toplevel (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_val_if_fail (window != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowPrivate*) window;
-
- while (private->window_type == GDK_WINDOW_CHILD)
- {
- window = ((GdkWindowPrivate*) window)->parent;
- private = (GdkWindowPrivate*) window;
- }
+ while (GDK_DRAWABLE_TYPE (window) == GDK_WINDOW_CHILD)
+ window = ((GdkWindowPrivate*) window)->parent;
return window;
}
@@ -1963,13 +1786,13 @@ gdk_window_get_children (GdkWindow *window)
GList *children;
g_return_val_if_fail (window != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
/* XXX ??? */
- g_warning ("gdk_window_get_children ???");
+ g_warning ("gdk_window_get_children not implemented");
children = NULL;
return children;
@@ -1981,9 +1804,10 @@ gdk_window_get_events (GdkWindow *window)
GdkWindowPrivate *private;
g_return_val_if_fail (window != NULL, 0);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return 0;
return private->event_mask;
@@ -1996,9 +1820,10 @@ gdk_window_set_events (GdkWindow *window,
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
private->event_mask = event_mask;
@@ -2007,65 +1832,57 @@ gdk_window_set_events (GdkWindow *window,
void
gdk_window_add_colormap_windows (GdkWindow *window)
{
- g_warning ("gdk_window_add_colormap_windows not implemented"); /* XXX */
+ g_warning ("gdk_window_add_colormap_windows not implemented");
}
-/*
- * This needs the X11 shape extension.
- * If not available, shaped windows will look
- * ugly, but programs still work. Stefan Wille
- */
void
gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask,
gint x, gint y)
{
- GdkWindowPrivate *window_private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- window_private = (GdkWindowPrivate*) window;
-
if (!mask)
{
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %#x none\n",
- window_private->xwindow));
- SetWindowRgn (window_private->xwindow, NULL, TRUE);
+ GDK_DRAWABLE_XID (window)));
+ SetWindowRgn (GDK_DRAWABLE_XID (window), NULL, TRUE);
}
else
{
- GdkPixmapPrivate *pixmap_private;
+ GdkDrawablePrivate *pixmap_private;
HRGN hrgn;
DWORD dwStyle;
DWORD dwExStyle;
RECT rect;
/* Convert mask bitmap to region */
- pixmap_private = (GdkPixmapPrivate*) mask;
+ pixmap_private = (GdkDrawablePrivate*) mask;
hrgn = BitmapToRegion (pixmap_private->xwindow);
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %#x %#x\n",
- window_private->xwindow,
+ GDK_DRAWABLE_XID (window),
pixmap_private->xwindow));
/* SetWindowRgn wants window (not client) coordinates */
- dwStyle = GetWindowLong (window_private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (window_private->xwindow, GWL_EXSTYLE);
- GetClientRect (window_private->xwindow, &rect);
+ dwStyle = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE);
+ dwExStyle = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_EXSTYLE);
+ GetClientRect (GDK_DRAWABLE_XID (window), &rect);
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 */
- if (window_private->window_type == GDK_WINDOW_TOPLEVEL)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_WINDOW_TOPLEVEL)
{
CombineRgn (hrgn, hrgn,
CreateRectRgn (0, 0, rect.right - rect.left, -rect.top),
RGN_OR);
}
- SetWindowRgn (window_private->xwindow, hrgn, TRUE);
+ SetWindowRgn (GDK_DRAWABLE_XID (window), hrgn, TRUE);
}
}
@@ -2077,16 +1894,19 @@ gdk_window_add_filter (GdkWindow *window,
GdkWindowPrivate *private;
GList *tmp_list;
GdkEventFilter *filter;
+
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
- if (private && private->destroyed)
+ if (private && GDK_DRAWABLE_DESTROYED (window))
return;
-
+
if (private)
tmp_list = private->filters;
else
tmp_list = gdk_default_filters;
-
+
while (tmp_list)
{
filter = (GdkEventFilter *)tmp_list->data;
@@ -2094,11 +1914,11 @@ gdk_window_add_filter (GdkWindow *window,
return;
tmp_list = tmp_list->next;
}
-
+
filter = g_new (GdkEventFilter, 1);
filter->function = function;
filter->data = data;
-
+
if (private)
private->filters = g_list_append (private->filters, filter);
else
@@ -2113,26 +1933,29 @@ gdk_window_remove_filter (GdkWindow *window,
GdkWindowPrivate *private;
GList *tmp_list, *node;
GdkEventFilter *filter;
+
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
-
- if(private)
+
+ if (private)
tmp_list = private->filters;
else
tmp_list = gdk_default_filters;
-
+
while (tmp_list)
{
filter = (GdkEventFilter *)tmp_list->data;
node = tmp_list;
tmp_list = tmp_list->next;
-
+
if ((filter->function == function) && (filter->data == data))
{
- if(private)
+ if (private)
private->filters = g_list_remove_link (private->filters, node);
else
- gdk_default_filters = g_list_remove_link (gdk_default_filters, tmp_list);
+ gdk_default_filters = g_list_remove_link (gdk_default_filters, node);
g_list_free_1 (node);
g_free (filter);
@@ -2145,7 +1968,10 @@ void
gdk_window_set_override_redirect (GdkWindow *window,
gboolean override_redirect)
{
- g_warning ("gdk_window_set_override_redirect not implemented"); /* XXX */
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ g_warning ("gdk_window_set_override_redirect not implemented");
}
void
@@ -2154,21 +1980,26 @@ gdk_window_set_icon (GdkWindow *window,
GdkPixmap *pixmap,
GdkBitmap *mask)
{
- g_warning ("gdk_window_set_icon not implemented"); /* XXX */
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ if (GDK_DRAWABLE_DESTROYED (window))
+ return;
+
+ g_warning ("gdk_window_set_icon not implemented");
}
-void
+void
gdk_window_set_icon_name (GdkWindow *window,
gchar *name)
{
- GdkWindowPrivate *window_private;
-
g_return_if_fail (window != NULL);
- window_private = (GdkWindowPrivate*) window;
- if (window_private->destroyed)
- return;
+ g_return_if_fail (GDK_IS_WINDOW (window));
- if (!SetWindowText (window_private->xwindow, name))
+ if (GDK_DRAWABLE_DESTROYED (window))
+ return;
+
+ if (!SetWindowText (GDK_DRAWABLE_XID (window), name))
g_warning ("gdk_window_set_icon_name: SetWindowText failed");
}
@@ -2176,18 +2007,28 @@ void
gdk_window_set_group (GdkWindow *window,
GdkWindow *leader)
{
- g_warning ("gdk_window_set_group not implemented"); /* XXX */
+ 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));
+
+ if (GDK_DRAWABLE_DESTROYED (window) || GDK_DRAWABLE_DESTROYED (leader))
+ return;
+
+ g_warning ("gdk_window_set_group not implemented");
}
void
gdk_window_set_decorations (GdkWindow *window,
GdkWMDecoration decorations)
{
- GdkWindowPrivate *window_private = (GdkWindowPrivate *) window;
LONG style, exstyle;
- style = GetWindowLong (window_private->xwindow, GWL_STYLE);
- exstyle = GetWindowLong (window_private->xwindow, GWL_EXSTYLE);
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ style = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE);
+ exstyle = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_EXSTYLE);
style &= (WS_OVERLAPPED|WS_POPUP|WS_CHILD|WS_MINIMIZE|WS_VISIBLE|WS_DISABLED
|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZE);
@@ -2209,18 +2050,20 @@ gdk_window_set_decorations (GdkWindow *window,
if (decorations & GDK_DECOR_MAXIMIZE)
style |= (WS_MAXIMIZEBOX);
- SetWindowLong (window_private->xwindow, GWL_STYLE, style);
+ SetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE, style);
}
void
gdk_window_set_functions (GdkWindow *window,
GdkWMFunction functions)
{
- GdkWindowPrivate *window_private = (GdkWindowPrivate *) window;
LONG style, exstyle;
- style = GetWindowLong (window_private->xwindow, GWL_STYLE);
- exstyle = GetWindowLong (window_private->xwindow, GWL_EXSTYLE);
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ style = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE);
+ exstyle = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_EXSTYLE);
style &= (WS_OVERLAPPED|WS_POPUP|WS_CHILD|WS_MINIMIZE|WS_VISIBLE|WS_DISABLED
|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZE|WS_CAPTION|WS_BORDER
@@ -2239,7 +2082,7 @@ gdk_window_set_functions (GdkWindow *window,
if (functions & GDK_FUNC_MAXIMIZE)
style |= (WS_MAXIMIZEBOX);
- SetWindowLong (window_private->xwindow, GWL_STYLE, style);
+ SetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE, style);
}
GList *
@@ -2339,29 +2182,25 @@ gdk_propagate_shapes (HANDLE win,
void
gdk_window_set_child_shapes (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
- gdk_propagate_shapes ( private->xwindow, FALSE);
+ gdk_propagate_shapes (GDK_DRAWABLE_XID (window), FALSE);
}
void
gdk_window_merge_child_shapes (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
- gdk_propagate_shapes (private->xwindow, TRUE);
+ gdk_propagate_shapes (GDK_DRAWABLE_XID (window), TRUE);
}
/*************************************************************
@@ -2379,6 +2218,7 @@ gdk_window_is_visible (GdkWindow *window)
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_val_if_fail (window != NULL, FALSE);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
return private->mapped;
}
@@ -2401,10 +2241,11 @@ gdk_window_is_viewable (GdkWindow *window)
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_val_if_fail (window != NULL, FALSE);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
while (private &&
(private != &gdk_root_parent) &&
- (private->window_type != GDK_WINDOW_FOREIGN))
+ (private->drawable.window_type != GDK_WINDOW_FOREIGN))
{
if (!private->mapped)
return FALSE;
@@ -2415,16 +2256,6 @@ gdk_window_is_viewable (GdkWindow *window)
return TRUE;
}
-void
-gdk_drawable_set_data (GdkDrawable *drawable,
- const gchar *key,
- gpointer data,
- GDestroyNotify destroy_func)
-{
- g_dataset_set_data_full (drawable, key, data, destroy_func);
-}
-
-
/* Support for windows that can be guffaw-scrolled
* (See http://www.gtk.org/~otaylor/whitepapers/guffaw-scrolling.txt)
*/
@@ -2434,7 +2265,7 @@ gdk_window_gravity_works (void)
{
enum { UNKNOWN, NO, YES };
static gint gravity_works = UNKNOWN;
-
+
if (gravity_works == UNKNOWN)
{
GdkWindowAttr attr;
@@ -2454,7 +2285,7 @@ gdk_window_gravity_works (void)
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);
@@ -2469,29 +2300,24 @@ gdk_window_gravity_works (void)
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)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *)window;
-
g_return_if_fail (window != NULL);
- GDK_NOTE (MISC,
- g_print ("gdk_window_set_static_bit_gravity: Not implemented\n"));
+ 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)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *)window;
-
g_return_if_fail (window != NULL);
GDK_NOTE (MISC,
@@ -2516,26 +2342,30 @@ gdk_window_set_static_gravities (GdkWindow *window,
{
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
GList *tmp_list;
-
- g_return_val_if_fail (window != NULL, FALSE);
+ 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;
-
- gdk_window_set_static_bit_gravity (window, use_static);
-
- tmp_list = private->children;
- while (tmp_list)
+
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- gdk_window_set_static_win_gravity (window, use_static);
+ gdk_window_set_static_bit_gravity (window, use_static);
- tmp_list = tmp_list->next;
+ tmp_list = private->children;
+ while (tmp_list)
+ {
+ gdk_window_set_static_win_gravity (window, use_static);
+
+ tmp_list = tmp_list->next;
+ }
}
-
+
return TRUE;
}
diff --git a/gdk/win32/gdkwindow.c b/gdk/win32/gdkwindow.c
index a78469f123..d76694dbaa 100644
--- a/gdk/win32/gdkwindow.c
+++ b/gdk/win32/gdkwindow.c
@@ -35,6 +35,7 @@
#include "gdkwindow.h"
#include "gdkprivate.h"
#include "gdkinputprivate.h"
+#include "gdkx.h"
/* The Win API function AdjustWindowRect may return negative values
* resulting in obscured title bars. This helper function is coreccting it.
@@ -117,14 +118,14 @@ gdk_window_init (void)
}
#endif
- gdk_root_parent.xwindow = gdk_root_window;
- gdk_root_parent.window_type = GDK_WINDOW_ROOT;
- gdk_root_parent.window.user_data = NULL;
- gdk_root_parent.width = width;
- gdk_root_parent.height = height;
+ gdk_root_parent.drawable.xwindow = gdk_root_window;
+ gdk_root_parent.drawable.window_type = GDK_WINDOW_ROOT;
+ gdk_root_parent.drawable.drawable.user_data = NULL;
+ gdk_root_parent.drawable.width = width;
+ gdk_root_parent.drawable.height = height;
+ gdk_root_parent.drawable.ref_count = 1;
+ gdk_root_parent.drawable.colormap = NULL;
gdk_root_parent.children = NULL;
- gdk_root_parent.colormap = NULL;
- gdk_root_parent.ref_count = 1;
gdk_xid_table_insert (&gdk_root_window, &gdk_root_parent);
}
@@ -234,8 +235,8 @@ RegisterGdkClass(GdkWindowType wtype)
case GDK_WINDOW_ROOT:
g_error ("cannot make windows of type GDK_WINDOW_ROOT");
break;
- case GDK_WINDOW_PIXMAP:
- g_error ("cannot make windows of type GDK_WINDOW_PIXMAP (use gdk_pixmap_new)");
+ case GDK_DRAWABLE_PIXMAP:
+ g_error ("cannot make windows of type GDK_DRAWABLE_PIXMAP (use gdk_pixmap_new)");
break;
}
@@ -267,28 +268,28 @@ gdk_window_new (GdkWindow *parent,
parent = (GdkWindow*) &gdk_root_parent;
parent_private = (GdkWindowPrivate*) parent;
- if (parent_private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (parent))
return NULL;
- xparent = parent_private->xwindow;
+ xparent = parent_private->drawable.xwindow;
private = g_new (GdkWindowPrivate, 1);
window = (GdkWindow*) private;
private->parent = parent;
- private->destroyed = FALSE;
+ private->drawable.destroyed = FALSE;
private->mapped = FALSE;
private->guffaw_gravity = FALSE;
private->resize_count = 0;
- private->ref_count = 1;
+ private->drawable.ref_count = 1;
private->x = (attributes_mask & GDK_WA_X) ? attributes->x : 0;
private->y = (attributes_mask & GDK_WA_Y) ? attributes->y : 0;
- private->width = (attributes->width > 1) ? (attributes->width) : (1);
- private->height = (attributes->height > 1) ? (attributes->height) : (1);
- private->window_type = attributes->window_type;
+ private->drawable.width = (attributes->width > 1) ? (attributes->width) : (1);
+ private->drawable.height = (attributes->height > 1) ? (attributes->height) : (1);
+ private->drawable.window_type = attributes->window_type;
private->extension_events = 0;
private->extension_events_selected = FALSE;
@@ -322,14 +323,14 @@ gdk_window_new (GdkWindow *parent,
{
dwExStyle = 0;
if (attributes_mask & GDK_WA_COLORMAP)
- private->colormap = attributes->colormap;
+ private->drawable.colormap = attributes->colormap;
else
- private->colormap = gdk_colormap_get_system ();
+ private->drawable.colormap = gdk_colormap_get_system ();
}
else
{
dwExStyle = WS_EX_TRANSPARENT;
- private->colormap = NULL;
+ private->drawable.colormap = NULL;
private->bg_type = GDK_WIN32_BG_TRANSPARENT;
private->bg_pixmap = NULL;
}
@@ -349,7 +350,7 @@ gdk_window_new (GdkWindow *parent,
if (parent_private)
parent_private->children = g_list_prepend (parent_private->children, window);
- switch (private->window_type)
+ switch (private->drawable.window_type)
{
case GDK_WINDOW_TOPLEVEL:
dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN;
@@ -370,16 +371,16 @@ gdk_window_new (GdkWindow *parent,
case GDK_WINDOW_ROOT:
g_error ("cannot make windows of type GDK_WINDOW_ROOT");
break;
- case GDK_WINDOW_PIXMAP:
- g_error ("cannot make windows of type GDK_WINDOW_PIXMAP (use gdk_pixmap_new)");
+ case GDK_DRAWABLE_PIXMAP:
+ g_error ("cannot make windows of type GDK_DRAWABLE_PIXMAP (use gdk_pixmap_new)");
break;
}
- klass = RegisterGdkClass (private->window_type);
+ klass = RegisterGdkClass (private->drawable.window_type);
if (!klass)
g_error ("RegisterClassEx failed");
- if (private->window_type != GDK_WINDOW_CHILD)
+ if (private->drawable.window_type != GDK_WINDOW_CHILD)
{
if (x == CW_USEDEFAULT)
{
@@ -392,8 +393,8 @@ gdk_window_new (GdkWindow *parent,
rect.top = y;
}
- rect.right = rect.left + private->width;
- rect.bottom = rect.top + private->height;
+ rect.right = rect.left + private->drawable.width;
+ rect.bottom = rect.top + private->drawable.height;
if (!SafeAdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
g_warning ("gdk_window_new: AdjustWindowRectEx failed");
@@ -408,11 +409,11 @@ gdk_window_new (GdkWindow *parent,
}
else
{
- width = private->width;
- height = private->height;
+ width = private->drawable.width;
+ height = private->drawable.height;
}
- private->xwindow =
+ private->drawable.xwindow =
CreateWindowEx (dwExStyle,
MAKEINTRESOURCE(klass),
title,
@@ -425,23 +426,23 @@ gdk_window_new (GdkWindow *parent,
NULL);
GDK_NOTE (MISC,
g_print ("gdk_window_create: %s %s %#x %#x %dx%d@+%d+%d %#x = %#x\n",
- (private->window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
- (private->window_type == GDK_WINDOW_CHILD ? "CHILD" :
- (private->window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
- (private->window_type == GDK_WINDOW_TEMP ? "TEMP" :
+ (private->drawable.window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
+ (private->drawable.window_type == GDK_WINDOW_CHILD ? "CHILD" :
+ (private->drawable.window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
+ (private->drawable.window_type == GDK_WINDOW_TEMP ? "TEMP" :
"???")))),
title,
dwStyle,
private->event_mask,
width, height, (x == CW_USEDEFAULT ? -9999 : x), y,
xparent,
- private->xwindow));
+ private->drawable.xwindow));
gdk_window_ref (window);
- gdk_xid_table_insert (&private->xwindow, window);
+ gdk_xid_table_insert (&private->drawable.xwindow, window);
- if (private->colormap)
- gdk_colormap_ref (private->colormap);
+ if (private->drawable.colormap)
+ gdk_colormap_ref (private->drawable.colormap);
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
(attributes->cursor) :
@@ -471,7 +472,7 @@ gdk_window_foreign_new (guint32 anid)
if (parent_private)
parent_private->children = g_list_prepend (parent_private->children, window);
- private->xwindow = (HWND) anid;
+ private->drawable.xwindow = (HWND) anid;
GetClientRect ((HWND) anid, &rect);
point.x = rect.left;
point.y = rect.right;
@@ -480,18 +481,18 @@ gdk_window_foreign_new (guint32 anid)
ScreenToClient (parent, &point);
private->x = point.x;
private->y = point.y;
- private->width = rect.right - rect.left;
- private->height = rect.bottom - rect.top;
+ private->drawable.width = rect.right - rect.left;
+ private->drawable.height = rect.bottom - rect.top;
private->resize_count = 0;
- private->ref_count = 1;
- private->window_type = GDK_WINDOW_FOREIGN;
- private->destroyed = FALSE;
- private->mapped = IsWindowVisible (private->xwindow);
+ private->drawable.ref_count = 1;
+ private->drawable.window_type = GDK_WINDOW_FOREIGN;
+ private->drawable.destroyed = FALSE;
+ private->mapped = IsWindowVisible (private->drawable.xwindow);
private->guffaw_gravity = FALSE;
private->extension_events = 0;
private->extension_events_selected = FALSE;
- private->colormap = NULL;
+ private->drawable.colormap = NULL;
private->filters = NULL;
private->children = NULL;
@@ -499,7 +500,7 @@ gdk_window_foreign_new (guint32 anid)
window->user_data = NULL;
gdk_window_ref (window);
- gdk_xid_table_insert (&private->xwindow, window);
+ gdk_xid_table_insert (&private->drawable.xwindow, window);
return window;
}
@@ -526,16 +527,16 @@ gdk_window_internal_destroy (GdkWindow *window,
private = (GdkWindowPrivate*) window;
GDK_NOTE (MISC, g_print ("gdk_window_internal_destroy %#x\n",
- private->xwindow));
+ private->drawable.xwindow));
- switch (private->window_type)
+ switch (private->drawable.window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_CHILD:
case GDK_WINDOW_DIALOG:
case GDK_WINDOW_TEMP:
case GDK_WINDOW_FOREIGN:
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
if (private->parent)
{
@@ -544,7 +545,7 @@ gdk_window_internal_destroy (GdkWindow *window,
parent_private->children = g_list_remove (parent_private->children, window);
}
- if (private->window_type != GDK_WINDOW_FOREIGN)
+ if (GDK_DRAWABLE_TYPE (window) != GDK_WINDOW_FOREIGN)
{
children = tmp = private->children;
private->children = NULL;
@@ -580,7 +581,7 @@ gdk_window_internal_destroy (GdkWindow *window,
private->filters = NULL;
}
- if (private->window_type == GDK_WINDOW_FOREIGN)
+ if (private->drawable.window_type == GDK_WINDOW_FOREIGN)
{
if (our_destroy && (private->parent != NULL))
{
@@ -596,17 +597,17 @@ gdk_window_internal_destroy (GdkWindow *window,
* OTOH, I don't think foreign windows are much
* used, so the question is maybe academic.
*/
- PostMessage (private->xwindow, WM_QUIT, 0, 0);
+ PostMessage (private->drawable.xwindow, WM_QUIT, 0, 0);
}
}
else if (xdestroy)
- DestroyWindow (private->xwindow);
+ DestroyWindow (private->drawable.xwindow);
- if (private->colormap)
- gdk_colormap_unref (private->colormap);
+ if (private->drawable.colormap)
+ gdk_colormap_unref (private->drawable.colormap);
private->mapped = FALSE;
- private->destroyed = TRUE;
+ private->drawable.destroyed = TRUE;
}
break;
@@ -614,7 +615,7 @@ gdk_window_internal_destroy (GdkWindow *window,
g_error ("attempted to destroy root window");
break;
- case GDK_WINDOW_PIXMAP:
+ case GDK_DRAWABLE_PIXMAP:
g_error ("called gdk_window_destroy on a pixmap (use gdk_pixmap_unref)");
break;
}
@@ -635,24 +636,20 @@ gdk_window_destroy (GdkWindow *window)
void
gdk_window_destroy_notify (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
- private = (GdkWindowPrivate*) window;
-
GDK_NOTE (EVENTS, g_print ("gdk_window_destroy_notify: %#x %d\n",
- private->xwindow, private->destroyed));
+ GDK_DRAWABLE_XID (window), GDK_DRAWABLE_DESTROYED (window)));
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- if (private->window_type == GDK_WINDOW_FOREIGN)
- gdk_window_internal_destroy (window, FALSE, FALSE);
- else
- g_warning ("GdkWindow %#lx unexpectedly destroyed", private->xwindow);
+ if (GDK_DRAWABLE_TYPE(window) != GDK_WINDOW_FOREIGN)
+ g_warning ("GdkWindow %#lx unexpectedly destroyed", GDK_DRAWABLE_XID (window));
+
+ gdk_window_internal_destroy (window, FALSE, FALSE);
}
- gdk_xid_table_remove (private->xwindow);
+ gdk_xid_table_remove (GDK_DRAWABLE_XID (window));
gdk_window_unref (window);
}
@@ -661,11 +658,12 @@ gdk_window_ref (GdkWindow *window)
{
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_val_if_fail (window != NULL, NULL);
-
- private->ref_count += 1;
+
+ private->drawable.ref_count += 1;
GDK_NOTE (MISC, g_print ("gdk_window_ref %#x %d\n",
- private->xwindow, private->ref_count));
+ GDK_DRAWABLE_XID (window),
+ private->drawable.ref_count));
return window;
}
@@ -676,21 +674,23 @@ gdk_window_unref (GdkWindow *window)
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
- private->ref_count -= 1;
+ private->drawable.ref_count -= 1;
GDK_NOTE (MISC, g_print ("gdk_window_unref %#x %d%s\n",
- private->xwindow, private->ref_count,
- (private->ref_count == 0 ? " freeing" : "")));
+ private->drawable.xwindow,
+ private->drawable.ref_count,
+ (private->drawable.ref_count == 0 ? " freeing" : "")));
- if (private->ref_count == 0)
+ if (private->drawable.ref_count == 0)
{
- if (private->bg_type == GDK_WIN32_BG_PIXMAP && private->bg_pixmap != NULL)
+ if (private->bg_type == GDK_WIN32_BG_PIXMAP
+ && private->bg_pixmap != NULL)
gdk_pixmap_unref (private->bg_pixmap);
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
- if (private->window_type == GDK_WINDOW_FOREIGN)
- gdk_xid_table_remove (private->xwindow);
+ if (private->drawable.window_type == GDK_WINDOW_FOREIGN)
+ gdk_xid_table_remove (private->drawable.xwindow);
else
g_warning ("losing last reference to undestroyed window");
}
@@ -707,27 +707,28 @@ gdk_window_show (GdkWindow *window)
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
- GDK_NOTE (MISC, g_print ("gdk_window_show: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_show: %#x\n",
+ private->drawable.xwindow));
private->mapped = TRUE;
- if (private->window_type == GDK_WINDOW_TEMP)
+ if (private->drawable.window_type == GDK_WINDOW_TEMP)
{
- ShowWindow (private->xwindow, SW_SHOWNOACTIVATE);
- SetWindowPos (private->xwindow, HWND_TOPMOST, 0, 0, 0, 0,
+ ShowWindow (private->drawable.xwindow, SW_SHOWNOACTIVATE);
+ SetWindowPos (private->drawable.xwindow, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
#if 0
- ShowWindow (private->xwindow, SW_HIDE); /* Don't put on toolbar */
+ ShowWindow (private->drawable.xwindow, SW_HIDE); /* Don't put on toolbar */
#endif
}
else
{
- ShowWindow (private->xwindow, SW_SHOWNORMAL);
- ShowWindow (private->xwindow, SW_RESTORE);
- SetForegroundWindow (private->xwindow);
+ ShowWindow (private->drawable.xwindow, SW_SHOWNORMAL);
+ ShowWindow (private->drawable.xwindow, SW_RESTORE);
+ SetForegroundWindow (private->drawable.xwindow);
#if 0
- ShowOwnedPopups (private->xwindow, TRUE);
+ ShowOwnedPopups (private->drawable.xwindow, TRUE);
#endif
}
}
@@ -741,19 +742,20 @@ gdk_window_hide (GdkWindow *window)
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
- GDK_NOTE (MISC, g_print ("gdk_window_hide: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_hide: %#x\n",
+ private->drawable.xwindow));
private->mapped = FALSE;
- if (private->window_type == GDK_WINDOW_TOPLEVEL)
- ShowOwnedPopups (private->xwindow, FALSE);
+ if (private->drawable.window_type == GDK_WINDOW_TOPLEVEL)
+ ShowOwnedPopups (private->drawable.xwindow, FALSE);
#if 1
- ShowWindow (private->xwindow, SW_HIDE);
+ ShowWindow (private->drawable.xwindow, SW_HIDE);
#elif 0
- ShowWindow (private->xwindow, SW_MINIMIZE);
+ ShowWindow (private->drawable.xwindow, SW_MINIMIZE);
#else
- CloseWindow (private->xwindow);
+ CloseWindow (private->drawable.xwindow);
#endif
}
}
@@ -766,9 +768,10 @@ gdk_window_withdraw (GdkWindow *window)
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
- GDK_NOTE (MISC, g_print ("gdk_window_withdraw: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_withdraw: %#x\n",
+ private->drawable.xwindow));
gdk_window_hide (window); /* XXX */
}
@@ -784,16 +787,16 @@ gdk_window_move (GdkWindow *window,
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
RECT rect;
GDK_NOTE (MISC, g_print ("gdk_window_move: %#x +%d+%d\n",
- private->xwindow, x, y));
+ private->drawable.xwindow, x, y));
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
- if (private->window_type != GDK_WINDOW_CHILD)
+ if (private->drawable.window_type != GDK_WINDOW_CHILD)
{
POINT ptTL, ptBR;
DWORD dwStyle;
@@ -801,18 +804,18 @@ gdk_window_move (GdkWindow *window,
ptTL.x = 0;
ptTL.y = 0;
- ClientToScreen (private->xwindow, &ptTL);
+ ClientToScreen (private->drawable.xwindow, &ptTL);
rect.left = x;
rect.top = y;
ptBR.x = rect.right;
ptBR.y = rect.bottom;
- ClientToScreen (private->xwindow, &ptBR);
+ ClientToScreen (private->drawable.xwindow, &ptBR);
rect.right = x + ptBR.x - ptTL.x;
rect.bottom = y + ptBR.y - ptTL.y;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
if (!SafeAdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
g_warning ("gdk_window_move: AdjustWindowRectEx failed");
@@ -825,10 +828,10 @@ gdk_window_move (GdkWindow *window,
private->y = y;
}
GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n",
- private->xwindow,
+ private->drawable.xwindow,
rect.right - rect.left, rect.bottom - rect.top,
x, y));
- if (!MoveWindow (private->xwindow,
+ if (!MoveWindow (private->drawable.xwindow,
x, y, rect.right - rect.left, rect.bottom - rect.top,
TRUE))
g_warning ("gdk_window_move: MoveWindow failed");
@@ -851,17 +854,17 @@ gdk_window_resize (GdkWindow *window,
private = (GdkWindowPrivate*) window;
- if (!private->destroyed &&
+ if (!private->drawable.destroyed &&
((private->resize_count > 0) ||
- (private->width != (guint16) width) ||
- (private->height != (guint16) height)))
+ (private->drawable.width != (guint16) width) ||
+ (private->drawable.height != (guint16) height)))
{
int x, y;
GDK_NOTE (MISC, g_print ("gdk_window_resize: %#x %dx%d\n",
- private->xwindow, width, height));
+ private->drawable.xwindow, width, height));
- if (private->window_type != GDK_WINDOW_CHILD)
+ if (private->drawable.window_type != GDK_WINDOW_CHILD)
{
POINT pt;
RECT rect;
@@ -870,14 +873,14 @@ gdk_window_resize (GdkWindow *window,
pt.x = 0;
pt.y = 0;
- ClientToScreen (private->xwindow, &pt);
+ ClientToScreen (private->drawable.xwindow, &pt);
rect.left = pt.x;
rect.top = pt.y;
rect.right = pt.x + width;
rect.bottom = pt.y + height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
if (!AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
g_warning ("gdk_window_resize: AdjustWindowRectEx failed");
@@ -890,15 +893,15 @@ gdk_window_resize (GdkWindow *window,
{
x = private->x;
y = private->y;
- private->width = width;
- private->height = height;
+ private->drawable.width = width;
+ private->drawable.height = height;
}
private->resize_count += 1;
GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n",
- private->xwindow, width, height, x, y));
- if (!MoveWindow (private->xwindow,
+ private->drawable.xwindow, width, height, x, y));
+ if (!MoveWindow (private->drawable.xwindow,
x, y, width, height,
TRUE))
g_warning ("gdk_window_resize: MoveWindow failed");
@@ -922,37 +925,37 @@ gdk_window_move_resize (GdkWindow *window,
height = 1;
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!private->drawable.destroyed)
{
RECT rect;
DWORD dwStyle;
DWORD dwExStyle;
GDK_NOTE (MISC, g_print ("gdk_window_move_resize: %#x %dx%d@+%d+%d\n",
- private->xwindow, width, height, x, y));
+ private->drawable.xwindow, width, height, x, y));
rect.left = x;
rect.top = y;
rect.right = x + width;
rect.bottom = y + height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
if (!AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle))
g_warning ("gdk_window_move_resize: AdjustWindowRectEx failed");
- if (private->window_type == GDK_WINDOW_CHILD)
+ if (private->drawable.window_type == GDK_WINDOW_CHILD)
{
private->x = x;
private->y = y;
- private->width = width;
- private->height = height;
+ private->drawable.width = width;
+ private->drawable.height = height;
}
GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n",
- private->xwindow,
+ private->drawable.xwindow,
rect.right - rect.left, rect.bottom - rect.top,
rect.left, rect.top));
- if (!MoveWindow (private->xwindow,
+ if (!MoveWindow (private->drawable.xwindow,
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
TRUE))
@@ -994,17 +997,17 @@ gdk_window_reparent (GdkWindow *window,
old_parent_private = (GdkWindowPrivate*)window_private->parent;
parent_private = (GdkWindowPrivate*) new_parent;
- if (!window_private->destroyed && !parent_private->destroyed)
+ if (!window_private->drawable.destroyed && !parent_private->drawable.destroyed)
{
GDK_NOTE (MISC, g_print ("gdk_window_reparent: %#x %#x\n",
- window_private->xwindow,
- parent_private->xwindow));
- if (!SetParent (window_private->xwindow, parent_private->xwindow))
+ window_private->drawable.xwindow,
+ parent_private->drawable.xwindow));
+ if (!SetParent (window_private->drawable.xwindow, parent_private->drawable.xwindow))
g_warning ("gdk_window_reparent: SetParent failed");
- if (!MoveWindow (window_private->xwindow,
+ if (!MoveWindow (window_private->drawable.xwindow,
x, y,
- window_private->width, window_private->height,
+ window_private->drawable.width, window_private->drawable.height,
TRUE))
g_warning ("gdk_window_reparent: MoveWindow failed");
}
@@ -1025,16 +1028,11 @@ gdk_window_reparent (GdkWindow *window,
void
gdk_window_clear (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
- {
- gdk_window_clear_area (window, 0, 0, private->width, private->height);
- }
+ if (!GDK_DRAWABLE_DESTROYED (window))
+ gdk_window_clear_area (window, 0, 0, -1, -1);
}
@@ -1045,13 +1043,10 @@ gdk_window_clear_area (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
HDC hdc;
@@ -1060,11 +1055,11 @@ gdk_window_clear_area (GdkWindow *window,
if (height == -1)
height = G_MAXSHORT/2;
GDK_NOTE (MISC, g_print ("gdk_window_clear_area: %#x %dx%d@+%d+%d\n",
- private->xwindow, width, height, x, y));
- hdc = GetDC (private->xwindow);
+ GDK_DRAWABLE_XID (window), width, height, x, y));
+ hdc = GetDC (GDK_DRAWABLE_XID (window));
IntersectClipRect (hdc, x, y, x + width, y + height);
- SendMessage (private->xwindow, WM_ERASEBKGND, (WPARAM) hdc, 0);
- ReleaseDC (private->xwindow, hdc);
+ SendMessage (GDK_DRAWABLE_XID (window), WM_ERASEBKGND, (WPARAM) hdc, 0);
+ ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
}
}
@@ -1075,86 +1070,38 @@ gdk_window_clear_area_e (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
RECT rect;
GDK_NOTE (MISC, g_print ("gdk_window_clear_area_e: %#x %dx%d@+%d+%d\n",
- private->xwindow, width, height, x, y));
+ GDK_DRAWABLE_XID (window), width, height, x, y));
rect.left = x;
rect.right = x + width;
rect.top = y;
rect.bottom = y + height;
- if (!InvalidateRect (private->xwindow, &rect, TRUE))
+ if (!InvalidateRect (GDK_DRAWABLE_XID (window), &rect, TRUE))
g_warning ("gdk_window_clear_area_e: InvalidateRect failed");
- UpdateWindow (private->xwindow);
- }
-}
-
-void
-gdk_window_copy_area (GdkWindow *window,
- GdkGC *gc,
- gint x,
- gint y,
- GdkWindow *source_window,
- gint source_x,
- gint source_y,
- gint width,
- gint height)
-{
- GdkWindowPrivate *src_private;
- GdkWindowPrivate *dest_private;
- GdkGCPrivate *gc_private;
-
- g_return_if_fail (window != NULL);
- g_return_if_fail (gc != NULL);
-
- if (source_window == NULL)
- source_window = window;
-
- src_private = (GdkWindowPrivate*) source_window;
- dest_private = (GdkWindowPrivate*) window;
- gc_private = (GdkGCPrivate*) gc;
-
- if (!src_private->destroyed && !dest_private->destroyed)
- {
- HDC hdcDest, hdcSrc;
-
- if ((hdcDest = GetDC (dest_private->xwindow)) == NULL)
- g_warning ("gdk_window_copy_area: GetDC failed");
-
- if ((hdcSrc = GetDC (src_private->xwindow)) == NULL)
- g_warning ("gdk_window_copy_area: GetDC failed");
-
- if (!BitBlt (hdcDest, x, y, width, height, hdcSrc, source_x, source_y, SRCCOPY))
- g_warning ("gdk_window_copy_area: BitBlt failed");
-
- ReleaseDC (dest_private->xwindow, hdcDest);
- ReleaseDC (src_private->xwindow, hdcSrc);
+ UpdateWindow (GDK_DRAWABLE_XID (window));
}
}
void
gdk_window_raise (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- GDK_NOTE (MISC, g_print ("gdk_window_raise: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_raise: %#x\n",
+ GDK_DRAWABLE_XID (window)));
- if (!BringWindowToTop (private->xwindow))
+ if (!BringWindowToTop (GDK_DRAWABLE_XID (window)))
g_warning ("gdk_window_raise: BringWindowToTop failed");
}
}
@@ -1162,17 +1109,15 @@ gdk_window_raise (GdkWindow *window)
void
gdk_window_lower (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- GDK_NOTE (MISC, g_print ("gdk_window_lower: %#x\n", private->xwindow));
+ GDK_NOTE (MISC, g_print ("gdk_window_lower: %#x\n",
+ GDK_DRAWABLE_XID (window)));
- if (!SetWindowPos (private->xwindow, HWND_BOTTOM, 0, 0, 0, 0,
+ if (!SetWindowPos (GDK_DRAWABLE_XID (window), HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE))
g_warning ("gdk_window_lower: SetWindowPos failed");
}
@@ -1205,13 +1150,15 @@ gdk_window_set_hints (GdkWindow *window,
int diff;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
+ private = (GdkWindowPrivate*) window;
+
GDK_NOTE (MISC, g_print ("gdk_window_set_hints: %#x %dx%d..%dx%d @+%d+%d\n",
- private->xwindow,
+ private->drawable.xwindow,
min_width, min_height, max_width, max_height,
x, y));
@@ -1221,7 +1168,7 @@ gdk_window_set_hints (GdkWindow *window,
if (flags)
{
if (flags & GDK_HINT_POS)
- if (!GetWindowPlacement (private->xwindow, &size_hints))
+ if (!GetWindowPlacement (private->drawable.xwindow, &size_hints))
g_warning ("gdk_window_set_hints: GetWindowPlacement failed");
else
{
@@ -1238,8 +1185,8 @@ gdk_window_set_hints (GdkWindow *window,
rect.top = y;
rect.right = rect.left + 200; /* dummy */
rect.bottom = rect.top + 200;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
size_hints.flags = 0;
size_hints.showCmd = SW_SHOWNA;
@@ -1258,7 +1205,7 @@ gdk_window_set_hints (GdkWindow *window,
size_hints.rcNormalPosition.top,
size_hints.rcNormalPosition.right,
size_hints.rcNormalPosition.bottom));
- if (!SetWindowPlacement (private->xwindow, &size_hints))
+ if (!SetWindowPlacement (private->drawable.xwindow, &size_hints))
g_warning ("gdk_window_set_hints: SetWindowPlacement failed");
private->hint_x = rect.left;
private->hint_y = rect.top;
@@ -1270,14 +1217,14 @@ gdk_window_set_hints (GdkWindow *window,
rect.top = 0;
rect.right = min_width;
rect.bottom = min_height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
private->hint_min_width = rect.right - rect.left;
private->hint_min_height = rect.bottom - rect.top;
/* Also chek if he current size of the window is in bounds. */
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
if (rect.right < min_width && rect.bottom < min_height)
gdk_window_resize (window, min_width, min_height);
else if (rect.right < min_width)
@@ -1291,13 +1238,13 @@ gdk_window_set_hints (GdkWindow *window,
rect.top = 0;
rect.right = max_width;
rect.bottom = max_height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
private->hint_max_width = rect.right - rect.left;
private->hint_max_height = rect.bottom - rect.top;
/* Again, check if the window is too large currently. */
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
if (rect.right > max_width && rect.bottom > max_height)
gdk_window_resize (window, max_width, max_height);
else if (rect.right > max_width)
@@ -1321,10 +1268,12 @@ gdk_window_set_geometry_hints (GdkWindow *window,
int diff;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
+
+ private = (GdkWindowPrivate*) window;
size_hints.length = sizeof (size_hints);
@@ -1339,14 +1288,14 @@ gdk_window_set_geometry_hints (GdkWindow *window,
rect.top = 0;
rect.right = geometry->min_width;
rect.bottom = geometry->min_height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
private->hint_min_width = rect.right - rect.left;
private->hint_min_height = rect.bottom - rect.top;
/* Also check if he current size of the window is in bounds */
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
if (rect.right < geometry->min_width
&& rect.bottom < geometry->min_height)
gdk_window_resize (window, geometry->min_width, geometry->min_height);
@@ -1362,14 +1311,14 @@ gdk_window_set_geometry_hints (GdkWindow *window,
rect.top = 0;
rect.right = geometry->max_width;
rect.bottom = geometry->max_height;
- dwStyle = GetWindowLong (private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (private->xwindow, GWL_EXSTYLE);
+ dwStyle = GetWindowLong (private->drawable.xwindow, GWL_STYLE);
+ dwExStyle = GetWindowLong (private->drawable.xwindow, GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
private->hint_max_width = rect.right - rect.left;
private->hint_max_height = rect.bottom - rect.top;
/* Again, check if the window is too large currently. */
- GetClientRect (private->xwindow, &rect);
+ GetClientRect (private->drawable.xwindow, &rect);
if (rect.right > geometry->max_width
&& rect.bottom > geometry->max_height)
gdk_window_resize (window, geometry->max_width, geometry->max_height);
@@ -1383,7 +1332,7 @@ gdk_window_set_geometry_hints (GdkWindow *window,
if (geom_mask & GDK_HINT_BASE_SIZE
&& geometry->base_width > 0
&& geometry->base_height > 0)
- if (!GetWindowPlacement (private->xwindow, &size_hints))
+ if (!GetWindowPlacement (private->drawable.xwindow, &size_hints))
g_warning ("gdk_window_set_hints: GetWindowPlacement failed");
else
{
@@ -1402,7 +1351,7 @@ gdk_window_set_geometry_hints (GdkWindow *window,
size_hints.rcNormalPosition.top,
size_hints.rcNormalPosition.right,
size_hints.rcNormalPosition.bottom));
- if (!SetWindowPlacement (private->xwindow, &size_hints))
+ if (!SetWindowPlacement (private->drawable.xwindow, &size_hints))
g_warning ("gdk_window_set_hints: SetWindowPlacement failed");
}
@@ -1421,16 +1370,14 @@ void
gdk_window_set_title (GdkWindow *window,
const gchar *title)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
GDK_NOTE (MISC, g_print ("gdk_window_set_title: %#x %s\n",
- private->xwindow, title));
- if (!private->destroyed)
+ GDK_DRAWABLE_XID (window), title));
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- if (!SetWindowText (private->xwindow, title))
+ if (!SetWindowText (GDK_DRAWABLE_XID (window), title))
g_warning ("gdk_window_set_title: SetWindowText failed");
}
}
@@ -1439,14 +1386,11 @@ void
gdk_window_set_role (GdkWindow *window,
const gchar *role)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
-
GDK_NOTE (MISC, g_print ("gdk_window_set_role: %#x %s\n",
- private->xwindow, (role ? role : "NULL")));
+ GDK_DRAWABLE_XID (window), (role ? role : "NULL")));
/* XXX */
}
@@ -1454,16 +1398,12 @@ void
gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
- GdkWindowPrivate *private;
- GdkWindowPrivate *parent_private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- parent_private = (GdkWindowPrivate*) parent;
-
GDK_NOTE (MISC, g_print ("gdk_window_set_transient_for: %#x %#x\n",
- private->xwindow, parent_private->xwindow));
+ GDK_DRAWABLE_XID (window),
+ GDK_DRAWABLE_XID (parent)));
/* XXX */
}
@@ -1474,15 +1414,13 @@ gdk_window_set_background (GdkWindow *window,
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- GdkColormapPrivate *colormap_private =
- (GdkColormapPrivate *) private->colormap;
-
GDK_NOTE (MISC, g_print ("gdk_window_set_background: %#x %s\n",
- private->xwindow,
+ private->drawable.xwindow,
gdk_color_to_string (color)));
if (private->bg_type == GDK_WIN32_BG_PIXMAP)
@@ -1504,28 +1442,27 @@ gdk_window_set_back_pixmap (GdkWindow *window,
GdkPixmap *pixmap,
gint parent_relative)
{
- GdkWindowPrivate *window_private;
+ GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- window_private = (GdkWindowPrivate*) window;
+ private = (GdkWindowPrivate*) window;
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- GdkColormapPrivate *colormap_private =
- (GdkColormapPrivate *) window_private->colormap;
- if (window_private->bg_type == GDK_WIN32_BG_PIXMAP)
+ if (private->bg_type == GDK_WIN32_BG_PIXMAP)
{
- if (window_private->bg_pixmap != NULL)
+ if (private->bg_pixmap != NULL)
{
- gdk_pixmap_unref (window_private->bg_pixmap);
- window_private->bg_pixmap = NULL;
+ gdk_pixmap_unref (private->bg_pixmap);
+ private->bg_pixmap = NULL;
}
- window_private->bg_type = GDK_WIN32_BG_NORMAL;
+ private->bg_type = GDK_WIN32_BG_NORMAL;
}
if (parent_relative)
{
- window_private->bg_type = GDK_WIN32_BG_PARENT_RELATIVE;
+ private->bg_type = GDK_WIN32_BG_PARENT_RELATIVE;
}
else if (!pixmap)
{
@@ -1536,8 +1473,8 @@ gdk_window_set_back_pixmap (GdkWindow *window,
/* We must cache the pixmap in the WindowPrivate and
* paint it each time we get WM_ERASEBKGND
*/
- window_private->bg_type = GDK_WIN32_BG_PIXMAP;
- window_private->bg_pixmap = pixmap;
+ private->bg_type = GDK_WIN32_BG_PIXMAP;
+ private->bg_pixmap = pixmap;
gdk_pixmap_ref (pixmap);
}
}
@@ -1552,11 +1489,12 @@ gdk_window_set_cursor (GdkWindow *window,
HCURSOR xcursor;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
window_private = (GdkWindowPrivate*) window;
cursor_private = (GdkCursorPrivate*) cursor;
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
if (!cursor)
xcursor = LoadCursor (NULL, IDC_ARROW);
@@ -1564,38 +1502,8 @@ gdk_window_set_cursor (GdkWindow *window,
xcursor = cursor_private->xcursor;
GDK_NOTE (MISC, g_print ("gdk_window_set_cursor: %#x %#x\n",
- window_private->xwindow, xcursor));
+ window_private->drawable.xwindow, xcursor));
window_private->xcursor = xcursor;
- SetCursor (xcursor);
- }
-}
-
-void
-gdk_window_set_colormap (GdkWindow *window,
- GdkColormap *colormap)
-{
- GdkWindowPrivate *window_private;
- GdkColormapPrivate *colormap_private;
-
- g_return_if_fail (window != NULL);
- g_return_if_fail (colormap != NULL);
-
- window_private = (GdkWindowPrivate*) window;
- colormap_private = (GdkColormapPrivate*) colormap;
-
- if (!window_private->destroyed)
- {
- /* XXX ??? */
- GDK_NOTE (MISC, g_print ("gdk_window_set_colormap: %#x %#x\n",
- window_private->xwindow,
- colormap_private->xcolormap));
- if (window_private->colormap)
- gdk_colormap_unref (window_private->colormap);
- window_private->colormap = colormap;
- gdk_colormap_ref (window_private->colormap);
-
- if (window_private->window_type != GDK_WINDOW_TOPLEVEL)
- gdk_window_add_colormap_windows (window);
}
}
@@ -1616,18 +1524,16 @@ gdk_window_get_geometry (GdkWindow *window,
gint *height,
gint *depth)
{
- GdkWindowPrivate *window_private;
+ g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
if (!window)
window = (GdkWindow*) &gdk_root_parent;
- window_private = (GdkWindowPrivate*) window;
-
- if (!window_private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
RECT rect;
- if (!GetClientRect (window_private->xwindow, &rect))
+ if (!GetClientRect (GDK_DRAWABLE_XID (window), &rect))
g_warning ("gdk_window_get_geometry: GetClientRect failed");
if (x)
@@ -1639,7 +1545,7 @@ gdk_window_get_geometry (GdkWindow *window,
if (height)
*height = rect.bottom - rect.top;
if (depth)
- *depth = gdk_window_get_visual (window)->depth;
+ *depth = gdk_drawable_get_visual (window)->depth;
}
}
@@ -1651,6 +1557,7 @@ gdk_window_get_position (GdkWindow *window,
GdkWindowPrivate *window_private;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
window_private = (GdkWindowPrivate*) window;
@@ -1660,100 +1567,24 @@ gdk_window_get_position (GdkWindow *window,
*y = window_private->y;
}
-void
-gdk_window_get_size (GdkWindow *window,
- gint *width,
- gint *height)
-{
- GdkWindowPrivate *window_private;
-
- g_return_if_fail (window != NULL);
-
- window_private = (GdkWindowPrivate*) window;
-
- if (width)
- *width = window_private->width;
- if (height)
- *height = window_private->height;
-}
-
-GdkVisual*
-gdk_window_get_visual (GdkWindow *window)
-{
- GdkWindowPrivate *window_private;
-
- g_return_val_if_fail (window != NULL, NULL);
-
- window_private = (GdkWindowPrivate*) window;
- /* Huh? ->parent is never set for a pixmap. We should just return
- * null immeditately. Well, do it then!
- */
- if (window_private->window_type == GDK_WINDOW_PIXMAP)
- return NULL;
-
- if (!window_private->destroyed)
- {
- if (window_private->colormap == NULL)
- return gdk_visual_get_system (); /* XXX ??? */
- else
- return ((GdkColormapPrivate *)window_private->colormap)->visual;
- }
-
- return NULL;
-}
-
-GdkColormap*
-gdk_window_get_colormap (GdkWindow *window)
-{
- GdkWindowPrivate *window_private;
-
- g_return_val_if_fail (window != NULL, NULL);
- window_private = (GdkWindowPrivate*) window;
-
- g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL);
- if (!window_private->destroyed)
- {
- if (window_private->colormap == NULL)
- return gdk_colormap_get_system (); /* XXX ??? */
- else
- return window_private->colormap;
- }
-
- return NULL;
-}
-
-GdkWindowType
-gdk_window_get_type (GdkWindow *window)
-{
- GdkWindowPrivate *window_private;
-
- g_return_val_if_fail (window != NULL, (GdkWindowType) -1);
-
- window_private = (GdkWindowPrivate*) window;
- return window_private->window_type;
-}
-
gint
gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y)
{
- GdkWindowPrivate *private;
gint return_val;
gint tx = 0;
gint ty = 0;
g_return_val_if_fail (window != NULL, 0);
- private = (GdkWindowPrivate*) window;
-
- if (!private->destroyed)
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
POINT pt;
pt.x = 0;
pt.y = 0;
- ClientToScreen (private->xwindow, &pt);
+ ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
tx = pt.x;
ty = pt.y;
return_val = 1;
@@ -1767,7 +1598,7 @@ gdk_window_get_origin (GdkWindow *window,
*y = ty;
GDK_NOTE (MISC, g_print ("gdk_window_get_origin: %#x: +%d+%d\n",
- private->xwindow, tx, ty));
+ GDK_DRAWABLE_XID (window), tx, ty));
return return_val;
}
@@ -1788,31 +1619,32 @@ gdk_window_get_root_origin (GdkWindow *window,
POINT pt;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
if (x)
*x = 0;
if (y)
*y = 0;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
while (private->parent && ((GdkWindowPrivate*) private->parent)->parent)
private = (GdkWindowPrivate*) private->parent;
- if (private->destroyed)
+ if (private->drawable.destroyed)
return;
pt.x = 0;
pt.y = 0;
- ClientToScreen (private->xwindow, &pt);
+ ClientToScreen (private->drawable.xwindow, &pt);
if (x)
*x = pt.x;
if (y)
*y = pt.y;
GDK_NOTE (MISC, g_print ("gdk_window_get_root_origin: %#x: (%#x) +%d+%d\n",
- ((GdkWindowPrivate *) window)->xwindow,
- private->xwindow, pt.x, pt.y));
+ GDK_DRAWABLE_XID (window),
+ private->drawable.xwindow, pt.x, pt.y));
}
GdkWindow*
@@ -1821,20 +1653,19 @@ gdk_window_get_pointer (GdkWindow *window,
gint *y,
GdkModifierType *mask)
{
- GdkWindowPrivate *private;
GdkWindow *return_val;
POINT pointc, point;
HWND hwnd, hwndc;
+ g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
+
if (!window)
window = (GdkWindow*) &gdk_root_parent;
- private = (GdkWindowPrivate*) window;
-
return_val = NULL;
GetCursorPos (&pointc);
point = pointc;
- ScreenToClient (private->xwindow, &point);
+ ScreenToClient (GDK_DRAWABLE_XID (window), &point);
if (x)
*x = point.x;
@@ -1882,14 +1713,11 @@ GdkWindow*
gdk_window_at_pointer (gint *win_x,
gint *win_y)
{
- GdkWindowPrivate *private;
GdkWindow *window;
POINT point, pointc;
HWND hwnd, hwndc;
RECT rect;
- private = &gdk_root_parent;
-
GetCursorPos (&pointc);
point = pointc;
hwnd = WindowFromPoint (point);
@@ -1934,6 +1762,7 @@ GdkWindow*
gdk_window_get_parent (GdkWindow *window)
{
g_return_val_if_fail (window != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
return ((GdkWindowPrivate*) window)->parent;
}
@@ -1941,17 +1770,11 @@ gdk_window_get_parent (GdkWindow *window)
GdkWindow*
gdk_window_get_toplevel (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_val_if_fail (window != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowPrivate*) window;
-
- while (private->window_type == GDK_WINDOW_CHILD)
- {
- window = ((GdkWindowPrivate*) window)->parent;
- private = (GdkWindowPrivate*) window;
- }
+ while (GDK_DRAWABLE_TYPE (window) == GDK_WINDOW_CHILD)
+ window = ((GdkWindowPrivate*) window)->parent;
return window;
}
@@ -1963,13 +1786,13 @@ gdk_window_get_children (GdkWindow *window)
GList *children;
g_return_val_if_fail (window != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
/* XXX ??? */
- g_warning ("gdk_window_get_children ???");
+ g_warning ("gdk_window_get_children not implemented");
children = NULL;
return children;
@@ -1981,9 +1804,10 @@ gdk_window_get_events (GdkWindow *window)
GdkWindowPrivate *private;
g_return_val_if_fail (window != NULL, 0);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return 0;
return private->event_mask;
@@ -1996,9 +1820,10 @@ gdk_window_set_events (GdkWindow *window,
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
private->event_mask = event_mask;
@@ -2007,65 +1832,57 @@ gdk_window_set_events (GdkWindow *window,
void
gdk_window_add_colormap_windows (GdkWindow *window)
{
- g_warning ("gdk_window_add_colormap_windows not implemented"); /* XXX */
+ g_warning ("gdk_window_add_colormap_windows not implemented");
}
-/*
- * This needs the X11 shape extension.
- * If not available, shaped windows will look
- * ugly, but programs still work. Stefan Wille
- */
void
gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask,
gint x, gint y)
{
- GdkWindowPrivate *window_private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- window_private = (GdkWindowPrivate*) window;
-
if (!mask)
{
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %#x none\n",
- window_private->xwindow));
- SetWindowRgn (window_private->xwindow, NULL, TRUE);
+ GDK_DRAWABLE_XID (window)));
+ SetWindowRgn (GDK_DRAWABLE_XID (window), NULL, TRUE);
}
else
{
- GdkPixmapPrivate *pixmap_private;
+ GdkDrawablePrivate *pixmap_private;
HRGN hrgn;
DWORD dwStyle;
DWORD dwExStyle;
RECT rect;
/* Convert mask bitmap to region */
- pixmap_private = (GdkPixmapPrivate*) mask;
+ pixmap_private = (GdkDrawablePrivate*) mask;
hrgn = BitmapToRegion (pixmap_private->xwindow);
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %#x %#x\n",
- window_private->xwindow,
+ GDK_DRAWABLE_XID (window),
pixmap_private->xwindow));
/* SetWindowRgn wants window (not client) coordinates */
- dwStyle = GetWindowLong (window_private->xwindow, GWL_STYLE);
- dwExStyle = GetWindowLong (window_private->xwindow, GWL_EXSTYLE);
- GetClientRect (window_private->xwindow, &rect);
+ dwStyle = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE);
+ dwExStyle = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_EXSTYLE);
+ GetClientRect (GDK_DRAWABLE_XID (window), &rect);
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 */
- if (window_private->window_type == GDK_WINDOW_TOPLEVEL)
+ if (GDK_DRAWABLE_TYPE (window) == GDK_WINDOW_TOPLEVEL)
{
CombineRgn (hrgn, hrgn,
CreateRectRgn (0, 0, rect.right - rect.left, -rect.top),
RGN_OR);
}
- SetWindowRgn (window_private->xwindow, hrgn, TRUE);
+ SetWindowRgn (GDK_DRAWABLE_XID (window), hrgn, TRUE);
}
}
@@ -2077,16 +1894,19 @@ gdk_window_add_filter (GdkWindow *window,
GdkWindowPrivate *private;
GList *tmp_list;
GdkEventFilter *filter;
+
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
- if (private && private->destroyed)
+ if (private && GDK_DRAWABLE_DESTROYED (window))
return;
-
+
if (private)
tmp_list = private->filters;
else
tmp_list = gdk_default_filters;
-
+
while (tmp_list)
{
filter = (GdkEventFilter *)tmp_list->data;
@@ -2094,11 +1914,11 @@ gdk_window_add_filter (GdkWindow *window,
return;
tmp_list = tmp_list->next;
}
-
+
filter = g_new (GdkEventFilter, 1);
filter->function = function;
filter->data = data;
-
+
if (private)
private->filters = g_list_append (private->filters, filter);
else
@@ -2113,26 +1933,29 @@ gdk_window_remove_filter (GdkWindow *window,
GdkWindowPrivate *private;
GList *tmp_list, *node;
GdkEventFilter *filter;
+
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowPrivate*) window;
-
- if(private)
+
+ if (private)
tmp_list = private->filters;
else
tmp_list = gdk_default_filters;
-
+
while (tmp_list)
{
filter = (GdkEventFilter *)tmp_list->data;
node = tmp_list;
tmp_list = tmp_list->next;
-
+
if ((filter->function == function) && (filter->data == data))
{
- if(private)
+ if (private)
private->filters = g_list_remove_link (private->filters, node);
else
- gdk_default_filters = g_list_remove_link (gdk_default_filters, tmp_list);
+ gdk_default_filters = g_list_remove_link (gdk_default_filters, node);
g_list_free_1 (node);
g_free (filter);
@@ -2145,7 +1968,10 @@ void
gdk_window_set_override_redirect (GdkWindow *window,
gboolean override_redirect)
{
- g_warning ("gdk_window_set_override_redirect not implemented"); /* XXX */
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ g_warning ("gdk_window_set_override_redirect not implemented");
}
void
@@ -2154,21 +1980,26 @@ gdk_window_set_icon (GdkWindow *window,
GdkPixmap *pixmap,
GdkBitmap *mask)
{
- g_warning ("gdk_window_set_icon not implemented"); /* XXX */
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ if (GDK_DRAWABLE_DESTROYED (window))
+ return;
+
+ g_warning ("gdk_window_set_icon not implemented");
}
-void
+void
gdk_window_set_icon_name (GdkWindow *window,
gchar *name)
{
- GdkWindowPrivate *window_private;
-
g_return_if_fail (window != NULL);
- window_private = (GdkWindowPrivate*) window;
- if (window_private->destroyed)
- return;
+ g_return_if_fail (GDK_IS_WINDOW (window));
- if (!SetWindowText (window_private->xwindow, name))
+ if (GDK_DRAWABLE_DESTROYED (window))
+ return;
+
+ if (!SetWindowText (GDK_DRAWABLE_XID (window), name))
g_warning ("gdk_window_set_icon_name: SetWindowText failed");
}
@@ -2176,18 +2007,28 @@ void
gdk_window_set_group (GdkWindow *window,
GdkWindow *leader)
{
- g_warning ("gdk_window_set_group not implemented"); /* XXX */
+ 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));
+
+ if (GDK_DRAWABLE_DESTROYED (window) || GDK_DRAWABLE_DESTROYED (leader))
+ return;
+
+ g_warning ("gdk_window_set_group not implemented");
}
void
gdk_window_set_decorations (GdkWindow *window,
GdkWMDecoration decorations)
{
- GdkWindowPrivate *window_private = (GdkWindowPrivate *) window;
LONG style, exstyle;
- style = GetWindowLong (window_private->xwindow, GWL_STYLE);
- exstyle = GetWindowLong (window_private->xwindow, GWL_EXSTYLE);
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ style = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE);
+ exstyle = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_EXSTYLE);
style &= (WS_OVERLAPPED|WS_POPUP|WS_CHILD|WS_MINIMIZE|WS_VISIBLE|WS_DISABLED
|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZE);
@@ -2209,18 +2050,20 @@ gdk_window_set_decorations (GdkWindow *window,
if (decorations & GDK_DECOR_MAXIMIZE)
style |= (WS_MAXIMIZEBOX);
- SetWindowLong (window_private->xwindow, GWL_STYLE, style);
+ SetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE, style);
}
void
gdk_window_set_functions (GdkWindow *window,
GdkWMFunction functions)
{
- GdkWindowPrivate *window_private = (GdkWindowPrivate *) window;
LONG style, exstyle;
- style = GetWindowLong (window_private->xwindow, GWL_STYLE);
- exstyle = GetWindowLong (window_private->xwindow, GWL_EXSTYLE);
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ style = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE);
+ exstyle = GetWindowLong (GDK_DRAWABLE_XID (window), GWL_EXSTYLE);
style &= (WS_OVERLAPPED|WS_POPUP|WS_CHILD|WS_MINIMIZE|WS_VISIBLE|WS_DISABLED
|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZE|WS_CAPTION|WS_BORDER
@@ -2239,7 +2082,7 @@ gdk_window_set_functions (GdkWindow *window,
if (functions & GDK_FUNC_MAXIMIZE)
style |= (WS_MAXIMIZEBOX);
- SetWindowLong (window_private->xwindow, GWL_STYLE, style);
+ SetWindowLong (GDK_DRAWABLE_XID (window), GWL_STYLE, style);
}
GList *
@@ -2339,29 +2182,25 @@ gdk_propagate_shapes (HANDLE win,
void
gdk_window_set_child_shapes (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
- gdk_propagate_shapes ( private->xwindow, FALSE);
+ gdk_propagate_shapes (GDK_DRAWABLE_XID (window), FALSE);
}
void
gdk_window_merge_child_shapes (GdkWindow *window)
{
- GdkWindowPrivate *private;
-
g_return_if_fail (window != NULL);
+ g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowPrivate*) window;
- if (private->destroyed)
+ if (GDK_DRAWABLE_DESTROYED (window))
return;
- gdk_propagate_shapes (private->xwindow, TRUE);
+ gdk_propagate_shapes (GDK_DRAWABLE_XID (window), TRUE);
}
/*************************************************************
@@ -2379,6 +2218,7 @@ gdk_window_is_visible (GdkWindow *window)
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_val_if_fail (window != NULL, FALSE);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
return private->mapped;
}
@@ -2401,10 +2241,11 @@ gdk_window_is_viewable (GdkWindow *window)
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_val_if_fail (window != NULL, FALSE);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
while (private &&
(private != &gdk_root_parent) &&
- (private->window_type != GDK_WINDOW_FOREIGN))
+ (private->drawable.window_type != GDK_WINDOW_FOREIGN))
{
if (!private->mapped)
return FALSE;
@@ -2415,16 +2256,6 @@ gdk_window_is_viewable (GdkWindow *window)
return TRUE;
}
-void
-gdk_drawable_set_data (GdkDrawable *drawable,
- const gchar *key,
- gpointer data,
- GDestroyNotify destroy_func)
-{
- g_dataset_set_data_full (drawable, key, data, destroy_func);
-}
-
-
/* Support for windows that can be guffaw-scrolled
* (See http://www.gtk.org/~otaylor/whitepapers/guffaw-scrolling.txt)
*/
@@ -2434,7 +2265,7 @@ gdk_window_gravity_works (void)
{
enum { UNKNOWN, NO, YES };
static gint gravity_works = UNKNOWN;
-
+
if (gravity_works == UNKNOWN)
{
GdkWindowAttr attr;
@@ -2454,7 +2285,7 @@ gdk_window_gravity_works (void)
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);
@@ -2469,29 +2300,24 @@ gdk_window_gravity_works (void)
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)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *)window;
-
g_return_if_fail (window != NULL);
- GDK_NOTE (MISC,
- g_print ("gdk_window_set_static_bit_gravity: Not implemented\n"));
+ 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)
{
- GdkWindowPrivate *private = (GdkWindowPrivate *)window;
-
g_return_if_fail (window != NULL);
GDK_NOTE (MISC,
@@ -2516,26 +2342,30 @@ gdk_window_set_static_gravities (GdkWindow *window,
{
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
GList *tmp_list;
-
- g_return_val_if_fail (window != NULL, FALSE);
+ 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;
-
- gdk_window_set_static_bit_gravity (window, use_static);
-
- tmp_list = private->children;
- while (tmp_list)
+
+ if (!GDK_DRAWABLE_DESTROYED (window))
{
- gdk_window_set_static_win_gravity (window, use_static);
+ gdk_window_set_static_bit_gravity (window, use_static);
- tmp_list = tmp_list->next;
+ tmp_list = private->children;
+ while (tmp_list)
+ {
+ gdk_window_set_static_win_gravity (window, use_static);
+
+ tmp_list = tmp_list->next;
+ }
}
-
+
return TRUE;
}
diff --git a/gdk/win32/gdkx.h b/gdk/win32/gdkx.h
index 34724393f7..7e8f8aded0 100644
--- a/gdk/win32/gdkx.h
+++ b/gdk/win32/gdkx.h
@@ -36,8 +36,10 @@
#define GDK_ROOT_WINDOW() ((guint32) HWND_DESKTOP)
#define GDK_ROOT_PARENT() ((GdkWindow *)&gdk_root_parent)
#define GDK_DISPLAY() NULL
-#define GDK_WINDOW_XDISPLAY(win) NULL
-#define GDK_WINDOW_XWINDOW(win) (((GdkWindowPrivate*) win)->xwindow)
+#define GDK_DRAWABLE_XDISPLAY(win) NULL
+#define GDK_DRAWABLE_XID(win) (((GdkDrawablePrivate*) win)->xwindow)
+#define GDK_WINDOW_XDISPLAY GDK_DRAWABLE_XDISPLAY
+#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID
#define GDK_IMAGE_XDISPLAY(image) NULL
#define GDK_IMAGE_XIMAGE(image) (((GdkImagePrivate*) image)->ximage)
#define GDK_GC_XDISPLAY(gc) NULL
diff --git a/gdk/win32/makefile.cygwin b/gdk/win32/makefile.cygwin
index 8cfe60ca90..77429ca2e8 100644
--- a/gdk/win32/makefile.cygwin
+++ b/gdk/win32/makefile.cygwin
@@ -25,7 +25,7 @@ GLIB_VER=1.3
GTK_VER=1.3
GLIB = ../../../glib
-CFLAGS = $(OPTIMIZE) -I . -I .. -I ../.. -I $(WTKIT)/include -I $(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" -DNEAR= -DFAR=
+CFLAGS = $(OPTIMIZE) -I . -I .. -I ../.. -I $(WTKIT)/include -I $(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\"
all: \
gdk/gdkprivate.h \
@@ -40,6 +40,7 @@ gdk_OBJECTS = \
gdk.o \
gdkcc.o \
gdkcolor.o \
+ gdkcompat.o \
gdkcursor.o \
gdkdnd.o \
gdkdraw.o \
diff --git a/gdk/win32/makefile.msc b/gdk/win32/makefile.msc
index 1f367e4479..ec26079ea0 100644
--- a/gdk/win32/makefile.msc
+++ b/gdk/win32/makefile.msc
@@ -47,6 +47,7 @@ gdk_OBJECTS = \
gdk.obj \
gdkcc.obj \
gdkcolor.obj \
+ gdkcompat.obj \
gdkcursor.obj \
gdkdnd.obj \
gdkdraw.obj \
diff --git a/gtk/gtk.def b/gtk/gtk.def
index a7353d55a6..27cd56983d 100755
--- a/gtk/gtk.def
+++ b/gtk/gtk.def
@@ -35,6 +35,7 @@ EXPORTS
GTK_TYPE_GDK_DRAG_ACTION
GTK_TYPE_GDK_DRAG_CONTEXT
GTK_TYPE_GDK_DRAG_PROTOCOL
+ GTK_TYPE_GDK_DRAWABLE_TYPE
GTK_TYPE_GDK_EVENT
GTK_TYPE_GDK_EVENT_MASK
GTK_TYPE_GDK_EVENT_TYPE
@@ -72,7 +73,6 @@ EXPORTS
GTK_TYPE_GDK_WINDOW_ATTRIBUTES_TYPE
GTK_TYPE_GDK_WINDOW_CLASS
GTK_TYPE_GDK_WINDOW_HINTS
- GTK_TYPE_GDK_WINDOW_TYPE
GTK_TYPE_GDK_WM_DECORATION
GTK_TYPE_GDK_WM_FUNCTION
GTK_TYPE_JUSTIFICATION
@@ -576,6 +576,7 @@ EXPORTS
gtk_invisible_new
gtk_item_deselect
gtk_item_factories_path_delete
+ gtk_item_factory_add_foreign
gtk_item_factory_construct
gtk_item_factory_create_item
gtk_item_factory_create_items
@@ -588,6 +589,9 @@ EXPORTS
gtk_item_factory_dump_rc
gtk_item_factory_from_path
gtk_item_factory_from_widget
+ gtk_item_factory_get_item
+ gtk_item_factory_get_item_by_action
+ gtk_item_factory_get_type
gtk_item_factory_get_widget
gtk_item_factory_get_widget_by_action
gtk_item_factory_new
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c
index eaa4ec8580..6987ea1388 100644
--- a/gtk/gtkfilesel.c
+++ b/gtk/gtkfilesel.c
@@ -2586,7 +2586,7 @@ attempt_homedir_completion(gchar* text_to_complete,
#endif
-#ifdef defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
+#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
#define FOLD(c) (tolower(c))
#else
#define FOLD(c) (c)
diff --git a/gtk/makefile.cygwin b/gtk/makefile.cygwin
index a104d62ead..de6092a762 100644
--- a/gtk/makefile.cygwin
+++ b/gtk/makefile.cygwin
@@ -34,7 +34,7 @@ GDKSYSDEP = ../gdk/win32
GLIB = ../../glib
INTL = ../../intl
-CFLAGS = $(OPTIMIZE) -I . -I .. -I $(GDKSYSDEP) -I $(GLIB) -I $(GLIB)/gmodule -I $(INTL) -DGTK_DISABLE_COMPAT_H
+CFLAGS = $(OPTIMIZE) -I . -I .. -I $(GDKSYSDEP) -I ../gdk -I $(GLIB) -I $(GLIB)/gmodule -I $(INTL) -DGTK_DISABLE_COMPAT_H
all : \
../config.h \
@@ -274,8 +274,25 @@ source_headers = \
# More headers to use when autogenerating.
gdk_headers = \
- ../gdk/gdktypes.h \
- ../gdk/gdkrgb.h
+ ../gdk/gdkcc.h \
+ ../gdk/gdkcolor.h \
+ ../gdk/gdkcursor.h \
+ ../gdk/gdkdnd.h \
+ ../gdk/gdkdrawable.h \
+ ../gdk/gdkevents.h \
+ ../gdk/gdkfont.h \
+ ../gdk/gdkgc.h \
+ ../gdk/gdkim.h \
+ ../gdk/gdkimage.h \
+ ../gdk/gdkinput.h \
+ ../gdk/gdkpixmap.h \
+ ../gdk/gdkproperty.h \
+ ../gdk/gdkregion.h \
+ ../gdk/gdkrgb.h \
+ ../gdk/gdkselection.h \
+ ../gdk/gdktypes.h \
+ ../gdk/gdkvisual.h \
+ ../gdk/gdkwindow.h
../config.h : ../config.h.win32
cp ../config.h.win32 ../config.h
diff --git a/gtk/makefile.msc b/gtk/makefile.msc
index d4688b00d9..13d6347781 100755
--- a/gtk/makefile.msc
+++ b/gtk/makefile.msc
@@ -46,7 +46,7 @@ GDKSYSDEP = ..\gdk\win32
GLIB = ..\..\glib
INTL = ..\..\intl
-CFLAGS = -I. -I.. -I$(GDKSYSDEP) -I$(GLIB) -I$(GLIB)\gmodule -I$(INTL) -DGTK_DISABLE_COMPAT_H
+CFLAGS = -I. -I.. -I$(GDKSYSDEP) -I..\gdk -I$(GLIB) -I$(GLIB)\gmodule -I$(INTL) -DGTK_DISABLE_COMPAT_H
all : \
..\config.h \
@@ -286,8 +286,25 @@ source_headers = \
# More headers to use when autogenerating.
gdk_headers = \
- ..\gdk\gdktypes.h \
- ..\gdk\gdkrgb.h
+ ..\gdk\gdkcc.h \
+ ..\gdk\gdkcolor.h \
+ ..\gdk\gdkcursor.h \
+ ..\gdk\gdkdnd.h \
+ ..\gdk\gdkdrawable.h \
+ ..\gdk\gdkevents.h \
+ ..\gdk\gdkfont.h \
+ ..\gdk\gdkgc.h \
+ ..\gdk\gdkim.h \
+ ..\gdk\gdkimage.h \
+ ..\gdk\gdkinput.h \
+ ..\gdk\gdkpixmap.h \
+ ..\gdk\gdkproperty.h \
+ ..\gdk\gdkregion.h \
+ ..\gdk\gdkrgb.h \
+ ..\gdk\gdkselection.h \
+ ..\gdk\gdktypes.h \
+ ..\gdk\gdkvisual.h \
+ ..\gdk\gdkwindow.h
..\config.h : ..\config.h.win32
copy ..\config.h.win32 ..\config.h