r1859: New 'Class' parameter to Filer_OpenDir SOAP method allows setting the
[rox-filer.git] / ROX-Filer / src / pixmaps.h
blobae13d4072607886be16189246f63411de0cbd182
1 /*
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@users.sourceforge.net>.
6 */
8 #ifndef _PIXMAP_H
9 #define _PIXMAP_H
11 #include <gtk/gtk.h>
13 extern GFSCache *pixmap_cache;
15 extern MaskedPixmap *im_error;
16 extern MaskedPixmap *im_unknown;
17 extern MaskedPixmap *im_symlink;
19 extern MaskedPixmap *im_unmounted;
20 extern MaskedPixmap *im_mounted;
21 extern MaskedPixmap *im_exec_file;
22 extern MaskedPixmap *im_appdir;
24 extern MaskedPixmap *im_dirs;
26 /* Note: don't change these two - thumbnails saving assumes 96x96 */
27 /* If making the huge size larger, be sure to update SMALL_IMAGE_THRESHOLD! */
28 #define HUGE_WIDTH 96
29 #define HUGE_HEIGHT 96
31 #define ICON_HEIGHT 48
32 #define ICON_WIDTH 48
34 #define SMALL_HEIGHT 18
35 #define SMALL_WIDTH 22
37 typedef struct _MaskedPixmapClass MaskedPixmapClass;
39 struct _MaskedPixmapClass {
40 GObjectClass parent;
43 /* When a MaskedPixmap is created we load the image from disk and
44 * scale the pixbuf down to the 'huge' size (if it's bigger).
45 * The 'normal' pixmap and mask are created automatically - you have
46 * to request the other sizes.
48 * Note that any of the masks be also be NULL if the image has no
49 * mask.
51 struct _MaskedPixmap
53 GObject object;
55 GdkPixbuf *src_pixbuf; /* Limited to 'huge' size */
57 /* If huge_pixbuf is NULL then call pixmap_make_huge() */
58 GdkPixbuf *huge_pixbuf;
59 GdkPixbuf *huge_pixbuf_lit;
60 int huge_width, huge_height;
62 GdkPixbuf *pixbuf; /* Normal size image, always valid */
63 GdkPixbuf *pixbuf_lit;
64 int width, height;
66 /* If sm_pixbuf is NULL then call pixmap_make_small() */
67 GdkPixbuf *sm_pixbuf;
68 GdkPixbuf *sm_pixbuf_lit;
69 int sm_width, sm_height;
72 void pixmaps_init(void);
73 void pixmap_make_huge(MaskedPixmap *mp);
74 void pixmap_make_small(MaskedPixmap *mp);
75 MaskedPixmap *load_pixmap(const char *name);
76 void pixmap_background_thumb(const gchar *path, GFunc callback, gpointer data);
77 MaskedPixmap *masked_pixmap_new(GdkPixbuf *full_size);
79 #endif /* _PIXMAP_H */