diff options
author | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2006-01-17 21:53:17 (GMT) |
---|---|---|
committer | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2006-01-17 21:53:17 (GMT) |
commit | c7bae2c213369b853bb420e5cf09d192f38f8cce (patch) | |
tree | 7dcbe628e1289f4297214ae3f1b71eed8409c5a9 /cut-n-paste/recent-files/egg-recent-util.c | |
parent | af71939e1812703087b8f9e4b39a3f79aa97f5a3 (diff) |
Update from libegg.
* cut-n-paste/recent-files/egg-recent-item.c:
(get_uri_shortname_for_display), (egg_recent_item_get_short_name):
* cut-n-paste/recent-files/egg-recent-model.c: (parse_info_init),
(parse_info_free), (valid_element), (start_element_handler),
(end_element_handler), (text_handler), (egg_recent_model_filter),
(egg_recent_model_monitor_cb), (egg_recent_model_poll_timeout),
(egg_recent_model_monitor), (egg_recent_model_read),
(egg_recent_model_open_file), (egg_recent_model_lock_file),
(egg_recent_model_unlock_file), (egg_recent_model_finalize),
(egg_recent_model_set_property), (egg_recent_model_class_init),
(egg_recent_model_init), (egg_recent_model_add_full),
(egg_recent_model_delete), (egg_recent_model_get_list),
(egg_recent_model_clear), (egg_recent_model_clear_mime_filter),
(egg_recent_model_set_filter_mime_types),
(egg_recent_model_clear_group_filter),
(egg_recent_model_set_filter_groups),
(egg_recent_model_clear_scheme_filter),
(egg_recent_model_set_filter_uri_schemes),
(egg_recent_model_remove_expired):
* cut-n-paste/recent-files/egg-recent-util.c:
(egg_recent_util_get_icon):
* cut-n-paste/recent-files/egg-recent-util.h:
* cut-n-paste/recent-files/egg-recent-view-uimanager.c:
(connect_proxy_cb), (egg_recent_view_uimanager_set_list),
(egg_recent_view_uimanager_set_empty_list), (model_changed_cb),
(egg_recent_view_uimanager_set_property),
(egg_recent_view_uimanager_get_property),
(egg_recent_view_uimanager_class_init),
(egg_recent_view_uimanager_init),
(egg_recent_view_uimanager_set_label_width),
(egg_recent_view_uimanager_get_label_width):
* cut-n-paste/recent-files/egg-recent-view-uimanager.h:
* cut-n-paste/toolbar-editor/egg-editable-toolbar.c:
* cut-n-paste/toolbar-editor/egg-editable-toolbar.h:
* cut-n-paste/toolbar-editor/egg-toolbar-editor.c:
* cut-n-paste/toolbar-editor/egg-toolbars-model.c:
* cut-n-paste/toolbar-editor/egg-toolbars-model.h:
Update from libegg.
Diffstat (limited to 'cut-n-paste/recent-files/egg-recent-util.c')
-rw-r--r-- | cut-n-paste/recent-files/egg-recent-util.c | 63 |
1 files changed, 8 insertions, 55 deletions
diff --git a/cut-n-paste/recent-files/egg-recent-util.c b/cut-n-paste/recent-files/egg-recent-util.c index bc15a06..4597f03 100644 --- a/cut-n-paste/recent-files/egg-recent-util.c +++ b/cut-n-paste/recent-files/egg-recent-util.c @@ -2,13 +2,12 @@ #include <stdio.h> #include <string.h> #include <gtk/gtk.h> -#include <time.h> -#include <unistd.h> -#include <sys/types.h> #ifndef USE_STABLE_LIBGNOMEUI -#include <libgnomeui/gnome-icon-theme.h> #include <libgnomeui/gnome-icon-lookup.h> #endif +#include <time.h> +#include <unistd.h> +#include <sys/types.h> #include <math.h> #include "egg-recent-util.h" @@ -57,72 +56,26 @@ egg_recent_util_escape_underlines (const gchar* text) return g_string_free (str, FALSE); } -#ifndef USE_STABLE_LIBGNOMEUI -static GdkPixbuf * -load_icon_file (char *filename, - guint nominal_size) -{ - GdkPixbuf *pixbuf, *scaled_pixbuf; - guint width, height; - - pixbuf = gdk_pixbuf_new_from_file_at_size (filename, nominal_size, nominal_size, NULL); - - if (pixbuf == NULL) { - return NULL; - } - - width = gdk_pixbuf_get_width (pixbuf); - height = gdk_pixbuf_get_height (pixbuf); - /* if the icon is larger than the nominal size, scale down */ - if (MAX (width, height) > nominal_size) { - if (width > height) { - height = height * nominal_size / width; - width = nominal_size; - } else { - width = width * nominal_size / height; - height = nominal_size; - } - scaled_pixbuf = gdk_pixbuf_scale_simple - (pixbuf, width, height, GDK_INTERP_BILINEAR); - g_object_unref (pixbuf); - pixbuf = scaled_pixbuf; - } - - return pixbuf; -} - GdkPixbuf * -egg_recent_util_get_icon (GnomeIconTheme *theme, const gchar *uri, +egg_recent_util_get_icon (GtkIconTheme *theme, const gchar *uri, const gchar *mime_type, int size) { +#ifndef USE_STABLE_LIBGNOMEUI gchar *icon; - gchar *filename; - const GnomeIconData *icon_data; GdkPixbuf *pixbuf; icon = gnome_icon_lookup (theme, NULL, uri, NULL, NULL, mime_type, 0, NULL); - g_return_val_if_fail (icon != NULL, NULL); - filename = gnome_icon_theme_lookup_icon (theme, icon, - size, - &icon_data, - NULL); + pixbuf = gtk_icon_theme_load_icon (theme, icon, size, 0, NULL); g_free (icon); - if (filename == NULL) { - return NULL; - } - - pixbuf = load_icon_file (filename, size); - g_free (filename); - - return pixbuf; +#endif + return NULL; } -#endif /* !USE_STABLE_LIBGNOMEUI */ gchar * egg_recent_util_get_unique_id (void) |