source: trunk/third/gnome-core/panel/applet.h @ 15821

Revision 15821, 2.1 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15820, which included commits to RCS files with non-trunk default branches.
Line 
1#ifndef APPLET_H
2#define APPLET_H
3
4#include <glib.h>
5#include "panel-widget.h"
6
7BEGIN_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
20typedef 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
35typedef struct _AppletUserMenu AppletUserMenu;
36typedef struct _AppletInfo AppletInfo;
37
38struct _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
48struct _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
59gboolean register_toy(GtkWidget *applet,
60                      gpointer data,
61                      GDestroyNotify data_destroy,
62                      PanelWidget *panel,
63                      int pos,
64                      gboolean exactpos,
65                      AppletType type);
66
67void panel_clean_applet(AppletInfo *info);
68
69/*applet menu stuff*/
70void create_applet_menu(AppletInfo *info, gboolean is_basep);
71void applet_add_callback(AppletInfo *info,
72                         const char *callback_name,
73                         const char *stock_item,
74                         const char *menuitem_text);
75void applet_remove_callback(AppletInfo *info,
76                            const char *callback_name);
77AppletUserMenu * applet_get_callback (GList *user_menu, const char *name);
78void applet_callback_set_sensitive(AppletInfo *info,
79                                   const char *callback_name,
80                                   int sensitive);
81void show_applet_menu (AppletInfo *info, GdkEventButton *event);
82
83/* during session save, we call this to unlink the .desktop files of
84 * removed launchers */
85void remove_unused_launchers (void);
86
87END_GNOME_DECLS
88
89#endif
Note: See TracBrowser for help on using the repository browser.