[nautilus: 1/4] icon-info: add a method to fetch GIcons for user special dirs
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus: 1/4] icon-info: add a method to fetch GIcons for user special dirs
- Date: Wed, 25 Aug 2010 17:59:40 +0000 (UTC)
commit 1df83c6586560a8ae5efc96037e673e52b4b119b
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Aug 25 19:50:05 2010 +0200
icon-info: add a method to fetch GIcons for user special dirs
libnautilus-private/nautilus-icon-info.c | 27 +++++++++++++++++++++++++++
libnautilus-private/nautilus-icon-info.h | 2 ++
libnautilus-private/nautilus-icon-names.h | 9 +++++++++
3 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-icon-info.c b/libnautilus-private/nautilus-icon-info.c
index afe5c07..6aaf678 100644
--- a/libnautilus-private/nautilus-icon-info.c
+++ b/libnautilus-private/nautilus-icon-info.c
@@ -21,6 +21,7 @@
#include <config.h>
#include <string.h>
#include "nautilus-icon-info.h"
+#include "nautilus-icon-names.h"
#include "nautilus-default-file-icon.h"
#include <gtk/gtk.h>
#include <gio/gio.h>
@@ -716,3 +717,29 @@ nautilus_icon_theme_can_render (GThemedIcon *icon)
return FALSE;
}
+
+GIcon *
+nautilus_user_special_directory_get_gicon (GUserDirectory directory)
+{
+
+ #define ICON_CASE(x) \
+ case G_USER_DIRECTORY_ ## x:\
+ return g_themed_icon_new (NAUTILUS_ICON_FOLDER_ ## x);
+
+ switch (directory) {
+
+ ICON_CASE (DESKTOP);
+ ICON_CASE (DOCUMENTS);
+ ICON_CASE (DOWNLOAD);
+ ICON_CASE (MUSIC);
+ ICON_CASE (PICTURES);
+ ICON_CASE (PUBLIC_SHARE);
+ ICON_CASE (TEMPLATES);
+ ICON_CASE (VIDEOS);
+
+ default:
+ return g_themed_icon_new ("folder");
+ }
+
+ #undef ICON_CASE
+}
diff --git a/libnautilus-private/nautilus-icon-info.h b/libnautilus-private/nautilus-icon-info.h
index 95a5341..8e70381 100644
--- a/libnautilus-private/nautilus-icon-info.h
+++ b/libnautilus-private/nautilus-icon-info.h
@@ -88,6 +88,8 @@ gint nautilus_get_icon_size_for_stock_size (GtkIconSize size);
guint nautilus_icon_get_emblem_size_for_icon_size (guint size);
gboolean nautilus_icon_theme_can_render (GThemedIcon *icon);
+GIcon * nautilus_user_special_directory_get_gicon (GUserDirectory directory);
+
G_END_DECLS
diff --git a/libnautilus-private/nautilus-icon-names.h b/libnautilus-private/nautilus-icon-names.h
index 8b419ff..a899c78 100644
--- a/libnautilus-private/nautilus-icon-names.h
+++ b/libnautilus-private/nautilus-icon-names.h
@@ -15,6 +15,15 @@
#define NAUTILUS_ICON_TRASH_FULL "user-trash-full"
#define NAUTILUS_ICON_DELETE "edit-delete"
+#define NAUTILUS_ICON_FOLDER_DESKTOP "folder-documents"
+#define NAUTILUS_ICON_FOLDER_DOCUMENTS "folder-documents"
+#define NAUTILUS_ICON_FOLDER_DOWNLOAD "folder-download"
+#define NAUTILUS_ICON_FOLDER_MUSIC "folder-music"
+#define NAUTILUS_ICON_FOLDER_PICTURES "folder-pictures"
+#define NAUTILUS_ICON_FOLDER_PUBLIC_SHARE "folder-publicshare"
+#define NAUTILUS_ICON_FOLDER_TEMPLATES "folder-templates"
+#define NAUTILUS_ICON_FOLDER_VIDEOS "folder-videos"
+
/* Other icons */
#define NAUTILUS_ICON_TEMPLATE "text-x-generic-template"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]