r3768: Updated years.
[rox-filer.git] / ROX-Filer / src / pixmaps.h
blob0219ff2d34fa9c0f3513435b2f790b1cfe6c1cab
1 /*
2 * ROX-Filer, filer for the ROX desktop project
3 * By Thomas Leonard, <tal197@users.sourceforge.net>.
4 */
6 #ifndef _PIXMAP_H
7 #define _PIXMAP_H
9 #include <gtk/gtk.h>
11 extern GFSCache *pixmap_cache;
13 extern MaskedPixmap *im_error;
14 extern MaskedPixmap *im_unknown;
15 extern MaskedPixmap *im_symlink;
17 extern MaskedPixmap *im_unmounted;
18 extern MaskedPixmap *im_mounted;
19 extern MaskedPixmap *im_exec_file;
20 extern MaskedPixmap *im_appdir;
21 extern MaskedPixmap *im_xattr;
23 extern MaskedPixmap *im_dirs;
25 /* If making the huge size larger, be sure to update SMALL_IMAGE_THRESHOLD! */
26 #define HUGE_WIDTH 96
27 #define HUGE_HEIGHT 96
29 #define ICON_HEIGHT 52
30 #define ICON_WIDTH 48
32 #define SMALL_HEIGHT 18
33 #define SMALL_WIDTH 22
35 typedef struct _MaskedPixmapClass MaskedPixmapClass;
37 struct _MaskedPixmapClass {
38 GObjectClass parent;
41 /* When a MaskedPixmap is created we load the image from disk and
42 * scale the pixbuf down to the 'huge' size (if it's bigger).
43 * The 'normal' pixmap and mask are created automatically - you have
44 * to request the other sizes.
46 * Note that any of the masks be also be NULL if the image has no
47 * mask.
49 struct _MaskedPixmap
51 GObject object;
53 GdkPixbuf *src_pixbuf; /* Limited to 'huge' size */
55 /* If huge_pixbuf is NULL then call pixmap_make_huge() */
56 GdkPixbuf *huge_pixbuf;
57 GdkPixbuf *huge_pixbuf_lit;
58 int huge_width, huge_height;
60 GdkPixbuf *pixbuf; /* Normal size image, always valid */
61 GdkPixbuf *pixbuf_lit;
62 int width, height;
64 /* If sm_pixbuf is NULL then call pixmap_make_small() */
65 GdkPixbuf *sm_pixbuf;
66 GdkPixbuf *sm_pixbuf_lit;
67 int sm_width, sm_height;
70 void pixmaps_init(void);
71 void pixmap_make_huge(MaskedPixmap *mp);
72 void pixmap_make_small(MaskedPixmap *mp);
73 MaskedPixmap *load_pixmap(const char *name);
74 void pixmap_background_thumb(const gchar *path, GFunc callback, gpointer data);
75 MaskedPixmap *masked_pixmap_new(GdkPixbuf *full_size);
76 GdkPixbuf *scale_pixbuf(GdkPixbuf *src, int max_w, int max_h);
78 #endif /* _PIXMAP_H */