[gtk: 18/40] icon-theme: Drop the _for_scale() versions and always take scale



commit b087f9ca51aec76f373f2d25676ea79de278f5a1
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Jan 28 16:14:52 2020 +0100

    icon-theme: Drop the _for_scale() versions and always take scale

 demos/gtk-demo/clipboard.c          |   2 +-
 demos/gtk-demo/textview.c           |   2 +-
 demos/icon-browser/iconbrowserwin.c |   4 +-
 gtk/gtkapplication-quartz-menu.c    |   2 +-
 gtk/gtkbuilder.c                    |   2 +-
 gtk/gtkcalendar.c                   |   2 +-
 gtk/gtkcssimageicontheme.c          |  12 +--
 gtk/gtkdragsource.c                 |   2 +-
 gtk/gtkiconhelper.c                 |  10 +--
 gtk/gtkicontheme.c                  | 171 +++++-------------------------------
 gtk/gtkicontheme.h                  |  20 +----
 gtk/gtkmountoperation.c             |   2 +-
 gtk/gtkwindow.c                     |  15 ++--
 tests/testclipboard2.c              |   2 +-
 tests/testdnd2.c                    |   4 +-
 tests/testicontheme.c               |   4 +-
 testsuite/gtk/check-icon-names.c    |   2 +-
 testsuite/gtk/icontheme.c           |  10 +--
 18 files changed, 65 insertions(+), 203 deletions(-)
---
diff --git a/demos/gtk-demo/clipboard.c b/demos/gtk-demo/clipboard.c
index d851360616..fba169ee45 100644
--- a/demos/gtk-demo/clipboard.c
+++ b/demos/gtk-demo/clipboard.c
@@ -107,7 +107,7 @@ get_image_paintable (GtkImage *image)
     case GTK_IMAGE_ICON_NAME:
       icon_name = gtk_image_get_icon_name (image);
       icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
-      icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, 48, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+      icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, 48, 1, 
GTK_ICON_LOOKUP_GENERIC_FALLBACK);
       if (icon_info == NULL)
         return NULL;
       return GDK_PAINTABLE (icon_info);
diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c
index ba42ebcbc0..39ae7315ca 100644
--- a/demos/gtk-demo/textview.c
+++ b/demos/gtk-demo/textview.c
@@ -135,7 +135,7 @@ insert_text (GtkTextBuffer *buffer)
   icon_theme = gtk_icon_theme_get_default ();
   icon = gtk_icon_theme_lookup_icon (icon_theme,
                                      "gtk3-demo",
-                                     32,
+                                     32, 1,
                                      GTK_ICON_LOOKUP_GENERIC_FALLBACK);
   texture = gtk_icon_download_texture (icon, NULL);
   g_object_unref (icon);
diff --git a/demos/icon-browser/iconbrowserwin.c b/demos/icon-browser/iconbrowserwin.c
index 2a55bc866d..6a047662cd 100644
--- a/demos/icon-browser/iconbrowserwin.c
+++ b/demos/icon-browser/iconbrowserwin.c
@@ -359,7 +359,7 @@ get_image_paintable (GtkImage *image)
       icon_name = gtk_image_get_icon_name (image);
       size = gtk_image_get_pixel_size (image);
       icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
-      icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, size,
+      icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, size, 1,
                                               GTK_ICON_LOOKUP_FORCE_SIZE | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
       if (icon_info == NULL)
         return NULL;
@@ -410,7 +410,7 @@ get_file (GValue   *value,
 
   name = gtk_image_get_icon_name (GTK_IMAGE (data));
 
-  info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, -1, 0);
+  info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, 32, 1, 0);
   file = g_file_new_for_path (gtk_icon_get_filename (info));
   g_value_set_object (value, file);
   g_object_unref (file);
diff --git a/gtk/gtkapplication-quartz-menu.c b/gtk/gtkapplication-quartz-menu.c
index 61188e3520..2d31dc0463 100644
--- a/gtk/gtkapplication-quartz-menu.c
+++ b/gtk/gtkapplication-quartz-menu.c
@@ -300,7 +300,7 @@ icon_loaded (GObject      *object,
       if ([[NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)])
         scale = roundf ([[NSScreen mainScreen] backingScaleFactor]);
 #endif
-      info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, icon, ICON_SIZE, scale, 
GTK_ICON_LOOKUP_USE_BUILTIN);
+      info = gtk_icon_theme_lookup_by_gicon (theme, icon, ICON_SIZE, scale, GTK_ICON_LOOKUP_USE_BUILTIN);
 
       if (info != NULL)
         {
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 77174404c4..3c7dad5f90 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -2167,7 +2167,7 @@ gtk_builder_value_from_string_type (GtkBuilder   *builder,
               /* fall back to a missing image */
               theme = gtk_icon_theme_get_default ();
 
-              icon = gtk_icon_theme_lookup_icon (theme, "image-missing", 16,
+              icon = gtk_icon_theme_lookup_icon (theme, "image-missing", 16, 1,
                                                  GTK_ICON_LOOKUP_USE_BUILTIN);
               texture = gtk_icon_download_texture (icon, NULL);
               pixbuf = gdk_pixbuf_get_from_texture (texture);
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index cc355c5ad5..928a5513b5 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -2604,7 +2604,7 @@ gtk_calendar_drag_update (GtkGestureDrag *gesture,
   drag = gdk_drag_begin (surface, device, content, GDK_ACTION_COPY, start_x, start_y);
 
   theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
-  icon = gtk_icon_theme_lookup_icon (theme, "text-x-generic", 32, 0);
+  icon = gtk_icon_theme_lookup_icon (theme, "text-x-generic", 32, 1, 0);
   gtk_drag_icon_set_from_paintable (drag, GDK_PAINTABLE (icon), 0, 0);
   g_clear_object (&icon);
 
diff --git a/gtk/gtkcssimageicontheme.c b/gtk/gtkcssimageicontheme.c
index 65790719d3..86786b8f61 100644
--- a/gtk/gtkcssimageicontheme.c
+++ b/gtk/gtkcssimageicontheme.c
@@ -61,15 +61,15 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image,
     }
   else
     {
-      icon_info = gtk_icon_theme_lookup_icon_for_scale (icon_theme->icon_theme,
-                                                        icon_theme->name,
-                                                        size,
-                                                        icon_theme->scale,
-                                                        GTK_ICON_LOOKUP_USE_BUILTIN);
+      icon_info = gtk_icon_theme_lookup_icon (icon_theme->icon_theme,
+                                              icon_theme->name,
+                                              size,
+                                              icon_theme->scale,
+                                              GTK_ICON_LOOKUP_USE_BUILTIN);
       if (icon_info == NULL)
         icon_info = gtk_icon_theme_lookup_icon (icon_theme->icon_theme,
                                                 "image-missing",
-                                                size,
+                                                size, icon_theme->scale,
                                                 GTK_ICON_LOOKUP_USE_BUILTIN | 
GTK_ICON_LOOKUP_GENERIC_FALLBACK);
 
       g_assert (icon_info != NULL);
diff --git a/gtk/gtkdragsource.c b/gtk/gtkdragsource.c
index 6bf730401c..0df09f1b56 100644
--- a/gtk/gtkdragsource.c
+++ b/gtk/gtkdragsource.c
@@ -486,7 +486,7 @@ gtk_drag_source_drag_begin (GtkDragSource *source)
       GtkIconTheme *theme;
 
       theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
-      source->paintable = GDK_PAINTABLE(gtk_icon_theme_lookup_icon (theme, "text-x-generic", 32, 0));
+      source->paintable = GDK_PAINTABLE(gtk_icon_theme_lookup_icon (theme, "text-x-generic", 32, 1, 0));
       source->hot_x = 0;
       source->hot_y = 0;
     }
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index aa76783d67..7bd7a7bc48 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -110,14 +110,14 @@ ensure_paintable_for_gicon (GtkIconHelper    *self,
 
   width = height = gtk_icon_helper_get_size (self);
 
-  info = gtk_icon_theme_lookup_by_gicon_for_scale (icon_theme,
-                                                   gicon,
-                                                   MIN (width, height),
-                                                   scale, flags);
+  info = gtk_icon_theme_lookup_by_gicon (icon_theme,
+                                         gicon,
+                                         MIN (width, height),
+                                         scale, flags);
   if (info == NULL)
     info = gtk_icon_theme_lookup_icon (icon_theme,
                                        "image-missing",
-                                       width,
+                                       width, scale,
                                        flags | GTK_ICON_LOOKUP_USE_BUILTIN | 
GTK_ICON_LOOKUP_GENERIC_FALLBACK);
 
   *symbolic = gtk_icon_is_symbolic (info);
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 90854396ac..289e1fc0ba 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -2071,51 +2071,7 @@ choose_icon (GtkIconTheme       *self,
 }
 
 /**
- * gtk_icon_theme_lookup_icon:
- * @self: a #GtkIconTheme
- * @icon_name: the name of the icon to lookup
- * @size: desired icon size
- * @flags: flags modifying the behavior of the icon lookup
- * 
- * Looks up a named icon and returns a #GtkIcon containing
- * information such as the filename of the icon. The icon
- * can then be rendered into a pixbuf using
- * gtk_icon_load_icon(). (gtk_icon_theme_load_icon()
- * combines these two steps if all you need is the pixbuf.)
- *
- * When rendering on displays with high pixel densities you should not
- * use a @size multiplied by the scaling factor returned by functions
- * like gdk_surface_get_scale_factor(). Instead, you should use
- * gtk_icon_theme_lookup_icon_for_scale(), as the assets loaded
- * for a given scaling factor may be different.
- *
- * This call is threadsafe, you can safely pass a GtkIconTheme
- * to another thread and call this method on it.
- *
- * Returns: (nullable) (transfer full): a #GtkIcon object
- *     containing information about the icon, or %NULL if the
- *     icon wasn’t found.
- */
-GtkIcon *
-gtk_icon_theme_lookup_icon (GtkIconTheme       *self,
-                            const gchar        *icon_name,
-                            gint                size,
-                            GtkIconLookupFlags  flags)
-{
-  g_return_val_if_fail (GTK_IS_ICON_THEME (self), NULL);
-  g_return_val_if_fail (icon_name != NULL, NULL);
-  g_return_val_if_fail ((flags & GTK_ICON_LOOKUP_NO_SVG) == 0 ||
-                        (flags & GTK_ICON_LOOKUP_FORCE_SVG) == 0, NULL);
-
-  GTK_DISPLAY_NOTE (self->display, ICONTHEME,
-                    g_message ("looking up icon %s", icon_name));
-
-  return gtk_icon_theme_lookup_icon_for_scale (self, icon_name,
-                                               size, 1, flags);
-}
-
-/**
- * gtk_icon_theme_lookup_icon_for_scale:
+ * gtk_icon_theme_lookup_icon_scale:
  * @self: a #GtkIconTheme
  * @icon_name: the name of the icon to lookup
  * @size: desired icon size
@@ -2136,11 +2092,11 @@ gtk_icon_theme_lookup_icon (GtkIconTheme       *self,
  *     icon wasn’t found.
  */
 GtkIcon *
-gtk_icon_theme_lookup_icon_for_scale (GtkIconTheme       *self,
-                                      const gchar        *icon_name,
-                                      gint                size,
-                                      gint                scale,
-                                      GtkIconLookupFlags  flags)
+gtk_icon_theme_lookup_icon (GtkIconTheme       *self,
+                            const gchar        *icon_name,
+                            gint                size,
+                            gint                scale,
+                            GtkIconLookupFlags  flags)
 {
   GtkIcon *icon;
 
@@ -2224,54 +2180,6 @@ gtk_icon_theme_lookup_icon_for_scale (GtkIconTheme       *self,
 /**
  * gtk_icon_theme_choose_icon:
  * @self: a #GtkIconTheme
- * @icon_names: (array zero-terminated=1): %NULL-terminated array of
- *     icon names to lookup
- * @size: desired icon size
- * @flags: flags modifying the behavior of the icon lookup
- * 
- * Looks up a named icon and returns a #GtkIcon containing
- * information such as the filename of the icon. The icon
- * can then be rendered into a pixbuf using
- * gtk_icon_load_icon(). (gtk_icon_theme_load_icon()
- * combines these two steps if all you need is the pixbuf.)
- *
- * If @icon_names contains more than one name, this function 
- * tries them all in the given order before falling back to 
- * inherited icon themes.
- *
- * This call is threadsafe, you can safely pass a GtkIconTheme
- * to another thread and call this method on it.
- *
- * Returns: (nullable) (transfer full): a #GtkIcon object
- * containing information about the icon, or %NULL if the icon wasn’t
- * found.
- */
-GtkIcon *
-gtk_icon_theme_choose_icon (GtkIconTheme       *self,
-                            const gchar        *icon_names[],
-                            gint                size,
-                            GtkIconLookupFlags  flags)
-{
-  GtkIcon *icon;
-
-  g_return_val_if_fail (GTK_IS_ICON_THEME (self), NULL);
-  g_return_val_if_fail (icon_names != NULL, NULL);
-  g_return_val_if_fail ((flags & GTK_ICON_LOOKUP_NO_SVG) == 0 ||
-                        (flags & GTK_ICON_LOOKUP_FORCE_SVG) == 0, NULL);
-  g_warn_if_fail ((flags & GTK_ICON_LOOKUP_GENERIC_FALLBACK) == 0);
-
-  gtk_icon_theme_lock (self);
-
-  icon = choose_icon (self, icon_names, size, 1, flags, FALSE, NULL);
-
-  gtk_icon_theme_unlock (self);
-
-  return icon;
-}
-
-/**
- * gtk_icon_theme_choose_icon_for_scale:
- * @self: a #GtkIconTheme
  * @icon_names: (array zero-terminated=1): %NULL-terminated
  *     array of icon names to lookup
  * @size: desired icon size
@@ -2296,11 +2204,11 @@ gtk_icon_theme_choose_icon (GtkIconTheme       *self,
  *     icon wasn’t found.
  */
 GtkIcon *
-gtk_icon_theme_choose_icon_for_scale (GtkIconTheme       *self,
-                                      const gchar        *icon_names[],
-                                      gint                size,
-                                      gint                scale,
-                                      GtkIconLookupFlags  flags)
+gtk_icon_theme_choose_icon (GtkIconTheme       *self,
+                            const gchar        *icon_names[],
+                            gint                size,
+                            gint                scale,
+                            GtkIconLookupFlags  flags)
 {
   GtkIcon *icon;
 
@@ -2358,11 +2266,11 @@ choose_icon_thread  (GTask        *task,
   GtkIconTheme *self = GTK_ICON_THEME (source_object);
   GtkIcon *icon;
 
-  icon = gtk_icon_theme_choose_icon_for_scale (self,
-                                               (const char **)data->icon_names,
-                                               data->size,
-                                               data->scale,
-                                               data->flags);
+  icon = gtk_icon_theme_choose_icon (self,
+                                     (const char **)data->icon_names,
+                                     data->size,
+                                     data->scale,
+                                     data->flags);
 
   if (icon)
     {
@@ -2415,7 +2323,7 @@ load_icon_thread  (GTask        *task,
  *
  * Asynchronously lookup, load, render and scale an icon .
  *
- * For more details, see gtk_icon_theme_choose_icon_for_scale() which is the synchronous
+ * For more details, see gtk_icon_theme_choose_icon() which is the synchronous
  * version of this call.
  *
  * Returns: (nullable) (transfer full): a #GtkIcon object
@@ -4101,37 +4009,6 @@ icon_paintable_init (GdkPaintableInterface *iface)
   iface->get_intrinsic_height = icon_paintable_get_intrinsic_height;
 }
 
-/**
- * gtk_icon_theme_lookup_by_gicon:
- * @self: a #GtkIconTheme
- * @icon: the #GIcon to look up
- * @size: desired icon size
- * @flags: flags modifying the behavior of the icon lookup
- * 
- * Looks up an icon and returns a #GtkIcon containing information
- * such as the filename of the icon. The icon can then be rendered
- * into a pixbuf using gtk_icon_load_icon().
- *
- * When rendering on displays with high pixel densities you should not
- * use a @size multiplied by the scaling factor returned by functions
- * like gdk_surface_get_scale_factor(). Instead, you should use
- * gtk_icon_theme_lookup_by_gicon_for_scale(), as the assets loaded
- * for a given scaling factor may be different.
- *
- * Returns: (nullable) (transfer full): a #GtkIcon containing
- *     information about the icon, or %NULL if the icon wasn’t
- *     found. Unref with g_object_unref()
- */
-GtkIcon *
-gtk_icon_theme_lookup_by_gicon (GtkIconTheme       *self,
-                                GIcon              *icon,
-                                gint                size,
-                                GtkIconLookupFlags  flags)
-{
-  return gtk_icon_theme_lookup_by_gicon_for_scale (self, icon,
-                                                   size, 1, flags);
-}
-
 static GtkIcon *
 gtk_icon_new_for_file (GFile *file,
                             gint   size,
@@ -4189,7 +4066,7 @@ gtk_icon_new_for_pixbuf (GtkIconTheme *icon_theme,
 }
 
 /**
- * gtk_icon_theme_lookup_by_gicon_for_scale:
+ * gtk_icon_theme_lookup_by_gicon:
  * @self: a #GtkIconTheme
  * @icon: the #GIcon to look up
  * @size: desired icon size
@@ -4205,11 +4082,11 @@ gtk_icon_new_for_pixbuf (GtkIconTheme *icon_theme,
  *     found. Unref with g_object_unref()
  */
 GtkIcon *
-gtk_icon_theme_lookup_by_gicon_for_scale (GtkIconTheme       *self,
-                                          GIcon              *gicon,
-                                          gint                size,
-                                          gint                scale,
-                                          GtkIconLookupFlags  flags)
+gtk_icon_theme_lookup_by_gicon (GtkIconTheme       *self,
+                                GIcon              *gicon,
+                                gint                size,
+                                gint                scale,
+                                GtkIconLookupFlags  flags)
 {
   GtkIcon *icon;
 
@@ -4281,7 +4158,7 @@ gtk_icon_theme_lookup_by_gicon_for_scale (GtkIconTheme       *self,
       const gchar **names;
 
       names = (const gchar **)g_themed_icon_get_names (G_THEMED_ICON (gicon));
-      icon = gtk_icon_theme_choose_icon_for_scale (self, names, size, scale, flags);
+      icon = gtk_icon_theme_choose_icon (self, names, size, scale, flags);
 
       return icon;
     }
diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h
index f1e22aa0ee..c40f0867d0 100644
--- a/gtk/gtkicontheme.h
+++ b/gtk/gtkicontheme.h
@@ -147,23 +147,12 @@ gint         *gtk_icon_theme_get_icon_sizes        (GtkIconTheme
                                                     const gchar                 *icon_name);
 GDK_AVAILABLE_IN_ALL
 GtkIcon *    gtk_icon_theme_lookup_icon            (GtkIconTheme                *self,
-                                                    const gchar                 *icon_name,
-                                                    gint                         size,
-                                                    GtkIconLookupFlags           flags);
-GDK_AVAILABLE_IN_ALL
-GtkIcon *    gtk_icon_theme_lookup_icon_for_scale  (GtkIconTheme                *self,
                                                     const gchar                 *icon_name,
                                                     gint                         size,
                                                     gint                         scale,
                                                     GtkIconLookupFlags           flags);
-
 GDK_AVAILABLE_IN_ALL
 GtkIcon *    gtk_icon_theme_choose_icon            (GtkIconTheme                *self,
-                                                    const gchar                 *icon_names[],
-                                                    gint                         size,
-                                                    GtkIconLookupFlags           flags);
-GDK_AVAILABLE_IN_ALL
-GtkIcon *    gtk_icon_theme_choose_icon_for_scale  (GtkIconTheme                *self,
                                                     const gchar                 *icon_names[],
                                                     gint                         size,
                                                     gint                         scale,
@@ -182,17 +171,12 @@ GtkIcon *    gtk_icon_theme_choose_icon_finish     (GtkIconTheme
                                                     GAsyncResult                *result,
                                                     GError                     **error);
 GDK_AVAILABLE_IN_ALL
-GtkIcon *    gtk_icon_theme_lookup_by_gicon        (GtkIconTheme                *self,
+GtkIcon *   gtk_icon_theme_lookup_by_gicon         (GtkIconTheme                *self,
                                                     GIcon                       *icon,
                                                     gint                         size,
+                                                    gint                         scale,
                                                     GtkIconLookupFlags           flags);
 GDK_AVAILABLE_IN_ALL
-GtkIcon *   gtk_icon_theme_lookup_by_gicon_for_scale (GtkIconTheme                *self,
-                                                      GIcon                       *icon,
-                                                      gint                      size,
-                                                      gint                      scale,
-                                                      GtkIconLookupFlags        flags);
-GDK_AVAILABLE_IN_ALL
 GList *       gtk_icon_theme_list_icons            (GtkIconTheme                *self,
                                                     const gchar                 *context);
 GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 37f2398c09..b23734d0bf 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -1174,7 +1174,7 @@ add_pid_to_process_list_store (GtkMountOperation              *mount_operation,
       theme = gtk_css_icon_theme_value_get_icon_theme
         (_gtk_style_context_peek_property (gtk_widget_get_style_context (GTK_WIDGET 
(mount_operation->priv->dialog)),
                                            GTK_CSS_PROPERTY_ICON_THEME));
-      info = gtk_icon_theme_lookup_icon (theme, "application-x-executable", 24, 0);
+      info = gtk_icon_theme_lookup_icon (theme, "application-x-executable", 24, 1, 0);
       texture = gtk_icon_download_texture (info, NULL);
       g_object_unref (info);
     }
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index ba1f53440b..76295d9695 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4027,13 +4027,13 @@ icon_list_from_theme (GtkWindow   *window,
        * fixed size of 48.
        */
       if (sizes[i] == -1)
-        info = gtk_icon_theme_lookup_icon_for_scale (icon_theme, name,
-                                                    48, priv->scale,
-                                                    0);
+        info = gtk_icon_theme_lookup_icon (icon_theme, name,
+                                           48, priv->scale,
+                                           0);
       else
-        info = gtk_icon_theme_lookup_icon_for_scale (icon_theme, name,
-                                                    sizes[i], priv->scale,
-                                                    0);
+        info = gtk_icon_theme_lookup_icon (icon_theme, name,
+                                           sizes[i], priv->scale,
+                                           0);
       if (info)
         {
           GdkTexture *texture = gtk_icon_download_texture (info, NULL);
@@ -4100,6 +4100,7 @@ GdkPaintable *
 gtk_window_get_icon_for_size (GtkWindow *window,
                               int        size)
 {
+  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
   const char *name;
   GtkIcon *info;
 
@@ -4111,7 +4112,7 @@ gtk_window_get_icon_for_size (GtkWindow *window,
     return NULL;
 
   info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
-                                     name, size,
+                                     name, size, priv->scale,
                                      GTK_ICON_LOOKUP_FORCE_SIZE);
   if (info == NULL)
     return NULL;
diff --git a/tests/testclipboard2.c b/tests/testclipboard2.c
index 0d2f37cace..3523051ef2 100644
--- a/tests/testclipboard2.c
+++ b/tests/testclipboard2.c
@@ -288,7 +288,7 @@ get_button_list (GdkClipboard *clipboard,
   g_value_init (&value, GDK_TYPE_PIXBUF);
   icon = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
                                      "utilities-terminal",
-                                     48, 0);
+                                     48, 1, 0);
   texture = gtk_icon_download_texture (icon, NULL);
   g_value_take_object (&value, gdk_pixbuf_get_from_texture (texture));
   g_object_unref (texture);
diff --git a/tests/testdnd2.c b/tests/testdnd2.c
index 42b73f1c85..4086688ea1 100644
--- a/tests/testdnd2.c
+++ b/tests/testdnd2.c
@@ -25,7 +25,7 @@ get_image_texture (GtkImage *image,
       icon_name = gtk_image_get_icon_name (image);
       icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
       *out_size = width;
-      icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, width, 
GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+      icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, width, 1, 
GTK_ICON_LOOKUP_GENERIC_FALLBACK);
       if (icon_info)
         texture = gtk_icon_download_texture (icon_info, NULL);
       g_object_unref (icon_info);
@@ -228,7 +228,7 @@ update_source_icon (GtkDragSource *source,
   int size = 48;
 
   icon = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
-                                     icon_name, size, 0);
+                                     icon_name, size, 1, 0);
   switch (hotspot)
     {
     default:
diff --git a/tests/testicontheme.c b/tests/testicontheme.c
index a50d35c11b..c5ba70ed1b 100644
--- a/tests/testicontheme.c
+++ b/tests/testicontheme.c
@@ -107,7 +107,7 @@ main (int argc, char *argv[])
       if (argc >= 6)
        scale = atoi (argv[5]);
 
-      icon = gtk_icon_theme_lookup_icon_for_scale (icon_theme, argv[3], size, scale, flags);
+      icon = gtk_icon_theme_lookup_icon (icon_theme, argv[3], size, scale, flags);
       if (!icon)
         {
           g_print ("Icon '%s' not found\n", argv[3]);
@@ -184,7 +184,7 @@ main (int argc, char *argv[])
       if (argc >= 6)
        scale = atoi (argv[5]);
 
-      icon_info = gtk_icon_theme_lookup_icon_for_scale (icon_theme, argv[3], size, scale, flags);
+      icon_info = gtk_icon_theme_lookup_icon (icon_theme, argv[3], size, scale, flags);
       g_print ("icon for %s at %dx%d@%dx is %s\n", argv[3], size, size, scale,
                icon_info ? gtk_icon_get_filename (icon_info) : "<none>");
 
diff --git a/testsuite/gtk/check-icon-names.c b/testsuite/gtk/check-icon-names.c
index 2929bcf207..3d15f072e5 100644
--- a/testsuite/gtk/check-icon-names.c
+++ b/testsuite/gtk/check-icon-names.c
@@ -79,7 +79,7 @@ test_icon_existence (gconstpointer icon_name)
    * icon theme.
    * The icon size is randomly chosen.
    */
-  info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), icon_name, 16, GTK_ICON_LOOKUP_DIR_LTR);
+  info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), icon_name, 16, 1, 
GTK_ICON_LOOKUP_DIR_LTR);
   if (info == NULL)
     {
       g_test_message ("Failed to look up icon for \"%s\"", (char *) icon_name);
diff --git a/testsuite/gtk/icontheme.c b/testsuite/gtk/icontheme.c
index 0e119db714..2d1ea6902c 100644
--- a/testsuite/gtk/icontheme.c
+++ b/testsuite/gtk/icontheme.c
@@ -57,7 +57,7 @@ assert_icon_lookup_size (const char         *icon_name,
 {
   GtkIcon *info;
 
-  info = gtk_icon_theme_lookup_icon (get_test_icontheme (FALSE), icon_name, size, flags);
+  info = gtk_icon_theme_lookup_icon (get_test_icontheme (FALSE), icon_name, size, 1, flags);
   if (info == NULL)
     {
       g_error ("Could not look up an icon for \"%s\" with flags %s at size %d",
@@ -110,7 +110,7 @@ assert_icon_lookup_fails (const char         *icon_name,
 {
   GtkIcon *info;
 
-  info = gtk_icon_theme_lookup_icon (get_test_icontheme (FALSE), icon_name, size, flags);
+  info = gtk_icon_theme_lookup_icon (get_test_icontheme (FALSE), icon_name, size, 1, flags);
 
   if (info != NULL)
     {
@@ -173,7 +173,7 @@ assert_lookup_order (const char         *icon_name,
 
   g_assert (lookups == NULL);
 
-  info = gtk_icon_theme_lookup_icon (get_test_icontheme (FALSE), icon_name, size, flags);
+  info = gtk_icon_theme_lookup_icon (get_test_icontheme (FALSE), icon_name, size, 1, flags);
   if (info)
     g_object_unref (info);
   
@@ -690,8 +690,8 @@ test_nonsquare_symbolic (void)
   icon_theme = gtk_icon_theme_get_default ();
   file = g_file_new_for_path (path);
   icon = g_file_icon_new (file);
-  info = gtk_icon_theme_lookup_by_gicon_for_scale (icon_theme, icon,
-                                                  height, 1, 0);
+  info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon,
+                                         height, 1, 0);
   g_assert_nonnull (info);
 
   g_object_unref (pixbuf);


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