r4567: Get ATK headers through Zero Install.
[rox-filer/translations.git] / ROX-Filer / src / type.h
blobc8d9da819d300dbcdea34cfffd9faec56deddbfb
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 extern GtkIconTheme *icon_theme;
27 struct _MIME_type
29 char *media_type;
30 char *subtype;
31 MaskedPixmap *image; /* NULL => not loaded yet */
32 time_t image_time; /* When we loaded the image */
34 /* Private: use mime_type_comment() instead */
35 char *comment; /* Name in local language */
36 gboolean executable; /* Subclass of application/x-executable */
39 /* Prototypes */
40 void type_init(void);
41 const char *basetype_name(DirItem *item);
42 MIME_type *type_get_type(const guchar *path);
44 MIME_type *type_from_path(const char *path);
45 MaskedPixmap *type_to_icon(MIME_type *type);
46 GdkAtom type_to_atom(MIME_type *type);
47 MIME_type *mime_type_from_base_type(int base_type);
48 int mode_to_base_type(int st_mode);
49 void type_set_handler_dialog(MIME_type *type);
50 gboolean can_set_run_action(DirItem *item);
51 gchar *describe_current_command(MIME_type *type);
52 GdkColor *type_get_colour(DirItem *item, GdkColor *normal);
53 void reread_mime_files(void);
54 extern const char *mime_type_comment(MIME_type *type);
55 extern MIME_type *mime_type_lookup(const char *type);
56 extern GList *mime_type_name_list(void);
57 char *handler_for(MIME_type *type);
59 #define EXECUTABLE_FILE(item) ((item)->mime_type && (item)->mime_type->executable && \
60 ((item)->flags & ITEM_FLAG_EXEC_FILE))
62 #endif /* _TYPE_H */