~ubuntu-branches/ubuntu/maverick/awn-extras-applets/maverick

« back to all changes in this revision

Viewing changes to applets/maintained/notification-area/notification-area.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-08-29 14:29:52 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20100829142952-rhvuetyms9bv5uu7
Tags: upstream-0.4.0+bzr1372
ImportĀ upstreamĀ versionĀ 0.4.0+bzr1372

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* notification-area.c generated by valac, the Vala compiler
 
1
/* notification-area.c generated by valac 0.9.7, the Vala compiler
2
2
 * generated from notification-area.vala, do not modify */
3
3
 
4
4
/*
101
101
static NotificationAreaPrefs* notification_area_prefs_window = NULL;
102
102
static gpointer notification_area_parent_class = NULL;
103
103
 
104
 
GType notification_area_get_type (void);
 
104
GType notification_area_get_type (void) G_GNUC_CONST;
105
105
#define NOTIFICATION_AREA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_NOTIFICATION_AREA, NotificationAreaPrivate))
106
106
enum  {
107
107
        NOTIFICATION_AREA_DUMMY_PROPERTY,
111
111
        NOTIFICATION_AREA_BACKGROUND_COLOR,
112
112
        NOTIFICATION_AREA_BORDER_COLOR
113
113
};
114
 
GType notification_area_prefs_get_type (void);
 
114
GType notification_area_prefs_get_type (void) G_GNUC_CONST;
115
115
#define NOTIFICATION_AREA_BORDER 2
 
116
NotificationArea* notification_area_new (AwnApplet* applet);
 
117
NotificationArea* notification_area_construct (GType object_type, AwnApplet* applet);
116
118
static void notification_area_on_icon_added (NotificationArea* self, GtkWidget* widget);
117
119
static void _notification_area_on_icon_added_egg_tray_manager_tray_icon_added (EggTrayManager* _sender, GtkWidget* object, gpointer self);
118
120
static void notification_area_on_icon_removed (NotificationArea* self, GtkWidget* widget);
119
121
static void _notification_area_on_icon_removed_egg_tray_manager_tray_icon_removed (EggTrayManager* _sender, GtkWidget* object, gpointer self);
 
122
static void _lambda9_ (GtkPositionType new_pos, NotificationArea* self);
120
123
static void notification_area_update_icon_sizes (NotificationArea* self);
121
124
static void notification_area_table_refresh (NotificationArea* self);
122
 
static void _lambda9_ (GtkPositionType new_pos, NotificationArea* self);
123
125
static void __lambda9__awn_applet_position_changed (AwnApplet* _sender, GtkPositionType position, gpointer self);
124
126
static void _lambda10_ (gint new_size, NotificationArea* self);
125
127
static void __lambda10__awn_applet_size_changed (AwnApplet* _sender, gint size, gpointer self);
128
130
static gboolean notification_area_button_press (NotificationArea* self, GdkEventButton* event);
129
131
static gboolean _notification_area_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
130
132
static gboolean notification_area_on_painter_expose (NotificationArea* self, GdkEvent* event, GtkBin* eb);
131
 
NotificationArea* notification_area_new (AwnApplet* applet);
132
 
NotificationArea* notification_area_construct (GType object_type, AwnApplet* applet);
133
133
static void notification_area_tray_icon_expose (GtkWidget* widget, cairo_t* cr);
134
134
NotificationAreaPrefs* notification_area_prefs_new (AwnApplet* applet);
135
135
NotificationAreaPrefs* notification_area_prefs_construct (GType object_type, AwnApplet* applet);
195
195
 
196
196
 
197
197
static gboolean _notification_area_on_applet_expose_gtk_widget_expose_event (GtkWidget* _sender, GdkEventExpose* event, gpointer self) {
198
 
        return notification_area_on_applet_expose (self, event);
 
198
        gboolean result;
 
199
        result = notification_area_on_applet_expose (self, event);
 
200
        return result;
199
201
}
200
202
 
201
203
 
202
204
static gboolean _notification_area_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
203
 
        return notification_area_button_press (self, event);
 
205
        gboolean result;
 
206
        result = notification_area_button_press (self, event);
 
207
        return result;
204
208
}
205
209
 
206
210
 
207
211
NotificationArea* notification_area_construct (GType object_type, AwnApplet* applet) {
208
 
        GError * _inner_error_;
209
212
        NotificationArea * self;
210
213
        AwnApplet* _tmp0_;
211
214
        EggTrayManager* _tmp1_;
218
221
        GtkTable* _tmp7_;
219
222
        DesktopAgnosticConfigClient* _tmp8_;
220
223
        DesktopAgnosticConfigClient* _tmp9_;
 
224
        GError * _inner_error_ = NULL;
221
225
        g_return_val_if_fail (applet != NULL, NULL);
222
 
        _inner_error_ = NULL;
223
226
        self = (NotificationArea*) g_object_new (object_type, NULL);
224
227
        self->priv->applet = (_tmp0_ = _g_object_ref0 (applet), _g_object_unref0 (self->priv->applet), _tmp0_);
225
228
        self->priv->manager = (_tmp1_ = egg_tray_manager_new (), _g_object_unref0 (self->priv->manager), _tmp1_);
701
704
 
702
705
 
703
706
static gboolean _workaround_gpm_bug_gsource_func (gpointer self) {
704
 
        return workaround_gpm_bug ();
 
707
        gboolean result;
 
708
        result = workaround_gpm_bug ();
 
709
        return result;
705
710
}
706
711
 
707
712
 
744
749
 
745
750
 
746
751
static gboolean _notification_area_redraw_scheduler_gsource_func (gpointer self) {
747
 
        return notification_area_redraw_scheduler (self);
 
752
        gboolean result;
 
753
        result = notification_area_redraw_scheduler (self);
 
754
        return result;
748
755
}
749
756
 
750
757
 
992
999
 
993
1000
gboolean workaround_gpm_bug (void) {
994
1001
        gboolean result = FALSE;
995
 
        GError * _inner_error_;
996
1002
        char* command;
997
 
        _inner_error_ = NULL;
 
1003
        GError * _inner_error_ = NULL;
998
1004
        command = g_strdup ("python -c \"" "import gconf;" "c = gconf.Client();" "key = '/apps/gnome-power-manager/ui/icon_policy';" "pol = c.get_string(key);" "c.set_string(key, 'always');" "c.set_string(key, pol);" "\"");
999
1005
        g_spawn_command_line_async (command, &_inner_error_);
1000
1006
        if (_inner_error_ != NULL) {
1023
1029
                gtk_message_dialog_format_secondary_text (d, "Please remove the existing notification area" " and then restart the applet.", NULL);
1024
1030
                gtk_dialog_run ((GtkDialog*) d);
1025
1031
                g_error ("notification-area.vala:644: %s", msg);
1026
 
                result = NULL;
 
1032
                _g_object_unref0 (d);
1027
1033
                _g_free0 (msg);
1028
 
                _g_object_unref0 (d);
1029
 
                return result;
1030
1034
        }
1031
1035
        applet = g_object_ref_sink (awn_applet_new (canonical_name, uid, panel_id));
1032
1036
        na = notification_area_new (applet);