1 | #ifndef APPLET_H |
---|
2 | #define APPLET_H |
---|
3 | |
---|
4 | #include <glib.h> |
---|
5 | #include <gdk/gdktypes.h> |
---|
6 | #include "panel-widget.h" |
---|
7 | #include "panel-gconf.h" |
---|
8 | |
---|
9 | G_BEGIN_DECLS |
---|
10 | |
---|
11 | typedef enum { |
---|
12 | APPLET_DRAWER, |
---|
13 | APPLET_MENU, |
---|
14 | APPLET_LAUNCHER, |
---|
15 | APPLET_STATUS, |
---|
16 | APPLET_BONOBO, |
---|
17 | APPLET_ACTION, |
---|
18 | APPLET_LOGOUT, /* FIXME: */ |
---|
19 | APPLET_LOCK, /* Both only for backwards compat */ |
---|
20 | |
---|
21 | } AppletType; |
---|
22 | |
---|
23 | #define APPLET_EVENT_MASK (GDK_BUTTON_PRESS_MASK | \ |
---|
24 | GDK_BUTTON_RELEASE_MASK | \ |
---|
25 | GDK_POINTER_MOTION_MASK | \ |
---|
26 | GDK_POINTER_MOTION_HINT_MASK) |
---|
27 | typedef struct { |
---|
28 | AppletType type; |
---|
29 | int applet_id; |
---|
30 | GtkWidget *widget; |
---|
31 | |
---|
32 | GtkWidget *menu; |
---|
33 | int menu_age; |
---|
34 | GList *user_menu; |
---|
35 | |
---|
36 | gpointer data; |
---|
37 | GDestroyNotify data_destroy; |
---|
38 | |
---|
39 | guint remove_idle; |
---|
40 | |
---|
41 | char *gconf_key; |
---|
42 | } AppletInfo; |
---|
43 | |
---|
44 | typedef struct { |
---|
45 | gchar *name; |
---|
46 | gchar *stock_item; |
---|
47 | gchar *text; |
---|
48 | |
---|
49 | gint sensitive; |
---|
50 | AppletInfo *info; |
---|
51 | |
---|
52 | GtkWidget *menuitem; |
---|
53 | GtkWidget *submenu; |
---|
54 | } AppletUserMenu; |
---|
55 | |
---|
56 | AppletInfo *panel_applet_register (GtkWidget *applet, |
---|
57 | gpointer data, |
---|
58 | GDestroyNotify data_destroy, |
---|
59 | PanelWidget *panel, |
---|
60 | gint pos, |
---|
61 | gboolean exactpos, |
---|
62 | AppletType type, |
---|
63 | const char *gconf_key); |
---|
64 | |
---|
65 | void panel_applet_clean (AppletInfo *info, |
---|
66 | gboolean clean_gconf); |
---|
67 | |
---|
68 | void panel_applet_clean_gconf (AppletType type, |
---|
69 | const char *gconf_key, |
---|
70 | gboolean clean_gconf); |
---|
71 | |
---|
72 | void panel_applet_add_callback (AppletInfo *info, |
---|
73 | const gchar *callback_name, |
---|
74 | const gchar *stock_item, |
---|
75 | const gchar *menuitem_text); |
---|
76 | |
---|
77 | void panel_applet_remove_callback (AppletInfo *info, |
---|
78 | const char *callback_name); |
---|
79 | |
---|
80 | void panel_applet_remove_in_idle (AppletInfo *info); |
---|
81 | |
---|
82 | AppletUserMenu *panel_applet_get_callback (GList *user_menu, |
---|
83 | const gchar *name); |
---|
84 | |
---|
85 | |
---|
86 | void panel_applet_load_applets_from_gconf (void); |
---|
87 | void panel_applet_save_to_gconf (AppletInfo *applet_info); |
---|
88 | void panel_applet_save_position (AppletInfo *applet_info, |
---|
89 | const char *gconf_key, |
---|
90 | gboolean immediate); |
---|
91 | |
---|
92 | void panel_applet_load_defaults_for_screen (PanelGConfKeyType type, |
---|
93 | const char *profile, |
---|
94 | int screen); |
---|
95 | |
---|
96 | int panel_applet_get_position (AppletInfo *applet); |
---|
97 | |
---|
98 | void panel_applet_menu_set_recurse (GtkMenu *menu, |
---|
99 | const gchar *key, |
---|
100 | gpointer data); |
---|
101 | |
---|
102 | G_END_DECLS |
---|
103 | |
---|
104 | #endif |
---|