[gtk+/icontheme: 4/6] Drop the builtin icon cache
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/icontheme: 4/6] Drop the builtin icon cache
- Date: Wed, 18 Jun 2014 02:43:18 +0000 (UTC)
commit 03637e7dd403ae522682022e4bb9fbc636e31436
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jun 17 22:06:08 2014 -0400
Drop the builtin icon cache
We don't need it anymore, now that the non-standard stock icons
are using resources.
gtk/Makefile.am | 60 -
gtk/deprecated/gtkiconfactory.c | 19 +-
gtk/gtkicontheme.c | 72 +-
gtk/gtkicontheme.h | 3 -
gtk/stock-icons/16/gtk-caps-lock-warning.png | Bin 275 -> 0 bytes
gtk/stock-icons/16/gtk-color-picker.png | Bin 606 -> 0 bytes
gtk/stock-icons/16/gtk-color-picker.svg | 233 ---
gtk/stock-icons/16/gtk-connect.png | Bin 692 -> 0 bytes
gtk/stock-icons/16/gtk-connect.svg | 378 -----
gtk/stock-icons/16/gtk-convert.png | Bin 677 -> 0 bytes
gtk/stock-icons/16/gtk-convert.svg | 133 --
gtk/stock-icons/16/gtk-disconnect.png | Bin 715 -> 0 bytes
gtk/stock-icons/16/gtk-disconnect.svg | 512 ------
gtk/stock-icons/16/gtk-edit.png | Bin 755 -> 0 bytes
gtk/stock-icons/16/gtk-edit.svg | 295 ----
gtk/stock-icons/16/gtk-font.png | Bin 706 -> 0 bytes
gtk/stock-icons/16/gtk-font.svg | 125 --
gtk/stock-icons/16/gtk-index.png | Bin 753 -> 0 bytes
gtk/stock-icons/16/gtk-index.svg | 365 -----
gtk/stock-icons/16/gtk-orientation-landscape.png | Bin 756 -> 0 bytes
gtk/stock-icons/16/gtk-orientation-landscape.svg | 282 ----
gtk/stock-icons/16/gtk-orientation-portrait.png | Bin 543 -> 0 bytes
gtk/stock-icons/16/gtk-orientation-portrait.svg | 211 ---
.../16/gtk-orientation-reverse-landscape.png | Bin 751 -> 0 bytes
.../16/gtk-orientation-reverse-landscape.svg | 282 ----
.../16/gtk-orientation-reverse-portrait.png | Bin 557 -> 0 bytes
.../16/gtk-orientation-reverse-portrait.svg | 211 ---
gtk/stock-icons/16/gtk-page-setup.png | Bin 622 -> 0 bytes
gtk/stock-icons/16/gtk-preferences.png | Bin 1014 -> 0 bytes
gtk/stock-icons/16/gtk-preferences.svg | 288 ----
gtk/stock-icons/16/gtk-select-color.png | Bin 735 -> 0 bytes
gtk/stock-icons/16/gtk-select-color.svg | 1275 ---------------
gtk/stock-icons/16/gtk-select-font.png | Bin 706 -> 0 bytes
gtk/stock-icons/16/gtk-undelete-ltr.png | Bin 962 -> 0 bytes
gtk/stock-icons/16/gtk-undelete-ltr.svg | 665 --------
gtk/stock-icons/16/gtk-undelete-rtl.png | Bin 952 -> 0 bytes
gtk/stock-icons/16/gtk-undelete-rtl.svg | 558 -------
gtk/stock-icons/20/gtk-apply.png | Bin 1002 -> 0 bytes
gtk/stock-icons/20/gtk-apply.svg | 1444 -----------------
gtk/stock-icons/20/gtk-cancel.png | Bin 1067 -> 0 bytes
gtk/stock-icons/20/gtk-cancel.svg | 1431 -----------------
gtk/stock-icons/20/gtk-no.png | Bin 952 -> 0 bytes
gtk/stock-icons/20/gtk-ok.png | Bin 963 -> 0 bytes
gtk/stock-icons/20/gtk-ok.svg | 1676 --------------------
gtk/stock-icons/20/gtk-yes.png | Bin 1044 -> 0 bytes
gtk/stock-icons/24/gtk-caps-lock-warning.png | Bin 360 -> 0 bytes
gtk/stock-icons/24/gtk-color-picker.png | Bin 891 -> 0 bytes
gtk/stock-icons/24/gtk-color-picker.svg | 243 ---
gtk/stock-icons/24/gtk-connect.png | Bin 946 -> 0 bytes
gtk/stock-icons/24/gtk-connect.svg | 331 ----
gtk/stock-icons/24/gtk-convert.png | Bin 1413 -> 0 bytes
gtk/stock-icons/24/gtk-convert.svg | 172 --
gtk/stock-icons/24/gtk-copy.xcf.bz2 | Bin 4275 -> 0 bytes
gtk/stock-icons/24/gtk-cut.xcf.bz2 | Bin 2928 -> 0 bytes
gtk/stock-icons/24/gtk-disconnect.png | Bin 852 -> 0 bytes
gtk/stock-icons/24/gtk-disconnect.svg | 396 -----
gtk/stock-icons/24/gtk-edit.png | Bin 1120 -> 0 bytes
gtk/stock-icons/24/gtk-edit.svg | 466 ------
gtk/stock-icons/24/gtk-font.png | Bin 1109 -> 0 bytes
gtk/stock-icons/24/gtk-font.svg | 158 --
gtk/stock-icons/24/gtk-index.png | Bin 960 -> 0 bytes
gtk/stock-icons/24/gtk-index.svg | 724 ---------
gtk/stock-icons/24/gtk-orientation-landscape.png | Bin 1097 -> 0 bytes
gtk/stock-icons/24/gtk-orientation-landscape.svg | 304 ----
gtk/stock-icons/24/gtk-orientation-portrait.png | Bin 931 -> 0 bytes
gtk/stock-icons/24/gtk-orientation-portrait.svg | 232 ---
.../24/gtk-orientation-reverse-landscape.png | Bin 1059 -> 0 bytes
.../24/gtk-orientation-reverse-landscape.svg | 304 ----
.../24/gtk-orientation-reverse-portrait.png | Bin 940 -> 0 bytes
.../24/gtk-orientation-reverse-portrait.svg | 232 ---
gtk/stock-icons/24/gtk-page-setup.png | Bin 1081 -> 0 bytes
gtk/stock-icons/24/gtk-paste.xcf.bz2 | Bin 2590 -> 0 bytes
gtk/stock-icons/24/gtk-preferences.png | Bin 1691 -> 0 bytes
gtk/stock-icons/24/gtk-preferences.svg | 323 ----
gtk/stock-icons/24/gtk-select-color.png | Bin 993 -> 0 bytes
gtk/stock-icons/24/gtk-select-color.svg | 420 -----
gtk/stock-icons/24/gtk-select-font.png | Bin 1109 -> 0 bytes
gtk/stock-icons/24/gtk-undelete-ltr.png | Bin 1692 -> 0 bytes
gtk/stock-icons/24/gtk-undelete-ltr.svg | 791 ---------
gtk/stock-icons/24/gtk-undelete-rtl.png | Bin 1722 -> 0 bytes
gtk/stock-icons/24/gtk-undelete-rtl.svg | 791 ---------
gtk/stock-icons/32/gtk-dnd-multiple.png | Bin 1215 -> 0 bytes
gtk/stock-icons/32/gtk-dnd-multiple.svg | 559 -------
gtk/stock-icons/32/gtk-dnd.png | Bin 1349 -> 0 bytes
gtk/stock-icons/32/gtk-dnd.svg | 407 -----
85 files changed, 6 insertions(+), 17365 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 36ff71a..a6dd579 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1243,7 +1243,6 @@ gtk_built_public_sources = \
gtk_built_private_headers = \
gtkresources.h \
gtkmarshalers.h \
- gtkbuiltincache.h \
gtkprivatetypebuiltins.h
gtk_built_sources = \
@@ -1287,7 +1286,6 @@ DISTCLEANFILES =
EXTRA_HEADERS =
EXTRA_DIST += $(gtk_all_private_h_sources) $(gtk_extra_sources)
EXTRA_DIST += $(gtk_built_sources)
-EXTRA_DIST += $(STOCK_ICONS)
pkgdatadir=$(datadir)/gtk-$(GTK_API_VERSION)
@@ -1678,51 +1676,6 @@ files:
echo $$p; \
done
-STOCK_ICONS = \
- stock-icons/16/gtk-connect.png \
- stock-icons/16/gtk-convert.png \
- stock-icons/16/gtk-disconnect.png \
- stock-icons/16/gtk-edit.png \
- stock-icons/16/gtk-caps-lock-warning.png \
- stock-icons/16/gtk-color-picker.png \
- stock-icons/16/gtk-index.png \
- stock-icons/16/gtk-orientation-landscape.png \
- stock-icons/16/gtk-orientation-portrait.png \
- stock-icons/16/gtk-orientation-reverse-landscape.png \
- stock-icons/16/gtk-orientation-reverse-portrait.png \
- stock-icons/16/gtk-page-setup.png \
- stock-icons/16/gtk-preferences.png \
- stock-icons/16/gtk-select-color.png \
- stock-icons/16/gtk-select-font.png \
- stock-icons/16/gtk-font.png \
- stock-icons/16/gtk-undelete-ltr.png \
- stock-icons/16/gtk-undelete-rtl.png \
- stock-icons/20/gtk-apply.png \
- stock-icons/20/gtk-cancel.png \
- stock-icons/20/gtk-no.png \
- stock-icons/20/gtk-ok.png \
- stock-icons/20/gtk-yes.png \
- stock-icons/24/gtk-caps-lock-warning.png \
- stock-icons/24/gtk-color-picker.png \
- stock-icons/24/gtk-connect.png \
- stock-icons/24/gtk-convert.png \
- stock-icons/24/gtk-disconnect.png \
- stock-icons/24/gtk-edit.png \
- stock-icons/24/gtk-font.png \
- stock-icons/24/gtk-index.png \
- stock-icons/24/gtk-orientation-reverse-landscape.png \
- stock-icons/24/gtk-orientation-landscape.png \
- stock-icons/24/gtk-orientation-reverse-portrait.png \
- stock-icons/24/gtk-orientation-portrait.png \
- stock-icons/24/gtk-page-setup.png \
- stock-icons/24/gtk-preferences.png \
- stock-icons/24/gtk-select-font.png \
- stock-icons/24/gtk-select-color.png \
- stock-icons/24/gtk-undelete-ltr.png \
- stock-icons/24/gtk-undelete-rtl.png \
- stock-icons/32/gtk-dnd-multiple.png \
- stock-icons/32/gtk-dnd.png
-
if USE_EXTERNAL_ICON_CACHE
gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE)
else
@@ -1733,18 +1686,6 @@ gtk_update_icon_cache_program = ./gtk-update-icon-cache$(EXEEXT)
endif
endif
-gtkbuiltincache.h:
-if !USE_EXTERNAL_ICON_CACHE
-if CROSS_COMPILING
- $(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) -C native/
-else
- $(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
-endif
-endif
- $(AM_V_GEN) $(gtk_update_icon_cache_program) --quiet --force --ignore-theme-index
--include-image-data \
- --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
- mv gtkbuiltincache.h.tmp gtkbuiltincache.h
-
gsettings_SCHEMAS = \
org.gtk.Settings.FileChooser.gschema.xml \
org.gtk.Settings.ColorChooser.gschema.xml \
@@ -1755,7 +1696,6 @@ gsettings_SCHEMAS = \
EXTRA_DIST += \
$(resource_files) \
$(adwaita_sources) \
- $(STOCK_ICONS) \
$(gsettings_SCHEMAS) \
gtk-win32.rc \
gtk-win32.rc.in \
diff --git a/gtk/deprecated/gtkiconfactory.c b/gtk/deprecated/gtkiconfactory.c
index ce0ce92..780604a 100644
--- a/gtk/deprecated/gtkiconfactory.c
+++ b/gtk/deprecated/gtkiconfactory.c
@@ -1579,8 +1579,6 @@ find_and_render_icon_source (GtkIconSet *icon_set,
return pixbuf;
}
-extern GtkIconCache *_builtin_cache;
-
static GdkPixbuf*
render_fallback_image (GtkStyleContext *context,
GtkTextDirection direction,
@@ -1592,21 +1590,12 @@ render_fallback_image (GtkStyleContext *context,
if (fallback_source.type == GTK_ICON_SOURCE_EMPTY)
{
- gint index;
- GdkPixbuf *pixbuf;
-
- _gtk_icon_theme_ensure_builtin_cache ();
-
- index = _gtk_icon_cache_get_directory_index (_builtin_cache, "24");
- pixbuf = _gtk_icon_cache_get_icon (_builtin_cache, "image-missing", index);
-
- g_return_val_if_fail(pixbuf != NULL, NULL);
-
- gtk_icon_source_set_pixbuf (&fallback_source, pixbuf);
- g_object_unref (pixbuf);
+ fallback_source.type = GTK_ICON_SOURCE_STATIC_ICON_NAME;
+ fallback_source.source.icon_name = (gchar *)"image-missing";
+ fallback_source.direction = GTK_TEXT_DIR_NONE;
}
- return gtk_render_icon_pixbuf (context, &fallback_source, size);
+ return render_icon_name_pixbuf (&fallback_source, context, size, 1);
}
static GdkPixbuf*
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 8b6dca3..a3f27d4 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -41,7 +41,6 @@
#include "gtkdebug.h"
#include "deprecated/gtkiconfactory.h"
#include "gtkiconcache.h"
-#include "gtkbuiltincache.h"
#include "gtkintl.h"
#include "gtkmain.h"
#include "deprecated/gtknumerableiconprivate.h"
@@ -380,10 +379,6 @@ static guint signal_changed = 0;
static GHashTable *icon_theme_builtin_icons;
-/* also used in gtkiconfactory.c */
-GtkIconCache *_builtin_cache = NULL;
-static GList *builtin_dirs = NULL;
-
static guint
icon_info_key_hash (gconstpointer _key)
{
@@ -1368,38 +1363,6 @@ load_themes (GtkIconTheme *icon_theme)
});
}
-void
-_gtk_icon_theme_ensure_builtin_cache (void)
-{
- static gboolean initialized = FALSE;
- IconThemeDir *dir;
- static IconThemeDir dirs[5] =
- {
- { ICON_THEME_DIR_THRESHOLD, 0, 16, 16, 16, 2, 1, NULL, "16", -1, NULL, NULL, NULL },
- { ICON_THEME_DIR_THRESHOLD, 0, 20, 20, 20, 2, 1, NULL, "20", -1, NULL, NULL, NULL },
- { ICON_THEME_DIR_THRESHOLD, 0, 24, 24, 24, 2, 1, NULL, "24", -1, NULL, NULL, NULL },
- { ICON_THEME_DIR_THRESHOLD, 0, 32, 32, 32, 2, 1, NULL, "32", -1, NULL, NULL, NULL },
- { ICON_THEME_DIR_THRESHOLD, 0, 48, 48, 48, 2, 1, NULL, "48", -1, NULL, NULL, NULL }
- };
- gint i;
-
- if (!initialized)
- {
- initialized = TRUE;
-
- _builtin_cache = _gtk_icon_cache_new ((gchar *)builtin_icons);
-
- for (i = 0; i < G_N_ELEMENTS (dirs); i++)
- {
- dir = &(dirs[i]);
- dir->cache = _gtk_icon_cache_ref (_builtin_cache);
- dir->subdir_index = _gtk_icon_cache_get_directory_index (dir->cache, dir->subdir);
-
- builtin_dirs = g_list_append (builtin_dirs, dir);
- }
- }
-}
-
static void
ensure_valid_themes (GtkIconTheme *icon_theme)
{
@@ -1411,8 +1374,6 @@ ensure_valid_themes (GtkIconTheme *icon_theme)
return;
priv->loading_themes = TRUE;
- _gtk_icon_theme_ensure_builtin_cache ();
-
if (priv->themes_valid)
{
g_get_current_time (&tv);
@@ -2387,10 +2348,6 @@ gtk_icon_theme_has_icon (GtkIconTheme *icon_theme,
icon_name, NULL, NULL))
return TRUE;
- if (_builtin_cache &&
- _gtk_icon_cache_has_icon (_builtin_cache, icon_name))
- return TRUE;
-
if (icon_theme_builtin_icons &&
g_hash_table_lookup_extended (icon_theme_builtin_icons,
icon_name, NULL, NULL))
@@ -2467,23 +2424,6 @@ gtk_icon_theme_get_icon_sizes (GtkIconTheme *icon_theme,
}
}
- for (d = builtin_dirs; d; d = d->next)
- {
- IconThemeDir *dir = d->data;
-
- if (dir->type != ICON_THEME_DIR_SCALABLE && g_hash_table_lookup_extended (sizes, GINT_TO_POINTER
(dir->size), NULL, NULL))
- continue;
-
- suffix = theme_dir_get_icon_suffix (dir, icon_name, NULL);
- if (suffix != ICON_SUFFIX_NONE)
- {
- if (suffix == ICON_SUFFIX_SVG)
- g_hash_table_insert (sizes, GINT_TO_POINTER (-1), NULL);
- else
- g_hash_table_insert (sizes, GINT_TO_POINTER (dir->size), NULL);
- }
- }
-
if (icon_theme_builtin_icons)
{
icons = g_hash_table_lookup (icon_theme_builtin_icons, icon_name);
@@ -2978,11 +2918,9 @@ theme_lookup_icon (IconTheme *theme,
if (min_difference == 0)
return icon_info_new_builtin (closest_builtin);
-
- dirs = builtin_dirs;
}
- else
- dirs = theme->dirs;
+
+ dirs = theme->dirs;
l = dirs;
while (l != NULL)
@@ -3006,12 +2944,6 @@ theme_lookup_icon (IconTheme *theme,
}
l = l->next;
-
- if (l == NULL && dirs == builtin_dirs)
- {
- dirs = theme->dirs;
- l = dirs;
- }
}
if (min_dir)
diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h
index 662545b..39bdd74 100644
--- a/gtk/gtkicontheme.h
+++ b/gtk/gtkicontheme.h
@@ -366,9 +366,6 @@ gboolean gtk_icon_info_get_attach_points (GtkIconInfo *icon_info
GDK_AVAILABLE_IN_ALL
const gchar * gtk_icon_info_get_display_name (GtkIconInfo *icon_info);
-/* Non-public methods */
-void _gtk_icon_theme_ensure_builtin_cache (void);
-
G_END_DECLS
#endif /* __GTK_ICON_THEME_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]