summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcaja-private/caja-icon-info.c21
-rw-r--r--libcaja-private/caja-icon-info.h2
2 files changed, 23 insertions, 0 deletions
diff --git a/libcaja-private/caja-icon-info.c b/libcaja-private/caja-icon-info.c
index e504a557..7873ebfa 100644
--- a/libcaja-private/caja-icon-info.c
+++ b/libcaja-private/caja-icon-info.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* caja-icon-info.c
* Copyright (C) 2007 Red Hat, Inc., Alexander Larsson <[email protected]>
*
@@ -757,3 +758,23 @@ caja_icon_get_emblem_size_for_icon_size (guint size)
return 0; /* no emblems for smaller sizes */
}
+
+gboolean
+caja_icon_theme_can_render (GThemedIcon *icon)
+{
+ GtkIconTheme *icon_theme;
+ const gchar * const *names;
+ gint idx;
+
+ names = g_themed_icon_get_names (icon);
+
+ icon_theme = gtk_icon_theme_get_default ();
+
+ for (idx = 0; names[idx] != NULL; idx++) {
+ if (gtk_icon_theme_has_icon (icon_theme, names[idx])) {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
diff --git a/libcaja-private/caja-icon-info.h b/libcaja-private/caja-icon-info.h
index 7c2a75d2..d2bbc926 100644
--- a/libcaja-private/caja-icon-info.h
+++ b/libcaja-private/caja-icon-info.h
@@ -90,6 +90,8 @@ extern "C" {
gint caja_get_icon_size_for_stock_size (GtkIconSize size);
guint caja_icon_get_emblem_size_for_icon_size (guint size);
+gboolean caja_icon_theme_can_render (GThemedIcon *icon);
+
#ifdef __cplusplus
}