]> Pileus Git - ~andy/gtk/commitdiff
gdk/gdkimage.h No need any longer on Win32 for the shared memory
authorTor Lillqvist <tml@iki.fi>
Sat, 19 Aug 2000 21:46:05 +0000 (21:46 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 19 Aug 2000 21:46:05 +0000 (21:46 +0000)
2000-08-20  Tor Lillqvist  <tml@iki.fi>

* gdk/gdkimage.h
* gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
shared memory image+pixmap GdkImage type, or
gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
I am dropping that.

* gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
actually call gtk_init_abi_check(), passing also
sizeof(GtkWindow). Ditto for gtk_init_check().

* gtk/gtk.def
* gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
New functions, used to check that the GTK+-using code has been
compiled using the correct compiler and switches. In particular,
with gcc one has to use the -fnative-struct switch as GTK+ is
compiled with that.

12 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdkimage.h
gdk/win32/gdkimage-win32.c
gtk/gtk.def
gtk/gtkmain.c
gtk/gtkmain.h

index 99e30616817cb636ff53e74b46b01790e2b0b107..726a4970fdf0473d8b13c4991842ba7983affbd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2000-08-20  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdkimage.h
+       * gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
+       shared memory image+pixmap GdkImage type, or
+       gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
+       I am dropping that.
+
+       * gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
+       actually call gtk_init_abi_check(), passing also
+       sizeof(GtkWindow). Ditto for gtk_init_check(). 
+
+       * gtk/gtk.def
+       * gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
+       New functions, used to check that the GTK+-using code has been
+       compiled using the correct compiler and switches. In particular,
+       with gcc one has to use the -fnative-struct switch as GTK+ is
+       compiled with that.
+
 Fri Aug 18 17:27:46 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling
index 99e30616817cb636ff53e74b46b01790e2b0b107..726a4970fdf0473d8b13c4991842ba7983affbd5 100644 (file)
@@ -1,3 +1,22 @@
+2000-08-20  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdkimage.h
+       * gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
+       shared memory image+pixmap GdkImage type, or
+       gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
+       I am dropping that.
+
+       * gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
+       actually call gtk_init_abi_check(), passing also
+       sizeof(GtkWindow). Ditto for gtk_init_check(). 
+
+       * gtk/gtk.def
+       * gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
+       New functions, used to check that the GTK+-using code has been
+       compiled using the correct compiler and switches. In particular,
+       with gcc one has to use the -fnative-struct switch as GTK+ is
+       compiled with that.
+
 Fri Aug 18 17:27:46 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling
index 99e30616817cb636ff53e74b46b01790e2b0b107..726a4970fdf0473d8b13c4991842ba7983affbd5 100644 (file)
@@ -1,3 +1,22 @@
+2000-08-20  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdkimage.h
+       * gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
+       shared memory image+pixmap GdkImage type, or
+       gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
+       I am dropping that.
+
+       * gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
+       actually call gtk_init_abi_check(), passing also
+       sizeof(GtkWindow). Ditto for gtk_init_check(). 
+
+       * gtk/gtk.def
+       * gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
+       New functions, used to check that the GTK+-using code has been
+       compiled using the correct compiler and switches. In particular,
+       with gcc one has to use the -fnative-struct switch as GTK+ is
+       compiled with that.
+
 Fri Aug 18 17:27:46 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling
index 99e30616817cb636ff53e74b46b01790e2b0b107..726a4970fdf0473d8b13c4991842ba7983affbd5 100644 (file)
@@ -1,3 +1,22 @@
+2000-08-20  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdkimage.h
+       * gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
+       shared memory image+pixmap GdkImage type, or
+       gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
+       I am dropping that.
+
+       * gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
+       actually call gtk_init_abi_check(), passing also
+       sizeof(GtkWindow). Ditto for gtk_init_check(). 
+
+       * gtk/gtk.def
+       * gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
+       New functions, used to check that the GTK+-using code has been
+       compiled using the correct compiler and switches. In particular,
+       with gcc one has to use the -fnative-struct switch as GTK+ is
+       compiled with that.
+
 Fri Aug 18 17:27:46 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling
index 99e30616817cb636ff53e74b46b01790e2b0b107..726a4970fdf0473d8b13c4991842ba7983affbd5 100644 (file)
@@ -1,3 +1,22 @@
+2000-08-20  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdkimage.h
+       * gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
+       shared memory image+pixmap GdkImage type, or
+       gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
+       I am dropping that.
+
+       * gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
+       actually call gtk_init_abi_check(), passing also
+       sizeof(GtkWindow). Ditto for gtk_init_check(). 
+
+       * gtk/gtk.def
+       * gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
+       New functions, used to check that the GTK+-using code has been
+       compiled using the correct compiler and switches. In particular,
+       with gcc one has to use the -fnative-struct switch as GTK+ is
+       compiled with that.
+
 Fri Aug 18 17:27:46 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling
index 99e30616817cb636ff53e74b46b01790e2b0b107..726a4970fdf0473d8b13c4991842ba7983affbd5 100644 (file)
@@ -1,3 +1,22 @@
+2000-08-20  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdkimage.h
+       * gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
+       shared memory image+pixmap GdkImage type, or
+       gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
+       I am dropping that.
+
+       * gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
+       actually call gtk_init_abi_check(), passing also
+       sizeof(GtkWindow). Ditto for gtk_init_check(). 
+
+       * gtk/gtk.def
+       * gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
+       New functions, used to check that the GTK+-using code has been
+       compiled using the correct compiler and switches. In particular,
+       with gcc one has to use the -fnative-struct switch as GTK+ is
+       compiled with that.
+
 Fri Aug 18 17:27:46 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling
index 99e30616817cb636ff53e74b46b01790e2b0b107..726a4970fdf0473d8b13c4991842ba7983affbd5 100644 (file)
@@ -1,3 +1,22 @@
+2000-08-20  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdkimage.h
+       * gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
+       shared memory image+pixmap GdkImage type, or
+       gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
+       I am dropping that.
+
+       * gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
+       actually call gtk_init_abi_check(), passing also
+       sizeof(GtkWindow). Ditto for gtk_init_check(). 
+
+       * gtk/gtk.def
+       * gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
+       New functions, used to check that the GTK+-using code has been
+       compiled using the correct compiler and switches. In particular,
+       with gcc one has to use the -fnative-struct switch as GTK+ is
+       compiled with that.
+
 Fri Aug 18 17:27:46 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling
index ee0154e2105ff1c6693c00c34e4a0a54ede57fc2..67011eb99622da9ce31f16592d1a6a7b68020668 100644 (file)
@@ -17,16 +17,12 @@ extern "C" {
  *          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_SHARED_PIXMAP
+  GDK_IMAGE_FASTEST
 } GdkImageType;
 
 typedef struct _GdkImageClass GdkImageClass;
@@ -70,13 +66,7 @@ GdkImage*  gdk_image_new       (GdkImageType  type,
                                GdkVisual    *visual,
                                gint          width,
                                gint          height);
-#ifdef GDK_WINDOWING_WIN32
-GdkImage*  gdk_image_bitmap_new(GdkImageType  type,
-                               GdkVisual    *visual,
-                               gint          width,
-                               gint          height);
 
-#endif
 GdkImage*  gdk_image_get       (GdkDrawable  *drawable,
                                gint          x,
                                gint          y,
index 59abded6d096a74e6f9ebae6fc561a5723aa357a..c9603158c73776ed8ab62369ca78e99ef463527e 100644 (file)
@@ -218,9 +218,8 @@ gdk_image_new (GdkImageType  type,
   GDK_NOTE (MISC, g_print ("gdk_image_new: %dx%d %s\n",
                           width, height,
                           (type == GDK_IMAGE_SHARED ? "shared" :
-                           (type == GDK_IMAGE_SHARED_PIXMAP ? "shared_pixmap" :
-                            "???"))));
-
+                           "???")));
+  
   image = g_object_new (gdk_image_get_type (), NULL);
   private = PRIVATE_DATA (image);
 
@@ -654,18 +653,10 @@ gdk_win32_image_destroy (GdkImage *image)
     return;
   
   GDK_NOTE (MISC, g_print ("gdk_win32_image_destroy: %#x%s\n",
-                          private->hbitmap,
-                          (image->type == GDK_IMAGE_SHARED_PIXMAP ?
-                           " (shared pixmap)" : "")));
+                          private->hbitmap));
   
   switch (image->type)
     {
-    case GDK_IMAGE_SHARED_PIXMAP:
-      break;                   /* The Windows bitmap has already been
-                                * (or will be) deleted when freeing
-                                * the corresponding pixmap.
-                                */
-
     case GDK_IMAGE_SHARED:
       if (!DeleteObject (private->hbitmap))
        WIN32_GDI_FAILED ("DeleteObject");
index 7e5c51279b6a81ce71bb2cfb3c3957f62880bb46..a0c178fb07350fa1808f544466a8bce8e6775356 100755 (executable)
@@ -569,8 +569,10 @@ EXPORTS
        gtk_image_new
        gtk_image_set
        gtk_init
+       gtk_init_abi_check
        gtk_init_add
        gtk_init_check
+       gtk_init_check_abi_check
        gtk_input_add_full
        gtk_input_dialog_get_type
        gtk_input_dialog_new
index ae728c81e105d37d46f44aea76423b2555723a50..121beb09854a9c0050df6873700ac16155ad2042 100644 (file)
@@ -194,6 +194,8 @@ static gchar *add_dll_suffix(gchar *module_name)
 }
 #endif
 
+#undef gtk_init_check
+
 gboolean
 gtk_init_check (int     *argc,
                char   ***argv)
@@ -460,6 +462,9 @@ gtk_init_check (int  *argc,
 
   return TRUE;
 }
+
+#undef gtk_init
+
 void
 gtk_init (int *argc, char ***argv)
 {
@@ -470,6 +475,38 @@ gtk_init (int *argc, char ***argv)
     }
 }
 
+#ifdef G_OS_WIN32
+
+static void
+check_sizeof_GtkWindow (size_t sizeof_GtkWindow)
+{
+  if (sizeof_GtkWindow != sizeof (GtkWindow))
+    g_error ("Incompatible build!\n"
+            "The code using GTK+ thinks GtkWindow is of different\n"
+             "size than it actually is in this build of GTK+.\n"
+            "On Windows, this probably means that you have compiled\n"
+            "your code with gcc without the -fnative-struct switch.");
+}
+
+/* These two functions might get more checks added later, thus pass
+ * in the number of extra args.
+ */
+void
+gtk_init_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof_GtkWindow)
+{
+  check_sizeof_GtkWindow (sizeof_GtkWindow);
+  gtk_init (argc, argv);
+}
+
+gboolean
+gtk_init_check_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof_GtkWindow)
+{
+  check_sizeof_GtkWindow (sizeof_GtkWindow);
+  return gtk_init_check (argc, argv);
+}
+
+#endif
+
 void
 gtk_exit (gint errorcode)
 {
index dcee5f5efc9363059eebc7f86b33304f7666f9f2..08c01c74a5beeaf168fec7d9a09c96f7aaad403c 100644 (file)
@@ -81,8 +81,28 @@ gchar* gtk_check_version (guint      required_major,
 
 void     gtk_init                 (int    *argc,
                                    char ***argv);
+
 gboolean gtk_init_check           (int    *argc,
                                    char ***argv);
+#ifdef G_OS_WIN32
+
+/* Variants that are used to check for correct struct packing
+ * when building GTK+-using code.
+ */
+void    gtk_init_abi_check       (int    *argc,
+                                  char ***argv,
+                                  int     num_checks,
+                                  size_t  sizeof_GtkWindow);
+gboolean gtk_init_check_abi_check (int   *argc,
+                                  char ***argv,
+                                  int     num_checks,
+                                  size_t  sizeof_GtkWindow);
+
+#define gtk_init(argc, argv) gtk_init_abi_check (argc, argv, 1, sizeof (GtkWindow))
+#define gtk_init_check(args, argv) gtk_init_check_abi_check (argc, argv, 1, sizeof (GtkWindow))
+
+#endif
+
 void     gtk_exit                 (gint    error_code);
 gchar*   gtk_set_locale           (void);
 gchar*   gtk_get_default_language (void);