- symbolic = FALSE;
-
- if (info)
- destination =
- gtk_icon_info_load_symbolic_for_context (info,
- context,
- &symbolic,
- NULL);
-
- if (destination == NULL)
- {
- destination =
- gtk_widget_render_icon_pixbuf (GTK_WIDGET (image),
- GTK_STOCK_MISSING_IMAGE,
- priv->icon_size);
- }
- else if (!symbolic)
- {
- GtkIconSource *source;
- GdkPixbuf *rendered;
-
- source = gtk_icon_source_new ();
- gtk_icon_source_set_pixbuf (source, destination);
- /* The size here is arbitrary; since size isn't
- * wildcarded in the source, it isn't supposed to be
- * scaled by the engine function
- */
- gtk_icon_source_set_size (source,
- GTK_ICON_SIZE_SMALL_TOOLBAR);
- gtk_icon_source_set_size_wildcarded (source, FALSE);
-
- rendered = gtk_render_icon_pixbuf (context, source, (GtkIconSize) -1);
- gtk_icon_source_free (source);
-
- g_object_unref (destination);
- destination = rendered;
- }
-
- return destination;
-}
-
-static void
-ensure_pixbuf_for_icon_name (GtkImage *image,
- GtkStateFlags state)
-{
- GtkImagePrivate *priv = image->priv;
- GdkScreen *screen;
- GtkIconTheme *icon_theme;
- gint width, height;
- GtkIconInfo *info;
- GtkIconLookupFlags flags;
-
- g_return_if_fail (priv->storage_type == GTK_IMAGE_ICON_NAME);
-
- screen = gtk_widget_get_screen (GTK_WIDGET (image));
- icon_theme = gtk_icon_theme_get_for_screen (screen);
-
- flags = GTK_ICON_LOOKUP_USE_BUILTIN;
-
- if (priv->use_fallback)
- flags |= GTK_ICON_LOOKUP_GENERIC_FALLBACK;
-
- if ((priv->data.name.pixbuf == NULL) ||
- (priv->last_rendered_state != state))
- {
- priv->last_rendered_state = state;
-
- if (priv->data.name.pixbuf)
- {
- g_object_unref (priv->data.name.pixbuf);
- priv->data.name.pixbuf = NULL;
- }
-
- ensure_icon_size (image, &flags, &width, &height);
- info = gtk_icon_theme_lookup_icon (icon_theme,
- priv->data.name.icon_name,
- MIN (width, height), flags);
-
- priv->data.name.pixbuf = ensure_stated_icon_from_info (image, info);
-
- if (info)
- gtk_icon_info_free (info);
- }
-}
-
-static void
-ensure_pixbuf_for_gicon (GtkImage *image,
- GtkStateFlags state)
-{
- GtkImagePrivate *priv = image->priv;
- GdkScreen *screen;
- GtkIconTheme *icon_theme;
- gint width, height;
- GtkIconInfo *info;
- GtkIconLookupFlags flags;
-
- g_return_if_fail (priv->storage_type == GTK_IMAGE_GICON);
-
- screen = gtk_widget_get_screen (GTK_WIDGET (image));
- icon_theme = gtk_icon_theme_get_for_screen (screen);
-
- flags = GTK_ICON_LOOKUP_USE_BUILTIN;
-
- if (priv->use_fallback)
- flags |= GTK_ICON_LOOKUP_GENERIC_FALLBACK;
-
- if ((priv->data.gicon.pixbuf == NULL) ||
- (priv->last_rendered_state != state))
- {
- priv->last_rendered_state = state;
-
- if (priv->data.gicon.pixbuf)
- {
- g_object_unref (priv->data.gicon.pixbuf);
- priv->data.gicon.pixbuf = NULL;
- }
-
- ensure_icon_size (image, &flags, &width, &height);
- info = gtk_icon_theme_lookup_by_gicon (icon_theme,
- priv->data.gicon.icon,
- MIN (width, height), flags);