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

Revision 18631, 2.6 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18630, 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 <gdk/gdktypes.h>
6#include "panel-widget.h"
7#include "panel-gconf.h"
8
9G_BEGIN_DECLS
10
11typedef 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)
27typedef 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
44typedef 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
56AppletInfo *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
65void        panel_applet_clean       (AppletInfo *info,
66                                      gboolean    clean_gconf);
67
68void        panel_applet_clean_gconf (AppletType  type,
69                                      const char *gconf_key,
70                                      gboolean    clean_gconf);
71
72void            panel_applet_add_callback    (AppletInfo  *info,
73                                              const gchar *callback_name,
74                                              const gchar *stock_item,
75                                              const gchar *menuitem_text);
76
77void            panel_applet_remove_callback (AppletInfo *info,
78                                              const char *callback_name);
79
80void            panel_applet_remove_in_idle  (AppletInfo *info);
81
82AppletUserMenu *panel_applet_get_callback    (GList       *user_menu,
83                                              const gchar *name);
84
85
86void        panel_applet_load_applets_from_gconf (void);
87void        panel_applet_save_to_gconf           (AppletInfo *applet_info);
88void        panel_applet_save_position           (AppletInfo *applet_info,
89                                                  const char *gconf_key,
90                                                  gboolean    immediate);
91
92void panel_applet_load_defaults_for_screen (PanelGConfKeyType  type,
93                                            const char        *profile,
94                                            int                screen);
95
96int         panel_applet_get_position    (AppletInfo *applet);
97
98void        panel_applet_menu_set_recurse (GtkMenu     *menu,
99                                           const gchar *key,
100                                           gpointer     data);
101
102G_END_DECLS
103
104#endif
Note: See TracBrowser for help on using the repository browser.