[gtk+] Add gtk_recent_info_get_gicon()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add gtk_recent_info_get_gicon()
- Date: Fri, 22 Oct 2010 11:09:33 +0000 (UTC)
commit b0fe3e49bbf788c9dd81d8c2f236666cc78d972d
Author: Christian Persch <chpe gnome org>
Date: Thu Apr 29 15:21:23 2010 +0200
Add gtk_recent_info_get_gicon()
https://bugzilla.gnome.org/show_bug.cgi?id=617174
docs/reference/gtk/gtk3-sections.txt | 1 +
gtk/gtk.symbols | 1 +
gtk/gtkrecentmanager.c | 29 +++++++++++++++++++++++++++++
gtk/gtkrecentmanager.h | 1 +
4 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index fc73186..f0ba03b 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -2625,6 +2625,7 @@ gtk_recent_info_create_app_info
gtk_recent_info_get_groups
gtk_recent_info_has_group
gtk_recent_info_get_icon
+gtk_recent_info_get_gicon
gtk_recent_info_get_short_name
gtk_recent_info_get_uri_display
gtk_recent_info_get_age
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index b968d7a..8020851 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -2797,6 +2797,7 @@ gtk_recent_info_create_app_info
gtk_recent_info_get_groups G_GNUC_MALLOC
gtk_recent_info_has_group
gtk_recent_info_get_icon
+gtk_recent_info_get_gicon
gtk_recent_info_get_short_name G_GNUC_MALLOC
gtk_recent_info_get_uri_display G_GNUC_MALLOC
gtk_recent_info_get_age
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index 3bc08c4..9730172 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -1927,6 +1927,35 @@ gtk_recent_info_get_icon (GtkRecentInfo *info,
}
/**
+ * gtk_recent_info_get_gicon:
+ * @info: a #GtkRecentInfo
+ *
+ * Retrieves the icon associated to the resource MIME type.
+ *
+ * Return value: a #GIcon containing the icon, or %NULL. Use
+ * g_object_unref() when finished using the icon
+ *
+ * Since: 2.22
+ */
+GIcon *
+gtk_recent_info_get_gicon (GtkRecentInfo *info)
+{
+ GIcon *icon = NULL;
+ gchar *content_type;
+
+ g_return_val_if_fail (info != NULL, NULL);
+
+ if (info->mime_type != NULL &&
+ (content_type = g_content_type_from_mime_type (info->mime_type)) != NULL)
+ {
+ icon = g_content_type_get_icon (content_type);
+ g_free (content_type);
+ }
+
+ return icon;
+}
+
+/**
* gtk_recent_info_is_local:
* @info: a #GtkRecentInfo
*
diff --git a/gtk/gtkrecentmanager.h b/gtk/gtkrecentmanager.h
index df5ce0e..9fdb942 100644
--- a/gtk/gtkrecentmanager.h
+++ b/gtk/gtkrecentmanager.h
@@ -218,6 +218,7 @@ gboolean gtk_recent_info_has_group (GtkRecentInfo *info
const gchar *group_name);
GdkPixbuf * gtk_recent_info_get_icon (GtkRecentInfo *info,
gint size);
+GIcon * gtk_recent_info_get_gicon (GtkRecentInfo *info);
gchar * gtk_recent_info_get_short_name (GtkRecentInfo *info) G_GNUC_MALLOC;
gchar * gtk_recent_info_get_uri_display (GtkRecentInfo *info) G_GNUC_MALLOC;
gint gtk_recent_info_get_age (GtkRecentInfo *info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]