5
#ifndef USE_STABLE_LIBGNOMEUI
6
#include <libgnomeui/gnome-icon-lookup.h>
7
10
#include <sys/types.h>
8
#ifndef USE_STABLE_LIBGNOMEUI
9
#include <libgnomeui/gnome-icon-theme.h>
10
#include <libgnomeui/gnome-icon-lookup.h>
13
12
#include "egg-recent-util.h"
57
56
return g_string_free (str, FALSE);
60
#ifndef USE_STABLE_LIBGNOMEUI
62
load_icon_file (char *filename,
65
GdkPixbuf *pixbuf, *scaled_pixbuf;
68
pixbuf = gdk_pixbuf_new_from_file_at_size (filename, nominal_size, nominal_size, NULL);
74
width = gdk_pixbuf_get_width (pixbuf);
75
height = gdk_pixbuf_get_height (pixbuf);
76
/* if the icon is larger than the nominal size, scale down */
77
if (MAX (width, height) > nominal_size) {
79
height = height * nominal_size / width;
82
width = width * nominal_size / height;
83
height = nominal_size;
85
scaled_pixbuf = gdk_pixbuf_scale_simple
86
(pixbuf, width, height, GDK_INTERP_BILINEAR);
87
g_object_unref (pixbuf);
88
pixbuf = scaled_pixbuf;
95
egg_recent_util_get_icon (GnomeIconTheme *theme, const gchar *uri,
60
egg_recent_util_get_icon (GtkIconTheme *theme, const gchar *uri,
96
61
const gchar *mime_type, int size)
63
#ifndef USE_STABLE_LIBGNOMEUI
100
const GnomeIconData *icon_data;
101
65
GdkPixbuf *pixbuf;
103
67
icon = gnome_icon_lookup (theme, NULL, uri, NULL, NULL,
104
68
mime_type, 0, NULL);
107
70
g_return_val_if_fail (icon != NULL, NULL);
109
filename = gnome_icon_theme_lookup_icon (theme, icon,
72
pixbuf = gtk_icon_theme_load_icon (theme, icon, size, 0, NULL);
115
if (filename == NULL) {
119
pixbuf = load_icon_file (filename, size);
125
#endif /* !USE_STABLE_LIBGNOMEUI */
128
81
egg_recent_util_get_unique_id (void)