summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2009-10-14 03:02:14 +0200
committerJavier Jardón <jjardon@gnome.org>2009-10-14 03:13:52 +0200
commit57bc51371396af839859293468ba6004adfebcad (patch)
treed945485785647f0e7f2a43ac59c05c76ef995634
parentfb63e32a9d54854ea126fb5e772b412df9bbaef8 (diff)
downloadgtk+-57bc51371396af839859293468ba6004adfebcad.tar.gz
Use g_object_ref/unref instead deprecated gdk_*_ref/unref functions
Substitute deprecated reference counting functions for g_object_ref/unref in documentation and in internal code https://bugzilla.gnome.org/show_bug.cgi?id=598217
-rw-r--r--docs/dnd_internals.txt2
-rw-r--r--docs/faq/gtk-faq.sgml4
-rw-r--r--docs/tutorial/gtk_tut.sgml8
-rwxr-xr-xdocs/tutorial/gtk_tut_12.es.sgml6
-rw-r--r--docs/widget_system.txt2
-rw-r--r--gdk/directfb/gdkdnd-directfb.c4
-rw-r--r--gdk/gdkgc.h2
-rw-r--r--gdk/gdkimage.h2
-rw-r--r--gdk/gdkpixmap.h8
-rw-r--r--gdk/gdkwindow.h4
-rw-r--r--gdk/testgdk.c2
-rw-r--r--gdk/x11/gdkcursor-x11.c4
12 files changed, 23 insertions, 25 deletions
diff --git a/docs/dnd_internals.txt b/docs/dnd_internals.txt
index 62312ef0fa..fc5afcecc0 100644
--- a/docs/dnd_internals.txt
+++ b/docs/dnd_internals.txt
@@ -62,8 +62,6 @@ used by anything other than the DND code in GTK+.
/* Drag and Drop */
GdkDragContext * gdk_drag_context_new (void);
-void gdk_drag_context_ref (GdkDragContext *context);
-void gdk_drag_context_unref (GdkDragContext *context);
These create and refcount GdkDragContexts in a
straightforward manner.
diff --git a/docs/faq/gtk-faq.sgml b/docs/faq/gtk-faq.sgml
index e1fd8934f9..a4cad44403 100644
--- a/docs/faq/gtk-faq.sgml
+++ b/docs/faq/gtk-faq.sgml
@@ -2307,8 +2307,8 @@ used, as in:</para>
NULL, gtk_widget_get_colormap(top),
&amp;pixmap_mask, NULL, pixfile);
pixw = gtk_pixmap_new (pixmap, pixmap_mask);
- gdk_pixmap_unref (pixmap);
- gdk_pixmap_unref (pixmap_mask);
+ g_object_unref (pixmap);
+ g_object_unref (pixmap_mask);
</programlisting>
</sect1>
diff --git a/docs/tutorial/gtk_tut.sgml b/docs/tutorial/gtk_tut.sgml
index 8c3357a805..af812b83fb 100644
--- a/docs/tutorial/gtk_tut.sgml
+++ b/docs/tutorial/gtk_tut.sgml
@@ -4114,7 +4114,7 @@ static const char * xpm_data[] = {
When we're done using a pixmap and not likely to reuse it again soon,
it is a good idea to release the resource using
-gdk_pixmap_unref(). Pixmaps should be considered a precious resource,
+g_object_unref(). Pixmaps should be considered a precious resource,
because they take up memory in the end-user's X server process. Even
though the X client you write may run on a powerful "server" computer,
the user may be running the X server on a small personal computer.
@@ -14476,7 +14476,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
- gdk_pixmap_unref(pixmap);
+ g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
@@ -17406,7 +17406,7 @@ static gint configure_event( GtkWidget *widget,
GdkEventConfigure *event )
{
if (pixmap)
- gdk_pixmap_unref(pixmap);
+ g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
@@ -17592,7 +17592,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
- gdk_pixmap_unref(pixmap);
+ g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
diff --git a/docs/tutorial/gtk_tut_12.es.sgml b/docs/tutorial/gtk_tut_12.es.sgml
index 74b4827aa6..cca7bd9a7f 100755
--- a/docs/tutorial/gtk_tut_12.es.sgml
+++ b/docs/tutorial/gtk_tut_12.es.sgml
@@ -4061,7 +4061,7 @@ static const char * xpm_data[] = {
Cuando hayamos acabado de usar un <em/pixmap/ y no lo vayamos a usar
durante un tiempo suele ser conveniente liberar el recurso mediante
-gdk_pixmap_unref(). (Los <em/pixmaps/ deben ser considerados recursos
+g_object_unref(). (Los <em/pixmaps/ deben ser considerados recursos
preciosos).
Una vez que hemos creado el <em/pixmap/ lo podemos mostrar como un
@@ -13967,7 +13967,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
- gdk_pixmap_unref(pixmap);
+ g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
@@ -16855,7 +16855,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
- gdk_pixmap_unref(pixmap);
+ g_object_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
diff --git a/docs/widget_system.txt b/docs/widget_system.txt
index e60ac32d8d..1c2867cad5 100644
--- a/docs/widget_system.txt
+++ b/docs/widget_system.txt
@@ -365,7 +365,7 @@ When a widget receives the "realize" signal it should:
1) set the realized flag
2) set widget->window
widget->window = gtk_widget_get_parent_window (widget);
- gdk_window_ref (widget->window);
+ g_object_ref (widget->window);
3) attach the widget's style
widget->style = gtk_style_attach (widget->style, widget->window);
diff --git a/gdk/directfb/gdkdnd-directfb.c b/gdk/directfb/gdkdnd-directfb.c
index 2691279008..6569105c26 100644
--- a/gdk/directfb/gdkdnd-directfb.c
+++ b/gdk/directfb/gdkdnd-directfb.c
@@ -235,7 +235,7 @@ local_send_enter (GdkDragContext *context,
if (current_dest_drag != NULL)
{
- gdk_drag_context_unref (current_dest_drag);
+ g_object_unref (current_dest_drag);
current_dest_drag = NULL;
}
@@ -627,7 +627,7 @@ gdk_drop_finish (GdkDragContext *context,
context->dest_window);
if (src_context)
{
- gdk_drag_context_ref (src_context);
+ g_object_ref (src_context);
event.dnd.type = GDK_DROP_FINISHED;
event.dnd.window = src_context->source_window;
diff --git a/gdk/gdkgc.h b/gdk/gdkgc.h
index ff0460504f..c64d2af5b4 100644
--- a/gdk/gdkgc.h
+++ b/gdk/gdkgc.h
@@ -294,7 +294,7 @@ void gdk_gc_set_rgb_bg_color (GdkGC *gc,
GdkScreen * gdk_gc_get_screen (GdkGC *gc);
#ifndef GDK_DISABLE_DEPRECATED
-#define gdk_gc_destroy gdk_gc_unref
+#define gdk_gc_destroy g_object_unref
#endif /* GDK_DISABLE_DEPRECATED */
G_END_DECLS
diff --git a/gdk/gdkimage.h b/gdk/gdkimage.h
index 1c3c40176c..92ac4ff800 100644
--- a/gdk/gdkimage.h
+++ b/gdk/gdkimage.h
@@ -129,7 +129,7 @@ GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
#endif /* GDK_ENABLE_BROKEN */
#ifndef GDK_DISABLE_DEPRECATED
-#define gdk_image_destroy gdk_image_unref
+#define gdk_image_destroy g_object_unref
#endif /* GDK_DISABLE_DEPRECATED */
G_END_DECLS
diff --git a/gdk/gdkpixmap.h b/gdk/gdkpixmap.h
index e309038915..470a9e5450 100644
--- a/gdk/gdkpixmap.h
+++ b/gdk/gdkpixmap.h
@@ -119,10 +119,10 @@ GdkPixmap* gdk_pixmap_foreign_new_for_screen (GdkScreen *screen,
gint depth);
#ifndef GDK_DISABLE_DEPRECATED
-#define gdk_bitmap_ref gdk_drawable_ref
-#define gdk_bitmap_unref gdk_drawable_unref
-#define gdk_pixmap_ref gdk_drawable_ref
-#define gdk_pixmap_unref gdk_drawable_unref
+#define gdk_bitmap_ref g_object_ref
+#define gdk_bitmap_unref g_object_unref
+#define gdk_pixmap_ref g_object_ref
+#define gdk_pixmap_unref g_object_unref
#endif /* GDK_DISABLE_DEPRECATED */
G_END_DECLS
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index b8502754b8..1a42ed5678 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -693,8 +693,8 @@ void gdk_window_remove_redirection (GdkWindow *window);
#define gdk_window_get_colormap gdk_drawable_get_colormap
#define gdk_window_set_colormap gdk_drawable_set_colormap
#define gdk_window_get_visual gdk_drawable_get_visual
-#define gdk_window_ref gdk_drawable_ref
-#define gdk_window_unref gdk_drawable_unref
+#define gdk_window_ref g_object_ref
+#define gdk_window_unref g_object_unref
#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \
gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height)
diff --git a/gdk/testgdk.c b/gdk/testgdk.c
index c7ca87bba8..0a4a656feb 100644
--- a/gdk/testgdk.c
+++ b/gdk/testgdk.c
@@ -303,7 +303,7 @@ test_gcs (void)
gdk_gc_copy (black_gc, gc);
gdk_gc_get_values (black_gc, &gcvalues);
TEST (test_default_gc (&gcvalues, TRUE));
- gdk_gc_unref (gc);
+ g_object_unref (gc);
gdk_gc_set_foreground (black_gc, &black);
gdk_gc_get_values (black_gc, &gcvalues);
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index 9f72b79964..19d79cf9ca 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -347,8 +347,8 @@ gdk_cursor_new_for_display (GdkDisplay *display,
* mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits,
* cursor1_width, cursor1_height);
* cursor = gdk_cursor_new_from_pixmap (source, mask, &amp;fg, &amp;bg, 8, 8);
- * gdk_pixmap_unref (source);
- * gdk_pixmap_unref (mask);
+ * g_object_unref (source);
+ * g_object_unref (mask);
*
*
* gdk_window_set_cursor (widget->window, cursor);