Remove final references to "icon info" with just "icon"
authorAlexander Larsson <alexl@redhat.com>
Thu, 30 Jan 2020 09:52:09 +0000 (10:52 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 30 Jan 2020 09:53:43 +0000 (10:53 +0100)
demos/gtk-demo/clipboard.c
demos/icon-browser/iconbrowserwin.c
gtk/gtkapplication-quartz-menu.c
gtk/gtkcssimageicontheme.c
gtk/gtkiconhelper.c
gtk/gtkicontheme.c
gtk/gtkmountoperation.c
tests/testdnd2.c
tests/testicontheme.c

index fba169ee45806753d54a7716d814b58975f2522d..5708b888c445f642fe8b710c36ac08b3a73d09c2 100644 (file)
@@ -98,7 +98,7 @@ get_image_paintable (GtkImage *image)
 {
   const gchar *icon_name;
   GtkIconTheme *icon_theme;
-  GtkIcon *icon_info;
+  GtkIcon *icon;
 
   switch (gtk_image_get_storage_type (image))
     {
@@ -107,10 +107,10 @@ 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, 1, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
-      if (icon_info == NULL)
+      icon = gtk_icon_theme_lookup_icon (icon_theme, icon_name, 48, 1, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+      if (icon == NULL)
         return NULL;
-      return GDK_PAINTABLE (icon_info);
+      return GDK_PAINTABLE (icon);
     default:
       g_warning ("Image storage type %d not handled",
                  gtk_image_get_storage_type (image));
index 6a047662cd9c5a207b111d045e09767c0bb3bb60..a0e61f34a278f26a9905e93052468d464b810fdd 100644 (file)
@@ -348,7 +348,7 @@ get_image_paintable (GtkImage *image)
 {
   const gchar *icon_name;
   GtkIconTheme *icon_theme;
-  GtkIcon *icon_info;
+  GtkIcon *icon;
   int size;
 
   switch (gtk_image_get_storage_type (image))
@@ -359,11 +359,11 @@ 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, 1,
+      icon = 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)
+      if (icon == NULL)
         return NULL;
-      return GDK_PAINTABLE (icon_info);
+      return GDK_PAINTABLE (icon);
     default:
       g_warning ("Image storage type %d not handled",
                  gtk_image_get_storage_type (image));
index 2d31dc0463642926d3c7b45568edc75c10554dda..1ed137c41cb28627ec63aa7868ecc60d7dde95ed 100644 (file)
@@ -103,7 +103,7 @@ icon_loaded (GObject      *object,
              GAsyncResult *result,
              gpointer      user_data)
 {
-  GtkIcon *info = GTK_ICON_INFO (object);
+  GtkIcon *icon = GTK_ICON (object);
   GNSMenuItem *item = user_data;
   GError *error = NULL;
   GdkPixbuf *pixbuf;
@@ -117,7 +117,7 @@ icon_loaded (GObject      *object,
         scale = roundf ([[NSScreen mainScreen] backingScaleFactor]);
 #endif
 
-  pixbuf = gtk_icon_load_symbolic_finish (info, result, NULL, &error);
+  pixbuf = gtk_icon_load_symbolic_finish (icon, result, NULL, &error);
 
   if (pixbuf != NULL)
     {
@@ -278,7 +278,7 @@ icon_loaded (GObject      *object,
       static GdkRGBA error;
 
       GtkIconTheme *theme;
-      GtkIcon *info;
+      GtkIcon *icon;
       gint scale = 1;
 
       if (!parsed)
@@ -300,14 +300,14 @@ icon_loaded (GObject      *object,
       if ([[NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)])
         scale = roundf ([[NSScreen mainScreen] backingScaleFactor]);
 #endif
-      info = gtk_icon_theme_lookup_by_gicon (theme, icon, ICON_SIZE, scale, GTK_ICON_LOOKUP_USE_BUILTIN);
+      icon = gtk_icon_theme_lookup_by_gicon (theme, icon, ICON_SIZE, scale, GTK_ICON_LOOKUP_USE_BUILTIN);
 
-      if (info != NULL)
+      if (icon != NULL)
         {
           cancellable = g_cancellable_new ();
-          gtk_icon_load_symbolic_async (info, &foreground, &success, &warning, &error,
+          gtk_icon_load_symbolic_async (icon, &foreground, &success, &warning, &error,
                                              cancellable, icon_loaded, self);
-          g_object_unref (info);
+          g_object_unref (icon);
           return;
         }
     }
index 86786b8f612e850e4b4cbadd9e1f967575186275..03bbc2795f4dc61064d74eebeba5edf1cb8f6aaf 100644 (file)
@@ -45,7 +45,7 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image,
                                    double       height)
 {
   GtkCssImageIconTheme *icon_theme = GTK_CSS_IMAGE_ICON_THEME (image);
-  GtkIcon *icon_info;
+  GtkIcon *icon;
   double icon_width, icon_height;
   gint size;
   double x, y;
@@ -57,31 +57,31 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image,
   if (size == icon_theme->cached_size &&
       icon_theme->cached_icon != NULL)
     {
-      icon_info = icon_theme->cached_icon;
+      icon = icon_theme->cached_icon;
     }
   else
     {
-      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, icon_theme->scale,
-                                                GTK_ICON_LOOKUP_USE_BUILTIN | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
-
-      g_assert (icon_info != NULL);
+      icon = gtk_icon_theme_lookup_icon (icon_theme->icon_theme,
+                                         icon_theme->name,
+                                         size,
+                                         icon_theme->scale,
+                                         GTK_ICON_LOOKUP_USE_BUILTIN);
+      if (icon == NULL)
+        icon = gtk_icon_theme_lookup_icon (icon_theme->icon_theme,
+                                           "image-missing",
+                                           size, icon_theme->scale,
+                                           GTK_ICON_LOOKUP_USE_BUILTIN | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+
+      g_assert (icon != NULL);
 
       g_clear_object (&icon_theme->cached_icon);
 
       icon_theme->cached_size = size;
-      icon_theme->cached_icon = icon_info;
+      icon_theme->cached_icon = icon;
     }
 
-  icon_width = (double) MIN (gdk_paintable_get_intrinsic_width (GDK_PAINTABLE (icon_info)), width);
-  icon_height = (double) MIN (gdk_paintable_get_intrinsic_height (GDK_PAINTABLE (icon_info)), height);
+  icon_width = (double) MIN (gdk_paintable_get_intrinsic_width (GDK_PAINTABLE (icon)), width);
+  icon_height = (double) MIN (gdk_paintable_get_intrinsic_height (GDK_PAINTABLE (icon)), height);
 
   x = (width - icon_width) / 2;
   y = (height - icon_height) / 2;
@@ -91,13 +91,13 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image,
       gtk_snapshot_save (snapshot);
       gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
     }
-  gtk_icon_snapshot_with_colors (icon_info, snapshot,
-                                      icon_width,
-                                      icon_height,
-                                      &icon_theme->color,
-                                      &icon_theme->success,
-                                      &icon_theme->warning,
-                                      &icon_theme->error);
+  gtk_icon_snapshot_with_colors (icon, snapshot,
+                                 icon_width,
+                                 icon_height,
+                                 &icon_theme->color,
+                                 &icon_theme->success,
+                                 &icon_theme->warning,
+                                 &icon_theme->error);
   if (x != 0 || y != 0)
     gtk_snapshot_restore (snapshot);
 }
index 47b5b675b0ebfa3edea345f9597fc82ca368f86e..4091722cc4ee54cfe333a6fc2cc281282d411a2c 100644 (file)
@@ -102,7 +102,7 @@ ensure_paintable_for_gicon (GtkIconHelper    *self,
 {
   GtkIconTheme *icon_theme;
   gint width, height;
-  GtkIcon *info;
+  GtkIcon *icon;
   GtkIconLookupFlags flags;
 
   icon_theme = gtk_css_icon_theme_value_get_icon_theme (style->core->icon_theme);
@@ -110,18 +110,18 @@ ensure_paintable_for_gicon (GtkIconHelper    *self,
 
   width = height = gtk_icon_helper_get_size (self);
 
-  info = gtk_icon_theme_lookup_by_gicon (icon_theme,
+  icon = 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,
+  if (icon == NULL)
+    icon = gtk_icon_theme_lookup_icon (icon_theme,
                                        "image-missing",
                                        width, scale,
                                        flags | GTK_ICON_LOOKUP_USE_BUILTIN | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
 
-  *symbolic = gtk_icon_is_symbolic (info);
-  return GDK_PAINTABLE (info);
+  *symbolic = gtk_icon_is_symbolic (icon);
+  return GDK_PAINTABLE (icon);
 }
 
 static GdkPaintable *
index f60dc2c09a787373e1964e738532bec7b06a86bb..d558a5fc8984f3468fcf352f556dd23114729fdd 100644 (file)
  * There is a global "icon_cache" G_LOCK, which protects icon_cache
  * and lru_cache in GtkIconTheme as well as its reverse pointer
  * GtkIcon->in_cache. This is sometimes taken with the theme lock held
- * (from the theme side) and sometimes not (from the icon info side),
+ * (from the theme side) and sometimes not (from the icon side),
  * but we never take another lock after taking it, so this is safe.
  * Since this is a global (not per icon/theme) lock we should never
  * block while holding it.
@@ -252,7 +252,7 @@ typedef struct {
   gint size;
   gint scale;
   GtkIconLookupFlags flags;
-} IconInfoKey;
+} IconKey;
 
 struct _GtkIconClass
 {
@@ -275,7 +275,7 @@ struct _GtkIcon
 
   /* Information about the source
    */
-  IconInfoKey key;
+  IconKey key;
   GtkIconTheme *in_cache; /* Protected by icon_cache lock */
 
   gchar *filename;
@@ -498,7 +498,7 @@ gtk_icon_theme_unlock (GtkIconTheme *self)
 static guint
 icon_key_hash (gconstpointer _key)
 {
-  const IconInfoKey *key = _key;
+  const IconKey *key = _key;
   guint h = 0;
   int i;
   for (i = 0; key->icon_names[i] != NULL; i++)
@@ -515,8 +515,8 @@ static gboolean
 icon_key_equal (gconstpointer _a,
                 gconstpointer _b)
 {
-  const IconInfoKey *a = _a;
-  const IconInfoKey *b = _b;
+  const IconKey *a = _a;
+  const IconKey *b = _b;
   int i;
 
   if (a->size != b->size)
@@ -549,9 +549,9 @@ icon_key_equal (gconstpointer _a,
 
 /* This is called with icon_cache lock held so must not take any locks */
 static gboolean
-_icon_cache_should_lru_cache (GtkIcon *info)
+_icon_cache_should_lru_cache (GtkIcon *icon)
 {
-  return info->desired_size <= MAX_LRU_TEXTURE_SIZE;
+  return icon->desired_size <= MAX_LRU_TEXTURE_SIZE;
 }
 
 /* This returns the old lru element because we can't unref it with
@@ -573,7 +573,7 @@ _icon_cache_add_to_lru_cache (GtkIconTheme *theme, GtkIcon *icon)
 }
 
 static GtkIcon *
-icon_cache_lookup (GtkIconTheme *theme, IconInfoKey *key)
+icon_cache_lookup (GtkIconTheme *theme, IconKey *key)
 {
   GtkIcon *old_icon = NULL;
   GtkIcon *icon;
@@ -605,7 +605,7 @@ icon_cache_lookup (GtkIconTheme *theme, IconInfoKey *key)
   return icon;
 }
 
-/* The icon info was removed from the icon_hash hash table.
+/* The icon was removed from the icon_hash hash table.
  * This is a callback from the icon_cache hashtable, so the icon_cache lock is already held.
  */
 static void
@@ -1869,7 +1869,7 @@ real_choose_icon (GtkIconTheme       *self,
   gboolean allow_svg;
   IconTheme *theme = NULL;
   gint i;
-  IconInfoKey key;
+  IconKey key;
 
   if (!ensure_valid_themes (self, non_blocking))
     {
index b23734d0bf4a7a16075ff3be825aa877ff10b4bc..20e61d08311da6abd3ed905cb34981f734b2f5a9 100644 (file)
@@ -1169,14 +1169,14 @@ add_pid_to_process_list_store (GtkMountOperation              *mount_operation,
   if (texture == NULL)
     {
       GtkIconTheme *theme;
-      GtkIcon *info;
+      GtkIcon *icon;
 
       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, 1, 0);
-      texture = gtk_icon_download_texture (info, NULL);
-      g_object_unref (info);
+      icon = gtk_icon_theme_lookup_icon (theme, "application-x-executable", 24, 1, 0);
+      texture = gtk_icon_download_texture (icon, NULL);
+      g_object_unref (icon);
     }
 
   markup = g_strdup_printf ("<b>%s</b>\n"
index 4086688ea1028c0a053949fa36409c6adce1e785..11d604fee54e0ebd2cfe5cceadb7770488969507 100644 (file)
@@ -10,7 +10,7 @@ get_image_texture (GtkImage *image,
   int width = 48;
   GdkPaintable *paintable;
   GdkTexture *texture = NULL;
-  GtkIcon *icon_info;
+  GtkIcon *icon;
 
   switch (gtk_image_get_storage_type (image))
     {
@@ -25,10 +25,10 @@ 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, 1, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
-      if (icon_info)
-        texture = gtk_icon_download_texture (icon_info, NULL);
-      g_object_unref (icon_info);
+      icon = gtk_icon_theme_lookup_icon (icon_theme, icon_name, width, 1, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+      if (icon)
+        texture = gtk_icon_download_texture (icon, NULL);
+      g_object_unref (icon);
     default:
       g_warning ("Image storage type %d not handled",
                  gtk_image_get_storage_type (image));
index c5ba70ed1be190de9b1f9ffc099bc8414399527a..c988f10ce577574d7807dba3d7273642bae2e5f9 100644 (file)
@@ -60,7 +60,7 @@ int
 main (int argc, char *argv[])
 {
   GtkIconTheme *icon_theme;
-  GtkIcon *icon_info;
+  GtkIcon *icon;
   char *context;
   char *themename;
   GList *list;
@@ -184,18 +184,18 @@ main (int argc, char *argv[])
       if (argc >= 6)
        scale = atoi (argv[5]);
 
-      icon_info = gtk_icon_theme_lookup_icon (icon_theme, argv[3], size, scale, flags);
+      icon = 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>");
+               icon ? gtk_icon_get_filename (icon) : "<none>");
 
-      if (icon_info)
+      if (icon)
        {
-          GdkPaintable *paintable = GDK_PAINTABLE (icon_info);
+          GdkPaintable *paintable = GDK_PAINTABLE (icon);
 
-          g_print ("Base size: %d, Scale: %d\n", gtk_icon_get_base_size (icon_info), gtk_icon_get_base_scale (icon_info));
+          g_print ("Base size: %d, Scale: %d\n", gtk_icon_get_base_size (icon), gtk_icon_get_base_scale (icon));
           g_print ("texture size: %dx%d\n", gdk_paintable_get_intrinsic_width (paintable), gdk_paintable_get_intrinsic_height (paintable));
 
-         g_object_unref (icon_info);
+         g_object_unref (icon);
        }
     }
   else