summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@src.gnome.org>1999-03-17 23:02:10 +0000
committerTor Lillqvist <tml@src.gnome.org>1999-03-17 23:02:10 +0000
commit0b4d29fd6e88bdbf70ee30e2743f4ecf9032e250 (patch)
tree9e87d0195fe9da01becb6a074058f83669844eb8
parentd142187b3856c756740ec2e2fa107a4603efcd23 (diff)
downloadgdk-pixbuf-0b4d29fd6e88bdbf70ee30e2743f4ecf9032e250.tar.gz
Merge in Win32 version: Define macro GDKVAR for declaring gdk variables
* gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for declaring gdk variables exported/imported from the DLL. New image type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and GDK_DRAG_PROTO_OLE2. * gdk/gdk.h: Merge in Win32 version: Two new functions, gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far declared only for the Win32 version, but could be in the X11 version as well. (Needed for a Xlib-less gdk_imlib.) gdk_color_hash should have only one parameter. Declare gdk_threads_mutex with GDKVAR. * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have just one parameter. * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes per pixel, not bits. * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv): Fetch bpp (which means bits-per-pixel here) from another place on Win32. Accept also depth==32 (which we might get on Win32) with bpp==32. * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel, gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc, gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c: Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be in the backend-dependent directory, not in the common gdk directory. * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk headers.
-rw-r--r--ChangeLog36
-rw-r--r--ChangeLog.pre-2-036
-rw-r--r--ChangeLog.pre-2-1036
-rw-r--r--ChangeLog.pre-2-236
-rw-r--r--ChangeLog.pre-2-436
-rw-r--r--ChangeLog.pre-2-636
-rw-r--r--ChangeLog.pre-2-836
-rw-r--r--gdk/gdk.h22
-rw-r--r--gdk/gdkcolor.c3
-rw-r--r--gdk/gdkimage.c9
-rw-r--r--gdk/gdkrgb.c12
-rw-r--r--gdk/gdktypes.h22
-rw-r--r--gdk/x11/gdkcolor-x11.c3
-rw-r--r--gdk/x11/gdkimage-x11.c9
-rw-r--r--gtk/gtkclist.c2
-rw-r--r--gtk/gtkctree.c2
-rw-r--r--gtk/gtkdnd.c2
-rw-r--r--gtk/gtkeditable.c2
-rw-r--r--gtk/gtkfontsel.c2
-rw-r--r--gtk/gtkhandlebox.c2
-rw-r--r--gtk/gtklayout.c2
-rw-r--r--gtk/gtkmain.c2
-rw-r--r--gtk/gtkplug.c2
-rw-r--r--gtk/gtkpreview.c2
-rw-r--r--gtk/gtkrc.c2
-rw-r--r--gtk/gtkselection.c2
-rw-r--r--gtk/gtksocket.c2
-rw-r--r--gtk/gtkstyle.c2
-rw-r--r--gtk/gtkwidget.c4
-rw-r--r--gtk/gtkwindow.c2
-rw-r--r--gtk/testgtk.c6
-rw-r--r--tests/testgtk.c6
32 files changed, 338 insertions, 40 deletions
diff --git a/ChangeLog b/ChangeLog
index e2079afb4..ac50b97a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+1999-03-18 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+ declaring gdk variables exported/imported from the DLL. New image
+ type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+ drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+ GDK_DRAG_PROTO_OLE2.
+
+ * gdk/gdk.h: Merge in Win32 version: Two new functions,
+ gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+ declared only for the Win32 version, but could be in the X11
+ version as well. (Needed for a Xlib-less gdk_imlib.)
+ gdk_color_hash should have only one parameter. Declare
+ gdk_threads_mutex with GDKVAR.
+
+ * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+ just one parameter.
+
+ * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+ per pixel, not bits.
+
+ * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+ Fetch bpp (which means bits-per-pixel here) from another place on
+ Win32. Accept also depth==32 (which we might get on Win32) with
+ bpp==32.
+
+ * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+ gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+ gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+ Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+ in the backend-dependent directory, not in the common gdk
+ directory.
+
+ * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+ headers.
+
Wed Mar 17 05:06:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init_check): tell people that they don't really
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index e2079afb4..ac50b97a1 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,39 @@
+1999-03-18 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+ declaring gdk variables exported/imported from the DLL. New image
+ type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+ drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+ GDK_DRAG_PROTO_OLE2.
+
+ * gdk/gdk.h: Merge in Win32 version: Two new functions,
+ gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+ declared only for the Win32 version, but could be in the X11
+ version as well. (Needed for a Xlib-less gdk_imlib.)
+ gdk_color_hash should have only one parameter. Declare
+ gdk_threads_mutex with GDKVAR.
+
+ * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+ just one parameter.
+
+ * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+ per pixel, not bits.
+
+ * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+ Fetch bpp (which means bits-per-pixel here) from another place on
+ Win32. Accept also depth==32 (which we might get on Win32) with
+ bpp==32.
+
+ * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+ gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+ gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+ Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+ in the backend-dependent directory, not in the common gdk
+ directory.
+
+ * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+ headers.
+
Wed Mar 17 05:06:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init_check): tell people that they don't really
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index e2079afb4..ac50b97a1 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,39 @@
+1999-03-18 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+ declaring gdk variables exported/imported from the DLL. New image
+ type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+ drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+ GDK_DRAG_PROTO_OLE2.
+
+ * gdk/gdk.h: Merge in Win32 version: Two new functions,
+ gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+ declared only for the Win32 version, but could be in the X11
+ version as well. (Needed for a Xlib-less gdk_imlib.)
+ gdk_color_hash should have only one parameter. Declare
+ gdk_threads_mutex with GDKVAR.
+
+ * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+ just one parameter.
+
+ * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+ per pixel, not bits.
+
+ * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+ Fetch bpp (which means bits-per-pixel here) from another place on
+ Win32. Accept also depth==32 (which we might get on Win32) with
+ bpp==32.
+
+ * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+ gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+ gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+ Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+ in the backend-dependent directory, not in the common gdk
+ directory.
+
+ * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+ headers.
+
Wed Mar 17 05:06:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init_check): tell people that they don't really
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index e2079afb4..ac50b97a1 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,39 @@
+1999-03-18 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+ declaring gdk variables exported/imported from the DLL. New image
+ type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+ drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+ GDK_DRAG_PROTO_OLE2.
+
+ * gdk/gdk.h: Merge in Win32 version: Two new functions,
+ gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+ declared only for the Win32 version, but could be in the X11
+ version as well. (Needed for a Xlib-less gdk_imlib.)
+ gdk_color_hash should have only one parameter. Declare
+ gdk_threads_mutex with GDKVAR.
+
+ * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+ just one parameter.
+
+ * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+ per pixel, not bits.
+
+ * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+ Fetch bpp (which means bits-per-pixel here) from another place on
+ Win32. Accept also depth==32 (which we might get on Win32) with
+ bpp==32.
+
+ * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+ gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+ gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+ Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+ in the backend-dependent directory, not in the common gdk
+ directory.
+
+ * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+ headers.
+
Wed Mar 17 05:06:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init_check): tell people that they don't really
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index e2079afb4..ac50b97a1 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,39 @@
+1999-03-18 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+ declaring gdk variables exported/imported from the DLL. New image
+ type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+ drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+ GDK_DRAG_PROTO_OLE2.
+
+ * gdk/gdk.h: Merge in Win32 version: Two new functions,
+ gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+ declared only for the Win32 version, but could be in the X11
+ version as well. (Needed for a Xlib-less gdk_imlib.)
+ gdk_color_hash should have only one parameter. Declare
+ gdk_threads_mutex with GDKVAR.
+
+ * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+ just one parameter.
+
+ * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+ per pixel, not bits.
+
+ * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+ Fetch bpp (which means bits-per-pixel here) from another place on
+ Win32. Accept also depth==32 (which we might get on Win32) with
+ bpp==32.
+
+ * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+ gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+ gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+ Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+ in the backend-dependent directory, not in the common gdk
+ directory.
+
+ * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+ headers.
+
Wed Mar 17 05:06:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init_check): tell people that they don't really
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index e2079afb4..ac50b97a1 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,39 @@
+1999-03-18 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+ declaring gdk variables exported/imported from the DLL. New image
+ type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+ drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+ GDK_DRAG_PROTO_OLE2.
+
+ * gdk/gdk.h: Merge in Win32 version: Two new functions,
+ gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+ declared only for the Win32 version, but could be in the X11
+ version as well. (Needed for a Xlib-less gdk_imlib.)
+ gdk_color_hash should have only one parameter. Declare
+ gdk_threads_mutex with GDKVAR.
+
+ * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+ just one parameter.
+
+ * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+ per pixel, not bits.
+
+ * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+ Fetch bpp (which means bits-per-pixel here) from another place on
+ Win32. Accept also depth==32 (which we might get on Win32) with
+ bpp==32.
+
+ * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+ gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+ gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+ Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+ in the backend-dependent directory, not in the common gdk
+ directory.
+
+ * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+ headers.
+
Wed Mar 17 05:06:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init_check): tell people that they don't really
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index e2079afb4..ac50b97a1 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,39 @@
+1999-03-18 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+ declaring gdk variables exported/imported from the DLL. New image
+ type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+ drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+ GDK_DRAG_PROTO_OLE2.
+
+ * gdk/gdk.h: Merge in Win32 version: Two new functions,
+ gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+ declared only for the Win32 version, but could be in the X11
+ version as well. (Needed for a Xlib-less gdk_imlib.)
+ gdk_color_hash should have only one parameter. Declare
+ gdk_threads_mutex with GDKVAR.
+
+ * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+ just one parameter.
+
+ * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+ per pixel, not bits.
+
+ * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+ Fetch bpp (which means bits-per-pixel here) from another place on
+ Win32. Accept also depth==32 (which we might get on Win32) with
+ bpp==32.
+
+ * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+ gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+ gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+ Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+ in the backend-dependent directory, not in the common gdk
+ directory.
+
+ * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+ headers.
+
Wed Mar 17 05:06:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init_check): tell people that they don't really
diff --git a/gdk/gdk.h b/gdk/gdk.h
index d3afbacbe..2c3d4d287 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -227,7 +227,7 @@ void gdk_window_set_child_shapes (GdkWindow *window);
/*
* This routine allows you to merge (ie ADD) child shapes to your
- * own window's shape keeping its current shape and ADDING the shild
+ * own window's shape keeping its current shape and ADDING the child
* shapes to it.
*
* - Raster
@@ -464,6 +464,15 @@ GdkPixmap* gdk_pixmap_new (GdkWindow *window,
gint width,
gint height,
gint depth);
+#if GDK_WINDOWING == GDK_WINDOWING_WIN32
+GdkPixmap* gdk_pixmap_create_on_shared_image
+ (GdkImage **image_return,
+ GdkWindow *window,
+ GdkVisual *visual,
+ gint width,
+ gint height,
+ gint depth);
+#endif
GdkBitmap* gdk_bitmap_create_from_data (GdkWindow *window,
const gchar *data,
gint width,
@@ -512,6 +521,12 @@ GdkImage* gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height);
+#if GDK_WINDOWING == GDK_WINDOWING_WIN32
+GdkImage* gdk_image_bitmap_new(GdkImageType type,
+ GdkVisual *visual,
+ gint width,
+ gint height);
+#endif
GdkImage* gdk_image_get (GdkWindow *window,
gint x,
gint y,
@@ -562,8 +577,7 @@ void gdk_color_free (GdkColor *color);
gint gdk_color_parse (const gchar *spec,
GdkColor *color);
-guint gdk_color_hash (const GdkColor *colora,
- const GdkColor *colorb);
+guint gdk_color_hash (const GdkColor *colora);
gint gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
@@ -994,7 +1008,7 @@ gboolean gdk_keyval_is_lower (guint keyval);
/* Threading
*/
-extern GMutex *gdk_threads_mutex;
+GDKVAR GMutex *gdk_threads_mutex;
void gdk_threads_enter (void);
void gdk_threads_leave (void);
diff --git a/gdk/gdkcolor.c b/gdk/gdkcolor.c
index 3a274a888..dd9f2b27b 100644
--- a/gdk/gdkcolor.c
+++ b/gdk/gdkcolor.c
@@ -1109,8 +1109,7 @@ gdk_color_change (GdkColormap *colormap,
}
guint
-gdk_color_hash (const GdkColor *colora,
- const GdkColor *colorb)
+gdk_color_hash (const GdkColor *colora)
{
return ((colora->red) +
(colora->green << 11) +
diff --git a/gdk/gdkimage.c b/gdk/gdkimage.c
index f2f26d95a..d2e66803d 100644
--- a/gdk/gdkimage.c
+++ b/gdk/gdkimage.c
@@ -372,7 +372,14 @@ gdk_image_get (GdkWindow *window,
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
- image->bpp = private->ximage->bits_per_pixel;
+ if (private->ximage->bits_per_pixel <= 8)
+ image->bpp = 1;
+ else if (private->ximage->bits_per_pixel <= 16)
+ image->bpp = 2;
+ else if (private->ximage->bits_per_pixel <= 24)
+ image->bpp = 3;
+ else
+ image->bpp = 4;
image->byte_order = private->ximage->byte_order;
return image;
diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c
index f66d1ff87..86d6f998d 100644
--- a/gdk/gdkrgb.c
+++ b/gdk/gdkrgb.c
@@ -56,13 +56,13 @@
#else
/* Compiling as a part of Gtk 1.1 or later */
-#include "../config.h"
-#include "gdk.h"
+#include "config.h"
+#include <gdk/gdk.h>
#include "gdkprivate.h"
#endif
-#include "gdkrgb.h"
+#include <gdk/gdkrgb.h>
typedef struct _GdkRgbInfo GdkRgbInfo;
@@ -2678,7 +2678,11 @@ gdk_rgb_select_conv (GdkImage *image)
gboolean mask_rgb, mask_bgr;
depth = image_info->visual->depth;
+#if defined (GDK_RGB_STANDALONE) || (GDK_WINDOWING == GDK_WINDOWING_X11)
bpp = ((GdkImagePrivate *)image)->ximage->bits_per_pixel;
+#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
+ bpp = ((GdkVisualPrivate *) gdk_visual_get_system())->xvisual->bitspixel;
+#endif
byte_order = image->byte_order;
if (gdk_rgb_verbose)
@@ -2765,7 +2769,7 @@ gdk_rgb_select_conv (GdkImage *image)
else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
(mask_rgb && byte_order == GDK_MSB_FIRST))
conv = gdk_rgb_convert_0888_br;
- else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
+ else if (bpp == 32 && (depth == 32 || depth == 24) && vtype == GDK_VISUAL_TRUE_COLOR &&
(mask_rgb && byte_order == GDK_LSB_FIRST))
conv = gdk_rgb_convert_0888;
else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 19406de57..cae611986 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -32,6 +32,15 @@
*/
#include <glib.h>
+#ifdef NATIVE_WIN32
+# ifdef GDK_COMPILATION
+# define GDKVAR __declspec(dllexport)
+# else
+# define GDKVAR extern __declspec(dllimport)
+# endif
+#else
+# define GDKVAR extern
+#endif
/* The system specific file gdkconfig.h contains such configuration
* settings that are needed not only when compiling GDK (or GTK)
@@ -174,18 +183,23 @@ typedef enum
/* Types of images.
* Normal: Normal X image type. These are slow as they involve passing
* the entire image through the X connection each time a draw
- * request is required.
+ * request is required. On Win32, a bitmap.
* Shared: Shared memory X image type. These are fast as the X server
* and the program actually use the same piece of memory. They
* should be used with care though as there is the possibility
* for both the X server and the program to be reading/writing
* the image simultaneously and producing undesired results.
+ * On Win32, also a bitmap.
+ * Shared Pixmap: Also a shared memory image, which also has a
+ * pixmap using the same memory. Used by gdk_imlib with the
+ * Win32 backend.
*/
typedef enum
{
GDK_IMAGE_NORMAL,
GDK_IMAGE_SHARED,
- GDK_IMAGE_FASTEST
+ GDK_IMAGE_FASTEST,
+ GDK_IMAGE_SHARED_PIXMAP
} GdkImageType;
/* Types of visuals.
@@ -766,7 +780,9 @@ typedef enum {
GDK_DRAG_PROTO_XDND,
GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming
* drags */
- GDK_DRAG_PROTO_NONE /* Not a valid drag window */
+ GDK_DRAG_PROTO_NONE, /* Not a valid drag window */
+ GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
+ GDK_DRAG_PROTO_OLE2, /* The complex OLE2 dnd (not implemented) */
} GdkDragProtocol;
/* The color type.
diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c
index 3a274a888..dd9f2b27b 100644
--- a/gdk/x11/gdkcolor-x11.c
+++ b/gdk/x11/gdkcolor-x11.c
@@ -1109,8 +1109,7 @@ gdk_color_change (GdkColormap *colormap,
}
guint
-gdk_color_hash (const GdkColor *colora,
- const GdkColor *colorb)
+gdk_color_hash (const GdkColor *colora)
{
return ((colora->red) +
(colora->green << 11) +
diff --git a/gdk/x11/gdkimage-x11.c b/gdk/x11/gdkimage-x11.c
index f2f26d95a..d2e66803d 100644
--- a/gdk/x11/gdkimage-x11.c
+++ b/gdk/x11/gdkimage-x11.c
@@ -372,7 +372,14 @@ gdk_image_get (GdkWindow *window,
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
- image->bpp = private->ximage->bits_per_pixel;
+ if (private->ximage->bits_per_pixel <= 8)
+ image->bpp = 1;
+ else if (private->ximage->bits_per_pixel <= 16)
+ image->bpp = 2;
+ else if (private->ximage->bits_per_pixel <= 24)
+ image->bpp = 3;
+ else
+ image->bpp = 4;
image->byte_order = private->ximage->byte_order;
return image;
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 574474837..ef9922b19 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -32,7 +32,7 @@
#include "gtkclist.h"
#include "gtkbindings.h"
#include "gtkdnd.h"
-#include <gdk/gdkx.h>
+#include "gdkx.h"
#include <gdk/gdkkeysyms.h>
/* length of button_actions array */
diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c
index 007913a37..b66e60f2e 100644
--- a/gtk/gtkctree.c
+++ b/gtk/gtkctree.c
@@ -33,7 +33,7 @@
#include "gtkbindings.h"
#include "gtkmain.h"
#include "gtkdnd.h"
-#include <gdk/gdkx.h>
+#include "gdkx.h"
#include <gdk/gdkkeysyms.h>
#define PM_SIZE 8
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 5b626d91f..101e4da4c 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -24,7 +24,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#include "gtkdnd.h"
#include "gtkinvisible.h"
diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c
index 420c66c57..cc68976ba 100644
--- a/gtk/gtkeditable.c
+++ b/gtk/gtkeditable.c
@@ -27,7 +27,7 @@
#include <ctype.h>
#include <string.h>
#ifdef USE_XIM
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#endif
#include "gdk/gdkkeysyms.h"
#include "gdk/gdki18n.h"
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index b505704af..c665bae11 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -70,7 +70,7 @@
#include <ctype.h>
#include "gdk/gdk.h"
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#include "gdk/gdkkeysyms.h"
#include "gtkbutton.h"
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index 30783ad60..93ffbe2de 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -26,7 +26,7 @@
*/
#include <stdlib.h>
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#include "gtkhandlebox.h"
#include "gtkmain.h"
#include "gtksignal.h"
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index cd630faa2..3e07f84bc 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -28,7 +28,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#include "gtklayout.h"
#include "gtksignal.h"
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 384035b31..0ee8c3461 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -24,7 +24,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include "gdk/gdkx.h" /* For GDK_WINDOWING */
+#include "gdkx.h" /* For GDK_WINDOWING */
#if GDK_WINDOWING == GDK_WINDOWING_X11
#include <X11/Xlocale.h> /* so we get the right setlocale */
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index cf7506e32..737671deb 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -25,7 +25,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#include "gdk/gdkkeysyms.h"
#include "gtkplug.h"
diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c
index b32210a71..02a2d9d46 100644
--- a/gtk/gtkpreview.c
+++ b/gtk/gtkpreview.c
@@ -32,7 +32,7 @@
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#include "gdk/gdkrgb.h"
#include "gtkpreview.h"
#include "gtksignal.h"
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index d5ecfc022..93c39e4dd 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -26,7 +26,7 @@
#include "config.h"
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#if GDK_WINDOWING == GDK_WINDOWING_X11
#include <X11/Xlocale.h> /* so we get the right setlocale */
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index 6ea50d680..d4ac3fb9f 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -53,7 +53,7 @@
#include <stdarg.h>
#include <string.h>
-#include <gdk/gdkx.h>
+#include "gdkx.h"
/* we need this for gdk_window_lookup() */
#include "gtkmain.h"
#include "gtkselection.h"
diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c
index a47321386..ed1508bed 100644
--- a/gtk/gtksocket.c
+++ b/gtk/gtksocket.c
@@ -25,7 +25,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#include "gdk/gdkkeysyms.h"
#include "gtkwindow.h"
#include "gtksignal.h"
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index f3984b9c5..c98e8c56d 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -31,7 +31,7 @@
#include "gtkthemes.h"
#include "gtkwidget.h"
#include "gtkthemes.h"
-#include "gdk/gdkprivate.h"
+#include "gdkprivate.h"
#define LIGHTNESS_MULT 1.3
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index bd24f74cd..62a4347af 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -36,7 +36,7 @@
#include "gtkbindings.h"
#include "gtkprivate.h"
#include "gdk/gdk.h"
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#define WIDGET_CLASS(w) GTK_WIDGET_CLASS (GTK_OBJECT (w)->klass)
@@ -2533,7 +2533,7 @@ gtk_widget_unlock_accelerators (GtkWidget *widget)
gboolean
gtk_widget_accelerators_locked (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
return gtk_signal_handler_pending_by_func (GTK_OBJECT (widget),
widget_signals[ADD_ACCELERATOR],
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 04ce74819..2310b5ce9 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -28,7 +28,7 @@
#include <limits.h>
#include "gdk/gdk.h"
#include "gdk/gdkkeysyms.h"
-#include "gdk/gdkx.h"
+#include "gdkx.h"
#include "gtkprivate.h"
#include "gtkrc.h"
#include "gtksignal.h"
diff --git a/gtk/testgtk.c b/gtk/testgtk.c
index 4bd90e368..47a967f26 100644
--- a/gtk/testgtk.c
+++ b/gtk/testgtk.c
@@ -32,9 +32,9 @@
#include <math.h>
#include <time.h>
#include "gtk.h"
-#include "../gdk/gdk.h"
-#include "../gdk/gdkx.h"
-#include "../gdk/gdkkeysyms.h"
+#include "gdk/gdk.h"
+#include "gdk/gdkkeysyms.h"
+#include "gdkx.h"
#include "circles.xbm"
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 4bd90e368..47a967f26 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -32,9 +32,9 @@
#include <math.h>
#include <time.h>
#include "gtk.h"
-#include "../gdk/gdk.h"
-#include "../gdk/gdkx.h"
-#include "../gdk/gdkkeysyms.h"
+#include "gdk/gdk.h"
+#include "gdk/gdkkeysyms.h"
+#include "gdkx.h"
#include "circles.xbm"