~ubuntu-branches/ubuntu/oneiric/gnome-panel/oneiric

« back to all changes in this revision

Viewing changes to bonobo/libpanel-applet/panel-applet.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher, Sebastien Bacher, Jeremy Bicha
  • Date: 2011-05-30 11:04:49 UTC
  • mfrom: (1.13.10 upstream) (2.2.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20110530110449-hinl17kxkcefjw6x
Tags: 1:3.0.2-0ubuntu1
[ Sebastien Bacher ]
* New upstream version
* debian/control.in:
  - the new libgweather version is in oneiric, use it
  - drop the python and python-gconf depends, 
    they were added for gnome-panel-add which is still using gconf and buggy
* debian/gnome-panel-data.install:
  - don't install the apport hook, it's only getting gconf datas which 
    doesn't work since gnome-panel uses gsettings
* debian/patches/90_build_fixes.patch:
  - restore build fix from git not applied in the new serie
* debian/patches/01_panel_submenus.patch:
  - don't take that Debian diff, the .menus use the upstream naming in Ubuntu
* debian/patches/06_no_resize_grip.patch:
  - dropped, the issue is fixed in the new version
* debian/patches/50_fix-potfiles.patch:
  - dropped, the issue is fixed in the new version
* debian/watch:
  - track unstable series as well

Drop those delta, since gnome-panel is not the default Ubuntu session now we
can go back to an experience closer to the upstream one: 
* debian/control.in:
  - drop the indicators recommends, unity-2d is the ubuntu fallback session
    so we can get back to use an upstream config for gnome-panel and reduce
    the delta we carry
* debian/patches/04_default_panel_config.patch:
  - don't modify the upstream layout
* debian/patches/05_no_session_delay.patch:
  - no need to tweak the upstream session to optimize it
* debian/patches/16_compiz_workspace_switcher.patch:
  - go back to the upstream switcher behaviour    
* debian/patches/25_dynamic_fusa_detection.patch:
  - not needed since we use the upstream layout, could be ported if someone
    is wanting to do the work though
* debian/patches/30_disable-initial-animation.patch, debian/rules:
  - drop the --disable-initial-animation, that was some login optimization
    but since it's not the default desktop you should go back to the 
    upstream behaviour

[ Jeremy Bicha ]   
* New upstream version
* Merge from Debian experimental, remaining Ubuntu changes:
* debian/control:
  - Recommends gnome-settings-daemon which has the timezone polkit service
* debian/rules:
  - Update translations template.
* debian/gnome-panel-data.install:
  - Install apport hook
  - Install the "About Ubuntu" menu item.
* debian/patches/01_layout.patch:
  - Disabled, Help & About Ubuntu don't fit as well in Gnome Panel 3
* debian/patches/01_panel_submenus.patch.
  - Dropped
* debian/patches/03_dnd_places_link.patch:
  - Disabled, when using Drag'n'Drop from Places menu, install a link launcher
    (.desktop file) instead of copying the entire directory.
* debian/patches/17_about-ubuntu-translation.patch:
  - List ubuntu-about.desktop for translation.
* debian/patches/40_unset_menuproxy.patch:
  - Make sure gnome-panel and the applets don't pick up menu proxies.
* debian/patches/50_fix-potfiles.patch
  - Fix i18n
* debian/patches/85_disable_shutdown_on_ltsp.patch:
  - Suppress the shutdown option in the panel if LTSP_CLIENT is set.
* debian/patches/71_change_bookmark_submenu_limit_value.patch
  - Dropped, picked up by Debian
* debian/patches/18_lockdown_lock_editor.patch:
* debian/patches/90_git_wnck_show_realize.patch:
* debian/patches/90_fix_linking_DSO_link.patch:
* debian/patches/91_gir_annotations.patch
* debian/patches/92_git_calendar_day.patch
* debian/patches/92_git_fix_applets_in_multiscreen.patch:
  - Dropped, applied upstream
* debian/watch:
  - watch unstable versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * panel-applet.h: panel applet writing API.
3
 
 *
4
 
 * Copyright (C) 2001 Sun Microsystems, Inc.
5
 
 *
6
 
 * This library is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU Library General Public
8
 
 * License as published by the Free Software Foundation; either
9
 
 * version 2 of the License, or (at your option) any later version.
10
 
 *
11
 
 * This library is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
 * Library General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU Library General Public
17
 
 * License along with this library; if not, write to the
18
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
 
 * Boston, MA 02111-1307, USA.
20
 
 *
21
 
 * Authors:
22
 
 *     Mark McLoughlin <mark@skynet.ie>
23
 
 */
24
 
 
25
 
#ifndef __PANEL_APPLET_H__
26
 
#define __PANEL_APPLET_H__
27
 
 
28
 
#include <glib.h>
29
 
#include <gtk/gtk.h>
30
 
#include <bonobo/bonobo-control.h>
31
 
#include <bonobo/bonobo-main.h>
32
 
#include <bonobo/bonobo-ui-component.h>
33
 
#include <bonobo/bonobo-generic-factory.h>
34
 
 
35
 
#include <GNOME_Panel.h>
36
 
 
37
 
G_BEGIN_DECLS
38
 
 
39
 
typedef GNOME_Vertigo_PanelOrient PanelAppletOrient;
40
 
 
41
 
#define PANEL_APPLET_ORIENT_UP    GNOME_Vertigo_PANEL_ORIENT_UP
42
 
#define PANEL_APPLET_ORIENT_DOWN  GNOME_Vertigo_PANEL_ORIENT_DOWN
43
 
#define PANEL_APPLET_ORIENT_LEFT  GNOME_Vertigo_PANEL_ORIENT_LEFT
44
 
#define PANEL_APPLET_ORIENT_RIGHT GNOME_Vertigo_PANEL_ORIENT_RIGHT
45
 
 
46
 
 
47
 
#define PANEL_TYPE_APPLET         (panel_applet_get_type ())
48
 
#define PANEL_APPLET(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), PANEL_TYPE_APPLET, PanelApplet))
49
 
#define PANEL_APPLET_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), PANEL_TYPE_APPLET, PanelAppletClass))
50
 
#define PANEL_IS_APPLET(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), PANEL_TYPE_APPLET))
51
 
#define PANEL_IS_APPLET_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), PANEL_TYPE_APPLET))
52
 
#define PANEL_APPLET_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PANEL_TYPE_APPLET, PanelAppletClass))
53
 
 
54
 
typedef enum {
55
 
        PANEL_NO_BACKGROUND,
56
 
        PANEL_COLOR_BACKGROUND,
57
 
        PANEL_PIXMAP_BACKGROUND
58
 
} PanelAppletBackgroundType;
59
 
 
60
 
typedef enum {
61
 
        PANEL_APPLET_FLAGS_NONE   = 0,
62
 
        PANEL_APPLET_EXPAND_MAJOR = 1 << 0,
63
 
        PANEL_APPLET_EXPAND_MINOR = 1 << 1,
64
 
        PANEL_APPLET_HAS_HANDLE   = 1 << 2
65
 
} PanelAppletFlags;
66
 
 
67
 
typedef struct _PanelApplet        PanelApplet;
68
 
typedef struct _PanelAppletClass   PanelAppletClass;
69
 
typedef struct _PanelAppletPrivate PanelAppletPrivate;
70
 
 
71
 
typedef gboolean (*PanelAppletFactoryCallback) (PanelApplet *applet,
72
 
                                                const gchar *iid,
73
 
                                                gpointer     user_data);
74
 
 
75
 
struct _PanelApplet {
76
 
        GtkEventBox          event_box;
77
 
 
78
 
        PanelAppletPrivate  *priv;
79
 
};
80
 
 
81
 
struct _PanelAppletClass {
82
 
        GtkEventBoxClass     event_box_class;
83
 
 
84
 
        void (*change_orient) (PanelApplet       *applet,
85
 
                               PanelAppletOrient  orient);
86
 
 
87
 
        void (*change_size)   (PanelApplet       *applet,
88
 
                               guint              size);
89
 
 
90
 
        void (*change_background) (PanelApplet               *applet,
91
 
                                   PanelAppletBackgroundType  type,
92
 
                                   GdkColor                  *color,
93
 
                                   GdkPixmap                 *pixmap);
94
 
        void (*move_focus_out_of_applet) (PanelApplet        *frame,
95
 
                                          GtkDirectionType    direction);
96
 
};
97
 
 
98
 
GType              panel_applet_get_type             (void) G_GNUC_CONST;
99
 
 
100
 
GtkWidget         *panel_applet_new                  (void);
101
 
 
102
 
PanelAppletOrient  panel_applet_get_orient           (PanelApplet *applet);
103
 
 
104
 
guint              panel_applet_get_size             (PanelApplet *applet);
105
 
 
106
 
PanelAppletBackgroundType
107
 
                   panel_applet_get_background       (PanelApplet *applet,
108
 
                                                      /* return values */
109
 
                                                      GdkColor    *color,
110
 
                                                      GdkPixmap  **pixmap);
111
 
 
112
 
void               panel_applet_set_background_widget (PanelApplet *applet,
113
 
                                                       GtkWidget   *widget);
114
 
 
115
 
gchar             *panel_applet_get_preferences_key  (PanelApplet *applet);
116
 
 
117
 
void               panel_applet_add_preferences      (PanelApplet  *applet,
118
 
                                                      const gchar  *schema_dir,
119
 
                                                      GError      **opt_error);
120
 
 
121
 
PanelAppletFlags   panel_applet_get_flags            (PanelApplet      *applet);
122
 
void               panel_applet_set_flags            (PanelApplet      *applet,
123
 
                                                      PanelAppletFlags  flags);
124
 
 
125
 
void               panel_applet_set_size_hints       (PanelApplet      *applet,
126
 
                                                      const int        *size_hints,
127
 
                                                      int               n_elements,
128
 
                                                      int               base_size);
129
 
 
130
 
gboolean           panel_applet_get_locked_down      (PanelApplet  *applet);
131
 
 
132
 
void               panel_applet_request_focus        (PanelApplet  *applet,
133
 
                                                      guint32       timestamp);
134
 
 
135
 
BonoboControl     *panel_applet_get_control          (PanelApplet  *applet);
136
 
BonoboUIComponent *panel_applet_get_popup_component  (PanelApplet  *applet);
137
 
 
138
 
void               panel_applet_setup_menu           (PanelApplet        *applet,
139
 
                                                      const gchar        *xml,
140
 
                                                      const BonoboUIVerb *verb_list,
141
 
                                                      gpointer            user_data);
142
 
 
143
 
void               panel_applet_setup_menu_from_file (PanelApplet        *applet,
144
 
                                                      const gchar        *opt_datadir,
145
 
                                                      const gchar        *file,
146
 
                                                      const gchar        *opt_app_name,
147
 
                                                      const BonoboUIVerb *verb_list,
148
 
                                                      gpointer            user_data);
149
 
 
150
 
 
151
 
int                panel_applet_factory_main          (const gchar                *iid,
152
 
                                                       GType                       applet_type,
153
 
                                                       PanelAppletFactoryCallback  callback,
154
 
                                                       gpointer                    data);
155
 
 
156
 
int                panel_applet_factory_main_closure  (const gchar                *iid,
157
 
                                                       GType                       applet_type,
158
 
                                                       GClosure                   *closure);
159
 
 
160
 
Bonobo_Unknown     panel_applet_shlib_factory         (const char                 *iid,
161
 
                                                       GType                       applet_type,
162
 
                                                       PortableServer_POA          poa,
163
 
                                                       gpointer                    impl_ptr,
164
 
                                                       PanelAppletFactoryCallback  callback,
165
 
                                                       gpointer                    user_data,
166
 
                                                       CORBA_Environment          *ev);
167
 
 
168
 
Bonobo_Unknown     panel_applet_shlib_factory_closure (const char                 *iid,
169
 
                                                       GType                       applet_type,
170
 
                                                       PortableServer_POA          poa,
171
 
                                                       gpointer                    impl_ptr,
172
 
                                                       GClosure                   *closure,
173
 
                                                       CORBA_Environment          *ev);
174
 
 
175
 
/*
176
 
 * These macros are getting a bit unwieldy.
177
 
 *
178
 
 * Things to define for these:
179
 
 *      + required if Native Language Support is enabled (ENABLE_NLS):
180
 
 *                   GETTEXT_PACKAGE and GNOMELOCALEDIR
181
 
 */
182
 
 
183
 
#if !defined(ENABLE_NLS)
184
 
#define _PANEL_APPLET_SETUP_GETTEXT(call_textdomain)                            \
185
 
        do { } while (0)
186
 
#else /* defined(ENABLE_NLS) */
187
 
#include <libintl.h>
188
 
#define _PANEL_APPLET_SETUP_GETTEXT(call_textdomain)                            \
189
 
        do {                                                                    \
190
 
                bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);               \
191
 
                bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");             \
192
 
                if (call_textdomain)                                            \
193
 
                        textdomain (GETTEXT_PACKAGE);                           \
194
 
        } while (0)
195
 
#endif /* !defined(ENABLE_NLS) */
196
 
 
197
 
#define PANEL_APPLET_BONOBO_FACTORY(iid, type, name, version, callback, data)   \
198
 
int main (int argc, char *argv [])                                              \
199
 
{                                                                               \
200
 
        GOptionContext *context;                                                \
201
 
        GError         *error;                                                  \
202
 
        int             retval;                                                 \
203
 
                                                                                \
204
 
        _PANEL_APPLET_SETUP_GETTEXT (TRUE);                                     \
205
 
                                                                                \
206
 
        context = g_option_context_new ("");                                    \
207
 
        g_option_context_add_group (context, gtk_get_option_group (TRUE));      \
208
 
        g_option_context_add_group (context,                                    \
209
 
                                    bonobo_activation_get_goption_group ());    \
210
 
                                                                                \
211
 
        error = NULL;                                                           \
212
 
        if (!g_option_context_parse (context, &argc, &argv, &error)) {          \
213
 
                if (error) {                                                    \
214
 
                        g_printerr ("Cannot parse arguments: %s.\n",            \
215
 
                                    error->message);                            \
216
 
                        g_error_free (error);                                   \
217
 
                } else                                                          \
218
 
                        g_printerr ("Cannot parse arguments.\n");               \
219
 
                g_option_context_free (context);                                \
220
 
                return 1;                                                       \
221
 
        }                                                                       \
222
 
                                                                                \
223
 
        gtk_init (&argc, &argv);                                                \
224
 
        if (!bonobo_init (&argc, argv)) {                                       \
225
 
                g_printerr ("Cannot initialize bonobo.\n");                     \
226
 
                return 1;                                                       \
227
 
        }                                                                       \
228
 
                                                                                \
229
 
        retval = panel_applet_factory_main (iid, type, callback, data);         \
230
 
        g_option_context_free (context);                                        \
231
 
                                                                                \
232
 
        return retval;                                                          \
233
 
}
234
 
 
235
 
#define PANEL_APPLET_BONOBO_SHLIB_FACTORY(iid, type, descr, callback, data)     \
236
 
static Bonobo_Unknown                                                           \
237
 
__panel_applet_shlib_factory (PortableServer_POA  poa,                          \
238
 
                              const char         *oafiid,                       \
239
 
                              gpointer            impl_ptr,                     \
240
 
                              CORBA_Environment  *ev)                           \
241
 
{                                                                               \
242
 
        _PANEL_APPLET_SETUP_GETTEXT (FALSE);                                    \
243
 
        return panel_applet_shlib_factory ((iid), (type), poa, impl_ptr,        \
244
 
                                           (callback), (data), ev);             \
245
 
}                                                                               \
246
 
static BonoboActivationPluginObject plugin_list[] = {                           \
247
 
        { (iid), __panel_applet_shlib_factory },                                \
248
 
        { NULL }                                                                \
249
 
};                                                                              \
250
 
const  BonoboActivationPlugin Bonobo_Plugin_info = { plugin_list, (descr) };
251
 
 
252
 
G_END_DECLS
253
 
 
254
 
#endif /* __PANEL_APPLET_H__ */