From e5ca720ad35eacd3ffbd0ed9520c8b540db9fd9e Mon Sep 17 00:00:00 2001 From: etxrab Date: Thu, 14 Jul 2011 08:11:16 +0000 Subject: [PATCH] Replace deprecated gdk_pixmap_unref() with g_object_unref(). Update checkAPIs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38013 f5534014-38df-0310-8fa8-9805f1628bb7 --- gtk/graph_analysis.c | 6 +++--- gtk/iax2_analysis.c | 2 +- gtk/io_stat.c | 2 +- gtk/rtp_analysis.c | 2 +- gtk/sctp_byte_graph_dlg.c | 2 +- gtk/sctp_graph_dlg.c | 2 +- gtk/tcp_graph.c | 22 +++++++++++----------- tools/checkAPIs.pl | 34 ++++++++++++++++++---------------- 8 files changed, 37 insertions(+), 35 deletions(-) diff --git a/gtk/graph_analysis.c b/gtk/graph_analysis.c index 190913e4bf..dece49455f 100644 --- a/gtk/graph_analysis.c +++ b/gtk/graph_analysis.c @@ -1287,7 +1287,7 @@ static gboolean configure_event(GtkWidget *widget, GdkEventConfigure *event _U_, }; if(user_data->dlg.pixmap_main){ - gdk_pixmap_unref(user_data->dlg.pixmap_main); + g_object_unref(user_data->dlg.pixmap_main); user_data->dlg.pixmap_main=NULL; } @@ -1357,7 +1357,7 @@ static gboolean configure_event_comments(GtkWidget *widget, GdkEventConfigure *e #endif if(user_data->dlg.pixmap_comments){ - gdk_pixmap_unref(user_data->dlg.pixmap_comments); + g_object_unref(user_data->dlg.pixmap_comments); user_data->dlg.pixmap_comments=NULL; } @@ -1399,7 +1399,7 @@ static gboolean configure_event_time(GtkWidget *widget, GdkEventConfigure *event #endif if(user_data->dlg.pixmap_time){ - gdk_pixmap_unref(user_data->dlg.pixmap_time); + g_object_unref(user_data->dlg.pixmap_time); user_data->dlg.pixmap_time=NULL; } diff --git a/gtk/iax2_analysis.c b/gtk/iax2_analysis.c index 24ad44d91d..937b36ed98 100644 --- a/gtk/iax2_analysis.c +++ b/gtk/iax2_analysis.c @@ -1339,7 +1339,7 @@ static gboolean draw_area_configure_event(GtkWidget *widget, GdkEventConfigure * int i; if(user_data->dlg.dialog_graph.pixmap){ - gdk_pixmap_unref(user_data->dlg.dialog_graph.pixmap); + g_object_unref(user_data->dlg.dialog_graph.pixmap); user_data->dlg.dialog_graph.pixmap=NULL; } diff --git a/gtk/io_stat.c b/gtk/io_stat.c index 9d16c7045b..c837094203 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -1380,7 +1380,7 @@ draw_area_configure_event(GtkWidget *widget, GdkEventConfigure *event _U_, gpoin GtkWidget *save_bt; if(io->pixmap){ - gdk_pixmap_unref(io->pixmap); + g_object_unref(io->pixmap); io->pixmap=NULL; } diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index be84e6fb99..fa170c604e 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -1350,7 +1350,7 @@ static gint configure_event(GtkWidget *widget, GdkEventConfigure *event _U_) } if(user_data->dlg.dialog_graph.pixmap){ - gdk_pixmap_unref(user_data->dlg.dialog_graph.pixmap); + g_object_unref(user_data->dlg.dialog_graph.pixmap); user_data->dlg.dialog_graph.pixmap=NULL; } diff --git a/gtk/sctp_byte_graph_dlg.c b/gtk/sctp_byte_graph_dlg.c index 8baa345292..912f65f5f4 100644 --- a/gtk/sctp_byte_graph_dlg.c +++ b/gtk/sctp_byte_graph_dlg.c @@ -646,7 +646,7 @@ on_configure_event(GtkWidget *widget, GdkEventConfigure *event _U_, gpointer use g_assert(u_data->io != NULL); if(u_data->io->pixmap){ - gdk_pixmap_unref(u_data->io->pixmap); + g_object_unref(u_data->io->pixmap); u_data->io->pixmap = NULL; } diff --git a/gtk/sctp_graph_dlg.c b/gtk/sctp_graph_dlg.c index 2373481e86..bfabf9c67f 100644 --- a/gtk/sctp_graph_dlg.c +++ b/gtk/sctp_graph_dlg.c @@ -968,7 +968,7 @@ configure_event(GtkWidget *widget, GdkEventConfigure *event _U_, gpointer user_d g_assert(u_data->io != NULL); if(u_data->io->pixmap){ - gdk_pixmap_unref(u_data->io->pixmap); + g_object_unref(u_data->io->pixmap); u_data->io->pixmap=NULL; } diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c index 6f7154cd3d..55d8493714 100644 --- a/gtk/tcp_graph.c +++ b/gtk/tcp_graph.c @@ -1727,8 +1727,8 @@ static void graph_destroy (struct graph *g) /* window_destroy (g->text); */ g_object_unref (g->fg_gc); g_object_unref (g->bg_gc); - gdk_pixmap_unref (g->pixmap[0]); - gdk_pixmap_unref (g->pixmap[1]); + g_object_unref (g->pixmap[0]); + g_object_unref (g->pixmap[1]); g_free (g->x_axis); g_free (g->y_axis); g_free ( (gpointer) (g->title) ); @@ -2015,7 +2015,7 @@ static void graph_element_lists_free (struct graph *g) static void graph_title_pixmap_create (struct graph *g) { if (g->title_pixmap) - gdk_pixmap_unref (g->title_pixmap); + g_object_unref (g->title_pixmap); g->title_pixmap = gdk_pixmap_new (g->drawing_area->window, g->x_axis->p.width, g->wp.y, -1); @@ -2050,9 +2050,9 @@ static void graph_pixmaps_create (struct graph *g) debug(DBS_FENTRY) puts ("graph_pixmaps_create()"); if (g->pixmap[0]) - gdk_pixmap_unref (g->pixmap[0]); + g_object_unref (g->pixmap[0]); if (g->pixmap[1]) - gdk_pixmap_unref (g->pixmap[1]); + g_object_unref (g->pixmap[1]); g->pixmap[0] = gdk_pixmap_new (g->drawing_area->window, g->wp.width, g->wp.height, -1); @@ -2172,9 +2172,9 @@ static void axis_pixmaps_create (struct axis *axis) { debug(DBS_FENTRY) puts ("axis_pixmaps_create()"); if (axis->pixmap[0]) - gdk_pixmap_unref (axis->pixmap[0]); + g_object_unref (axis->pixmap[0]); if (axis->pixmap[1]) - gdk_pixmap_unref (axis->pixmap[1]); + g_object_unref (axis->pixmap[1]); axis->pixmap[0] = gdk_pixmap_new (axis->drawing_area->window, axis->p.width, axis->p.height, -1); @@ -2186,8 +2186,8 @@ static void axis_pixmaps_create (struct axis *axis) static void axis_destroy (struct axis *axis) { - gdk_pixmap_unref (axis->pixmap[0]); - gdk_pixmap_unref (axis->pixmap[1]); + g_object_unref (axis->pixmap[0]); + g_object_unref (axis->pixmap[1]); g_free ( (gpointer) (axis->label) ); } @@ -2742,8 +2742,8 @@ static void magnify_destroy (struct graph *g) struct graph *mg = g->magnify.g; window_destroy (GTK_WIDGET (mg->drawing_area)); - gdk_pixmap_unref (mg->pixmap[0]); - gdk_pixmap_unref (mg->pixmap[1]); + g_object_unref (mg->pixmap[0]); + g_object_unref (mg->pixmap[1]); for (list=mg->elists; list; list=list->next) g_free (list->elements); diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl index f4a41e54f3..ab6baae7ad 100755 --- a/tools/checkAPIs.pl +++ b/tools/checkAPIs.pl @@ -996,13 +996,14 @@ my %deprecatedGtkFunctions = ( 'gdk_drawable_get_display', 'W', # 'gdk_drawable_get_image', 'W', # 'gdk_drawable_get_screen', 'W', # - 'gdk_drawable_get_size', 'W', # + 'gdk_drawable_get_size', 'W', # deprecated since version 2.24 Use gdk_window_get_width() and gdk_window_get_height() for GdkWindows. + # Use gdk_pixmap_get_size() for GdkPixmaps 'gdk_drawable_get_visual', 'W', # 'gdk_drawable_ref', 'W', # 'gdk_drawable_set_data', 'W', # 'gdk_drawable_unref', 'W', # - 'gdk_draw_arc', 'W', # - 'gdk_draw_drawable', 'W', # gdk_cairo_set_source_pixmap(), + 'gdk_draw_arc', 'W', # deprecated since version 2.22. Use cairo_arc() and cairo_fill() or cairo_stroke() instead. + 'gdk_draw_drawable', 'W', # deprecated since version 2.22. Use gdk_cairo_set_source_pixmap(), cairo_rectangle() and cairo_fill() to draw pixmap on top of other drawables 'gdk_draw_glyphs', 'W', # 'gdk_draw_glyphs_transformed', 'W', # 'gdk_draw_gray_image', 'W', # @@ -1015,11 +1016,11 @@ my %deprecatedGtkFunctions = ( 'gdk_draw_line', 'W', # 'gdk_draw_lines', 'W', # 'gdk_draw_pixbuf', 'W', # gdk_cairo_set_source_pixbuf() and cairo_paint() or cairo_rectangle() and cairo_fill() instead. - 'gdk_draw_pixmap', 'W', # + 'gdk_draw_pixmap', 'W', # gdk_draw_drawable() (gdk_draw_drawable has been deprecated since version 2.22 ) 'gdk_draw_point', 'W', # 'gdk_draw_points', 'W', # 'gdk_draw_polygon', 'W', # - 'gdk_draw_rectangle', 'W', # + 'gdk_draw_rectangle', 'W', # deprecated since version 2.22, Use cairo_rectangle() and cairo_fill() or cairo_stroke() 'gdk_draw_rgb_32_image', 'W', # 'gdk_draw_rgb_32_image_dithalign', 'W', # 'gdk_draw_rgb_image', 'W', # @@ -1056,8 +1057,8 @@ my %deprecatedGtkFunctions = ( 'gdk_gc_get_colormap', 'W', # 'gdk_gc_get_screen', 'W', # 'gdk_gc_get_values', 'W', # - 'gdk_gc_new', 'W', # - 'gdk_gc_new_with_values', 'W', # + 'gdk_gc_new', 'W', # deprecated since version 2.22 and should not be used in newly-written code. Use Cairo for rendering. + 'gdk_gc_new_with_values', 'W', # deprecated since version 2.22 'gdk_gc_offset', 'W', # 'gdk_gc_ref', 'W', # 'gdk_gc_set_background', 'W', # @@ -1070,17 +1071,17 @@ my %deprecatedGtkFunctions = ( 'gdk_gc_set_exposures', 'W', # 'gdk_gc_set_fill', 'W', # 'gdk_gc_set_font', 'W', # - 'gdk_gc_set_foreground', 'W', # - 'gdk_gc_set_function', 'W', # Use cairo_set_operator() with Cairo. + 'gdk_gc_set_foreground', 'W', # deprecated since version 2.22. Use gdk_cairo_set_source_color() to use a GdkColor as the source in Cairo. + 'gdk_gc_set_function', 'W', # deprecated since version 2.22. Use cairo_set_operator() with Cairo. 'gdk_gc_set_line_attributes', 'W', # 'gdk_gc_set_rgb_bg_color', 'W', # - 'gdk_gc_set_rgb_fg_color', 'W', # + 'gdk_gc_set_rgb_fg_color', 'W', # deprecated since version 2.22. Use gdk_cairo_set_source_color() instead. 'gdk_gc_set_stipple', 'W', # 'gdk_gc_set_subwindow', 'W', # - 'gdk_gc_set_tile', 'W', # + 'gdk_gc_set_tile', 'W', # deprecated since version 2.22. 'gdk_gc_set_ts_origin', 'W', # 'gdk_gc_set_values', 'W', # - 'gdk_gc_unref', 'W', # + 'gdk_gc_unref', 'E', # deprecated since version 2.0. Use g_object_unref() 'gdk_get_use_xshm', 'W', # 'gdk_image_destroy', 'W', # 'gdk_image_get', 'W', # @@ -1114,9 +1115,10 @@ my %deprecatedGtkFunctions = ( 'gdk_pixmap_colormap_create_from_xpm_d', 'W', # 'gdk_pixmap_create_from_data', 'W', # 'gdk_pixmap_create_from_xpm', 'W', # - 'gdk_pixmap_create_from_xpm_d', 'W', # + 'gdk_pixmap_create_from_xpm_d', 'W', # deprecated since version 2.22. Use a GdkPixbuf instead. You can use gdk_pixbuf_new_from_xpm_data() to create it. + # If you must use a pixmap, use gdk_pixmap_new() to create it and Cairo to draw the pixbuf onto it. 'gdk_pixmap_ref', 'W', # - 'gdk_pixmap_unref', 'W', # + 'gdk_pixmap_unref', 'E', # Deprecated equivalent of g_object_unref(). 'gdk_region_polygon', 'W', # 'gdk_region_rect_equal', 'W', # 'gdk_region_shrink', 'W', # @@ -1175,9 +1177,9 @@ my %deprecatedGtkFunctions = ( 'gdk_window_copy_area', 'W', # 'gdk_window_foreign_new', 'W', # 'gdk_window_foreign_new_for_display', 'W', # - 'gdk_window_get_colormap', 'W', # + 'gdk_window_get_colormap', 'W', # Deprecated equivalent of gdk_drawable_get_colormap(). 'gdk_window_get_deskrelative_origin', 'W', # - 'gdk_window_get_size', 'W', # + 'gdk_window_get_size', 'W', # Deprecated equivalent of gdk_drawable_get_size(). 'gdk_window_get_toplevels', 'W', # 'gdk_window_get_type', 'W', # 'gdk_window_lookup', 'W', # -- 2.34.1