[gimp/gtk3-port: 136/248] Use gtk_widget_render_icon_pixbuf() instead of gtk_widget_render_icon()



commit 03279747fdf32d9f15e622ec6f424ae82f061e69
Author: Michael Natterer <mitch gimp org>
Date:   Thu Dec 9 21:01:13 2010 +0100

    Use gtk_widget_render_icon_pixbuf() instead of gtk_widget_render_icon()
    
    because the latter is deprecated.

 app/display/gimpstatusbar.c             |   11 ++++++-----
 app/widgets/gimperrorconsole.c          |    6 +++---
 app/widgets/gimpfgbgeditor.c            |   14 ++++++++------
 app/widgets/gimpviewrenderer-frame.c    |    6 +++---
 app/widgets/gimpviewrenderer.c          |    8 ++++----
 libgimpwidgets/gimpcellrenderertoggle.c |    6 +++---
 libgimpwidgets/gimppageselector.c       |   13 ++++++-------
 plug-ins/common/compose.c               |    6 +++---
 plug-ins/help-browser/dialog.c          |    6 +++---
 plug-ins/metadata/gimpxmpmodelwidget.c  |   10 ++++++----
 plug-ins/metadata/interface.c           |   15 +++++++++------
 11 files changed, 54 insertions(+), 47 deletions(-)
---
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index f6a8d40..4e5ff4f 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -541,8 +541,9 @@ gimp_statusbar_progress_message (GimpProgress        *progress,
             {
               GdkPixbuf *pixbuf;
 
-              pixbuf = gtk_widget_render_icon (statusbar->label, stock_id,
-                                               GTK_ICON_SIZE_MENU, NULL);
+              pixbuf = gtk_widget_render_icon_pixbuf (statusbar->label,
+                                                      stock_id,
+                                                      GTK_ICON_SIZE_MENU);
 
               width += ICON_SPACING + gdk_pixbuf_get_width (pixbuf);
 
@@ -589,9 +590,9 @@ gimp_statusbar_set_text (GimpStatusbar *statusbar,
         g_object_unref (statusbar->icon);
 
       if (stock_id)
-        statusbar->icon = gtk_widget_render_icon (statusbar->label,
-                                                  stock_id,
-                                                  GTK_ICON_SIZE_MENU, NULL);
+        statusbar->icon = gtk_widget_render_icon_pixbuf (statusbar->label,
+                                                         stock_id,
+                                                         GTK_ICON_SIZE_MENU);
       else
         statusbar->icon = NULL;
 
diff --git a/app/widgets/gimperrorconsole.c b/app/widgets/gimperrorconsole.c
index 1f800e7..04619ee 100644
--- a/app/widgets/gimperrorconsole.c
+++ b/app/widgets/gimperrorconsole.c
@@ -191,9 +191,9 @@ gimp_error_console_add (GimpErrorConsole    *console,
 
   gtk_text_buffer_get_end_iter (console->text_buffer, &end);
 
-  pixbuf = gtk_widget_render_icon (console->text_view,
-                                   gimp_get_message_stock_id (severity),
-                                   GTK_ICON_SIZE_BUTTON, NULL);
+  pixbuf = gtk_widget_render_icon_pixbuf (console->text_view,
+                                          gimp_get_message_stock_id (severity),
+                                          GTK_ICON_SIZE_BUTTON);
   gtk_text_buffer_insert_pixbuf (console->text_buffer, &end, pixbuf);
   g_object_unref (pixbuf);
 
diff --git a/app/widgets/gimpfgbgeditor.c b/app/widgets/gimpfgbgeditor.c
index 94c1053..538878f 100644
--- a/app/widgets/gimpfgbgeditor.c
+++ b/app/widgets/gimpfgbgeditor.c
@@ -243,9 +243,10 @@ gimp_fg_bg_editor_draw (GtkWidget *widget,
 
   /*  draw the default colors pixbuf  */
   if (! editor->default_icon)
-    editor->default_icon = gtk_widget_render_icon (widget,
-                                                   GIMP_STOCK_DEFAULT_COLORS,
-                                                   GTK_ICON_SIZE_MENU, NULL);
+    editor->default_icon =
+      gtk_widget_render_icon_pixbuf (widget,
+                                     GIMP_STOCK_DEFAULT_COLORS,
+                                     GTK_ICON_SIZE_MENU);
 
   default_w = gdk_pixbuf_get_width  (editor->default_icon);
   default_h = gdk_pixbuf_get_height (editor->default_icon);
@@ -263,9 +264,10 @@ gimp_fg_bg_editor_draw (GtkWidget *widget,
 
   /*  draw the swap colors pixbuf  */
   if (! editor->swap_icon)
-    editor->swap_icon = gtk_widget_render_icon (widget,
-                                                GIMP_STOCK_SWAP_COLORS,
-                                                GTK_ICON_SIZE_MENU, NULL);
+    editor->swap_icon =
+      gtk_widget_render_icon_pixbuf (widget,
+                                     GIMP_STOCK_SWAP_COLORS,
+                                     GTK_ICON_SIZE_MENU);
 
   swap_w = gdk_pixbuf_get_width  (editor->swap_icon);
   swap_h = gdk_pixbuf_get_height (editor->swap_icon);
diff --git a/app/widgets/gimpviewrenderer-frame.c b/app/widgets/gimpviewrenderer-frame.c
index 0eb1547..fb30e80 100644
--- a/app/widgets/gimpviewrenderer-frame.c
+++ b/app/widgets/gimpviewrenderer-frame.c
@@ -196,9 +196,9 @@ gimp_view_renderer_ensure_frame (GimpViewRenderer *renderer,
 
   if (! class->frame)
     {
-      class->frame = gtk_widget_render_icon (widget,
-                                             GIMP_STOCK_FRAME,
-                                             GTK_ICON_SIZE_DIALOG, NULL);
+      class->frame = gtk_widget_render_icon_pixbuf (widget,
+                                                    GIMP_STOCK_FRAME,
+                                                    GTK_ICON_SIZE_DIALOG);
 
       /*  FIXME: shouldn't be hardcoded  */
       class->frame_left   = 2;
diff --git a/app/widgets/gimpviewrenderer.c b/app/widgets/gimpviewrenderer.c
index 1852e95..1852a92 100644
--- a/app/widgets/gimpviewrenderer.c
+++ b/app/widgets/gimpviewrenderer.c
@@ -884,7 +884,7 @@ gimp_view_renderer_render_stock (GimpViewRenderer *renderer,
                                   renderer->width, renderer->height);
 
   if (icon_size)
-    pixbuf = gtk_widget_render_icon (widget, stock_id, icon_size, NULL);
+    pixbuf = gtk_widget_render_icon_pixbuf (widget, stock_id, icon_size);
 
   if (pixbuf)
     {
@@ -1120,9 +1120,9 @@ gimp_view_renderer_create_background (GimpViewRenderer *renderer,
 
   if (renderer->bg_stock_id)
     {
-      GdkPixbuf *pixbuf = gtk_widget_render_icon (widget,
-                                                  renderer->bg_stock_id,
-                                                  GTK_ICON_SIZE_DIALOG, NULL);
+      GdkPixbuf *pixbuf = gtk_widget_render_icon_pixbuf (widget,
+                                                         renderer->bg_stock_id,
+                                                         GTK_ICON_SIZE_DIALOG);
 
       if (pixbuf)
         {
diff --git a/libgimpwidgets/gimpcellrenderertoggle.c b/libgimpwidgets/gimpcellrenderertoggle.c
index 655564d..ea0f032 100644
--- a/libgimpwidgets/gimpcellrenderertoggle.c
+++ b/libgimpwidgets/gimpcellrenderertoggle.c
@@ -401,9 +401,9 @@ gimp_cell_renderer_toggle_create_pixbuf (GimpCellRendererToggle *toggle,
   if (toggle->pixbuf)
     g_object_unref (toggle->pixbuf);
 
-  toggle->pixbuf = gtk_widget_render_icon (widget,
-                                           toggle->stock_id,
-                                           toggle->stock_size, NULL);
+  toggle->pixbuf = gtk_widget_render_icon_pixbuf (widget,
+                                                  toggle->stock_id,
+                                                  toggle->stock_size);
 }
 
 
diff --git a/libgimpwidgets/gimppageselector.c b/libgimpwidgets/gimppageselector.c
index d9fa5b2..cf535a1 100644
--- a/libgimpwidgets/gimppageselector.c
+++ b/libgimpwidgets/gimppageselector.c
@@ -338,10 +338,9 @@ gimp_page_selector_init (GimpPageSelector *selector)
 
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
 
-  priv->default_thumbnail = gtk_widget_render_icon (GTK_WIDGET (selector),
-                                                    GTK_STOCK_FILE,
-                                                    GTK_ICON_SIZE_DND,
-                                                    NULL);
+  priv->default_thumbnail = gtk_widget_render_icon_pixbuf (GTK_WIDGET (selector),
+                                                           GTK_STOCK_FILE,
+                                                           GTK_ICON_SIZE_DND);
 }
 
 static void
@@ -1487,9 +1486,9 @@ gimp_page_selector_add_frame (GtkWidget *widget,
 
   if (! frame)
     {
-      frame = gtk_widget_render_icon (widget,
-                                      GIMP_STOCK_FRAME,
-                                      GTK_ICON_SIZE_DIALOG, NULL);
+      frame = gtk_widget_render_icon_pixbuf (widget,
+                                             GIMP_STOCK_FRAME,
+                                             GTK_ICON_SIZE_DIALOG);
       g_object_set_data_full (G_OBJECT (widget), "frame", frame,
                               (GDestroyNotify) g_object_unref);
     }
diff --git a/plug-ins/common/compose.c b/plug-ins/common/compose.c
index 5b6dd0a..a04a79e 100644
--- a/plug-ins/common/compose.c
+++ b/plug-ins/common/compose.c
@@ -1604,9 +1604,9 @@ compose_dialog (const gchar *compose_type,
       combo = gimp_drawable_combo_box_new (check_gray, NULL);
       composeint.channel_menu[j] = combo;
 
-      ico = gtk_widget_render_icon (dialog,
-                                    GIMP_STOCK_CHANNEL_GRAY,
-                                    GTK_ICON_SIZE_BUTTON, NULL);
+      ico = gtk_widget_render_icon_pixbuf (dialog,
+                                           GIMP_STOCK_CHANNEL_GRAY,
+                                           GTK_ICON_SIZE_BUTTON);
       model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
       gtk_list_store_append (GTK_LIST_STORE (model), &iter);
       gtk_list_store_set (GTK_LIST_STORE (model), &iter,
diff --git a/plug-ins/help-browser/dialog.c b/plug-ins/help-browser/dialog.c
index fe98cdc..1507c2a 100644
--- a/plug-ins/help-browser/dialog.c
+++ b/plug-ins/help-browser/dialog.c
@@ -350,9 +350,9 @@ window_set_icons (GtkWidget *window)
 
   for (i = 0; i < G_N_ELEMENTS (sizes); i++)
     list = g_list_prepend (list,
-                           gtk_widget_render_icon (window,
-                                                   GIMP_STOCK_USER_MANUAL,
-                                                   sizes[i], NULL));
+                           gtk_widget_render_icon_pixbuf (window,
+                                                          GIMP_STOCK_USER_MANUAL,
+                                                          sizes[i]));
 
   gtk_window_set_icon_list (GTK_WINDOW (window), list);
 
diff --git a/plug-ins/metadata/gimpxmpmodelwidget.c b/plug-ins/metadata/gimpxmpmodelwidget.c
index 726bac9..9dcd624 100644
--- a/plug-ins/metadata/gimpxmpmodelwidget.c
+++ b/plug-ins/metadata/gimpxmpmodelwidget.c
@@ -347,16 +347,18 @@ set_property_edit_icon (GtkWidget       *widget,
 
   if (editable == XMP_AUTO_UPDATE)
     {
-      icon = gtk_widget_render_icon (GTK_WIDGET (widget), GIMP_STOCK_WILBER,
-                                     GTK_ICON_SIZE_MENU, NULL);
+      icon = gtk_widget_render_icon_pixbuf (GTK_WIDGET (widget),
+                                            GIMP_STOCK_WILBER,
+                                            GTK_ICON_SIZE_MENU);
       gtk_tree_store_set (GTK_TREE_STORE (xmp_model), iter,
                           COL_XMP_EDIT_ICON, icon,
                           -1);
     }
   else if (editable == TRUE)
     {
-      icon = gtk_widget_render_icon (GTK_WIDGET (widget), GTK_STOCK_EDIT,
-                                     GTK_ICON_SIZE_MENU, NULL);
+      icon = gtk_widget_render_icon_pixbuf (GTK_WIDGET (widget),
+                                            GTK_STOCK_EDIT,
+                                            GTK_ICON_SIZE_MENU);
       gtk_tree_store_set (GTK_TREE_STORE (xmp_model), iter,
                           COL_XMP_EDIT_ICON, icon,
                           -1);
diff --git a/plug-ins/metadata/interface.c b/plug-ins/metadata/interface.c
index d539118..6d0234b 100644
--- a/plug-ins/metadata/interface.c
+++ b/plug-ins/metadata/interface.c
@@ -330,8 +330,9 @@ add_thumbnail_tab (GtkWidget *notebook)
   GtkWidget *image;
 
   /* FIXME: link thumbnail with XMP model */
-  default_thumb = gtk_widget_render_icon (notebook, GIMP_STOCK_QUESTION,
-                                          (GtkIconSize) -1, "thumbnail");
+  default_thumb = gtk_widget_render_icon_pixbuf (notebook,
+                                                 GIMP_STOCK_QUESTION,
+                                                 (GtkIconSize) -1);
   image = gtk_image_new_from_pixbuf (default_thumb);
   gtk_notebook_append_page (GTK_NOTEBOOK (notebook), image,
           gtk_label_new (_("Thumbnail")));
@@ -639,10 +640,12 @@ metadata_dialog (gint32    image_ID,
   gtk_widget_show (notebook);
 
   mgui.xmp_model = xmp_model;
-  mgui.edit_icon = gtk_widget_render_icon (mgui.dlg, GTK_STOCK_EDIT,
-                                           GTK_ICON_SIZE_MENU, NULL);
-  mgui.auto_icon = gtk_widget_render_icon (mgui.dlg, GIMP_STOCK_WILBER,
-                                           GTK_ICON_SIZE_MENU, NULL);
+  mgui.edit_icon = gtk_widget_render_icon_pixbuf (mgui.dlg,
+                                                  GTK_STOCK_EDIT,
+                                                  GTK_ICON_SIZE_MENU);
+  mgui.auto_icon = gtk_widget_render_icon_pixbuf (mgui.dlg,
+                                                  GIMP_STOCK_WILBER,
+                                                  GTK_ICON_SIZE_MENU);
   update_icons (&mgui);
 
   mgui.run_ok = FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]