107
107
typedef struct _UnityLauncherApplicationQuicklistController UnityLauncherApplicationQuicklistController;
108
108
typedef struct _UnityLauncherApplicationQuicklistControllerClass UnityLauncherApplicationQuicklistControllerClass;
109
109
#define _g_array_free0(var) ((var == NULL) ? NULL : (var = (g_array_free (var, TRUE), NULL)))
111
#define UNITY_LAUNCHER_TYPE_PIN_TYPE (unity_launcher_pin_type_get_type ())
110
112
typedef struct _UnityLauncherScrollerChildPrivate UnityLauncherScrollerChildPrivate;
112
#define UNITY_LAUNCHER_TYPE_PIN_TYPE (unity_launcher_pin_type_get_type ())
113
typedef struct _Block8Data Block8Data;
113
typedef struct _Block7Data Block7Data;
114
114
typedef struct _Block6Data Block6Data;
115
115
#define __g_list_free_g_object_unref0(var) ((var == NULL) ? NULL : (var = (_g_list_free_g_object_unref (var), NULL)))
116
116
typedef struct _Block9Data Block9Data;
117
typedef struct _Block7Data Block7Data;
117
typedef struct _Block8Data Block8Data;
118
118
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
229
229
UNITY_LAUNCHER_APPLICATION_CONTROLLER_DUMMY_PROPERTY,
230
230
UNITY_LAUNCHER_APPLICATION_CONTROLLER_DESKTOP_FILE
232
static void unity_launcher_application_controller_set_desktop_file (UnityLauncherApplicationController* self, const char* value);
233
static void unity_launcher_application_controller_load_desktop_file_info (UnityLauncherApplicationController* self);
232
234
GType unity_launcher_scroller_child_get_type (void) G_GNUC_CONST;
233
235
UnityLauncherApplicationController* unity_launcher_application_controller_new (const char* desktop_file_, UnityLauncherScrollerChild* child_);
234
236
UnityLauncherApplicationController* unity_launcher_application_controller_construct (GType object_type, const char* desktop_file_, UnityLauncherScrollerChild* child_);
235
static void unity_launcher_application_controller_set_desktop_file (UnityLauncherApplicationController* self, const char* value);
236
static void unity_launcher_application_controller_load_desktop_file_info (UnityLauncherApplicationController* self);
237
static UnityLauncherQuicklistController* unity_launcher_application_controller_real_get_menu_controller (UnityLauncherScrollerChildController* base);
238
237
UnityLauncherApplicationQuicklistController* unity_launcher_application_quicklist_controller_new (UnityLauncherScrollerChildController* scroller_child);
239
238
UnityLauncherApplicationQuicklistController* unity_launcher_application_quicklist_controller_construct (GType object_type, UnityLauncherScrollerChildController* scroller_child);
240
239
GType unity_launcher_application_quicklist_controller_get_type (void) G_GNUC_CONST;
240
static UnityLauncherQuicklistController* unity_launcher_application_controller_real_get_menu_controller (UnityLauncherScrollerChildController* base);
241
gboolean unity_launcher_application_controller_is_sticky (UnityLauncherApplicationController* self);
241
242
void unity_launcher_application_controller_closed (UnityLauncherApplicationController* self);
242
gboolean unity_launcher_application_controller_is_sticky (UnityLauncherApplicationController* self);
243
const char* unity_launcher_application_controller_get_desktop_file (UnityLauncherApplicationController* self);
243
244
void unity_launcher_application_controller_set_sticky (UnityLauncherApplicationController* self, gboolean is_sticky);
244
const char* unity_launcher_application_controller_get_desktop_file (UnityLauncherApplicationController* self);
245
245
void unity_launcher_application_controller_close_windows (UnityLauncherApplicationController* self);
246
246
void unity_launcher_application_controller_set_priority (UnityLauncherApplicationController* self, float priority);
247
247
float unity_launcher_application_controller_get_priority (UnityLauncherApplicationController* self, GError** error);
248
GType unity_launcher_pin_type_get_type (void) G_GNUC_CONST;
249
UnityLauncherScrollerChild* unity_launcher_scroller_child_controller_get_child (UnityLauncherScrollerChildController* self);
248
250
static void unity_launcher_application_controller_on_favorite_added (UnityLauncherApplicationController* self, const char* uid);
249
UnityLauncherScrollerChild* unity_launcher_scroller_child_controller_get_child (UnityLauncherScrollerChildController* self);
250
GType unity_launcher_pin_type_get_type (void) G_GNUC_CONST;
251
251
static void unity_launcher_application_controller_on_favorite_removed (UnityLauncherApplicationController* self, const char* uid);
252
static void unity_launcher_application_controller_real_get_menu_actions (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target);
252
static void _lambda74_ (Block7Data* _data7_);
253
static void __lambda74__dbusmenu_menuitem_realized (DbusmenuMenuitem* _sender, gpointer self);
254
static Block7Data* block7_data_ref (Block7Data* _data7_);
255
static void block7_data_unref (Block7Data* _data7_);
253
256
static void _lambda73_ (Block6Data* _data6_);
254
static void _lambda74_ (Block8Data* _data8_);
255
static void __lambda74__dbusmenu_menuitem_realized (DbusmenuMenuitem* _sender, gpointer self);
256
static Block8Data* block8_data_ref (Block8Data* _data8_);
257
static void block8_data_unref (Block8Data* _data8_);
258
257
static void __lambda73__dbusmenu_client_layout_updated (DbusmenuClient* _sender, gpointer self);
259
258
static Block6Data* block6_data_ref (Block6Data* _data6_);
260
259
static void block6_data_unref (Block6Data* _data6_);
263
262
static void __lambda75__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self);
264
263
static Block9Data* block9_data_ref (Block9Data* _data9_);
265
264
static void block9_data_unref (Block9Data* _data9_);
266
static Block7Data* block7_data_ref (Block7Data* _data7_);
267
static void block7_data_unref (Block7Data* _data7_);
268
static void unity_launcher_application_controller_real_get_menu_navigation (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target);
265
static Block8Data* block8_data_ref (Block8Data* _data8_);
266
static void block8_data_unref (Block8Data* _data8_);
267
static void unity_launcher_application_controller_real_get_menu_actions (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target);
269
268
static void _lambda76_ (guint timestamp, UnityLauncherApplicationController* self);
270
269
static void __lambda76__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self);
271
270
static void _lambda77_ (guint timestamp, UnityLauncherApplicationController* self);
272
271
static void __lambda77__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self);
272
static void unity_launcher_application_controller_real_get_menu_navigation (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target);
273
273
static gint unity_launcher_application_controller_order_app_windows (void* a, void* b);
274
static void unity_launcher_application_controller_real_activate (UnityLauncherScrollerChildController* base);
275
274
void unity_launcher_scroller_child_set_activating (UnityLauncherScrollerChild* self, gboolean value);
276
275
static gboolean unity_launcher_application_controller_on_launch_timeout (UnityLauncherApplicationController* self);
277
276
static gboolean _unity_launcher_application_controller_on_launch_timeout_gsource_func (gpointer self);
278
void unity_launcher_application_controller_attach_application (UnityLauncherApplicationController* self, BamfApplication* application);
277
static void unity_launcher_application_controller_real_activate (UnityLauncherScrollerChildController* base);
279
278
void unity_launcher_scroller_child_set_running (UnityLauncherScrollerChild* self, gboolean value);
280
279
void unity_launcher_scroller_child_set_active (UnityLauncherScrollerChild* self, gboolean value);
281
280
static void unity_launcher_application_controller_on_app_running_changed (UnityLauncherApplicationController* self, gboolean running);
286
285
static void _unity_launcher_application_controller_detach_application_bamf_view_closed (BamfView* _sender, gpointer self);
287
286
static void unity_launcher_application_controller_on_app_urgant_changed (UnityLauncherApplicationController* self, gboolean urgancy);
288
287
static void _unity_launcher_application_controller_on_app_urgant_changed_bamf_view_urgent_changed (BamfView* _sender, gboolean object, gpointer self);
288
void unity_launcher_scroller_child_controller_set_hide (UnityLauncherScrollerChildController* self, gboolean value);
289
289
static void _lambda78_ (gboolean value, UnityLauncherApplicationController* self);
290
void unity_launcher_scroller_child_controller_set_hide (UnityLauncherScrollerChildController* self, gboolean value);
291
290
static void __lambda78__bamf_view_user_visible_changed (BamfView* _sender, gboolean object, gpointer self);
292
291
void unity_launcher_scroller_child_controller_set_name (UnityLauncherScrollerChildController* self, const char* value);
293
292
const char* unity_launcher_scroller_child_controller_get_name (UnityLauncherScrollerChildController* self);
294
293
void unity_launcher_scroller_child_controller_load_icon_from_icon_name (UnityLauncherScrollerChildController* self, const char* icon_name);
294
void unity_launcher_application_controller_attach_application (UnityLauncherApplicationController* self, BamfApplication* application);
295
295
void unity_launcher_scroller_child_set_needs_attention (UnityLauncherScrollerChild* self, gboolean value);
296
296
gboolean unity_launcher_application_controller_debug_is_application_attached (UnityLauncherApplicationController* self);
297
297
static void _unity_launcher_application_controller_on_favorite_added_unity_favorites_favorite_added (UnityFavorites* _sender, const char* uid, gpointer self);
572
static void _lambda74_ (Block8Data* _data8_) {
573
static void _lambda74_ (Block7Data* _data7_) {
573
574
Block6Data* _data6_;
575
576
UnityLauncherApplicationController * self;
576
_data6_ = _data8_->_data6_;
577
_data7_ = _data6_->_data7_;
578
self = _data7_->self;
577
_data6_ = _data7_->_data6_;
578
_data8_ = _data6_->_data8_;
579
self = _data8_->self;
579
580
self->priv->menu_items_realized_counter = self->priv->menu_items_realized_counter - 1;
580
581
if (self->priv->menu_items_realized_counter < 1) {
581
_data7_->callback (_data8_->menu, _data7_->callback_target);
582
_data8_->callback (_data7_->menu, _data8_->callback_target);
591
static Block8Data* block8_data_ref (Block8Data* _data8_) {
592
g_atomic_int_inc (&_data8_->_ref_count_);
592
static Block7Data* block7_data_ref (Block7Data* _data7_) {
593
g_atomic_int_inc (&_data7_->_ref_count_);
597
static void block8_data_unref (Block8Data* _data8_) {
598
if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
599
block6_data_unref (_data8_->_data6_);
600
_g_object_unref0 (_data8_->menu);
601
g_slice_free (Block8Data, _data8_);
598
static void block7_data_unref (Block7Data* _data7_) {
599
if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
600
block6_data_unref (_data7_->_data6_);
601
_g_object_unref0 (_data7_->menu);
602
g_slice_free (Block7Data, _data7_);
606
607
static void _lambda73_ (Block6Data* _data6_) {
609
UnityLauncherApplicationController * self;
607
610
Block7Data* _data7_;
608
UnityLauncherApplicationController * self;
610
611
DbusmenuMenuitem* _tmp0_;
611
612
GList* menu_items;
612
_data7_ = _data6_->_data7_;
613
self = _data7_->self;
614
_data8_ = g_slice_new0 (Block8Data);
615
_data8_->_ref_count_ = 1;
616
_data8_->_data6_ = block6_data_ref (_data6_);
617
_data8_->menu = dbusmenu_client_get_root (self->priv->menu_client);
618
self->priv->cached_menu = (_tmp0_ = _g_object_ref0 (_data8_->menu), _g_object_unref0 (self->priv->cached_menu), _tmp0_);
619
if (DBUSMENU_IS_MENUITEM (_data8_->menu) == FALSE) {
613
_data8_ = _data6_->_data8_;
614
self = _data8_->self;
615
_data7_ = g_slice_new0 (Block7Data);
616
_data7_->_ref_count_ = 1;
617
_data7_->_data6_ = block6_data_ref (_data6_);
618
_data7_->menu = dbusmenu_client_get_root (self->priv->menu_client);
619
self->priv->cached_menu = (_tmp0_ = _g_object_ref0 (_data7_->menu), _g_object_unref0 (self->priv->cached_menu), _tmp0_);
620
if (DBUSMENU_IS_MENUITEM (_data7_->menu) == FALSE) {
621
622
g_warning ("application-controller.vala:201: %s", _tmp1_ = g_strconcat ("Didn't get a menu for path: ", string_to_string (_data6_->path), " - address: ", string_to_string (_data6_->remote_address), NULL));
622
623
_g_free0 (_tmp1_);
624
menu_items = dbusmenu_menuitem_get_children (_data8_->menu);
625
menu_items = dbusmenu_menuitem_get_children (_data7_->menu);
625
626
self->priv->menu_items_realized_counter = (gint) g_list_length (menu_items);
627
628
GList* menuitem_collection;
631
632
DbusmenuMenuitem* menuitem;
632
633
menuitem = _g_object_ref0 ((DbusmenuMenuitem*) menuitem_it->data);
634
g_signal_connect_data (menuitem, "realized", (GCallback) __lambda74__dbusmenu_menuitem_realized, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
635
g_signal_connect_data (menuitem, "realized", (GCallback) __lambda74__dbusmenu_menuitem_realized, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
635
636
_g_object_unref0 (menuitem);
639
block8_data_unref (_data8_);
640
block7_data_unref (_data7_);
690
691
static void block9_data_unref (Block9Data* _data9_) {
691
692
if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
692
block7_data_unref (_data9_->_data7_);
693
block8_data_unref (_data9_->_data8_);
693
694
_g_free0 (_data9_->local_nick);
694
695
g_slice_free (Block9Data, _data9_);
699
static Block7Data* block7_data_ref (Block7Data* _data7_) {
700
g_atomic_int_inc (&_data7_->_ref_count_);
700
static Block8Data* block8_data_ref (Block8Data* _data8_) {
701
g_atomic_int_inc (&_data8_->_ref_count_);
705
static void block7_data_unref (Block7Data* _data7_) {
706
if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
707
_g_object_unref0 (_data7_->self);
708
_g_object_unref0 (_data7_->shortcuts);
709
g_slice_free (Block7Data, _data7_);
706
static void block8_data_unref (Block8Data* _data8_) {
707
if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
708
_g_object_unref0 (_data8_->self);
709
_g_object_unref0 (_data8_->shortcuts);
710
g_slice_free (Block8Data, _data8_);
714
715
static void unity_launcher_application_controller_real_get_menu_actions (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target) {
715
716
UnityLauncherApplicationController * self;
717
718
gboolean _tmp3_ = FALSE;
718
721
gint nicks_length1;
723
724
DbusmenuMenuitem* root;
724
725
self = (UnityLauncherApplicationController*) base;
725
_data7_ = g_slice_new0 (Block7Data);
726
_data7_->_ref_count_ = 1;
727
_data7_->self = g_object_ref (self);
728
_data7_->callback = callback;
729
_data7_->callback_target = callback_target;
726
_data8_ = g_slice_new0 (Block8Data);
727
_data8_->_ref_count_ = 1;
728
_data8_->self = g_object_ref (self);
729
_data8_->callback = callback;
730
_data8_->callback_target = callback_target;
730
731
if (BAMF_IS_APPLICATION (self->priv->app)) {
732
733
views = bamf_view_get_children ((BamfView*) self->priv->app);
745
746
DbusmenuClient* _tmp2_;
746
747
_data6_ = g_slice_new0 (Block6Data);
747
748
_data6_->_ref_count_ = 1;
748
_data6_->_data7_ = block7_data_ref (_data7_);
749
_data6_->_data8_ = block8_data_ref (_data8_);
749
750
_data6_->path = g_strdup (bamf_indicator_get_dbus_menu_path ((_tmp0_ = view, BAMF_IS_INDICATOR (_tmp0_) ? ((BamfIndicator*) _tmp0_) : NULL)));
750
751
_data6_->remote_address = g_strdup (bamf_indicator_get_remote_address ((_tmp1_ = view, BAMF_IS_INDICATOR (_tmp1_) ? ((BamfIndicator*) _tmp1_) : NULL)));
751
752
self->priv->menu_client = (_tmp2_ = dbusmenu_client_new (_data6_->remote_address, _data6_->path), _g_object_unref0 (self->priv->menu_client), _tmp2_);
764
765
_tmp3_ = self->priv->_desktop_file == NULL;
767
_data7_->callback (NULL, _data7_->callback_target);
768
_data8_->callback (NULL, _data8_->callback_target);
769
_data7_->shortcuts = indicator_desktop_shortcuts_new (self->priv->_desktop_file, "Unity");
770
nicks = (_tmp5_ = _tmp4_ = indicator_desktop_shortcuts_get_nicks (_data7_->shortcuts), nicks_length1 = _vala_array_length (_tmp4_), _nicks_size_ = nicks_length1, _tmp5_);
770
_data8_->shortcuts = indicator_desktop_shortcuts_new (self->priv->_desktop_file, "Unity");
771
nicks = (_tmp5_ = _tmp4_ = indicator_desktop_shortcuts_get_nicks (_data8_->shortcuts), nicks_length1 = _vala_array_length (_tmp4_), _nicks_size_ = nicks_length1, _tmp5_);
771
772
if (nicks_length1 < 1) {
772
_data7_->callback (NULL, _data7_->callback_target);
773
_data8_->callback (NULL, _data8_->callback_target);
774
775
root = dbusmenu_menuitem_new ();
775
776
dbusmenu_menuitem_set_root (root, TRUE);
789
790
DbusmenuMenuitem* shortcut_item;
790
791
_data9_ = g_slice_new0 (Block9Data);
791
792
_data9_->_ref_count_ = 1;
792
_data9_->_data7_ = block7_data_ref (_data7_);
793
_data9_->_data8_ = block8_data_ref (_data8_);
793
794
_data9_->local_nick = g_strdup (nick);
794
name = indicator_desktop_shortcuts_nick_get_name (_data7_->shortcuts, _data9_->local_nick);
795
name = indicator_desktop_shortcuts_nick_get_name (_data8_->shortcuts, _data9_->local_nick);
795
796
local_name = g_strdup (name);
796
797
shortcut_item = dbusmenu_menuitem_new ();
797
798
dbusmenu_menuitem_property_set (shortcut_item, DBUSMENU_MENUITEM_PROP_LABEL, local_name);