summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-theme.c
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2000-07-10 08:18:07 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2000-07-10 08:18:07 +0000
commit33d57594f3a725f95ce98c0a8aa04c1eb3f3d17a (patch)
tree7689e3ce6f6ce681dcce8898c90d65bfdbea01ad /libnautilus-private/nautilus-theme.c
parentd1a5df03f6826e94385f912f33d53b1e5a7cfbe2 (diff)
downloadnautilus-33d57594f3a725f95ce98c0a8aa04c1eb3f3d17a.tar.gz
improved the property browser. Added a line of descriptive text. Added a
improved the property browser. Added a line of descriptive text. Added a new "theme" section.
Diffstat (limited to 'libnautilus-private/nautilus-theme.c')
-rw-r--r--libnautilus-private/nautilus-theme.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-theme.c b/libnautilus-private/nautilus-theme.c
index 6be08825f..2857a7c8e 100644
--- a/libnautilus-private/nautilus-theme.c
+++ b/libnautilus-private/nautilus-theme.c
@@ -24,11 +24,17 @@
#include <config.h>
#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
#include <parser.h>
#include <xmlmemory.h>
+#include <gnome.h>
#include <libgnomevfs/gnome-vfs.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <librsvg/rsvg.h>
#include "nautilus-file.h"
#include "nautilus-file-utilities.h"
@@ -146,7 +152,6 @@ nautilus_theme_get_image_path (const char *image_name)
g_free (temp_str);
/* see if a theme-specific image exists; if so, return it */
-
if (g_file_exists (image_path))
return image_path;
@@ -163,3 +168,42 @@ nautilus_theme_get_image_path (const char *image_name)
g_free (image_path);
return NULL;
}
+
+/* create a pixbuf that represents the passed in theme name */
+/* this is a placeholder until we get Arlo's design */
+
+GdkPixbuf *
+nautilus_theme_make_selector (const char *theme_name)
+{
+ char *pixbuf_file, *temp_str ;
+ GdkPixbuf *pixbuf;
+
+ temp_str = g_strdup_printf ("%s/%s", theme_name, "i-directory.png");
+ pixbuf_file = nautilus_pixmap_file(temp_str);
+ g_free (temp_str);
+
+ if (!g_file_exists (pixbuf_file)) {
+ g_free (pixbuf_file);
+ temp_str = g_strdup_printf ("%s/%s", theme_name, "i-directory.svg");
+ pixbuf_file = nautilus_pixmap_file(temp_str);
+ g_free (temp_str);
+ if (!g_file_exists (pixbuf_file)) {
+ g_free (pixbuf_file);
+ pixbuf_file = nautilus_pixmap_file ("i-directory.png");
+ }
+ }
+
+ if (nautilus_str_has_suffix(pixbuf_file, ".svg")) {
+ FILE *f = fopen (pixbuf_file, "rb");
+ if (f != NULL) {
+ pixbuf = rsvg_render_file (f, 1.0);
+ fclose (f);
+ }
+
+ } else {
+ pixbuf = gdk_pixbuf_new_from_file (pixbuf_file);
+ }
+
+ g_free (pixbuf_file);
+ return pixbuf;
+}