aboutsummaryrefslogtreecommitdiff
path: root/src/specific-items-manager.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-10-28 09:45:22 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-10-28 09:45:22 -0400
commit6c40e13a44770e9bda393e5b0b1ebefa6b8077d5 (patch)
tree8d5e2ee74ab2a728a2af4e514740266424b5b955 /src/specific-items-manager.c
parent3b17bc829e96005f2cd6897be7cf77fec37ef012 (diff)
parentef3495e8ca6aa257c2d3123a7b0a25067570b0de (diff)
downloadayatana-indicator-sound-6c40e13a44770e9bda393e5b0b1ebefa6b8077d5.tar.gz
ayatana-indicator-sound-6c40e13a44770e9bda393e5b0b1ebefa6b8077d5.tar.bz2
ayatana-indicator-sound-6c40e13a44770e9bda393e5b0b1ebefa6b8077d5.zip
Import upstream version 0.7.9.1
Diffstat (limited to 'src/specific-items-manager.c')
-rw-r--r--src/specific-items-manager.c286
1 files changed, 85 insertions, 201 deletions
diff --git a/src/specific-items-manager.c b/src/specific-items-manager.c
index f39e43d..f367fad 100644
--- a/src/specific-items-manager.c
+++ b/src/specific-items-manager.c
@@ -1,4 +1,4 @@
-/* specific-items-manager.c generated by valac 0.14.0, the Vala compiler
+/* specific-items-manager.c generated by valac 0.12.1, the Vala compiler
* generated from specific-items-manager.vala, do not modify */
/*
@@ -173,36 +173,22 @@ static void _specific_items_manager_on_root_changed_dbusmenu_client_root_changed
SpecificItemsManager* specific_items_manager_construct (GType object_type, PlayerController* controller, const gchar* path, SpecificItemsManagercategory which_type) {
SpecificItemsManager * self = NULL;
- SpecificItemsManagercategory _tmp0_;
- PlayerController* _tmp1_;
- const gchar* _tmp2_;
- gchar* _tmp3_;
- PlayerController* _tmp4_;
- const gchar* _tmp5_;
- const gchar* _tmp6_;
- const gchar* _tmp7_;
- DbusmenuClient* _tmp8_;
- DbusmenuClient* _tmp9_;
+ gchar* _tmp0_;
+ const gchar* _tmp1_ = NULL;
+ DbusmenuClient* _tmp2_ = NULL;
g_return_val_if_fail (controller != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
self = (SpecificItemsManager*) g_object_new (object_type, NULL);
- _tmp0_ = which_type;
- self->priv->of_type = (gint) _tmp0_;
- _tmp1_ = controller;
- specific_items_manager_set_owner (self, _tmp1_);
- _tmp2_ = path;
- _tmp3_ = g_strdup (_tmp2_);
+ self->priv->of_type = (gint) which_type;
+ specific_items_manager_set_owner (self, controller);
+ _tmp0_ = g_strdup (path);
_g_free0 (self->priv->dbus_path);
- self->priv->dbus_path = _tmp3_;
- _tmp4_ = self->priv->_owner;
- _tmp5_ = player_controller_get_dbus_name (_tmp4_);
- _tmp6_ = _tmp5_;
- _tmp7_ = self->priv->dbus_path;
- _tmp8_ = dbusmenu_client_new (_tmp6_, _tmp7_);
+ self->priv->dbus_path = _tmp0_;
+ _tmp1_ = player_controller_get_dbus_name (self->priv->_owner);
+ _tmp2_ = dbusmenu_client_new (_tmp1_, self->priv->dbus_path);
_g_object_unref0 (self->priv->client);
- self->priv->client = _tmp8_;
- _tmp9_ = self->priv->client;
- g_signal_connect_object (_tmp9_, "root-changed", (GCallback) _specific_items_manager_on_root_changed_dbusmenu_client_root_changed, self, 0);
+ self->priv->client = _tmp2_;
+ g_signal_connect_object (self->priv->client, "root-changed", (GCallback) _specific_items_manager_on_root_changed_dbusmenu_client_root_changed, self, 0);
return self;
}
@@ -229,71 +215,35 @@ static gboolean _bool_equal (const gboolean* s1, const gboolean* s2) {
static gint specific_items_manager_figure_out_positioning (SpecificItemsManager* self) {
gint result = 0;
gint _result_;
- gint _tmp0_;
- gint _tmp22_;
- gint _tmp23_;
g_return_val_if_fail (self != NULL, 0);
_result_ = 0;
- _tmp0_ = self->priv->of_type;
- if (_tmp0_ == ((gint) SPECIFIC_ITEMS_MANAGER_CATEGORY_TRACK)) {
- PlayerController* _tmp1_;
- gint _tmp2_;
- gint _tmp3_;
- PlayerController* _tmp4_;
- GeeArrayList* _tmp5_;
- gint _tmp6_;
- gint _tmp7_;
- _tmp1_ = self->priv->_owner;
- _tmp2_ = player_controller_get_menu_offset (_tmp1_);
- _tmp3_ = _tmp2_;
- _tmp4_ = self->priv->_owner;
- _tmp5_ = self->priv->_proxy_items;
- _tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
- _tmp7_ = _tmp6_;
- _result_ = (_tmp3_ + PLAYER_CONTROLLER_WIDGET_QUANTITY) + _tmp7_;
+ if (self->priv->of_type == SPECIFIC_ITEMS_MANAGER_CATEGORY_TRACK) {
+ gint _tmp0_;
+ gint _tmp1_;
+ _tmp0_ = player_controller_get_menu_offset (self->priv->_owner);
+ _tmp1_ = gee_collection_get_size ((GeeCollection*) self->priv->_proxy_items);
+ _result_ = (_tmp0_ + PLAYER_CONTROLLER_WIDGET_QUANTITY) + _tmp1_;
} else {
- gint _tmp8_;
- _tmp8_ = self->priv->of_type;
- if (_tmp8_ == ((gint) SPECIFIC_ITEMS_MANAGER_CATEGORY_PLAYER)) {
- PlayerController* _tmp9_;
- gint _tmp10_;
- gint _tmp11_;
- PlayerController* _tmp12_;
- PlayerController* _tmp13_;
- gint _tmp14_ = 0;
+ if (self->priv->of_type == SPECIFIC_ITEMS_MANAGER_CATEGORY_PLAYER) {
+ gint _tmp2_;
+ gint _tmp3_;
gint pos;
- gint _tmp15_ = 0;
- PlayerController* _tmp16_;
- gboolean* _tmp17_;
- gboolean _tmp18_;
- gint _tmp19_;
- gint _tmp20_;
- gint _tmp21_;
- _tmp9_ = self->priv->_owner;
- _tmp10_ = player_controller_get_menu_offset (_tmp9_);
- _tmp11_ = _tmp10_;
- _tmp12_ = self->priv->_owner;
- _tmp13_ = self->priv->_owner;
- _tmp14_ = player_controller_track_specific_count (_tmp13_);
- pos = (_tmp11_ + PLAYER_CONTROLLER_WIDGET_QUANTITY) + _tmp14_;
- _tmp16_ = self->priv->_owner;
- _tmp17_ = _tmp16_->use_playlists;
- _tmp18_ = TRUE;
- if (_bool_equal (_tmp17_, &_tmp18_) == TRUE) {
- _tmp15_ = 1;
+ gint _tmp4_ = 0;
+ gboolean _tmp5_;
+ _tmp2_ = player_controller_get_menu_offset (self->priv->_owner);
+ _tmp3_ = player_controller_track_specific_count (self->priv->_owner);
+ pos = (_tmp2_ + PLAYER_CONTROLLER_WIDGET_QUANTITY) + _tmp3_;
+ _tmp5_ = TRUE;
+ if (_bool_equal (self->priv->_owner->use_playlists, &_tmp5_) == TRUE) {
+ _tmp4_ = 1;
} else {
- _tmp15_ = 0;
+ _tmp4_ = 0;
}
- _tmp19_ = pos;
- _tmp20_ = _tmp15_;
- pos = _tmp19_ + _tmp20_;
- _tmp21_ = pos;
- _result_ = _tmp21_;
+ pos = pos + _tmp4_;
+ _result_ = pos;
}
}
- _tmp22_ = self->priv->of_type;
- _tmp23_ = _result_;
- g_debug ("specific-items-manager.vala:63: !!!!! Menu pos of type %i is = %i", _tmp22_, _tmp23_);
+ g_debug ("specific-items-manager.vala:63: !!!!! Menu pos of type %i is = %i", self->priv->of_type, _result_);
result = _result_;
return result;
}
@@ -315,136 +265,78 @@ static void _specific_items_manager_on_child_removed_dbusmenu_menuitem_child_rem
static void specific_items_manager_on_root_changed (SpecificItemsManager* self, GObject* newroot) {
- GObject* _tmp0_;
- DbusmenuClient* _tmp19_;
- DbusmenuMenuitem* _tmp20_ = NULL;
- DbusmenuMenuitem* _tmp21_;
+ DbusmenuMenuitem* _tmp4_ = NULL;
+ DbusmenuMenuitem* _tmp5_;
DbusmenuMenuitem* root;
- DbusmenuMenuitem* _tmp22_;
- DbusmenuMenuitem* _tmp23_;
- DbusmenuMenuitem* _tmp24_;
- GList* _tmp25_ = NULL;
- GList* _tmp26_ = NULL;
+ GList* _tmp6_ = NULL;
+ GList* _tmp7_ = NULL;
GList* children;
- GList* _tmp27_;
g_return_if_fail (self != NULL);
- _tmp0_ = newroot;
- if (_tmp0_ == NULL) {
- GeeArrayList* _tmp15_;
- GeeArrayList* _tmp16_;
- gint _tmp17_;
- gint _tmp18_;
+ if (newroot == NULL) {
+ gint _tmp3_;
g_debug ("specific-items-manager.vala:70: root disappeared -remove proxyitems");
{
- GeeArrayList* _tmp1_;
- GeeArrayList* _tmp2_;
+ GeeArrayList* _tmp0_;
GeeArrayList* _p_list;
- GeeArrayList* _tmp3_;
- gint _tmp4_;
- gint _tmp5_;
+ gint _tmp1_;
gint _p_size;
gint _p_index;
- _tmp1_ = self->priv->_proxy_items;
- _tmp2_ = _g_object_ref0 (_tmp1_);
- _p_list = _tmp2_;
- _tmp3_ = _p_list;
- _tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
- _tmp5_ = _tmp4_;
- _p_size = _tmp5_;
+ _tmp0_ = _g_object_ref0 (self->priv->_proxy_items);
+ _p_list = _tmp0_;
+ _tmp1_ = gee_collection_get_size ((GeeCollection*) _p_list);
+ _p_size = _tmp1_;
_p_index = -1;
while (TRUE) {
- gint _tmp6_;
- gint _tmp7_;
- gint _tmp8_;
- GeeArrayList* _tmp9_;
- gint _tmp10_;
- gpointer _tmp11_ = NULL;
+ gpointer _tmp2_ = NULL;
DbusmenuMenuitemProxy* p;
- PlayerController* _tmp12_;
- DbusmenuMenuitem* _tmp13_;
- DbusmenuMenuitemProxy* _tmp14_;
- _tmp6_ = _p_index;
- _p_index = _tmp6_ + 1;
- _tmp7_ = _p_index;
- _tmp8_ = _p_size;
- if (!(_tmp7_ < _tmp8_)) {
+ _p_index = _p_index + 1;
+ if (!(_p_index < _p_size)) {
break;
}
- _tmp9_ = _p_list;
- _tmp10_ = _p_index;
- _tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _tmp10_);
- p = (DbusmenuMenuitemProxy*) _tmp11_;
- _tmp12_ = self->priv->_owner;
- _tmp13_ = _tmp12_->root_menu;
- _tmp14_ = p;
- dbusmenu_menuitem_child_delete (_tmp13_, (DbusmenuMenuitem*) _tmp14_);
+ _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) _p_list, _p_index);
+ p = (DbusmenuMenuitemProxy*) _tmp2_;
+ dbusmenu_menuitem_child_delete (self->priv->_owner->root_menu, (DbusmenuMenuitem*) p);
_g_object_unref0 (p);
}
_g_object_unref0 (_p_list);
}
- _tmp15_ = self->priv->_proxy_items;
- gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp15_);
- _tmp16_ = self->priv->_proxy_items;
- _tmp17_ = gee_collection_get_size ((GeeCollection*) _tmp16_);
- _tmp18_ = _tmp17_;
- g_debug ("specific-items-manager.vala:75: array list size is now %i", _tmp18_);
+ gee_abstract_collection_clear ((GeeAbstractCollection*) self->priv->_proxy_items);
+ _tmp3_ = gee_collection_get_size ((GeeCollection*) self->priv->_proxy_items);
+ g_debug ("specific-items-manager.vala:75: array list size is now %i", _tmp3_);
return;
}
- _tmp19_ = self->priv->client;
- _tmp20_ = dbusmenu_client_get_root (_tmp19_);
- _tmp21_ = _g_object_ref0 (_tmp20_);
- root = _tmp21_;
- _tmp22_ = root;
- g_signal_connect_object (_tmp22_, "child-added", (GCallback) _specific_items_manager_on_child_added_dbusmenu_menuitem_child_added, self, 0);
- _tmp23_ = root;
- g_signal_connect_object (_tmp23_, "child-removed", (GCallback) _specific_items_manager_on_child_removed_dbusmenu_menuitem_child_removed, self, 0);
- _tmp24_ = root;
- _tmp25_ = dbusmenu_menuitem_get_children (_tmp24_);
- _tmp26_ = g_list_copy (_tmp25_);
- children = _tmp26_;
- _tmp27_ = children;
+ _tmp4_ = dbusmenu_client_get_root (self->priv->client);
+ _tmp5_ = _g_object_ref0 (_tmp4_);
+ root = _tmp5_;
+ g_signal_connect_object (root, "child-added", (GCallback) _specific_items_manager_on_child_added_dbusmenu_menuitem_child_added, self, 0);
+ g_signal_connect_object (root, "child-removed", (GCallback) _specific_items_manager_on_child_removed_dbusmenu_menuitem_child_removed, self, 0);
+ _tmp6_ = dbusmenu_menuitem_get_children (root);
+ _tmp7_ = g_list_copy (_tmp6_);
+ children = _tmp7_;
{
- GList* child_collection = NULL;
- GList* child_it = NULL;
- child_collection = _tmp27_;
+ GList* child_collection;
+ GList* child_it;
+ child_collection = children;
for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
- void* child = NULL;
+ void* child;
child = child_it->data;
{
- gint _tmp28_ = 0;
+ gint _tmp8_;
gint pos;
- void* _tmp29_;
DbusmenuMenuitem* item;
- DbusmenuMenuitem* _tmp30_;
- DbusmenuMenuitemProxy* _tmp31_;
+ DbusmenuMenuitemProxy* _tmp9_ = NULL;
DbusmenuMenuitemProxy* proxy;
- GeeArrayList* _tmp32_;
- DbusmenuMenuitemProxy* _tmp33_;
- DbusmenuMenuitem* _tmp34_;
- const gchar* _tmp35_ = NULL;
- PlayerController* _tmp36_;
- DbusmenuMenuitem* _tmp37_;
- DbusmenuMenuitemProxy* _tmp38_;
- gint _tmp39_;
- _tmp28_ = specific_items_manager_figure_out_positioning (self);
- pos = _tmp28_;
- _tmp29_ = child;
- item = DBUSMENU_MENUITEM (_tmp29_);
- _tmp30_ = item;
- _tmp31_ = dbusmenu_menuitem_proxy_new (_tmp30_);
- proxy = _tmp31_;
- _tmp32_ = self->priv->_proxy_items;
- _tmp33_ = proxy;
- gee_abstract_collection_add ((GeeAbstractCollection*) _tmp32_, _tmp33_);
- _tmp34_ = item;
- _tmp35_ = dbusmenu_menuitem_property_get (_tmp34_, DBUSMENU_MENUITEM_PROP_LABEL);
+ const gchar* _tmp10_ = NULL;
+ _tmp8_ = specific_items_manager_figure_out_positioning (self);
+ pos = _tmp8_;
+ item = DBUSMENU_MENUITEM (child);
+ _tmp9_ = dbusmenu_menuitem_proxy_new (item);
+ proxy = _tmp9_;
+ gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->_proxy_items, proxy);
+ _tmp10_ = dbusmenu_menuitem_property_get (item, DBUSMENU_MENUITEM_PROP_LABEL);
g_debug ("specific-items-manager.vala:92: Proxy item of label = %s added to coll" \
-"ection", _tmp35_);
- _tmp36_ = self->priv->_owner;
- _tmp37_ = _tmp36_->root_menu;
- _tmp38_ = proxy;
- _tmp39_ = pos;
- dbusmenu_menuitem_child_add_position (_tmp37_, (DbusmenuMenuitem*) _tmp38_, (guint) _tmp39_);
+"ection", _tmp10_);
+ dbusmenu_menuitem_child_add_position (self->priv->_owner->root_menu, (DbusmenuMenuitem*) proxy, (guint) pos);
_g_object_unref0 (proxy);
}
}
@@ -470,43 +362,35 @@ static void specific_items_manager_on_child_removed (SpecificItemsManager* self,
static PlayerController* specific_items_manager_get_owner (SpecificItemsManager* self) {
PlayerController* result;
- PlayerController* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = self->priv->_owner;
- result = _tmp0_;
+ result = self->priv->_owner;
return result;
}
static void specific_items_manager_set_owner (SpecificItemsManager* self, PlayerController* value) {
PlayerController* _tmp0_;
- PlayerController* _tmp1_;
g_return_if_fail (self != NULL);
- _tmp0_ = value;
- _tmp1_ = _g_object_ref0 (_tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
_g_object_unref0 (self->priv->_owner);
- self->priv->_owner = _tmp1_;
+ self->priv->_owner = _tmp0_;
}
GeeArrayList* specific_items_manager_get_proxy_items (SpecificItemsManager* self) {
GeeArrayList* result;
- GeeArrayList* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = self->priv->_proxy_items;
- result = _tmp0_;
+ result = self->priv->_proxy_items;
return result;
}
static void specific_items_manager_set_proxy_items (SpecificItemsManager* self, GeeArrayList* value) {
GeeArrayList* _tmp0_;
- GeeArrayList* _tmp1_;
g_return_if_fail (self != NULL);
- _tmp0_ = value;
- _tmp1_ = _g_object_ref0 (_tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
_g_object_unref0 (self->priv->_proxy_items);
- self->priv->_proxy_items = _tmp1_;
+ self->priv->_proxy_items = _tmp0_;
g_object_notify ((GObject *) self, "proxy-items");
}
@@ -515,7 +399,7 @@ static GObject * specific_items_manager_constructor (GType type, guint n_constru
GObject * obj;
GObjectClass * parent_class;
SpecificItemsManager * self;
- GeeArrayList* _tmp0_;
+ GeeArrayList* _tmp0_ = NULL;
GeeArrayList* _tmp1_;
parent_class = G_OBJECT_CLASS (specific_items_manager_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);