r898: Applied Bernard Jungen's latest patch:
[rox-filer.git] / ROX-Filer / src / type.h
blob7cfc5e330df7757e2bff8b99bf2ce44ec393efbd
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,
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();
45 char *basetype_name(DirItem *item);
46 MIME_type *type_get_type(guchar *path);
48 MIME_type *type_from_path(char *path);
49 gboolean type_open(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);
57 #endif /* _TYPE_H */