Converted README to markdown
[rox-filer.git] / ROX-Filer / src / type.h
blob26a38f791bb8e66e19e44ebc8dd1d5a07e2b2e9d
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_mountpoint;
14 extern MIME_type *inode_pipe;
15 extern MIME_type *inode_socket;
16 extern MIME_type *inode_block_dev;
17 extern MIME_type *inode_char_dev;
18 extern MIME_type *application_executable;
19 extern MIME_type *inode_unknown;
20 extern MIME_type *inode_door;
21 extern MIME_type *application_octet_stream;
22 extern MIME_type *application_x_shellscript;
23 extern MIME_type *application_x_desktop;
25 struct _MIME_type
27 char *media_type;
28 char *subtype;
29 MaskedPixmap *image; /* NULL => not loaded yet */
30 time_t image_time; /* When we loaded the image */
32 /* Private: use mime_type_comment() instead */
33 char *comment; /* Name in local language */
34 gboolean executable; /* Subclass of application/x-executable */
37 /* Prototypes */
38 void type_init(void);
39 const char *basetype_name(DirItem *item);
40 MIME_type *type_get_type(const guchar *path);
42 MIME_type *type_from_path(const char *path);
43 MaskedPixmap *type_to_icon(MIME_type *type);
44 GdkAtom type_to_atom(MIME_type *type);
45 MIME_type *mime_type_from_base_type(int base_type);
46 int mode_to_base_type(int st_mode);
47 void type_set_handler_dialog(MIME_type *type);
48 gboolean can_set_run_action(DirItem *item);
49 gchar *describe_current_command(MIME_type *type);
50 GdkColor *type_get_colour(DirItem *item, GdkColor *normal);
51 void reread_mime_files(void);
52 extern const char *mime_type_comment(MIME_type *type);
53 extern MIME_type *mime_type_lookup(const char *type);
54 extern GList *mime_type_name_list(gboolean only_regular);
55 char *handler_for(MIME_type *type);
57 GtkIconInfo *theme_lookup_icon(const gchar *icon_name, gint size,
58 GtkIconLookupFlags flags);
59 GdkPixbuf *theme_load_icon(const gchar *icon_name, gint size,
60 GtkIconLookupFlags flags, GError **error);
62 #define EXECUTABLE_FILE(item) ((item)->mime_type && (item)->mime_type->executable && \
63 ((item)->flags & ITEM_FLAG_EXEC_FILE))
65 #endif /* _TYPE_H */