r1322: Converted MaskedPixmap to GObject.
[rox-filer.git] / ROX-Filer / src / type.h
blob628ade04f7790c01f369497b2f026fcc5e38c834
1 /*
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@users.sourceforge.net>.
6 */
8 #ifndef _TYPE_H
9 #define _TYPE_H
11 #include <gtk/gtk.h>
13 extern MIME_type *text_plain; /* Often used as a default type */
14 extern MIME_type *special_directory;
15 extern MIME_type *special_pipe;
16 extern MIME_type *special_socket;
17 extern MIME_type *special_block_dev;
18 extern MIME_type *special_char_dev;
19 extern MIME_type *special_exec;
20 extern MIME_type *special_unknown;
22 enum
24 /* Base types - this also determines the sort order */
25 TYPE_ERROR,
26 TYPE_UNKNOWN, /* Not scanned yet */
27 TYPE_DIRECTORY,
28 TYPE_PIPE,
29 TYPE_SOCKET,
30 TYPE_FILE,
31 TYPE_CHAR_DEVICE,
32 TYPE_BLOCK_DEVICE,
35 struct _MIME_type
37 char *media_type;
38 char *subtype;
39 MaskedPixmap *image; /* NULL => not loaded yet */
40 time_t image_time; /* When we loaded the image */
43 /* Prototypes */
44 void type_init(void);
45 const char *basetype_name(DirItem *item);
46 MIME_type *type_get_type(const guchar *path);
48 MIME_type *type_from_path(const char *path);
49 gboolean type_open(const char *path, MIME_type *type);
50 MaskedPixmap *type_to_icon(MIME_type *type);
51 GdkAtom type_to_atom(MIME_type *type);
52 MIME_type *mime_type_from_base_type(int base_type);
53 int mode_to_base_type(int st_mode);
54 void type_set_handler_dialog(MIME_type *type);
55 gboolean can_set_run_action(DirItem *item);
56 gchar *describe_current_command(MIME_type *type);
57 GdkColor *type_get_colour(DirItem *item, GdkColor *normal);
59 #endif /* _TYPE_H */