~ubuntu-branches/ubuntu/maverick/unity/maverick

« back to all changes in this revision

Viewing changes to unity-private/panel/panel-indicator-object-view.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-09-17 14:02:54 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20100917140254-6cbue12klia2f07l
Tags: 0.2.40-0ubuntu1
* New upstream release:
  - Fix inactive menus accessible (LP: #604505)
  - Fix some more memory leaks (LP: #604777, #621690, #628144)
  - Fix weird behaviors of quicklist (LP: #617339)
  - Provide an "open this folder" button (LP: #633201)
  - Hidden menu causing gap (LP: #600191)
  - Cannot go fullscreen for flash videos (LP: #631381)
  - Can't access menu items from the keyboard (LP: #636728)
  - Don't register for MDRAGs since they aren't used (LP: #632613)
  - Don't run indicator on special launchers (LP: #627488)
  - Center arrows position in folded launcher tiles (LP: #633084)
  - Launcher icons first appear as white upon login (LP: #601093)
  - Removes jittering when rubber band is in use on the launcher (LP: #632991)
  - Mutter restarts on closing almost any application (LP: #634701)
  - Can't launch apps like synaptic with root privileges from launch bar
    (LP: #599298)
  - Launcher tile dragging shouldn't be masked (LP: #631443)
  - Fix Carousel-ed icons have distorted perspective (LP: #607515)
  - Use no longer sync call (LP: #620011)
* update debian/libunity0.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <libindicator/indicator.h>
30
30
#include <libindicator/indicator-service.h>
31
31
#include <libindicator/indicator-service-manager.h>
 
32
#include <stdlib.h>
 
33
#include <string.h>
32
34
#include <clutter/clutter.h>
33
35
#include <unity-utils.h>
34
36
 
54
56
typedef struct _UnityPanelIndicatorsIndicatorObjectEntryView UnityPanelIndicatorsIndicatorObjectEntryView;
55
57
typedef struct _UnityPanelIndicatorsIndicatorObjectEntryViewClass UnityPanelIndicatorsIndicatorObjectEntryViewClass;
56
58
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
59
#define _g_free0(var) (var = (g_free (var), NULL))
 
60
typedef struct _UnityPanelIndicatorsIndicatorObjectEntryViewPrivate UnityPanelIndicatorsIndicatorObjectEntryViewPrivate;
57
61
 
58
62
struct _UnityPanelIndicatorsIndicatorObjectView {
59
63
        CtkBox parent_instance;
69
73
        GeeArrayList* indicator_entry_array;
70
74
};
71
75
 
 
76
struct _UnityPanelIndicatorsIndicatorObjectEntryView {
 
77
        CtkBox parent_instance;
 
78
        UnityPanelIndicatorsIndicatorObjectEntryViewPrivate * priv;
 
79
        CtkImage* image;
 
80
        CtkText* text;
 
81
        gboolean skip;
 
82
};
 
83
 
 
84
struct _UnityPanelIndicatorsIndicatorObjectEntryViewClass {
 
85
        CtkBoxClass parent_class;
 
86
};
 
87
 
72
88
 
73
89
static gpointer unity_panel_indicators_indicator_object_view_parent_class = NULL;
74
90
 
82
98
UnityPanelIndicatorsIndicatorObjectView* unity_panel_indicators_indicator_object_view_new (IndicatorObject* _object);
83
99
UnityPanelIndicatorsIndicatorObjectView* unity_panel_indicators_indicator_object_view_construct (GType object_type, IndicatorObject* _object);
84
100
void unity_panel_indicators_indicator_object_view_show_entry_menu (UnityPanelIndicatorsIndicatorObjectView* self, gint entry);
 
101
void unity_panel_indicators_indicator_object_view_on_menu_show (UnityPanelIndicatorsIndicatorObjectView* self, IndicatorObjectEntry* entry, guint timestamp);
 
102
IndicatorObjectEntry* unity_panel_indicators_indicator_object_entry_view_get_entry (UnityPanelIndicatorsIndicatorObjectEntryView* self);
 
103
void unity_panel_indicators_indicator_object_entry_view_show_menu (UnityPanelIndicatorsIndicatorObjectEntryView* self);
85
104
static void unity_panel_indicators_indicator_object_view_on_menu_moved (UnityPanelIndicatorsIndicatorObjectView* self, UnityPanelIndicatorsIndicatorObjectEntryView* object_entry_view, GtkMenuDirectionType type);
86
 
void unity_panel_indicators_indicator_object_entry_view_show_menu (UnityPanelIndicatorsIndicatorObjectEntryView* self);
87
105
static void unity_panel_indicators_indicator_object_view_on_entry_added (UnityPanelIndicatorsIndicatorObjectView* self, IndicatorObject* object, IndicatorObjectEntry* indicator_object_entry);
88
 
IndicatorObjectEntry* unity_panel_indicators_indicator_object_entry_view_get_entry (UnityPanelIndicatorsIndicatorObjectEntryView* self);
89
106
UnityPanelIndicatorsIndicatorObjectEntryView* unity_panel_indicators_indicator_object_entry_view_new (IndicatorObjectEntry* _entry);
90
107
UnityPanelIndicatorsIndicatorObjectEntryView* unity_panel_indicators_indicator_object_entry_view_construct (GType object_type, IndicatorObjectEntry* _entry);
91
108
static void _unity_panel_indicators_indicator_object_view_on_menu_moved_unity_panel_indicators_indicator_object_entry_view_menu_moved (UnityPanelIndicatorsIndicatorObjectEntryView* _sender, GtkMenuDirectionType type, gpointer self);
99
116
static void unity_panel_indicators_indicator_object_view_set_indicator_object (UnityPanelIndicatorsIndicatorObjectView* self, IndicatorObject* value);
100
117
static void _unity_panel_indicators_indicator_object_view_on_entry_added_indicator_object_entry_added (IndicatorObject* _sender, IndicatorObjectEntry* entry, gpointer self);
101
118
static void _unity_panel_indicators_indicator_object_view_remove_entry_indicator_object_entry_removed (IndicatorObject* _sender, IndicatorObjectEntry* entry, gpointer self);
 
119
static void _unity_panel_indicators_indicator_object_view_on_menu_show_indicator_object_menu_show (IndicatorObject* _sender, IndicatorObjectEntry* entry, guint timestamp, gpointer self);
102
120
static GObject * unity_panel_indicators_indicator_object_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
103
121
static void unity_panel_indicators_indicator_object_view_finalize (GObject* obj);
104
122
static void unity_panel_indicators_indicator_object_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
124
142
}
125
143
 
126
144
 
 
145
void unity_panel_indicators_indicator_object_view_on_menu_show (UnityPanelIndicatorsIndicatorObjectView* self, IndicatorObjectEntry* entry, guint timestamp) {
 
146
        g_return_if_fail (self != NULL);
 
147
        g_return_if_fail (entry != NULL);
 
148
        {
 
149
                GeeIterator* _view_it;
 
150
                _view_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) self->priv->indicator_entry_array);
 
151
                while (TRUE) {
 
152
                        UnityPanelIndicatorsIndicatorObjectEntryView* view;
 
153
                        const char* _tmp0_;
 
154
                        char* s;
 
155
                        if (!gee_iterator_next (_view_it)) {
 
156
                                break;
 
157
                        }
 
158
                        view = (UnityPanelIndicatorsIndicatorObjectEntryView*) gee_iterator_get (_view_it);
 
159
                        _tmp0_ = NULL;
 
160
                        if (GTK_IS_LABEL (unity_panel_indicators_indicator_object_entry_view_get_entry (view)->label)) {
 
161
                                _tmp0_ = gtk_label_get_label (entry->label);
 
162
                        } else {
 
163
                                _tmp0_ = "";
 
164
                        }
 
165
                        s = g_strdup (_tmp0_);
 
166
                        if (unity_panel_indicators_indicator_object_entry_view_get_entry (view) == entry) {
 
167
                                unity_panel_indicators_indicator_object_entry_view_show_menu (view);
 
168
                                _g_free0 (s);
 
169
                                _g_object_unref0 (view);
 
170
                                break;
 
171
                        }
 
172
                        _g_free0 (s);
 
173
                        _g_object_unref0 (view);
 
174
                }
 
175
                _g_object_unref0 (_view_it);
 
176
        }
 
177
}
 
178
 
 
179
 
127
180
static void unity_panel_indicators_indicator_object_view_on_menu_moved (UnityPanelIndicatorsIndicatorObjectView* self, UnityPanelIndicatorsIndicatorObjectEntryView* object_entry_view, GtkMenuDirectionType type) {
128
181
        gboolean _tmp0_ = FALSE;
129
182
        gint pos;
158
211
                }
159
212
        }
160
213
        next_object_entry_view = (UnityPanelIndicatorsIndicatorObjectEntryView*) gee_abstract_list_get ((GeeAbstractList*) self->priv->indicator_entry_array, pos);
 
214
        if (next_object_entry_view->skip) {
 
215
                if (type == GTK_MENU_DIR_PARENT) {
 
216
                        if (pos == 0) {
 
217
                                UnityPanelIndicatorsIndicatorObjectEntryView* _tmp1_;
 
218
                                next_object_entry_view = (_tmp1_ = (UnityPanelIndicatorsIndicatorObjectEntryView*) gee_abstract_list_get ((GeeAbstractList*) self->priv->indicator_entry_array, gee_collection_get_size ((GeeCollection*) self->priv->indicator_entry_array) - 1), _g_object_unref0 (next_object_entry_view), _tmp1_);
 
219
                        } else {
 
220
                                UnityPanelIndicatorsIndicatorObjectEntryView* _tmp2_;
 
221
                                next_object_entry_view = (_tmp2_ = (UnityPanelIndicatorsIndicatorObjectEntryView*) gee_abstract_list_get ((GeeAbstractList*) self->priv->indicator_entry_array, pos - 1), _g_object_unref0 (next_object_entry_view), _tmp2_);
 
222
                        }
 
223
                } else {
 
224
                        if (type == GTK_MENU_DIR_CHILD) {
 
225
                                if (pos == (gee_collection_get_size ((GeeCollection*) self->priv->indicator_entry_array) - 1)) {
 
226
                                        UnityPanelIndicatorsIndicatorObjectEntryView* _tmp3_;
 
227
                                        next_object_entry_view = (_tmp3_ = (UnityPanelIndicatorsIndicatorObjectEntryView*) gee_abstract_list_get ((GeeAbstractList*) self->priv->indicator_entry_array, 0), _g_object_unref0 (next_object_entry_view), _tmp3_);
 
228
                                } else {
 
229
                                        UnityPanelIndicatorsIndicatorObjectEntryView* _tmp4_;
 
230
                                        next_object_entry_view = (_tmp4_ = (UnityPanelIndicatorsIndicatorObjectEntryView*) gee_abstract_list_get ((GeeAbstractList*) self->priv->indicator_entry_array, pos + 1), _g_object_unref0 (next_object_entry_view), _tmp4_);
 
231
                                }
 
232
                        }
 
233
                }
 
234
        }
161
235
        unity_panel_indicators_indicator_object_entry_view_show_menu (next_object_entry_view);
162
236
        _g_object_unref0 (next_object_entry_view);
163
237
}
370
444
}
371
445
 
372
446
 
 
447
static void _unity_panel_indicators_indicator_object_view_on_menu_show_indicator_object_menu_show (IndicatorObject* _sender, IndicatorObjectEntry* entry, guint timestamp, gpointer self) {
 
448
        unity_panel_indicators_indicator_object_view_on_menu_show (self, entry, timestamp);
 
449
}
 
450
 
 
451
 
373
452
static GObject * unity_panel_indicators_indicator_object_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
374
453
        GObject * obj;
375
454
        GObjectClass * parent_class;
384
463
                self->priv->indicator_entry_array = (_tmp0_ = gee_array_list_new (UNITY_PANEL_INDICATORS_TYPE_INDICATOR_OBJECT_ENTRY_VIEW, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL), _g_object_unref0 (self->priv->indicator_entry_array), _tmp0_);
385
464
                g_signal_connect_object (self->priv->_indicator_object, "entry-added", (GCallback) _unity_panel_indicators_indicator_object_view_on_entry_added_indicator_object_entry_added, self, 0);
386
465
                g_signal_connect_object (self->priv->_indicator_object, "entry-removed", (GCallback) _unity_panel_indicators_indicator_object_view_remove_entry_indicator_object_entry_removed, self, 0);
 
466
                g_signal_connect_object (self->priv->_indicator_object, "menu-show", (GCallback) _unity_panel_indicators_indicator_object_view_on_menu_show_indicator_object_menu_show, self, 0);
387
467
                list = indicator_object_get_entries (self->priv->_indicator_object);
388
468
                {
389
469
                        gint i;