Converted README to markdown
[rox-filer.git] / ROX-Filer / src / icon.h
blobfe67566b09360f657885fefd7f2afe4c2cb581b0
1 /*
2 * ROX-Filer, filer for the ROX desktop project
3 * By Thomas Leonard, <tal197@users.sourceforge.net>.
4 */
6 #ifndef _ICON_H
7 #define _ICON_H
9 #include <glib.h>
10 #include <X11/Xlib.h>
12 extern GList *icon_selection;
13 extern GtkWidget *icon_menu; /* The popup icon menu */
15 typedef struct _IconClass IconClass;
17 typedef struct {
18 KeyCode keycode;
19 int modifier;
20 } MyKey;
22 struct _IconClass {
23 GObjectClass parent;
25 gboolean (*same_group)(Icon *icon, Icon *other);
26 void (*destroy)(Icon *icon);
27 void (*redraw)(Icon *icon);
28 void (*update)(Icon *icon);
29 void (*wink)(Icon *icon);
31 /* Acts on selected items */
32 void (*remove_items)(void);
35 struct _Icon {
36 GObject object;
38 gboolean selected;
39 guchar *src_path; /* Eg: ~/Apps */
40 guchar *path; /* Eg: /home/fred/Apps */
41 DirItem *item;
42 gchar *shortcut; /* Eg: Control + x */
43 MyKey shortcut_key; /* Parsed version of shortcut */
44 gchar *args; /* Arguments, or NULL if none */
45 gboolean locked; /* TRUE if the icon can't be removed */
47 GtkWidget *dialog; /* Current rename box, if any */
50 GType icon_get_type(void);
51 gboolean icons_require(const gchar *path);
52 void icon_may_update(Icon *icon);
53 void icons_may_update(const gchar *path);
55 /* After options_item you may pass further MenuItems followed by NULL to
56 * terminate list */
57 void icon_prepare_menu(Icon *icon, GtkWidget *options_item, ...);
59 void icon_set_selected(Icon *icon, gboolean selected);
60 void icon_select_only(Icon *select);
61 void icon_set_path(Icon *icon, const char *pathname, const char *name);
62 gchar *icon_create_uri_list(void);
63 void icon_destroy(Icon *icon);
64 void icon_set_shortcut(Icon *icon, const gchar *shortcut);
65 void icon_set_arguments(Icon *icon, const gchar *args);
66 void icon_run(Icon *icon);
68 #endif /* _ICON_H */