diff options
author | Tor Lillqvist <tml@iki.fi> | 2000-07-23 01:18:34 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2000-07-23 01:18:34 +0000 |
commit | 20b5d8ec2fc3ec4505ba7327ffae006a7bfa2e09 (patch) | |
tree | 5f6d561d69e9613fd4170496ddd4e025eb2c848b | |
parent | a52f7c348e39035da76ecd51500955f29eab01ca (diff) | |
download | gdk-pixbuf-20b5d8ec2fc3ec4505ba7327ffae006a7bfa2e09.tar.gz |
More work on GDK for Win32. Still in an intermediate state.
2000-07-23 Tor Lillqvist <tml@iki.fi>
More work on GDK for Win32. Still in an intermediate state.
* gdk/makefile.cygwin
* gdk/win32/makefile.cygwin: Removed.
* gdk/makefile.mingw.in
* gdk/win32/makefile.mingw.in: New files.
* gdk/Makefile.am
* gdk/win32/Makefile.am: Generate and distribute them.
* gdk/win32/gdkwindow-win32.h
* gdk/win32/gdkdrawable-win32.h
* gdk/win32/gdkpixmap-win32.h: New files.
* gdk/win32/gdkcolor-win32.c
* gdk/win32/gdkcursor-win32.c
* gdk/win32/gdkgc-win32.c
* gdk/win32/gdkimage-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Update data structures. Cosmetics:
don't use fields and variables called xcursor, xid, etc (leftovers
from the X11 backend).
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 24 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 24 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 24 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 24 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 24 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 24 | ||||
-rw-r--r-- | gdk/Makefile.am | 5 | ||||
-rw-r--r-- | gdk/makefile.cygwin | 56 | ||||
-rw-r--r-- | gdk/makefile.mingw.in | 73 | ||||
-rw-r--r-- | gdk/win32/Makefile.am | 8 | ||||
-rw-r--r-- | gdk/win32/gdkcolor-win32.c | 4 | ||||
-rw-r--r-- | gdk/win32/gdkcursor-win32.c | 80 | ||||
-rw-r--r-- | gdk/win32/gdkdrawable-win32.h | 72 | ||||
-rw-r--r-- | gdk/win32/gdkgc-win32.c | 6 | ||||
-rw-r--r-- | gdk/win32/gdkimage-win32.c | 100 | ||||
-rw-r--r-- | gdk/win32/gdkpixmap-win32.h | 72 | ||||
-rw-r--r-- | gdk/win32/gdkprivate-win32.h | 6 | ||||
-rw-r--r-- | gdk/win32/gdkwin32.h | 91 | ||||
-rw-r--r-- | gdk/win32/gdkwindow-win32.h | 118 | ||||
-rw-r--r-- | gdk/win32/makefile.cygwin | 84 | ||||
-rw-r--r-- | gdk/win32/makefile.mingw.in | 87 |
22 files changed, 744 insertions, 286 deletions
@@ -3,6 +3,30 @@ * configure.in: Check for mkstemp and sigsetjmp. Output gdk-pixbuf/makefile.mingw and gdk-pixbuf/pixops/makefile.mingw. + More work on GDK for Win32. Still in an intermediate state. + + * gdk/makefile.cygwin + * gdk/win32/makefile.cygwin: Removed. + + * gdk/makefile.mingw.in + * gdk/win32/makefile.mingw.in: New files. + + * gdk/Makefile.am + * gdk/win32/Makefile.am: Generate and distribute them. + + * gdk/win32/gdkwindow-win32.h + * gdk/win32/gdkdrawable-win32.h + * gdk/win32/gdkpixmap-win32.h: New files. + + * gdk/win32/gdkcolor-win32.c + * gdk/win32/gdkcursor-win32.c + * gdk/win32/gdkgc-win32.c + * gdk/win32/gdkimage-win32.c + * gdk/win32/gdkprivate-win32.h + * gdk/win32/gdkwin32.h: Update data structures. Cosmetics: + don't use fields and variables called xcursor, xid, etc (leftovers + from the X11 backend). + Sat Jul 22 17:41:26 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.[ch]: Fix some problems with vertical diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 6d0d2d8f8..dd6f3dc1a 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -3,6 +3,30 @@ * configure.in: Check for mkstemp and sigsetjmp. Output gdk-pixbuf/makefile.mingw and gdk-pixbuf/pixops/makefile.mingw. + More work on GDK for Win32. Still in an intermediate state. + + * gdk/makefile.cygwin + * gdk/win32/makefile.cygwin: Removed. + + * gdk/makefile.mingw.in + * gdk/win32/makefile.mingw.in: New files. + + * gdk/Makefile.am + * gdk/win32/Makefile.am: Generate and distribute them. + + * gdk/win32/gdkwindow-win32.h + * gdk/win32/gdkdrawable-win32.h + * gdk/win32/gdkpixmap-win32.h: New files. + + * gdk/win32/gdkcolor-win32.c + * gdk/win32/gdkcursor-win32.c + * gdk/win32/gdkgc-win32.c + * gdk/win32/gdkimage-win32.c + * gdk/win32/gdkprivate-win32.h + * gdk/win32/gdkwin32.h: Update data structures. Cosmetics: + don't use fields and variables called xcursor, xid, etc (leftovers + from the X11 backend). + Sat Jul 22 17:41:26 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.[ch]: Fix some problems with vertical diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6d0d2d8f8..dd6f3dc1a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -3,6 +3,30 @@ * configure.in: Check for mkstemp and sigsetjmp. Output gdk-pixbuf/makefile.mingw and gdk-pixbuf/pixops/makefile.mingw. + More work on GDK for Win32. Still in an intermediate state. + + * gdk/makefile.cygwin + * gdk/win32/makefile.cygwin: Removed. + + * gdk/makefile.mingw.in + * gdk/win32/makefile.mingw.in: New files. + + * gdk/Makefile.am + * gdk/win32/Makefile.am: Generate and distribute them. + + * gdk/win32/gdkwindow-win32.h + * gdk/win32/gdkdrawable-win32.h + * gdk/win32/gdkpixmap-win32.h: New files. + + * gdk/win32/gdkcolor-win32.c + * gdk/win32/gdkcursor-win32.c + * gdk/win32/gdkgc-win32.c + * gdk/win32/gdkimage-win32.c + * gdk/win32/gdkprivate-win32.h + * gdk/win32/gdkwin32.h: Update data structures. Cosmetics: + don't use fields and variables called xcursor, xid, etc (leftovers + from the X11 backend). + Sat Jul 22 17:41:26 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.[ch]: Fix some problems with vertical diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 6d0d2d8f8..dd6f3dc1a 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -3,6 +3,30 @@ * configure.in: Check for mkstemp and sigsetjmp. Output gdk-pixbuf/makefile.mingw and gdk-pixbuf/pixops/makefile.mingw. + More work on GDK for Win32. Still in an intermediate state. + + * gdk/makefile.cygwin + * gdk/win32/makefile.cygwin: Removed. + + * gdk/makefile.mingw.in + * gdk/win32/makefile.mingw.in: New files. + + * gdk/Makefile.am + * gdk/win32/Makefile.am: Generate and distribute them. + + * gdk/win32/gdkwindow-win32.h + * gdk/win32/gdkdrawable-win32.h + * gdk/win32/gdkpixmap-win32.h: New files. + + * gdk/win32/gdkcolor-win32.c + * gdk/win32/gdkcursor-win32.c + * gdk/win32/gdkgc-win32.c + * gdk/win32/gdkimage-win32.c + * gdk/win32/gdkprivate-win32.h + * gdk/win32/gdkwin32.h: Update data structures. Cosmetics: + don't use fields and variables called xcursor, xid, etc (leftovers + from the X11 backend). + Sat Jul 22 17:41:26 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.[ch]: Fix some problems with vertical diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6d0d2d8f8..dd6f3dc1a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -3,6 +3,30 @@ * configure.in: Check for mkstemp and sigsetjmp. Output gdk-pixbuf/makefile.mingw and gdk-pixbuf/pixops/makefile.mingw. + More work on GDK for Win32. Still in an intermediate state. + + * gdk/makefile.cygwin + * gdk/win32/makefile.cygwin: Removed. + + * gdk/makefile.mingw.in + * gdk/win32/makefile.mingw.in: New files. + + * gdk/Makefile.am + * gdk/win32/Makefile.am: Generate and distribute them. + + * gdk/win32/gdkwindow-win32.h + * gdk/win32/gdkdrawable-win32.h + * gdk/win32/gdkpixmap-win32.h: New files. + + * gdk/win32/gdkcolor-win32.c + * gdk/win32/gdkcursor-win32.c + * gdk/win32/gdkgc-win32.c + * gdk/win32/gdkimage-win32.c + * gdk/win32/gdkprivate-win32.h + * gdk/win32/gdkwin32.h: Update data structures. Cosmetics: + don't use fields and variables called xcursor, xid, etc (leftovers + from the X11 backend). + Sat Jul 22 17:41:26 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.[ch]: Fix some problems with vertical diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6d0d2d8f8..dd6f3dc1a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -3,6 +3,30 @@ * configure.in: Check for mkstemp and sigsetjmp. Output gdk-pixbuf/makefile.mingw and gdk-pixbuf/pixops/makefile.mingw. + More work on GDK for Win32. Still in an intermediate state. + + * gdk/makefile.cygwin + * gdk/win32/makefile.cygwin: Removed. + + * gdk/makefile.mingw.in + * gdk/win32/makefile.mingw.in: New files. + + * gdk/Makefile.am + * gdk/win32/Makefile.am: Generate and distribute them. + + * gdk/win32/gdkwindow-win32.h + * gdk/win32/gdkdrawable-win32.h + * gdk/win32/gdkpixmap-win32.h: New files. + + * gdk/win32/gdkcolor-win32.c + * gdk/win32/gdkcursor-win32.c + * gdk/win32/gdkgc-win32.c + * gdk/win32/gdkimage-win32.c + * gdk/win32/gdkprivate-win32.h + * gdk/win32/gdkwin32.h: Update data structures. Cosmetics: + don't use fields and variables called xcursor, xid, etc (leftovers + from the X11 backend). + Sat Jul 22 17:41:26 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.[ch]: Fix some problems with vertical diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6d0d2d8f8..dd6f3dc1a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -3,6 +3,30 @@ * configure.in: Check for mkstemp and sigsetjmp. Output gdk-pixbuf/makefile.mingw and gdk-pixbuf/pixops/makefile.mingw. + More work on GDK for Win32. Still in an intermediate state. + + * gdk/makefile.cygwin + * gdk/win32/makefile.cygwin: Removed. + + * gdk/makefile.mingw.in + * gdk/win32/makefile.mingw.in: New files. + + * gdk/Makefile.am + * gdk/win32/Makefile.am: Generate and distribute them. + + * gdk/win32/gdkwindow-win32.h + * gdk/win32/gdkdrawable-win32.h + * gdk/win32/gdkpixmap-win32.h: New files. + + * gdk/win32/gdkcolor-win32.c + * gdk/win32/gdkcursor-win32.c + * gdk/win32/gdkgc-win32.c + * gdk/win32/gdkimage-win32.c + * gdk/win32/gdkprivate-win32.h + * gdk/win32/gdkwin32.h: Update data structures. Cosmetics: + don't use fields and variables called xcursor, xid, etc (leftovers + from the X11 backend). + Sat Jul 22 17:41:26 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.[ch]: Fix some problems with vertical diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 223e826fc..d4b3e924f 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -6,7 +6,7 @@ DIST_SUBDIRS=linux-fb nanox win32 x11 EXTRA_DIST = \ gdkconfig.h.win32 \ gdk.def \ - makefile.cygwin \ + makefile.mingw \ makefile.msc common_includes = @STRIP_BEGIN@ \ @@ -179,6 +179,9 @@ stamp-gc-h: ../config.status cd .. && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=gdk/gdkconfig.h ./config.status echo timestamp > stamp-gc-h +makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gdk/makefile.mingw.in + cd $(top_builddir) && CONFIG_FILES=gdk/$@ CONFIG_HEADERS= $(SHELL) ./config.status + .PHONY: files files: diff --git a/gdk/makefile.cygwin b/gdk/makefile.cygwin deleted file mode 100644 index 045b83942..000000000 --- a/gdk/makefile.cygwin +++ /dev/null @@ -1,56 +0,0 @@ -## Makefile for building the GDK DLL with gcc-2.95 or later on cygwin -## Use: make -f makefile.cygwin - -## You must first build the Win32-dependent sources in the win32 subdirectory. - -## There is no install target, you have to decide where and -## how to install for yourself. - -OPTIMIZE = -g - -TOP = ../.. - -include $(TOP)/build/win32/make.mingw - -################################################################ - -# Nothing much configurable below - -INCLUDES = -I . -I .. -I ../gdk-pixbuf -DEPCFLAGS = $(GLIB_CFLAGS) $(PANGO_CFLAGS) -DEFINES = -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" - -all: \ - ../config.h \ - gdkconfig.h \ - gdk-$(GTK_VER).dll - -gdk_OBJECTS = \ - gdk.o \ - gdkcolor.o \ - gdkcursor.o \ - gdkdraw.o \ - gdkevents.o \ - gdkfont.o \ - gdkgc.o \ - gdkglobals.o \ - gdkimage.o \ - gdkkeyuni.o \ - gdkpango.o \ - gdkpixbuf-drawable.o \ - gdkpixbuf-render.o \ - gdkpixmap.o \ - gdkpolyreg-generic.o \ - gdkrgb.o \ - gdkrectangle.o \ - gdkregion-generic.o \ - gdkwindow.o - -../config.h : ../config.h.win32 - cp $< $@ - -gdkconfig.h : gdkconfig.h.win32 - cp $< $@ - -gdk-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def win32/libgdk-win32.a win32/gdk-win32res.o - $(GLIB)/build-dll gdk $(GTK_VER) gdk.def $(gdk_OBJECTS) -L win32 -lgdk-win32 -lwntab32x $(GLIB_LIBS) -lgdi32 -luser32 -limm32 -lshell32 -lole32 -luuid $(LDFLAGS) win32/gdk-win32res.o diff --git a/gdk/makefile.mingw.in b/gdk/makefile.mingw.in new file mode 100644 index 000000000..8c35a8eef --- /dev/null +++ b/gdk/makefile.mingw.in @@ -0,0 +1,73 @@ +## Makefile for building the GDK DLL with gcc on Win32 +## Use: make -f makefile.mingw + +## There is no install target, you have to decide where and +## how to install for yourself. + +TOP = ../.. + +include ../build/win32/make.mingw + +# Possibly override GTK+ version from build/win32/module.defs +GTK_VER = @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@ + +OPTIMIZE = -g + +INCLUDES = -I . -I .. -I ../gdk-pixbuf +DEPCFLAGS = $(GLIB_CFLAGS) $(PANGO_CFLAGS) +DEFINES = -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" + +all: \ + ../config.h \ + gdkconfig.h \ + win32/libgdk-win32.a \ + win32/gdk-win32res.o \ + gdk-win32-$(GTK_VER).dll + +gdk_OBJECTS = \ + gdk.o \ + gdkcolor.o \ + gdkcursor.o \ + gdkdraw.o \ + gdkevents.o \ + gdkfont.o \ + gdkgc.o \ + gdkglobals.o \ + gdkimage.o \ + gdkkeyuni.o \ + gdkpango.o \ + gdkpixbuf-drawable.o \ + gdkpixbuf-render.o \ + gdkpixmap.o \ + gdkpolyreg-generic.o \ + gdkrgb.o \ + gdkrectangle.o \ + gdkregion-generic.o \ + gdkwindow.o + +../config.h : ../config.h.win32 + cp $< $@ + +gdkconfig.h : gdkconfig.h.win32 + cp $< $@ + +win32/libgdk-win32.a : FRC + cd win32 && $(MAKE) -f makefile.mingw libgdk-win32.a + +win32/gdk-win32res.o : FRC + cd win32 && $(MAKE) -f makefile.mingw gdk-win32res.o + +gdk-win32-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def win32/libgdk-win32.a win32/gdk-win32res.o win32/libwntab32x.a + $(GLIB)/build-dll gdk-win32 $(GTK_VER) gdk.def $(gdk_OBJECTS) win32/gdk-win32.a win32/wntab32x.a $(GLIB_LIBS) -lgdi32 -luser32 -limm32 -lshell32 -lole32 -luuid $(LDFLAGS) win32/gdk-win32res.o + +win32/libwntab32x.a : FRC + cd win32 && $(MAKE) -f makefile.mingw libwntab32x.a + +# Hack to get an updated makefile.mingw automatically after updating +# makefile.mingw.in. Only for developer use. +makefile.mingw: makefile.mingw.in + sed -e 's,@GTK_MAJOR[_]VERSION@,@GTK_MAJOR_VERSION@,' \ + -e 's,@GTK_MINOR[_]VERSION@,@GTK_MINOR_VERSION@,' <$< >$@ + +.PHONY: FRC + diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am index d045605b6..430ffdfa5 100644 --- a/gdk/win32/Makefile.am +++ b/gdk/win32/Makefile.am @@ -1,5 +1,5 @@ EXTRA_DIST = \ - makefile.cygwin \ + makefile.mingw \ makefile.msc \ gdkcc-win32.c \ gdkcolor-win32.c \ @@ -24,8 +24,6 @@ EXTRA_DIST = \ gdkwin32.h \ gdkwin32id.c \ gdkwindow-win32.c \ - makefile.cygwin \ - makefile.msc \ surrogate-dimm.h \ rc/gdk.rc \ rc/gtk.ico \ @@ -106,3 +104,7 @@ EXTRA_DIST = \ rc/cursor94.cur \ rc/cursor96.cur \ rc/cursor98.cur + +makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gdk/win32/makefile.mingw.in + cd $(top_builddir) && CONFIG_FILES=gdk/win32/$@ CONFIG_HEADERS= $(SHELL) ./config.status + diff --git a/gdk/win32/gdkcolor-win32.c b/gdk/win32/gdkcolor-win32.c index 35648e73c..21c07bd9e 100644 --- a/gdk/win32/gdkcolor-win32.c +++ b/gdk/win32/gdkcolor-win32.c @@ -347,7 +347,7 @@ alloc_color(Colormap colormap, /* * Determine what color will actually be used on non-colormap systems. */ - *pixelp = GetNearestColor (gdk_DC, RGB(entry.peRed, entry.peGreen, entry.peBlue)); + *pixelp = GetNearestColor (gdk_display_hdc, RGB(entry.peRed, entry.peGreen, entry.peBlue)); color->peRed = GetRValue (*pixelp); color->peGreen = GetGValue (*pixelp); @@ -1562,7 +1562,7 @@ gdk_colormap_get_system_size (void) { gint bitspixel; - bitspixel = GetDeviceCaps (gdk_DC, BITSPIXEL); + bitspixel = GetDeviceCaps (gdk_display_hdc, BITSPIXEL); if (bitspixel == 1) return 2; diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c index 8ef0c58cf..ac10ff0d4 100644 --- a/gdk/win32/gdkcursor-win32.c +++ b/gdk/win32/gdkcursor-win32.c @@ -19,8 +19,10 @@ #include "config.h" +#include "gdkwin32.h" #include "gdkcursor.h" #include "gdkinternals.h" +#include "gdkpixmap-win32.h" #include "gdkprivate-win32.h" static const struct { const char *name; int type; } cursors[] = { @@ -109,28 +111,28 @@ gdk_cursor_new (GdkCursorType cursor_type) { GdkCursorPrivate *private; GdkCursor *cursor; - HCURSOR xcursor; + HCURSOR hcursor; int i; for (i = 0; cursors[i].name != NULL && cursors[i].type != cursor_type; i++) ; if (cursors[i].name != NULL) { - xcursor = LoadCursor (gdk_DLLInstance, cursors[i].name); - if (xcursor == NULL) + hcursor = LoadCursor (gdk_dll_hinstance, cursors[i].name); + if (hcursor == NULL) WIN32_API_FAILED ("LoadCursor"); GDK_NOTE (MISC, g_print ("gdk_cursor_new: %#x %d\n", - xcursor, cursor_type)); + hcursor, cursor_type)); } else { g_warning ("gdk_cursor_new: no cursor %d found", cursor_type); - xcursor = NULL; + hcursor = NULL; } private = g_new (GdkCursorPrivate, 1); - private->xcursor = xcursor; + private->hcursor = hcursor; cursor = (GdkCursor*) private; cursor->type = cursor_type; cursor->ref_count = 1; @@ -148,10 +150,10 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, { GdkCursorPrivate *private; GdkCursor *cursor; - GdkDrawablePrivate *source_private, *mask_private; + GdkPixmapImplWin32 *source_impl, *mask_impl; GdkImage *source_image, *mask_image; - HCURSOR xcursor; - guchar *p, *q, *XORmask, *ANDmask; + HCURSOR hcursor; + guchar *p, *q, *xor_mask, *and_mask; gint width, height, cursor_width, cursor_height; guchar residue; gint ix, iy; @@ -161,19 +163,19 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, g_return_val_if_fail (fg != NULL, NULL); g_return_val_if_fail (bg != NULL, NULL); - source_private = (GdkDrawablePrivate *) source; - mask_private = (GdkDrawablePrivate *) mask; + source_impl = GDK_PIXMAP_IMPL_WIN32 (source); + mask_impl = GDK_PIXMAP_IMPL_WIN32 (mask); - g_return_val_if_fail (source_private->width == mask_private->width - && source_private->height == mask_private->height, + g_return_val_if_fail (source_impl->width == mask_impl->width + && source_impl->height == mask_impl->height, NULL); - width = source_private->width; - height = source_private->height; + width = source_impl->width; + height = source_impl->height; cursor_width = GetSystemMetrics (SM_CXCURSOR); cursor_height = GetSystemMetrics (SM_CYCURSOR); - g_return_val_if_fail (width <= cursor_width - && height <= cursor_height, NULL); + g_return_val_if_fail (width <= cursor_width && height <= cursor_height, + NULL); residue = (1 << ((8-(width%8))%8)) - 1; @@ -182,10 +184,10 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, if (source_image->depth != 1 || mask_image->depth != 1) { - gdk_image_unref (source_image); - gdk_image_unref (mask_image); - g_return_val_if_fail (source_image->depth == 1 && mask_image->depth == 1, - NULL); + gdk_image_unref (source_image); + gdk_image_unref (mask_image); + g_return_val_if_fail (source_image->depth == 1 && mask_image->depth == 1, + NULL); } /* Such complex bit manipulation for this simple task, sigh. @@ -195,7 +197,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, */ /* First set masked-out source bits, as all source bits matter on Windoze. - * As we invert them below, they will be clear in the final XORmask. + * As we invert them below, they will be clear in the final xor_mask. */ for (iy = 0; iy < height; iy++) { @@ -207,12 +209,12 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, } /* XOR mask is initialized to zero */ - XORmask = g_malloc0 (cursor_width/8 * cursor_height); + xor_mask = g_malloc0 (cursor_width/8 * cursor_height); for (iy = 0; iy < height; iy++) { p = (guchar *) source_image->mem + iy*source_image->bpl; - q = XORmask + iy*cursor_width/8; + q = xor_mask + iy*cursor_width/8; for (ix = 0; ix < ((width-1)/8+1); ix++) *q++ = ~(*p++); @@ -220,38 +222,38 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, } /* AND mask is initialized to ones */ - ANDmask = g_malloc (cursor_width/8 * cursor_height); - memset (ANDmask, 0xFF, cursor_width/8 * cursor_height); + and_mask = g_malloc (cursor_width/8 * cursor_height); + memset (and_mask, 0xFF, cursor_width/8 * cursor_height); for (iy = 0; iy < height; iy++) { p = (guchar *) mask_image->mem + iy*mask_image->bpl; - q = ANDmask + iy*cursor_width/8; + q = and_mask + iy*cursor_width/8; for (ix = 0; ix < ((width-1)/8+1); ix++) *q++ = ~(*p++); q[-1] |= residue; /* Set left-over bits */ } - xcursor = CreateCursor (gdk_ProgInstance, x, y, cursor_width, cursor_height, - ANDmask, XORmask); + hcursor = CreateCursor (gdk_app_hinstance, x, y, cursor_width, cursor_height, + and_mask, xor_mask); GDK_NOTE (MISC, g_print ("gdk_cursor_new_from_pixmap: " "%#x (%dx%d) %#x (%dx%d) = %#x (%dx%d)\n", - GDK_DRAWABLE_XID (source), - source_private->width, source_private->height, - GDK_DRAWABLE_XID (mask), - mask_private->width, mask_private->height, - xcursor, cursor_width, cursor_height)); + GDK_PIXMAP_HBM (source), + source_impl->width, source_impl->height, + GDK_PIXMAP_HBM (mask), + mask_impl->width, mask_impl->height, + hcursor, cursor_width, cursor_height)); - g_free (XORmask); - g_free (ANDmask); + g_free (xor_mask); + g_free (and_mask); gdk_image_unref (source_image); gdk_image_unref (mask_image); private = g_new (GdkCursorPrivate, 1); - private->xcursor = xcursor; + private->hcursor = hcursor; cursor = (GdkCursor*) private; cursor->type = GDK_CURSOR_IS_PIXMAP; cursor->ref_count = 1; @@ -268,10 +270,10 @@ _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->xcursor : 0)); + (cursor->type == GDK_CURSOR_IS_PIXMAP) ? private->hcursor : 0)); if (cursor->type == GDK_CURSOR_IS_PIXMAP) - if (!DestroyCursor (private->xcursor)) + if (!DestroyCursor (private->hcursor)) WIN32_API_FAILED ("DestroyCursor"); g_free (private); diff --git a/gdk/win32/gdkdrawable-win32.h b/gdk/win32/gdkdrawable-win32.h new file mode 100644 index 000000000..287c70545 --- /dev/null +++ b/gdk/win32/gdkdrawable-win32.h @@ -0,0 +1,72 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GDK_DRAWABLE_WIN32_H__ +#define __GDK_DRAWABLE_WIN32_H__ + +#include <gdk/gdkdrawable.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Drawable implementation for Win32 + */ + +typedef struct _GdkDrawableImplWin32 GdkDrawableImplWin32; +typedef struct _GdkDrawableImplWin32Class GdkDrawableImplWin32Class; + +#define GDK_TYPE_DRAWABLE_IMPL_WIN32 (gdk_drawable_impl_win32_get_type ()) +#define GDK_DRAWABLE_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE_IMPL_WIN32, GdkDrawableImplWin32)) +#define GDK_DRAWABLE_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE_IMPL_WIN32, GdkDrawableImplWin32Class)) +#define GDK_IS_DRAWABLE_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE_IMPL_WIN32)) +#define GDK_IS_DRAWABLE_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE_IMPL_WIN32)) +#define GDK_DRAWABLE_IMPL_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE_IMPL_WIN32, GdkDrawableImplWin32Class)) + +struct _GdkDrawableImplWin32 +{ + GdkDrawable parent_instance; + + GdkDrawable *wrapper; + + GdkColormap *colormap; + + HANDLE handle; +}; + +struct _GdkDrawableImplWin32Class +{ + GdkDrawableClass parent_class; + +}; + +GType gdk_drawable_impl_win32_get_type (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GDK_DRAWABLE_WIN32_H__ */ diff --git a/gdk/win32/gdkgc-win32.c b/gdk/win32/gdkgc-win32.c index dd14b4ae8..8894c0277 100644 --- a/gdk/win32/gdkgc-win32.c +++ b/gdk/win32/gdkgc-win32.c @@ -167,6 +167,10 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values, data->rop2 = R2_NOTMASKPEN; GDK_NOTE (MISC, g_print ("NOTMASKPEN")); break; + case GDK_NOR: + data->rop2 = R2_NOTMERGEPEN; + GDK_NOTE (MISC, g_print ("NOTMERGEPEN")); + break; case GDK_SET: data->rop2 = R2_WHITE; GDK_NOTE (MISC, g_print ("WHITE")); @@ -508,6 +512,8 @@ gdk_win32_gc_get_values (GdkGC *gc, values->function = GDK_OR_INVERT; break; case R2_NOTMASKPEN: values->function = GDK_NAND; break; + case R2_NOTMERGEPEN: + values->function = GDK_NOR; break; case R2_WHITE: values->function = GDK_SET; break; } diff --git a/gdk/win32/gdkimage-win32.c b/gdk/win32/gdkimage-win32.c index a05f17db9..0cdae6a24 100644 --- a/gdk/win32/gdkimage-win32.c +++ b/gdk/win32/gdkimage-win32.c @@ -30,23 +30,69 @@ #include "gdkinternals.h" #include "gdkprivate-win32.h" -static void gdk_win32_image_destroy (GdkImage *image); -static void gdk_image_put (GdkImage *image, - GdkDrawable *drawable, - GdkGC *gc, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); - -static GdkImageClass image_class = { - gdk_win32_image_destroy, - gdk_image_put -}; - static GList *image_list = NULL; +static gpointer parent_class = NULL; + +static void gdk_win32_image_destroy (GdkImage *image); +static void gdk_image_init (GdkImage *image); +static void gdk_image_class_init (GdkImageClass *klass); +static void gdk_image_finalize (GObject *object); + +#define PRIVATE_DATA(image) ((GdkImagePrivateWin32 *) GDK_IMAGE (image)->windowing_data) + +GType +gdk_image_get_type (void) +{ + static GType object_type = 0; + + if (!object_type) + { + static const GTypeInfo object_info = + { + sizeof (GdkImageClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) gdk_image_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GdkImage), + 0, /* n_preallocs */ + (GInstanceInitFunc) gdk_image_init, + }; + + object_type = g_type_register_static (G_TYPE_OBJECT, + "GdkImage", + &object_info); + } + + return object_type; +} + +static void +gdk_image_init (GdkImage *image) +{ + image->windowing_data = g_new0 (GdkImagePrivateWin32, 1); +} + +static void +gdk_image_class_init (GdkImageClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + object_class->finalize = gdk_image_finalize; +} + +static void +gdk_image_finalize (GObject *object) +{ + GdkImage *image = GDK_IMAGE (object); + + gdk_win32_image_destroy (image); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} void gdk_image_exit (void) @@ -136,8 +182,9 @@ gdk_image_new_bitmap (GdkVisual *visual, gpointer data, gint w, gint h) } /* gdk_image_new_bitmap() */ void -gdk_image_init (void) +_gdk_windowing_image_init (void) { + /* Nothing needed AFAIK */ } static GdkImage* @@ -321,7 +368,7 @@ gdk_image_get (GdkWindow *window, BITMAP bm; int i; - g_return_val_if_fail (window != NULL, NULL); + g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); if (GDK_DRAWABLE_DESTROYED (window)) return NULL; @@ -329,11 +376,8 @@ gdk_image_get (GdkWindow *window, GDK_NOTE (MISC, g_print ("gdk_image_get: %#x %dx%d@+%d+%d\n", GDK_DRAWABLE_XID (window), width, height, x, y)); - private = g_new (GdkImagePrivateWin32, 1); - image = (GdkImage*) private; - - private->base.ref_count = 1; - private->base.klass = &image_class; + image = g_object_new (gdk_image_get_type (), NULL); + private = PRIVATE_DATA (image); image->type = GDK_IMAGE_SHARED; image->visual = gdk_drawable_get_visual (window); @@ -624,8 +668,14 @@ gdk_win32_image_destroy (GdkImage *image) g_return_if_fail (image != NULL); - private = (GdkImagePrivateWin32 *) image; + private = PRIVATE_DATA (image); + if (private == NULL) /* This means that gdk_image_exit() destroyed the + * image already, and now we're called a second + * time from _finalize() + */ + return; + GDK_NOTE (MISC, g_print ("gdk_win32_image_destroy: %#x%s\n", private->ximage, (image->type == GDK_IMAGE_SHARED_PIXMAP ? @@ -648,7 +698,7 @@ gdk_win32_image_destroy (GdkImage *image) g_assert_not_reached (); } - g_free (image); + g_free (private); } static void diff --git a/gdk/win32/gdkpixmap-win32.h b/gdk/win32/gdkpixmap-win32.h new file mode 100644 index 000000000..782d850e3 --- /dev/null +++ b/gdk/win32/gdkpixmap-win32.h @@ -0,0 +1,72 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GDK_PIXMAP_WIN32_H__ +#define __GDK_PIXMAP_WIN32_H__ + +#include <gdk/win32/gdkdrawable-win32.h> +#include <gdk/gdkpixmap.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Pixmap implementation for Win32 + */ + +typedef struct _GdkPixmapImplWin32 GdkPixmapImplWin32; +typedef struct _GdkPixmapImplWin32Class GdkPixmapImplWin32Class; + +#define GDK_TYPE_PIXMAP_IMPL_WIN32 (gdk_pixmap_impl_win32_get_type ()) +#define GDK_PIXMAP_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXMAP_IMPL_WIN32, GdkPixmapImplWin32)) +#define GDK_PIXMAP_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXMAP_IMPL_WIN32, GdkPixmapImplWin32Class)) +#define GDK_IS_PIXMAP_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXMAP_IMPL_WIN32)) +#define GDK_IS_PIXMAP_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXMAP_IMPL_WIN32)) +#define GDK_PIXMAP_IMPL_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXMAP_IMPL_WIN32, GdkPixmapImplWin32Class)) + +struct _GdkPixmapImplWin32 +{ + GdkDrawableImplWin32 parent_instance; + + gint width; + gint height; + + guint is_foreign : 1; +}; + +struct _GdkPixmapImplWin32Class +{ + GdkDrawableImplWin32Class parent_class; + +}; + +GType gdk_pixmap_impl_win32_get_type (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GDK_PIXMAP_WIN32_H__ */ diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index 50b7f72b1..c0f872e98 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -99,9 +99,9 @@ extern GdkDrawableClass _gdk_win32_drawable_class; extern HWND gdk_root_window; extern gboolean gdk_event_func_from_window_proc; -extern HDC gdk_DC; -extern HINSTANCE gdk_DLLInstance; -extern HINSTANCE gdk_ProgInstance; +extern HDC gdk_display_hdc; +extern HINSTANCE gdk_dll_hinstance; +extern HINSTANCE gdk_app_hinstance; extern UINT gdk_selection_notify_msg; extern UINT gdk_selection_request_msg; diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h index 3b3f7ba5f..fa2ad74dd 100644 --- a/gdk/win32/gdkwin32.h +++ b/gdk/win32/gdkwin32.h @@ -30,10 +30,16 @@ #include <gdk/gdkprivate.h> #include <gdk/gdkcursor.h> +#ifndef STRICT #define STRICT /* We want strict type checks */ +#endif #include <windows.h> #include <commctrl.h> +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /* Make up for some minor w32api header lossage */ /* PS_JOIN_MASK is missing */ @@ -182,86 +188,23 @@ typedef struct { unsigned long base_pixel; } XStandardColormap; -typedef struct _GdkDrawableWin32Data GdkDrawableWin32Data; -typedef struct _GdkWindowWin32Data GdkWindowWin32Data; -typedef struct _GdkWin32PositionInfo GdkWin32PositionInfo; +typedef struct _GdkGCWin32Data GdkGCWin32Data; typedef struct _GdkColormapPrivateWin32 GdkColormapPrivateWin32; typedef struct _GdkCursorPrivate GdkCursorPrivate; typedef struct _GdkWin32SingleFont GdkWin32SingleFont; typedef struct _GdkFontPrivateWin32 GdkFontPrivateWin32; typedef struct _GdkImagePrivateWin32 GdkImagePrivateWin32; typedef struct _GdkVisualPrivate GdkVisualPrivate; -typedef struct _GdkRegionPrivate GdkRegionPrivate; -typedef struct _GdkICPrivate GdkICPrivate; - -#define GDK_DRAWABLE_WIN32DATA(win) ((GdkDrawableWin32Data *)(((GdkDrawablePrivate*)(win))->klass_data)) -#define GDK_WINDOW_WIN32DATA(win) ((GdkWindowWin32Data *)(((GdkDrawablePrivate*)(win))->klass_data)) - -struct _GdkDrawableWin32Data -{ - HANDLE xid; -}; - -struct _GdkWin32PositionInfo -{ - gint x; - gint y; - gint width; - gint height; - gint x_offset; /* Offsets to add to Win32 coordinates */ - gint y_offset; /* within window to get GDK coodinates */ - gboolean big : 1; - gboolean mapped : 1; - gboolean no_bg : 1; /* Set when the window background is - * temporarily unset during resizing - * and scaling */ - GdkRectangle clip_rect; /* visible rectangle of window */ -}; - -struct _GdkWindowWin32Data -{ - GdkDrawableWin32Data drawable; - - GdkWin32PositionInfo position_info; - - /* We must keep the event mask here to filter them ourselves */ - gint event_mask; - - /* Values for bg_type */ -#define GDK_WIN32_BG_NORMAL 0 -#define GDK_WIN32_BG_PIXEL 1 -#define GDK_WIN32_BG_PIXMAP 2 -#define GDK_WIN32_BG_PARENT_RELATIVE 3 -#define GDK_WIN32_BG_TRANSPARENT 4 - - /* We draw the background ourselves at WM_ERASEBKGND */ - guchar bg_type; - gulong bg_pixel; - GdkPixmap *bg_pixmap; - - HCURSOR xcursor; - - /* Window size hints */ - gint hint_flags; - gint hint_x, hint_y; - gint hint_min_width, hint_min_height; - gint hint_max_width, hint_max_height; - - gboolean extension_events_selected; - - HKL input_locale; - CHARSETINFO charset_info; -}; struct _GdkCursorPrivate { GdkCursor cursor; - HCURSOR xcursor; + HCURSOR hcursor; }; struct _GdkWin32SingleFont { - HFONT xfont; + HFONT hfont; UINT charset; UINT codepage; FONTSIGNATURE fs; @@ -352,15 +295,13 @@ GType gdk_gc_win32_get_type (void); #define GDK_ROOT_WINDOW() ((guint32) HWND_DESKTOP) #define GDK_ROOT_PARENT() ((GdkWindow *) gdk_parent_root) #define GDK_DISPLAY() NULL -#define GDK_DRAWABLE_XID(win) (GDK_DRAWABLE_WIN32DATA(win)->xid) -#define GDK_IMAGE_XIMAGE(image) (((GdkImagePrivate *) image)->ximage) -#define GDK_COLORMAP_XDISPLAY(cmap) NULL -#define GDK_COLORMAP_WIN32COLORMAP(cmap)(((GdkColormapPrivateWin32 *) cmap)->xcolormap) +#define GDK_WINDOW_HWND(win) (GDK_DRAWABLE_IMPL_WIN32(((GdkWindowObject *)win)->impl)->handle) +#define GDK_PIXMAP_HBM(win) (GDK_DRAWABLE_IMPL_WIN32(((GdkPixmapObject *)win)->impl)->handle) +#define GDK_DRAWABLE_HANDLE(win) (GDK_IS_WINDOW (win) ? GDK_WINDOW_HWND (win) : GDK_PIXMAP_HBM (win)) +#define GDK_IMAGE_HBM(image) (((GdkImagePrivateWin32 *) GDK_IMAGE (image)->windowing_data)->hbm) +#define GDK_COLORMAP_WIN32COLORMAP(cmap) (((GdkColormapPrivateWin32 *)GDK_COLORMAP (cmap)->windowing_data)->xcolormap) #define GDK_VISUAL_XVISUAL(vis) (((GdkVisualPrivate *) vis)->xvisual) -#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID -#define GDK_WINDOW_XDISPLAY GDK_DRAWABLE_XDISPLAY - GDKVAR gchar *gdk_progclass; GDKVAR ATOM gdk_selection_property; @@ -387,4 +328,8 @@ void gdk_win32_hdc_release (GdkDrawable *drawable, GdkGC *gc, GdkGCValuesMask usage); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* __GDK_WIN32_H__ */ diff --git a/gdk/win32/gdkwindow-win32.h b/gdk/win32/gdkwindow-win32.h new file mode 100644 index 000000000..bf0f15b24 --- /dev/null +++ b/gdk/win32/gdkwindow-win32.h @@ -0,0 +1,118 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GDK_WINDOW_WIN32_H__ +#define __GDK_WINDOW_WIN32_H__ + +#include <gdk/win32/gdkdrawable-win32.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef struct _GdkWin32PositionInfo GdkWin32PositionInfo; + +struct _GdkWin32PositionInfo +{ + gint x; + gint y; + gint width; + gint height; + gint x_offset; /* Offsets to add to Win32 coordinates */ + gint y_offset; /* within window to get GDK coodinates */ + gboolean big : 1; + gboolean mapped : 1; + gboolean no_bg : 1; /* Set when the window background + * is temporarily unset during resizing + * and scaling */ + GdkRectangle clip_rect; /* visible rectangle of window */ +}; + + +/* Window implementation for Win32 + */ + +typedef struct _GdkWindowImplWin32 GdkWindowImplWin32; +typedef struct _GdkWindowImplWin32Class GdkWindowImplWin32Class; + +#define GDK_TYPE_WINDOW_IMPL_WIN32 (gdk_window_impl_win32_get_type ()) +#define GDK_WINDOW_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32)) +#define GDK_WINDOW_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32Class)) +#define GDK_IS_WINDOW_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_WIN32)) +#define GDK_IS_WINDOW_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_WIN32)) +#define GDK_WINDOW_IMPL_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32Class)) + +struct _GdkWindowImplWin32 +{ + GdkDrawableImplWin32 parent_instance; + + gint width; + gint height; + + GdkWin32PositionInfo position_info; + + /* We must keep the event mask here to filter them ourselves */ + gint event_mask; + + /* Values for bg_type */ +#define GDK_WIN32_BG_NORMAL 0 +#define GDK_WIN32_BG_PIXEL 1 +#define GDK_WIN32_BG_PIXMAP 2 +#define GDK_WIN32_BG_PARENT_RELATIVE 3 +#define GDK_WIN32_BG_TRANSPARENT 4 + + /* We draw the background ourselves at WM_ERASEBKGND */ + guchar bg_type; + gulong bg_pixel; + GdkPixmap *bg_pixmap; + + HCURSOR hcursor; + + /* Window size hints */ + gint hint_flags; + gint hint_x, hint_y; + gint hint_min_width, hint_min_height; + gint hint_max_width, hint_max_height; + + gboolean extension_events_selected; + + HKL input_locale; + CHARSETINFO charset_info; +}; + +struct _GdkWindowImplWin32Class +{ + GdkDrawableImplWin32Class parent_class; + +}; + +GType gdk_window_impl_win32_get_type (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GDK_WINDOW_WIN32_H__ */ diff --git a/gdk/win32/makefile.cygwin b/gdk/win32/makefile.cygwin deleted file mode 100644 index 5d33ea042..000000000 --- a/gdk/win32/makefile.cygwin +++ /dev/null @@ -1,84 +0,0 @@ -## Makefile for building the machine dependent part of GDK on Win32 with gcc -## Use: make -f makefile.cygwin - -# Location of the Wintab toolkit. Downloadable from http://www.pointing.com. -# We use the wntab32x.lib archive library directly (copy it as libwntab32x.a). -WTKIT = ../../../wtkit126 - -OPTIMIZE = -g - -TOP = ../../.. - -include $(TOP)/build/win32/make.mingw - -################################################################ - -# Nothing much configurable below - -INCLUDES = -I ../.. -I .. -I $(WTKIT)/include -DEPCFLAGS = $(GLIB_CFLAGS) $(PANGO_CFLAGS) -DEFINES = -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" - -all: \ - ../../config.h \ - ../gdkconfig.h \ - libgdk-win32.a \ - gdk-win32res.o \ - libwntab32x.a - -gdk_win32_OBJECTS = \ - gdkcc-win32.o \ - gdkcolor-win32.o \ - gdkcursor-win32.o \ - gdkdnd-win32.o \ - gdkdrawable-win32.o \ - gdkevents-win32.o \ - gdkfont-win32.o \ - gdkgc-win32.o \ - gdkgeometry-win32.o \ - gdkglobals-win32.o \ - gdkim-win32.o \ - gdkimage-win32.o \ - gdkinput-win32.o \ - gdkmain-win32.o \ - gdkpixmap-win32.o \ - gdkproperty-win32.o \ - gdkselection-win32.o \ - gdkvisual-win32.o \ - gdkwin32id.o \ - gdkwindow-win32.o - -../../config.h : ../../config.h.win32 - cp $< $@ - -../gdkconfig.h : ../gdkconfig.h.win32 - cp $< $@ - -# Kludge to get the path to the win32 headers -WIN32APIHEADERS = $(shell echo "\#include <winver.h>" | $(CC) -M -E - | tail -1 | sed -e 's![\\/]winver.h!!' | tr -d '\015') - -gdk-win32res.o : rc/gdk.rc gdk-build.tmp - m4 -DBUILDNUMBER=`cat gdk-build.tmp` <rc/gdk.rc >gdk-win32res.rc - windres --include-dir rc --include-dir $(WIN32APIHEADERS) gdk-win32res.rc gdk-win32res.o - rm gdk-build.tmp gdk-win32res.rc - -# The *.stamp files aren't distributed. Thus, this takes care of only -# tml building libraries with nonzero build number. - -ifeq ($(wildcard gdk-build.stamp),gdk-build.stamp) -# Magic to bump the build number -gdk-build.tmp : - bash -c "read number && echo $$[number+1]" <gdk-build.stamp >gdk-build.tmp - cp gdk-build.tmp gdk-build.stamp -else -# Use zero as build number. -gdk-build.tmp : - echo 0 >gdk-build.tmp -endif - -libgdk-win32.a : $(gdk_win32_OBJECTS) - -rm -f $@ - $(AR) rv $@ $(gdk_win32_OBJECTS) - -libwntab32x.a : $(WTKIT)/lib/i386/wntab32x.lib - cp $(WTKIT)/lib/i386/wntab32x.lib libwntab32x.a diff --git a/gdk/win32/makefile.mingw.in b/gdk/win32/makefile.mingw.in new file mode 100644 index 000000000..0ca4f3497 --- /dev/null +++ b/gdk/win32/makefile.mingw.in @@ -0,0 +1,87 @@ +## Makefile for building the Win32 dependent GDK objects with gcc on Win32 +## Use: make -f makefile.mingw + +TOP = ../../.. + +# Location of the Wintab toolkit. Downloadable from +# http://www.pointing.com. We use the wntab32x.lib archive library +# directly (copying it to libwntab32x.a). +WTKIT = $(TOP)/wtkit126 + +include ../../build/win32/make.mingw + +# Possibly override GTK+ version from build/win32/module.defs +GTK_VER = @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@ + +OPTIMIZE = -g + +INCLUDES = -I ../.. -I .. -I $(WTKIT)/include +DEPCFLAGS = $(GLIB_CFLAGS) $(PANGO_CFLAGS) +DEFINES = -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" + +all: \ + ../../config.h \ + ../gdkconfig.h \ + libgdk-win32.a \ + gdk-win32res.o \ + libwntab32x.a + +gdk_win32_OBJECTS = \ + gdkcc-win32.o \ + gdkcolor-win32.o \ + gdkcursor-win32.o \ + gdkdnd-win32.o \ + gdkdrawable-win32.o \ + gdkevents-win32.o \ + gdkfont-win32.o \ + gdkgc-win32.o \ + gdkgeometry-win32.o \ + gdkglobals-win32.o \ + gdkim-win32.o \ + gdkimage-win32.o \ + gdkinput-win32.o \ + gdkmain-win32.o \ + gdkpixmap-win32.o \ + gdkproperty-win32.o \ + gdkselection-win32.o \ + gdkvisual-win32.o \ + gdkwin32id.o \ + gdkwindow-win32.o + +../../config.h : ../../config.h.win32 + cp $< $@ + +../gdkconfig.h : ../gdkconfig.h.win32 + cp $< $@ + +gdk-win32res.o : rc/gdk.rc gdk-build.tmp + m4 -DBUILDNUMBER=`cat gdk-build.tmp` <rc/gdk.rc >gdk-win32res.rc + windres --include-dir rc gdk-win32res.rc gdk-win32res.o + rm gdk-build.tmp gdk-win32res.rc + +# The *.stamp files aren't distributed. Thus, this takes care of only +# tml building libraries with nonzero build number. + +ifeq ($(wildcard gdk-build.stamp),gdk-build.stamp) +# Magic to bump the build number +gdk-build.tmp : + bash -c "read number && echo $$[number+1]" <gdk-build.stamp >gdk-build.tmp + cp gdk-build.tmp gdk-build.stamp +else +# Use zero as build number. +gdk-build.tmp : + echo 0 >gdk-build.tmp +endif + +libgdk-win32.a : $(gdk_win32_OBJECTS) + -rm -f $@ + $(AR) rv $@ $(gdk_win32_OBJECTS) + +libwntab32x.a : $(WTKIT)/lib/i386/wntab32x.lib + cp $< $@ + +# Hack to get an updated makefile.mingw automatically after updating +# makefile.mingw.in. Only for developer use. +makefile.mingw: makefile.mingw.in + sed -e 's,@GTK_MAJOR[_]VERSION@,@GTK_MAJOR_VERSION@,' \ + -e 's,@GTK_MINOR[_]VERSION@,@GTK_MINOR_VERSION@,' <$< >$@ |