r1996: Cope slightly better with invalid filenames in various places (reported by
[rox-filer.git] / ROX-Filer / src / type.h
blob59c5e2f12522e1c78652bf762c4ff4b5026ca9e0
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 *inode_directory;
15 extern MIME_type *inode_pipe;
16 extern MIME_type *inode_socket;
17 extern MIME_type *inode_block_dev;
18 extern MIME_type *inode_char_dev;
19 extern MIME_type *application_executable;
20 extern MIME_type *inode_unknown;
21 extern MIME_type *inode_door;
23 enum
25 /* Base types - this also determines the sort order */
26 TYPE_ERROR,
27 TYPE_UNKNOWN, /* Not scanned yet */
28 TYPE_DIRECTORY,
29 TYPE_PIPE,
30 TYPE_SOCKET,
31 TYPE_FILE,
32 TYPE_CHAR_DEVICE,
33 TYPE_BLOCK_DEVICE,
34 TYPE_DOOR,
36 /* These are purely for colour allocation */
37 TYPE_EXEC,
38 TYPE_APPDIR,
41 struct _MIME_type
43 char *media_type;
44 char *subtype;
45 MaskedPixmap *image; /* NULL => not loaded yet */
46 time_t image_time; /* When we loaded the image */
49 /* Prototypes */
50 void type_init(void);
51 const char *basetype_name(DirItem *item);
52 MIME_type *type_get_type(const guchar *path);
54 MIME_type *type_from_path(const char *path);
55 gboolean type_open(const char *path, MIME_type *type);
56 MaskedPixmap *type_to_icon(MIME_type *type);
57 GdkAtom type_to_atom(MIME_type *type);
58 MIME_type *mime_type_from_base_type(int base_type);
59 int mode_to_base_type(int st_mode);
60 void type_set_handler_dialog(MIME_type *type);
61 gboolean can_set_run_action(DirItem *item);
62 gchar *describe_current_command(MIME_type *type);
63 GdkColor *type_get_colour(DirItem *item, GdkColor *normal);
64 void reread_mime_files(void);
66 #endif /* _TYPE_H */