1 | #ifndef APPLET_H |
---|
2 | #define APPLET_H |
---|
3 | |
---|
4 | #include <glib.h> |
---|
5 | #include "panel-widget.h" |
---|
6 | |
---|
7 | BEGIN_GNOME_DECLS |
---|
8 | |
---|
9 | #define EMPTY_ID "Empty" /*this applet should not be loaded*/ |
---|
10 | #define MENU_ID "Menu" |
---|
11 | #define DRAWER_ID "Drawer" |
---|
12 | #define LOGOUT_ID "Logout" |
---|
13 | #define SWALLOW_ID "Swallow" |
---|
14 | #define EXTERN_ID "Extern" |
---|
15 | #define LAUNCHER_ID "Launcher" |
---|
16 | #define LOCK_ID "Lock" |
---|
17 | #define STATUS_ID "Status" |
---|
18 | #define RUN_ID "Run" |
---|
19 | |
---|
20 | typedef enum { |
---|
21 | APPLET_EXTERN, |
---|
22 | APPLET_EXTERN_RESERVED, |
---|
23 | APPLET_EXTERN_PENDING, |
---|
24 | APPLET_DRAWER, |
---|
25 | APPLET_MENU, |
---|
26 | APPLET_LOGOUT, |
---|
27 | APPLET_SWALLOW, |
---|
28 | APPLET_LAUNCHER, |
---|
29 | APPLET_EMPTY, |
---|
30 | APPLET_LOCK, |
---|
31 | APPLET_STATUS, |
---|
32 | APPLET_RUN |
---|
33 | } AppletType; |
---|
34 | |
---|
35 | typedef struct _AppletUserMenu AppletUserMenu; |
---|
36 | typedef struct _AppletInfo AppletInfo; |
---|
37 | |
---|
38 | struct _AppletUserMenu { |
---|
39 | char *name; |
---|
40 | char *stock_item; |
---|
41 | char *text; |
---|
42 | int sensitive; |
---|
43 | AppletInfo *info; |
---|
44 | GtkWidget *menuitem; |
---|
45 | GtkWidget *submenu; |
---|
46 | }; |
---|
47 | |
---|
48 | struct _AppletInfo { |
---|
49 | AppletType type; |
---|
50 | int applet_id; |
---|
51 | GtkWidget *widget; /*an event box*/ |
---|
52 | GtkWidget *menu; /*the applet menu*/ |
---|
53 | int menu_age; |
---|
54 | GList *user_menu; /*list of AppletUserMenu items for callbacks*/ |
---|
55 | gpointer data; /*the per applet structure, if it exists*/ |
---|
56 | GDestroyNotify data_destroy; |
---|
57 | }; |
---|
58 | |
---|
59 | gboolean register_toy(GtkWidget *applet, |
---|
60 | gpointer data, |
---|
61 | GDestroyNotify data_destroy, |
---|
62 | PanelWidget *panel, |
---|
63 | int pos, |
---|
64 | gboolean exactpos, |
---|
65 | AppletType type); |
---|
66 | |
---|
67 | void panel_clean_applet(AppletInfo *info); |
---|
68 | |
---|
69 | /*applet menu stuff*/ |
---|
70 | void create_applet_menu(AppletInfo *info, gboolean is_basep); |
---|
71 | void applet_add_callback(AppletInfo *info, |
---|
72 | const char *callback_name, |
---|
73 | const char *stock_item, |
---|
74 | const char *menuitem_text); |
---|
75 | void applet_remove_callback(AppletInfo *info, |
---|
76 | const char *callback_name); |
---|
77 | AppletUserMenu * applet_get_callback (GList *user_menu, const char *name); |
---|
78 | void applet_callback_set_sensitive(AppletInfo *info, |
---|
79 | const char *callback_name, |
---|
80 | int sensitive); |
---|
81 | void show_applet_menu (AppletInfo *info, GdkEventButton *event); |
---|
82 | |
---|
83 | /* during session save, we call this to unlink the .desktop files of |
---|
84 | * removed launchers */ |
---|
85 | void remove_unused_launchers (void); |
---|
86 | |
---|
87 | END_GNOME_DECLS |
---|
88 | |
---|
89 | #endif |
---|