summaryrefslogtreecommitdiff
path: root/gdk/gdkpixmap.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>1997-12-18 02:17:14 +0000
committerOwen Taylor <otaylor@src.gnome.org>1997-12-18 02:17:14 +0000
commitd5d01a5af9aaa11762d7ba86760796df00af3786 (patch)
treec12bb7c7980b3177456cab8987755a976297b205 /gdk/gdkpixmap.c
parent65e63db01e93820093c2eb5169d5f8c0be3fe4e5 (diff)
downloadgtk+-d5d01a5af9aaa11762d7ba86760796df00af3786.tar.gz
It's all in the changelog. Well, almost all.
-owt
Diffstat (limited to 'gdk/gdkpixmap.c')
-rw-r--r--gdk/gdkpixmap.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index b1eaba214d..cf95dfc86e 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -650,22 +650,39 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
return pixmap;
}
-void
-gdk_pixmap_destroy (GdkPixmap *pixmap)
+GdkPixmap*
+gdk_pixmap_ref (GdkPixmap *pixmap)
{
- GdkWindowPrivate *private;
+ GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
+ g_return_val_if_fail (pixmap != NULL, NULL);
- g_return_if_fail (pixmap != NULL);
+ private->ref_count += 1;
+ return pixmap;
+}
- private = (GdkPixmapPrivate*) pixmap;
- if (private->ref_count <= 0)
+void
+gdk_pixmap_unref (GdkPixmap *pixmap)
+{
+ GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
+ g_return_if_fail(pixmap != NULL);
+
+ private->ref_count -= 1;
+ if (private->ref_count == 0)
{
XFreePixmap (private->xdisplay, private->xwindow);
gdk_xid_table_remove (private->xwindow);
- g_free (pixmap);
- }
- else
- {
- private->ref_count -= 1;
+ g_free (private);
}
}
+
+GdkBitmap *
+gdk_bitmap_ref (GdkBitmap *bitmap)
+{
+ return (GdkBitmap *)gdk_pixmap_ref ((GdkPixmap *)bitmap);
+}
+
+void
+gdk_bitmap_unref (GdkBitmap *bitmap)
+{
+ gdk_pixmap_unref ((GdkPixmap *)bitmap);
+}