summaryrefslogtreecommitdiff
path: root/src/nautilus-bookmark.c
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-02-01 05:34:46 +0000
committerDarin Adler <darin@src.gnome.org>2000-02-01 05:34:46 +0000
commit39b26449f4fcdf53f555e8d2ef03522e883c5c06 (patch)
tree9642f60f64a663609c8d7e981381b85ba305113d /src/nautilus-bookmark.c
parent9bef26f2d771ff19272596ecaf6c2b812cf62945 (diff)
downloadnautilus-39b26449f4fcdf53f555e8d2ef03522e883c5c06.tar.gz
Changed the icon factory interface in a few ways: 1) There's no longer a
* libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_new): (nautilus_icon_factory_destroy): (nautilus_get_current_icon_factory): (nautilus_icon_factory_get_icon_for_file): (nautilus_icon_factory_set_theme): (nautilus_icon_factory_get_icon_by_name): (nautilus_icon_factory_get_pixbuf_for_icon): (nautilus_scalable_icon_ref): (nautilus_scalable_icon_unref): (nautilus_scalable_icon_get_name): (scalable_icon_get): (icon_set_possibly_free): (scalable_icon_new): Changed the icon factory interface in a few ways: 1) There's no longer a NautilusIconFactory object. There's just a single global icon factory. If we find that we need multiple factories, we can implement that later. 2) Instead of going straight from a file to a pixbuf, you get a scalable icon, and then get a pixbuf from that. This allows you to choose the icon and then get different-sized versions of it without going through the icon selection process over and over again. There's also a name for each icon which can be stored in the metafile so you can get the same icon again before you have full information on a file. * src/nautilus-bookmark.c: (nautilus_bookmark_get_pixmap_and_mask): * src/file-manager/fm-directory-view-list.c: (install_icon): * src/file-manager/fm-icons-controller.c: (fm_icons_controller_get_icon_image): Changed icon factory clients to use the new interface. Maybe after a while I'll add a convenience function that's as simple as the old interface was for the common case where you want to go straight to the pixbuf, but lets try it this way for a while. * libnautilus/nautilus-string.h: * libnautilus/nautilus-string.c: (nautilus_has_prefix): Added nautilus_has_prefix. This checks to see if a string has a particular prefix. It's both clearer to read and more efficient than Andy's typical trick of calling strstr. * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-string.c: Added self-checks for nautilus-string.c. The tests uncovered a bug in nautilus_string_to_int that I fixed. * nautilus-glib-extensions.c: Just a stray new-line.
Diffstat (limited to 'src/nautilus-bookmark.c')
-rw-r--r--src/nautilus-bookmark.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nautilus-bookmark.c b/src/nautilus-bookmark.c
index 68e011332..8372f6e36 100644
--- a/src/nautilus-bookmark.c
+++ b/src/nautilus-bookmark.c
@@ -171,9 +171,9 @@ nautilus_bookmark_get_pixmap_and_mask (const NautilusBookmark *bookmark,
GdkPixmap **pixmap_return,
GdkBitmap **mask_return)
{
- GdkPixbuf *pixbuf;
NautilusFile *file;
-
+ NautilusScalableIcon *scalable_icon;
+ GdkPixbuf *pixbuf;
file = nautilus_file_get (nautilus_bookmark_get_uri (bookmark));
@@ -185,13 +185,13 @@ nautilus_bookmark_get_pixmap_and_mask (const NautilusBookmark *bookmark,
if (file == NULL)
return FALSE;
- pixbuf = nautilus_icon_factory_get_icon_for_file (
- nautilus_get_current_icon_factory(),
- file,
- icon_size);
-
+ scalable_icon = nautilus_icon_factory_get_icon_for_file (file);
nautilus_file_unref (file);
+ pixbuf = nautilus_icon_factory_get_pixbuf_for_icon
+ (scalable_icon, icon_size);
+ nautilus_scalable_icon_unref (scalable_icon);
+
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap_return, mask_return, 100);
gdk_pixbuf_unref (pixbuf);