summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-09-07 22:33:09 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-09-07 22:33:09 +0000
commita3914aaf10c84a7c6e3e3ca6537af4af09892f06 (patch)
treecc7785505cc14cd8d4fb248ab112e5f30e8c2055
parente8648181eddfc2e9069631fd5a7083fe015f3605 (diff)
downloadgtk+-a3914aaf10c84a7c6e3e3ca6537af4af09892f06.tar.gz
Deprecate gdk_set/get_use_xshm, make gdk_set_use_xshm a noop. Remove
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.
-rw-r--r--ChangeLog19
-rw-r--r--ChangeLog.pre-2-019
-rw-r--r--ChangeLog.pre-2-1019
-rw-r--r--ChangeLog.pre-2-219
-rw-r--r--ChangeLog.pre-2-419
-rw-r--r--ChangeLog.pre-2-619
-rw-r--r--ChangeLog.pre-2-819
-rw-r--r--gdk/gdk.h5
-rw-r--r--gdk/gdkcolor.h2
-rw-r--r--gdk/gdkpixbuf-render.c59
-rw-r--r--gdk/gdkpixbuf.h15
-rw-r--r--gdk/x11/gdkmain-x11.c2
-rw-r--r--gtk/gtkwindow.c52
13 files changed, 206 insertions, 62 deletions
diff --git a/ChangeLog b/ChangeLog
index b210b8251b..7953464708 100644
--- 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
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index b210b8251b..7953464708 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -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
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index b210b8251b..7953464708 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -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
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index b210b8251b..7953464708 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -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
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index b210b8251b..7953464708 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -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
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index b210b8251b..7953464708 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -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
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index b210b8251b..7953464708 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -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
diff --git a/gdk/gdk.h b/gdk/gdk.h
index 701f3f6fb8..5546278349 100644
--- 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
diff --git a/gdk/gdkcolor.h b/gdk/gdkcolor.h
index ad820830ab..569aff64da 100644
--- a/gdk/gdkcolor.h
+++ b/gdk/gdkcolor.h
@@ -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);
diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c
index 7b86f6e516..5a534be73d 100644
--- a/gdk/gdkpixbuf-render.c
+++ b/gdk/gdkpixbuf-render.c
@@ -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.
**/
@@ -441,18 +446,55 @@ gdk_pixbuf_render_pixmap_and_mask (GdkPixbuf *pixbuf,
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);
if (pixmap_return)
{
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;
}
}
+
+
diff --git a/gdk/gdkpixbuf.h b/gdk/gdkpixbuf.h
index 593d4ad450..3298ad8b95 100644
--- a/gdk/gdkpixbuf.h
+++ b/gdk/gdkpixbuf.h
@@ -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,
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 0f6476fe44..0c696e8327 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -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
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index eab6decbac..e0d8ab6bd7 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -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)