+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.
## 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
###############################################################
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 \
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
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\" $<
#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))
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:
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;
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
{
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,
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);
/* 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.
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 */
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 */
}
for (ix = 0; ix < ((width-1)/8+1); ix++)
*q++ = ~(*p++);
+
q[-1] |= residue; /* Set left-over bits */
}
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);
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))
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;
}
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;
}
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)
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);
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;
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;
*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;
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
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)
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;
}
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;
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");
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));
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,
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)
if (obj->bg_pixmap)
{
- HBITMAP hbitmap;
-
/* ??? */
}
else
if (((GdkWindowObject *)window)->input_only)
return;
+ obj = (GdkWindowObject *) window;
+ impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
+
old_clip_region = gdk_region_rectangle (old_clip);
new_clip_region = gdk_region_rectangle (new_clip);
gdk_region_destroy (new_clip_region);
gdk_region_destroy (old_clip_region);
}
-
BITMAP bm;
int i;
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+ g_return_val_if_fail (GDK_IS_DRAWABLE (window), NULL);
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_IS_WINDOW (window) && GDK_WINDOW_DESTROYED (window))
return NULL;
GDK_NOTE (MISC, g_print ("gdk_image_get: %#x %dx%d@+%d+%d\n",
#include <stdio.h>
#include <math.h>
+#include "gdk.h"
#include "gdkinput.h"
#include "gdkinternals.h"
#include "gdkprivate-win32.h"
GdkTimeCoord ***events,
gint *n_events)
{
- GdkTimeCoord **coords;
- int i;
-
g_return_val_if_fail (window != NULL, FALSE);
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
g_return_val_if_fail (events != NULL, FALSE);
GdkWindow *window)
{
#ifdef HAVE_WINTAB
+#if !USE_SYSCONTEXT
GdkWindow *current_window;
+#endif
GdkWindowObject *obj;
GdkWindowImplWin32 *impl;
GdkInputWindow *input_window;
POINT pt;
PACKET packet;
- gint return_val;
gint k;
gint x, y;
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
| GDK_BUTTON5_MASK));
- GDK_NOTE (EVENTS, g_print ("WINTAB button %s:%d %g,%g %g %g,%g\n",
+ GDK_NOTE (EVENTS, g_print ("WINTAB button %s:%d %g,%g\n",
(event->button.type == GDK_BUTTON_PRESS ?
"press" : "release"),
event->button.button,
GdkPixmap *wrapper = GDK_PIXMAP (GDK_DRAWABLE_IMPL_WIN32 (impl)->wrapper);
GDK_NOTE (MISC, g_print ("gdk_pixmap_impl_win32_finalize: %#x\n",
- GDK_PIXMAP_HBITMAP (object)));
+ (guint) GDK_PIXMAP_HBITMAP (wrapper)));
- if (!DeleteObject (GDK_PIXMAP_HBITMAP (object)))
+ if (!DeleteObject (GDK_PIXMAP_HBITMAP (wrapper)))
WIN32_GDI_FAILED ("DeleteObject");
- gdk_win32_handle_table_remove (GDK_PIXMAP_HBITMAP (object));
+ gdk_win32_handle_table_remove (GDK_PIXMAP_HBITMAP (wrapper));
G_OBJECT_CLASS (parent_class)->finalize (object);
}
}
ReleaseDC (GDK_WINDOW_HWND (window), hdc);
- GDK_NOTE (MISC, g_print ("... = %#x\n", GDK_PIXMAP_HBITMAP (pixmap)));
+ GDK_NOTE (MISC, g_print ("... = %#x\n",
+ (guint) GDK_PIXMAP_HBITMAP (pixmap)));
- gdk_win32_handle_table_insert (GDK_PIXMAP_HBITMAP (pixmap), pixmap);
+ gdk_win32_handle_table_insert (&GDK_PIXMAP_HBITMAP (pixmap), pixmap);
return pixmap;
}
draw_impl->handle = CreateBitmap (width, height, 1, 1, bits);
GDK_NOTE (MISC, g_print ("gdk_bitmap_create_from_data: %dx%d = %#x\n",
- width, height, GDK_PIXMAP_HBITMAP (pixmap)));
+ width, height,
+ (guint) GDK_PIXMAP_HBITMAP (pixmap)));
g_free (bits);
draw_impl->colormap = NULL;
- gdk_win32_handle_table_insert (GDK_PIXMAP_HBITMAP (pixmap), pixmap);
+ gdk_win32_handle_table_insert (&GDK_PIXMAP_HBITMAP (pixmap), pixmap);
return pixmap;
}
GDK_NOTE (MISC, g_print ("gdk_pixmap_create_from_data: %dx%dx%d = %#x\n",
width, height, depth,
- GDK_PIXMAP_HBITMAP (result)));
+ (guint) GDK_PIXMAP_HBITMAP (result)));
return result;
}
GdkPixmapImplWin32 *pix_impl;
HBITMAP hbitmap;
SIZE size;
- unsigned int x_ret, y_ret, w_ret, h_ret, bw_ret, depth_ret;
+ unsigned int w_ret, h_ret;
/* check to make sure we were passed a HBITMAP */
g_return_val_if_fail(GetObjectType ((HGDIOBJ) anid) == OBJ_BITMAP, NULL);
pix_impl->width = w_ret;
pix_impl->height = h_ret;
- gdk_win32_handle_table_insert (GDK_PIXMAP_HBITMAP (pixmap), pixmap);
+ gdk_win32_handle_table_insert (&GDK_PIXMAP_HBITMAP (pixmap), pixmap);
return pixmap;
}
#include <gdk/gdkprivate.h>
#include "gdkwin32.h"
-void gdk_win32_handle_table_insert (HANDLE handle,
+/* Routines from gdkgeometry-win32.c */
+void
+_gdk_window_init_position (GdkWindow *window);
+void
+_gdk_window_move_resize_child (GdkWindow *window,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+
+void gdk_win32_selection_init (void);
+void gdk_win32_dnd_exit (void);
+
+void gdk_win32_handle_table_insert (HANDLE *handle,
gpointer data);
void gdk_win32_handle_table_remove (HANDLE handle);
#endif
/* Missing messages */
+#ifndef WM_SYNCPAINT
+#define WM_SYNCPAINT 0x88
+#endif
#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL 0X20A
#endif
return (*a == *b);
}
-/* Note that the handle is passed by value to this function! */
void
-gdk_win32_handle_table_insert (HANDLE handle,
+gdk_win32_handle_table_insert (HANDLE *handle,
gpointer data)
{
g_return_if_fail (handle != NULL);
handle_ht = g_hash_table_new ((GHashFunc) gdk_handle_hash,
(GCompareFunc) gdk_handle_compare);
- g_hash_table_insert (handle_ht, &handle, data);
+ g_hash_table_insert (handle_ht, handle, data);
}
void
impl->width = width;
impl->height = height;
- gdk_win32_handle_table_insert (gdk_root_window, gdk_parent_root);
+ gdk_win32_handle_table_insert (&gdk_root_window, gdk_parent_root);
}
/* The Win API function AdjustWindowRect may return negative values
WideCharToMultiByte (GetACP (), 0, wctitle, -1,
mbtitle, 3*titlelen, NULL, NULL);
+#ifdef WITHOUT_WM_CREATE
draw_impl->handle = CreateWindowEx (dwExStyle,
MAKEINTRESOURCE(klass),
mbtitle,
NULL,
gdk_app_hmodule,
NULL);
+#else
+ {
+ HWND hwndNew =
+ CreateWindowEx (dwExStyle,
+ MAKEINTRESOURCE(klass),
+ mbtitle,
+ dwStyle,
+ x, y,
+ width, height,
+ hparent,
+ NULL,
+ gdk_app_hmodule,
+ window);
+ if (GDK_WINDOW_HWND (window) != hwndNew)
+ {
+ g_warning("gdk_window_new: gdk_event_translate::WM_CREATE (%#x, %#x) HWND mismatch.",
+ GDK_WINDOW_HWND (window), hwndNew);
+
+ /* HB: IHMO due to a race condition the handle was increased by
+ * one, which causes much trouble. Because I can't find the
+ * real bug, try to workaround it ...
+ * To reproduce: compile with MSVC 5, DEBUG=1
+ */
+# if 0
+ gdk_win32_handle_table_remove (GDK_WINDOW_HWND (window));
+ GDK_WINDOW_HWND (window) = hwndNew;
+ gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
+# else
+ /* the old behaviour, but with warning */
+ GDK_WINDOW_HWND (window) = hwndNew;
+# endif
+
+ }
+ }
+ gdk_drawable_ref (window);
+ gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
+#endif
GDK_NOTE (MISC,
g_print ("gdk_window_new: %s %s %dx%d@+%d+%d %#x = %#x\n"
return NULL;
}
+#ifdef WITHOUT_WM_CREATE
gdk_drawable_ref (window);
- gdk_win32_handle_table_insert (GDK_WINDOW_HWND (window), window);
+ gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
+#endif
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
(attributes->cursor) :
private->depth = gdk_visual_get_system ()->depth;
gdk_drawable_ref (window);
- gdk_win32_handle_table_insert (GDK_WINDOW_HWND (window), window);
+ gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
return window;
}
# Nothing much configurable below
+TOP = ../../..
+!INCLUDE $(TOP)/build/win32/make.msc
+
!IFNDEF DEBUG
# Full optimization:
OPTIMIZE = -Ox -MD
LDFLAGS = /link /machine:ix86 $(LINKDEBUG)
-GLIB_VER=1.3
GTK_VER=1.3
-GLIB = ..\..\..\glib
-CFLAGS = -I. -I.. -I..\.. -I$(WTKIT)\include -I$(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\"
+CFLAGS = -I. -I.. -I..\.. $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I$(WTKIT)\include -I$(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\"
all: \
..\..\config.h \
gdkglobals-win32.obj \
gdkim-win32.obj \
gdkimage-win32.obj \
+ gdkinput.obj \
gdkinput-win32.obj \
gdkmain-win32.obj \
+ gdkpango-win32.obj \
gdkpixmap-win32.obj \
gdkproperty-win32.obj \
- gdkregion-win32.obj \
+# gdkregion-win32.obj \
gdkselection-win32.obj \
gdkvisual-win32.obj \
gdkwin32id.obj \
gtk_text_buffer_get_iter_at_mark
gtk_text_buffer_get_iter_at_offset
gtk_text_buffer_get_line_count
+ gtk_text_buffer_get_tag_table
gtk_text_buffer_create_mark
gtk_text_buffer_create_tag
gtk_text_buffer_delete_mark
gtk_text_get_type
gtk_text_insert
gtk_text_iter_backward_chars
+ gtk_text_iter_backward_to_tag_toggle
+ gtk_text_iter_begins_tag
gtk_text_iter_forward_chars
gtk_text_iter_forward_line
gtk_text_iter_forward_search
+ gtk_text_iter_forward_to_tag_toggle
+ gtk_text_iter_ends_tag
gtk_text_iter_equal
gtk_text_iter_get_attributes
gtk_text_iter_get_line
gtk_text_iter_get_offset
gtk_text_iter_get_text
+ gtk_text_iter_get_toggled_tags
gtk_text_iter_is_last
gtk_text_iter_next_char
gtk_text_iter_prev_char
gtk_text_iter_spew
+ gtk_text_iter_toggles_tag
gtk_text_new
gtk_text_set_adjustments
gtk_text_set_editable
gtk_text_set_point
gtk_text_set_word_wrap
gtk_text_tag_get_type
+ gtk_text_tag_table_lookup
gtk_text_thaw
gtk_text_unknown_char
gtk_text_unknown_char_utf8