r2525: Use stock icons in pinboard and panel menus.
[rox-filer.git] / ROX-Filer / src / type.h
blob9617718f7be8e72ca7fb4e55d82e0a27f129bda9
1 /*
2 * ROX-Filer, filer for the ROX desktop project
3 * By Thomas Leonard, <tal197@users.sourceforge.net>.
4 */
6 #ifndef _TYPE_H
7 #define _TYPE_H
9 #include <gtk/gtk.h>
11 extern MIME_type *text_plain; /* Often used as a default type */
12 extern MIME_type *inode_directory;
13 extern MIME_type *inode_pipe;
14 extern MIME_type *inode_socket;
15 extern MIME_type *inode_block_dev;
16 extern MIME_type *inode_char_dev;
17 extern MIME_type *application_executable;
18 extern MIME_type *inode_unknown;
19 extern MIME_type *inode_door;
21 enum
23 /* Base types - this also determines the sort order */
24 TYPE_ERROR,
25 TYPE_UNKNOWN, /* Not scanned yet */
26 TYPE_DIRECTORY,
27 TYPE_PIPE,
28 TYPE_SOCKET,
29 TYPE_FILE,
30 TYPE_CHAR_DEVICE,
31 TYPE_BLOCK_DEVICE,
32 TYPE_DOOR,
34 /* These are purely for colour allocation */
35 TYPE_EXEC,
36 TYPE_APPDIR,
39 struct _MIME_type
41 char *media_type;
42 char *subtype;
43 MaskedPixmap *image; /* NULL => not loaded yet */
44 time_t image_time; /* When we loaded the image */
46 /* Private: use mime_type_comment() instead */
47 char *comment; /* Name in local language */
50 /* Prototypes */
51 void type_init(void);
52 const char *basetype_name(DirItem *item);
53 MIME_type *type_get_type(const guchar *path);
55 MIME_type *type_from_path(const char *path);
56 gboolean type_open(const char *path, MIME_type *type);
57 MaskedPixmap *type_to_icon(MIME_type *type);
58 GdkAtom type_to_atom(MIME_type *type);
59 MIME_type *mime_type_from_base_type(int base_type);
60 int mode_to_base_type(int st_mode);
61 void type_set_handler_dialog(MIME_type *type);
62 gboolean can_set_run_action(DirItem *item);
63 gchar *describe_current_command(MIME_type *type);
64 GdkColor *type_get_colour(DirItem *item, GdkColor *normal);
65 void reread_mime_files(void);
66 extern const char *mime_type_comment(MIME_type *type);
68 #endif /* _TYPE_H */