static void ensure_pixbuf_for_gicon (GtkIconHelper *self, GtkStyleContext *context) { GtkIconTheme *icon_theme; gint width, height; GtkIconInfo *info; GtkIconLookupFlags flags; if (!check_invalidate_pixbuf (self, context)) return; icon_theme = gtk_icon_theme_get_for_screen (gtk_style_context_get_screen (context)); flags = get_icon_lookup_flags (self, context); ensure_icon_size (self, context, &width, &height); if (self->priv->gicon != NULL) { info = gtk_icon_theme_lookup_by_gicon (icon_theme, self->priv->gicon, MIN (width, height), flags); } else { g_assert_not_reached (); return; } self->priv->rendered_pixbuf = ensure_stated_icon_from_info (self, context, info); if (info) g_object_unref (info); }
static void ensure_pixbuf_for_icon_name_or_gicon (GtkIconHelper *self, GtkStyleContext *context) { GtkIconTheme *icon_theme; gint width, height; GtkIconInfo *info; GtkIconLookupFlags flags; if (!check_invalidate_pixbuf (self, context)) return; icon_theme = gtk_icon_theme_get_default (); flags = get_icon_lookup_flags (self); ensure_icon_size (self, context, &width, &height); if (self->priv->storage_type == GTK_IMAGE_ICON_NAME && self->priv->icon_name != NULL) { info = gtk_icon_theme_lookup_icon (icon_theme, self->priv->icon_name, MIN (width, height), flags); } else if (self->priv->storage_type == GTK_IMAGE_GICON && self->priv->gicon != NULL) { info = gtk_icon_theme_lookup_by_gicon (icon_theme, self->priv->gicon, MIN (width, height), flags); } else { g_assert_not_reached (); return; } self->priv->rendered_pixbuf = ensure_stated_icon_from_info (self, context, info); if (info) g_object_unref (info); }