summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2000-01-29 22:26:41 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-01-29 22:26:41 +0000
commit4d48b106f0b897d3c101c73be0e4f19f1248f8de (patch)
tree73ef27890b623ef58361790272f97470261947cf /gdk
parent7d39971922e88caa0a1ac7a129a766929457b028 (diff)
downloadgdk-pixbuf-4d48b106f0b897d3c101c73be0e4f19f1248f8de.tar.gz
use gdk_cursor_unref instead of destroy
2000-01-30 Havoc Pennington <hp@pobox.com> * gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of destroy * gdk/gdkimage.c (gdk_image_ref): image wasn't being returned * gdk/gdkprivate.h: declare _gdk_cursor_destroy which is then implemented in platform-specific code * gdk/Makefile.am (gdk_c_sources): add gdkcursor.c * gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy): rename with an underscore in front * gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy): put an underscore in front * gdk/gdkcursor.c: new file, implements gdk_cursor_ref/gdk_cursor_unref * gdk/gdkcursor.h: Refcount GdkCursor * gdk/gdkcompat.h (gdk_cursor_destroy): compat
Diffstat (limited to 'gdk')
-rw-r--r--gdk/Makefile.am1
-rw-r--r--gdk/gdkcompat.h2
-rw-r--r--gdk/gdkcursor.h4
-rw-r--r--gdk/gdkimage.c2
-rw-r--r--gdk/gdkprivate.h2
-rw-r--r--gdk/win32/gdkcursor-win32.c2
-rw-r--r--gdk/x11/gdkcursor-x11.c2
7 files changed, 12 insertions, 3 deletions
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 134fc1881..5130ac1c7 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -76,6 +76,7 @@ gdk_public_h_sources = @STRIP_BEGIN@ \
gdk_c_sources = @STRIP_BEGIN@ \
gdk.c \
gdkcolor.c \
+ gdkcursor.c \
gdkdraw.c \
gdkevents.c \
gdkfont.c \
diff --git a/gdk/gdkcompat.h b/gdk/gdkcompat.h
index d82d8f69d..b07837086 100644
--- a/gdk/gdkcompat.h
+++ b/gdk/gdkcompat.h
@@ -34,6 +34,8 @@ extern "C" {
#define gdk_gc_destroy gdk_gc_unref
#define gdk_image_destroy gdk_image_unref
+#define gdk_cursor_destroy gdk_cursor_unref
+
#define GDK_WINDOW_PIXMAP GDK_DRAWABLE_PIXMAP
diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h
index 14f6e4414..fd28ce89f 100644
--- a/gdk/gdkcursor.h
+++ b/gdk/gdkcursor.h
@@ -19,6 +19,7 @@ typedef enum
struct _GdkCursor
{
GdkCursorType type;
+ guint refcount;
};
/* Cursors
@@ -30,7 +31,8 @@ GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
GdkColor *bg,
gint x,
gint y);
-void gdk_cursor_destroy (GdkCursor *cursor);
+GdkCursor* gdk_cursor_ref (GdkCursor *cursor);
+void gdk_cursor_unref (GdkCursor *cursor);
#ifdef __cplusplus
}
diff --git a/gdk/gdkimage.c b/gdk/gdkimage.c
index 09ae112b6..1e82d50df 100644
--- a/gdk/gdkimage.c
+++ b/gdk/gdkimage.c
@@ -38,6 +38,8 @@ gdk_image_ref (GdkImage *image)
g_return_val_if_fail (image != NULL, NULL);
private->ref_count++;
+
+ return image;
}
void
diff --git a/gdk/gdkprivate.h b/gdk/gdkprivate.h
index 8d32599d9..4eefea9e4 100644
--- a/gdk/gdkprivate.h
+++ b/gdk/gdkprivate.h
@@ -262,6 +262,8 @@ void _gdk_font_destroy (GdkFont *font);
void _gdk_colormap_real_destroy (GdkColormap *colormap);
+void _gdk_cursor_destroy (GdkCursor *cursor);
+
/* Initialization */
extern GdkArgDesc _gdk_windowing_args[];
diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c
index a8d1760d6..c887a4556 100644
--- a/gdk/win32/gdkcursor-win32.c
+++ b/gdk/win32/gdkcursor-win32.c
@@ -255,7 +255,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
}
void
-gdk_cursor_destroy (GdkCursor *cursor)
+_gdk_cursor_destroy (GdkCursor *cursor)
{
GdkCursorPrivate *private;
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index 66d0f34dd..974135208 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -79,7 +79,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, GdkColor *fg, Gd
}
void
-gdk_cursor_destroy (GdkCursor *cursor)
+_gdk_cursor_destroy (GdkCursor *cursor)
{
GdkCursorPrivate *private;