]> Pileus Git - ~andy/gtk/commitdiff
Deprecate gdk_set/get_use_xshm, make gdk_set_use_xshm a noop. Remove
authorOwen Taylor <otaylor@redhat.com>
Fri, 7 Sep 2001 22:33:09 +0000 (22:33 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 7 Sep 2001 22:33:09 +0000 (22:33 +0000)
Fri Sep  7 18:17:47 2001  Owen Taylor  <otaylor@redhat.com>

* gdk/gdk.h gdk/x11/gdkmain-x11.c: Deprecate gdk_set/get_use_xshm,
make gdk_set_use_xshm a noop. Remove --no-xshm command line
option. If we aren't autodetecting properly, we need
to fix the problem, or at least make it an environment
variable setting, to avoid problems with propagating
to embedded children, plugins, etc.

* gdk/gdkcolor.h: Deprecate gdk_colormap_get_system_size().

* gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h
(gdk_pixbuf_render_pixmap_and_mask_for_colormap):
New function to render a pixmap and mask for a particular colormap.

* gtk/gtkwindow.c (get_pixmap_and_mask): Change to use
gdk_pixbuf_render_pixmap_and_mask_for_colormap () instead
of internal implementation of the same.

13 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/gdk.h
gdk/gdkcolor.h
gdk/gdkpixbuf-render.c
gdk/gdkpixbuf.h
gdk/x11/gdkmain-x11.c
gtk/gtkwindow.c

index b210b8251b6570d39eff80a21040038442e9f28c..7953464708025a1bc2c978094def411e03e57347 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+Fri Sep  7 18:17:47 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.h gdk/x11/gdkmain-x11.c: Deprecate gdk_set/get_use_xshm, 
+       make gdk_set_use_xshm a noop. Remove --no-xshm command line
+       option. If we aren't autodetecting properly, we need
+       to fix the problem, or at least make it an environment
+       variable setting, to avoid problems with propagating
+       to embedded children, plugins, etc.
+
+       * gdk/gdkcolor.h: Deprecate gdk_colormap_get_system_size().
+
+       * gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h
+       (gdk_pixbuf_render_pixmap_and_mask_for_colormap):
+       New function to render a pixmap and mask for a particular colormap.
+
+       * gtk/gtkwindow.c (get_pixmap_and_mask): Change to use
+       gdk_pixbuf_render_pixmap_and_mask_for_colormap () instead
+       of internal implementation of the same.
+
 2001-09-07  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextlayout.c (gtk_text_layout_get_lines): remove some
index b210b8251b6570d39eff80a21040038442e9f28c..7953464708025a1bc2c978094def411e03e57347 100644 (file)
@@ -1,3 +1,22 @@
+Fri Sep  7 18:17:47 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.h gdk/x11/gdkmain-x11.c: Deprecate gdk_set/get_use_xshm, 
+       make gdk_set_use_xshm a noop. Remove --no-xshm command line
+       option. If we aren't autodetecting properly, we need
+       to fix the problem, or at least make it an environment
+       variable setting, to avoid problems with propagating
+       to embedded children, plugins, etc.
+
+       * gdk/gdkcolor.h: Deprecate gdk_colormap_get_system_size().
+
+       * gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h
+       (gdk_pixbuf_render_pixmap_and_mask_for_colormap):
+       New function to render a pixmap and mask for a particular colormap.
+
+       * gtk/gtkwindow.c (get_pixmap_and_mask): Change to use
+       gdk_pixbuf_render_pixmap_and_mask_for_colormap () instead
+       of internal implementation of the same.
+
 2001-09-07  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextlayout.c (gtk_text_layout_get_lines): remove some
index b210b8251b6570d39eff80a21040038442e9f28c..7953464708025a1bc2c978094def411e03e57347 100644 (file)
@@ -1,3 +1,22 @@
+Fri Sep  7 18:17:47 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.h gdk/x11/gdkmain-x11.c: Deprecate gdk_set/get_use_xshm, 
+       make gdk_set_use_xshm a noop. Remove --no-xshm command line
+       option. If we aren't autodetecting properly, we need
+       to fix the problem, or at least make it an environment
+       variable setting, to avoid problems with propagating
+       to embedded children, plugins, etc.
+
+       * gdk/gdkcolor.h: Deprecate gdk_colormap_get_system_size().
+
+       * gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h
+       (gdk_pixbuf_render_pixmap_and_mask_for_colormap):
+       New function to render a pixmap and mask for a particular colormap.
+
+       * gtk/gtkwindow.c (get_pixmap_and_mask): Change to use
+       gdk_pixbuf_render_pixmap_and_mask_for_colormap () instead
+       of internal implementation of the same.
+
 2001-09-07  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextlayout.c (gtk_text_layout_get_lines): remove some
index b210b8251b6570d39eff80a21040038442e9f28c..7953464708025a1bc2c978094def411e03e57347 100644 (file)
@@ -1,3 +1,22 @@
+Fri Sep  7 18:17:47 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.h gdk/x11/gdkmain-x11.c: Deprecate gdk_set/get_use_xshm, 
+       make gdk_set_use_xshm a noop. Remove --no-xshm command line
+       option. If we aren't autodetecting properly, we need
+       to fix the problem, or at least make it an environment
+       variable setting, to avoid problems with propagating
+       to embedded children, plugins, etc.
+
+       * gdk/gdkcolor.h: Deprecate gdk_colormap_get_system_size().
+
+       * gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h
+       (gdk_pixbuf_render_pixmap_and_mask_for_colormap):
+       New function to render a pixmap and mask for a particular colormap.
+
+       * gtk/gtkwindow.c (get_pixmap_and_mask): Change to use
+       gdk_pixbuf_render_pixmap_and_mask_for_colormap () instead
+       of internal implementation of the same.
+
 2001-09-07  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextlayout.c (gtk_text_layout_get_lines): remove some
index b210b8251b6570d39eff80a21040038442e9f28c..7953464708025a1bc2c978094def411e03e57347 100644 (file)
@@ -1,3 +1,22 @@
+Fri Sep  7 18:17:47 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.h gdk/x11/gdkmain-x11.c: Deprecate gdk_set/get_use_xshm, 
+       make gdk_set_use_xshm a noop. Remove --no-xshm command line
+       option. If we aren't autodetecting properly, we need
+       to fix the problem, or at least make it an environment
+       variable setting, to avoid problems with propagating
+       to embedded children, plugins, etc.
+
+       * gdk/gdkcolor.h: Deprecate gdk_colormap_get_system_size().
+
+       * gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h
+       (gdk_pixbuf_render_pixmap_and_mask_for_colormap):
+       New function to render a pixmap and mask for a particular colormap.
+
+       * gtk/gtkwindow.c (get_pixmap_and_mask): Change to use
+       gdk_pixbuf_render_pixmap_and_mask_for_colormap () instead
+       of internal implementation of the same.
+
 2001-09-07  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextlayout.c (gtk_text_layout_get_lines): remove some
index b210b8251b6570d39eff80a21040038442e9f28c..7953464708025a1bc2c978094def411e03e57347 100644 (file)
@@ -1,3 +1,22 @@
+Fri Sep  7 18:17:47 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.h gdk/x11/gdkmain-x11.c: Deprecate gdk_set/get_use_xshm, 
+       make gdk_set_use_xshm a noop. Remove --no-xshm command line
+       option. If we aren't autodetecting properly, we need
+       to fix the problem, or at least make it an environment
+       variable setting, to avoid problems with propagating
+       to embedded children, plugins, etc.
+
+       * gdk/gdkcolor.h: Deprecate gdk_colormap_get_system_size().
+
+       * gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h
+       (gdk_pixbuf_render_pixmap_and_mask_for_colormap):
+       New function to render a pixmap and mask for a particular colormap.
+
+       * gtk/gtkwindow.c (get_pixmap_and_mask): Change to use
+       gdk_pixbuf_render_pixmap_and_mask_for_colormap () instead
+       of internal implementation of the same.
+
 2001-09-07  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextlayout.c (gtk_text_layout_get_lines): remove some
index b210b8251b6570d39eff80a21040038442e9f28c..7953464708025a1bc2c978094def411e03e57347 100644 (file)
@@ -1,3 +1,22 @@
+Fri Sep  7 18:17:47 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/gdk.h gdk/x11/gdkmain-x11.c: Deprecate gdk_set/get_use_xshm, 
+       make gdk_set_use_xshm a noop. Remove --no-xshm command line
+       option. If we aren't autodetecting properly, we need
+       to fix the problem, or at least make it an environment
+       variable setting, to avoid problems with propagating
+       to embedded children, plugins, etc.
+
+       * gdk/gdkcolor.h: Deprecate gdk_colormap_get_system_size().
+
+       * gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h
+       (gdk_pixbuf_render_pixmap_and_mask_for_colormap):
+       New function to render a pixmap and mask for a particular colormap.
+
+       * gtk/gtkwindow.c (get_pixmap_and_mask): Change to use
+       gdk_pixbuf_render_pixmap_and_mask_for_colormap () instead
+       of internal implementation of the same.
+
 2001-09-07  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextlayout.c (gtk_text_layout_get_lines): remove some
index 701f3f6fb8a0a3719a430d9e41ca9e88eb6b36c3..5546278349b5daf1accfef572bc377b1afebff35 100644 (file)
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -75,10 +75,11 @@ void                 gdk_set_program_class (const char *program_class);
 void      gdk_error_trap_push           (void);
 gint      gdk_error_trap_pop            (void);
 
-
+#ifndef GDK_DISABLE_DEPRECATED
 void     gdk_set_use_xshm              (gboolean        use_xshm);
-
 gboolean  gdk_get_use_xshm             (void);
+#endif /* GDK_DISABLE_DEPRECATED */
+
 gchar*   gdk_get_display               (void);
 
 #ifndef GDK_DISABLE_DEPRECATED
index ad820830abd2246377e02b38ff5c5bfbd1e9064e..569aff64da47275bbf6602f268f36732ca7dcdc4 100644 (file)
@@ -64,7 +64,9 @@ GdkColormap* gdk_colormap_ref   (GdkColormap *cmap);
 void        gdk_colormap_unref   (GdkColormap *cmap);
 
 GdkColormap* gdk_colormap_get_system      (void);
+#ifndef GDK_DISABLE_DEPRECATED
 gint        gdk_colormap_get_system_size  (void);
+#endif
 
 void gdk_colormap_change (GdkColormap  *colormap,
                          gint           ncolors);
index 7b86f6e516f14b3292ec82355bad1fbc421782a7..5a534be73d736403b052364a5ae341ee1f47cfcc 100644 (file)
@@ -427,11 +427,16 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf   *pixbuf,
  *
  * Creates a pixmap and a mask bitmap which are returned in the @pixmap_return
  * and @mask_return arguments, respectively, and renders a pixbuf and its
- * corresponding tresholded alpha mask to them.  This is merely a convenience
+ * corresponding thresholded alpha mask to them.  This is merely a convenience
  * function; applications that need to render pixbufs with dither offsets or to
  * given drawables should use gdk_pixbuf_render_to_drawable_alpha() or
  * gdk_pixbuf_render_to_drawable(), and gdk_pixbuf_render_threshold_alpha().
  *
+ * The pixmap that is created is created for the colormap returned
+ * by gdk_rgb_get_colormap(). You normally will want to instead use
+ * the actual colormap for a widget, and use
+ * gdk_pixbuf_render_pixmap_and_mask_for_colormap.
+ *
  * If the pixbuf does not have an alpha channel, then *@mask_return will be set
  * to NULL.
  **/
@@ -440,6 +445,41 @@ gdk_pixbuf_render_pixmap_and_mask (GdkPixbuf  *pixbuf,
                                   GdkPixmap **pixmap_return,
                                   GdkBitmap **mask_return,
                                   int         alpha_threshold)
+{
+  gdk_pixbuf_render_pixmap_and_mask_for_colormap (pixbuf,
+                                                 gdk_rgb_get_colormap (),
+                                                 pixmap_return, mask_return,
+                                                 alpha_threshold);
+}
+
+/**
+ * gdk_pixbuf_render_pixmap_and_mask_for_colormap:
+ * @pixbuf: A pixbuf.
+ * @colormap: A #GdkColormap
+ * @pixmap_return: Return value for the created pixmap.
+ * @mask_return: Return value for the created mask.
+ * @alpha_threshold: Threshold value for opacity values.
+ *
+ * Creates a pixmap and a mask bitmap which are returned in the @pixmap_return
+ * and @mask_return arguments, respectively, and renders a pixbuf and its
+ * corresponding tresholded alpha mask to them.  This is merely a convenience
+ * function; applications that need to render pixbufs with dither offsets or to
+ * given drawables should use gdk_pixbuf_render_to_drawable_alpha() or
+ * gdk_pixbuf_render_to_drawable(), and gdk_pixbuf_render_threshold_alpha().
+ *
+ * The pixmap that is created uses the #GdkColormap specified by @colormap.
+ * This colormap must match the colormap of the window where the pixmap
+ * will eventually be used or an error will result.
+ *
+ * If the pixbuf does not have an alpha channel, then *@mask_return will be set
+ * to NULL.
+ **/
+void
+gdk_pixbuf_render_pixmap_and_mask_for_colormap (GdkPixbuf   *pixbuf,
+                                               GdkColormap *colormap,
+                                               GdkPixmap  **pixmap_return,
+                                               GdkBitmap  **mask_return,
+                                               int          alpha_threshold)
 {
   g_return_if_fail (pixbuf != NULL);
   
@@ -447,12 +487,14 @@ gdk_pixbuf_render_pixmap_and_mask (GdkPixbuf  *pixbuf,
     {
       GdkGC *gc;
       
-      *pixmap_return = gdk_pixmap_new (NULL, pixbuf->width, pixbuf->height,
-                                      gdk_rgb_get_visual ()->depth);
+      *pixmap_return = gdk_pixmap_new (NULL, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf),
+                                      gdk_colormap_get_visual (colormap)->depth);
+      gdk_drawable_set_colormap (GDK_DRAWABLE (*pixmap_return),
+                                 colormap);
       gc = gdk_gc_new (*pixmap_return);
       gdk_pixbuf_render_to_drawable (pixbuf, *pixmap_return, gc,
                                     0, 0, 0, 0,
-                                    pixbuf->width, pixbuf->height,
+                                    gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf),
                                     GDK_RGB_DITHER_NORMAL,
                                     0, 0);
       gdk_gc_unref (gc);
@@ -460,15 +502,18 @@ gdk_pixbuf_render_pixmap_and_mask (GdkPixbuf  *pixbuf,
   
   if (mask_return)
     {
-      if (pixbuf->has_alpha)
+      if (gdk_pixbuf_get_has_alpha (pixbuf))
        {
-         *mask_return = gdk_pixmap_new (NULL, pixbuf->width, pixbuf->height, 1);
+         *mask_return = gdk_pixmap_new (NULL, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), 1);
+          
          gdk_pixbuf_render_threshold_alpha (pixbuf, *mask_return,
                                             0, 0, 0, 0,
-                                            pixbuf->width, pixbuf->height,
+                                            gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf),
                                             alpha_threshold);
        }
       else
        *mask_return = NULL;
     }
 }
+
+
index 593d4ad45054c6668c1af39c780dbba41996db75..3298ad8b9519985c78b4a402397c76073f527307 100644 (file)
@@ -45,10 +45,17 @@ void gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf           *pixbuf,
                                          GdkRgbDither         dither,
                                          int                  x_dither,
                                          int                  y_dither);
-void gdk_pixbuf_render_pixmap_and_mask   (GdkPixbuf           *pixbuf,
-                                         GdkPixmap          **pixmap_return,
-                                         GdkBitmap          **mask_return,
-                                         int                  alpha_threshold);
+
+void gdk_pixbuf_render_pixmap_and_mask_for_colormap (GdkPixbuf    *pixbuf,
+                                                    GdkColormap  *colormap,
+                                                    GdkPixmap   **pixmap_return,
+                                                    GdkBitmap   **mask_return,
+                                                    int           alpha_threshold);
+void gdk_pixbuf_render_pixmap_and_mask              (GdkPixbuf    *pixbuf,
+                                                    GdkPixmap   **pixmap_return,
+                                                    GdkBitmap   **mask_return,
+                                                    int           alpha_threshold);
+
 
 /* Fetching a region from a drawable */
 GdkPixbuf *gdk_pixbuf_get_from_drawable (GdkPixbuf   *dest,
index 0f6476fe446deef5a2022d30a3b1f0054e653303..0c696e8327de8e5377541421362b5924474ed495 100644 (file)
@@ -105,7 +105,6 @@ static const int gdk_ndebug_keys = sizeof(gdk_debug_keys)/sizeof(GDebugKey);
 GdkArgDesc _gdk_windowing_args[] = {
   { "display",     GDK_ARG_STRING,   &_gdk_display_name,    (GdkArgFunc)NULL   },
   { "sync",        GDK_ARG_BOOL,     &gdk_synchronize,     (GdkArgFunc)NULL   },
-  { "no-xshm",     GDK_ARG_NOBOOL,   &_gdk_use_xshm,        (GdkArgFunc)NULL   },
   { "gxid-host",   GDK_ARG_STRING,   &_gdk_input_gxid_host, (GdkArgFunc)NULL   },
   { "gxid-port",   GDK_ARG_INT,      &_gdk_input_gxid_port, (GdkArgFunc)NULL   },
   { NULL }
@@ -193,7 +192,6 @@ _gdk_windowing_init_check (int argc, char **argv)
 void
 gdk_set_use_xshm (gboolean use_xshm)
 {
-  _gdk_use_xshm = use_xshm;
 }
 
 gboolean
index eab6decbac1ab512a5380bb9f9e2758169291e61..e0d8ab6bd7d077b471a78c3e81bf0616a4176617 100644 (file)
@@ -1737,48 +1737,6 @@ gtk_window_get_decorated (GtkWindow *window)
   return window->decorated;
 }
 
-static void
-gdk_pixbuf_render_pixmap_and_mask_with_colormap (GdkPixbuf   *pixbuf,
-                                                 GdkPixmap  **pixmap_return,
-                                                 GdkBitmap  **mask_return,
-                                                 int          alpha_threshold,
-                                                 GdkColormap *cmap)
-{
-  g_return_if_fail (pixbuf != NULL);
-  
-  if (pixmap_return)
-    {
-      GdkGC *gc;
-      
-      *pixmap_return = gdk_pixmap_new (NULL, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf),
-                                      gdk_colormap_get_visual (cmap)->depth);
-      gdk_drawable_set_colormap (GDK_DRAWABLE (*pixmap_return),
-                                 cmap);
-      gc = gdk_gc_new (*pixmap_return);
-      gdk_pixbuf_render_to_drawable (pixbuf, *pixmap_return, gc,
-                                    0, 0, 0, 0,
-                                    gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf),
-                                    GDK_RGB_DITHER_NORMAL,
-                                    0, 0);
-      gdk_gc_unref (gc);
-    }
-  
-  if (mask_return)
-    {
-      if (gdk_pixbuf_get_has_alpha (pixbuf))
-       {
-         *mask_return = gdk_pixmap_new (NULL, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), 1);
-          
-         gdk_pixbuf_render_threshold_alpha (pixbuf, *mask_return,
-                                            0, 0, 0, 0,
-                                            gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf),
-                                            alpha_threshold);
-       }
-      else
-       *mask_return = NULL;
-    }
-}
-
 static GtkWindowIconInfo*
 get_icon_info (GtkWindow *window)
 {
@@ -1884,11 +1842,11 @@ get_pixmap_and_mask (GtkWindowIconInfo  *parent_info,
         }
 
       if (best_icon)
-        gdk_pixbuf_render_pixmap_and_mask_with_colormap (best_icon,
-                                                         pmap_return,
-                                                         mask_return,
-                                                         128,
-                                                         gdk_colormap_get_system ());
+        gdk_pixbuf_render_pixmap_and_mask_for_colormap (best_icon,
+                                                       gdk_colormap_get_system (),
+                                                       pmap_return,
+                                                       mask_return,
+                                                       128);
 
       /* Save pmap/mask for others to use if appropriate */
       if (parent_info)