~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-04-11 22:38:55 UTC
  • mto: (2.2.5 sid)
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: james.westby@ubuntu.com-20100411223855-bb0ovgd1kerhtyv8
Tags: upstream-0.4.0
ImportĀ upstreamĀ versionĀ 0.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
356
356
 
357
357
 
358
358
static gboolean notification_area_on_painter_expose (NotificationArea* self, GdkEvent* event, GtkBin* eb) {
359
 
        gboolean result;
 
359
        gboolean result = FALSE;
360
360
        cairo_t* cr;
361
361
        GtkWidget* child;
362
362
        cairo_t* _tmp1_;
412
412
 
413
413
 
414
414
static gboolean notification_area_on_applet_expose (NotificationArea* self, GdkEventExpose* event) {
415
 
        gboolean result;
 
415
        gboolean result = FALSE;
416
416
        cairo_t* cr;
417
417
        gint x;
418
418
        gint y;
467
467
 
468
468
 
469
469
static gboolean notification_area_button_press (NotificationArea* self, GdkEventButton* event) {
470
 
        gboolean result;
 
470
        gboolean result = FALSE;
471
471
        g_return_val_if_fail (self != NULL, FALSE);
472
472
        if ((*event).button == 3) {
473
473
                if (notification_area_prefs_window == NULL) {
526
526
                        GtkWidget* icon;
527
527
                        icon = (GtkWidget*) icon_it->data;
528
528
                        {
529
 
                                gint del = 0;
530
 
                                del = (gint) g_object_get_qdata ((GObject*) icon, self->priv->deletion_quark);
531
 
                                if (del != 0) {
 
529
                                void* del;
 
530
                                del = g_object_get_qdata ((GObject*) icon, self->priv->deletion_quark);
 
531
                                if (del != NULL) {
532
532
                                        gtk_container_remove ((GtkContainer*) self->priv->table, icon);
533
533
                                } else {
534
534
                                        gboolean _tmp1_ = FALSE;
564
564
                        EggTrayChild* icon;
565
565
                        icon = (EggTrayChild*) icon_it->data;
566
566
                        {
567
 
                                gint added = 0;
 
567
                                void* added;
568
568
                                gboolean _tmp2_ = FALSE;
569
 
                                added = (gint) g_object_get_qdata ((GObject*) icon, self->priv->addition_quark);
570
 
                                if (added == 0) {
 
569
                                added = g_object_get_qdata ((GObject*) icon, self->priv->addition_quark);
 
570
                                if (added == NULL) {
571
571
                                        continue;
572
572
                                }
573
 
                                g_object_set_qdata ((GObject*) icon, self->priv->addition_quark, GINT_TO_POINTER (0));
 
573
                                g_object_set_qdata_full ((GObject*) icon, self->priv->addition_quark, GINT_TO_POINTER (0), NULL);
574
574
                                gtk_table_attach_defaults (self->priv->table, (GtkWidget*) icon, (guint) col, (guint) (col + 1), (guint) row, (guint) (row + 1));
575
575
                                if (position == GTK_POS_TOP) {
576
576
                                        _tmp2_ = TRUE;
638
638
 
639
639
 
640
640
static gint notification_area_get_tray_icon_size (NotificationArea* self) {
641
 
        gint result;
 
641
        gint result = 0;
642
642
        gint size;
643
643
        gint icon_size;
644
644
        gint _tmp1_ = 0;
723
723
                g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, _workaround_gpm_bug_gsource_func, NULL, NULL);
724
724
                gpm_workaround_done = TRUE;
725
725
        }
726
 
        g_object_set_qdata ((GObject*) icon, self->priv->addition_quark, GINT_TO_POINTER (1));
727
 
        g_object_set_qdata ((GObject*) icon, self->priv->deletion_quark, GINT_TO_POINTER (0));
 
726
        g_object_set_qdata_full ((GObject*) icon, self->priv->addition_quark, GINT_TO_POINTER (1), NULL);
 
727
        g_object_set_qdata_full ((GObject*) icon, self->priv->deletion_quark, GINT_TO_POINTER (0), NULL);
728
728
        self->priv->tray_icons = g_list_append (self->priv->tray_icons, icon);
729
729
        icon_size = notification_area_get_tray_icon_size (self);
730
730
        gtk_widget_set_size_request ((GtkWidget*) icon, icon_size, icon_size);
737
737
        g_return_if_fail (self != NULL);
738
738
        g_return_if_fail (widget != NULL);
739
739
        icon = EGG_TRAY_CHILD (widget);
740
 
        g_object_set_qdata ((GObject*) icon, self->priv->deletion_quark, GINT_TO_POINTER (1));
 
740
        g_object_set_qdata_full ((GObject*) icon, self->priv->deletion_quark, GINT_TO_POINTER (1), NULL);
741
741
        self->priv->tray_icons = g_list_remove (self->priv->tray_icons, icon);
742
742
        notification_area_table_refresh (self);
743
743
}
749
749
 
750
750
 
751
751
static gboolean notification_area_redraw_scheduler (NotificationArea* self) {
752
 
        gboolean result;
 
752
        gboolean result = FALSE;
753
753
        g_return_val_if_fail (self != NULL, FALSE);
754
754
        gtk_widget_queue_draw ((GtkWidget*) self->priv->eb);
755
755
        switch (self->priv->redraw_timer) {
783
783
 
784
784
 
785
785
gboolean notification_area_on_visibility_change (NotificationArea* self, GdkEvent* event, GtkWidget* applet) {
786
 
        gboolean result;
 
786
        gboolean result = FALSE;
787
787
        g_return_val_if_fail (self != NULL, FALSE);
788
788
        g_return_val_if_fail (event != NULL, FALSE);
789
789
        g_return_val_if_fail (applet != NULL, FALSE);
927
927
 
928
928
 
929
929
GType notification_area_get_type (void) {
930
 
        static GType notification_area_type_id = 0;
931
 
        if (notification_area_type_id == 0) {
 
930
        static volatile gsize notification_area_type_id__volatile = 0;
 
931
        if (g_once_init_enter (&notification_area_type_id__volatile)) {
932
932
                static const GTypeInfo g_define_type_info = { sizeof (NotificationAreaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) notification_area_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NotificationArea), 0, (GInstanceInitFunc) notification_area_instance_init, NULL };
 
933
                GType notification_area_type_id;
933
934
                notification_area_type_id = g_type_register_static (G_TYPE_OBJECT, "NotificationArea", &g_define_type_info, 0);
 
935
                g_once_init_leave (&notification_area_type_id__volatile, notification_area_type_id);
934
936
        }
935
 
        return notification_area_type_id;
 
937
        return notification_area_type_id__volatile;
936
938
}
937
939
 
938
940
 
989
991
 
990
992
 
991
993
gboolean workaround_gpm_bug (void) {
992
 
        gboolean result;
 
994
        gboolean result = FALSE;
993
995
        GError * _inner_error_;
994
996
        char* command;
995
997
        _inner_error_ = NULL;
1008
1010
 
1009
1011
 
1010
1012
AwnApplet* awn_applet_factory_initp (const char* canonical_name, const char* uid, gint panel_id) {
1011
 
        AwnApplet* result;
 
1013
        AwnApplet* result = NULL;
1012
1014
        AwnApplet* applet;
1013
1015
        NotificationArea* na;
1014
1016
        g_return_val_if_fail (canonical_name != NULL, NULL);
1020
1022
                d = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", msg));
1021
1023
                gtk_message_dialog_format_secondary_text (d, "Please remove the existing notification area" " and then restart the applet.", NULL);
1022
1024
                gtk_dialog_run ((GtkDialog*) d);
1023
 
                g_error ("notification-area.vala:647: %s", msg);
 
1025
                g_error ("notification-area.vala:644: %s", msg);
1024
1026
                result = NULL;
1025
1027
                _g_free0 (msg);
1026
1028
                _g_object_unref0 (d);
1028
1030
        }
1029
1031
        applet = g_object_ref_sink (awn_applet_new (canonical_name, uid, panel_id));
1030
1032
        na = notification_area_new (applet);
1031
 
        g_object_set_data ((GObject*) applet, "notification-area", g_object_ref ((GObject*) na));
 
1033
        g_object_set_data_full ((GObject*) applet, "notification-area", _g_object_ref0 (g_object_ref ((GObject*) na)), g_object_unref);
1032
1034
        gtk_widget_add_events ((GtkWidget*) applet, (gint) GDK_VISIBILITY_NOTIFY_MASK);
1033
1035
        g_signal_connect_swapped (applet, "visibility-notify-event", (GCallback) notification_area_on_visibility_change, na);
1034
1036
        result = applet;