Commit 658b4b1d authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Update.

2000-10-09  Tor Lillqvist  <tml@iki.fi>

	* README.win32: Update.

	* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
	lines that had been deleted by mistake (?).

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
	also the case fg==white and bg==black (but still not randomly
	coloured cursors). Thanks to Wolfgang Sourdeau.

	* gdk/win32/*.c: Silence gcc -Wall.

	* gtk/gtk.def: Add missing entry points.

	Fixes by Hans Breuer:

	* gdk/makefile.msc
	* gdk/win32/makefile.msc: Update.

	* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
	some MSVC thing, presumably), cause breakpoint on failures. Add
	GDK_NOR case. Call g_log_set_always_fatal.

	* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
	should be pased by reference.

	* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.

	* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.

	* gdk/win32/gdkevents-win32.c
	* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.

	* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
	implementation object.

	* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
	not just windows.

	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
	Use the wrapper object.
parent ea708d50
2000-10-09 Tor Lillqvist <tml@iki.fi>
* README.win32: Update.
* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
lines that had been deleted by mistake (?).
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
also the case fg==white and bg==black (but still not randomly
coloured cursors). Thanks to Wolfgang Sourdeau.
* gdk/win32/*.c: Silence gcc -Wall.
* gtk/gtk.def: Add missing entry points.
Fixes by Hans Breuer:
* gdk/makefile.msc
* gdk/win32/makefile.msc: Update.
* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
some MSVC thing, presumably), cause breakpoint on failures. Add
GDK_NOR case. Call g_log_set_always_fatal.
* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
should be pased by reference.
* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.
* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.
* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
implementation object.
* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
not just windows.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
Use the wrapper object.
2000-10-06 Havoc Pennington <hp@redhat.com>
* Makefile.am (SRC_SUBDIRS): contrib subdir
......
2000-10-09 Tor Lillqvist <tml@iki.fi>
* README.win32: Update.
* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
lines that had been deleted by mistake (?).
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
also the case fg==white and bg==black (but still not randomly
coloured cursors). Thanks to Wolfgang Sourdeau.
* gdk/win32/*.c: Silence gcc -Wall.
* gtk/gtk.def: Add missing entry points.
Fixes by Hans Breuer:
* gdk/makefile.msc
* gdk/win32/makefile.msc: Update.
* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
some MSVC thing, presumably), cause breakpoint on failures. Add
GDK_NOR case. Call g_log_set_always_fatal.
* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
should be pased by reference.
* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.
* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.
* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
implementation object.
* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
not just windows.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
Use the wrapper object.
2000-10-06 Havoc Pennington <hp@redhat.com>
* Makefile.am (SRC_SUBDIRS): contrib subdir
......
2000-10-09 Tor Lillqvist <tml@iki.fi>
* README.win32: Update.
* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
lines that had been deleted by mistake (?).
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
also the case fg==white and bg==black (but still not randomly
coloured cursors). Thanks to Wolfgang Sourdeau.
* gdk/win32/*.c: Silence gcc -Wall.
* gtk/gtk.def: Add missing entry points.
Fixes by Hans Breuer:
* gdk/makefile.msc
* gdk/win32/makefile.msc: Update.
* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
some MSVC thing, presumably), cause breakpoint on failures. Add
GDK_NOR case. Call g_log_set_always_fatal.
* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
should be pased by reference.
* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.
* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.
* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
implementation object.
* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
not just windows.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
Use the wrapper object.
2000-10-06 Havoc Pennington <hp@redhat.com>
* Makefile.am (SRC_SUBDIRS): contrib subdir
......
2000-10-09 Tor Lillqvist <tml@iki.fi>
* README.win32: Update.
* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
lines that had been deleted by mistake (?).
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
also the case fg==white and bg==black (but still not randomly
coloured cursors). Thanks to Wolfgang Sourdeau.
* gdk/win32/*.c: Silence gcc -Wall.
* gtk/gtk.def: Add missing entry points.
Fixes by Hans Breuer:
* gdk/makefile.msc
* gdk/win32/makefile.msc: Update.
* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
some MSVC thing, presumably), cause breakpoint on failures. Add
GDK_NOR case. Call g_log_set_always_fatal.
* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
should be pased by reference.
* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.
* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.
* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
implementation object.
* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
not just windows.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
Use the wrapper object.
2000-10-06 Havoc Pennington <hp@redhat.com>
* Makefile.am (SRC_SUBDIRS): contrib subdir
......
2000-10-09 Tor Lillqvist <tml@iki.fi>
* README.win32: Update.
* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
lines that had been deleted by mistake (?).
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
also the case fg==white and bg==black (but still not randomly
coloured cursors). Thanks to Wolfgang Sourdeau.
* gdk/win32/*.c: Silence gcc -Wall.
* gtk/gtk.def: Add missing entry points.
Fixes by Hans Breuer:
* gdk/makefile.msc
* gdk/win32/makefile.msc: Update.
* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
some MSVC thing, presumably), cause breakpoint on failures. Add
GDK_NOR case. Call g_log_set_always_fatal.
* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
should be pased by reference.
* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.
* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.
* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
implementation object.
* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
not just windows.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
Use the wrapper object.
2000-10-06 Havoc Pennington <hp@redhat.com>
* Makefile.am (SRC_SUBDIRS): contrib subdir
......
2000-10-09 Tor Lillqvist <tml@iki.fi>
* README.win32: Update.
* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
lines that had been deleted by mistake (?).
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
also the case fg==white and bg==black (but still not randomly
coloured cursors). Thanks to Wolfgang Sourdeau.
* gdk/win32/*.c: Silence gcc -Wall.
* gtk/gtk.def: Add missing entry points.
Fixes by Hans Breuer:
* gdk/makefile.msc
* gdk/win32/makefile.msc: Update.
* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
some MSVC thing, presumably), cause breakpoint on failures. Add
GDK_NOR case. Call g_log_set_always_fatal.
* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
should be pased by reference.
* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.
* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.
* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
implementation object.
* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
not just windows.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
Use the wrapper object.
2000-10-06 Havoc Pennington <hp@redhat.com>
* Makefile.am (SRC_SUBDIRS): contrib subdir
......
2000-10-09 Tor Lillqvist <tml@iki.fi>
* README.win32: Update.
* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
lines that had been deleted by mistake (?).
* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
also the case fg==white and bg==black (but still not randomly
coloured cursors). Thanks to Wolfgang Sourdeau.
* gdk/win32/*.c: Silence gcc -Wall.
* gtk/gtk.def: Add missing entry points.
Fixes by Hans Breuer:
* gdk/makefile.msc
* gdk/win32/makefile.msc: Update.
* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
some MSVC thing, presumably), cause breakpoint on failures. Add
GDK_NOR case. Call g_log_set_always_fatal.
* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
should be pased by reference.
* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.
* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.
* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
implementation object.
* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
not just windows.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
Use the wrapper object.
2000-10-06 Havoc Pennington <hp@redhat.com>
* Makefile.am (SRC_SUBDIRS): contrib subdir
......
This current (CVS) version of the Win32 backend does *not* even
compile properly. A zipfile with an older snapshot (from before the
merge of the no-flicker branch, and the other recent additions), is
available from http://www.gimp.org/win32/. That should be use by
"production" code until this CVS version is useable. (But note, the
Win32 backend has never been claimed to be "production quality",
although it works OK for the GIMP.)
The Win32 port of GTk+ is a work in progress, and not as stable or
correct as the Unix/X11 version. For more information about the Win32
port, see http://www.gimp.org/win32/ or
http://www.iki.fi/tml/gimp/win32/ .
To build GTk+ on Win32, you need either the Microsoft compiler and
tools, or gcc-2.95 or later. The mingw setup of gcc is preferred, but
This current (CVS) version of the Win32 backend does *not* necessarily
even compile properly. A zipfile with an older snapshot (from before
the merge of the no-flicker branch, and the other recent additions),
is available from http://www.gimp.org/win32/. That should be used by
"production" code until this CVS version is useable. (But note, the
Win32 backend has never been claimed to be "production quality",
although it works OK for the GIMP.)
To build GTk+ on Win32, you need either gcc-2.95 or later, or the
Microsoft compiler and tools. The mingw setup of gcc is preferred, but
you can run gcc also under cygwin-b20.1 or later. Compile in
gdk\win32, gdk and gtk with `nmake -f makefile.msc` or `make -f
makefile.cygwin`. The name makefile.cygwin is misleading, it should
really be called makefile.mingw.
gdk\win32, gdk and gtk with `make -f makefile.mingw` (gcc) or `nmake
-f makefile.msc` (MSVC). The name makefile.mingw needs an explanation:
It refers to the target, not the build environment. As build
envíronment, only cygwin is tested. GNU Make is definitely needed.
See the README.win32 file in the GLib distribution for instructions
how to build with gcc.
......
......@@ -6,7 +6,11 @@
## There is no install target, you have to decide where and
## how to install for yourself.
TOP = ../..
!INCLUDE $(TOP)/build/win32/make.msc
# Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
# definition should possibly go to build/win32/module.def, too.
WTKIT = ..\..\wtkit126
###############################################################
......@@ -28,16 +32,19 @@ CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
LDFLAGS = /link $(LINKDEBUG)
GLIB_VER=1.3
# overwrite version?
GTK_VER=1.3
GLIB = ..\..\glib
CFLAGS = -I . -I .. -I $(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\"
CFLAGS = -I . -I .. $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I ../gdk-pixbuf \
-DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\"
EXTRALIBS = $(WTKIT)\lib\i386\wntab32x.lib $(GLIB_LIBS) \
..\gdk-pixbuf\gdk_pixbuf-$(GDK_PIXBUF_VER).lib $(PANGOWIN32_LIBS)
all: \
..\config.h \
gdkconfig.h \
gdk-$(GTK_VER).dll
gdk-$(GTK_VER).dll \
testgdk.exe
gdk_OBJECTS = \
gdk.obj \
......@@ -49,6 +56,12 @@ gdk_OBJECTS = \
gdkgc.obj \
gdkglobals.obj \
gdkimage.obj \
gdkkeyuni.obj \
gdkpango.obj \
gdkpixmap.obj \
gdkregion-generic.obj \
gdkpixbuf-render.obj \
gdkpolyreg-generic.obj \
gdkrgb.obj \
gdkrectangle.obj \
gdkwindow.obj
......@@ -60,7 +73,10 @@ gdkconfig.h : gdkconfig.h.win32
copy gdkconfig.h.win32 gdkconfig.h
gdk-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def win32\gdk-win32.lib
$(CC) $(CFLAGS) -LD -Fegdk-$(GTK_VER).dll $(gdk_OBJECTS) win32\gdk-win32.lib $(WTKIT)\lib\i386\wntab32x.lib $(GLIB)\glib-$(GLIB_VER).lib gdi32.lib user32.lib imm32.lib shell32.lib ole32.lib uuid.lib win32\gdk.res $(LDFLAGS) /def:gdk.def
$(CC) $(CFLAGS) -LD -Fegdk-$(GTK_VER).dll $(gdk_OBJECTS) win32\gdk-win32.lib $(EXTRALIBS) gdi32.lib user32.lib imm32.lib shell32.lib ole32.lib uuid.lib win32\gdk.res $(LDFLAGS) /def:gdk.def
testgdk.exe : gdk-$(GTK_VER).dll testgdk.obj
$(CC) -Fetestgdk.exe testgdk.obj gdk-$(GTK_VER).lib $(EXTRALIBS) $(LDFLAGS)
.c.obj :
$(CC) $(CFLAGS) -GD -c -DGDK_COMPILATION -DG_LOG_DOMAIN=\"Gdk\" $<
......
......@@ -78,11 +78,24 @@
#define QTESTF(expr, failfmt) \
CQTESTF (TRUE, expr, failfmt)
#ifndef _DEBUG
#define ASSERT(expr) \
do { \
if (!QTEST (expr)) \
printf ("That is fatal. Goodbye\n"), exit (1);\
} while (0)
#else
static void
my_break()
{
G_BREAKPOINT();
}
#define ASSERT(expr) \
do { \
if (!QTEST (expr)) \
printf ("That is fatal. Goodbye\n"), my_break();\
} while (0)
#endif
#define N(a) (sizeof(a)/sizeof(*a))
......@@ -475,6 +488,8 @@ test_gc_function (GdkFunction function,
QTEST (newpixel == ((oldpixel | (~foreground)) & mask)); break;
case GDK_NAND:
QTEST (newpixel == (((~oldpixel) | (~foreground)) & mask)); break;
case GDK_NOR:
QTEST (newpixel == (~oldpixel & ~mask)); break;
case GDK_SET:
QTEST (newpixel == ((~0) & mask)); break;
default:
......@@ -900,8 +915,14 @@ tests (void)
int
main (int argc, char **argv)
{
GLogLevelFlags fatal_mask;
gdk_init (&argc, &argv);
fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
g_log_set_always_fatal (fatal_mask);
tests ();
return return_value;
......
......@@ -122,7 +122,7 @@ gdk_cursor_new (GdkCursorType cursor_type)
if (hcursor == NULL)
WIN32_API_FAILED ("LoadCursor");
GDK_NOTE (MISC, g_print ("gdk_cursor_new: %#x %d\n",
hcursor, cursor_type));
(guint) hcursor, cursor_type));
}
else
{
......@@ -140,6 +140,14 @@ gdk_cursor_new (GdkCursorType cursor_type)
return cursor;
}
static gboolean
color_is_white (GdkColor *color)
{
return (color->red == 0xFFFF
&& color->green == 0xFFFF
&& color->blue == 0xFFFF);
}
GdkCursor*
gdk_cursor_new_from_pixmap (GdkPixmap *source,
GdkPixmap *mask,
......@@ -157,6 +165,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
gint width, height, cursor_width, cursor_height;
guchar residue;
gint ix, iy;
const gboolean bg_is_white = color_is_white (bg);
g_return_val_if_fail (GDK_IS_PIXMAP (source), NULL);
g_return_val_if_fail (GDK_IS_PIXMAP (mask), NULL);
......@@ -193,7 +202,13 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
/* Such complex bit manipulation for this simple task, sigh.
* The X cursor and Windows cursor concepts are quite different.
* We assume here that we are always called with fg == black and
* bg == white.
* bg == white, *or* the other way around. Random colours won't work.
* (Well, you will get a cursor, but not in those colours.)
*/
/* Note: The comments below refer to the case fg==black and
* bg==white, as that was what was implemented first. The fg==white
* (the "if (fg->pixel)" branches) case was added later.
*/
/* First set masked-out source bits, as all source bits matter on Windoze.
......@@ -205,7 +220,10 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
q = (guchar *) mask_image->mem + iy*mask_image->bpl;
for (ix = 0; ix < ((width-1)/8+1); ix++)
*p++ |= ~(*q++);
if (bg_is_white)
*p++ |= ~(*q++);
else
*p++ &= *q++;
}
/* XOR mask is initialized to zero */
......@@ -217,7 +235,11 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
q = xor_mask + iy*cursor_width/8;
for (ix = 0; ix < ((width-1)/8+1); ix++)
*q++ = ~(*p++);
if (bg_is_white)
*q++ = ~(*p++);
else
*q++ = *p++;
q[-1] &= ~residue; /* Clear left-over bits */
}
......@@ -232,6 +254,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
for (ix = 0; ix < ((width-1)/8+1); ix++)
*q++ = ~(*p++);
q[-1] |= residue; /* Set left-over bits */
}
......@@ -240,11 +263,11 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
GDK_NOTE (MISC, g_print ("gdk_cursor_new_from_pixmap: "
"%#x (%dx%d) %#x (%dx%d) = %#x (%dx%d)\n",
GDK_PIXMAP_HBITMAP (source),
(guint) GDK_PIXMAP_HBITMAP (source),
source_impl->width, source_impl->height,
GDK_PIXMAP_HBITMAP (mask),
(guint) GDK_PIXMAP_HBITMAP (mask),
mask_impl->width, mask_impl->height,
hcursor, cursor_width, cursor_height));
(guint) hcursor, cursor_width, cursor_height));
g_free (xor_mask);
g_free (and_mask);
......@@ -270,7 +293,7 @@ _gdk_cursor_destroy (GdkCursor *cursor)
private = (GdkCursorPrivate *) cursor;
GDK_NOTE (MISC, g_print ("_gdk_cursor_destroy: %#x\n",
(cursor->type == GDK_CURSOR_IS_PIXMAP) ? private->hcursor : 0));
(cursor->type == GDK_CURSOR_IS_PIXMAP) ? (guint) private->hcursor : 0));
if (cursor->type == GDK_CURSOR_IS_PIXMAP)
if (!DestroyCursor (private->hcursor))
......
......@@ -791,7 +791,7 @@ target_context_new (void)
result->context = gdk_drag_context_new ();
result->context->is_source = FALSE;
GDK_NOTE (DND, g_print ("target_context_new: %#x\n", result));
GDK_NOTE (DND, g_print ("target_context_new: %p\n", result));
return result;
}
......@@ -810,7 +810,7 @@ source_context_new (void)
result->context = gdk_drag_context_new ();
result->context->is_source = TRUE;
GDK_NOTE (DND, g_print ("source_context_new: %#x\n", result));
GDK_NOTE (DND, g_print ("source_context_new: %p\n", result));
return result;
}
......@@ -951,7 +951,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
MSG *msg = (MSG *) xev;
HANDLE hdrop;
POINT pt;
gint nfiles, i, k;
gint nfiles, i;
guchar fileName[MAX_PATH], linkedFile[MAX_PATH];
if (text_uri_list_atom == GDK_NONE)
......@@ -959,7 +959,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
if (msg->message == WM_DROPFILES)
{
GDK_NOTE (DND, g_print ("WM_DROPFILES: %#x\n", msg->hwnd));
GDK_NOTE (DND, g_print ("WM_DROPFILES: %#x\n", (guint) msg->hwnd));
context = gdk_drag_context_new ();
private = PRIVATE_DATA (context);
......@@ -1075,9 +1075,9 @@ GdkDragContext *
gdk_drag_begin (GdkWindow *window,
GList *targets)
{
GList *tmp_list;
source_drag_context *ctx;
#ifdef OLE2_DND
GList *tmp_list;
data_object *dobj;
HRESULT hResult;
DWORD dwEffect;
......@@ -1149,12 +1149,11 @@ gdk_drag_find_window (GdkDragContext *context,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
{
GdkDragContextPrivateWin32 *private = PRIVATE_DATA (context);
HWND recipient;
POINT pt;
GDK_NOTE (DND, g_print ("gdk_drag_find_window: %#x +%d+%d\n",
(drag_window ? GDK_WINDOW_HWND (drag_window) : 0),
(drag_window ? (guint) GDK_WINDOW_HWND (drag_window) : 0),
x_root, y_root));
pt.x = x_root;
......@@ -1164,7 +1163,7 @@ gdk_drag_find_window (GdkDragContext *context,
*dest_window = NULL;
else
{
*dest_window = gdk_win32_handle_table_lookup (recipient);
*dest_window = gdk_win32_handle_table_lookup (GPOINTER_TO_UINT(recipient));
if (*dest_window)
gdk_drawable_ref (*dest_window);
*protocol = GDK_DRAG_PROTO_WIN32_DROPFILES;
......@@ -1266,7 +1265,7 @@ gdk_window_register_dnd (GdkWindow *window)
g_return_if_fail (window != NULL);
GDK_NOTE (DND, g_print ("gdk_window_register_dnd: %#x\n",
GDK_WINDOW_HWND (window)));
(guint) GDK_WINDOW_HWND (window)));
/* We always claim to accept dropped files, but in fact we might not,
* of course. This function is called in such a way that it cannot know
......
......@@ -1197,7 +1197,7 @@ propagate (GdkWindow **window,
if ((*doesnt_want_it) (GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (*window)->impl)->event_mask, msg))
{
/* Owner doesn't want it, propagate to parent. */
if (GDK_WINDOW (GDK_WINDOW_OBJECT (window)->parent) == gdk_parent_root)
if (GDK_WINDOW (GDK_WINDOW_OBJECT (*window)->parent) == gdk_parent_root)
{
/* No parent; check if grabbed */
if (grab_window != NULL)
......@@ -1396,6 +1396,30 @@ gdk_event_translate (GdkEvent *event,
PostMessage (msg->hwnd, msg->message,
msg->wParam, msg->lParam);
}
#ifndef WITHOUT_WM_CREATE
else if (WM_CREATE == msg->message)
{
window = (UNALIGNED GdkWindow*) (((LPCREATESTRUCT) msg->lParam)->lpCreateParams);
GDK_WINDOW_HWND (window) = msg->hwnd;
GDK_NOTE (EVENTS, g_print ("gdk_event_translate: created %#x\n",
(guint) msg->hwnd));
# if 0
/* This should handle allmost all the other window==NULL cases.
* This code is executed while gdk_window_new is in it's
* CreateWindowEx call.
* Don't insert xid there a second time, if it's done here.
*/
gdk_drawable_ref (window);
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND(window), window);
# endif
}
else
{
GDK_NOTE (EVENTS, g_print ("gdk_event_translate: %s for %#x (NULL)\n",
gdk_win32_message_name(msg->message),
(guint) msg->hwnd));
}
#endif
return FALSE;
}
......
......@@ -945,9 +945,9 @@ gdk_win32_hdc_get (GdkDrawable *drawable,
g_assert (win32_gc->hdc == NULL);
win32_gc->hwnd = GDK_DRAWABLE_HANDLE (drawable);
if (GDK_IS_PIXMAP (drawable))
win32_gc->hwnd = GDK_DRAWABLE_IMPL_WIN32(drawable)->handle;
if (GDK_IS_PIXMAP_IMPL_WIN32 (drawable))
{
if ((win32_gc->hdc = CreateCompatibleDC (NULL)) == NULL)
WIN32_GDI_FAILED ("CreateCompatibleDC"), ok = FALSE;
......@@ -1151,7 +1151,7 @@ gdk_win32_hdc_release (GdkDrawable *drawable,
WIN32_GDI_FAILED ("UnrealizeObject");
}
#endif
if (GDK_IS_PIXMAP (drawable))
if (GDK_IS_PIXMAP_IMPL_WIN32 (drawable))
{
if (!DeleteDC (win32_gc->hdc))
WIN32_GDI_FAILED ("DeleteDC");
......
......@@ -682,8 +682,8 @@ gdk_window_queue_translation (GdkWindow *window,
item->u.translate.dx = dx;
item->u.translate.dy = dy;
GDK_NOTE (EVENTS, g_print ("gdk_window_queue_translation %#x %d %d,%d\n",
GDK_WINDOW_HWND (window),
GDK_NOTE (EVENTS, g_print ("gdk_window_queue_translation %#x %ld %d,%d\n",
(guint) GDK_WINDOW_HWND (window),
item->serial,
dx, dy));
......@@ -702,8 +702,8 @@ _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
item->type = GDK_WINDOW_QUEUE_ANTIEXPOSE;
item->u.antiexpose.area = area;
GDK_NOTE (EVENTS, g_print ("_gdk_windowing_window_queue_antiexpose %#x %d %dx%d@+%d+%d\n",
GDK_WINDOW_HWND (window),
GDK_NOTE (EVENTS, g_print ("_gdk_windowing_window_queue_antiexpose %#x %ld %dx%d@+%d+%d\n",
(guint) GDK_WINDOW_HWND (window),
item->serial,
area->extents.x2 - area->extents.x1,
area->extents.y2 - area->extents.y1,
......@@ -727,8 +727,8 @@ _gdk_window_process_expose (GdkWindow *window,
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
GDK_NOTE (EVENTS, g_print ("_gdk_window_process_expose %#x %d %dx%d@+%d+%d\n",
GDK_WINDOW_HWND (window), serial,
GDK_NOTE (EVENTS, g_print ("_gdk_window_process_expose %#x %ld %dx%d@+%d+%d\n",
(guint) GDK_WINDOW_HWND (window), serial,
area->width, area->height, area->x, area->y));
while (tmp_list)
......@@ -802,8 +802,6 @@ gdk_window_tmp_reset_bg (GdkWindow *window)
if (obj->bg_pixmap)
{
HBITMAP hbitmap;
/* ??? */
}
else
......@@ -825,6 +823,9 @@ gdk_window_clip_changed (GdkWindow *window,
if (((GdkWindowObject *)window)->input_only)
return;
obj = (GdkWindowObject *) window;
impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);