[gtk/wip/otte/icontheme: 4/11] icontheme: Remove GTK_ICON_LOOKUP_USE_BUILTIN
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/icontheme: 4/11] icontheme: Remove GTK_ICON_LOOKUP_USE_BUILTIN
- Date: Sun, 2 Feb 2020 00:27:43 +0000 (UTC)
commit 377f389d03e3138d351e51c82fe1adab9526b72d
Author: Benjamin Otte <otte redhat com>
Date: Sun Feb 2 00:35:42 2020 +0100
icontheme: Remove GTK_ICON_LOOKUP_USE_BUILTIN
It's unused.
gtk/gtkapplication-quartz-menu.c | 2 +-
gtk/gtkbuilder.c | 2 +-
gtk/gtkcssimageicontheme.c | 4 ++--
gtk/gtkiconhelper.c | 4 ++--
gtk/gtkicontheme.c | 9 ++-------
gtk/gtkicontheme.h | 13 ++++---------
tests/testicontheme.c | 2 +-
7 files changed, 13 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkapplication-quartz-menu.c b/gtk/gtkapplication-quartz-menu.c
index 56ab759bf6..bf6b5ed425 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
- icon = 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, 0);
if (icon != NULL)
{
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index d6e38b92c6..6ad3dc5c90 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -2173,7 +2173,7 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
icon = gtk_icon_theme_lookup_icon (theme, "image-missing", 16, 1,
GTK_TEXT_DIR_NONE,
- GTK_ICON_LOOKUP_USE_BUILTIN);
+ 0);
texture = gtk_icon_download_texture (icon, NULL);
pixbuf = gdk_pixbuf_get_from_texture (texture);
g_object_unref (icon);
diff --git a/gtk/gtkcssimageicontheme.c b/gtk/gtkcssimageicontheme.c
index 0b92662fc7..ee7db6f997 100644
--- a/gtk/gtkcssimageicontheme.c
+++ b/gtk/gtkcssimageicontheme.c
@@ -66,13 +66,13 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image,
size,
icon_theme->scale,
GTK_TEXT_DIR_NONE,
- GTK_ICON_LOOKUP_USE_BUILTIN);
+ 0);
if (icon == NULL)
icon = gtk_icon_theme_lookup_icon (icon_theme->icon_theme,
"image-missing",
size, icon_theme->scale,
GTK_TEXT_DIR_NONE,
- GTK_ICON_LOOKUP_USE_BUILTIN | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+ 0 | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
g_assert (icon != NULL);
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index 96ca132a26..fdf2485f54 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -61,7 +61,7 @@ get_icon_lookup_flags (GtkIconHelper *self,
GtkIconLookupFlags flags;
GtkCssIconStyle icon_style;
- flags = GTK_ICON_LOOKUP_USE_BUILTIN;
+ flags = 0;
if (self->pixel_size != -1 || self->force_scale_pixbuf)
flags |= GTK_ICON_LOOKUP_FORCE_SIZE;
@@ -114,7 +114,7 @@ ensure_paintable_for_gicon (GtkIconHelper *self,
"image-missing",
width, scale,
dir,
- flags | GTK_ICON_LOOKUP_USE_BUILTIN |
GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+ flags | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
*symbolic = gtk_icon_is_symbolic (icon);
return GDK_PAINTABLE (icon);
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 91c26b4c1b..dd61a21755 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3445,15 +3445,10 @@ gtk_icon_get_base_scale (GtkIcon *icon)
* gtk_icon_get_filename:
* @self: a #GtkIcon
*
- * Gets the filename for the icon. If the %GTK_ICON_LOOKUP_USE_BUILTIN
- * flag was passed to gtk_icon_theme_lookup_icon(), there may be no
- * filename if a builtin icon is returned; in this case, you should
- * use gtk_icon_get_builtin_pixbuf().
+ * Gets the filename for the icon.
*
* Returns: (nullable) (type filename): the filename for the icon, or %NULL
- * if gtk_icon_get_builtin_pixbuf() should be used instead.
- * The return value is owned by GTK+ and should not be modified
- * or freed.
+ * if the icon is not represented by a filename.
*/
const gchar *
gtk_icon_get_filename (GtkIcon *icon)
diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h
index 8d73006f8e..42008c5e62 100644
--- a/gtk/gtkicontheme.h
+++ b/gtk/gtkicontheme.h
@@ -47,10 +47,6 @@ typedef struct _GtkIconTheme GtkIconTheme;
* @GTK_ICON_LOOKUP_FORCE_SVG: Get SVG icons, even if gdk-pixbuf
* doesn’t support them.
* Cannot be used together with %GTK_ICON_LOOKUP_NO_SVG.
- * @GTK_ICON_LOOKUP_USE_BUILTIN: When passed to
- * gtk_icon_theme_lookup_icon() includes builtin icons
- * as well as files. For a builtin icon, gtk_icon_get_filename()
- * is %NULL and you need to call gtk_icon_get_builtin_pixbuf().
* @GTK_ICON_LOOKUP_GENERIC_FALLBACK: Try to shorten icon name at '-'
* characters before looking at inherited themes. This flag is only
* supported in functions that take a single icon name. For more general
@@ -72,11 +68,10 @@ typedef enum
{
GTK_ICON_LOOKUP_NO_SVG = 1 << 0,
GTK_ICON_LOOKUP_FORCE_SVG = 1 << 1,
- GTK_ICON_LOOKUP_USE_BUILTIN = 1 << 2,
- GTK_ICON_LOOKUP_GENERIC_FALLBACK = 1 << 3,
- GTK_ICON_LOOKUP_FORCE_SIZE = 1 << 4,
- GTK_ICON_LOOKUP_FORCE_REGULAR = 1 << 5,
- GTK_ICON_LOOKUP_FORCE_SYMBOLIC = 1 << 6
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK = 1 << 2,
+ GTK_ICON_LOOKUP_FORCE_SIZE = 1 << 3,
+ GTK_ICON_LOOKUP_FORCE_REGULAR = 1 << 4,
+ GTK_ICON_LOOKUP_FORCE_SYMBOLIC = 1 << 5
} GtkIconLookupFlags;
/**
diff --git a/tests/testicontheme.c b/tests/testicontheme.c
index fe7c28f771..7ef888ccec 100644
--- a/tests/testicontheme.c
+++ b/tests/testicontheme.c
@@ -53,7 +53,7 @@ main (int argc, char *argv[])
return 1;
}
- flags = GTK_ICON_LOOKUP_USE_BUILTIN;
+ flags = 0;
if (g_getenv ("RTL"))
direction = GTK_TEXT_DIR_RTL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]