mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-16 05:30:28 +00:00
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
This commit is contained in:
parent
fb63e32a9d
commit
57bc513713
@ -62,8 +62,6 @@ used by anything other than the DND code in GTK+.
|
|||||||
/* Drag and Drop */
|
/* Drag and Drop */
|
||||||
|
|
||||||
GdkDragContext * gdk_drag_context_new (void);
|
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
|
These create and refcount GdkDragContexts in a
|
||||||
straightforward manner.
|
straightforward manner.
|
||||||
|
@ -2307,8 +2307,8 @@ used, as in:</para>
|
|||||||
NULL, gtk_widget_get_colormap(top),
|
NULL, gtk_widget_get_colormap(top),
|
||||||
&pixmap_mask, NULL, pixfile);
|
&pixmap_mask, NULL, pixfile);
|
||||||
pixw = gtk_pixmap_new (pixmap, pixmap_mask);
|
pixw = gtk_pixmap_new (pixmap, pixmap_mask);
|
||||||
gdk_pixmap_unref (pixmap);
|
g_object_unref (pixmap);
|
||||||
gdk_pixmap_unref (pixmap_mask);
|
g_object_unref (pixmap_mask);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
@ -4114,7 +4114,7 @@ static const char * xpm_data[] = {
|
|||||||
|
|
||||||
When we're done using a pixmap and not likely to reuse it again soon,
|
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
|
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
|
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,
|
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.
|
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)
|
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
||||||
{
|
{
|
||||||
if (pixmap)
|
if (pixmap)
|
||||||
gdk_pixmap_unref(pixmap);
|
g_object_unref(pixmap);
|
||||||
|
|
||||||
pixmap = gdk_pixmap_new(widget->window,
|
pixmap = gdk_pixmap_new(widget->window,
|
||||||
widget->allocation.width,
|
widget->allocation.width,
|
||||||
@ -17406,7 +17406,7 @@ static gint configure_event( GtkWidget *widget,
|
|||||||
GdkEventConfigure *event )
|
GdkEventConfigure *event )
|
||||||
{
|
{
|
||||||
if (pixmap)
|
if (pixmap)
|
||||||
gdk_pixmap_unref(pixmap);
|
g_object_unref(pixmap);
|
||||||
|
|
||||||
pixmap = gdk_pixmap_new(widget->window,
|
pixmap = gdk_pixmap_new(widget->window,
|
||||||
widget->allocation.width,
|
widget->allocation.width,
|
||||||
@ -17592,7 +17592,7 @@ static gint
|
|||||||
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
||||||
{
|
{
|
||||||
if (pixmap)
|
if (pixmap)
|
||||||
gdk_pixmap_unref(pixmap);
|
g_object_unref(pixmap);
|
||||||
|
|
||||||
pixmap = gdk_pixmap_new(widget->window,
|
pixmap = gdk_pixmap_new(widget->window,
|
||||||
widget->allocation.width,
|
widget->allocation.width,
|
||||||
|
@ -4061,7 +4061,7 @@ static const char * xpm_data[] = {
|
|||||||
|
|
||||||
Cuando hayamos acabado de usar un <em/pixmap/ y no lo vayamos a usar
|
Cuando hayamos acabado de usar un <em/pixmap/ y no lo vayamos a usar
|
||||||
durante un tiempo suele ser conveniente liberar el recurso mediante
|
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).
|
preciosos).
|
||||||
|
|
||||||
Una vez que hemos creado el <em/pixmap/ lo podemos mostrar como un
|
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)
|
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
||||||
{
|
{
|
||||||
if (pixmap)
|
if (pixmap)
|
||||||
gdk_pixmap_unref(pixmap);
|
g_object_unref(pixmap);
|
||||||
|
|
||||||
pixmap = gdk_pixmap_new(widget->window,
|
pixmap = gdk_pixmap_new(widget->window,
|
||||||
widget->allocation.width,
|
widget->allocation.width,
|
||||||
@ -16855,7 +16855,7 @@ static gint
|
|||||||
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
||||||
{
|
{
|
||||||
if (pixmap)
|
if (pixmap)
|
||||||
gdk_pixmap_unref(pixmap);
|
g_object_unref(pixmap);
|
||||||
|
|
||||||
pixmap = gdk_pixmap_new(widget->window,
|
pixmap = gdk_pixmap_new(widget->window,
|
||||||
widget->allocation.width,
|
widget->allocation.width,
|
||||||
|
@ -365,7 +365,7 @@ When a widget receives the "realize" signal it should:
|
|||||||
1) set the realized flag
|
1) set the realized flag
|
||||||
2) set widget->window
|
2) set widget->window
|
||||||
widget->window = gtk_widget_get_parent_window (widget);
|
widget->window = gtk_widget_get_parent_window (widget);
|
||||||
gdk_window_ref (widget->window);
|
g_object_ref (widget->window);
|
||||||
3) attach the widget's style
|
3) attach the widget's style
|
||||||
|
|
||||||
widget->style = gtk_style_attach (widget->style, widget->window);
|
widget->style = gtk_style_attach (widget->style, widget->window);
|
||||||
|
@ -235,7 +235,7 @@ local_send_enter (GdkDragContext *context,
|
|||||||
|
|
||||||
if (current_dest_drag != NULL)
|
if (current_dest_drag != NULL)
|
||||||
{
|
{
|
||||||
gdk_drag_context_unref (current_dest_drag);
|
g_object_unref (current_dest_drag);
|
||||||
current_dest_drag = NULL;
|
current_dest_drag = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -627,7 +627,7 @@ gdk_drop_finish (GdkDragContext *context,
|
|||||||
context->dest_window);
|
context->dest_window);
|
||||||
if (src_context)
|
if (src_context)
|
||||||
{
|
{
|
||||||
gdk_drag_context_ref (src_context);
|
g_object_ref (src_context);
|
||||||
|
|
||||||
event.dnd.type = GDK_DROP_FINISHED;
|
event.dnd.type = GDK_DROP_FINISHED;
|
||||||
event.dnd.window = src_context->source_window;
|
event.dnd.window = src_context->source_window;
|
||||||
|
@ -294,7 +294,7 @@ void gdk_gc_set_rgb_bg_color (GdkGC *gc,
|
|||||||
GdkScreen * gdk_gc_get_screen (GdkGC *gc);
|
GdkScreen * gdk_gc_get_screen (GdkGC *gc);
|
||||||
|
|
||||||
#ifndef GDK_DISABLE_DEPRECATED
|
#ifndef GDK_DISABLE_DEPRECATED
|
||||||
#define gdk_gc_destroy gdk_gc_unref
|
#define gdk_gc_destroy g_object_unref
|
||||||
#endif /* GDK_DISABLE_DEPRECATED */
|
#endif /* GDK_DISABLE_DEPRECATED */
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -129,7 +129,7 @@ GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
|
|||||||
#endif /* GDK_ENABLE_BROKEN */
|
#endif /* GDK_ENABLE_BROKEN */
|
||||||
|
|
||||||
#ifndef GDK_DISABLE_DEPRECATED
|
#ifndef GDK_DISABLE_DEPRECATED
|
||||||
#define gdk_image_destroy gdk_image_unref
|
#define gdk_image_destroy g_object_unref
|
||||||
#endif /* GDK_DISABLE_DEPRECATED */
|
#endif /* GDK_DISABLE_DEPRECATED */
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -119,10 +119,10 @@ GdkPixmap* gdk_pixmap_foreign_new_for_screen (GdkScreen *screen,
|
|||||||
gint depth);
|
gint depth);
|
||||||
|
|
||||||
#ifndef GDK_DISABLE_DEPRECATED
|
#ifndef GDK_DISABLE_DEPRECATED
|
||||||
#define gdk_bitmap_ref gdk_drawable_ref
|
#define gdk_bitmap_ref g_object_ref
|
||||||
#define gdk_bitmap_unref gdk_drawable_unref
|
#define gdk_bitmap_unref g_object_unref
|
||||||
#define gdk_pixmap_ref gdk_drawable_ref
|
#define gdk_pixmap_ref g_object_ref
|
||||||
#define gdk_pixmap_unref gdk_drawable_unref
|
#define gdk_pixmap_unref g_object_unref
|
||||||
#endif /* GDK_DISABLE_DEPRECATED */
|
#endif /* GDK_DISABLE_DEPRECATED */
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -693,8 +693,8 @@ void gdk_window_remove_redirection (GdkWindow *window);
|
|||||||
#define gdk_window_get_colormap gdk_drawable_get_colormap
|
#define gdk_window_get_colormap gdk_drawable_get_colormap
|
||||||
#define gdk_window_set_colormap gdk_drawable_set_colormap
|
#define gdk_window_set_colormap gdk_drawable_set_colormap
|
||||||
#define gdk_window_get_visual gdk_drawable_get_visual
|
#define gdk_window_get_visual gdk_drawable_get_visual
|
||||||
#define gdk_window_ref gdk_drawable_ref
|
#define gdk_window_ref g_object_ref
|
||||||
#define gdk_window_unref gdk_drawable_unref
|
#define gdk_window_unref g_object_unref
|
||||||
|
|
||||||
#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \
|
#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)
|
gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height)
|
||||||
|
@ -303,7 +303,7 @@ test_gcs (void)
|
|||||||
gdk_gc_copy (black_gc, gc);
|
gdk_gc_copy (black_gc, gc);
|
||||||
gdk_gc_get_values (black_gc, &gcvalues);
|
gdk_gc_get_values (black_gc, &gcvalues);
|
||||||
TEST (test_default_gc (&gcvalues, TRUE));
|
TEST (test_default_gc (&gcvalues, TRUE));
|
||||||
gdk_gc_unref (gc);
|
g_object_unref (gc);
|
||||||
|
|
||||||
gdk_gc_set_foreground (black_gc, &black);
|
gdk_gc_set_foreground (black_gc, &black);
|
||||||
gdk_gc_get_values (black_gc, &gcvalues);
|
gdk_gc_get_values (black_gc, &gcvalues);
|
||||||
|
@ -347,8 +347,8 @@ gdk_cursor_new_for_display (GdkDisplay *display,
|
|||||||
* mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits,
|
* mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits,
|
||||||
* cursor1_width, cursor1_height);
|
* cursor1_width, cursor1_height);
|
||||||
* cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 8, 8);
|
* cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 8, 8);
|
||||||
* gdk_pixmap_unref (source);
|
* g_object_unref (source);
|
||||||
* gdk_pixmap_unref (mask);
|
* g_object_unref (mask);
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* gdk_window_set_cursor (widget->window, cursor);
|
* gdk_window_set_cursor (widget->window, cursor);
|
||||||
|
Loading…
Reference in New Issue
Block a user