aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/familiar-players-db.c530
-rw-r--r--src/familiar-players-db.vala7
-rw-r--r--src/fetch-file.c284
-rw-r--r--src/fetch-file.vala2
-rw-r--r--src/indicator-sound.c108
-rw-r--r--src/metadata-menu-item.c390
-rw-r--r--src/metadata-menu-item.vala2
-rw-r--r--src/mpris2-controller.c741
-rw-r--r--src/music-player-bridge.c299
-rw-r--r--src/music-player-bridge.h74
-rw-r--r--src/player-controller.c422
-rw-r--r--src/player-item.c241
-rw-r--r--src/title-menu-item.c46
-rw-r--r--src/title-widget.c34
-rw-r--r--src/transport-menu-item.c39
-rw-r--r--src/transport-widget.c836
-rw-r--r--src/transport-widget.h6
17 files changed, 2637 insertions, 1424 deletions
diff --git a/src/familiar-players-db.c b/src/familiar-players-db.c
index 4adf129..7b082a2 100644
--- a/src/familiar-players-db.c
+++ b/src/familiar-players-db.c
@@ -1,4 +1,4 @@
-/* familiar-players-db.c generated by valac 0.10.0, the Vala compiler
+/* familiar-players-db.c generated by valac 0.11.2, the Vala compiler
* generated from familiar-players-db.vala, do not modify */
/*
@@ -54,8 +54,8 @@ struct _FamiliarPlayersDBClass {
struct _FamiliarPlayersDBPrivate {
GeeHashMap* players_DB;
- char* file_name;
- char* dir_name;
+ gchar* file_name;
+ gchar* dir_name;
GKeyFile* key_file;
guint write_id;
};
@@ -77,49 +77,72 @@ static gboolean familiar_players_db_create_key_file (FamiliarPlayersDB* self);
static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self);
static gboolean familiar_players_db_check_for_keys (FamiliarPlayersDB* self);
static gboolean familiar_players_db_load_data_from_key_file (FamiliarPlayersDB* self);
-static void _vala_array_add1 (char*** array, int* length, int* size, char* value);
-void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop);
-gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop);
+static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
+void familiar_players_db_insert (FamiliarPlayersDB* self, const gchar* desktop);
+gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const gchar* desktop);
static gboolean _familiar_players_db_write_db_gsource_func (gpointer self);
GeeSet* familiar_players_db_records (FamiliarPlayersDB* self);
-char* familiar_players_db_fetch_icon_name (const char* desktop_path);
+gchar* familiar_players_db_fetch_icon_name (const gchar* desktop_path);
static void familiar_players_db_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
-
FamiliarPlayersDB* familiar_players_db_construct (GType object_type) {
- FamiliarPlayersDB * self;
- GeeHashMap* _tmp0_;
- char* _tmp1_;
- char* _tmp2_;
- gboolean _tmp3_ = FALSE;
- gboolean _tmp4_ = FALSE;
+ FamiliarPlayersDB * self = NULL;
+ GeeHashMap* _tmp0_ = NULL;
+ GeeHashMap* _tmp1_;
+ gboolean _tmp2_;
+ const gchar* _tmp3_ = NULL;
+ gchar* _tmp4_ = NULL;
+ gchar* _tmp5_;
+ gchar* _tmp6_ = NULL;
+ gchar* _tmp7_;
+ gboolean _tmp8_ = FALSE;
+ gboolean _tmp9_ = FALSE;
+ gboolean _tmp10_;
self = (FamiliarPlayersDB*) g_object_new (object_type, NULL);
self->priv->write_id = (guint) 0;
- self->priv->players_DB = (_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_BOOLEAN, NULL, NULL, NULL, NULL, NULL), _g_object_unref0 (self->priv->players_DB), _tmp0_);
- if (!familiar_players_db_create_key_file (self)) {
+ _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_BOOLEAN, NULL, NULL, NULL, NULL, NULL);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->players_DB);
+ self->priv->players_DB = _tmp1_;
+ _tmp2_ = familiar_players_db_create_key_file (self);
+ if (!_tmp2_) {
gee_abstract_map_set ((GeeAbstractMap*) self->priv->players_DB, FAMILIAR_PLAYERS_DB_DEFAULT_APP_DESKTOP, GINT_TO_POINTER (TRUE));
familiar_players_db_write_db (self);
}
- self->priv->dir_name = (_tmp1_ = g_build_filename (g_get_user_cache_dir (), "indicators", "sound", NULL), _g_free0 (self->priv->dir_name), _tmp1_);
- self->priv->file_name = (_tmp2_ = g_build_filename (self->priv->dir_name, "familiar-players-db.keyfile", NULL), _g_free0 (self->priv->file_name), _tmp2_);
- if (familiar_players_db_create_key_file (self)) {
- _tmp4_ = familiar_players_db_check_for_keys (self);
+ _tmp3_ = g_get_user_cache_dir ();
+ _tmp4_ = g_build_filename (_tmp3_, "indicators", "sound", NULL);
+ _tmp5_ = _tmp4_;
+ _g_free0 (self->priv->dir_name);
+ self->priv->dir_name = _tmp5_;
+ _tmp6_ = g_build_filename (self->priv->dir_name, "familiar-players-db.keyfile", NULL);
+ _tmp7_ = _tmp6_;
+ _g_free0 (self->priv->file_name);
+ self->priv->file_name = _tmp7_;
+ _tmp10_ = familiar_players_db_create_key_file (self);
+ if (_tmp10_) {
+ gboolean _tmp11_;
+ _tmp11_ = familiar_players_db_check_for_keys (self);
+ _tmp9_ = _tmp11_;
} else {
- _tmp4_ = FALSE;
+ _tmp9_ = FALSE;
}
- if (_tmp4_) {
- _tmp3_ = familiar_players_db_load_data_from_key_file (self);
+ if (_tmp9_) {
+ gboolean _tmp12_;
+ _tmp12_ = familiar_players_db_load_data_from_key_file (self);
+ _tmp8_ = _tmp12_;
} else {
- _tmp3_ = FALSE;
+ _tmp8_ = FALSE;
}
- if (_tmp3_) {
+ if (_tmp8_) {
g_debug ("familiar-players-db.vala:51: keyfiles in place and ready for action");
} else {
- GKeyFile* _tmp5_;
- self->priv->key_file = (_tmp5_ = NULL, _g_key_file_free0 (self->priv->key_file), _tmp5_);
+ GKeyFile* _tmp13_;
+ _tmp13_ = NULL;
+ _g_key_file_free0 (self->priv->key_file);
+ self->priv->key_file = _tmp13_;
g_warning ("familiar-players-db.vala:55: FamiliarPlayersDB:: problems loading key " \
"file - can't go any further");
}
@@ -135,39 +158,43 @@ FamiliarPlayersDB* familiar_players_db_new (void) {
static gboolean familiar_players_db_create_key_file (FamiliarPlayersDB* self) {
gboolean result = FALSE;
gboolean _result_;
+ gboolean _tmp0_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
_result_ = FALSE;
- if (g_file_test (self->priv->file_name, G_FILE_TEST_EXISTS)) {
- GKeyFile* _tmp0_;
- self->priv->key_file = (_tmp0_ = g_key_file_new (), _g_key_file_free0 (self->priv->key_file), _tmp0_);
- {
- gboolean _tmp1_;
- _tmp1_ = g_key_file_load_from_file (self->priv->key_file, self->priv->file_name, G_KEY_FILE_NONE, &_inner_error_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_KEY_FILE_ERROR) {
- goto __catch6_g_key_file_error;
- }
- if (_inner_error_->domain == G_FILE_ERROR) {
- goto __catch6_g_file_error;
- }
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return FALSE;
+ _tmp0_ = g_file_test (self->priv->file_name, G_FILE_TEST_EXISTS);
+ if (_tmp0_) {
+ GKeyFile* _tmp1_ = NULL;
+ GKeyFile* _tmp2_;
+ gboolean _tmp3_;
+ gboolean _tmp4_;
+ _tmp1_ = g_key_file_new ();
+ _tmp2_ = _tmp1_;
+ _g_key_file_free0 (self->priv->key_file);
+ self->priv->key_file = _tmp2_;
+ _tmp3_ = g_key_file_load_from_file (self->priv->key_file, self->priv->file_name, G_KEY_FILE_NONE, &_inner_error_);
+ _tmp4_ = _tmp3_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_KEY_FILE_ERROR) {
+ goto __catch6_g_key_file_error;
+ }
+ if (_inner_error_->domain == G_FILE_ERROR) {
+ goto __catch6_g_file_error;
}
- _result_ = _tmp1_;
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
}
+ _result_ = _tmp4_;
goto __finally6;
__catch6_g_key_file_error:
{
GError * e;
e = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("familiar-players-db.vala:67: FamiliarPlayersDB::create_key_file() - Ke" \
+ g_warning ("familiar-players-db.vala:67: FamiliarPlayersDB::create_key_file() - Ke" \
"yFileError");
- _g_error_free0 (e);
- }
+ _g_error_free0 (e);
}
goto __finally6;
__catch6_g_file_error:
@@ -175,11 +202,9 @@ static gboolean familiar_players_db_create_key_file (FamiliarPlayersDB* self) {
GError * e;
e = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("familiar-players-db.vala:70: FamiliarPlayersDB::create_key_file() - Fi" \
+ g_warning ("familiar-players-db.vala:70: FamiliarPlayersDB::create_key_file() - Fi" \
"leError");
- _g_error_free0 (e);
- }
+ _g_error_free0 (e);
}
__finally6:
if (_inner_error_ != NULL) {
@@ -195,23 +220,23 @@ static gboolean familiar_players_db_create_key_file (FamiliarPlayersDB* self) {
static gboolean familiar_players_db_check_for_keys (FamiliarPlayersDB* self) {
gboolean result = FALSE;
+ gboolean _tmp0_;
+ gboolean _tmp1_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
- {
- gboolean _tmp0_;
- _tmp0_ = g_key_file_has_key (self->priv->key_file, FAMILIAR_PLAYERS_DB_GROUP_NAME, FAMILIAR_PLAYERS_DB_KEY_NAME, &_inner_error_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_KEY_FILE_ERROR) {
- goto __catch7_g_key_file_error;
- }
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return FALSE;
- }
- if (_tmp0_ == TRUE) {
- result = TRUE;
- return result;
+ _tmp0_ = g_key_file_has_key (self->priv->key_file, FAMILIAR_PLAYERS_DB_GROUP_NAME, FAMILIAR_PLAYERS_DB_KEY_NAME, &_inner_error_);
+ _tmp1_ = _tmp0_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_KEY_FILE_ERROR) {
+ goto __catch7_g_key_file_error;
}
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ if (_tmp1_ == TRUE) {
+ result = TRUE;
+ return result;
}
goto __finally7;
__catch7_g_key_file_error:
@@ -219,11 +244,9 @@ static gboolean familiar_players_db_check_for_keys (FamiliarPlayersDB* self) {
GError * e;
e = _inner_error_;
_inner_error_ = NULL;
- {
- result = FALSE;
- _g_error_free0 (e);
- return result;
- }
+ result = FALSE;
+ _g_error_free0 (e);
+ return result;
}
__finally7:
if (_inner_error_ != NULL) {
@@ -240,68 +263,70 @@ static gboolean familiar_players_db_check_for_keys (FamiliarPlayersDB* self) {
static gboolean familiar_players_db_load_data_from_key_file (FamiliarPlayersDB* self) {
gboolean result = FALSE;
+ gsize _tmp0_;
+ gchar** _tmp1_ = NULL;
+ gint desktops_length1;
+ gint _desktops_size_;
+ gchar** _tmp2_;
+ gchar** desktops;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
- {
- gint desktops_length1;
- gint _desktops_size_;
- char** _tmp1_;
- gsize _tmp0_;
- char** desktops;
- desktops = (_tmp1_ = g_key_file_get_string_list (self->priv->key_file, FAMILIAR_PLAYERS_DB_GROUP_NAME, FAMILIAR_PLAYERS_DB_KEY_NAME, &_tmp0_, &_inner_error_), desktops_length1 = _tmp0_, _desktops_size_ = desktops_length1, _tmp1_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_KEY_FILE_ERROR) {
- goto __catch8_g_key_file_error;
- }
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return FALSE;
+ _tmp1_ = g_key_file_get_string_list (self->priv->key_file, FAMILIAR_PLAYERS_DB_GROUP_NAME, FAMILIAR_PLAYERS_DB_KEY_NAME, &_tmp0_, &_inner_error_);
+ _tmp2_ = _tmp1_;
+ desktops_length1 = _tmp0_;
+ _desktops_size_ = desktops_length1;
+ desktops = _tmp2_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_KEY_FILE_ERROR) {
+ goto __catch8_g_key_file_error;
}
- {
- char** s_collection;
- int s_collection_length1;
- int s_it;
- s_collection = desktops;
- s_collection_length1 = desktops_length1;
- for (s_it = 0; s_it < desktops_length1; s_it = s_it + 1) {
- char* s;
- s = g_strdup (s_collection[s_it]);
- {
- gee_abstract_map_set ((GeeAbstractMap*) self->priv->players_DB, s, GINT_TO_POINTER (TRUE));
- _g_free0 (s);
- }
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ {
+ gchar** s_collection;
+ int s_collection_length1;
+ int s_it;
+ s_collection = desktops;
+ s_collection_length1 = desktops_length1;
+ for (s_it = 0; s_it < desktops_length1; s_it = s_it + 1) {
+ gchar* _tmp3_;
+ gchar* s;
+ _tmp3_ = g_strdup (s_collection[s_it]);
+ s = _tmp3_;
+ {
+ gee_abstract_map_set ((GeeAbstractMap*) self->priv->players_DB, s, GINT_TO_POINTER (TRUE));
+ _g_free0 (s);
}
}
- result = TRUE;
- desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
- return result;
}
+ result = TRUE;
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ return result;
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
goto __finally8;
__catch8_g_key_file_error:
{
GError * _error_;
_error_ = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("familiar-players-db.vala:99: Error loading the Desktop string list");
- result = FALSE;
- _g_error_free0 (_error_);
- return result;
- }
+ g_warning ("familiar-players-db.vala:99: Error loading the Desktop string list");
+ result = FALSE;
+ _g_error_free0 (_error_);
+ return result;
}
__finally8:
- {
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return FALSE;
- }
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
}
-static void _vala_array_add1 (char*** array, int* length, int* size, char* value) {
+static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) {
if ((*length) == (*size)) {
*size = (*size) ? (2 * (*size)) : 4;
- *array = g_renew (char*, *array, (*size) + 1);
+ *array = g_renew (gchar*, *array, (*size) + 1);
}
(*array)[(*length)++] = value;
(*array)[*length] = NULL;
@@ -310,55 +335,77 @@ static void _vala_array_add1 (char*** array, int* length, int* size, char* value
static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) {
gboolean result = FALSE;
+ GKeyFile* _tmp0_ = NULL;
GKeyFile* keyfile;
+ gchar** _tmp1_ = NULL;
gint desktops_length1;
gint _desktops_size_;
- char** _tmp1_;
- char** _tmp0_ = NULL;
- char** desktops;
+ gchar** _tmp2_;
+ gchar** desktops;
gsize data_length = 0UL;
- char* data;
+ gchar* data;
+ gsize _tmp10_;
+ gchar* _tmp11_ = NULL;
+ gchar* _tmp12_;
+ gint _tmp13_;
+ gboolean _tmp14_;
+ gboolean _tmp15_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
- keyfile = g_key_file_new ();
- desktops = (_tmp1_ = (_tmp0_ = g_new0 (char*, 0 + 1), _tmp0_), desktops_length1 = 0, _desktops_size_ = desktops_length1, _tmp1_);
+ _tmp0_ = g_key_file_new ();
+ keyfile = _tmp0_;
+ _tmp1_ = g_new0 (gchar*, 0 + 1);
+ _tmp2_ = _tmp1_;
+ desktops_length1 = 0;
+ _desktops_size_ = desktops_length1;
+ desktops = _tmp2_;
{
- GeeSet* _tmp2_;
- GeeIterator* _tmp3_;
+ GeeSet* _tmp3_ = NULL;
+ GeeSet* _tmp4_;
+ GeeIterator* _tmp5_ = NULL;
+ GeeIterator* _tmp6_;
GeeIterator* _key_it;
- _key_it = (_tmp3_ = gee_iterable_iterator ((GeeIterable*) (_tmp2_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB))), _g_object_unref0 (_tmp2_), _tmp3_);
+ _tmp3_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB);
+ _tmp4_ = _tmp3_;
+ _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
+ _key_it = (_tmp6_ = _tmp5_, _g_object_unref0 (_tmp4_), _tmp6_);
while (TRUE) {
- char* key;
- if (!gee_iterator_next (_key_it)) {
+ gboolean _tmp7_;
+ gpointer _tmp8_ = NULL;
+ gchar* key;
+ gchar* _tmp9_;
+ _tmp7_ = gee_iterator_next (_key_it);
+ if (!_tmp7_) {
break;
}
- key = (char*) gee_iterator_get (_key_it);
- _vala_array_add1 (&desktops, &desktops_length1, &_desktops_size_, g_strdup (key));
+ _tmp8_ = gee_iterator_get (_key_it);
+ key = (gchar*) _tmp8_;
+ _tmp9_ = g_strdup (key);
+ _vala_array_add1 (&desktops, &desktops_length1, &_desktops_size_, _tmp9_);
_g_free0 (key);
}
_g_object_unref0 (_key_it);
}
g_key_file_set_string_list (keyfile, FAMILIAR_PLAYERS_DB_GROUP_NAME, FAMILIAR_PLAYERS_DB_KEY_NAME, (const gchar* const*) desktops, desktops_length1);
data = NULL;
- {
- char* _tmp4_;
- data = (_tmp4_ = g_key_file_to_data (keyfile, &data_length, NULL), _g_free0 (data), _tmp4_);
- }
+ _tmp11_ = g_key_file_to_data (keyfile, &_tmp10_, NULL);
+ data_length = _tmp10_;
+ _tmp12_ = _tmp11_;
+ _g_free0 (data);
+ data = _tmp12_;
goto __finally9;
__catch9_g_key_file_error:
{
GError * e;
e = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("familiar-players-db.vala:120: Problems dumping keyfile to a string");
- result = FALSE;
- _g_error_free0 (e);
- _g_free0 (data);
- desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
- _g_key_file_free0 (keyfile);
- return result;
- }
+ g_warning ("familiar-players-db.vala:120: Problems dumping keyfile to a string");
+ result = FALSE;
+ _g_error_free0 (e);
+ _g_free0 (data);
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ _g_key_file_free0 (keyfile);
+ return result;
}
__finally9:
if (_inner_error_ != NULL) {
@@ -369,7 +416,8 @@ static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) {
g_clear_error (&_inner_error_);
return FALSE;
}
- if (g_mkdir_with_parents (self->priv->dir_name, 0700) != 0) {
+ _tmp13_ = g_mkdir_with_parents (self->priv->dir_name, 0700);
+ if (_tmp13_ != 0) {
g_warning ("familiar-players-db.vala:125: Unable to make directory: %s", self->priv->dir_name);
result = FALSE;
_g_free0 (data);
@@ -377,23 +425,21 @@ static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) {
_g_key_file_free0 (keyfile);
return result;
}
- {
- gboolean _tmp5_;
- _tmp5_ = g_file_set_contents (self->priv->file_name, data, (gssize) data_length, &_inner_error_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_FILE_ERROR) {
- goto __catch10_g_file_error;
- }
- _g_free0 (data);
- desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
- _g_key_file_free0 (keyfile);
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return FALSE;
- }
- if (_tmp5_ == FALSE) {
- g_warning ("familiar-players-db.vala:131: Unable to write out file '%s'", self->priv->file_name);
+ _tmp14_ = g_file_set_contents (self->priv->file_name, data, (gssize) data_length, &_inner_error_);
+ _tmp15_ = _tmp14_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_FILE_ERROR) {
+ goto __catch10_g_file_error;
}
+ _g_free0 (data);
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ _g_key_file_free0 (keyfile);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ if (_tmp15_ == FALSE) {
+ g_warning ("familiar-players-db.vala:131: Unable to write out file '%s'", self->priv->file_name);
}
goto __finally10;
__catch10_g_file_error:
@@ -401,10 +447,8 @@ static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) {
GError * err;
err = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("familiar-players-db.vala:135: Unable to write out file '%s'", self->priv->file_name);
- _g_error_free0 (err);
- }
+ g_warning ("familiar-players-db.vala:135: Unable to write out file '%s'", self->priv->file_name);
+ _g_error_free0 (err);
}
__finally10:
if (_inner_error_ != NULL) {
@@ -430,72 +474,106 @@ static gboolean _familiar_players_db_write_db_gsource_func (gpointer self) {
}
-void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop) {
+void familiar_players_db_insert (FamiliarPlayersDB* self, const gchar* desktop) {
+ gboolean _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (desktop != NULL);
- if (familiar_players_db_already_familiar (self, desktop) == FALSE) {
- char* _tmp0_;
+ _tmp0_ = familiar_players_db_already_familiar (self, desktop);
+ if (_tmp0_ == FALSE) {
+ guint _tmp1_;
+ gchar* _tmp2_ = NULL;
+ gchar* _tmp3_;
if (self->priv->write_id != 0) {
g_source_remove (self->priv->write_id);
self->priv->write_id = (guint) 0;
}
- self->priv->write_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 60, _familiar_players_db_write_db_gsource_func, g_object_ref (self), g_object_unref);
- gee_abstract_map_set ((GeeAbstractMap*) self->priv->players_DB, _tmp0_ = g_strdup (desktop), GINT_TO_POINTER (TRUE));
- _g_free0 (_tmp0_);
+ _tmp1_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 60, _familiar_players_db_write_db_gsource_func, g_object_ref (self), g_object_unref);
+ self->priv->write_id = _tmp1_;
+ _tmp2_ = g_strdup (desktop);
+ _tmp3_ = _tmp2_;
+ gee_abstract_map_set ((GeeAbstractMap*) self->priv->players_DB, _tmp3_, GINT_TO_POINTER (TRUE));
+ _g_free0 (_tmp3_);
}
}
-static char* bool_to_string (gboolean self) {
- char* result = NULL;
+static gchar* bool_to_string (gboolean self) {
+ gchar* result = NULL;
if (self) {
- result = g_strdup ("true");
+ gchar* _tmp0_;
+ _tmp0_ = g_strdup ("true");
+ result = _tmp0_;
return result;
} else {
- result = g_strdup ("false");
+ gchar* _tmp1_;
+ _tmp1_ = g_strdup ("false");
+ result = _tmp1_;
return result;
}
}
-gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop) {
+gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const gchar* desktop) {
gboolean result = FALSE;
- GeeSet* _tmp0_;
- char* _tmp1_;
- GeeSet* _tmp2_;
- gboolean _tmp3_;
+ GeeSet* _tmp0_ = NULL;
+ GeeSet* _tmp1_;
+ gboolean _tmp2_;
+ gchar* _tmp3_ = NULL;
+ gchar* _tmp4_;
+ GeeSet* _tmp5_ = NULL;
+ GeeSet* _tmp6_;
+ gboolean _tmp7_;
+ gboolean _tmp8_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (desktop != NULL, FALSE);
- g_debug ("familiar-players-db.vala:154: playerDB->already_familiar - result %s", _tmp1_ = bool_to_string (gee_collection_contains ((GeeCollection*) (_tmp0_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB)), desktop)));
- _g_free0 (_tmp1_);
- _g_object_unref0 (_tmp0_);
- result = (_tmp3_ = gee_collection_contains ((GeeCollection*) (_tmp2_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB)), desktop), _g_object_unref0 (_tmp2_), _tmp3_);
+ _tmp0_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB);
+ _tmp1_ = _tmp0_;
+ _tmp2_ = gee_collection_contains ((GeeCollection*) _tmp1_, desktop);
+ _tmp3_ = bool_to_string (_tmp2_);
+ _tmp4_ = _tmp3_;
+ g_debug ("familiar-players-db.vala:154: playerDB->already_familiar - result %s", _tmp4_);
+ _g_free0 (_tmp4_);
+ _g_object_unref0 (_tmp1_);
+ _tmp5_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB);
+ _tmp6_ = _tmp5_;
+ _tmp7_ = gee_collection_contains ((GeeCollection*) _tmp6_, desktop);
+ result = (_tmp8_ = _tmp7_, _g_object_unref0 (_tmp6_), _tmp8_);
return result;
}
GeeSet* familiar_players_db_records (FamiliarPlayersDB* self) {
GeeSet* result = NULL;
+ GeeSet* _tmp0_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
- result = gee_map_get_keys ((GeeMap*) self->priv->players_DB);
+ _tmp0_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB);
+ result = _tmp0_;
return result;
}
-char* familiar_players_db_fetch_icon_name (const char* desktop_path) {
- char* result = NULL;
+gchar* familiar_players_db_fetch_icon_name (const gchar* desktop_path) {
+ gchar* result = NULL;
+ GKeyFile* _tmp0_ = NULL;
GKeyFile* desktop_keyfile;
+ gchar* _tmp1_ = NULL;
+ gchar* _tmp2_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (desktop_path != NULL, NULL);
- desktop_keyfile = g_key_file_new ();
- {
- g_key_file_load_from_file (desktop_keyfile, desktop_path, G_KEY_FILE_NONE, &_inner_error_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_FILE_ERROR) {
- goto __catch11_g_file_error;
- }
- goto __finally11;
+ _tmp0_ = g_key_file_new ();
+ desktop_keyfile = _tmp0_;
+ g_key_file_load_from_file (desktop_keyfile, desktop_path, G_KEY_FILE_NONE, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_FILE_ERROR) {
+ goto __catch11_g_file_error;
}
+ if (_inner_error_->domain == G_KEY_FILE_ERROR) {
+ goto __catch11_g_key_file_error;
+ }
+ _g_key_file_free0 (desktop_keyfile);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return NULL;
}
goto __finally11;
__catch11_g_file_error:
@@ -503,13 +581,23 @@ char* familiar_players_db_fetch_icon_name (const char* desktop_path) {
GError * _error_;
_error_ = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("familiar-players-db.vala:170: Error loading keyfile");
- result = NULL;
- _g_error_free0 (_error_);
- _g_key_file_free0 (desktop_keyfile);
- return result;
- }
+ g_warning ("familiar-players-db.vala:170: Error loading keyfile - FileError");
+ result = NULL;
+ _g_error_free0 (_error_);
+ _g_key_file_free0 (desktop_keyfile);
+ return result;
+ }
+ goto __finally11;
+ __catch11_g_key_file_error:
+ {
+ GError * _error_;
+ _error_ = _inner_error_;
+ _inner_error_ = NULL;
+ g_warning ("familiar-players-db.vala:174: Error loading keyfile - KeyFileError");
+ result = NULL;
+ _g_error_free0 (_error_);
+ _g_key_file_free0 (desktop_keyfile);
+ return result;
}
__finally11:
if (_inner_error_ != NULL) {
@@ -518,45 +606,38 @@ char* familiar_players_db_fetch_icon_name (const char* desktop_path) {
g_clear_error (&_inner_error_);
return NULL;
}
- {
- char* _tmp0_;
- _tmp0_ = g_key_file_get_string (desktop_keyfile, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, &_inner_error_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_KEY_FILE_ERROR) {
- goto __catch12_g_key_file_error;
- }
- _g_key_file_free0 (desktop_keyfile);
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return NULL;
+ _tmp1_ = g_key_file_get_string (desktop_keyfile, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, &_inner_error_);
+ _tmp2_ = _tmp1_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_KEY_FILE_ERROR) {
+ goto __catch12_g_key_file_error;
}
- result = _tmp0_;
_g_key_file_free0 (desktop_keyfile);
- return result;
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return NULL;
}
+ result = _tmp2_;
+ _g_key_file_free0 (desktop_keyfile);
+ return result;
goto __finally12;
__catch12_g_key_file_error:
{
GError * _error_;
_error_ = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("familiar-players-db.vala:178: Error trying to fetch the icon name from" \
+ g_warning ("familiar-players-db.vala:183: Error trying to fetch the icon name from" \
" the keyfile");
- result = NULL;
- _g_error_free0 (_error_);
- _g_key_file_free0 (desktop_keyfile);
- return result;
- }
- }
- __finally12:
- {
+ result = NULL;
+ _g_error_free0 (_error_);
_g_key_file_free0 (desktop_keyfile);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return NULL;
+ return result;
}
+ __finally12:
_g_key_file_free0 (desktop_keyfile);
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return NULL;
}
@@ -614,4 +695,3 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify
-
diff --git a/src/familiar-players-db.vala b/src/familiar-players-db.vala
index af7d07f..47ddc70 100644
--- a/src/familiar-players-db.vala
+++ b/src/familiar-players-db.vala
@@ -167,9 +167,14 @@ public class FamiliarPlayersDB : GLib.Object
desktop_keyfile.load_from_file (desktop_path, KeyFileFlags.NONE);
}
catch(GLib.FileError error){
- warning("Error loading keyfile");
+ warning("Error loading keyfile - FileError");
return null;
}
+ catch(GLib.KeyFileError error){
+ warning("Error loading keyfile - KeyFileError");
+ return null;
+ }
+
try{
return desktop_keyfile.get_string (KeyFileDesktop.GROUP,
KeyFileDesktop.KEY_ICON);
diff --git a/src/fetch-file.c b/src/fetch-file.c
index 2bf4bbf..680a582 100644
--- a/src/fetch-file.c
+++ b/src/fetch-file.c
@@ -1,4 +1,4 @@
-/* fetch-file.c generated by valac 0.10.0, the Vala compiler
+/* fetch-file.c generated by valac 0.11.2, the Vala compiler
* generated from fetch-file.vala, do not modify */
/*
@@ -56,8 +56,8 @@ struct _FetchFileClass {
};
struct _FetchFilePrivate {
- char* _uri;
- char* _intended_property;
+ gchar* _uri;
+ gchar* _intended_property;
GDataInputStream* stream;
GFile* file;
GByteArray* data;
@@ -65,33 +65,40 @@ struct _FetchFilePrivate {
struct _FetchFileFetchDataData {
int _state_;
+ GObject* _source_object_;
GAsyncResult* _res_;
GSimpleAsyncResult* _async_result;
FetchFile* self;
GFileInputStream* _tmp0_;
GFileInputStream* _tmp1_;
- GDataInputStream* _tmp2_;
+ GFileInputStream* _tmp2_;
+ GDataInputStream* _tmp3_;
+ GDataInputStream* _tmp4_;
GError * e;
GError * _inner_error_;
};
struct _FetchFileReadSomethingAsyncData {
int _state_;
+ GObject* _source_object_;
GAsyncResult* _res_;
GSimpleAsyncResult* _async_result;
FetchFile* self;
gssize size;
- guint8* buffer;
+ guint8* _tmp0_;
gint buffer_length1;
gint _buffer_size_;
- guint8* _tmp0_;
+ guint8* _tmp1_;
+ guint8* buffer;
gssize bufsize;
- gboolean _tmp1_;
- gssize _tmp2_;
- guint8* cpybuf;
+ gboolean _tmp2_;
+ gssize _tmp3_;
+ gssize _tmp4_;
+ guint8* _tmp5_;
gint cpybuf_length1;
gint _cpybuf_size_;
- guint8* _tmp3_;
+ guint8* _tmp6_;
+ guint8* cpybuf;
GError * e;
GError * _inner_error_;
};
@@ -106,8 +113,8 @@ enum {
FETCH_FILE_URI,
FETCH_FILE_INTENDED_PROPERTY
};
-FetchFile* fetch_file_new (const char* uri, const char* prop);
-FetchFile* fetch_file_construct (GType object_type, const char* uri, const char* prop);
+FetchFile* fetch_file_new (const gchar* uri, const gchar* prop);
+FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop);
static void fetch_file_fetch_data_data_free (gpointer _data);
static void fetch_file_fetch_data_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
@@ -118,20 +125,19 @@ static void fetch_file_read_something_finish (FetchFile* self, GAsyncResult* _re
static void fetch_file_read_something_async_data_free (gpointer _data);
static void fetch_file_read_something_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncData* data);
-const char* fetch_file_get_intended_property (FetchFile* self);
-const char* fetch_file_get_uri (FetchFile* self);
-static void fetch_file_set_uri (FetchFile* self, const char* value);
-static void fetch_file_set_intended_property (FetchFile* self, const char* value);
+const gchar* fetch_file_get_intended_property (FetchFile* self);
+const gchar* fetch_file_get_uri (FetchFile* self);
+static void fetch_file_set_uri (FetchFile* self, const gchar* value);
+static void fetch_file_set_intended_property (FetchFile* self, const gchar* value);
+static void g_cclosure_user_marshal_VOID__POINTER_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static GObject * fetch_file_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void fetch_file_finalize (GObject* obj);
-static void fetch_file_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
-static void fetch_file_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
-
+static void _vala_fetch_file_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void _vala_fetch_file_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
-static void g_cclosure_user_marshal_VOID__POINTER_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
-FetchFile* fetch_file_construct (GType object_type, const char* uri, const char* prop) {
- FetchFile * self;
+FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop) {
+ FetchFile * self = NULL;
g_return_val_if_fail (uri != NULL, NULL);
g_return_val_if_fail (prop != NULL, NULL);
self = (FetchFile*) g_object_new (object_type, "uri", uri, "intended-property", prop, NULL);
@@ -139,7 +145,7 @@ FetchFile* fetch_file_construct (GType object_type, const char* uri, const char*
}
-FetchFile* fetch_file_new (const char* uri, const char* prop) {
+FetchFile* fetch_file_new (const gchar* uri, const gchar* prop) {
return fetch_file_construct (TYPE_FETCH_FILE, uri, prop);
}
@@ -147,17 +153,22 @@ FetchFile* fetch_file_new (const char* uri, const char* prop) {
static void fetch_file_fetch_data_data_free (gpointer _data) {
FetchFileFetchDataData* data;
data = _data;
- g_object_unref (data->self);
+ _g_object_unref0 (data->self);
g_slice_free (FetchFileFetchDataData, data);
}
+static gpointer _g_object_ref0 (gpointer self) {
+ return self ? g_object_ref (self) : NULL;
+}
+
+
void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
FetchFileFetchDataData* _data_;
_data_ = g_slice_new0 (FetchFileFetchDataData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fetch_file_fetch_data);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fetch_file_fetch_data_data_free);
- _data_->self = g_object_ref (self);
+ _data_->self = _g_object_ref0 (self);
fetch_file_fetch_data_co (_data_);
}
@@ -171,6 +182,7 @@ void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_) {
static void fetch_file_fetch_data_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
FetchFileFetchDataData* data;
data = _user_data_;
+ data->_source_object_ = source_object;
data->_res_ = _res_;
fetch_file_fetch_data_co (data);
}
@@ -184,24 +196,27 @@ static gboolean fetch_file_fetch_data_co (FetchFileFetchDataData* data) {
g_assert_not_reached ();
}
_state_0:
- {
- data->_tmp0_ = g_file_read (data->self->priv->file, NULL, &data->_inner_error_);
- if (data->_inner_error_ != NULL) {
- goto __catch13_g_error;
- }
- data->self->priv->stream = (data->_tmp2_ = g_data_input_stream_new ((GInputStream*) (data->_tmp1_ = data->_tmp0_)), _g_object_unref0 (data->self->priv->stream), data->_tmp2_);
- _g_object_unref0 (data->_tmp1_);
- g_data_input_stream_set_byte_order (data->self->priv->stream, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN);
+ data->_tmp0_ = NULL;
+ data->_tmp0_ = g_file_read (data->self->priv->file, NULL, &data->_inner_error_);
+ data->_tmp1_ = data->_tmp0_;
+ if (data->_inner_error_ != NULL) {
+ goto __catch13_g_error;
}
+ data->_tmp2_ = data->_tmp1_;
+ data->_tmp3_ = NULL;
+ data->_tmp3_ = g_data_input_stream_new ((GInputStream*) data->_tmp2_);
+ data->_tmp4_ = data->_tmp3_;
+ _g_object_unref0 (data->self->priv->stream);
+ data->self->priv->stream = data->_tmp4_;
+ _g_object_unref0 (data->_tmp2_);
+ g_data_input_stream_set_byte_order (data->self->priv->stream, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN);
goto __finally13;
__catch13_g_error:
{
data->e = data->_inner_error_;
data->_inner_error_ = NULL;
- {
- g_signal_emit_by_name (data->self, "failed");
- _g_error_free0 (data->e);
- }
+ g_signal_emit_by_name (data->self, "failed");
+ _g_error_free0 (data->e);
}
__finally13:
if (data->_inner_error_ != NULL) {
@@ -210,22 +225,20 @@ static gboolean fetch_file_fetch_data_co (FetchFileFetchDataData* data) {
return FALSE;
}
fetch_file_read_something_async (data->self, NULL, NULL);
- {
- if (data->_state_ == 0) {
- g_simple_async_result_complete_in_idle (data->_async_result);
- } else {
- g_simple_async_result_complete (data->_async_result);
- }
- g_object_unref (data->_async_result);
- return FALSE;
+ if (data->_state_ == 0) {
+ g_simple_async_result_complete_in_idle (data->_async_result);
+ } else {
+ g_simple_async_result_complete (data->_async_result);
}
+ g_object_unref (data->_async_result);
+ return FALSE;
}
static void fetch_file_read_something_async_data_free (gpointer _data) {
FetchFileReadSomethingAsyncData* data;
data = _data;
- g_object_unref (data->self);
+ _g_object_unref0 (data->self);
g_slice_free (FetchFileReadSomethingAsyncData, data);
}
@@ -235,7 +248,7 @@ static void fetch_file_read_something_async (FetchFile* self, GAsyncReadyCallbac
_data_ = g_slice_new0 (FetchFileReadSomethingAsyncData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fetch_file_read_something_async);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fetch_file_read_something_async_data_free);
- _data_->self = g_object_ref (self);
+ _data_->self = _g_object_ref0 (self);
fetch_file_read_something_async_co (_data_);
}
@@ -249,6 +262,7 @@ static void fetch_file_read_something_finish (FetchFile* self, GAsyncResult* _re
static void fetch_file_read_something_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
FetchFileReadSomethingAsyncData* data;
data = _user_data_;
+ data->_source_object_ = source_object;
data->_res_ = _res_;
fetch_file_read_something_async_co (data);
}
@@ -258,55 +272,62 @@ static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncD
switch (data->_state_) {
case 0:
goto _state_0;
- default:
- g_assert_not_reached ();
case 1:
goto _state_1;
+ default:
+ g_assert_not_reached ();
}
_state_0:
data->size = (gssize) 1024;
- data->buffer = (data->_tmp0_ = g_new0 (guint8, data->size), data->buffer_length1 = data->size, data->_buffer_size_ = data->buffer_length1, data->_tmp0_);
+ data->_tmp0_ = NULL;
+ data->_tmp0_ = g_new0 (guint8, data->size);
+ data->_tmp1_ = data->_tmp0_;
+ data->buffer_length1 = data->size;
+ data->_buffer_size_ = data->buffer_length1;
+ data->buffer = data->_tmp1_;
data->bufsize = (gssize) 1;
{
- data->_tmp1_ = TRUE;
+ data->_tmp2_ = TRUE;
while (TRUE) {
- if (!data->_tmp1_) {
+ if (!data->_tmp2_) {
if (!(data->bufsize > 0)) {
break;
}
}
- data->_tmp1_ = FALSE;
- {
- data->_state_ = 1;
- g_input_stream_read_async ((GInputStream*) data->self->priv->stream, data->buffer, (gsize) data->size, G_PRIORITY_DEFAULT, NULL, fetch_file_read_something_async_ready, data);
- return FALSE;
- _state_1:
- data->_tmp2_ = g_input_stream_read_finish ((GInputStream*) data->self->priv->stream, data->_res_, &data->_inner_error_);
- if (data->_inner_error_ != NULL) {
- goto __catch14_g_error;
- }
- data->bufsize = data->_tmp2_;
- if (data->bufsize < 1) {
- break;
- }
- if (data->bufsize != data->size) {
- data->cpybuf = (data->_tmp3_ = g_new0 (guint8, data->bufsize), data->cpybuf_length1 = data->bufsize, data->_cpybuf_size_ = data->cpybuf_length1, data->_tmp3_);
- memcpy (data->cpybuf, data->buffer, (gsize) data->bufsize);
- g_byte_array_append (data->self->priv->data, data->cpybuf, data->cpybuf_length1);
- data->cpybuf = (g_free (data->cpybuf), NULL);
- } else {
- g_byte_array_append (data->self->priv->data, data->buffer, data->buffer_length1);
- }
+ data->_tmp2_ = FALSE;
+ data->_state_ = 1;
+ g_input_stream_read_async ((GInputStream*) data->self->priv->stream, data->buffer, (gsize) data->buffer_length1, G_PRIORITY_DEFAULT, NULL, fetch_file_read_something_async_ready, data);
+ return FALSE;
+ _state_1:
+ data->_tmp3_ = g_input_stream_read_finish ((GInputStream*) data->self->priv->stream, data->_res_, &data->_inner_error_);
+ data->_tmp4_ = data->_tmp3_;
+ if (data->_inner_error_ != NULL) {
+ goto __catch14_g_error;
+ }
+ data->bufsize = data->_tmp4_;
+ if (data->bufsize < 1) {
+ break;
+ }
+ if (data->bufsize != data->size) {
+ data->_tmp5_ = NULL;
+ data->_tmp5_ = g_new0 (guint8, data->bufsize);
+ data->_tmp6_ = data->_tmp5_;
+ data->cpybuf_length1 = data->bufsize;
+ data->_cpybuf_size_ = data->cpybuf_length1;
+ data->cpybuf = data->_tmp6_;
+ memcpy (data->cpybuf, data->buffer, (gsize) data->bufsize);
+ g_byte_array_append (data->self->priv->data, data->cpybuf, data->cpybuf_length1);
+ data->cpybuf = (g_free (data->cpybuf), NULL);
+ } else {
+ g_byte_array_append (data->self->priv->data, data->buffer, data->buffer_length1);
}
goto __finally14;
__catch14_g_error:
{
data->e = data->_inner_error_;
data->_inner_error_ = NULL;
- {
- g_signal_emit_by_name (data->self, "failed");
- _g_error_free0 (data->e);
- }
+ g_signal_emit_by_name (data->self, "failed");
+ _g_error_free0 (data->e);
}
__finally14:
if (data->_inner_error_ != NULL) {
@@ -319,63 +340,94 @@ static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncD
}
g_signal_emit_by_name (data->self, "completed", data->self->priv->data, data->self->priv->_intended_property);
data->buffer = (g_free (data->buffer), NULL);
- {
- if (data->_state_ == 0) {
- g_simple_async_result_complete_in_idle (data->_async_result);
- } else {
- g_simple_async_result_complete (data->_async_result);
- }
- g_object_unref (data->_async_result);
- return FALSE;
+ if (data->_state_ == 0) {
+ g_simple_async_result_complete_in_idle (data->_async_result);
+ } else {
+ g_simple_async_result_complete (data->_async_result);
}
+ g_object_unref (data->_async_result);
+ return FALSE;
}
-const char* fetch_file_get_uri (FetchFile* self) {
- const char* result;
+const gchar* fetch_file_get_uri (FetchFile* self) {
+ const gchar* result;
g_return_val_if_fail (self != NULL, NULL);
result = self->priv->_uri;
return result;
}
-static void fetch_file_set_uri (FetchFile* self, const char* value) {
- char* _tmp0_;
+static void fetch_file_set_uri (FetchFile* self, const gchar* value) {
+ gchar* _tmp0_;
+ gchar* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_uri = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_uri), _tmp0_);
+ _tmp0_ = g_strdup (value);
+ _tmp1_ = _tmp0_;
+ _g_free0 (self->priv->_uri);
+ self->priv->_uri = _tmp1_;
g_object_notify ((GObject *) self, "uri");
}
-const char* fetch_file_get_intended_property (FetchFile* self) {
- const char* result;
+const gchar* fetch_file_get_intended_property (FetchFile* self) {
+ const gchar* result;
g_return_val_if_fail (self != NULL, NULL);
result = self->priv->_intended_property;
return result;
}
-static void fetch_file_set_intended_property (FetchFile* self, const char* value) {
- char* _tmp0_;
+static void fetch_file_set_intended_property (FetchFile* self, const gchar* value) {
+ gchar* _tmp0_;
+ gchar* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_intended_property = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_intended_property), _tmp0_);
+ _tmp0_ = g_strdup (value);
+ _tmp1_ = _tmp0_;
+ _g_free0 (self->priv->_intended_property);
+ self->priv->_intended_property = _tmp1_;
g_object_notify ((GObject *) self, "intended-property");
}
+static void g_cclosure_user_marshal_VOID__POINTER_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
+ typedef void (*GMarshalFunc_VOID__POINTER_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, gpointer data2);
+ register GMarshalFunc_VOID__POINTER_STRING callback;
+ register GCClosure * cc;
+ register gpointer data1, data2;
+ cc = (GCClosure *) closure;
+ g_return_if_fail (n_param_values == 3);
+ if (G_CCLOSURE_SWAP_DATA (closure)) {
+ data1 = closure->data;
+ data2 = param_values->data[0].v_pointer;
+ } else {
+ data1 = param_values->data[0].v_pointer;
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_VOID__POINTER_STRING) (marshal_data ? marshal_data : cc->callback);
+ callback (data1, g_value_get_pointer (param_values + 1), g_value_get_string (param_values + 2), data2);
+}
+
+
static GObject * fetch_file_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
GObject * obj;
GObjectClass * parent_class;
FetchFile * self;
+ GFile* _tmp0_ = NULL;
+ GFile* _tmp1_;
+ GByteArray* _tmp2_ = NULL;
+ GByteArray* _tmp3_;
parent_class = G_OBJECT_CLASS (fetch_file_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = FETCH_FILE (obj);
- {
- GFile* _tmp0_;
- GByteArray* _tmp1_;
- self->priv->file = (_tmp0_ = g_file_new_for_uri (self->priv->_uri), _g_object_unref0 (self->priv->file), _tmp0_);
- self->priv->data = (_tmp1_ = g_byte_array_new (), _g_byte_array_free0 (self->priv->data), _tmp1_);
- }
+ _tmp0_ = g_file_new_for_uri (self->priv->_uri);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->file);
+ self->priv->file = _tmp1_;
+ _tmp2_ = g_byte_array_new ();
+ _tmp3_ = _tmp2_;
+ _g_byte_array_free0 (self->priv->data);
+ self->priv->data = _tmp3_;
return obj;
}
@@ -383,8 +435,8 @@ static GObject * fetch_file_constructor (GType type, guint n_construct_propertie
static void fetch_file_class_init (FetchFileClass * klass) {
fetch_file_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (FetchFilePrivate));
- G_OBJECT_CLASS (klass)->get_property = fetch_file_get_property;
- G_OBJECT_CLASS (klass)->set_property = fetch_file_set_property;
+ G_OBJECT_CLASS (klass)->get_property = _vala_fetch_file_get_property;
+ G_OBJECT_CLASS (klass)->set_property = _vala_fetch_file_set_property;
G_OBJECT_CLASS (klass)->constructor = fetch_file_constructor;
G_OBJECT_CLASS (klass)->finalize = fetch_file_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), FETCH_FILE_URI, g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
@@ -423,7 +475,7 @@ GType fetch_file_get_type (void) {
}
-static void fetch_file_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+static void _vala_fetch_file_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
FetchFile * self;
self = FETCH_FILE (object);
switch (property_id) {
@@ -440,7 +492,7 @@ static void fetch_file_get_property (GObject * object, guint property_id, GValue
}
-static void fetch_file_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+static void _vala_fetch_file_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
FetchFile * self;
self = FETCH_FILE (object);
switch (property_id) {
@@ -458,23 +510,3 @@ static void fetch_file_set_property (GObject * object, guint property_id, const
-static void g_cclosure_user_marshal_VOID__POINTER_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
- typedef void (*GMarshalFunc_VOID__POINTER_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, gpointer data2);
- register GMarshalFunc_VOID__POINTER_STRING callback;
- register GCClosure * cc;
- register gpointer data1, data2;
- cc = (GCClosure *) closure;
- g_return_if_fail (n_param_values == 3);
- if (G_CCLOSURE_SWAP_DATA (closure)) {
- data1 = closure->data;
- data2 = param_values->data[0].v_pointer;
- } else {
- data1 = param_values->data[0].v_pointer;
- data2 = closure->data;
- }
- callback = (GMarshalFunc_VOID__POINTER_STRING) (marshal_data ? marshal_data : cc->callback);
- callback (data1, g_value_get_pointer (param_values + 1), g_value_get_string (param_values + 2), data2);
-}
-
-
-
diff --git a/src/fetch-file.vala b/src/fetch-file.vala
index 1811cc1..e6fc11d 100644
--- a/src/fetch-file.vala
+++ b/src/fetch-file.vala
@@ -64,7 +64,7 @@ public class FetchFile : Object
ssize_t bufsize = 1;
do {
try {
- bufsize = yield this.stream.read_async (buffer, size, GLib.Priority.DEFAULT, null);
+ bufsize = yield this.stream.read_async (buffer, GLib.Priority.DEFAULT, null);
if (bufsize < 1) { break;}
if (bufsize != size)
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 13f1529..7797f49 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -47,6 +47,7 @@ typedef struct _IndicatorSoundPrivate IndicatorSoundPrivate;
struct _IndicatorSoundPrivate
{
GtkWidget* volume_widget;
+ GList* transport_widgets_list;
};
#define INDICATOR_SOUND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_SOUND_TYPE, IndicatorSoundPrivate))
@@ -71,6 +72,7 @@ static void indicator_sound_scroll (IndicatorObject* io, gint delta, Indicato
//Slider related
static gboolean new_volume_slider_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data);
+static gboolean key_release_cb(GtkWidget* widget, GdkEventKey* event, gpointer data);
static void style_changed_cb(GtkWidget *widget, gpointer user_data);
//player widget realisation methods
@@ -154,6 +156,8 @@ indicator_sound_init (IndicatorSound *self)
IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self);
priv->volume_widget = NULL;
+ GList* t_list = NULL;
+ priv->transport_widgets_list = t_list;
g_signal_connect(G_OBJECT(self->service),
INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE,
@@ -174,6 +178,10 @@ indicator_sound_dispose (GObject *object)
free_the_animation_list();
+ IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (self));
+
+ g_list_free ( priv->transport_widgets_list );
+
G_OBJECT_CLASS (indicator_sound_parent_class)->dispose (object);
return;
}
@@ -221,7 +229,8 @@ get_menu (IndicatorObject * io)
dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_TITLE_MENUITEM_TYPE, new_title_widget);
// register Key-press listening on the menu widget as the slider does not allow this.
g_signal_connect(menu, "key-press-event", G_CALLBACK(key_press_cb), io);
-
+ g_signal_connect(menu, "key-release-event", G_CALLBACK(key_release_cb), io);
+
return GTK_MENU(menu);
}
@@ -241,11 +250,16 @@ new_transport_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbus
//g_debug("indicator-sound: new_transport_bar() called ");
GtkWidget* bar = NULL;
+ IndicatorObject *io = NULL;
g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE);
g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE);
bar = transport_widget_new(newitem);
+ io = g_object_get_data (G_OBJECT (client), "indicator");
+ IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io));
+ priv->transport_widgets_list = g_list_append ( priv->transport_widgets_list, bar );
+
GtkMenuItem *menu_transport_bar = GTK_MENU_ITEM(bar);
gtk_widget_show_all(bar);
@@ -706,9 +720,98 @@ key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
new_value = CLAMP(new_value, 0, 100);
if (new_value != current_value && current_state != STATE_MUTED) {
//g_debug("Attempting to set the range from the key listener to %f", new_value);
- volume_widget_update(VOLUME_WIDGET(priv->volume_widget), new_value);
+ volume_widget_update(VOLUME_WIDGET(priv->volume_widget), new_value);
}
}
+ else if (IS_TRANSPORT_WIDGET(menuitem) == TRUE) {
+ TransportWidget* transport_widget;
+ GList* elem;
+
+ for ( elem = priv->transport_widgets_list; elem; elem = elem->next ) {
+ transport_widget = TRANSPORT_WIDGET ( elem->data );
+ if ( transport_widget_is_selected( transport_widget ) )
+ break;
+ }
+
+ switch (event->keyval) {
+ case GDK_Right:
+ transport_widget_react_to_key_press_event ( transport_widget,
+ TRANSPORT_NEXT );
+ digested = TRUE;
+ break;
+ case GDK_Left:
+ transport_widget_react_to_key_press_event ( transport_widget,
+ TRANSPORT_PREVIOUS );
+ digested = TRUE;
+ break;
+ case GDK_KEY_space:
+ transport_widget_react_to_key_press_event ( transport_widget,
+ TRANSPORT_PLAY_PAUSE );
+ digested = TRUE;
+ break;
+ case GDK_Up:
+ case GDK_Down:
+ digested = FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+ return digested;
+}
+
+
+/**
+key_release_cb:
+**/
+static gboolean
+key_release_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
+{
+ gboolean digested = FALSE;
+
+ g_return_val_if_fail(IS_INDICATOR_SOUND(data), FALSE);
+
+ IndicatorSound *indicator = INDICATOR_SOUND (data);
+
+ IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(indicator);
+
+ GtkWidget *menuitem;
+
+ menuitem = GTK_MENU_SHELL (widget)->active_menu_item;
+ if (IS_TRANSPORT_WIDGET(menuitem) == TRUE) {
+ TransportWidget* transport_widget;
+ GList* elem;
+
+ for(elem = priv->transport_widgets_list; elem; elem = elem->next) {
+ transport_widget = TRANSPORT_WIDGET (elem->data);
+ if ( transport_widget_is_selected( transport_widget ) )
+ break;
+ }
+
+ switch (event->keyval) {
+ case GDK_Right:
+ transport_widget_react_to_key_release_event ( transport_widget,
+ TRANSPORT_NEXT );
+ digested = TRUE;
+ break;
+ case GDK_Left:
+ transport_widget_react_to_key_release_event ( transport_widget,
+ TRANSPORT_PREVIOUS );
+ digested = TRUE;
+ break;
+ case GDK_KEY_space:
+ transport_widget_react_to_key_release_event ( transport_widget,
+ TRANSPORT_PLAY_PAUSE );
+ digested = TRUE;
+ break;
+ case GDK_Up:
+ case GDK_Down:
+ digested = FALSE;
+ break;
+ default:
+ break;
+ }
+ }
return digested;
}
@@ -730,7 +833,6 @@ indicator_sound_scroll (IndicatorObject *io, gint delta, IndicatorScrollDirectio
if (device_available == FALSE || current_state == STATE_MUTED)
return;
-
IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io));
GtkWidget* slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
diff --git a/src/metadata-menu-item.c b/src/metadata-menu-item.c
index 5cb2d03..8acf1ed 100644
--- a/src/metadata-menu-item.c
+++ b/src/metadata-menu-item.c
@@ -1,4 +1,4 @@
-/* metadata-menu-item.c generated by valac 0.10.0, the Vala compiler
+/* metadata-menu-item.c generated by valac 0.11.2, the Vala compiler
* generated from metadata-menu-item.vala, do not modify */
/*
@@ -89,15 +89,15 @@ struct _MetadataMenuitemClass {
};
struct _MetadataMenuitemPrivate {
- char* previous_temp_album_art_path;
+ gchar* previous_temp_album_art_path;
};
-extern char* metadata_menuitem_album_art_cache_dir;
-char* metadata_menuitem_album_art_cache_dir = NULL;
+static gpointer metadata_menuitem_parent_class = NULL;
+extern gchar* metadata_menuitem_album_art_cache_dir;
+gchar* metadata_menuitem_album_art_cache_dir = NULL;
static FetchFile* metadata_menuitem_fetcher;
static FetchFile* metadata_menuitem_fetcher = NULL;
-static gpointer metadata_menuitem_parent_class = NULL;
GType player_item_get_type (void) G_GNUC_CONST;
GType metadata_menuitem_get_type (void) G_GNUC_CONST;
@@ -113,28 +113,30 @@ void player_item_reset (PlayerItem* self, GeeHashSet* attrs);
GeeHashSet* metadata_menuitem_attributes_format (void);
static void metadata_menuitem_clean_album_art_temp_dir (void);
static gboolean metadata_menuitem_delete_album_art_contents (GFile* dir);
-static char* metadata_menuitem_create_album_art_temp_dir (void);
-void metadata_menuitem_fetch_art (MetadataMenuitem* self, const char* uri, const char* prop);
-FetchFile* fetch_file_new (const char* uri, const char* prop);
-FetchFile* fetch_file_construct (GType object_type, const char* uri, const char* prop);
+static gchar* metadata_menuitem_create_album_art_temp_dir (void);
+void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop);
+FetchFile* fetch_file_new (const gchar* uri, const gchar* prop);
+FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop);
static void _lambda0_ (MetadataMenuitem* self);
static void metadata_menuitem_on_fetcher_failed (MetadataMenuitem* self);
static void __lambda0__fetch_file_failed (FetchFile* _sender, gpointer self);
-static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const char* property);
-static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const char* property, gpointer self);
+static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const gchar* property);
+static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const gchar* property, gpointer self);
void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_);
static GObject * metadata_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void metadata_menuitem_finalize (GObject* obj);
-
MetadataMenuitem* metadata_menuitem_construct (GType object_type) {
- MetadataMenuitem * self;
- GeeHashSet* _tmp0_;
+ MetadataMenuitem * self = NULL;
+ GeeHashSet* _tmp0_ = NULL;
+ GeeHashSet* _tmp1_;
self = (MetadataMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_METADATA_MENUITEM_TYPE, NULL);
- player_item_reset ((PlayerItem*) self, _tmp0_ = metadata_menuitem_attributes_format ());
- _g_object_unref0 (_tmp0_);
+ _tmp0_ = metadata_menuitem_attributes_format ();
+ _tmp1_ = _tmp0_;
+ player_item_reset ((PlayerItem*) self, _tmp1_);
+ _g_object_unref0 (_tmp1_);
return self;
}
@@ -145,11 +147,19 @@ MetadataMenuitem* metadata_menuitem_new (void) {
static void metadata_menuitem_clean_album_art_temp_dir (void) {
- char* path;
+ const gchar* _tmp0_ = NULL;
+ gchar* _tmp1_ = NULL;
+ gchar* path;
+ GFile* _tmp2_ = NULL;
GFile* album_art_dir;
- path = g_build_filename (g_get_user_cache_dir (), METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL);
- album_art_dir = g_file_new_for_path (path);
- if (metadata_menuitem_delete_album_art_contents (album_art_dir) == FALSE) {
+ gboolean _tmp3_;
+ _tmp0_ = g_get_user_cache_dir ();
+ _tmp1_ = g_build_filename (_tmp0_, METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL);
+ path = _tmp1_;
+ _tmp2_ = g_file_new_for_path (path);
+ album_art_dir = _tmp2_;
+ _tmp3_ = metadata_menuitem_delete_album_art_contents (album_art_dir);
+ if (_tmp3_ == FALSE) {
g_warning ("metadata-menu-item.vala:52: could not remove the temp album art files " \
"%s", path);
}
@@ -158,11 +168,17 @@ static void metadata_menuitem_clean_album_art_temp_dir (void) {
}
-static char* metadata_menuitem_create_album_art_temp_dir (void) {
- char* result = NULL;
- char* path;
- path = g_build_filename (g_get_user_cache_dir (), METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL);
- if (g_mkdir (path, 0700) == (-1)) {
+static gchar* metadata_menuitem_create_album_art_temp_dir (void) {
+ gchar* result = NULL;
+ const gchar* _tmp0_ = NULL;
+ gchar* _tmp1_ = NULL;
+ gchar* path;
+ gint _tmp2_;
+ _tmp0_ = g_get_user_cache_dir ();
+ _tmp1_ = g_build_filename (_tmp0_, METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL);
+ path = _tmp1_;
+ _tmp2_ = g_mkdir (path, 0700);
+ if (_tmp2_ == (-1)) {
g_warning ("metadata-menu-item.vala:60: could not create a temp dir for remote alb" \
"um art, it must have been created already");
}
@@ -171,8 +187,8 @@ static char* metadata_menuitem_create_album_art_temp_dir (void) {
}
-static const char* string_to_string (const char* self) {
- const char* result = NULL;
+static const gchar* string_to_string (const gchar* self) {
+ const gchar* result = NULL;
g_return_val_if_fail (self != NULL, NULL);
result = self;
return result;
@@ -182,78 +198,98 @@ static const char* string_to_string (const char* self) {
static gboolean metadata_menuitem_delete_album_art_contents (GFile* dir) {
gboolean result = FALSE;
gboolean _result_;
+ GFileEnumerator* _tmp0_ = NULL;
+ GFileEnumerator* e;
GError * _inner_error_ = NULL;
g_return_val_if_fail (dir != NULL, FALSE);
_result_ = TRUE;
- {
- GFileEnumerator* e;
- e = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
+ _tmp0_ = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
+ e = _tmp0_;
+ if (_inner_error_ != NULL) {
+ goto __catch0_g_error;
+ }
+ while (TRUE) {
+ GFileInfo* _tmp1_ = NULL;
+ GFileInfo* file;
+ const gchar* _tmp2_ = NULL;
+ const gchar* _tmp3_ = NULL;
+ GFile* _tmp4_ = NULL;
+ GFile* child;
+ _tmp1_ = g_file_enumerator_next_file (e, NULL, &_inner_error_);
+ file = _tmp1_;
if (_inner_error_ != NULL) {
+ _g_object_unref0 (e);
goto __catch0_g_error;
}
- while (TRUE) {
- GFileInfo* file;
- GFile* child;
- file = g_file_enumerator_next_file (e, NULL, &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (e);
- goto __catch0_g_error;
- }
- g_debug ("metadata-menu-item.vala:76: file name = %s", g_file_info_get_name (file));
- if (file == NULL) {
- _g_object_unref0 (file);
- break;
- }
- child = g_file_get_child (dir, g_file_info_get_name (file));
- {
- g_file_delete (child, NULL, &_inner_error_);
- if (_inner_error_ != NULL) {
- goto __catch1_g_error;
- }
- }
- goto __finally1;
- __catch1_g_error:
- {
- GError * error_;
- error_ = _inner_error_;
- _inner_error_ = NULL;
- {
- char* _tmp0_;
- char* _tmp1_;
- g_warning ("metadata-menu-item.vala:86: %s", _tmp1_ = g_strconcat ("Unable to delete file '", string_to_string (_tmp0_ = g_file_get_basename (child)), ": ", string_to_string (error_->message), NULL));
- _g_free0 (_tmp1_);
- _g_free0 (_tmp0_);
- _result_ = FALSE;
- _g_error_free0 (error_);
- }
- }
- __finally1:
- if (_inner_error_ != NULL) {
- _g_object_unref0 (child);
- _g_object_unref0 (file);
- _g_object_unref0 (e);
- goto __catch0_g_error;
- }
+ _tmp2_ = g_file_info_get_name (file);
+ g_debug ("metadata-menu-item.vala:76: file name = %s", _tmp2_);
+ if (file == NULL) {
+ _g_object_unref0 (file);
+ break;
+ }
+ _tmp3_ = g_file_info_get_name (file);
+ _tmp4_ = g_file_get_child (dir, _tmp3_);
+ child = _tmp4_;
+ g_file_delete (child, NULL, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ goto __catch1_g_error;
+ }
+ goto __finally1;
+ __catch1_g_error:
+ {
+ GError * error_;
+ gchar* _tmp5_ = NULL;
+ gchar* _tmp6_;
+ const gchar* _tmp7_ = NULL;
+ const gchar* _tmp8_ = NULL;
+ gchar* _tmp9_ = NULL;
+ gchar* _tmp10_;
+ error_ = _inner_error_;
+ _inner_error_ = NULL;
+ _tmp5_ = g_file_get_basename (child);
+ _tmp6_ = _tmp5_;
+ _tmp7_ = string_to_string (_tmp6_);
+ _tmp8_ = string_to_string (error_->message);
+ _tmp9_ = g_strconcat ("Unable to delete file '", _tmp7_, ": ", _tmp8_, NULL);
+ _tmp10_ = _tmp9_;
+ g_warning ("metadata-menu-item.vala:86: %s", _tmp10_);
+ _g_free0 (_tmp10_);
+ _g_free0 (_tmp6_);
+ _result_ = FALSE;
+ _g_error_free0 (error_);
+ }
+ __finally1:
+ if (_inner_error_ != NULL) {
_g_object_unref0 (child);
_g_object_unref0 (file);
+ _g_object_unref0 (e);
+ goto __catch0_g_error;
}
- _g_object_unref0 (e);
+ _g_object_unref0 (child);
+ _g_object_unref0 (file);
}
+ _g_object_unref0 (e);
goto __finally0;
__catch0_g_error:
{
GError * _error_;
+ gchar* _tmp11_ = NULL;
+ gchar* _tmp12_;
+ const gchar* _tmp13_ = NULL;
+ gchar* _tmp14_ = NULL;
+ gchar* _tmp15_;
_error_ = _inner_error_;
_inner_error_ = NULL;
- {
- char* _tmp2_;
- char* _tmp3_;
- g_warning (_tmp3_ = g_strconcat ("Unable to read files from directory '", string_to_string (_tmp2_ = g_file_get_basename (dir)), "': %s", NULL), _error_->message);
- _g_free0 (_tmp3_);
- _g_free0 (_tmp2_);
- _result_ = FALSE;
- _g_error_free0 (_error_);
- }
+ _tmp11_ = g_file_get_basename (dir);
+ _tmp12_ = _tmp11_;
+ _tmp13_ = string_to_string (_tmp12_);
+ _tmp14_ = g_strconcat ("Unable to read files from directory '", _tmp13_, "': %s", NULL);
+ _tmp15_ = _tmp14_;
+ g_warning (_tmp15_, _error_->message);
+ _g_free0 (_tmp15_);
+ _g_free0 (_tmp12_);
+ _result_ = FALSE;
+ _g_error_free0 (_error_);
}
__finally0:
if (_inner_error_ != NULL) {
@@ -266,11 +302,13 @@ static gboolean metadata_menuitem_delete_album_art_contents (GFile* dir) {
}
-static char* string_strip (const char* self) {
- char* result = NULL;
- char* _result_;
+static gchar* string_strip (const gchar* self) {
+ gchar* result = NULL;
+ gchar* _tmp0_ = NULL;
+ gchar* _result_;
g_return_val_if_fail (self != NULL, NULL);
- _result_ = g_strdup (self);
+ _tmp0_ = g_strdup (self);
+ _result_ = _tmp0_;
g_strstrip (_result_);
result = _result_;
return result;
@@ -287,51 +325,59 @@ static void __lambda0__fetch_file_failed (FetchFile* _sender, gpointer self) {
}
-static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const char* property, gpointer self) {
+static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const gchar* property, gpointer self) {
metadata_menuitem_on_fetcher_completed (self, data, property);
}
-void metadata_menuitem_fetch_art (MetadataMenuitem* self, const char* uri, const char* prop) {
+void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop) {
+ GFile* _tmp0_ = NULL;
GFile* art_file;
- FetchFile* _tmp4_;
+ gboolean _tmp1_;
+ FetchFile* _tmp8_ = NULL;
+ FetchFile* _tmp9_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (uri != NULL);
g_return_if_fail (prop != NULL);
- art_file = g_file_new_for_uri (uri);
- if (g_file_is_native (art_file) == TRUE) {
- char* path;
+ _tmp0_ = g_file_new_for_uri (uri);
+ art_file = _tmp0_;
+ _tmp1_ = g_file_is_native (art_file);
+ if (_tmp1_ == TRUE) {
+ gchar* path;
+ gchar* _tmp2_ = NULL;
+ gchar* _tmp3_;
+ gchar* _tmp4_ = NULL;
+ gchar* _tmp5_;
+ gchar* _tmp6_;
+ gchar* _tmp7_;
path = NULL;
- {
- char* _tmp0_;
- char* _tmp1_;
- char* _tmp2_;
- char* _tmp3_;
- _tmp2_ = (_tmp1_ = g_filename_from_uri (_tmp0_ = string_strip (uri), NULL, &_inner_error_), _g_free0 (_tmp0_), _tmp1_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_CONVERT_ERROR) {
- goto __catch2_g_convert_error;
- }
- _g_free0 (path);
- _g_object_unref0 (art_file);
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
+ _tmp2_ = string_strip (uri);
+ _tmp3_ = _tmp2_;
+ _tmp4_ = g_filename_from_uri (_tmp3_, NULL, &_inner_error_);
+ _tmp6_ = (_tmp5_ = _tmp4_, _g_free0 (_tmp3_), _tmp5_);
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_CONVERT_ERROR) {
+ goto __catch2_g_convert_error;
}
- path = (_tmp3_ = _tmp2_, _g_free0 (path), _tmp3_);
- dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, prop, path);
+ _g_free0 (path);
+ _g_object_unref0 (art_file);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
}
+ _tmp7_ = _tmp6_;
+ _g_free0 (path);
+ path = _tmp7_;
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, prop, path);
goto __finally2;
__catch2_g_convert_error:
{
GError * e;
e = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("metadata-menu-item.vala:108: Problem converting URI %s to file path", uri);
- _g_error_free0 (e);
- }
+ g_warning ("metadata-menu-item.vala:108: Problem converting URI %s to file path", uri);
+ _g_error_free0 (e);
}
__finally2:
if (_inner_error_ != NULL) {
@@ -350,7 +396,10 @@ void metadata_menuitem_fetch_art (MetadataMenuitem* self, const char* uri, const
_g_object_unref0 (art_file);
return;
}
- metadata_menuitem_fetcher = (_tmp4_ = fetch_file_new (uri, prop), _g_object_unref0 (metadata_menuitem_fetcher), _tmp4_);
+ _tmp8_ = fetch_file_new (uri, prop);
+ _tmp9_ = _tmp8_;
+ _g_object_unref0 (metadata_menuitem_fetcher);
+ metadata_menuitem_fetcher = _tmp9_;
g_signal_connect_object (metadata_menuitem_fetcher, "failed", (GCallback) __lambda0__fetch_file_failed, self, 0);
g_signal_connect_object (metadata_menuitem_fetcher, "completed", (GCallback) _metadata_menuitem_on_fetcher_completed_fetch_file_completed, self, 0);
fetch_file_fetch_data (metadata_menuitem_fetcher, NULL, NULL);
@@ -370,60 +419,74 @@ static gpointer _g_object_ref0 (gpointer self) {
}
-static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const char* property) {
+static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const gchar* property) {
+ GdkPixbufLoader* _tmp0_ = NULL;
+ GdkPixbufLoader* loader;
+ GdkPixbuf* _tmp1_ = NULL;
+ GdkPixbuf* _tmp2_;
+ GdkPixbuf* icon;
+ gchar* _tmp3_ = NULL;
+ gchar* path;
+ gint _tmp4_;
+ gint r;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (update != NULL);
g_return_if_fail (property != NULL);
- {
- GdkPixbufLoader* loader;
- GdkPixbuf* icon;
- char* path;
- gint r;
- loader = gdk_pixbuf_loader_new ();
- gdk_pixbuf_loader_write (loader, update->data, (gsize) update->len, &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_object_unref0 (loader);
- goto __catch3_g_error;
- }
- gdk_pixbuf_loader_close (loader, &_inner_error_);
+ _tmp0_ = gdk_pixbuf_loader_new ();
+ loader = _tmp0_;
+ gdk_pixbuf_loader_write (loader, update->data, (gsize) ((gint) update->len), &_inner_error_);
+ if (_inner_error_ != NULL) {
+ _g_object_unref0 (loader);
+ goto __catch3_g_error;
+ }
+ gdk_pixbuf_loader_close (loader, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ _g_object_unref0 (loader);
+ goto __catch3_g_error;
+ }
+ _tmp1_ = gdk_pixbuf_loader_get_pixbuf (loader);
+ _tmp2_ = _g_object_ref0 (_tmp1_);
+ icon = _tmp2_;
+ _tmp3_ = g_strconcat (metadata_menuitem_album_art_cache_dir, "/downloaded-coverart-XXXXXX", NULL);
+ path = _tmp3_;
+ _tmp4_ = g_mkstemp (path);
+ r = _tmp4_;
+ if (r != (-1)) {
+ GdkPixbufFormat* _tmp5_ = NULL;
+ const gchar* _tmp6_ = NULL;
+ gchar* _tmp7_;
+ gchar* _tmp8_;
+ _tmp5_ = gdk_pixbuf_loader_get_format (loader);
+ _tmp6_ = gdk_pixbuf_format_get_name (_tmp5_);
+ gdk_pixbuf_save (icon, path, _tmp6_, &_inner_error_, NULL);
if (_inner_error_ != NULL) {
+ _g_free0 (path);
+ _g_object_unref0 (icon);
_g_object_unref0 (loader);
goto __catch3_g_error;
}
- icon = _g_object_ref0 (gdk_pixbuf_loader_get_pixbuf (loader));
- path = g_strconcat (metadata_menuitem_album_art_cache_dir, "/downloaded-coverart-XXXXXX", NULL);
- r = g_mkstemp (path);
- if (r != (-1)) {
- char* _tmp0_;
- gdk_pixbuf_save (icon, path, gdk_pixbuf_format_get_name (gdk_pixbuf_loader_get_format (loader)), &_inner_error_, NULL);
- if (_inner_error_ != NULL) {
- _g_free0 (path);
- _g_object_unref0 (icon);
- _g_object_unref0 (loader);
- goto __catch3_g_error;
- }
- dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, path);
- if (self->priv->previous_temp_album_art_path != NULL) {
- g_remove (self->priv->previous_temp_album_art_path);
- }
- self->priv->previous_temp_album_art_path = (_tmp0_ = g_strdup (path), _g_free0 (self->priv->previous_temp_album_art_path), _tmp0_);
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, path);
+ if (self->priv->previous_temp_album_art_path != NULL) {
+ g_remove (self->priv->previous_temp_album_art_path);
}
- _g_free0 (path);
- _g_object_unref0 (icon);
- _g_object_unref0 (loader);
+ _tmp7_ = g_strdup (path);
+ _tmp8_ = _tmp7_;
+ _g_free0 (self->priv->previous_temp_album_art_path);
+ self->priv->previous_temp_album_art_path = _tmp8_;
}
+ _g_free0 (path);
+ _g_object_unref0 (icon);
+ _g_object_unref0 (loader);
goto __finally3;
__catch3_g_error:
{
GError * e;
e = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("metadata-menu-item.vala:151: Problem creating file from bytearray fetc" \
+ g_warning ("metadata-menu-item.vala:151: Problem creating file from bytearray fetc" \
"hed from the interweb - error: %s", e->message);
- _g_error_free0 (e);
- }
+ _g_error_free0 (e);
}
__finally3:
if (_inner_error_ != NULL) {
@@ -436,8 +499,10 @@ static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByt
GeeHashSet* metadata_menuitem_attributes_format (void) {
GeeHashSet* result = NULL;
+ GeeHashSet* _tmp0_ = NULL;
GeeHashSet* attrs;
- attrs = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ attrs = _tmp0_;
gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_TITLE);
gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTIST);
gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ALBUM);
@@ -451,16 +516,20 @@ static GObject * metadata_menuitem_constructor (GType type, guint n_construct_pr
GObject * obj;
GObjectClass * parent_class;
MetadataMenuitem * self;
+ gchar* _tmp0_;
+ gchar* _tmp1_ = NULL;
+ gchar* _tmp2_;
parent_class = G_OBJECT_CLASS (metadata_menuitem_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = METADATA_MENUITEM (obj);
- {
- char* _tmp0_;
- char* _tmp1_;
- metadata_menuitem_clean_album_art_temp_dir ();
- self->priv->previous_temp_album_art_path = (_tmp0_ = NULL, _g_free0 (self->priv->previous_temp_album_art_path), _tmp0_);
- metadata_menuitem_album_art_cache_dir = (_tmp1_ = metadata_menuitem_create_album_art_temp_dir (), _g_free0 (metadata_menuitem_album_art_cache_dir), _tmp1_);
- }
+ metadata_menuitem_clean_album_art_temp_dir ();
+ _tmp0_ = NULL;
+ _g_free0 (self->priv->previous_temp_album_art_path);
+ self->priv->previous_temp_album_art_path = _tmp0_;
+ _tmp1_ = metadata_menuitem_create_album_art_temp_dir ();
+ _tmp2_ = _tmp1_;
+ _g_free0 (metadata_menuitem_album_art_cache_dir);
+ metadata_menuitem_album_art_cache_dir = _tmp2_;
return obj;
}
@@ -499,4 +568,3 @@ GType metadata_menuitem_get_type (void) {
-
diff --git a/src/metadata-menu-item.vala b/src/metadata-menu-item.vala
index 3f71653..c9ab4dd 100644
--- a/src/metadata-menu-item.vala
+++ b/src/metadata-menu-item.vala
@@ -133,7 +133,7 @@ public class MetadataMenuitem : PlayerItem
{
try{
PixbufLoader loader = new PixbufLoader ();
- loader.write (update.data, update.len);
+ loader.write (update.data);
loader.close ();
Pixbuf icon = loader.get_pixbuf ();
string path = this.album_art_cache_dir.concat("/downloaded-coverart-XXXXXX");
diff --git a/src/mpris2-controller.c b/src/mpris2-controller.c
index 1ee4ebf..c482dd4 100644
--- a/src/mpris2-controller.c
+++ b/src/mpris2-controller.c
@@ -1,4 +1,4 @@
-/* mpris2-controller.c generated by valac 0.10.0, the Vala compiler
+/* mpris2-controller.c generated by valac 0.11.2, the Vala compiler
* generated from mpris2-controller.vala, do not modify */
/*
@@ -137,10 +137,10 @@ struct _MprisRootIface {
void (*set_CanQuit) (MprisRoot* self, gboolean value);
gboolean (*get_CanRaise) (MprisRoot* self);
void (*set_CanRaise) (MprisRoot* self, gboolean value);
- char* (*get_Identity) (MprisRoot* self);
- void (*set_Identity) (MprisRoot* self, const char* value);
- char* (*get_DesktopEntry) (MprisRoot* self);
- void (*set_DesktopEntry) (MprisRoot* self, const char* value);
+ gchar* (*get_Identity) (MprisRoot* self);
+ void (*set_Identity) (MprisRoot* self, const gchar* value);
+ gchar* (*get_DesktopEntry) (MprisRoot* self);
+ void (*set_DesktopEntry) (MprisRoot* self, const gchar* value);
};
struct _DBusObjectVTable {
@@ -176,8 +176,8 @@ struct _MprisPlayerIface {
void (*set_Metadata) (MprisPlayer* self, GHashTable* value);
gint32 (*get_Position) (MprisPlayer* self);
void (*set_Position) (MprisPlayer* self, gint32 value);
- char* (*get_PlaybackStatus) (MprisPlayer* self);
- void (*set_PlaybackStatus) (MprisPlayer* self, const char* value);
+ gchar* (*get_PlaybackStatus) (MprisPlayer* self);
+ void (*set_PlaybackStatus) (MprisPlayer* self, const gchar* value);
};
struct _MprisPlayerDBusProxy {
@@ -273,10 +273,10 @@ gboolean mpris_root_get_CanQuit (MprisRoot* self);
void mpris_root_set_CanQuit (MprisRoot* self, gboolean value);
gboolean mpris_root_get_CanRaise (MprisRoot* self);
void mpris_root_set_CanRaise (MprisRoot* self, gboolean value);
-char* mpris_root_get_Identity (MprisRoot* self);
-void mpris_root_set_Identity (MprisRoot* self, const char* value);
-char* mpris_root_get_DesktopEntry (MprisRoot* self);
-void mpris_root_set_DesktopEntry (MprisRoot* self, const char* value);
+gchar* mpris_root_get_Identity (MprisRoot* self);
+void mpris_root_set_Identity (MprisRoot* self, const gchar* value);
+gchar* mpris_root_get_DesktopEntry (MprisRoot* self);
+void mpris_root_set_DesktopEntry (MprisRoot* self, const gchar* value);
static void _vala_dbus_register_object (DBusConnection* connection, const char* path, void* object);
static void _vala_dbus_unregister_object (gpointer connection, GObject* object);
void mpris_root_dbus_register_object (DBusConnection* connection, const char* path, void* object);
@@ -312,13 +312,13 @@ static gboolean mpris_root_dbus_proxy_get_CanQuit (MprisRoot* self);
static void mpris_root_dbus_proxy_set_CanQuit (MprisRoot* self, gboolean value);
static gboolean mpris_root_dbus_proxy_get_CanRaise (MprisRoot* self);
static void mpris_root_dbus_proxy_set_CanRaise (MprisRoot* self, gboolean value);
-static char* mpris_root_dbus_proxy_get_Identity (MprisRoot* self);
-static void mpris_root_dbus_proxy_set_Identity (MprisRoot* self, const char* value);
-static char* mpris_root_dbus_proxy_get_DesktopEntry (MprisRoot* self);
-static void mpris_root_dbus_proxy_set_DesktopEntry (MprisRoot* self, const char* value);
+static gchar* mpris_root_dbus_proxy_get_Identity (MprisRoot* self);
+static void mpris_root_dbus_proxy_set_Identity (MprisRoot* self, const gchar* value);
+static gchar* mpris_root_dbus_proxy_get_DesktopEntry (MprisRoot* self);
+static void mpris_root_dbus_proxy_set_DesktopEntry (MprisRoot* self, const gchar* value);
static void mpris_root_dbus_proxy_mpris_root__interface_init (MprisRootIface* iface);
-static void mpris_root_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
-static void mpris_root_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static void _vala_mpris_root_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void _vala_mpris_root_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
MprisPlayer* mpris_player_dbus_proxy_new (DBusGConnection* connection, const char* name, const char* path);
GType mpris_player_get_type (void) G_GNUC_CONST;
void mpris_player_PlayPause (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
@@ -331,8 +331,9 @@ GHashTable* mpris_player_get_Metadata (MprisPlayer* self);
void mpris_player_set_Metadata (MprisPlayer* self, GHashTable* value);
gint32 mpris_player_get_Position (MprisPlayer* self);
void mpris_player_set_Position (MprisPlayer* self, gint32 value);
-char* mpris_player_get_PlaybackStatus (MprisPlayer* self);
-void mpris_player_set_PlaybackStatus (MprisPlayer* self, const char* value);
+gchar* mpris_player_get_PlaybackStatus (MprisPlayer* self);
+void mpris_player_set_PlaybackStatus (MprisPlayer* self, const gchar* value);
+static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
void mpris_player_dbus_register_object (DBusConnection* connection, const char* path, void* object);
void _mpris_player_dbus_unregister (DBusConnection* connection, void* _user_data_);
DBusHandlerResult mpris_player_dbus_message (DBusConnection* connection, DBusMessage* message, void* object);
@@ -369,19 +370,20 @@ static GHashTable* mpris_player_dbus_proxy_get_Metadata (MprisPlayer* self);
static void mpris_player_dbus_proxy_set_Metadata (MprisPlayer* self, GHashTable* value);
static gint32 mpris_player_dbus_proxy_get_Position (MprisPlayer* self);
static void mpris_player_dbus_proxy_set_Position (MprisPlayer* self, gint32 value);
-static char* mpris_player_dbus_proxy_get_PlaybackStatus (MprisPlayer* self);
-static void mpris_player_dbus_proxy_set_PlaybackStatus (MprisPlayer* self, const char* value);
+static gchar* mpris_player_dbus_proxy_get_PlaybackStatus (MprisPlayer* self);
+static void mpris_player_dbus_proxy_set_PlaybackStatus (MprisPlayer* self, const gchar* value);
static void mpris_player_dbus_proxy_mpris_player__interface_init (MprisPlayerIface* iface);
-static void mpris_player_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
-static void mpris_player_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static void _vala_mpris_player_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void _vala_mpris_player_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType free_desktop_properties_get_type (void) G_GNUC_CONST;
FreeDesktopProperties* free_desktop_properties_dbus_proxy_new (DBusGConnection* connection, const char* name, const char* path);
+static void g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
void free_desktop_properties_dbus_register_object (DBusConnection* connection, const char* path, void* object);
void _free_desktop_properties_dbus_unregister (DBusConnection* connection, void* _user_data_);
DBusHandlerResult free_desktop_properties_dbus_message (DBusConnection* connection, DBusMessage* message, void* object);
static DBusHandlerResult _dbus_free_desktop_properties_introspect (FreeDesktopProperties* self, DBusConnection* connection, DBusMessage* message);
static DBusHandlerResult _dbus_free_desktop_properties_property_get_all (FreeDesktopProperties* self, DBusConnection* connection, DBusMessage* message);
-static void _dbus_free_desktop_properties_properties_changed (GObject* _sender, const char* source, GHashTable* changed_properties, char** invalid, int invalid_length1, DBusConnection* _connection);
+static void _dbus_free_desktop_properties_properties_changed (GObject* _sender, const gchar* source, GHashTable* changed_properties, gchar** invalid, int invalid_length1, DBusConnection* _connection);
GType free_desktop_properties_dbus_proxy_get_type (void) G_GNUC_CONST;
static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktopProperties* self, DBusConnection* connection, DBusMessage* message);
DBusHandlerResult free_desktop_properties_dbus_proxy_filter (DBusConnection* connection, DBusMessage* message, void* user_data);
@@ -389,8 +391,8 @@ enum {
FREE_DESKTOP_PROPERTIES_DBUS_PROXY_DUMMY_PROPERTY
};
static void free_desktop_properties_dbus_proxy_free_desktop_properties__interface_init (FreeDesktopPropertiesIface* iface);
-static void free_desktop_properties_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
-static void free_desktop_properties_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static void _vala_free_desktop_properties_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void _vala_free_desktop_properties_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType mpris2_controller_get_type (void) G_GNUC_CONST;
GType player_controller_get_type (void) G_GNUC_CONST;
#define MPRIS2_CONTROLLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerPrivate))
@@ -404,13 +406,13 @@ enum {
#define MPRIS2_CONTROLLER_root_interface "org.mpris.MediaPlayer2"
Mpris2Controller* mpris2_controller_new (PlayerController* ctrl);
Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl);
-void mpris2_controller_property_changed_cb (Mpris2Controller* self, const char* interface_source, GHashTable* changed_properties, char** invalid, int invalid_length1);
+void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1);
PlayerController* mpris2_controller_get_owner (Mpris2Controller* self);
-const char* player_controller_get_mpris_name (PlayerController* self);
+const gchar* player_controller_get_mpris_name (PlayerController* self);
static GValue* _g_value_dup (GValue* self);
MprisPlayer* mpris2_controller_get_player (Mpris2Controller* self);
GType transport_menuitem_state_get_type (void) G_GNUC_CONST;
-static TransportMenuitemstate mpris2_controller_determine_play_state (Mpris2Controller* self, const char* status);
+static TransportMenuitemstate mpris2_controller_determine_play_state (Mpris2Controller* self, const gchar* status);
GType player_item_get_type (void) G_GNUC_CONST;
GType player_controller_widget_order_get_type (void) G_GNUC_CONST;
GType transport_menuitem_get_type (void) G_GNUC_CONST;
@@ -421,7 +423,7 @@ GeeHashSet* metadata_menuitem_attributes_format (void);
void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes);
gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs);
static void _vala_GValue_free (GValue* self);
-static char** _vala_array_dup1 (char** self, int length);
+static gchar** _vala_array_dup1 (gchar** self, int length);
void mpris2_controller_initial_update (Mpris2Controller* self);
GType transport_menuitem_action_get_type (void) G_GNUC_CONST;
void mpris2_controller_transport_update (Mpris2Controller* self, TransportMenuitemaction command);
@@ -434,14 +436,13 @@ static void mpris2_controller_set_player (Mpris2Controller* self, MprisPlayer* v
static void mpris2_controller_set_owner (Mpris2Controller* self, PlayerController* value);
FreeDesktopProperties* mpris2_controller_get_properties_interface (Mpris2Controller* self);
static void mpris2_controller_set_properties_interface (Mpris2Controller* self, FreeDesktopProperties* value);
-static void _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed (FreeDesktopProperties* _sender, const char* source, GHashTable* changed_properties, char** invalid, int invalid_length1, gpointer self);
static GObject * mpris2_controller_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed (FreeDesktopProperties* _sender, const gchar* source, GHashTable* changed_properties, gchar** invalid, int invalid_length1, gpointer self);
static void mpris2_controller_finalize (GObject* obj);
-static void mpris2_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
-static void mpris2_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static void _vala_mpris2_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void _vala_mpris2_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
-static int _vala_strcmp0 (const char * str1, const char * str2);
static const DBusObjectPathVTable _mpris_root_dbus_path_vtable = {_mpris_root_dbus_unregister, mpris_root_dbus_message};
static const _DBusObjectVTable _mpris_root_dbus_vtable = {mpris_root_dbus_register_object};
@@ -450,9 +451,6 @@ static const _DBusObjectVTable _mpris_player_dbus_vtable = {mpris_player_dbus_re
static const DBusObjectPathVTable _free_desktop_properties_dbus_path_vtable = {_free_desktop_properties_dbus_unregister, free_desktop_properties_dbus_message};
static const _DBusObjectVTable _free_desktop_properties_dbus_vtable = {free_desktop_properties_dbus_register_object};
-static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
-static void g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
-
void mpris_root_Quit (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
MPRIS_ROOT_GET_INTERFACE (self)->Quit (self, _callback_, _user_data_);
}
@@ -503,22 +501,22 @@ void mpris_root_set_CanRaise (MprisRoot* self, gboolean value) {
}
-char* mpris_root_get_Identity (MprisRoot* self) {
+gchar* mpris_root_get_Identity (MprisRoot* self) {
return MPRIS_ROOT_GET_INTERFACE (self)->get_Identity (self);
}
-void mpris_root_set_Identity (MprisRoot* self, const char* value) {
+void mpris_root_set_Identity (MprisRoot* self, const gchar* value) {
MPRIS_ROOT_GET_INTERFACE (self)->set_Identity (self, value);
}
-char* mpris_root_get_DesktopEntry (MprisRoot* self) {
+gchar* mpris_root_get_DesktopEntry (MprisRoot* self) {
return MPRIS_ROOT_GET_INTERFACE (self)->get_DesktopEntry (self);
}
-void mpris_root_set_DesktopEntry (MprisRoot* self, const char* value) {
+void mpris_root_set_DesktopEntry (MprisRoot* self, const gchar* value) {
MPRIS_ROOT_GET_INTERFACE (self)->set_DesktopEntry (self, value);
}
@@ -618,7 +616,7 @@ static DBusHandlerResult _dbus_mpris_root_property_get (MprisRoot* self, DBusCon
dbus_message_iter_append_basic (&subiter, DBUS_TYPE_BOOLEAN, &_tmp4_);
dbus_message_iter_close_container (&reply_iter, &subiter);
} else if ((strcmp (interface_name, "org.mpris.MediaPlayer2") == 0) && (strcmp (property_name, "Identity") == 0)) {
- char* result;
+ gchar* result;
const char* _tmp5_;
dbus_message_iter_open_container (&reply_iter, DBUS_TYPE_VARIANT, "s", &subiter);
result = mpris_root_get_Identity (self);
@@ -627,7 +625,7 @@ static DBusHandlerResult _dbus_mpris_root_property_get (MprisRoot* self, DBusCon
_g_free0 (result);
dbus_message_iter_close_container (&reply_iter, &subiter);
} else if ((strcmp (interface_name, "org.mpris.MediaPlayer2") == 0) && (strcmp (property_name, "DesktopEntry") == 0)) {
- char* result;
+ gchar* result;
const char* _tmp6_;
dbus_message_iter_open_container (&reply_iter, DBUS_TYPE_VARIANT, "s", &subiter);
result = mpris_root_get_DesktopEntry (self);
@@ -692,7 +690,7 @@ static DBusHandlerResult _dbus_mpris_root_property_set (MprisRoot* self, DBusCon
value = _tmp11_;
mpris_root_set_CanRaise (self, value);
} else if ((strcmp (interface_name, "org.mpris.MediaPlayer2") == 0) && (strcmp (property_name, "Identity") == 0)) {
- char* value;
+ gchar* value;
const char* _tmp12_;
dbus_message_iter_get_basic (&subiter, &_tmp12_);
dbus_message_iter_next (&subiter);
@@ -700,7 +698,7 @@ static DBusHandlerResult _dbus_mpris_root_property_set (MprisRoot* self, DBusCon
mpris_root_set_Identity (self, value);
_g_free0 (value);
} else if ((strcmp (interface_name, "org.mpris.MediaPlayer2") == 0) && (strcmp (property_name, "DesktopEntry") == 0)) {
- char* value;
+ gchar* value;
const char* _tmp13_;
dbus_message_iter_get_basic (&subiter, &_tmp13_);
dbus_message_iter_next (&subiter);
@@ -780,7 +778,7 @@ static DBusHandlerResult _dbus_mpris_root_property_get_all (MprisRoot* self, DBu
dbus_message_iter_close_container (&subiter, &entry_iter);
}
{
- char* result;
+ gchar* result;
const char* _tmp18_;
dbus_message_iter_open_container (&subiter, DBUS_TYPE_DICT_ENTRY, NULL, &entry_iter);
property_name = "Identity";
@@ -794,7 +792,7 @@ static DBusHandlerResult _dbus_mpris_root_property_get_all (MprisRoot* self, DBu
dbus_message_iter_close_container (&subiter, &entry_iter);
}
{
- char* result;
+ gchar* result;
const char* _tmp19_;
dbus_message_iter_open_container (&subiter, DBUS_TYPE_DICT_ENTRY, NULL, &entry_iter);
property_name = "DesktopEntry";
@@ -1218,8 +1216,8 @@ static void mpris_root_dbus_proxy_dispose (GObject* self) {
static void mpris_root_dbus_proxy_class_init (MprisRootDBusProxyClass* klass) {
G_OBJECT_CLASS (klass)->constructor = mpris_root_dbus_proxy_construct;
G_OBJECT_CLASS (klass)->dispose = mpris_root_dbus_proxy_dispose;
- G_OBJECT_CLASS (klass)->get_property = mpris_root_dbus_proxy_get_property;
- G_OBJECT_CLASS (klass)->set_property = mpris_root_dbus_proxy_set_property;
+ G_OBJECT_CLASS (klass)->get_property = _vala_mpris_root_dbus_proxy_get_property;
+ G_OBJECT_CLASS (klass)->set_property = _vala_mpris_root_dbus_proxy_set_property;
g_object_class_override_property (G_OBJECT_CLASS (klass), MPRIS_ROOT_DBUS_PROXY_HAS_TRACKLIST, "HasTracklist");
g_object_class_override_property (G_OBJECT_CLASS (klass), MPRIS_ROOT_DBUS_PROXY_CAN_QUIT, "CanQuit");
g_object_class_override_property (G_OBJECT_CLASS (klass), MPRIS_ROOT_DBUS_PROXY_CAN_RAISE, "CanRaise");
@@ -1277,8 +1275,8 @@ static void mpris_root_dbus_proxy_Quit_finish (MprisRoot* self, GAsyncResult* _r
_reply = dbus_pending_call_steal_reply (_data_->pending);
dbus_set_error_from_message (&_dbus_error, _reply);
if (dbus_error_is_set (&_dbus_error)) {
- GQuark _edomain;
- gint _ecode;
+ GQuark _edomain = 0;
+ gint _ecode = 0;
if (strstr (_dbus_error.name, "org.freedesktop.DBus.Error") == _dbus_error.name) {
const char* _tmp0_;
_edomain = DBUS_GERROR;
@@ -1410,8 +1408,8 @@ static void mpris_root_dbus_proxy_Raise_finish (MprisRoot* self, GAsyncResult* _
_reply = dbus_pending_call_steal_reply (_data_->pending);
dbus_set_error_from_message (&_dbus_error, _reply);
if (dbus_error_is_set (&_dbus_error)) {
- GQuark _edomain;
- gint _ecode;
+ GQuark _edomain = 0;
+ gint _ecode = 0;
if (strstr (_dbus_error.name, "org.freedesktop.DBus.Error") == _dbus_error.name) {
const char* _tmp1_;
_edomain = DBUS_GERROR;
@@ -1765,14 +1763,14 @@ static void mpris_root_dbus_proxy_set_CanRaise (MprisRoot* self, gboolean value)
}
-static char* mpris_root_dbus_proxy_get_Identity (MprisRoot* self) {
+static gchar* mpris_root_dbus_proxy_get_Identity (MprisRoot* self) {
DBusError _dbus_error;
DBusGConnection *_connection;
DBusMessage *_message, *_reply;
DBusMessageIter _iter, _subiter;
const char* _tmp20_;
const char* _tmp21_;
- char* _result;
+ gchar* _result;
const char* _tmp22_;
if (((MprisRootDBusProxy*) self)->disposed) {
return NULL;
@@ -1813,7 +1811,7 @@ static char* mpris_root_dbus_proxy_get_Identity (MprisRoot* self) {
}
-static void mpris_root_dbus_proxy_set_Identity (MprisRoot* self, const char* value) {
+static void mpris_root_dbus_proxy_set_Identity (MprisRoot* self, const gchar* value) {
DBusError _dbus_error;
DBusGConnection *_connection;
DBusMessage *_message, *_reply;
@@ -1854,14 +1852,14 @@ static void mpris_root_dbus_proxy_set_Identity (MprisRoot* self, const char* val
}
-static char* mpris_root_dbus_proxy_get_DesktopEntry (MprisRoot* self) {
+static gchar* mpris_root_dbus_proxy_get_DesktopEntry (MprisRoot* self) {
DBusError _dbus_error;
DBusGConnection *_connection;
DBusMessage *_message, *_reply;
DBusMessageIter _iter, _subiter;
const char* _tmp26_;
const char* _tmp27_;
- char* _result;
+ gchar* _result;
const char* _tmp28_;
if (((MprisRootDBusProxy*) self)->disposed) {
return NULL;
@@ -1902,7 +1900,7 @@ static char* mpris_root_dbus_proxy_get_DesktopEntry (MprisRoot* self) {
}
-static void mpris_root_dbus_proxy_set_DesktopEntry (MprisRoot* self, const char* value) {
+static void mpris_root_dbus_proxy_set_DesktopEntry (MprisRoot* self, const gchar* value) {
DBusError _dbus_error;
DBusGConnection *_connection;
DBusMessage *_message, *_reply;
@@ -1961,11 +1959,11 @@ static void mpris_root_dbus_proxy_mpris_root__interface_init (MprisRootIface* if
}
-static void mpris_root_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+static void _vala_mpris_root_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
}
-static void mpris_root_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+static void _vala_mpris_root_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
}
@@ -2019,16 +2017,35 @@ void mpris_player_set_Position (MprisPlayer* self, gint32 value) {
}
-char* mpris_player_get_PlaybackStatus (MprisPlayer* self) {
+gchar* mpris_player_get_PlaybackStatus (MprisPlayer* self) {
return MPRIS_PLAYER_GET_INTERFACE (self)->get_PlaybackStatus (self);
}
-void mpris_player_set_PlaybackStatus (MprisPlayer* self, const char* value) {
+void mpris_player_set_PlaybackStatus (MprisPlayer* self, const gchar* value) {
MPRIS_PLAYER_GET_INTERFACE (self)->set_PlaybackStatus (self, value);
}
+static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
+ typedef void (*GMarshalFunc_VOID__INT64) (gpointer data1, gint64 arg_1, gpointer data2);
+ register GMarshalFunc_VOID__INT64 callback;
+ register GCClosure * cc;
+ register gpointer data1, data2;
+ cc = (GCClosure *) closure;
+ g_return_if_fail (n_param_values == 2);
+ if (G_CCLOSURE_SWAP_DATA (closure)) {
+ data1 = closure->data;
+ data2 = param_values->data[0].v_pointer;
+ } else {
+ data1 = param_values->data[0].v_pointer;
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_VOID__INT64) (marshal_data ? marshal_data : cc->callback);
+ callback (data1, g_value_get_int64 (param_values + 1), data2);
+}
+
+
void _mpris_player_dbus_unregister (DBusConnection* connection, void* _user_data_) {
}
@@ -2090,12 +2107,12 @@ static DBusHandlerResult _dbus_mpris_player_property_get (MprisPlayer* self, DBu
dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, "{sv}", &_tmp2_);
g_hash_table_iter_init (&_tmp4_, result);
while (g_hash_table_iter_next (&_tmp4_, &_tmp5_, &_tmp6_)) {
- char* _key;
+ gchar* _key;
GValue* _value;
const char* _tmp7_;
DBusMessageIter _tmp8_;
dbus_message_iter_open_container (&_tmp2_, DBUS_TYPE_DICT_ENTRY, NULL, &_tmp3_);
- _key = (char*) _tmp5_;
+ _key = (gchar*) _tmp5_;
_value = (GValue*) _tmp6_;
_tmp7_ = _key;
dbus_message_iter_append_basic (&_tmp3_, DBUS_TYPE_STRING, &_tmp7_);
@@ -2148,7 +2165,7 @@ static DBusHandlerResult _dbus_mpris_player_property_get (MprisPlayer* self, DBu
dbus_message_iter_append_basic (&_tmp8_, DBUS_TYPE_STRING, &_tmp16_);
dbus_message_iter_close_container (&_tmp3_, &_tmp8_);
} else if (G_VALUE_TYPE (_value) == G_TYPE_STRV) {
- const char** _tmp17_;
+ const gchar** _tmp17_;
DBusMessageIter _tmp18_;
int _tmp19_;
dbus_message_iter_open_container (&_tmp3_, DBUS_TYPE_VARIANT, "as", &_tmp8_);
@@ -2177,7 +2194,7 @@ static DBusHandlerResult _dbus_mpris_player_property_get (MprisPlayer* self, DBu
dbus_message_iter_append_basic (&subiter, DBUS_TYPE_INT32, &_tmp21_);
dbus_message_iter_close_container (&reply_iter, &subiter);
} else if ((strcmp (interface_name, "org.mpris.MediaPlayer2.Player") == 0) && (strcmp (property_name, "PlaybackStatus") == 0)) {
- char* result;
+ gchar* result;
const char* _tmp22_;
dbus_message_iter_open_container (&reply_iter, DBUS_TYPE_VARIANT, "s", &subiter);
result = mpris_player_get_PlaybackStatus (self);
@@ -2228,7 +2245,7 @@ static DBusHandlerResult _dbus_mpris_player_property_set (MprisPlayer* self, DBu
_tmp25_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
dbus_message_iter_recurse (&subiter, &_tmp26_);
while (dbus_message_iter_get_arg_type (&_tmp26_)) {
- char* _key;
+ gchar* _key;
GValue* _value;
const char* _tmp28_;
GValue _tmp29_ = {0};
@@ -2299,12 +2316,12 @@ static DBusHandlerResult _dbus_mpris_player_property_set (MprisPlayer* self, DBu
g_value_init (&_tmp29_, G_TYPE_STRING);
g_value_take_string (&_tmp29_, g_strdup (_tmp42_));
} else if ((dbus_message_iter_get_arg_type (&_tmp30_) == DBUS_TYPE_ARRAY) && (dbus_message_iter_get_element_type (&_tmp30_) == DBUS_TYPE_STRING)) {
- const char** _tmp43_;
+ const gchar** _tmp43_;
int _tmp43__length;
int _tmp43__size;
int _tmp43__length1;
DBusMessageIter _tmp44_;
- _tmp43_ = g_new (const char*, 5);
+ _tmp43_ = g_new (const gchar*, 5);
_tmp43__length = 0;
_tmp43__size = 4;
_tmp43__length1 = 0;
@@ -2313,7 +2330,7 @@ static DBusHandlerResult _dbus_mpris_player_property_set (MprisPlayer* self, DBu
const char* _tmp45_;
if (_tmp43__size == _tmp43__length) {
_tmp43__size = 2 * _tmp43__size;
- _tmp43_ = g_renew (const char*, _tmp43_, _tmp43__size + 1);
+ _tmp43_ = g_renew (const gchar*, _tmp43_, _tmp43__size + 1);
}
dbus_message_iter_get_basic (&_tmp44_, &_tmp45_);
dbus_message_iter_next (&_tmp44_);
@@ -2340,7 +2357,7 @@ static DBusHandlerResult _dbus_mpris_player_property_set (MprisPlayer* self, DBu
value = _tmp46_;
mpris_player_set_Position (self, value);
} else if ((strcmp (interface_name, "org.mpris.MediaPlayer2.Player") == 0) && (strcmp (property_name, "PlaybackStatus") == 0)) {
- char* value;
+ gchar* value;
const char* _tmp47_;
dbus_message_iter_get_basic (&subiter, &_tmp47_);
dbus_message_iter_next (&subiter);
@@ -2393,12 +2410,12 @@ static DBusHandlerResult _dbus_mpris_player_property_get_all (MprisPlayer* self,
dbus_message_iter_open_container (&value_iter, DBUS_TYPE_ARRAY, "{sv}", &_tmp49_);
g_hash_table_iter_init (&_tmp51_, result);
while (g_hash_table_iter_next (&_tmp51_, &_tmp52_, &_tmp53_)) {
- char* _key;
+ gchar* _key;
GValue* _value;
const char* _tmp54_;
DBusMessageIter _tmp55_;
dbus_message_iter_open_container (&_tmp49_, DBUS_TYPE_DICT_ENTRY, NULL, &_tmp50_);
- _key = (char*) _tmp52_;
+ _key = (gchar*) _tmp52_;
_value = (GValue*) _tmp53_;
_tmp54_ = _key;
dbus_message_iter_append_basic (&_tmp50_, DBUS_TYPE_STRING, &_tmp54_);
@@ -2451,7 +2468,7 @@ static DBusHandlerResult _dbus_mpris_player_property_get_all (MprisPlayer* self,
dbus_message_iter_append_basic (&_tmp55_, DBUS_TYPE_STRING, &_tmp63_);
dbus_message_iter_close_container (&_tmp50_, &_tmp55_);
} else if (G_VALUE_TYPE (_value) == G_TYPE_STRV) {
- const char** _tmp64_;
+ const gchar** _tmp64_;
DBusMessageIter _tmp65_;
int _tmp66_;
dbus_message_iter_open_container (&_tmp50_, DBUS_TYPE_VARIANT, "as", &_tmp55_);
@@ -2487,7 +2504,7 @@ static DBusHandlerResult _dbus_mpris_player_property_get_all (MprisPlayer* self,
dbus_message_iter_close_container (&subiter, &entry_iter);
}
{
- char* result;
+ gchar* result;
const char* _tmp69_;
dbus_message_iter_open_container (&subiter, DBUS_TYPE_DICT_ENTRY, NULL, &entry_iter);
property_name = "PlaybackStatus";
@@ -3090,8 +3107,8 @@ static void mpris_player_dbus_proxy_dispose (GObject* self) {
static void mpris_player_dbus_proxy_class_init (MprisPlayerDBusProxyClass* klass) {
G_OBJECT_CLASS (klass)->constructor = mpris_player_dbus_proxy_construct;
G_OBJECT_CLASS (klass)->dispose = mpris_player_dbus_proxy_dispose;
- G_OBJECT_CLASS (klass)->get_property = mpris_player_dbus_proxy_get_property;
- G_OBJECT_CLASS (klass)->set_property = mpris_player_dbus_proxy_set_property;
+ G_OBJECT_CLASS (klass)->get_property = _vala_mpris_player_dbus_proxy_get_property;
+ G_OBJECT_CLASS (klass)->set_property = _vala_mpris_player_dbus_proxy_set_property;
g_object_class_override_property (G_OBJECT_CLASS (klass), MPRIS_PLAYER_DBUS_PROXY_METADATA, "Metadata");
g_object_class_override_property (G_OBJECT_CLASS (klass), MPRIS_PLAYER_DBUS_PROXY_POSITION, "Position");
g_object_class_override_property (G_OBJECT_CLASS (klass), MPRIS_PLAYER_DBUS_PROXY_PLAYBACK_STATUS, "PlaybackStatus");
@@ -3147,8 +3164,8 @@ static void mpris_player_dbus_proxy_PlayPause_finish (MprisPlayer* self, GAsyncR
_reply = dbus_pending_call_steal_reply (_data_->pending);
dbus_set_error_from_message (&_dbus_error, _reply);
if (dbus_error_is_set (&_dbus_error)) {
- GQuark _edomain;
- gint _ecode;
+ GQuark _edomain = 0;
+ gint _ecode = 0;
if (strstr (_dbus_error.name, "org.freedesktop.DBus.Error") == _dbus_error.name) {
const char* _tmp33_;
_edomain = DBUS_GERROR;
@@ -3280,8 +3297,8 @@ static void mpris_player_dbus_proxy_Next_finish (MprisPlayer* self, GAsyncResult
_reply = dbus_pending_call_steal_reply (_data_->pending);
dbus_set_error_from_message (&_dbus_error, _reply);
if (dbus_error_is_set (&_dbus_error)) {
- GQuark _edomain;
- gint _ecode;
+ GQuark _edomain = 0;
+ gint _ecode = 0;
if (strstr (_dbus_error.name, "org.freedesktop.DBus.Error") == _dbus_error.name) {
const char* _tmp34_;
_edomain = DBUS_GERROR;
@@ -3413,8 +3430,8 @@ static void mpris_player_dbus_proxy_Previous_finish (MprisPlayer* self, GAsyncRe
_reply = dbus_pending_call_steal_reply (_data_->pending);
dbus_set_error_from_message (&_dbus_error, _reply);
if (dbus_error_is_set (&_dbus_error)) {
- GQuark _edomain;
- gint _ecode;
+ GQuark _edomain = 0;
+ gint _ecode = 0;
if (strstr (_dbus_error.name, "org.freedesktop.DBus.Error") == _dbus_error.name) {
const char* _tmp35_;
_edomain = DBUS_GERROR;
@@ -3546,7 +3563,7 @@ static GHashTable* mpris_player_dbus_proxy_get_Metadata (MprisPlayer* self) {
_tmp38_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
dbus_message_iter_recurse (&_subiter, &_tmp39_);
while (dbus_message_iter_get_arg_type (&_tmp39_)) {
- char* _key;
+ gchar* _key;
GValue* _value;
const char* _tmp41_;
GValue _tmp42_ = {0};
@@ -3617,12 +3634,12 @@ static GHashTable* mpris_player_dbus_proxy_get_Metadata (MprisPlayer* self) {
g_value_init (&_tmp42_, G_TYPE_STRING);
g_value_take_string (&_tmp42_, g_strdup (_tmp55_));
} else if ((dbus_message_iter_get_arg_type (&_tmp43_) == DBUS_TYPE_ARRAY) && (dbus_message_iter_get_element_type (&_tmp43_) == DBUS_TYPE_STRING)) {
- const char** _tmp56_;
+ const gchar** _tmp56_;
int _tmp56__length;
int _tmp56__size;
int _tmp56__length1;
DBusMessageIter _tmp57_;
- _tmp56_ = g_new (const char*, 5);
+ _tmp56_ = g_new (const gchar*, 5);
_tmp56__length = 0;
_tmp56__size = 4;
_tmp56__length1 = 0;
@@ -3631,7 +3648,7 @@ static GHashTable* mpris_player_dbus_proxy_get_Metadata (MprisPlayer* self) {
const char* _tmp58_;
if (_tmp56__size == _tmp56__length) {
_tmp56__size = 2 * _tmp56__size;
- _tmp56_ = g_renew (const char*, _tmp56_, _tmp56__size + 1);
+ _tmp56_ = g_renew (const gchar*, _tmp56_, _tmp56__size + 1);
}
dbus_message_iter_get_basic (&_tmp57_, &_tmp58_);
dbus_message_iter_next (&_tmp57_);
@@ -3676,12 +3693,12 @@ static void mpris_player_dbus_proxy_set_Metadata (MprisPlayer* self, GHashTable*
dbus_message_iter_open_container (&_subiter, DBUS_TYPE_ARRAY, "{sv}", &_tmp61_);
g_hash_table_iter_init (&_tmp63_, value);
while (g_hash_table_iter_next (&_tmp63_, &_tmp64_, &_tmp65_)) {
- char* _key;
+ gchar* _key;
GValue* _value;
const char* _tmp66_;
DBusMessageIter _tmp67_;
dbus_message_iter_open_container (&_tmp61_, DBUS_TYPE_DICT_ENTRY, NULL, &_tmp62_);
- _key = (char*) _tmp64_;
+ _key = (gchar*) _tmp64_;
_value = (GValue*) _tmp65_;
_tmp66_ = _key;
dbus_message_iter_append_basic (&_tmp62_, DBUS_TYPE_STRING, &_tmp66_);
@@ -3734,7 +3751,7 @@ static void mpris_player_dbus_proxy_set_Metadata (MprisPlayer* self, GHashTable*
dbus_message_iter_append_basic (&_tmp67_, DBUS_TYPE_STRING, &_tmp75_);
dbus_message_iter_close_container (&_tmp62_, &_tmp67_);
} else if (G_VALUE_TYPE (_value) == G_TYPE_STRV) {
- const char** _tmp76_;
+ const gchar** _tmp76_;
DBusMessageIter _tmp77_;
int _tmp78_;
dbus_message_iter_open_container (&_tmp62_, DBUS_TYPE_VARIANT, "as", &_tmp67_);
@@ -3862,14 +3879,14 @@ static void mpris_player_dbus_proxy_set_Position (MprisPlayer* self, gint32 valu
}
-static char* mpris_player_dbus_proxy_get_PlaybackStatus (MprisPlayer* self) {
+static gchar* mpris_player_dbus_proxy_get_PlaybackStatus (MprisPlayer* self) {
DBusError _dbus_error;
DBusGConnection *_connection;
DBusMessage *_message, *_reply;
DBusMessageIter _iter, _subiter;
const char* _tmp86_;
const char* _tmp87_;
- char* _result;
+ gchar* _result;
const char* _tmp88_;
if (((MprisPlayerDBusProxy*) self)->disposed) {
return NULL;
@@ -3910,7 +3927,7 @@ static char* mpris_player_dbus_proxy_get_PlaybackStatus (MprisPlayer* self) {
}
-static void mpris_player_dbus_proxy_set_PlaybackStatus (MprisPlayer* self, const char* value) {
+static void mpris_player_dbus_proxy_set_PlaybackStatus (MprisPlayer* self, const gchar* value) {
DBusError _dbus_error;
DBusGConnection *_connection;
DBusMessage *_message, *_reply;
@@ -3967,11 +3984,30 @@ static void mpris_player_dbus_proxy_mpris_player__interface_init (MprisPlayerIfa
}
-static void mpris_player_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+static void _vala_mpris_player_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
}
-static void mpris_player_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+static void _vala_mpris_player_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+}
+
+
+static void g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
+ typedef void (*GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer arg_3, gint arg_4, gpointer data2);
+ register GMarshalFunc_VOID__STRING_BOXED_BOXED_INT callback;
+ register GCClosure * cc;
+ register gpointer data1, data2;
+ cc = (GCClosure *) closure;
+ g_return_if_fail (n_param_values == 5);
+ if (G_CCLOSURE_SWAP_DATA (closure)) {
+ data1 = closure->data;
+ data2 = param_values->data[0].v_pointer;
+ } else {
+ data1 = param_values->data[0].v_pointer;
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (marshal_data ? marshal_data : cc->callback);
+ callback (data1, g_value_get_string (param_values + 1), g_value_get_boxed (param_values + 2), g_value_get_boxed (param_values + 3), g_value_get_int (param_values + 4), data2);
}
@@ -4055,7 +4091,7 @@ DBusHandlerResult free_desktop_properties_dbus_message (DBusConnection* connecti
}
-static void _dbus_free_desktop_properties_properties_changed (GObject* _sender, const char* source, GHashTable* changed_properties, char** invalid, int invalid_length1, DBusConnection* _connection) {
+static void _dbus_free_desktop_properties_properties_changed (GObject* _sender, const gchar* source, GHashTable* changed_properties, gchar** invalid, int invalid_length1, DBusConnection* _connection) {
const char * _path;
DBusMessage *_message;
DBusMessageIter _iter;
@@ -4063,7 +4099,7 @@ static void _dbus_free_desktop_properties_properties_changed (GObject* _sender,
DBusMessageIter _tmp2_, _tmp3_;
GHashTableIter _tmp4_;
gpointer _tmp5_, _tmp6_;
- char** _tmp21_;
+ gchar** _tmp21_;
DBusMessageIter _tmp22_;
int _tmp23_;
_path = g_object_get_data (_sender, "dbus_object_path");
@@ -4074,12 +4110,12 @@ static void _dbus_free_desktop_properties_properties_changed (GObject* _sender,
dbus_message_iter_open_container (&_iter, DBUS_TYPE_ARRAY, "{sv}", &_tmp2_);
g_hash_table_iter_init (&_tmp4_, changed_properties);
while (g_hash_table_iter_next (&_tmp4_, &_tmp5_, &_tmp6_)) {
- char* _key;
+ gchar* _key;
GValue* _value;
const char* _tmp7_;
DBusMessageIter _tmp8_;
dbus_message_iter_open_container (&_tmp2_, DBUS_TYPE_DICT_ENTRY, NULL, &_tmp3_);
- _key = (char*) _tmp5_;
+ _key = (gchar*) _tmp5_;
_value = (GValue*) _tmp6_;
_tmp7_ = _key;
dbus_message_iter_append_basic (&_tmp3_, DBUS_TYPE_STRING, &_tmp7_);
@@ -4132,7 +4168,7 @@ static void _dbus_free_desktop_properties_properties_changed (GObject* _sender,
dbus_message_iter_append_basic (&_tmp8_, DBUS_TYPE_STRING, &_tmp16_);
dbus_message_iter_close_container (&_tmp3_, &_tmp8_);
} else if (G_VALUE_TYPE (_value) == G_TYPE_STRV) {
- const char** _tmp17_;
+ const gchar** _tmp17_;
DBusMessageIter _tmp18_;
int _tmp19_;
dbus_message_iter_open_container (&_tmp3_, DBUS_TYPE_VARIANT, "as", &_tmp8_);
@@ -4226,15 +4262,15 @@ static GObject* free_desktop_properties_dbus_proxy_construct (GType gtype, guint
static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktopProperties* self, DBusConnection* connection, DBusMessage* message) {
DBusMessageIter iter;
- char* source = NULL;
+ gchar* source = NULL;
const char* _tmp92_;
GHashTable* changed_properties = NULL;
GHashTable* _tmp93_;
DBusMessageIter _tmp94_;
DBusMessageIter _tmp95_;
- char** invalid = NULL;
+ gchar** invalid = NULL;
int invalid_length1;
- char** _tmp114_;
+ gchar** _tmp114_;
int _tmp114__length;
int _tmp114__size;
int _tmp114__length1;
@@ -4250,7 +4286,7 @@ static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktop
_tmp93_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
dbus_message_iter_recurse (&iter, &_tmp94_);
while (dbus_message_iter_get_arg_type (&_tmp94_)) {
- char* _key;
+ gchar* _key;
GValue* _value;
const char* _tmp96_;
GValue _tmp97_ = {0};
@@ -4321,12 +4357,12 @@ static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktop
g_value_init (&_tmp97_, G_TYPE_STRING);
g_value_take_string (&_tmp97_, g_strdup (_tmp110_));
} else if ((dbus_message_iter_get_arg_type (&_tmp98_) == DBUS_TYPE_ARRAY) && (dbus_message_iter_get_element_type (&_tmp98_) == DBUS_TYPE_STRING)) {
- const char** _tmp111_;
+ const gchar** _tmp111_;
int _tmp111__length;
int _tmp111__size;
int _tmp111__length1;
DBusMessageIter _tmp112_;
- _tmp111_ = g_new (const char*, 5);
+ _tmp111_ = g_new (const gchar*, 5);
_tmp111__length = 0;
_tmp111__size = 4;
_tmp111__length1 = 0;
@@ -4335,7 +4371,7 @@ static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktop
const char* _tmp113_;
if (_tmp111__size == _tmp111__length) {
_tmp111__size = 2 * _tmp111__size;
- _tmp111_ = g_renew (const char*, _tmp111_, _tmp111__size + 1);
+ _tmp111_ = g_renew (const gchar*, _tmp111_, _tmp111__size + 1);
}
dbus_message_iter_get_basic (&_tmp112_, &_tmp113_);
dbus_message_iter_next (&_tmp112_);
@@ -4353,7 +4389,7 @@ static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktop
dbus_message_iter_next (&iter);
changed_properties = _tmp93_;
invalid_length1 = 0;
- _tmp114_ = g_new (char*, 5);
+ _tmp114_ = g_new (gchar*, 5);
_tmp114__length = 0;
_tmp114__size = 4;
_tmp114__length1 = 0;
@@ -4362,7 +4398,7 @@ static void _dbus_handle_free_desktop_properties_properties_changed (FreeDesktop
const char* _tmp116_;
if (_tmp114__size == _tmp114__length) {
_tmp114__size = 2 * _tmp114__size;
- _tmp114_ = g_renew (char*, _tmp114_, _tmp114__size + 1);
+ _tmp114_ = g_renew (gchar*, _tmp114_, _tmp114__size + 1);
}
dbus_message_iter_get_basic (&_tmp115_, &_tmp116_);
dbus_message_iter_next (&_tmp115_);
@@ -4404,8 +4440,8 @@ static void free_desktop_properties_dbus_proxy_dispose (GObject* self) {
static void free_desktop_properties_dbus_proxy_class_init (FreeDesktopPropertiesDBusProxyClass* klass) {
G_OBJECT_CLASS (klass)->constructor = free_desktop_properties_dbus_proxy_construct;
G_OBJECT_CLASS (klass)->dispose = free_desktop_properties_dbus_proxy_dispose;
- G_OBJECT_CLASS (klass)->get_property = free_desktop_properties_dbus_proxy_get_property;
- G_OBJECT_CLASS (klass)->set_property = free_desktop_properties_dbus_proxy_set_property;
+ G_OBJECT_CLASS (klass)->get_property = _vala_free_desktop_properties_dbus_proxy_get_property;
+ G_OBJECT_CLASS (klass)->set_property = _vala_free_desktop_properties_dbus_proxy_set_property;
}
@@ -4417,16 +4453,16 @@ static void free_desktop_properties_dbus_proxy_free_desktop_properties__interfac
}
-static void free_desktop_properties_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+static void _vala_free_desktop_properties_dbus_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
}
-static void free_desktop_properties_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+static void _vala_free_desktop_properties_dbus_proxy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
}
Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl) {
- Mpris2Controller * self;
+ Mpris2Controller * self = NULL;
g_return_val_if_fail (ctrl != NULL, NULL);
self = (Mpris2Controller*) g_object_new (object_type, "owner", ctrl, NULL);
return self;
@@ -4454,52 +4490,86 @@ static void _vala_GValue_free (GValue* self) {
}
-void mpris2_controller_property_changed_cb (Mpris2Controller* self, const char* interface_source, GHashTable* changed_properties, char** invalid, int invalid_length1) {
- gboolean _tmp0_ = FALSE;
+void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1) {
+ const gchar* _tmp0_ = NULL;
+ gboolean _tmp1_ = FALSE;
+ gconstpointer _tmp3_ = NULL;
+ GValue* _tmp4_;
GValue* play_v;
+ gconstpointer _tmp10_ = NULL;
+ GValue* _tmp11_;
GValue* meta_v;
g_return_if_fail (self != NULL);
g_return_if_fail (interface_source != NULL);
g_return_if_fail (changed_properties != NULL);
+ _tmp0_ = player_controller_get_mpris_name (self->priv->_owner);
g_debug ("mpris2-controller.vala:95: properties-changed for interface %s and own" \
-"er %s", interface_source, player_controller_get_mpris_name (self->priv->_owner));
+"er %s", interface_source, _tmp0_);
if (changed_properties == NULL) {
- _tmp0_ = TRUE;
+ _tmp1_ = TRUE;
} else {
- _tmp0_ = g_str_has_prefix (interface_source, MPRIS2_CONTROLLER_root_interface) == FALSE;
+ gboolean _tmp2_;
+ _tmp2_ = g_str_has_prefix (interface_source, MPRIS2_CONTROLLER_root_interface);
+ _tmp1_ = _tmp2_ == FALSE;
}
- if (_tmp0_) {
+ if (_tmp1_) {
g_warning ("mpris2-controller.vala:98: Property-changed hash is null or this is an" \
" interface that doesn't concerns us");
return;
}
- play_v = __g_value_dup0 ((GValue*) g_hash_table_lookup (changed_properties, "PlaybackStatus"));
+ _tmp3_ = g_hash_table_lookup (changed_properties, "PlaybackStatus");
+ _tmp4_ = __g_value_dup0 ((GValue*) _tmp3_);
+ play_v = _tmp4_;
if (play_v != NULL) {
- char* state;
+ gchar* _tmp5_ = NULL;
+ gchar* state;
+ TransportMenuitemstate _tmp6_;
TransportMenuitemstate p;
- PlayerItem* _tmp1_;
- TransportMenuitem* _tmp2_;
- state = mpris_player_get_PlaybackStatus (self->priv->_player);
- p = (TransportMenuitemstate) mpris2_controller_determine_play_state (self, state);
- transport_menuitem_change_play_state (_tmp2_ = (_tmp1_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT), IS_TRANSPORT_MENUITEM (_tmp1_) ? ((TransportMenuitem*) _tmp1_) : NULL), p);
- _g_object_unref0 (_tmp2_);
+ gpointer _tmp7_ = NULL;
+ PlayerItem* _tmp8_;
+ TransportMenuitem* _tmp9_;
+ _tmp5_ = mpris_player_get_PlaybackStatus (self->priv->_player);
+ state = _tmp5_;
+ _tmp6_ = mpris2_controller_determine_play_state (self, state);
+ p = (TransportMenuitemstate) _tmp6_;
+ _tmp7_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT);
+ _tmp9_ = (_tmp8_ = (PlayerItem*) _tmp7_, IS_TRANSPORT_MENUITEM (_tmp8_) ? ((TransportMenuitem*) _tmp8_) : NULL);
+ transport_menuitem_change_play_state (_tmp9_, p);
+ _g_object_unref0 (_tmp9_);
_g_free0 (state);
}
- meta_v = __g_value_dup0 ((GValue*) g_hash_table_lookup (changed_properties, "Metadata"));
+ _tmp10_ = g_hash_table_lookup (changed_properties, "Metadata");
+ _tmp11_ = __g_value_dup0 ((GValue*) _tmp10_);
+ meta_v = _tmp11_;
if (meta_v != NULL) {
+ GHashTable* _tmp12_ = NULL;
GHashTable* changed_updates;
+ gpointer _tmp13_ = NULL;
PlayerItem* metadata;
- GeeHashSet* _tmp3_;
- GeeHashSet* _tmp4_;
- GeeHashSet* _tmp5_;
- changed_updates = mpris2_controller_clean_metadata (self);
- metadata = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA);
- player_item_reset (metadata, _tmp3_ = metadata_menuitem_attributes_format ());
- _g_object_unref0 (_tmp3_);
- player_item_update (metadata, changed_updates, _tmp4_ = metadata_menuitem_attributes_format ());
- _g_object_unref0 (_tmp4_);
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) metadata, DBUSMENU_MENUITEM_PROP_VISIBLE, player_item_populated (metadata, _tmp5_ = metadata_menuitem_attributes_format ()));
- _g_object_unref0 (_tmp5_);
+ GeeHashSet* _tmp14_ = NULL;
+ GeeHashSet* _tmp15_;
+ GeeHashSet* _tmp16_ = NULL;
+ GeeHashSet* _tmp17_;
+ GeeHashSet* _tmp18_ = NULL;
+ GeeHashSet* _tmp19_;
+ gboolean _tmp20_;
+ _tmp12_ = mpris2_controller_clean_metadata (self);
+ changed_updates = _tmp12_;
+ _tmp13_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA);
+ metadata = (PlayerItem*) _tmp13_;
+ _tmp14_ = metadata_menuitem_attributes_format ();
+ _tmp15_ = _tmp14_;
+ player_item_reset (metadata, _tmp15_);
+ _g_object_unref0 (_tmp15_);
+ _tmp16_ = metadata_menuitem_attributes_format ();
+ _tmp17_ = _tmp16_;
+ player_item_update (metadata, changed_updates, _tmp17_);
+ _g_object_unref0 (_tmp17_);
+ _tmp18_ = metadata_menuitem_attributes_format ();
+ _tmp19_ = _tmp18_;
+ _tmp20_ = player_item_populated (metadata, _tmp19_);
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) metadata, DBUSMENU_MENUITEM_PROP_VISIBLE, _tmp20_);
+ _g_object_unref0 (_tmp19_);
_g_object_unref0 (metadata);
_g_hash_table_unref0 (changed_updates);
}
@@ -4508,10 +4578,10 @@ void mpris2_controller_property_changed_cb (Mpris2Controller* self, const char*
}
-static char** _vala_array_dup1 (char** self, int length) {
- char** result;
+static gchar** _vala_array_dup1 (gchar** self, int length) {
+ gchar** result;
int i;
- result = g_new0 (char*, length + 1);
+ result = g_new0 (gchar*, length + 1);
for (i = 0; i < length; i++) {
result[i] = g_strdup (self[i]);
}
@@ -4521,41 +4591,80 @@ static char** _vala_array_dup1 (char** self, int length) {
static GHashTable* mpris2_controller_clean_metadata (Mpris2Controller* self) {
GHashTable* result = NULL;
+ GHashTable* _tmp0_ = NULL;
GHashTable* changed_updates;
- GHashTable* _tmp0_;
- GValue* _tmp1_;
+ GHashTable* _tmp1_ = NULL;
+ GHashTable* _tmp2_;
+ gconstpointer _tmp3_ = NULL;
+ GValue* _tmp4_;
+ GValue* _tmp5_;
GValue* artist_v;
- GHashTable* _tmp7_;
- GValue* _tmp8_;
+ GHashTable* _tmp16_ = NULL;
+ GHashTable* _tmp17_;
+ gconstpointer _tmp18_ = NULL;
+ GValue* _tmp19_;
+ GValue* _tmp20_;
GValue* length_v;
g_return_val_if_fail (self != NULL, NULL);
- changed_updates = mpris_player_get_Metadata (self->priv->_player);
- artist_v = (_tmp1_ = __g_value_dup0 ((GValue*) g_hash_table_lookup (_tmp0_ = mpris_player_get_Metadata (self->priv->_player), "xesam:artist")), _g_hash_table_unref0 (_tmp0_), _tmp1_);
+ _tmp0_ = mpris_player_get_Metadata (self->priv->_player);
+ changed_updates = _tmp0_;
+ _tmp1_ = mpris_player_get_Metadata (self->priv->_player);
+ _tmp2_ = _tmp1_;
+ _tmp3_ = g_hash_table_lookup (_tmp2_, "xesam:artist");
+ _tmp4_ = __g_value_dup0 ((GValue*) _tmp3_);
+ artist_v = (_tmp5_ = _tmp4_, _g_hash_table_unref0 (_tmp2_), _tmp5_);
if (artist_v != NULL) {
+ GHashTable* _tmp6_ = NULL;
+ GHashTable* _tmp7_;
+ gconstpointer _tmp8_ = NULL;
+ gchar** _tmp9_;
+ gchar** _tmp10_;
+ gchar** _tmp11_;
gint artists_length1;
gint _artists_size_;
- char** _tmp5_;
- GHashTable* _tmp2_;
- char** _tmp3_;
- char** _tmp4_;
- char** artists;
- char* display_artists;
- GValue* _tmp6_ = NULL;
- artists = (_tmp5_ = (_tmp4_ = (_tmp3_ = g_value_get_boxed ((GValue*) g_hash_table_lookup (_tmp2_ = mpris_player_get_Metadata (self->priv->_player), "xesam:artist")), (_tmp3_ == NULL) ? ((gpointer) _tmp3_) : _vala_array_dup1 (_tmp3_, g_strv_length (g_value_get_boxed ((GValue*) g_hash_table_lookup (_tmp2_ = mpris_player_get_Metadata (self->priv->_player), "xesam:artist"))))), _g_hash_table_unref0 (_tmp2_), _tmp4_), artists_length1 = g_strv_length (g_value_get_boxed ((GValue*) g_hash_table_lookup (_tmp2_ = mpris_player_get_Metadata (self->priv->_player), "xesam:artist"))), _artists_size_ = artists_length1, _tmp5_);
- display_artists = g_strjoinv (", ", artists);
- g_hash_table_replace (changed_updates, g_strdup ("xesam:artist"), (_tmp6_ = g_new0 (GValue, 1), g_value_init (_tmp6_, G_TYPE_STRING), g_value_set_string (_tmp6_, display_artists), _tmp6_));
+ gchar** _tmp12_;
+ gchar** artists;
+ gchar* _tmp13_ = NULL;
+ gchar* display_artists;
+ gchar* _tmp14_;
+ GValue* _tmp15_ = NULL;
+ _tmp6_ = mpris_player_get_Metadata (self->priv->_player);
+ _tmp7_ = _tmp6_;
+ _tmp8_ = g_hash_table_lookup (_tmp7_, "xesam:artist");
+ _tmp9_ = (_tmp10_ = g_value_get_boxed ((GValue*) _tmp8_), (_tmp10_ == NULL) ? ((gpointer) _tmp10_) : _vala_array_dup1 (_tmp10_, g_strv_length (g_value_get_boxed ((GValue*) _tmp8_))));
+ _tmp12_ = (_tmp11_ = _tmp9_, _g_hash_table_unref0 (_tmp7_), _tmp11_);
+ artists_length1 = g_strv_length (g_value_get_boxed ((GValue*) _tmp8_));
+ _artists_size_ = artists_length1;
+ artists = _tmp12_;
+ _tmp13_ = g_strjoinv (", ", artists);
+ display_artists = _tmp13_;
+ _tmp14_ = g_strdup ("xesam:artist");
+ g_hash_table_replace (changed_updates, _tmp14_, (_tmp15_ = g_new0 (GValue, 1), g_value_init (_tmp15_, G_TYPE_STRING), g_value_set_string (_tmp15_, display_artists), _tmp15_));
g_debug ("mpris2-controller.vala:128: artist : %s", display_artists);
_g_free0 (display_artists);
artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL);
}
- length_v = (_tmp8_ = __g_value_dup0 ((GValue*) g_hash_table_lookup (_tmp7_ = mpris_player_get_Metadata (self->priv->_player), "mpris:length")), _g_hash_table_unref0 (_tmp7_), _tmp8_);
+ _tmp16_ = mpris_player_get_Metadata (self->priv->_player);
+ _tmp17_ = _tmp16_;
+ _tmp18_ = g_hash_table_lookup (_tmp17_, "mpris:length");
+ _tmp19_ = __g_value_dup0 ((GValue*) _tmp18_);
+ length_v = (_tmp20_ = _tmp19_, _g_hash_table_unref0 (_tmp17_), _tmp20_);
if (length_v != NULL) {
- GHashTable* _tmp9_;
- gint64 _tmp10_;
+ GHashTable* _tmp21_ = NULL;
+ GHashTable* _tmp22_;
+ gconstpointer _tmp23_ = NULL;
+ gint64 _tmp24_;
+ gint64 _tmp25_;
gint64 duration;
- GValue* _tmp11_ = NULL;
- duration = (_tmp10_ = g_value_get_int64 ((GValue*) g_hash_table_lookup (_tmp9_ = mpris_player_get_Metadata (self->priv->_player), "mpris:length")), _g_hash_table_unref0 (_tmp9_), _tmp10_);
- g_hash_table_replace (changed_updates, g_strdup ("mpris:length"), (_tmp11_ = g_new0 (GValue, 1), g_value_init (_tmp11_, G_TYPE_INT64), g_value_set_int64 (_tmp11_, duration / 1000000), _tmp11_));
+ gchar* _tmp26_;
+ GValue* _tmp27_ = NULL;
+ _tmp21_ = mpris_player_get_Metadata (self->priv->_player);
+ _tmp22_ = _tmp21_;
+ _tmp23_ = g_hash_table_lookup (_tmp22_, "mpris:length");
+ _tmp24_ = g_value_get_int64 ((GValue*) _tmp23_);
+ duration = (_tmp25_ = _tmp24_, _g_hash_table_unref0 (_tmp22_), _tmp25_);
+ _tmp26_ = g_strdup ("mpris:length");
+ g_hash_table_replace (changed_updates, _tmp26_, (_tmp27_ = g_new0 (GValue, 1), g_value_init (_tmp27_, G_TYPE_INT64), g_value_set_int64 (_tmp27_, duration / 1000000), _tmp27_));
}
result = changed_updates;
__vala_GValue_free0 (length_v);
@@ -4564,13 +4673,13 @@ static GHashTable* mpris2_controller_clean_metadata (Mpris2Controller* self) {
}
-static TransportMenuitemstate mpris2_controller_determine_play_state (Mpris2Controller* self, const char* status) {
+static TransportMenuitemstate mpris2_controller_determine_play_state (Mpris2Controller* self, const gchar* status) {
TransportMenuitemstate result = 0;
gboolean _tmp0_ = FALSE;
g_return_val_if_fail (self != NULL, 0);
g_return_val_if_fail (status != NULL, 0);
if (status != NULL) {
- _tmp0_ = _vala_strcmp0 (status, "Playing") == 0;
+ _tmp0_ = g_strcmp0 (status, "Playing") == 0;
} else {
_tmp0_ = FALSE;
}
@@ -4585,27 +4694,46 @@ static TransportMenuitemstate mpris2_controller_determine_play_state (Mpris2Cont
void mpris2_controller_initial_update (Mpris2Controller* self) {
TransportMenuitemstate update = 0;
- char* _tmp0_;
- gboolean _tmp1_;
- PlayerItem* _tmp3_;
- TransportMenuitem* _tmp4_;
+ gchar* _tmp0_ = NULL;
+ gchar* _tmp1_;
+ gboolean _tmp2_;
+ gpointer _tmp6_ = NULL;
+ PlayerItem* _tmp7_;
+ TransportMenuitem* _tmp8_;
+ GHashTable* _tmp9_ = NULL;
GHashTable* cleaned_metadata;
- PlayerItem* _tmp5_;
- GeeHashSet* _tmp6_;
+ gpointer _tmp10_ = NULL;
+ PlayerItem* _tmp11_;
+ GeeHashSet* _tmp12_ = NULL;
+ GeeHashSet* _tmp13_;
g_return_if_fail (self != NULL);
- if ((_tmp1_ = (_tmp0_ = mpris_player_get_PlaybackStatus (self->priv->_player)) == NULL, _g_free0 (_tmp0_), _tmp1_)) {
+ _tmp0_ = mpris_player_get_PlaybackStatus (self->priv->_player);
+ _tmp1_ = _tmp0_;
+ if ((_tmp2_ = _tmp1_ == NULL, _g_free0 (_tmp1_), _tmp2_)) {
update = TRANSPORT_MENUITEM_STATE_PAUSED;
} else {
- char* _tmp2_;
- update = mpris2_controller_determine_play_state (self, _tmp2_ = mpris_player_get_PlaybackStatus (self->priv->_player));
- _g_free0 (_tmp2_);
- }
- transport_menuitem_change_play_state (_tmp4_ = (_tmp3_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT), IS_TRANSPORT_MENUITEM (_tmp3_) ? ((TransportMenuitem*) _tmp3_) : NULL), update);
- _g_object_unref0 (_tmp4_);
- cleaned_metadata = mpris2_controller_clean_metadata (self);
- player_item_update (_tmp5_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA), cleaned_metadata, _tmp6_ = metadata_menuitem_attributes_format ());
- _g_object_unref0 (_tmp6_);
- _g_object_unref0 (_tmp5_);
+ gchar* _tmp3_ = NULL;
+ gchar* _tmp4_;
+ TransportMenuitemstate _tmp5_;
+ _tmp3_ = mpris_player_get_PlaybackStatus (self->priv->_player);
+ _tmp4_ = _tmp3_;
+ _tmp5_ = mpris2_controller_determine_play_state (self, _tmp4_);
+ update = _tmp5_;
+ _g_free0 (_tmp4_);
+ }
+ _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT);
+ _tmp8_ = (_tmp7_ = (PlayerItem*) _tmp6_, IS_TRANSPORT_MENUITEM (_tmp7_) ? ((TransportMenuitem*) _tmp7_) : NULL);
+ transport_menuitem_change_play_state (_tmp8_, update);
+ _g_object_unref0 (_tmp8_);
+ _tmp9_ = mpris2_controller_clean_metadata (self);
+ cleaned_metadata = _tmp9_;
+ _tmp10_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA);
+ _tmp11_ = (PlayerItem*) _tmp10_;
+ _tmp12_ = metadata_menuitem_attributes_format ();
+ _tmp13_ = _tmp12_;
+ player_item_update (_tmp11_, cleaned_metadata, _tmp13_);
+ _g_object_unref0 (_tmp13_);
+ _g_object_unref0 (_tmp11_);
_g_hash_table_unref0 (cleaned_metadata);
}
@@ -4660,8 +4788,10 @@ gboolean mpris2_controller_was_successfull (Mpris2Controller* self) {
void mpris2_controller_expose (Mpris2Controller* self) {
+ gboolean _tmp0_;
g_return_if_fail (self != NULL);
- if (mpris2_controller_connected (self) == TRUE) {
+ _tmp0_ = mpris2_controller_connected (self);
+ if (_tmp0_ == TRUE) {
mpris_root_Raise (self->priv->_mpris2_root, NULL, NULL);
}
}
@@ -4682,8 +4812,12 @@ static gpointer _g_object_ref0 (gpointer self) {
static void mpris2_controller_set_mpris2_root (Mpris2Controller* self, MprisRoot* value) {
MprisRoot* _tmp0_;
+ MprisRoot* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_mpris2_root = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_mpris2_root), _tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->_mpris2_root);
+ self->priv->_mpris2_root = _tmp1_;
g_object_notify ((GObject *) self, "mpris2-root");
}
@@ -4698,8 +4832,12 @@ MprisPlayer* mpris2_controller_get_player (Mpris2Controller* self) {
static void mpris2_controller_set_player (Mpris2Controller* self, MprisPlayer* value) {
MprisPlayer* _tmp0_;
+ MprisPlayer* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_player = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_player), _tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->_player);
+ self->priv->_player = _tmp1_;
g_object_notify ((GObject *) self, "player");
}
@@ -4714,8 +4852,12 @@ PlayerController* mpris2_controller_get_owner (Mpris2Controller* self) {
static void mpris2_controller_set_owner (Mpris2Controller* self, PlayerController* value) {
PlayerController* _tmp0_;
+ PlayerController* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_owner = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_owner), _tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->_owner);
+ self->priv->_owner = _tmp1_;
g_object_notify ((GObject *) self, "owner");
}
@@ -4730,13 +4872,17 @@ FreeDesktopProperties* mpris2_controller_get_properties_interface (Mpris2Control
static void mpris2_controller_set_properties_interface (Mpris2Controller* self, FreeDesktopProperties* value) {
FreeDesktopProperties* _tmp0_;
+ FreeDesktopProperties* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_properties_interface = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_properties_interface), _tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->_properties_interface);
+ self->priv->_properties_interface = _tmp1_;
g_object_notify ((GObject *) self, "properties-interface");
}
-static void _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed (FreeDesktopProperties* _sender, const char* source, GHashTable* changed_properties, char** invalid, int invalid_length1, gpointer self) {
+static void _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed (FreeDesktopProperties* _sender, const gchar* source, GHashTable* changed_properties, gchar** invalid, int invalid_length1, gpointer self) {
mpris2_controller_property_changed_cb (self, source, changed_properties, invalid, invalid_length1);
}
@@ -4745,68 +4891,107 @@ static GObject * mpris2_controller_constructor (GType type, guint n_construct_pr
GObject * obj;
GObjectClass * parent_class;
Mpris2Controller * self;
- GError * _inner_error_;
+ DBusGConnection* _tmp0_ = NULL;
+ DBusGConnection* connection;
+ gchar* _tmp1_ = NULL;
+ gchar* _tmp2_;
+ const gchar* _tmp3_ = NULL;
+ gchar* _tmp4_ = NULL;
+ gchar* _tmp5_;
+ DBusGProxy* _tmp6_ = NULL;
+ gchar* _tmp7_ = NULL;
+ gchar* _tmp8_;
+ const gchar* _tmp9_ = NULL;
+ gchar* _tmp10_ = NULL;
+ gchar* _tmp11_;
+ MprisRoot* _tmp12_;
+ gchar* _tmp13_ = NULL;
+ gchar* _tmp14_;
+ const gchar* _tmp15_ = NULL;
+ gchar* _tmp16_ = NULL;
+ gchar* _tmp17_;
+ gchar* _tmp18_ = NULL;
+ gchar* _tmp19_;
+ DBusGProxy* _tmp20_ = NULL;
+ gchar* _tmp21_ = NULL;
+ gchar* _tmp22_;
+ const gchar* _tmp23_ = NULL;
+ gchar* _tmp24_ = NULL;
+ gchar* _tmp25_;
+ MprisPlayer* _tmp26_;
+ DBusGProxy* _tmp27_ = NULL;
+ FreeDesktopProperties* _tmp28_;
+ GError * _inner_error_ = NULL;
parent_class = G_OBJECT_CLASS (mpris2_controller_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = MPRIS2_CONTROLLER (obj);
- _inner_error_ = NULL;
- {
- {
- DBusGConnection* connection;
- char* _tmp0_;
- char* _tmp1_;
- char* _tmp2_;
- char* _tmp3_;
- MprisRoot* _tmp4_;
- char* _tmp5_;
- char* _tmp6_;
- char* _tmp7_;
- char* _tmp8_;
- char* _tmp9_;
- MprisPlayer* _tmp10_;
- FreeDesktopProperties* _tmp11_;
- connection = dbus_g_bus_get (DBUS_BUS_SESSION, &_inner_error_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == DBUS_GERROR) {
- goto __catch5_dbus_gerror;
- }
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- }
- mpris2_controller_set_mpris2_root (self, _tmp4_ = mpris_root_dbus_proxy_new (connection, _tmp3_ = g_strconcat (_tmp2_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL), player_controller_get_mpris_name (self->priv->_owner), NULL), "/org/mpris/MediaPlayer2"));
- _g_object_unref0 (_tmp4_);
- _g_free0 (_tmp3_);
- _g_free0 (_tmp2_);
- _g_free0 (_tmp1_);
- _g_free0 (_tmp0_);
- mpris2_controller_set_player (self, _tmp10_ = mpris_player_dbus_proxy_new (connection, _tmp9_ = g_strconcat (_tmp8_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL), player_controller_get_mpris_name (self->priv->_owner), NULL), "/org/mpris/MediaPlayer2"));
- _g_object_unref0 (_tmp10_);
- _g_free0 (_tmp9_);
- _g_free0 (_tmp8_);
- _g_free0 (_tmp7_);
- _g_free0 (_tmp6_);
- _g_free0 (_tmp5_);
- mpris2_controller_set_properties_interface (self, _tmp11_ = free_desktop_properties_dbus_proxy_new (connection, "org.freedesktop.Properties.PropertiesChanged", "/org/mpris/MediaPlayer2"));
- _g_object_unref0 (_tmp11_);
- g_signal_connect_object (self->priv->_properties_interface, "properties-changed", (GCallback) _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed, self, 0);
- _dbus_g_connection_unref0 (connection);
- }
- goto __finally5;
- __catch5_dbus_gerror:
- {
- GError * e;
- e = _inner_error_;
- _inner_error_ = NULL;
- {
- g_error ("mpris2-controller.vala:89: Problems connecting to the session bus - %s", e->message);
- _g_error_free0 (e);
- }
- }
- __finally5:
- if (_inner_error_ != NULL) {
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
+ _tmp0_ = dbus_g_bus_get (DBUS_BUS_SESSION, &_inner_error_);
+ connection = _tmp0_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == DBUS_GERROR) {
+ goto __catch5_dbus_gerror;
}
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ }
+ _tmp1_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL);
+ _tmp2_ = _tmp1_;
+ _tmp3_ = player_controller_get_mpris_name (self->priv->_owner);
+ _tmp4_ = g_strconcat (_tmp2_, _tmp3_, NULL);
+ _tmp5_ = _tmp4_;
+ _tmp6_ = dbus_g_proxy_new_for_name (connection, _tmp5_, "/org/mpris/MediaPlayer2", MPRIS2_CONTROLLER_root_interface);
+ _tmp7_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL);
+ _tmp8_ = _tmp7_;
+ _tmp9_ = player_controller_get_mpris_name (self->priv->_owner);
+ _tmp10_ = g_strconcat (_tmp8_, _tmp9_, NULL);
+ _tmp11_ = _tmp10_;
+ _tmp12_ = mpris_root_dbus_proxy_new (connection, _tmp11_, "/org/mpris/MediaPlayer2");
+ mpris2_controller_set_mpris2_root (self, _tmp12_);
+ _g_object_unref0 (_tmp12_);
+ _g_free0 (_tmp11_);
+ _g_free0 (_tmp8_);
+ _g_free0 (_tmp5_);
+ _g_free0 (_tmp2_);
+ _tmp13_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL);
+ _tmp14_ = _tmp13_;
+ _tmp15_ = player_controller_get_mpris_name (self->priv->_owner);
+ _tmp16_ = g_strconcat (_tmp14_, _tmp15_, NULL);
+ _tmp17_ = _tmp16_;
+ _tmp18_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".Player", NULL);
+ _tmp19_ = _tmp18_;
+ _tmp20_ = dbus_g_proxy_new_for_name (connection, _tmp17_, "/org/mpris/MediaPlayer2", _tmp19_);
+ _tmp21_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL);
+ _tmp22_ = _tmp21_;
+ _tmp23_ = player_controller_get_mpris_name (self->priv->_owner);
+ _tmp24_ = g_strconcat (_tmp22_, _tmp23_, NULL);
+ _tmp25_ = _tmp24_;
+ _tmp26_ = mpris_player_dbus_proxy_new (connection, _tmp25_, "/org/mpris/MediaPlayer2");
+ mpris2_controller_set_player (self, _tmp26_);
+ _g_object_unref0 (_tmp26_);
+ _g_free0 (_tmp25_);
+ _g_free0 (_tmp22_);
+ _g_free0 (_tmp19_);
+ _g_free0 (_tmp17_);
+ _g_free0 (_tmp14_);
+ _tmp27_ = dbus_g_proxy_new_for_name (connection, "org.freedesktop.Properties.PropertiesChanged", "/org/mpris/MediaPlayer2", NULL);
+ _tmp28_ = free_desktop_properties_dbus_proxy_new (connection, "org.freedesktop.Properties.PropertiesChanged", "/org/mpris/MediaPlayer2");
+ mpris2_controller_set_properties_interface (self, _tmp28_);
+ _g_object_unref0 (_tmp28_);
+ g_signal_connect_object (self->priv->_properties_interface, "properties-changed", (GCallback) _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed, self, 0);
+ _dbus_g_connection_unref0 (connection);
+ goto __finally5;
+ __catch5_dbus_gerror:
+ {
+ GError * e;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ g_error ("mpris2-controller.vala:89: Problems connecting to the session bus - %s", e->message);
+ _g_error_free0 (e);
+ }
+ __finally5:
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
}
return obj;
}
@@ -4815,8 +5000,8 @@ static GObject * mpris2_controller_constructor (GType type, guint n_construct_pr
static void mpris2_controller_class_init (Mpris2ControllerClass * klass) {
mpris2_controller_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (Mpris2ControllerPrivate));
- G_OBJECT_CLASS (klass)->get_property = mpris2_controller_get_property;
- G_OBJECT_CLASS (klass)->set_property = mpris2_controller_set_property;
+ G_OBJECT_CLASS (klass)->get_property = _vala_mpris2_controller_get_property;
+ G_OBJECT_CLASS (klass)->set_property = _vala_mpris2_controller_set_property;
G_OBJECT_CLASS (klass)->constructor = mpris2_controller_constructor;
G_OBJECT_CLASS (klass)->finalize = mpris2_controller_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS2_CONTROLLER_MPRIS2_ROOT, g_param_spec_object ("mpris2-root", "mpris2-root", "mpris2-root", TYPE_MPRIS_ROOT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
@@ -4854,7 +5039,7 @@ GType mpris2_controller_get_type (void) {
}
-static void mpris2_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+static void _vala_mpris2_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
Mpris2Controller * self;
self = MPRIS2_CONTROLLER (object);
switch (property_id) {
@@ -4877,7 +5062,7 @@ static void mpris2_controller_get_property (GObject * object, guint property_id,
}
-static void mpris2_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+static void _vala_mpris2_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
Mpris2Controller * self;
self = MPRIS2_CONTROLLER (object);
switch (property_id) {
@@ -4918,54 +5103,4 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify
}
-static int _vala_strcmp0 (const char * str1, const char * str2) {
- if (str1 == NULL) {
- return -(str1 != str2);
- }
- if (str2 == NULL) {
- return str1 != str2;
- }
- return strcmp (str1, str2);
-}
-
-
-
-static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
- typedef void (*GMarshalFunc_VOID__INT64) (gpointer data1, gint64 arg_1, gpointer data2);
- register GMarshalFunc_VOID__INT64 callback;
- register GCClosure * cc;
- register gpointer data1, data2;
- cc = (GCClosure *) closure;
- g_return_if_fail (n_param_values == 2);
- if (G_CCLOSURE_SWAP_DATA (closure)) {
- data1 = closure->data;
- data2 = param_values->data[0].v_pointer;
- } else {
- data1 = param_values->data[0].v_pointer;
- data2 = closure->data;
- }
- callback = (GMarshalFunc_VOID__INT64) (marshal_data ? marshal_data : cc->callback);
- callback (data1, g_value_get_int64 (param_values + 1), data2);
-}
-
-
-static void g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
- typedef void (*GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer arg_3, gint arg_4, gpointer data2);
- register GMarshalFunc_VOID__STRING_BOXED_BOXED_INT callback;
- register GCClosure * cc;
- register gpointer data1, data2;
- cc = (GCClosure *) closure;
- g_return_if_fail (n_param_values == 5);
- if (G_CCLOSURE_SWAP_DATA (closure)) {
- data1 = closure->data;
- data2 = param_values->data[0].v_pointer;
- } else {
- data1 = param_values->data[0].v_pointer;
- data2 = closure->data;
- }
- callback = (GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (marshal_data ? marshal_data : cc->callback);
- callback (data1, g_value_get_string (param_values + 1), g_value_get_boxed (param_values + 2), g_value_get_boxed (param_values + 3), g_value_get_int (param_values + 4), data2);
-}
-
-
diff --git a/src/music-player-bridge.c b/src/music-player-bridge.c
index 7e0a5a8..7c29522 100644
--- a/src/music-player-bridge.c
+++ b/src/music-player-bridge.c
@@ -1,4 +1,4 @@
-/* music-player-bridge.c generated by valac 0.10.0, the Vala compiler
+/* music-player-bridge.c generated by valac 0.11.2, the Vala compiler
* generated from music-player-bridge.vala, do not modify */
/*
@@ -111,24 +111,24 @@ MusicPlayerBridge* music_player_bridge_new (void);
MusicPlayerBridge* music_player_bridge_construct (GType object_type);
FamiliarPlayersDB* familiar_players_db_new (void);
FamiliarPlayersDB* familiar_players_db_construct (GType object_type);
-void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type);
-static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self);
-void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type);
-static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self);
+void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type);
+static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const gchar* p0, gpointer self);
+void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type);
+static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const gchar* p0, gpointer self);
static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self);
GeeSet* familiar_players_db_records (FamiliarPlayersDB* self);
-static char* music_player_bridge_determine_key (char* path);
-char* familiar_players_db_fetch_icon_name (const char* desktop_path);
+static gchar* music_player_bridge_determine_key (gchar* path);
+gchar* familiar_players_db_fetch_icon_name (const gchar* desktop_path);
static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self);
GType player_controller_state_get_type (void) G_GNUC_CONST;
-PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state);
-PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state);
#define PLAYER_CONTROLLER_WIDGET_QUANTITY 4
-static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const char* type);
-static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, char* path, void* data);
-GAppInfo* music_player_bridge_create_app_info (const char* path);
-gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop);
-void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop);
+static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const gchar* type);
+static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, gchar* path, void* data);
+GAppInfo* music_player_bridge_create_app_info (const gchar* path);
+gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const gchar* desktop);
+void familiar_players_db_insert (FamiliarPlayersDB* self, const gchar* desktop);
void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state);
void player_controller_activate (PlayerController* self);
void player_controller_hibernate (PlayerController* self);
@@ -139,26 +139,37 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify
static gint _vala_array_length (gpointer array);
-
-static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self) {
+static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const gchar* p0, gpointer self) {
music_player_bridge_on_server_added (self, object, p0);
}
-static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self) {
+static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const gchar* p0, gpointer self) {
music_player_bridge_on_server_removed (self, object, p0);
}
MusicPlayerBridge* music_player_bridge_construct (GType object_type) {
- MusicPlayerBridge * self;
- FamiliarPlayersDB* _tmp0_;
- GeeHashMap* _tmp1_;
- IndicateListener* _tmp2_;
+ MusicPlayerBridge * self = NULL;
+ FamiliarPlayersDB* _tmp0_ = NULL;
+ FamiliarPlayersDB* _tmp1_;
+ GeeHashMap* _tmp2_ = NULL;
+ GeeHashMap* _tmp3_;
+ IndicateListener* _tmp4_ = NULL;
+ IndicateListener* _tmp5_;
self = (MusicPlayerBridge*) g_object_new (object_type, NULL);
- self->priv->playersDB = (_tmp0_ = familiar_players_db_new (), _g_object_unref0 (self->priv->playersDB), _tmp0_);
- self->priv->registered_clients = (_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, TYPE_PLAYER_CONTROLLER, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL), _g_object_unref0 (self->priv->registered_clients), _tmp1_);
- self->priv->listener = (_tmp2_ = indicate_listener_ref_default (), _g_object_unref0 (self->priv->listener), _tmp2_);
+ _tmp0_ = familiar_players_db_new ();
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->playersDB);
+ self->priv->playersDB = _tmp1_;
+ _tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, TYPE_PLAYER_CONTROLLER, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
+ _tmp3_ = _tmp2_;
+ _g_object_unref0 (self->priv->registered_clients);
+ self->priv->registered_clients = _tmp3_;
+ _tmp4_ = indicate_listener_ref_default ();
+ _tmp5_ = _tmp4_;
+ _g_object_unref0 (self->priv->listener);
+ self->priv->listener = _tmp5_;
g_signal_connect_object (self->priv->listener, "server-added", (GCallback) _music_player_bridge_on_server_added_indicate_listener_server_added, self, 0);
g_signal_connect_object (self->priv->listener, "server-removed", (GCallback) _music_player_bridge_on_server_removed_indicate_listener_server_removed, self, 0);
return self;
@@ -178,23 +189,39 @@ static gpointer _g_object_ref0 (gpointer self) {
static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self) {
g_return_if_fail (self != NULL);
{
- GeeSet* _tmp0_;
- GeeIterator* _tmp1_;
+ GeeSet* _tmp0_ = NULL;
+ GeeSet* _tmp1_;
+ GeeIterator* _tmp2_ = NULL;
+ GeeIterator* _tmp3_;
GeeIterator* _app_it;
- _app_it = (_tmp1_ = gee_iterable_iterator ((GeeIterable*) (_tmp0_ = familiar_players_db_records (self->priv->playersDB))), _g_object_unref0 (_tmp0_), _tmp1_);
+ _tmp0_ = familiar_players_db_records (self->priv->playersDB);
+ _tmp1_ = _tmp0_;
+ _tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_);
+ _app_it = (_tmp3_ = _tmp2_, _g_object_unref0 (_tmp1_), _tmp3_);
while (TRUE) {
- char* app;
+ gboolean _tmp4_;
+ gpointer _tmp5_ = NULL;
+ gchar* app;
+ GDesktopAppInfo* _tmp6_ = NULL;
GDesktopAppInfo* info;
- GDesktopAppInfo* _tmp2_;
+ GDesktopAppInfo* _tmp7_;
+ GAppInfo* _tmp8_;
GAppInfo* app_info;
- char* mpris_key;
- char* _tmp3_;
- PlayerController* _tmp4_;
+ gchar* _tmp9_;
+ gchar* _tmp10_ = NULL;
+ gchar* mpris_key;
+ gchar* _tmp11_ = NULL;
+ gchar* _tmp12_;
+ gint _tmp13_;
+ PlayerController* _tmp14_ = NULL;
+ PlayerController* _tmp15_;
PlayerController* ctrl;
- if (!gee_iterator_next (_app_it)) {
+ _tmp4_ = gee_iterator_next (_app_it);
+ if (!_tmp4_) {
break;
}
- app = (char*) gee_iterator_get (_app_it);
+ _tmp5_ = gee_iterator_get (_app_it);
+ app = (gchar*) _tmp5_;
if (app == NULL) {
g_warning ("music-player-bridge.vala:44: App string in keyfile is null therefore m" \
"oving on to next player");
@@ -202,7 +229,8 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye
continue;
}
g_debug ("music-player-bridge.vala:48: attempting to make an app info from %s", app);
- info = g_desktop_app_info_new_from_filename (app);
+ _tmp6_ = g_desktop_app_info_new_from_filename (app);
+ info = _tmp6_;
if (info == NULL) {
g_warning ("music-player-bridge.vala:53: Could not create a desktopappinfo instanc" \
"e from app,: %s , moving on to the next client", app);
@@ -210,9 +238,16 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye
_g_free0 (app);
continue;
}
- app_info = _g_object_ref0 ((_tmp2_ = info, G_IS_APP_INFO (_tmp2_) ? ((GAppInfo*) _tmp2_) : NULL));
- mpris_key = music_player_bridge_determine_key (g_strdup (app));
- ctrl = (_tmp4_ = player_controller_new (self->priv->root_menu, app_info, mpris_key, _tmp3_ = familiar_players_db_fetch_icon_name (app), music_player_bridge_calculate_menu_position (self), PLAYER_CONTROLLER_STATE_OFFLINE), _g_free0 (_tmp3_), _tmp4_);
+ _tmp8_ = _g_object_ref0 ((_tmp7_ = info, G_IS_APP_INFO (_tmp7_) ? ((GAppInfo*) _tmp7_) : NULL));
+ app_info = _tmp8_;
+ _tmp9_ = g_strdup (app);
+ _tmp10_ = music_player_bridge_determine_key (_tmp9_);
+ mpris_key = _tmp10_;
+ _tmp11_ = familiar_players_db_fetch_icon_name (app);
+ _tmp12_ = _tmp11_;
+ _tmp13_ = music_player_bridge_calculate_menu_position (self);
+ _tmp14_ = player_controller_new (self->priv->root_menu, app_info, mpris_key, _tmp12_, _tmp13_, PLAYER_CONTROLLER_STATE_OFFLINE);
+ ctrl = (_tmp15_ = _tmp14_, _g_free0 (_tmp12_), _tmp15_);
gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, mpris_key, ctrl);
_g_object_unref0 (ctrl);
_g_free0 (mpris_key);
@@ -227,23 +262,29 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye
static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self) {
gint result = 0;
+ gint _tmp0_;
g_return_val_if_fail (self != NULL, 0);
- if (gee_map_get_size ((GeeMap*) self->priv->registered_clients) == 0) {
+ _tmp0_ = gee_map_get_size ((GeeMap*) self->priv->registered_clients);
+ if (_tmp0_ == 0) {
result = 2;
return result;
} else {
- result = 2 + (gee_map_get_size ((GeeMap*) self->priv->registered_clients) * PLAYER_CONTROLLER_WIDGET_QUANTITY);
+ gint _tmp1_;
+ _tmp1_ = gee_map_get_size ((GeeMap*) self->priv->registered_clients);
+ result = 2 + (_tmp1_ * PLAYER_CONTROLLER_WIDGET_QUANTITY);
return result;
}
}
-void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type) {
+void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type) {
+ gboolean _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (type != NULL);
g_debug ("music-player-bridge.vala:81: MusicPlayerBridge -> on_server_added with" \
" value %s", type);
- if (music_player_bridge_server_is_not_of_interest (self, type)) {
+ _tmp0_ = music_player_bridge_server_is_not_of_interest (self, type);
+ if (_tmp0_) {
return;
}
if (self->priv->root_menu != NULL) {
@@ -254,15 +295,22 @@ void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListe
}
-static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, char* path, void* data) {
+static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, gchar* path, void* data) {
void* _tmp0_;
+ MusicPlayerBridge* _tmp1_;
MusicPlayerBridge* bridge;
+ GAppInfo* _tmp2_ = NULL;
GAppInfo* app_info;
- char* mpris_key;
+ gchar* _tmp3_;
+ gchar* _tmp4_ = NULL;
+ gchar* mpris_key;
+ gboolean _tmp5_;
g_return_if_fail (self != NULL);
g_return_if_fail (path != NULL);
- bridge = _g_object_ref0 ((_tmp0_ = data, IS_MUSIC_PLAYER_BRIDGE (_tmp0_) ? ((MusicPlayerBridge*) _tmp0_) : NULL));
- app_info = music_player_bridge_create_app_info (path);
+ _tmp1_ = _g_object_ref0 ((_tmp0_ = data, IS_MUSIC_PLAYER_BRIDGE (_tmp0_) ? ((MusicPlayerBridge*) _tmp0_) : NULL));
+ bridge = _tmp1_;
+ _tmp2_ = music_player_bridge_create_app_info (path);
+ app_info = _tmp2_;
if (app_info == NULL) {
g_warning ("music-player-bridge.vala:96: Could not create app_info for path %s \n" \
" Getting out of here ", path);
@@ -271,26 +319,42 @@ static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self,
_g_free0 (path);
return;
}
- mpris_key = music_player_bridge_determine_key (g_strdup (path));
- if (familiar_players_db_already_familiar (bridge->priv->playersDB, path) == FALSE) {
- char* _tmp1_;
- PlayerController* _tmp2_;
+ _tmp3_ = g_strdup (path);
+ _tmp4_ = music_player_bridge_determine_key (_tmp3_);
+ mpris_key = _tmp4_;
+ _tmp5_ = familiar_players_db_already_familiar (bridge->priv->playersDB, path);
+ if (_tmp5_ == FALSE) {
+ gchar* _tmp6_ = NULL;
+ gchar* _tmp7_;
+ gint _tmp8_;
+ PlayerController* _tmp9_ = NULL;
+ PlayerController* _tmp10_;
PlayerController* ctrl;
g_debug ("music-player-bridge.vala:103: New client has registered that we have s" \
"een before: %s", path);
familiar_players_db_insert (bridge->priv->playersDB, path);
- ctrl = (_tmp2_ = player_controller_new (bridge->priv->root_menu, app_info, mpris_key, _tmp1_ = familiar_players_db_fetch_icon_name (path), music_player_bridge_calculate_menu_position (bridge), PLAYER_CONTROLLER_STATE_READY), _g_free0 (_tmp1_), _tmp2_);
+ _tmp6_ = familiar_players_db_fetch_icon_name (path);
+ _tmp7_ = _tmp6_;
+ _tmp8_ = music_player_bridge_calculate_menu_position (bridge);
+ _tmp9_ = player_controller_new (bridge->priv->root_menu, app_info, mpris_key, _tmp7_, _tmp8_, PLAYER_CONTROLLER_STATE_READY);
+ ctrl = (_tmp10_ = _tmp9_, _g_free0 (_tmp7_), _tmp10_);
gee_abstract_map_set ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key, ctrl);
g_debug ("music-player-bridge.vala:112: successfully created appinfo and instanc" \
"e from path and set it on the respective instance");
_g_object_unref0 (ctrl);
} else {
- PlayerController* _tmp3_;
- PlayerController* _tmp4_;
- player_controller_update_state (_tmp3_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key), PLAYER_CONTROLLER_STATE_READY);
- _g_object_unref0 (_tmp3_);
- player_controller_activate (_tmp4_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key));
- _g_object_unref0 (_tmp4_);
+ gpointer _tmp11_ = NULL;
+ PlayerController* _tmp12_;
+ gpointer _tmp13_ = NULL;
+ PlayerController* _tmp14_;
+ _tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key);
+ _tmp12_ = (PlayerController*) _tmp11_;
+ player_controller_update_state (_tmp12_, PLAYER_CONTROLLER_STATE_READY);
+ _g_object_unref0 (_tmp12_);
+ _tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key);
+ _tmp14_ = (PlayerController*) _tmp13_;
+ player_controller_activate (_tmp14_);
+ _g_object_unref0 (_tmp14_);
g_debug ("music-player-bridge.vala:117: Ignoring desktop file path callback beca" \
"use the db cache file has it already: %s \n", path);
}
@@ -301,26 +365,36 @@ static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self,
}
-void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type) {
+void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type) {
+ gboolean _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (type != NULL);
g_debug ("music-player-bridge.vala:123: MusicPlayerBridge -> on_server_removed w" \
"ith value %s", type);
- if (music_player_bridge_server_is_not_of_interest (self, type)) {
+ _tmp0_ = music_player_bridge_server_is_not_of_interest (self, type);
+ if (_tmp0_) {
return;
}
if (self->priv->root_menu != NULL) {
+ gchar** _tmp1_;
+ gchar** _tmp2_ = NULL;
gint tmp_length1;
gint _tmp_size_;
- char** _tmp1_;
- char** _tmp0_;
- char** tmp;
- tmp = (_tmp1_ = _tmp0_ = g_strsplit (type, ".", 0), tmp_length1 = _vala_array_length (_tmp0_), _tmp_size_ = tmp_length1, _tmp1_);
+ gchar** _tmp3_;
+ gchar** tmp;
+ _tmp2_ = _tmp1_ = g_strsplit (type, ".", 0);
+ _tmp3_ = _tmp2_;
+ tmp_length1 = _vala_array_length (_tmp1_);
+ _tmp_size_ = tmp_length1;
+ tmp = _tmp3_;
g_debug ("music-player-bridge.vala:127: attempt to remove %s", tmp[tmp_length1 - 1]);
if (tmp_length1 > 0) {
- PlayerController* _tmp2_;
- player_controller_hibernate (_tmp2_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, tmp[tmp_length1 - 1]));
- _g_object_unref0 (_tmp2_);
+ gpointer _tmp4_ = NULL;
+ PlayerController* _tmp5_;
+ _tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, tmp[tmp_length1 - 1]);
+ _tmp5_ = (PlayerController*) _tmp4_;
+ player_controller_hibernate (_tmp5_);
+ _g_object_unref0 (_tmp5_);
g_debug ("music-player-bridge.vala:130: Successively offlined client %s", tmp[tmp_length1 - 1]);
}
tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL);
@@ -328,24 +402,28 @@ void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateLis
}
-static gboolean string_contains (const char* self, const char* needle) {
+static gboolean string_contains (const gchar* self, const gchar* needle) {
gboolean result = FALSE;
+ const gchar* _tmp0_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (needle != NULL, FALSE);
- result = strstr (self, needle) != NULL;
+ _tmp0_ = strstr (self, needle);
+ result = _tmp0_ != NULL;
return result;
}
-static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const char* type) {
+static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const gchar* type) {
gboolean result = FALSE;
+ gboolean _tmp0_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (type != NULL, FALSE);
if (type == NULL) {
result = TRUE;
return result;
}
- if (string_contains (type, "music") == FALSE) {
+ _tmp0_ = string_contains (type, "music");
+ if (_tmp0_ == FALSE) {
g_debug ("music-player-bridge.vala:138: server is of no interest, it is not an " \
"music server");
result = TRUE;
@@ -358,20 +436,27 @@ static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge
void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu) {
DbusmenuMenuitem* _tmp0_;
+ DbusmenuMenuitem* _tmp1_;
g_return_if_fail (self != NULL);
g_return_if_fail (menu != NULL);
- self->priv->root_menu = (_tmp0_ = _g_object_ref0 (menu), _g_object_unref0 (self->priv->root_menu), _tmp0_);
+ _tmp0_ = _g_object_ref0 (menu);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->root_menu);
+ self->priv->root_menu = _tmp1_;
music_player_bridge_try_to_add_inactive_familiar_clients (self);
}
-GAppInfo* music_player_bridge_create_app_info (const char* path) {
+GAppInfo* music_player_bridge_create_app_info (const gchar* path) {
GAppInfo* result = NULL;
+ GDesktopAppInfo* _tmp0_ = NULL;
GDesktopAppInfo* info;
- GDesktopAppInfo* _tmp0_;
+ GDesktopAppInfo* _tmp1_;
+ GAppInfo* _tmp2_;
GAppInfo* app_info;
g_return_val_if_fail (path != NULL, NULL);
- info = g_desktop_app_info_new_from_filename (path);
+ _tmp0_ = g_desktop_app_info_new_from_filename (path);
+ info = _tmp0_;
if (path == NULL) {
g_warning ("music-player-bridge.vala:154: Could not create a desktopappinfo instan" \
"ce from app: %s", path);
@@ -379,45 +464,68 @@ GAppInfo* music_player_bridge_create_app_info (const char* path) {
_g_object_unref0 (info);
return result;
}
- app_info = _g_object_ref0 ((_tmp0_ = info, G_IS_APP_INFO (_tmp0_) ? ((GAppInfo*) _tmp0_) : NULL));
+ _tmp2_ = _g_object_ref0 ((_tmp1_ = info, G_IS_APP_INFO (_tmp1_) ? ((GAppInfo*) _tmp1_) : NULL));
+ app_info = _tmp2_;
result = app_info;
_g_object_unref0 (info);
return result;
}
-static char* music_player_bridge_determine_key (char* path) {
- char* result = NULL;
+static gchar* music_player_bridge_determine_key (gchar* path) {
+ gchar* result = NULL;
+ gchar** _tmp0_;
+ gchar** _tmp1_ = NULL;
gint tokens_length1;
gint _tokens_size_;
- char** _tmp1_;
- char** _tmp0_;
- char** tokens;
- char* filename;
- char** _tmp2_;
- char** _tmp3_;
- gint _tmp3__length1;
- char* _tmp4_;
- char* _result_;
+ gchar** _tmp2_;
+ gchar** tokens;
+ gchar* _tmp3_;
+ gchar* filename;
+ gchar** _tmp4_;
+ gchar** _tmp5_ = NULL;
+ gchar** _tmp6_;
+ gint _tmp6__length1;
+ gchar* _tmp7_;
+ gchar* _tmp8_;
+ gchar* _result_;
+ gchar** _tmp9_;
+ gchar** _tmp10_ = NULL;
gint temp_length1;
gint _temp_size_;
- char** _tmp6_;
- char** _tmp5_;
- char** temp;
+ gchar** _tmp11_;
+ gchar** temp;
g_return_val_if_fail (path != NULL, NULL);
- tokens = (_tmp1_ = _tmp0_ = g_strsplit (path, "/", 0), tokens_length1 = _vala_array_length (_tmp0_), _tokens_size_ = tokens_length1, _tmp1_);
+ _tmp1_ = _tmp0_ = g_strsplit (path, "/", 0);
+ _tmp2_ = _tmp1_;
+ tokens_length1 = _vala_array_length (_tmp0_);
+ _tokens_size_ = tokens_length1;
+ tokens = _tmp2_;
if (tokens_length1 < 2) {
result = NULL;
tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
_g_free0 (path);
return result;
}
- filename = g_strdup (tokens[tokens_length1 - 1]);
- _result_ = (_tmp4_ = g_strdup ((_tmp3_ = _tmp2_ = g_strsplit (filename, ".", 0), _tmp3__length1 = _vala_array_length (_tmp2_), _tmp3_)[0]), _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL), _tmp4_);
- temp = (_tmp6_ = _tmp5_ = g_strsplit (_result_, "-", 0), temp_length1 = _vala_array_length (_tmp5_), _temp_size_ = temp_length1, _tmp6_);
+ _tmp3_ = g_strdup (tokens[tokens_length1 - 1]);
+ filename = _tmp3_;
+ _tmp5_ = _tmp4_ = g_strsplit (filename, ".", 0);
+ _tmp6_ = _tmp5_;
+ _tmp6__length1 = _vala_array_length (_tmp4_);
+ _tmp7_ = g_strdup (_tmp6_[0]);
+ _result_ = (_tmp8_ = _tmp7_, _tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_free), NULL), _tmp8_);
+ _tmp10_ = _tmp9_ = g_strsplit (_result_, "-", 0);
+ _tmp11_ = _tmp10_;
+ temp_length1 = _vala_array_length (_tmp9_);
+ _temp_size_ = temp_length1;
+ temp = _tmp11_;
if (temp_length1 > 1) {
- char* _tmp7_;
- _result_ = (_tmp7_ = g_strdup (temp[0]), _g_free0 (_result_), _tmp7_);
+ gchar* _tmp12_;
+ gchar* _tmp13_;
+ _tmp12_ = g_strdup (temp[0]);
+ _tmp13_ = _tmp12_;
+ _g_free0 (_result_);
+ _result_ = _tmp13_;
}
g_debug ("music-player-bridge.vala:171: determine key result = %s", _result_);
result = _result_;
@@ -495,4 +603,3 @@ static gint _vala_array_length (gpointer array) {
-
diff --git a/src/music-player-bridge.h b/src/music-player-bridge.h
index 2a3b9ac..26c9974 100644
--- a/src/music-player-bridge.h
+++ b/src/music-player-bridge.h
@@ -1,4 +1,4 @@
-/* music-player-bridge.h generated by valac 0.10.0, the Vala compiler, do not modify */
+/* music-player-bridge.h generated by valac 0.11.2, the Vala compiler, do not modify */
#ifndef __MUSIC_PLAYER_BRIDGE_H__
@@ -251,10 +251,10 @@ struct _MprisRootIface {
void (*set_CanQuit) (MprisRoot* self, gboolean value);
gboolean (*get_CanRaise) (MprisRoot* self);
void (*set_CanRaise) (MprisRoot* self, gboolean value);
- char* (*get_Identity) (MprisRoot* self);
- void (*set_Identity) (MprisRoot* self, const char* value);
- char* (*get_DesktopEntry) (MprisRoot* self);
- void (*set_DesktopEntry) (MprisRoot* self, const char* value);
+ gchar* (*get_Identity) (MprisRoot* self);
+ void (*set_Identity) (MprisRoot* self, const gchar* value);
+ gchar* (*get_DesktopEntry) (MprisRoot* self);
+ void (*set_DesktopEntry) (MprisRoot* self, const gchar* value);
};
struct _MprisPlayerIface {
@@ -269,8 +269,8 @@ struct _MprisPlayerIface {
void (*set_Metadata) (MprisPlayer* self, GHashTable* value);
gint32 (*get_Position) (MprisPlayer* self);
void (*set_Position) (MprisPlayer* self, gint32 value);
- char* (*get_PlaybackStatus) (MprisPlayer* self);
- void (*set_PlaybackStatus) (MprisPlayer* self, const char* value);
+ gchar* (*get_PlaybackStatus) (MprisPlayer* self);
+ void (*set_PlaybackStatus) (MprisPlayer* self, const gchar* value);
};
struct _FreeDesktopPropertiesIface {
@@ -308,10 +308,10 @@ struct _FetchFileClass {
GType music_player_bridge_get_type (void) G_GNUC_CONST;
MusicPlayerBridge* music_player_bridge_new (void);
MusicPlayerBridge* music_player_bridge_construct (GType object_type);
-void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type);
-void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type);
+void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type);
+void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type);
void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu);
-GAppInfo* music_player_bridge_create_app_info (const char* path);
+GAppInfo* music_player_bridge_create_app_info (const gchar* path);
GType player_item_get_type (void) G_GNUC_CONST;
GType transport_menuitem_get_type (void) G_GNUC_CONST;
GType transport_menuitem_action_get_type (void) G_GNUC_CONST;
@@ -322,11 +322,11 @@ TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerContro
void transport_menuitem_change_play_state (TransportMenuitem* self, TransportMenuitemstate update);
GeeHashSet* transport_menuitem_attributes_format (void);
GType metadata_menuitem_get_type (void) G_GNUC_CONST;
-extern char* metadata_menuitem_album_art_cache_dir;
+extern gchar* metadata_menuitem_album_art_cache_dir;
#define METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX "indicators/sound/album-art-cache"
MetadataMenuitem* metadata_menuitem_new (void);
MetadataMenuitem* metadata_menuitem_construct (GType object_type);
-void metadata_menuitem_fetch_art (MetadataMenuitem* self, const char* uri, const char* prop);
+void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop);
GeeHashSet* metadata_menuitem_attributes_format (void);
GType title_menuitem_get_type (void) G_GNUC_CONST;
TitleMenuitem* title_menuitem_new (PlayerController* parent);
@@ -337,8 +337,8 @@ GType mpris2_controller_get_type (void) G_GNUC_CONST;
GType player_controller_widget_order_get_type (void) G_GNUC_CONST;
GType player_controller_state_get_type (void) G_GNUC_CONST;
#define PLAYER_CONTROLLER_WIDGET_QUANTITY 4
-PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state);
-PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state);
void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state);
void player_controller_activate (PlayerController* self);
void player_controller_instantiate (PlayerController* self);
@@ -346,16 +346,16 @@ void player_controller_vanish (PlayerController* self);
void player_controller_hibernate (PlayerController* self);
void player_controller_update_layout (PlayerController* self);
void player_controller_determine_state (PlayerController* self);
-const char* player_controller_get_name (PlayerController* self);
-void player_controller_set_name (PlayerController* self, const char* value);
-const char* player_controller_get_mpris_name (PlayerController* self);
-void player_controller_set_mpris_name (PlayerController* self, const char* value);
+const gchar* player_controller_get_name (PlayerController* self);
+void player_controller_set_name (PlayerController* self, const gchar* value);
+const gchar* player_controller_get_mpris_name (PlayerController* self);
+void player_controller_set_mpris_name (PlayerController* self, const gchar* value);
GAppInfo* player_controller_get_app_info (PlayerController* self);
void player_controller_set_app_info (PlayerController* self, GAppInfo* value);
gint player_controller_get_menu_offset (PlayerController* self);
void player_controller_set_menu_offset (PlayerController* self, gint value);
-const char* player_controller_get_icon_name (PlayerController* self);
-void player_controller_set_icon_name (PlayerController* self, const char* value);
+const gchar* player_controller_get_icon_name (PlayerController* self);
+void player_controller_set_icon_name (PlayerController* self, const gchar* value);
MprisRoot* mpris_root_dbus_proxy_new (DBusGConnection* connection, const char* name, const char* path);
GType mpris_root_get_type (void) G_GNUC_CONST;
void mpris_root_Quit (MprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
@@ -368,10 +368,10 @@ gboolean mpris_root_get_CanQuit (MprisRoot* self);
void mpris_root_set_CanQuit (MprisRoot* self, gboolean value);
gboolean mpris_root_get_CanRaise (MprisRoot* self);
void mpris_root_set_CanRaise (MprisRoot* self, gboolean value);
-char* mpris_root_get_Identity (MprisRoot* self);
-void mpris_root_set_Identity (MprisRoot* self, const char* value);
-char* mpris_root_get_DesktopEntry (MprisRoot* self);
-void mpris_root_set_DesktopEntry (MprisRoot* self, const char* value);
+gchar* mpris_root_get_Identity (MprisRoot* self);
+void mpris_root_set_Identity (MprisRoot* self, const gchar* value);
+gchar* mpris_root_get_DesktopEntry (MprisRoot* self);
+void mpris_root_set_DesktopEntry (MprisRoot* self, const gchar* value);
MprisPlayer* mpris_player_dbus_proxy_new (DBusGConnection* connection, const char* name, const char* path);
GType mpris_player_get_type (void) G_GNUC_CONST;
void mpris_player_PlayPause (MprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
@@ -384,14 +384,14 @@ GHashTable* mpris_player_get_Metadata (MprisPlayer* self);
void mpris_player_set_Metadata (MprisPlayer* self, GHashTable* value);
gint32 mpris_player_get_Position (MprisPlayer* self);
void mpris_player_set_Position (MprisPlayer* self, gint32 value);
-char* mpris_player_get_PlaybackStatus (MprisPlayer* self);
-void mpris_player_set_PlaybackStatus (MprisPlayer* self, const char* value);
+gchar* mpris_player_get_PlaybackStatus (MprisPlayer* self);
+void mpris_player_set_PlaybackStatus (MprisPlayer* self, const gchar* value);
GType free_desktop_properties_get_type (void) G_GNUC_CONST;
FreeDesktopProperties* free_desktop_properties_dbus_proxy_new (DBusGConnection* connection, const char* name, const char* path);
#define MPRIS2_CONTROLLER_root_interface "org.mpris.MediaPlayer2"
Mpris2Controller* mpris2_controller_new (PlayerController* ctrl);
Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl);
-void mpris2_controller_property_changed_cb (Mpris2Controller* self, const char* interface_source, GHashTable* changed_properties, char** invalid, int invalid_length1);
+void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1);
void mpris2_controller_initial_update (Mpris2Controller* self);
void mpris2_controller_transport_update (Mpris2Controller* self, TransportMenuitemaction command);
gboolean mpris2_controller_connected (Mpris2Controller* self);
@@ -401,27 +401,27 @@ MprisRoot* mpris2_controller_get_mpris2_root (Mpris2Controller* self);
MprisPlayer* mpris2_controller_get_player (Mpris2Controller* self);
PlayerController* mpris2_controller_get_owner (Mpris2Controller* self);
FreeDesktopProperties* mpris2_controller_get_properties_interface (Mpris2Controller* self);
-PlayerItem* player_item_new (const char* type);
-PlayerItem* player_item_construct (GType object_type, const char* type);
+PlayerItem* player_item_new (const gchar* type);
+PlayerItem* player_item_construct (GType object_type, const gchar* type);
void player_item_reset (PlayerItem* self, GeeHashSet* attrs);
void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes);
gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs);
PlayerController* player_item_get_owner (PlayerItem* self);
-const char* player_item_get_item_type (PlayerItem* self);
+const gchar* player_item_get_item_type (PlayerItem* self);
GType familiar_players_db_get_type (void) G_GNUC_CONST;
FamiliarPlayersDB* familiar_players_db_new (void);
FamiliarPlayersDB* familiar_players_db_construct (GType object_type);
-void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop);
-gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop);
+void familiar_players_db_insert (FamiliarPlayersDB* self, const gchar* desktop);
+gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const gchar* desktop);
GeeSet* familiar_players_db_records (FamiliarPlayersDB* self);
-char* familiar_players_db_fetch_icon_name (const char* desktop_path);
+gchar* familiar_players_db_fetch_icon_name (const gchar* desktop_path);
GType fetch_file_get_type (void) G_GNUC_CONST;
-FetchFile* fetch_file_new (const char* uri, const char* prop);
-FetchFile* fetch_file_construct (GType object_type, const char* uri, const char* prop);
+FetchFile* fetch_file_new (const gchar* uri, const gchar* prop);
+FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop);
void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_);
-const char* fetch_file_get_uri (FetchFile* self);
-const char* fetch_file_get_intended_property (FetchFile* self);
+const gchar* fetch_file_get_uri (FetchFile* self);
+const gchar* fetch_file_get_intended_property (FetchFile* self);
G_END_DECLS
diff --git a/src/player-controller.c b/src/player-controller.c
index ee477e7..e4a2172 100644
--- a/src/player-controller.c
+++ b/src/player-controller.c
@@ -1,4 +1,4 @@
-/* player-controller.c generated by valac 0.10.0, the Vala compiler
+/* player-controller.c generated by valac 0.11.2, the Vala compiler
* generated from player-controller.vala, do not modify */
/*
@@ -115,11 +115,11 @@ struct _PlayerControllerClass {
struct _PlayerControllerPrivate {
DbusmenuMenuitem* root_menu;
- char* _name;
- char* _mpris_name;
+ gchar* _name;
+ gchar* _mpris_name;
GAppInfo* _app_info;
gint _menu_offset;
- char* _icon_name;
+ gchar* _icon_name;
};
typedef enum {
@@ -155,20 +155,20 @@ enum {
GType player_controller_widget_order_get_type (void) G_GNUC_CONST;
GType player_controller_state_get_type (void) G_GNUC_CONST;
#define PLAYER_CONTROLLER_WIDGET_QUANTITY 4
-PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state);
-PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state);
void player_controller_set_app_info (PlayerController* self, GAppInfo* value);
-static char* player_controller_format_player_name (char* app_info_name);
+static gchar* player_controller_format_player_name (gchar* app_info_name);
GAppInfo* player_controller_get_app_info (PlayerController* self);
-void player_controller_set_name (PlayerController* self, const char* value);
-void player_controller_set_mpris_name (PlayerController* self, const char* value);
-void player_controller_set_icon_name (PlayerController* self, const char* value);
+void player_controller_set_name (PlayerController* self, const gchar* value);
+void player_controller_set_mpris_name (PlayerController* self, const gchar* value);
+void player_controller_set_icon_name (PlayerController* self, const gchar* value);
void player_controller_set_menu_offset (PlayerController* self, gint value);
static void player_controller_construct_widgets (PlayerController* self);
static void player_controller_establish_mpris_connection (PlayerController* self);
void player_controller_update_layout (PlayerController* self);
void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state);
-const char* player_controller_get_name (PlayerController* self);
+const gchar* player_controller_get_name (PlayerController* self);
void player_controller_activate (PlayerController* self);
void player_controller_instantiate (PlayerController* self);
Mpris2Controller* mpris2_controller_new (PlayerController* ctrl);
@@ -182,8 +182,8 @@ GeeHashSet* metadata_menuitem_attributes_format (void);
GType title_menuitem_get_type (void) G_GNUC_CONST;
void title_menuitem_toggle_active_triangle (TitleMenuitem* self, gboolean update);
gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs);
-PlayerItem* player_item_new (const char* type);
-PlayerItem* player_item_construct (GType object_type, const char* type);
+PlayerItem* player_item_new (const gchar* type);
+PlayerItem* player_item_construct (GType object_type, const gchar* type);
TitleMenuitem* title_menuitem_new (PlayerController* parent);
TitleMenuitem* title_menuitem_construct (GType object_type, PlayerController* parent);
MetadataMenuitem* metadata_menuitem_new (void);
@@ -195,17 +195,16 @@ GType transport_menuitem_get_type (void) G_GNUC_CONST;
gint player_controller_get_menu_offset (PlayerController* self);
gboolean mpris2_controller_connected (Mpris2Controller* self);
void mpris2_controller_initial_update (Mpris2Controller* self);
-const char* player_controller_get_mpris_name (PlayerController* self);
-const char* player_controller_get_icon_name (PlayerController* self);
+const gchar* player_controller_get_mpris_name (PlayerController* self);
+const gchar* player_controller_get_icon_name (PlayerController* self);
static void player_controller_finalize (GObject* obj);
-static void player_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
-static void player_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static void _vala_player_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void _vala_player_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);
-
GType player_controller_widget_order_get_type (void) {
static volatile gsize player_controller_widget_order_type_id__volatile = 0;
if (g_once_init_enter (&player_controller_widget_order_type_id__volatile)) {
@@ -235,23 +234,38 @@ static gpointer _g_object_ref0 (gpointer self) {
}
-PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state) {
- PlayerController * self;
+PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state) {
+ PlayerController * self = NULL;
DbusmenuMenuitem* _tmp0_;
- char* _tmp1_;
- GeeArrayList* _tmp2_;
+ DbusmenuMenuitem* _tmp1_;
+ const gchar* _tmp2_ = NULL;
+ gchar* _tmp3_;
+ gchar* _tmp4_ = NULL;
+ gchar* _tmp5_;
+ GeeArrayList* _tmp6_ = NULL;
+ GeeArrayList* _tmp7_;
g_return_val_if_fail (root != NULL, NULL);
g_return_val_if_fail (app != NULL, NULL);
g_return_val_if_fail (mpris_name != NULL, NULL);
g_return_val_if_fail (icon_name != NULL, NULL);
self = (PlayerController*) g_object_new (object_type, NULL);
- self->priv->root_menu = (_tmp0_ = _g_object_ref0 (root), _g_object_unref0 (self->priv->root_menu), _tmp0_);
+ _tmp0_ = _g_object_ref0 (root);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->root_menu);
+ self->priv->root_menu = _tmp1_;
player_controller_set_app_info (self, app);
- player_controller_set_name (self, _tmp1_ = player_controller_format_player_name (g_strdup (g_app_info_get_name (self->priv->_app_info))));
- _g_free0 (_tmp1_);
+ _tmp2_ = g_app_info_get_name (self->priv->_app_info);
+ _tmp3_ = g_strdup (_tmp2_);
+ _tmp4_ = player_controller_format_player_name (_tmp3_);
+ _tmp5_ = _tmp4_;
+ player_controller_set_name (self, _tmp5_);
+ _g_free0 (_tmp5_);
player_controller_set_mpris_name (self, mpris_name);
player_controller_set_icon_name (self, icon_name);
- self->custom_items = (_tmp2_ = gee_array_list_new (TYPE_PLAYER_ITEM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL), _g_object_unref0 (self->custom_items), _tmp2_);
+ _tmp6_ = gee_array_list_new (TYPE_PLAYER_ITEM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
+ _tmp7_ = _tmp6_;
+ _g_object_unref0 (self->custom_items);
+ self->custom_items = _tmp7_;
self->current_state = (gint) initial_state;
player_controller_set_menu_offset (self, offset);
player_controller_construct_widgets (self);
@@ -261,7 +275,7 @@ PlayerController* player_controller_construct (GType object_type, DbusmenuMenuit
}
-PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state) {
+PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state) {
return player_controller_construct (TYPE_PLAYER_CONTROLLER, root, app, mpris_name, icon_name, offset, initial_state);
}
@@ -285,24 +299,20 @@ void player_controller_instantiate (PlayerController* self) {
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_debug ("player-controller.vala:94: instantiate in player controller for %s", self->priv->_name);
- {
- g_app_info_launch (self->priv->_app_info, NULL, NULL, &_inner_error_);
- if (_inner_error_ != NULL) {
- goto __catch4_g_error;
- }
- player_controller_update_state (self, PLAYER_CONTROLLER_STATE_INSTANTIATING);
+ g_app_info_launch (self->priv->_app_info, NULL, NULL, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ goto __catch4_g_error;
}
+ player_controller_update_state (self, PLAYER_CONTROLLER_STATE_INSTANTIATING);
goto __finally4;
__catch4_g_error:
{
GError * _error_;
_error_ = _inner_error_;
_inner_error_ = NULL;
- {
- g_warning ("player-controller.vala:100: Failed to launch app %s with error message" \
+ g_warning ("player-controller.vala:100: Failed to launch app %s with error message" \
": %s", self->priv->_name, _error_->message);
- _g_error_free0 (_error_);
- }
+ _g_error_free0 (_error_);
}
__finally4:
if (_inner_error_ != NULL) {
@@ -314,14 +324,18 @@ void player_controller_instantiate (PlayerController* self) {
static void player_controller_establish_mpris_connection (PlayerController* self) {
- Mpris2Controller* _tmp0_;
+ Mpris2Controller* _tmp0_ = NULL;
+ Mpris2Controller* _tmp1_;
g_return_if_fail (self != NULL);
if (self->current_state != PLAYER_CONTROLLER_STATE_READY) {
g_debug ("player-controller.vala:107: establish_mpris_connection - Not ready to " \
"connect");
return;
}
- self->mpris_bridge = (_tmp0_ = mpris2_controller_new (self), _g_object_unref0 (self->mpris_bridge), _tmp0_);
+ _tmp0_ = mpris2_controller_new (self);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->mpris_bridge);
+ self->mpris_bridge = _tmp1_;
player_controller_determine_state (self);
}
@@ -329,94 +343,161 @@ static void player_controller_establish_mpris_connection (PlayerController* self
void player_controller_vanish (PlayerController* self) {
g_return_if_fail (self != NULL);
{
- GeeIterator* _item_it;
- _item_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) self->custom_items);
+ GeeArrayList* _tmp0_;
+ GeeArrayList* _item_list;
+ gint _tmp1_;
+ gint _item_size;
+ gint _item_index;
+ _tmp0_ = _g_object_ref0 (self->custom_items);
+ _item_list = _tmp0_;
+ _tmp1_ = gee_collection_get_size ((GeeCollection*) _item_list);
+ _item_size = _tmp1_;
+ _item_index = -1;
while (TRUE) {
+ gpointer _tmp2_ = NULL;
DbusmenuMenuitem* item;
- if (!gee_iterator_next (_item_it)) {
+ _item_index = _item_index + 1;
+ if (!(_item_index < _item_size)) {
break;
}
- item = (DbusmenuMenuitem*) ((PlayerItem*) gee_iterator_get (_item_it));
+ _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) _item_list, _item_index);
+ item = (DbusmenuMenuitem*) ((PlayerItem*) _tmp2_);
dbusmenu_menuitem_child_delete (self->priv->root_menu, item);
_g_object_unref0 (item);
}
- _g_object_unref0 (_item_it);
+ _g_object_unref0 (_item_list);
}
}
void player_controller_hibernate (PlayerController* self) {
- PlayerItem* _tmp0_;
- GeeHashSet* _tmp1_;
- PlayerItem* _tmp2_;
+ gpointer _tmp0_ = NULL;
+ PlayerItem* _tmp1_;
+ GeeHashSet* _tmp2_ = NULL;
GeeHashSet* _tmp3_;
- PlayerItem* _tmp4_;
+ gpointer _tmp4_ = NULL;
+ PlayerItem* _tmp5_;
+ GeeHashSet* _tmp6_ = NULL;
+ GeeHashSet* _tmp7_;
+ gpointer _tmp8_ = NULL;
+ PlayerItem* _tmp9_;
TitleMenuitem* title;
g_return_if_fail (self != NULL);
player_controller_update_state (self, PLAYER_CONTROLLER_STATE_OFFLINE);
- player_item_reset (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT), _tmp1_ = transport_menuitem_attributes_format ());
- _g_object_unref0 (_tmp1_);
- _g_object_unref0 (_tmp0_);
- player_item_reset (_tmp2_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA), _tmp3_ = metadata_menuitem_attributes_format ());
+ _tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT);
+ _tmp1_ = (PlayerItem*) _tmp0_;
+ _tmp2_ = transport_menuitem_attributes_format ();
+ _tmp3_ = _tmp2_;
+ player_item_reset (_tmp1_, _tmp3_);
_g_object_unref0 (_tmp3_);
- _g_object_unref0 (_tmp2_);
- title = (_tmp4_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TITLE), IS_TITLE_MENUITEM (_tmp4_) ? ((TitleMenuitem*) _tmp4_) : NULL);
+ _g_object_unref0 (_tmp1_);
+ _tmp4_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA);
+ _tmp5_ = (PlayerItem*) _tmp4_;
+ _tmp6_ = metadata_menuitem_attributes_format ();
+ _tmp7_ = _tmp6_;
+ player_item_reset (_tmp5_, _tmp7_);
+ _g_object_unref0 (_tmp7_);
+ _g_object_unref0 (_tmp5_);
+ _tmp8_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TITLE);
+ title = (_tmp9_ = (PlayerItem*) _tmp8_, IS_TITLE_MENUITEM (_tmp9_) ? ((TitleMenuitem*) _tmp9_) : NULL);
title_menuitem_toggle_active_triangle (title, FALSE);
_g_object_unref0 (title);
}
void player_controller_update_layout (PlayerController* self) {
- PlayerItem* _tmp2_;
- PlayerItem* _tmp3_;
- GeeHashSet* _tmp4_;
+ gpointer _tmp4_ = NULL;
PlayerItem* _tmp5_;
+ gpointer _tmp6_ = NULL;
+ PlayerItem* _tmp7_;
+ GeeHashSet* _tmp8_ = NULL;
+ GeeHashSet* _tmp9_;
+ gboolean _tmp10_;
+ gpointer _tmp11_ = NULL;
+ PlayerItem* _tmp12_;
g_return_if_fail (self != NULL);
if (self->current_state != PLAYER_CONTROLLER_STATE_CONNECTED) {
- PlayerItem* _tmp0_;
+ gpointer _tmp0_ = NULL;
PlayerItem* _tmp1_;
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT)), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
- _g_object_unref0 (_tmp0_);
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp1_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA)), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
+ gpointer _tmp2_ = NULL;
+ PlayerItem* _tmp3_;
+ _tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT);
+ _tmp1_ = (PlayerItem*) _tmp0_;
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp1_, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
_g_object_unref0 (_tmp1_);
+ _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA);
+ _tmp3_ = (PlayerItem*) _tmp2_;
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp3_, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
+ _g_object_unref0 (_tmp3_);
return;
}
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp2_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA)), DBUSMENU_MENUITEM_PROP_VISIBLE, player_item_populated (_tmp3_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA), _tmp4_ = metadata_menuitem_attributes_format ()));
- _g_object_unref0 (_tmp4_);
- _g_object_unref0 (_tmp3_);
- _g_object_unref0 (_tmp2_);
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp5_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT)), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
+ _tmp4_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA);
+ _tmp5_ = (PlayerItem*) _tmp4_;
+ _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA);
+ _tmp7_ = (PlayerItem*) _tmp6_;
+ _tmp8_ = metadata_menuitem_attributes_format ();
+ _tmp9_ = _tmp8_;
+ _tmp10_ = player_item_populated (_tmp7_, _tmp9_);
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp5_, DBUSMENU_MENUITEM_PROP_VISIBLE, _tmp10_);
+ _g_object_unref0 (_tmp9_);
+ _g_object_unref0 (_tmp7_);
_g_object_unref0 (_tmp5_);
+ _tmp11_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT);
+ _tmp12_ = (PlayerItem*) _tmp11_;
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp12_, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
+ _g_object_unref0 (_tmp12_);
}
static void player_controller_construct_widgets (PlayerController* self) {
- PlayerItem* _tmp0_;
+ PlayerItem* _tmp0_ = NULL;
+ PlayerItem* _tmp1_;
+ TitleMenuitem* _tmp2_ = NULL;
TitleMenuitem* title_menu_item;
+ MetadataMenuitem* _tmp3_ = NULL;
MetadataMenuitem* metadata_item;
+ TransportMenuitem* _tmp4_ = NULL;
TransportMenuitem* transport_item;
g_return_if_fail (self != NULL);
- gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, _tmp0_ = player_item_new (DBUSMENU_CLIENT_TYPES_SEPARATOR));
- _g_object_unref0 (_tmp0_);
- title_menu_item = title_menuitem_new (self);
+ _tmp0_ = player_item_new (DBUSMENU_CLIENT_TYPES_SEPARATOR);
+ _tmp1_ = _tmp0_;
+ gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, _tmp1_);
+ _g_object_unref0 (_tmp1_);
+ _tmp2_ = title_menuitem_new (self);
+ title_menu_item = _tmp2_;
gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) title_menu_item);
- metadata_item = metadata_menuitem_new ();
+ _tmp3_ = metadata_menuitem_new ();
+ metadata_item = _tmp3_;
gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) metadata_item);
- transport_item = transport_menuitem_new (self);
+ _tmp4_ = transport_menuitem_new (self);
+ transport_item = _tmp4_;
gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) transport_item);
{
- GeeIterator* _item_it;
- _item_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) self->custom_items);
+ GeeArrayList* _tmp5_;
+ GeeArrayList* _item_list;
+ gint _tmp6_;
+ gint _item_size;
+ gint _item_index;
+ _tmp5_ = _g_object_ref0 (self->custom_items);
+ _item_list = _tmp5_;
+ _tmp6_ = gee_collection_get_size ((GeeCollection*) _item_list);
+ _item_size = _tmp6_;
+ _item_index = -1;
while (TRUE) {
+ gpointer _tmp7_ = NULL;
PlayerItem* item;
- if (!gee_iterator_next (_item_it)) {
+ gint _tmp8_;
+ _item_index = _item_index + 1;
+ if (!(_item_index < _item_size)) {
break;
}
- item = (PlayerItem*) gee_iterator_get (_item_it);
- dbusmenu_menuitem_child_add_position (self->priv->root_menu, (DbusmenuMenuitem*) item, (guint) (self->priv->_menu_offset + gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item)));
+ _tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _item_list, _item_index);
+ item = (PlayerItem*) _tmp7_;
+ _tmp8_ = gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item);
+ dbusmenu_menuitem_child_add_position (self->priv->root_menu, (DbusmenuMenuitem*) item, (guint) (self->priv->_menu_offset + _tmp8_));
_g_object_unref0 (item);
}
- _g_object_unref0 (_item_it);
+ _g_object_unref0 (_item_list);
}
_g_object_unref0 (transport_item);
_g_object_unref0 (metadata_item);
@@ -424,33 +505,40 @@ static void player_controller_construct_widgets (PlayerController* self) {
}
-static char* string_strip (const char* self) {
- char* result = NULL;
- char* _result_;
+static gchar* string_strip (const gchar* self) {
+ gchar* result = NULL;
+ gchar* _tmp0_ = NULL;
+ gchar* _result_;
g_return_val_if_fail (self != NULL, NULL);
- _result_ = g_strdup (self);
+ _tmp0_ = g_strdup (self);
+ _result_ = _tmp0_;
g_strstrip (_result_);
result = _result_;
return result;
}
-static glong string_get_length (const char* self) {
- glong result;
- g_return_val_if_fail (self != NULL, 0L);
- result = g_utf8_strlen (self, (gssize) (-1));
+static const gchar* string_offset (const gchar* self, glong offset) {
+ const gchar* result = NULL;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = (const gchar*) (((gchar*) self) + offset);
return result;
}
-static char* string_slice (const char* self, glong start, glong end) {
- char* result = NULL;
+static gchar* string_slice (const gchar* self, glong start, glong end) {
+ gchar* result = NULL;
+ glong _tmp0_;
glong string_length;
- gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
- const char* start_string;
+ gboolean _tmp2_ = FALSE;
+ const gchar* _tmp3_ = NULL;
+ const gchar* start_string;
+ const gchar* _tmp4_ = NULL;
+ gchar* _tmp5_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
- string_length = string_get_length (self);
+ _tmp0_ = strlen (self);
+ string_length = _tmp0_;
if (start < 0) {
start = string_length + start;
}
@@ -458,48 +546,79 @@ static char* string_slice (const char* self, glong start, glong end) {
end = string_length + end;
}
if (start >= 0) {
- _tmp0_ = start <= string_length;
+ _tmp1_ = start <= string_length;
} else {
- _tmp0_ = FALSE;
+ _tmp1_ = FALSE;
}
- g_return_val_if_fail (_tmp0_, NULL);
+ g_return_val_if_fail (_tmp1_, NULL);
if (end >= 0) {
- _tmp1_ = end <= string_length;
+ _tmp2_ = end <= string_length;
} else {
- _tmp1_ = FALSE;
+ _tmp2_ = FALSE;
}
- g_return_val_if_fail (_tmp1_, NULL);
+ g_return_val_if_fail (_tmp2_, NULL);
g_return_val_if_fail (start <= end, NULL);
- start_string = g_utf8_offset_to_pointer (self, start);
- result = g_strndup (start_string, ((gchar*) g_utf8_offset_to_pointer (start_string, end - start)) - ((gchar*) start_string));
+ _tmp3_ = string_offset (self, start);
+ start_string = _tmp3_;
+ _tmp4_ = string_offset (start_string, end - start);
+ _tmp5_ = g_strndup (start_string, ((gchar*) _tmp4_) - ((gchar*) start_string));
+ result = _tmp5_;
return result;
}
-static char* player_controller_format_player_name (char* app_info_name) {
- char* result = NULL;
- char* _tmp0_;
- char* _tmp1_;
- char* _result_;
+static gchar* player_controller_format_player_name (gchar* app_info_name) {
+ gchar* result = NULL;
+ gchar* _tmp0_ = NULL;
+ gchar* _tmp1_;
+ gchar* _tmp2_ = NULL;
+ gchar* _tmp3_;
+ gchar* _result_;
+ gchar** _tmp4_;
+ gchar** _tmp5_ = NULL;
gint tokens_length1;
gint _tokens_size_;
- char** _tmp3_;
- char** _tmp2_;
- char** tokens;
+ gchar** _tmp6_;
+ gchar** tokens;
+ glong _tmp9_;
g_return_val_if_fail (app_info_name != NULL, NULL);
- _result_ = (_tmp1_ = string_strip (_tmp0_ = g_utf8_strdown (app_info_name, -1)), _g_free0 (_tmp0_), _tmp1_);
- tokens = (_tmp3_ = _tmp2_ = g_strsplit (_result_, " ", 0), tokens_length1 = _vala_array_length (_tmp2_), _tokens_size_ = tokens_length1, _tmp3_);
+ _tmp0_ = g_utf8_strdown (app_info_name, (gssize) (-1));
+ _tmp1_ = _tmp0_;
+ _tmp2_ = string_strip (_tmp1_);
+ _result_ = (_tmp3_ = _tmp2_, _g_free0 (_tmp1_), _tmp3_);
+ _tmp5_ = _tmp4_ = g_strsplit (_result_, " ", 0);
+ _tmp6_ = _tmp5_;
+ tokens_length1 = _vala_array_length (_tmp4_);
+ _tokens_size_ = tokens_length1;
+ tokens = _tmp6_;
if (tokens_length1 > 1) {
- char* _tmp4_;
- _result_ = (_tmp4_ = g_strdup (tokens[0]), _g_free0 (_result_), _tmp4_);
+ gchar* _tmp7_;
+ gchar* _tmp8_;
+ _tmp7_ = g_strdup (tokens[0]);
+ _tmp8_ = _tmp7_;
+ _g_free0 (_result_);
+ _result_ = _tmp8_;
}
- if (string_get_length (_result_) > 1) {
- char* _tmp5_;
- char* _tmp6_;
- char* _tmp7_;
- _result_ = (_tmp7_ = g_strconcat (_tmp5_ = g_utf8_strup (_result_, (gssize) 1), _tmp6_ = string_slice (_result_, (glong) 1, string_get_length (_result_)), NULL), _g_free0 (_result_), _tmp7_);
- _g_free0 (_tmp6_);
- _g_free0 (_tmp5_);
+ _tmp9_ = strlen (_result_);
+ if (_tmp9_ > 1) {
+ gchar* _tmp10_ = NULL;
+ gchar* _tmp11_;
+ glong _tmp12_;
+ gchar* _tmp13_ = NULL;
+ gchar* _tmp14_;
+ gchar* _tmp15_ = NULL;
+ gchar* _tmp16_;
+ _tmp10_ = g_utf8_strup (_result_, (gssize) 1);
+ _tmp11_ = _tmp10_;
+ _tmp12_ = strlen (_result_);
+ _tmp13_ = string_slice (_result_, (glong) 1, _tmp12_);
+ _tmp14_ = _tmp13_;
+ _tmp15_ = g_strconcat (_tmp11_, _tmp14_, NULL);
+ _tmp16_ = _tmp15_;
+ _g_free0 (_result_);
+ _result_ = _tmp16_;
+ _g_free0 (_tmp14_);
+ _g_free0 (_tmp11_);
g_debug ("player-controller.vala:176: PlayerController->format_player_name - : %" \
"s", _result_);
}
@@ -511,12 +630,16 @@ static char* player_controller_format_player_name (char* app_info_name) {
void player_controller_determine_state (PlayerController* self) {
+ gboolean _tmp0_;
g_return_if_fail (self != NULL);
- if (mpris2_controller_connected (self->mpris_bridge) == TRUE) {
- PlayerItem* _tmp0_;
+ _tmp0_ = mpris2_controller_connected (self->mpris_bridge);
+ if (_tmp0_ == TRUE) {
+ gpointer _tmp1_ = NULL;
+ PlayerItem* _tmp2_;
TitleMenuitem* title;
player_controller_update_state (self, PLAYER_CONTROLLER_STATE_CONNECTED);
- title = (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TITLE), IS_TITLE_MENUITEM (_tmp0_) ? ((TitleMenuitem*) _tmp0_) : NULL);
+ _tmp1_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TITLE);
+ title = (_tmp2_ = (PlayerItem*) _tmp1_, IS_TITLE_MENUITEM (_tmp2_) ? ((TitleMenuitem*) _tmp2_) : NULL);
title_menuitem_toggle_active_triangle (title, TRUE);
mpris2_controller_initial_update (self->mpris_bridge);
_g_object_unref0 (title);
@@ -526,34 +649,42 @@ void player_controller_determine_state (PlayerController* self) {
}
-const char* player_controller_get_name (PlayerController* self) {
- const char* result;
+const gchar* player_controller_get_name (PlayerController* self) {
+ const gchar* result;
g_return_val_if_fail (self != NULL, NULL);
result = self->priv->_name;
return result;
}
-void player_controller_set_name (PlayerController* self, const char* value) {
- char* _tmp0_;
+void player_controller_set_name (PlayerController* self, const gchar* value) {
+ gchar* _tmp0_;
+ gchar* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_name = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_name), _tmp0_);
+ _tmp0_ = g_strdup (value);
+ _tmp1_ = _tmp0_;
+ _g_free0 (self->priv->_name);
+ self->priv->_name = _tmp1_;
g_object_notify ((GObject *) self, "name");
}
-const char* player_controller_get_mpris_name (PlayerController* self) {
- const char* result;
+const gchar* player_controller_get_mpris_name (PlayerController* self) {
+ const gchar* result;
g_return_val_if_fail (self != NULL, NULL);
result = self->priv->_mpris_name;
return result;
}
-void player_controller_set_mpris_name (PlayerController* self, const char* value) {
- char* _tmp0_;
+void player_controller_set_mpris_name (PlayerController* self, const gchar* value) {
+ gchar* _tmp0_;
+ gchar* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_mpris_name = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_mpris_name), _tmp0_);
+ _tmp0_ = g_strdup (value);
+ _tmp1_ = _tmp0_;
+ _g_free0 (self->priv->_mpris_name);
+ self->priv->_mpris_name = _tmp1_;
g_object_notify ((GObject *) self, "mpris-name");
}
@@ -568,8 +699,12 @@ GAppInfo* player_controller_get_app_info (PlayerController* self) {
void player_controller_set_app_info (PlayerController* self, GAppInfo* value) {
GAppInfo* _tmp0_;
+ GAppInfo* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_app_info = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_app_info), _tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->_app_info);
+ self->priv->_app_info = _tmp1_;
g_object_notify ((GObject *) self, "app-info");
}
@@ -589,18 +724,22 @@ void player_controller_set_menu_offset (PlayerController* self, gint value) {
}
-const char* player_controller_get_icon_name (PlayerController* self) {
- const char* result;
+const gchar* player_controller_get_icon_name (PlayerController* self) {
+ const gchar* result;
g_return_val_if_fail (self != NULL, NULL);
result = self->priv->_icon_name;
return result;
}
-void player_controller_set_icon_name (PlayerController* self, const char* value) {
- char* _tmp0_;
+void player_controller_set_icon_name (PlayerController* self, const gchar* value) {
+ gchar* _tmp0_;
+ gchar* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_icon_name = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_icon_name), _tmp0_);
+ _tmp0_ = g_strdup (value);
+ _tmp1_ = _tmp0_;
+ _g_free0 (self->priv->_icon_name);
+ self->priv->_icon_name = _tmp1_;
g_object_notify ((GObject *) self, "icon-name");
}
@@ -608,8 +747,8 @@ void player_controller_set_icon_name (PlayerController* self, const char* value)
static void player_controller_class_init (PlayerControllerClass * klass) {
player_controller_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (PlayerControllerPrivate));
- G_OBJECT_CLASS (klass)->get_property = player_controller_get_property;
- G_OBJECT_CLASS (klass)->set_property = player_controller_set_property;
+ G_OBJECT_CLASS (klass)->get_property = _vala_player_controller_get_property;
+ G_OBJECT_CLASS (klass)->set_property = _vala_player_controller_set_property;
G_OBJECT_CLASS (klass)->finalize = player_controller_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_MPRIS_NAME, g_param_spec_string ("mpris-name", "mpris-name", "mpris-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
@@ -651,7 +790,7 @@ GType player_controller_get_type (void) {
}
-static void player_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+static void _vala_player_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
PlayerController * self;
self = PLAYER_CONTROLLER (object);
switch (property_id) {
@@ -677,7 +816,7 @@ static void player_controller_get_property (GObject * object, guint property_id,
}
-static void player_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+static void _vala_player_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
PlayerController * self;
self = PLAYER_CONTROLLER (object);
switch (property_id) {
@@ -734,4 +873,3 @@ static gint _vala_array_length (gpointer array) {
-
diff --git a/src/player-item.c b/src/player-item.c
index fe0d8db..073fd80 100644
--- a/src/player-item.c
+++ b/src/player-item.c
@@ -1,4 +1,4 @@
-/* player-item.c generated by valac 0.10.0, the Vala compiler
+/* player-item.c generated by valac 0.11.2, the Vala compiler
* generated from player-item.vala, do not modify */
/*
@@ -76,7 +76,7 @@ struct _PlayerItemClass {
struct _PlayerItemPrivate {
PlayerController* _owner;
- char* _item_type;
+ gchar* _item_type;
};
@@ -91,38 +91,37 @@ enum {
PLAYER_ITEM_ITEM_TYPE
};
#define PLAYER_ITEM_EMPTY (-1)
-PlayerItem* player_item_new (const char* type);
-PlayerItem* player_item_construct (GType object_type, const char* type);
+PlayerItem* player_item_new (const gchar* type);
+PlayerItem* player_item_construct (GType object_type, const gchar* type);
void player_item_reset (PlayerItem* self, GeeHashSet* attrs);
void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes);
static GValue* _g_value_dup (GValue* self);
GType metadata_menuitem_get_type (void) G_GNUC_CONST;
-void metadata_menuitem_fetch_art (MetadataMenuitem* self, const char* uri, const char* prop);
+void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop);
static void _vala_GValue_free (GValue* self);
gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs);
PlayerController* player_item_get_owner (PlayerItem* self);
static void player_item_set_owner (PlayerItem* self, PlayerController* value);
-const char* player_item_get_item_type (PlayerItem* self);
-static void player_item_set_item_type (PlayerItem* self, const char* value);
+const gchar* player_item_get_item_type (PlayerItem* self);
+static void player_item_set_item_type (PlayerItem* self, const gchar* value);
static GObject * player_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void player_item_finalize (GObject* obj);
-static void player_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
-static void player_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static void _vala_player_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void _vala_player_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);
-
-PlayerItem* player_item_construct (GType object_type, const char* type) {
- PlayerItem * self;
+PlayerItem* player_item_construct (GType object_type, const gchar* type) {
+ PlayerItem * self = NULL;
g_return_val_if_fail (type != NULL, NULL);
self = (PlayerItem*) g_object_new (object_type, "item-type", type, NULL);
return self;
}
-PlayerItem* player_item_new (const char* type) {
+PlayerItem* player_item_new (const gchar* type) {
return player_item_construct (TYPE_PLAYER_ITEM, type);
}
@@ -131,14 +130,20 @@ void player_item_reset (PlayerItem* self, GeeHashSet* attrs) {
g_return_if_fail (self != NULL);
g_return_if_fail (attrs != NULL);
{
+ GeeIterator* _tmp0_ = NULL;
GeeIterator* _s_it;
- _s_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs);
+ _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs);
+ _s_it = _tmp0_;
while (TRUE) {
- char* s;
- if (!gee_iterator_next (_s_it)) {
+ gboolean _tmp1_;
+ gpointer _tmp2_ = NULL;
+ gchar* s;
+ _tmp1_ = gee_iterator_next (_s_it);
+ if (!_tmp1_) {
break;
}
- s = (char*) gee_iterator_get (_s_it);
+ _tmp2_ = gee_iterator_get (_s_it);
+ s = (gchar*) _tmp2_;
g_debug ("player-item.vala:40: attempting to set prop %s to EMPTY", s);
dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, s, PLAYER_ITEM_EMPTY);
_g_free0 (s);
@@ -164,22 +169,26 @@ static gpointer __g_value_dup0 (gpointer self) {
}
-static char* string_strip (const char* self) {
- char* result = NULL;
- char* _result_;
+static gchar* string_strip (const gchar* self) {
+ gchar* result = NULL;
+ gchar* _tmp0_ = NULL;
+ gchar* _result_;
g_return_val_if_fail (self != NULL, NULL);
- _result_ = g_strdup (self);
+ _tmp0_ = g_strdup (self);
+ _result_ = _tmp0_;
g_strstrip (_result_);
result = _result_;
return result;
}
-static gboolean string_contains (const char* self, const char* needle) {
+static gboolean string_contains (const gchar* self, const gchar* needle) {
gboolean result = FALSE;
+ const gchar* _tmp0_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (needle != NULL, FALSE);
- result = strstr (self, needle) != NULL;
+ _tmp0_ = strstr (self, needle);
+ result = _tmp0_ != NULL;
return result;
}
@@ -195,19 +204,24 @@ static void _vala_GValue_free (GValue* self) {
}
-static char* bool_to_string (gboolean self) {
- char* result = NULL;
+static gchar* bool_to_string (gboolean self) {
+ gchar* result = NULL;
if (self) {
- result = g_strdup ("true");
+ gchar* _tmp0_;
+ _tmp0_ = g_strdup ("true");
+ result = _tmp0_;
return result;
} else {
- result = g_strdup ("false");
+ gchar* _tmp1_;
+ _tmp1_ = g_strdup ("false");
+ result = _tmp1_;
return result;
}
}
void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes) {
+ gboolean _tmp28_;
g_return_if_fail (self != NULL);
g_return_if_fail (data != NULL);
g_return_if_fail (attributes != NULL);
@@ -218,38 +232,66 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu
return;
}
{
+ GeeIterator* _tmp0_ = NULL;
GeeIterator* _property_it;
- _property_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) attributes);
+ _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attributes);
+ _property_it = _tmp0_;
while (TRUE) {
- char* property;
+ gboolean _tmp1_;
+ gpointer _tmp2_ = NULL;
+ gchar* property;
+ gchar** _tmp3_;
+ gchar** _tmp4_ = NULL;
gint input_keys_length1;
gint _input_keys_size_;
- char** _tmp1_;
- char** _tmp0_;
- char** input_keys;
- gint _tmp2_;
- char** _tmp3_ = NULL;
- char* search_key;
+ gchar** _tmp5_;
+ gchar** input_keys;
+ gchar* _tmp6_;
+ gchar* search_key;
+ gconstpointer _tmp7_ = NULL;
+ GValue* _tmp8_;
GValue* v;
- if (!gee_iterator_next (_property_it)) {
+ gboolean _tmp9_;
+ _tmp1_ = gee_iterator_next (_property_it);
+ if (!_tmp1_) {
break;
}
- property = (char*) gee_iterator_get (_property_it);
- input_keys = (_tmp1_ = _tmp0_ = g_strsplit (property, "-", 0), input_keys_length1 = _vala_array_length (_tmp0_), _input_keys_size_ = input_keys_length1, _tmp1_);
- search_key = g_strdup ((_tmp3_ = input_keys + (input_keys_length1 - 1), _tmp2_ = input_keys_length1 - (input_keys_length1 - 1), _tmp3_)[0]);
+ _tmp2_ = gee_iterator_get (_property_it);
+ property = (gchar*) _tmp2_;
+ _tmp4_ = _tmp3_ = g_strsplit (property, "-", 0);
+ _tmp5_ = _tmp4_;
+ input_keys_length1 = _vala_array_length (_tmp3_);
+ _input_keys_size_ = input_keys_length1;
+ input_keys = _tmp5_;
+ _tmp6_ = g_strdup ((input_keys + (input_keys_length1 - 1))[0]);
+ search_key = _tmp6_;
g_debug ("player-item.vala:62: search key = %s", search_key);
- v = __g_value_dup0 ((GValue*) g_hash_table_lookup (data, search_key));
- if (G_VALUE_HOLDS (v, G_TYPE_STRING)) {
- char* update;
- update = string_strip (g_value_get_string (v));
+ _tmp7_ = g_hash_table_lookup (data, search_key);
+ _tmp8_ = __g_value_dup0 ((GValue*) _tmp7_);
+ v = _tmp8_;
+ _tmp9_ = G_VALUE_HOLDS (v, G_TYPE_STRING);
+ if (_tmp9_) {
+ const gchar* _tmp10_ = NULL;
+ gchar* _tmp11_ = NULL;
+ gchar* update;
+ gboolean _tmp12_;
+ _tmp10_ = g_value_get_string (v);
+ _tmp11_ = string_strip (_tmp10_);
+ update = _tmp11_;
g_debug ("player-item.vala:67: with value : %s", update);
- if (string_contains (property, "mpris:artUrl")) {
- PlayerItem* _tmp4_;
+ _tmp12_ = string_contains (property, "mpris:artUrl");
+ if (_tmp12_) {
+ PlayerItem* _tmp13_;
+ MetadataMenuitem* _tmp14_;
MetadataMenuitem* metadata;
- char* _tmp5_;
- metadata = _g_object_ref0 ((_tmp4_ = self, IS_METADATA_MENUITEM (_tmp4_) ? ((MetadataMenuitem*) _tmp4_) : NULL));
- metadata_menuitem_fetch_art (metadata, _tmp5_ = string_strip (update), property);
- _g_free0 (_tmp5_);
+ gchar* _tmp15_ = NULL;
+ gchar* _tmp16_;
+ _tmp14_ = _g_object_ref0 ((_tmp13_ = self, IS_METADATA_MENUITEM (_tmp13_) ? ((MetadataMenuitem*) _tmp13_) : NULL));
+ metadata = _tmp14_;
+ _tmp15_ = string_strip (update);
+ _tmp16_ = _tmp15_;
+ metadata_menuitem_fetch_art (metadata, _tmp16_, property);
+ _g_free0 (_tmp16_);
_g_object_unref0 (metadata);
_g_free0 (update);
__vala_GValue_free0 (v);
@@ -261,19 +303,40 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu
dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, update);
_g_free0 (update);
} else {
- if (G_VALUE_HOLDS (v, G_TYPE_INT)) {
- g_debug ("player-item.vala:78: with value : %i", g_value_get_int (v));
- dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, g_value_get_int (v));
+ gboolean _tmp17_;
+ _tmp17_ = G_VALUE_HOLDS (v, G_TYPE_INT);
+ if (_tmp17_) {
+ gint _tmp18_;
+ gint _tmp19_;
+ _tmp18_ = g_value_get_int (v);
+ g_debug ("player-item.vala:78: with value : %i", _tmp18_);
+ _tmp19_ = g_value_get_int (v);
+ dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, _tmp19_);
} else {
- if (G_VALUE_HOLDS (v, G_TYPE_INT64)) {
- g_debug ("player-item.vala:82: with value : %i", (gint) g_value_get_int64 (v));
- dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, (gint) g_value_get_int64 (v));
+ gboolean _tmp20_;
+ _tmp20_ = G_VALUE_HOLDS (v, G_TYPE_INT64);
+ if (_tmp20_) {
+ gint64 _tmp21_;
+ gint64 _tmp22_;
+ _tmp21_ = g_value_get_int64 (v);
+ g_debug ("player-item.vala:82: with value : %i", (gint) _tmp21_);
+ _tmp22_ = g_value_get_int64 (v);
+ dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, (gint) _tmp22_);
} else {
- if (G_VALUE_HOLDS (v, G_TYPE_BOOLEAN)) {
- char* _tmp6_;
- g_debug ("player-item.vala:86: with value : %s", _tmp6_ = bool_to_string (g_value_get_boolean (v)));
- _g_free0 (_tmp6_);
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, property, g_value_get_boolean (v));
+ gboolean _tmp23_;
+ _tmp23_ = G_VALUE_HOLDS (v, G_TYPE_BOOLEAN);
+ if (_tmp23_) {
+ gboolean _tmp24_;
+ gchar* _tmp25_ = NULL;
+ gchar* _tmp26_;
+ gboolean _tmp27_;
+ _tmp24_ = g_value_get_boolean (v);
+ _tmp25_ = bool_to_string (_tmp24_);
+ _tmp26_ = _tmp25_;
+ g_debug ("player-item.vala:86: with value : %s", _tmp26_);
+ _g_free0 (_tmp26_);
+ _tmp27_ = g_value_get_boolean (v);
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, property, _tmp27_);
}
}
}
@@ -285,7 +348,8 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu
}
_g_object_unref0 (_property_it);
}
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_VISIBLE, player_item_populated (self, attributes));
+ _tmp28_ = player_item_populated (self, attributes);
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_VISIBLE, _tmp28_);
}
@@ -294,18 +358,28 @@ gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs) {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (attrs != NULL, FALSE);
{
+ GeeIterator* _tmp0_ = NULL;
GeeIterator* _prop_it;
- _prop_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs);
+ _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs);
+ _prop_it = _tmp0_;
while (TRUE) {
- char* prop;
+ gboolean _tmp1_;
+ gpointer _tmp2_ = NULL;
+ gchar* prop;
+ gint _tmp3_;
gint value_int;
- if (!gee_iterator_next (_prop_it)) {
+ gint _tmp4_;
+ _tmp1_ = gee_iterator_next (_prop_it);
+ if (!_tmp1_) {
break;
}
- prop = (char*) gee_iterator_get (_prop_it);
+ _tmp2_ = gee_iterator_get (_prop_it);
+ prop = (gchar*) _tmp2_;
g_debug ("player-item.vala:96: populated ? - prop: %s", prop);
- value_int = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop);
- if (dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop) != PLAYER_ITEM_EMPTY) {
+ _tmp3_ = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop);
+ value_int = _tmp3_;
+ _tmp4_ = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop);
+ if (_tmp4_ != PLAYER_ITEM_EMPTY) {
g_debug ("player-item.vala:99: populated - prop %s and value %i", prop, value_int);
result = TRUE;
_g_free0 (prop);
@@ -331,24 +405,32 @@ PlayerController* player_item_get_owner (PlayerItem* self) {
static void player_item_set_owner (PlayerItem* self, PlayerController* value) {
PlayerController* _tmp0_;
+ PlayerController* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_owner = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_owner), _tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
+ _tmp1_ = _tmp0_;
+ _g_object_unref0 (self->priv->_owner);
+ self->priv->_owner = _tmp1_;
g_object_notify ((GObject *) self, "owner");
}
-const char* player_item_get_item_type (PlayerItem* self) {
- const char* result;
+const gchar* player_item_get_item_type (PlayerItem* self) {
+ const gchar* result;
g_return_val_if_fail (self != NULL, NULL);
result = self->priv->_item_type;
return result;
}
-static void player_item_set_item_type (PlayerItem* self, const char* value) {
- char* _tmp0_;
+static void player_item_set_item_type (PlayerItem* self, const gchar* value) {
+ gchar* _tmp0_;
+ gchar* _tmp1_;
g_return_if_fail (self != NULL);
- self->priv->_item_type = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_item_type), _tmp0_);
+ _tmp0_ = g_strdup (value);
+ _tmp1_ = _tmp0_;
+ _g_free0 (self->priv->_item_type);
+ self->priv->_item_type = _tmp1_;
g_object_notify ((GObject *) self, "item-type");
}
@@ -360,9 +442,7 @@ static GObject * player_item_constructor (GType type, guint n_construct_properti
parent_class = G_OBJECT_CLASS (player_item_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = PLAYER_ITEM (obj);
- {
- dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_TYPE, self->priv->_item_type);
- }
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_TYPE, self->priv->_item_type);
return obj;
}
@@ -370,8 +450,8 @@ static GObject * player_item_constructor (GType type, guint n_construct_properti
static void player_item_class_init (PlayerItemClass * klass) {
player_item_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (PlayerItemPrivate));
- G_OBJECT_CLASS (klass)->get_property = player_item_get_property;
- G_OBJECT_CLASS (klass)->set_property = player_item_set_property;
+ G_OBJECT_CLASS (klass)->get_property = _vala_player_item_get_property;
+ G_OBJECT_CLASS (klass)->set_property = _vala_player_item_set_property;
G_OBJECT_CLASS (klass)->constructor = player_item_constructor;
G_OBJECT_CLASS (klass)->finalize = player_item_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_ITEM_OWNER, g_param_spec_object ("owner", "owner", "owner", TYPE_PLAYER_CONTROLLER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
@@ -405,7 +485,7 @@ GType player_item_get_type (void) {
}
-static void player_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+static void _vala_player_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
PlayerItem * self;
self = PLAYER_ITEM (object);
switch (property_id) {
@@ -422,7 +502,7 @@ static void player_item_get_property (GObject * object, guint property_id, GValu
}
-static void player_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+static void _vala_player_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
PlayerItem * self;
self = PLAYER_ITEM (object);
switch (property_id) {
@@ -470,4 +550,3 @@ static gint _vala_array_length (gpointer array) {
-
diff --git a/src/title-menu-item.c b/src/title-menu-item.c
index 4dcd986..5e4ee1c 100644
--- a/src/title-menu-item.c
+++ b/src/title-menu-item.c
@@ -1,4 +1,4 @@
-/* title-menu-item.c generated by valac 0.10.0, the Vala compiler
+/* title-menu-item.c generated by valac 0.11.2, the Vala compiler
* generated from title-menu-item.vala, do not modify */
/*
@@ -127,9 +127,9 @@ enum {
GType player_controller_get_type (void) G_GNUC_CONST;
TitleMenuitem* title_menuitem_new (PlayerController* parent);
TitleMenuitem* title_menuitem_construct (GType object_type, PlayerController* parent);
-const char* player_controller_get_name (PlayerController* self);
-const char* player_controller_get_icon_name (PlayerController* self);
-static void title_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp);
+const gchar* player_controller_get_name (PlayerController* self);
+const gchar* player_controller_get_icon_name (PlayerController* self);
+static void title_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GValue* input_value, guint timestamp);
PlayerController* player_item_get_owner (PlayerItem* self);
GType mpris2_controller_get_type (void) G_GNUC_CONST;
GType player_controller_state_get_type (void) G_GNUC_CONST;
@@ -139,14 +139,19 @@ void title_menuitem_toggle_active_triangle (TitleMenuitem* self, gboolean update
GeeHashSet* title_menuitem_attributes_format (void);
-
TitleMenuitem* title_menuitem_construct (GType object_type, PlayerController* parent) {
- TitleMenuitem * self;
+ TitleMenuitem * self = NULL;
+ const gchar* _tmp0_ = NULL;
+ const gchar* _tmp1_ = NULL;
+ const gchar* _tmp2_ = NULL;
g_return_val_if_fail (parent != NULL, NULL);
self = (TitleMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TITLE_MENUITEM_TYPE, "owner", parent, NULL);
- dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_TITLE_MENUITEM_NAME, player_controller_get_name (parent));
- g_debug ("title-menu-item.vala:30: title init - icon name = %s", player_controller_get_icon_name (parent));
- dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_TITLE_MENUITEM_ICON, player_controller_get_icon_name (parent));
+ _tmp0_ = player_controller_get_name (parent);
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_TITLE_MENUITEM_NAME, _tmp0_);
+ _tmp1_ = player_controller_get_icon_name (parent);
+ g_debug ("title-menu-item.vala:30: title init - icon name = %s", _tmp1_);
+ _tmp2_ = player_controller_get_icon_name (parent);
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_TITLE_MENUITEM_ICON, _tmp2_);
dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_TITLE_MENUITEM_RUNNING, FALSE);
return self;
}
@@ -157,15 +162,23 @@ TitleMenuitem* title_menuitem_new (PlayerController* parent) {
}
-static void title_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp) {
+static void title_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GValue* input_value, guint timestamp) {
TitleMenuitem * self;
+ PlayerController* _tmp0_ = NULL;
self = (TitleMenuitem*) base;
g_return_if_fail (name != NULL);
- if (player_item_get_owner ((PlayerItem*) self)->current_state == PLAYER_CONTROLLER_STATE_OFFLINE) {
- player_controller_instantiate (player_item_get_owner ((PlayerItem*) self));
+ _tmp0_ = player_item_get_owner ((PlayerItem*) self);
+ if (_tmp0_->current_state == PLAYER_CONTROLLER_STATE_OFFLINE) {
+ PlayerController* _tmp1_ = NULL;
+ _tmp1_ = player_item_get_owner ((PlayerItem*) self);
+ player_controller_instantiate (_tmp1_);
} else {
- if (player_item_get_owner ((PlayerItem*) self)->current_state == PLAYER_CONTROLLER_STATE_CONNECTED) {
- mpris2_controller_expose (player_item_get_owner ((PlayerItem*) self)->mpris_bridge);
+ PlayerController* _tmp2_ = NULL;
+ _tmp2_ = player_item_get_owner ((PlayerItem*) self);
+ if (_tmp2_->current_state == PLAYER_CONTROLLER_STATE_CONNECTED) {
+ PlayerController* _tmp3_ = NULL;
+ _tmp3_ = player_item_get_owner ((PlayerItem*) self);
+ mpris2_controller_expose (_tmp3_->mpris_bridge);
}
}
}
@@ -179,8 +192,10 @@ void title_menuitem_toggle_active_triangle (TitleMenuitem* self, gboolean update
GeeHashSet* title_menuitem_attributes_format (void) {
GeeHashSet* result = NULL;
+ GeeHashSet* _tmp0_ = NULL;
GeeHashSet* attrs;
- attrs = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ attrs = _tmp0_;
gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_TITLE_MENUITEM_NAME);
gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_TITLE_MENUITEM_RUNNING);
gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_TITLE_MENUITEM_ICON);
@@ -212,4 +227,3 @@ GType title_menuitem_get_type (void) {
-
diff --git a/src/title-widget.c b/src/title-widget.c
index 5bc2a93..1524a4a 100644
--- a/src/title-widget.c
+++ b/src/title-widget.c
@@ -83,27 +83,41 @@ title_widget_set_icon(TitleWidget *self)
{
TitleWidgetPrivate *priv = TITLE_WIDGET_GET_PRIVATE(self);
- gchar* icon_name = g_strdup(dbusmenu_menuitem_property_get(priv->twin_item,
- DBUSMENU_TITLE_MENUITEM_ICON));
gint padding = 0;
gtk_widget_style_get(GTK_WIDGET(self), "horizontal-padding", &padding, NULL);
-
gint width, height;
gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
-
- GtkWidget * icon = gtk_image_new_from_icon_name(icon_name,
- GTK_ICON_SIZE_MENU);
-
- gtk_widget_set_size_request(icon, width
+
+ GString* banshee_string = g_string_new ( "banshee" );
+ GString* app_panel = g_string_new ( g_utf8_strdown ( dbusmenu_menuitem_property_get(priv->twin_item, DBUSMENU_TITLE_MENUITEM_NAME),
+ -1 ));
+ GtkWidget * icon = NULL;
+
+ // Not ideal but apparently we want the banshee icon to be the greyscale one
+ // and any others to be the icon from the desktop file => colour.
+ if ( g_string_equal ( banshee_string, app_panel ) == TRUE &&
+ gtk_icon_theme_has_icon ( gtk_icon_theme_get_default(), app_panel->str ) ){
+ g_string_append ( app_panel, "-panel" );
+ icon = gtk_image_new_from_icon_name ( app_panel->str,
+ GTK_ICON_SIZE_MENU );
+ }
+ else{
+ icon = gtk_image_new_from_icon_name ( g_strdup (dbusmenu_menuitem_property_get ( priv->twin_item, DBUSMENU_TITLE_MENUITEM_ICON )),
+ GTK_ICON_SIZE_MENU );
+ }
+ g_string_free ( app_panel, FALSE) ;
+ g_string_free ( banshee_string, FALSE) ;
+
+ gtk_widget_set_size_request(icon, width
+ 5 /* ref triangle is 5x9 pixels */
+ 1 /* padding */,
height);
gtk_misc_set_alignment(GTK_MISC(icon), 0.5 /* right aligned */, 0);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(self), GTK_WIDGET(icon));
- gtk_widget_show(icon);
- g_free(icon_name);
+ gtk_widget_show(icon);
}
+
static void
title_widget_dispose (GObject *object)
{
diff --git a/src/transport-menu-item.c b/src/transport-menu-item.c
index d6a66a2..37a63d9 100644
--- a/src/transport-menu-item.c
+++ b/src/transport-menu-item.c
@@ -1,4 +1,4 @@
-/* transport-menu-item.c generated by valac 0.10.0, the Vala compiler
+/* transport-menu-item.c generated by valac 0.11.2, the Vala compiler
* generated from transport-menu-item.vala, do not modify */
/*
@@ -136,15 +136,14 @@ GType player_controller_get_type (void) G_GNUC_CONST;
TransportMenuitem* transport_menuitem_new (PlayerController* parent);
TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent);
void transport_menuitem_change_play_state (TransportMenuitem* self, TransportMenuitemstate update);
-static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp);
+static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GValue* input_value, guint timestamp);
PlayerController* player_item_get_owner (PlayerItem* self);
-const char* player_controller_get_name (PlayerController* self);
+const gchar* player_controller_get_name (PlayerController* self);
GType mpris2_controller_get_type (void) G_GNUC_CONST;
void mpris2_controller_transport_update (Mpris2Controller* self, TransportMenuitemaction command);
GeeHashSet* transport_menuitem_attributes_format (void);
-
GType transport_menuitem_action_get_type (void) {
static volatile gsize transport_menuitem_action_type_id__volatile = 0;
if (g_once_init_enter (&transport_menuitem_action_type_id__volatile)) {
@@ -170,7 +169,7 @@ GType transport_menuitem_state_get_type (void) {
TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent) {
- TransportMenuitem * self;
+ TransportMenuitem * self = NULL;
g_return_val_if_fail (parent != NULL, NULL);
self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", parent, NULL);
dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, 1);
@@ -191,24 +190,37 @@ void transport_menuitem_change_play_state (TransportMenuitem* self, TransportMen
}
-static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp) {
+static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GValue* input_value, guint timestamp) {
TransportMenuitem * self;
+ gint _tmp0_;
gint input;
- char* _tmp0_;
+ gchar* _tmp1_ = NULL;
+ gchar* _tmp2_;
+ PlayerController* _tmp3_ = NULL;
+ const gchar* _tmp4_ = NULL;
+ PlayerController* _tmp5_ = NULL;
self = (TransportMenuitem*) base;
g_return_if_fail (name != NULL);
- input = g_value_get_int (input_value);
- g_debug ("transport-menu-item.vala:53: handle_event with value %s", _tmp0_ = g_strdup_printf ("%i", input));
- _g_free0 (_tmp0_);
- g_debug ("transport-menu-item.vala:54: transport owner name = %s", player_controller_get_name (player_item_get_owner ((PlayerItem*) self)));
- mpris2_controller_transport_update (player_item_get_owner ((PlayerItem*) self)->mpris_bridge, (TransportMenuitemaction) input);
+ _tmp0_ = g_value_get_int (input_value);
+ input = _tmp0_;
+ _tmp1_ = g_strdup_printf ("%i", input);
+ _tmp2_ = _tmp1_;
+ g_debug ("transport-menu-item.vala:53: handle_event with value %s", _tmp2_);
+ _g_free0 (_tmp2_);
+ _tmp3_ = player_item_get_owner ((PlayerItem*) self);
+ _tmp4_ = player_controller_get_name (_tmp3_);
+ g_debug ("transport-menu-item.vala:54: transport owner name = %s", _tmp4_);
+ _tmp5_ = player_item_get_owner ((PlayerItem*) self);
+ mpris2_controller_transport_update (_tmp5_->mpris_bridge, (TransportMenuitemaction) input);
}
GeeHashSet* transport_menuitem_attributes_format (void) {
GeeHashSet* result = NULL;
+ GeeHashSet* _tmp0_ = NULL;
GeeHashSet* attrs;
- attrs = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ attrs = _tmp0_;
gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE);
result = attrs;
return result;
@@ -238,4 +250,3 @@ GType transport_menuitem_get_type (void) {
-
diff --git a/src/transport-widget.c b/src/transport-widget.c
index 26b7a98..5be9d4a 100644
--- a/src/transport-widget.c
+++ b/src/transport-widget.c
@@ -33,7 +33,7 @@ Uses code from ctk
#define Y 7.0f
#define X 80.0f
#define INNER_RADIUS 12.5
-#define MIDDLE_RADIUS 13.5f
+#define MIDDLE_RADIUS 13.0f
#define OUTER_RADIUS 14.5f
#define CIRCLE_RADIUS 21.0f
#define PREV_WIDTH 25.0f
@@ -59,24 +59,30 @@ Uses code from ctk
#define PLAY_PADDING 5.0f
#define INNER_START_SHADE 0.98
#define INNER_END_SHADE 0.98
-#define MIDDLE_START_SHADE 0.7
-#define MIDDLE_END_SHADE 1.4
-#define OUTER_START_SHADE 0.96
-#define OUTER_END_SHADE 0.96
+#define MIDDLE_START_SHADE 1.0
+#define MIDDLE_END_SHADE 1.0
+#define OUTER_START_SHADE 0.75
+#define OUTER_END_SHADE 1.3
+#define SHADOW_BUTTON_SHADE 0.8
+#define OUTER_PLAY_START_SHADE 0.7
+#define OUTER_PLAY_END_SHADE 1.38
#define BUTTON_START_SHADE 1.1
#define BUTTON_END_SHADE 0.9
#define BUTTON_SHADOW_SHADE 0.8
-#define INNER_COMPRESSED_START_SHADE 0.95
-#define INNER_COMPRESSED_END_SHADE 1.05
+#define INNER_COMPRESSED_START_SHADE 1.0
+#define INNER_COMPRESSED_END_SHADE 1.0
typedef struct _TransportWidgetPrivate TransportWidgetPrivate;
struct _TransportWidgetPrivate
{
TransportWidgetEvent current_command;
+ TransportWidgetEvent key_event;
+ TransportWidgetEvent motion_event;
TransportWidgetState current_state;
GHashTable* command_coordinates;
DbusmenuMenuitem* twin_item;
+ gboolean has_focus;
};
#define TRANSPORT_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRANSPORT_WIDGET_TYPE, TransportWidgetPrivate))
@@ -98,7 +104,11 @@ static void draw (GtkWidget* button, cairo_t *cr);
static gboolean transport_widget_button_press_event (GtkWidget *menuitem,
GdkEventButton *event);
static gboolean transport_widget_button_release_event (GtkWidget *menuitem,
- GdkEventButton *event);
+ GdkEventButton *event);
+static gboolean transport_widget_motion_notify_event (GtkWidget *menuitem,
+ GdkEventMotion *event);
+static gboolean transport_widget_leave_notify_event (GtkWidget *menuitem,
+ GdkEventCrossing *event);
static void transport_widget_property_update ( DbusmenuMenuitem* item,
gchar * property,
GValue * value,
@@ -110,10 +120,15 @@ static void transport_widget_notify ( GObject *item,
gpointer user_data );
static TransportWidgetEvent transport_widget_determine_button_event ( TransportWidget* button,
GdkEventButton* event);
+static TransportWidgetEvent transport_widget_determine_motion_event ( TransportWidget* button,
+ GdkEventMotion* event);
static void transport_widget_react_to_button_release ( TransportWidget* button,
TransportWidgetEvent command);
static void transport_widget_toggle_play_pause ( TransportWidget* button,
TransportWidgetState update);
+static void transport_widget_select (GtkItem* menu, gpointer Userdata);
+static void transport_widget_deselect (GtkItem* menu, gpointer Userdata);
+
/// Init functions //////////////////////////////////////////////////////////
@@ -126,7 +141,9 @@ transport_widget_class_init (TransportWidgetClass *klass)
g_type_class_add_private (klass, sizeof (TransportWidgetPrivate));
widget_class->button_press_event = transport_widget_button_press_event;
- widget_class->button_release_event = transport_widget_button_release_event;
+ widget_class->button_release_event = transport_widget_button_release_event;
+ widget_class->motion_notify_event = transport_widget_motion_notify_event;
+ widget_class->leave_notify_event = transport_widget_leave_notify_event;
widget_class->expose_event = transport_widget_expose;
gobject_class->dispose = transport_widget_dispose;
@@ -139,6 +156,9 @@ transport_widget_init (TransportWidget *self)
TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(self);
priv->current_command = TRANSPORT_NADA;
priv->current_state = PAUSE;
+ priv->key_event = TRANSPORT_NADA;
+ priv->motion_event = TRANSPORT_NADA;
+ priv->has_focus = FALSE;
priv->command_coordinates = g_hash_table_new_full(g_direct_hash,
g_direct_equal,
NULL,
@@ -171,12 +191,21 @@ transport_widget_init (TransportWidget *self)
g_hash_table_insert(priv->command_coordinates,
GINT_TO_POINTER(TRANSPORT_NEXT),
next_list);
-
gtk_widget_set_size_request(GTK_WIDGET(self), 200, 43);
g_signal_connect (G_OBJECT(self),
"notify",
G_CALLBACK (transport_widget_notify),
- NULL);
+ NULL);
+ g_signal_connect (GTK_ITEM(self),
+ "select",
+ G_CALLBACK (transport_widget_select),
+ NULL);
+ g_signal_connect (GTK_ITEM(self),
+ "deselect",
+ G_CALLBACK (transport_widget_deselect),
+ NULL);
+ gtk_widget_realize ( GTK_WIDGET (self) );
+
}
static void
@@ -209,6 +238,13 @@ transport_widget_expose (GtkWidget *button, GdkEventExpose *event)
return FALSE;
}
+gboolean
+transport_widget_is_selected ( TransportWidget* widget )
+{
+ TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(widget);
+ return priv->has_focus;
+}
+
static void
transport_widget_toggle_play_pause(TransportWidget* button,
TransportWidgetState update)
@@ -242,6 +278,40 @@ transport_widget_menu_hidden ( GtkWidget *menu,
transport_widget_react_to_button_release(transport, TRANSPORT_NADA);
}
+static gboolean
+transport_widget_motion_notify_event (GtkWidget *menuitem,
+ GdkEventMotion *event)
+{
+ g_return_val_if_fail ( IS_TRANSPORT_WIDGET(menuitem), FALSE );
+ TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE ( TRANSPORT_WIDGET(menuitem) );
+ TransportWidgetEvent result = transport_widget_determine_motion_event ( TRANSPORT_WIDGET(menuitem),
+ event);
+
+ priv->motion_event = result;
+ cairo_t *cr;
+ cr = gdk_cairo_create (menuitem->window);
+ draw ( menuitem, cr );
+ cairo_destroy ( cr );
+
+ return TRUE;
+}
+
+static gboolean
+transport_widget_leave_notify_event (GtkWidget *menuitem,
+ GdkEventCrossing *event)
+{
+ g_return_val_if_fail ( IS_TRANSPORT_WIDGET(menuitem), FALSE );
+ TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE ( TRANSPORT_WIDGET(menuitem) );
+
+ priv->motion_event = TRANSPORT_NADA;
+ cairo_t *cr;
+ cr = gdk_cairo_create (menuitem->window);
+ draw ( menuitem, cr );
+ cairo_destroy ( cr );
+
+ return TRUE;
+}
+
/* keyevents */
static gboolean
transport_widget_button_press_event (GtkWidget *menuitem,
@@ -249,9 +319,9 @@ transport_widget_button_press_event (GtkWidget *menuitem,
{
g_return_val_if_fail ( IS_TRANSPORT_WIDGET(menuitem), FALSE );
TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE ( TRANSPORT_WIDGET(menuitem) );
-
TransportWidgetEvent result = transport_widget_determine_button_event ( TRANSPORT_WIDGET(menuitem),
event);
+
if(result != TRANSPORT_NADA){
priv->current_command = result;
cairo_t *cr;
@@ -270,7 +340,6 @@ transport_widget_button_release_event (GtkWidget *menuitem,
g_return_val_if_fail(IS_TRANSPORT_WIDGET(menuitem), FALSE);
TransportWidget* transport = TRANSPORT_WIDGET(menuitem);
TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE ( transport );
-
TransportWidgetEvent result = transport_widget_determine_button_event ( transport,
event );
if(result != TRANSPORT_NADA){
@@ -283,12 +352,76 @@ transport_widget_button_release_event (GtkWidget *menuitem,
&value,
0 );
}
-
transport_widget_react_to_button_release ( transport,
result );
return TRUE;
}
+static void
+transport_widget_select (GtkItem* item, gpointer Userdata)
+{
+ TransportWidget* transport = TRANSPORT_WIDGET(item);
+ TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE ( transport );
+ priv->has_focus = TRUE;
+}
+
+static void
+transport_widget_deselect (GtkItem* item, gpointer Userdata)
+{
+ TransportWidget* transport = TRANSPORT_WIDGET(item);
+ TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE ( transport );
+ priv->has_focus = FALSE;
+}
+
+void
+transport_widget_react_to_key_press_event ( TransportWidget* transport,
+ TransportWidgetEvent transport_event )
+{
+ if(transport_event != TRANSPORT_NADA){
+ TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE ( transport );
+ priv->current_command = transport_event;
+ priv->key_event = transport_event;
+/* printf("transport_widget_react_to_key_press_event: before drawing\n");*/
+ gtk_widget_realize ( GTK_WIDGET(transport) );
+
+ printf ( "transport widget - react to key press event -> is the window null: %i",
+ gtk_widget_get_window (GTK_WIDGET (transport) ) == NULL );
+ cairo_t *cr;
+
+ printf("transport_widget_react_to_key_press_event: before drawing\n");
+ cr = gdk_cairo_create ( GTK_WIDGET(transport)->window );
+ draw ( GTK_WIDGET(transport), cr );
+ cairo_destroy (cr);
+ }
+}
+
+void
+transport_widget_react_to_key_release_event ( TransportWidget* transport,
+ TransportWidgetEvent transport_event )
+{
+ if(transport_event != TRANSPORT_NADA){
+ TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE ( transport );
+ GValue value = {0};
+ g_value_init(&value, G_TYPE_INT);
+ //g_debug("TransportWidget::menu_press_event - going to send value %i", (int)result);
+ g_value_set_int(&value, (int)transport_event);
+ dbusmenu_menuitem_handle_event ( priv->twin_item,
+ "Transport state change",
+ &value,
+ 0 );
+ }
+ transport_widget_react_to_button_release ( transport,
+ transport_event );
+}
+
+void
+transport_widget_focus_update ( TransportWidget* transport, gboolean focus )
+{
+ TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE ( transport );
+ priv->has_focus = focus;
+ g_debug("new focus update = %i", focus);
+}
+
static TransportWidgetEvent
transport_widget_determine_button_event( TransportWidget* button,
GdkEventButton* event )
@@ -312,6 +445,28 @@ transport_widget_determine_button_event( TransportWidget* button,
return button_event;
}
+static TransportWidgetEvent
+transport_widget_determine_motion_event( TransportWidget* button,
+ GdkEventMotion* event )
+{
+/* g_debug("event x coordinate = %f", event->x);*/
+/* g_debug("event y coordinate = %f", event->y);*/
+ TransportWidgetEvent motion_event = TRANSPORT_NADA;
+ // For now very simple rectangular collision detection
+ if(event->x > 67 && event->x < 112
+ && event->y > 12 && event->y < 40){
+ motion_event = TRANSPORT_PREVIOUS;
+ }
+ else if(event->x > 111 && event->x < 153
+ && event->y > 5 && event->y < 47){
+ motion_event = TRANSPORT_PLAY_PAUSE;
+ }
+ else if(event->x > 152 && event->x < 197
+ && event->y > 12 && event->y < 40){
+ motion_event = TRANSPORT_NEXT;
+ }
+ return motion_event;
+}
static void
transport_widget_react_to_button_release ( TransportWidget* button,
@@ -319,21 +474,18 @@ transport_widget_react_to_button_release ( TransportWidget* button,
{
g_return_if_fail(IS_TRANSPORT_WIDGET(button));
TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(button);
- if(priv->current_command == TRANSPORT_NADA){
- //g_debug("returning from the playbutton release because my previous command was nada");
- return;
- }
- else if(priv->current_command != TRANSPORT_NADA &&
+ if(priv->current_command != TRANSPORT_NADA &&
command != TRANSPORT_NADA){
priv->current_command = command;
}
cairo_t *cr;
cr = gdk_cairo_create ( GTK_WIDGET(button)->window );
- priv->current_command = TRANSPORT_NADA;
+ priv->current_command = TRANSPORT_NADA;
+ priv->key_event = TRANSPORT_NADA;
draw ( GTK_WIDGET(button), cr );
cairo_destroy (cr);
-}
+}
/// internal helper functions //////////////////////////////////////////////////
@@ -364,7 +516,7 @@ draw_gradient (cairo_t* cr,
90.0f * G_PI / 180.0f,
270.0f * G_PI / 180.0f);
cairo_close_path (cr);
-
+
pattern = cairo_pattern_create_linear (x, y, x, y + 2.0f * r);
cairo_pattern_add_color_stop_rgba (pattern,
0.0f,
@@ -512,8 +664,7 @@ _mask_play (cairo_t* cr,
double x,
double y,
double tri_width,
- double tri_height
- /*double tri_offset*/)
+ double tri_height)
{
if (!cr)
return;
@@ -578,6 +729,28 @@ _finalize (cairo_t* cr,
}
static void
+_finalize_repaint (cairo_t* cr,
+ cairo_t** cr_surf,
+ cairo_surface_t** surf,
+ double x,
+ double y,
+ int repaints)
+{
+ if (!cr || !cr_surf || !surf)
+ return;
+
+ while (repaints > 0)
+ {
+ cairo_set_source_surface (cr, *surf, x, y);
+ cairo_paint (cr);
+ repaints--;
+ }
+
+ cairo_surface_destroy (*surf);
+ cairo_destroy (*cr_surf);
+}
+
+static void
_color_rgb_to_hls (gdouble *r,
gdouble *g,
gdouble *b)
@@ -654,7 +827,7 @@ _color_rgb_to_hls (gdouble *r,
static void
_color_hls_to_rgb (gdouble *h,
- gdouble *l,
+ gdouble *l,
gdouble *s)
{
gdouble hue;
@@ -995,177 +1168,380 @@ draw (GtkWidget* button, cairo_t *cr)
GtkStyle *style;
- CairoColorRGB bg_normal, fg_normal;
- CairoColorRGB color_inner[2], color_middle[2], color_outer[2], color_button[3], color_inner_compressed[2];
+ CairoColorRGB bg_color, fg_color, bg_selected, bg_prelight;
+ CairoColorRGB color_middle[2], color_middle_prelight[2], color_outer[2], color_outer_prelight[2],
+ color_play_outer[2], color_play_outer_prelight[2],
+ color_button[4], color_button_shadow, color_inner[2], color_inner_compressed[2];
style = gtk_widget_get_style (button);
- bg_normal.r = style->bg[0].red/65535.0;
- bg_normal.g = style->bg[0].green/65535.0;
- bg_normal.b = style->bg[0].blue/65535.0;
-
- fg_normal.r = style->fg[0].red/65535.0;
- fg_normal.g = style->fg[0].green/65535.0;
- fg_normal.b = style->fg[0].blue/65535.0;
-
- _color_shade (&bg_normal, INNER_START_SHADE, &color_inner[0]);
- _color_shade (&bg_normal, INNER_END_SHADE, &color_inner[1]);
- _color_shade (&bg_normal, MIDDLE_START_SHADE, &color_middle[0]);
- _color_shade (&bg_normal, MIDDLE_END_SHADE, &color_middle[1]);
- _color_shade (&bg_normal, OUTER_START_SHADE, &color_outer[0]);
- _color_shade (&bg_normal, OUTER_END_SHADE, &color_outer[1]);
- _color_shade (&fg_normal, BUTTON_START_SHADE, &color_button[0]);
- _color_shade (&fg_normal, BUTTON_END_SHADE, &color_button[1]);
- _color_shade (&bg_normal, BUTTON_SHADOW_SHADE, &color_button[2]);
- _color_shade (&bg_normal, INNER_COMPRESSED_START_SHADE, &color_inner_compressed[0]);
- _color_shade (&bg_normal, INNER_COMPRESSED_END_SHADE, &color_inner_compressed[1]);
-
- double MIDDLE_END[] = {color_middle[0].r, color_middle[0].g, color_middle[0].b, 1.0f};
+ bg_color.r = style->bg[0].red/65535.0;
+ bg_color.g = style->bg[0].green/65535.0;
+ bg_color.b = style->bg[0].blue/65535.0;
+
+ bg_prelight.r = style->bg[GTK_STATE_PRELIGHT].red/65535.0;
+ bg_prelight.g = style->bg[GTK_STATE_PRELIGHT].green/65535.0;
+ bg_prelight.b = style->bg[GTK_STATE_PRELIGHT].blue/65535.0;
+
+ bg_selected.r = style->bg[GTK_STATE_SELECTED].red/65535.0;
+ bg_selected.g = style->bg[GTK_STATE_SELECTED].green/65535.0;
+ bg_selected.b = style->bg[GTK_STATE_SELECTED].blue/65535.0;
+
+ fg_color.r = style->fg[0].red/65535.0;
+ fg_color.g = style->fg[0].green/65535.0;
+ fg_color.b = style->fg[0].blue/65535.0;
+
+ _color_shade (&bg_color, MIDDLE_START_SHADE, &color_middle[0]);
+ _color_shade (&bg_color, MIDDLE_END_SHADE, &color_middle[1]);
+ _color_shade (&bg_prelight, MIDDLE_START_SHADE, &color_middle_prelight[0]);
+ _color_shade (&bg_prelight, MIDDLE_END_SHADE, &color_middle_prelight[1]);
+ _color_shade (&bg_color, OUTER_START_SHADE, &color_outer[0]);
+ _color_shade (&bg_color, OUTER_END_SHADE, &color_outer[1]);
+ _color_shade (&bg_prelight, OUTER_START_SHADE, &color_outer_prelight[0]);
+ _color_shade (&bg_prelight, OUTER_END_SHADE, &color_outer_prelight[1]);
+ _color_shade (&bg_color, OUTER_PLAY_START_SHADE, &color_play_outer[0]);
+ _color_shade (&bg_color, OUTER_PLAY_END_SHADE, &color_play_outer[1]);
+ _color_shade (&bg_prelight, OUTER_PLAY_START_SHADE, &color_play_outer_prelight[0]);
+ _color_shade (&bg_prelight, OUTER_PLAY_END_SHADE, &color_play_outer_prelight[1]);
+ _color_shade (&bg_color, INNER_START_SHADE, &color_inner[0]);
+ _color_shade (&bg_color, INNER_END_SHADE, &color_inner[1]);
+ _color_shade (&fg_color, BUTTON_START_SHADE, &color_button[0]);
+ _color_shade (&fg_color, BUTTON_END_SHADE, &color_button[1]);
+ _color_shade (&bg_color, BUTTON_SHADOW_SHADE, &color_button[2]);
+ _color_shade (&bg_color, SHADOW_BUTTON_SHADE, &color_button_shadow);
+ _color_shade (&bg_selected, 1.0, &color_button[3]);
+ _color_shade (&bg_color, INNER_COMPRESSED_START_SHADE, &color_inner_compressed[0]);
+ _color_shade (&bg_color, INNER_COMPRESSED_END_SHADE, &color_inner_compressed[1]);
+
+ double MIDDLE_END[] = {color_middle[0].r, color_middle[0].g, color_middle[0].b, 1.0f};
double MIDDLE_START[] = {color_middle[1].r, color_middle[1].g, color_middle[1].b, 1.0f};
- double OUTER_END[] = {color_outer[0].r, color_outer[0].g, color_outer[0].b, 1.0f};
+ double MIDDLE_END_PRELIGHT[] = {color_middle_prelight[0].r, color_middle_prelight[0].g, color_middle_prelight[0].b, 1.0f};
+ double MIDDLE_START_PRELIGHT[] = {color_middle_prelight[1].r, color_middle_prelight[1].g, color_middle_prelight[1].b, 1.0f};
+ double OUTER_END[] = {color_outer[0].r, color_outer[0].g, color_outer[0].b, 1.0f};
double OUTER_START[] = {color_outer[1].r, color_outer[1].g, color_outer[1].b, 1.0f};
+ double OUTER_END_PRELIGHT[] = {color_outer_prelight[0].r, color_outer_prelight[0].g, color_outer_prelight[0].b, 1.0f};
+ double OUTER_START_PRELIGHT[] = {color_outer_prelight[1].r, color_outer_prelight[1].g, color_outer_prelight[1].b, 1.0f};
+ double SHADOW_BUTTON[] = {color_button_shadow.r, color_button_shadow.g, color_button_shadow.b, 0.3f};
+ double OUTER_PLAY_END[] = {color_play_outer[0].r, color_play_outer[0].g, color_play_outer[0].b, 1.0f};
+ double OUTER_PLAY_START[] = {color_play_outer[1].r, color_play_outer[1].g, color_play_outer[1].b, 1.0f};
+ double OUTER_PLAY_END_PRELIGHT[] = {color_play_outer_prelight[0].r, color_play_outer_prelight[0].g, color_play_outer_prelight[0].b, 1.0f};
+ double OUTER_PLAY_START_PRELIGHT[] = {color_play_outer_prelight[1].r, color_play_outer_prelight[1].g, color_play_outer_prelight[1].b, 1.0f};
double BUTTON_END[] = {color_button[0].r, color_button[0].g, color_button[0].b, 1.0f};
double BUTTON_START[] = {color_button[1].r, color_button[1].g, color_button[1].b, 1.0f};
double BUTTON_SHADOW[] = {color_button[2].r, color_button[2].g, color_button[2].b, 0.75f};
+ double BUTTON_SHADOW_FOCUS[] = {color_button[3].r, color_button[3].g, color_button[3].b, 1.0f};
double INNER_COMPRESSED_END[] = {color_inner_compressed[1].r, color_inner_compressed[1].g, color_inner_compressed[1].b, 1.0f};
double INNER_COMPRESSED_START[] = {color_inner_compressed[0].r, color_inner_compressed[0].g, color_inner_compressed[0].b, 1.0f};
-
- // prev/next-background
+
+
draw_gradient (cr,
- X,
- Y,
- RECT_WIDTH,
- OUTER_RADIUS,
- OUTER_START,
- OUTER_END);
+ X,
+ Y,
+ RECT_WIDTH,
+ OUTER_RADIUS,
+ OUTER_START,
+ OUTER_END);
+
draw_gradient (cr,
- X,
- Y + 1,
- RECT_WIDTH - 2,
- MIDDLE_RADIUS,
- MIDDLE_START,
- MIDDLE_END);
+ X,
+ Y + 1,
+ RECT_WIDTH - 2,
+ MIDDLE_RADIUS,
+ MIDDLE_START,
+ MIDDLE_END);
+
draw_gradient (cr,
- X,
- Y + 2,
- RECT_WIDTH - 4,
- MIDDLE_RADIUS,
- MIDDLE_START,
- MIDDLE_END);
-
- if(priv->current_command == TRANSPORT_PREVIOUS){
+ X,
+ Y + 2,
+ RECT_WIDTH - 4,
+ MIDDLE_RADIUS,
+ MIDDLE_START,
+ MIDDLE_END);
+
+ //prev/next button
+ if(priv->current_command == TRANSPORT_PREVIOUS)
+ {
+ draw_gradient (cr,
+ X,
+ Y,
+ RECT_WIDTH/2,
+ OUTER_RADIUS,
+ OUTER_END,
+ OUTER_START);
+
+ draw_gradient (cr,
+ X,
+ Y + 1,
+ RECT_WIDTH/2,
+ MIDDLE_RADIUS,
+ INNER_COMPRESSED_START,
+ INNER_COMPRESSED_END);
+
draw_gradient (cr,
X,
Y + 2,
RECT_WIDTH/2,
- INNER_RADIUS,
+ MIDDLE_RADIUS,
INNER_COMPRESSED_START,
INNER_COMPRESSED_END);
- }
- else if(priv->current_command == TRANSPORT_NEXT){
+ }
+ else if(priv->current_command == TRANSPORT_NEXT)
+ {
+ draw_gradient (cr,
+ RECT_WIDTH / 2 + X,
+ Y,
+ RECT_WIDTH/2,
+ OUTER_RADIUS,
+ OUTER_END,
+ OUTER_START);
+
+ draw_gradient (cr,
+ RECT_WIDTH / 2 + X,
+ Y + 1,
+ (RECT_WIDTH - 7)/2,
+ MIDDLE_RADIUS,
+ INNER_COMPRESSED_START,
+ INNER_COMPRESSED_END);
+
draw_gradient (cr,
RECT_WIDTH / 2 + X,
Y + 2,
(RECT_WIDTH - 7)/2,
- INNER_RADIUS,
+ MIDDLE_RADIUS,
INNER_COMPRESSED_START,
- INNER_COMPRESSED_END);
+ INNER_COMPRESSED_END);
}
+ else if (priv->motion_event == TRANSPORT_PREVIOUS)
+ {
+ draw_gradient (cr,
+ X,
+ Y,
+ RECT_WIDTH/2,
+ OUTER_RADIUS,
+ OUTER_START_PRELIGHT,
+ OUTER_END_PRELIGHT);
+
+ draw_gradient (cr,
+ X,
+ Y + 1,
+ RECT_WIDTH/2,
+ MIDDLE_RADIUS,
+ MIDDLE_START_PRELIGHT,
+ MIDDLE_END_PRELIGHT);
- // play/pause-background
- draw_circle (cr,
- X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f,
- Y - ((CIRCLE_RADIUS - OUTER_RADIUS)),
- CIRCLE_RADIUS,
- OUTER_START,
- OUTER_END);
- draw_circle (cr,
- X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 0.5f,
- Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 0.5f,
- CIRCLE_RADIUS - 0.75f,
- MIDDLE_START,
- MIDDLE_END);
+ draw_gradient (cr,
+ X,
+ Y + 2,
+ RECT_WIDTH/2,
+ MIDDLE_RADIUS,
+ MIDDLE_START_PRELIGHT,
+ MIDDLE_END_PRELIGHT);
+ }
+ else if (priv->motion_event == TRANSPORT_NEXT)
+ {
+ draw_gradient (cr,
+ RECT_WIDTH / 2 + X,
+ Y,
+ RECT_WIDTH/2,
+ OUTER_RADIUS,
+ OUTER_START_PRELIGHT,
+ OUTER_END_PRELIGHT);
- if(priv->current_command == TRANSPORT_PLAY_PAUSE){
- draw_circle (cr,
- X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 1.5f,
- Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 1.5f,
- CIRCLE_RADIUS - 1.5f,
- INNER_COMPRESSED_START,
- INNER_COMPRESSED_END);
+ draw_gradient (cr,
+ RECT_WIDTH / 2 + X,
+ Y + 1,
+ (RECT_WIDTH - 7)/2,
+ MIDDLE_RADIUS,
+ MIDDLE_START_PRELIGHT,
+ MIDDLE_END_PRELIGHT);
+
+ draw_gradient (cr,
+ RECT_WIDTH / 2 + X,
+ Y + 2,
+ (RECT_WIDTH - 7)/2,
+ MIDDLE_RADIUS,
+ MIDDLE_START_PRELIGHT,
+ MIDDLE_END_PRELIGHT);
}
- else{
+
+ // play/pause shadow
+ if(priv->current_command != TRANSPORT_PLAY_PAUSE)
+ {
+ cairo_save (cr);
+ cairo_rectangle (cr, X, Y, RECT_WIDTH, MIDDLE_RADIUS*2);
+ cairo_clip (cr);
+
+ draw_circle (cr,
+ X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f - 1.0f,
+ Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) - 1.0f,
+ CIRCLE_RADIUS + 1.0f,
+ SHADOW_BUTTON,
+ SHADOW_BUTTON);
+
+ cairo_restore (cr);
+ }
+
+ // play/pause button
+ if(priv->current_command == TRANSPORT_PLAY_PAUSE)
+ {
+ draw_circle (cr,
+ X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f,
+ Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) ,
+ CIRCLE_RADIUS,
+ OUTER_PLAY_END,
+ OUTER_PLAY_START);
+
draw_circle (cr,
- X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 1.5f,
- Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 1.5f,
- CIRCLE_RADIUS - 1.5f,
- MIDDLE_START,
- MIDDLE_END);
- }
+ X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 1.25f,
+ Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 1.25f,
+ CIRCLE_RADIUS - 1.25,
+ INNER_COMPRESSED_START,
+ INNER_COMPRESSED_END);
+ }
+ else if (priv->motion_event == TRANSPORT_PLAY_PAUSE)
+ {
+ /* this subtle offset is to fix alpha borders, should be removed once this draw routine will be refactored */
+ draw_circle (cr,
+ X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 0.1,
+ Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 0.1,
+ CIRCLE_RADIUS - 0.1,
+ OUTER_PLAY_START_PRELIGHT,
+ OUTER_PLAY_END_PRELIGHT);
+
+ draw_circle (cr,
+ X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 1.25f,
+ Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 1.25f,
+ CIRCLE_RADIUS - 1.25,
+ MIDDLE_START_PRELIGHT,
+ MIDDLE_END_PRELIGHT);
+ }
+ else
+ {
+ draw_circle (cr,
+ X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f,
+ Y - ((CIRCLE_RADIUS - OUTER_RADIUS)),
+ CIRCLE_RADIUS,
+ OUTER_PLAY_START,
+ OUTER_PLAY_END);
+
+ draw_circle (cr,
+ X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 1.25f,
+ Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 1.25f,
+ CIRCLE_RADIUS - 1.25,
+ MIDDLE_START,
+ MIDDLE_END);
+ }
+
// draw previous-button drop-shadow
- _setup (&cr_surf, &surf, PREV_WIDTH, PREV_HEIGHT);
- _mask_prev (cr_surf,
- (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
- TRI_WIDTH,
- TRI_HEIGHT,
- TRI_OFFSET);
- _fill (cr_surf,
- (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
- (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (double) TRI_HEIGHT,
- BUTTON_SHADOW,
- BUTTON_SHADOW,
- FALSE);
- _surface_blur (surf, 1);
- _finalize (cr, &cr_surf, &surf, PREV_X, PREV_Y + 1.0f);
+ if (priv->has_focus && priv->key_event == TRANSPORT_PREVIOUS)
+ {
+ _setup (&cr_surf, &surf, PREV_WIDTH+6, PREV_HEIGHT+6);
+ _mask_prev (cr_surf,
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
+ TRI_WIDTH,
+ TRI_HEIGHT,
+ TRI_OFFSET);
+ _fill (cr_surf,
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (double) TRI_HEIGHT,
+ BUTTON_SHADOW_FOCUS,
+ BUTTON_SHADOW_FOCUS,
+ FALSE);
+ _surface_blur (surf, 3);
+ _finalize_repaint (cr, &cr_surf, &surf, PREV_X, PREV_Y + 0.5f, 3);
+ }
+ else
+ {
+ _setup (&cr_surf, &surf, PREV_WIDTH, PREV_HEIGHT);
+ _mask_prev (cr_surf,
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
+ TRI_WIDTH,
+ TRI_HEIGHT,
+ TRI_OFFSET);
+ _fill (cr_surf,
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (double) TRI_HEIGHT,
+ BUTTON_SHADOW,
+ BUTTON_SHADOW,
+ FALSE);
+ _surface_blur (surf, 1);
+ _finalize (cr, &cr_surf, &surf, PREV_X, PREV_Y + 1.0f);
+ }
// draw previous-button
_setup (&cr_surf, &surf, PREV_WIDTH, PREV_HEIGHT);
_mask_prev (cr_surf,
- (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
- TRI_WIDTH,
- TRI_HEIGHT,
- TRI_OFFSET);
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
+ TRI_WIDTH,
+ TRI_HEIGHT,
+ TRI_OFFSET);
_fill (cr_surf,
- (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
- (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (double) TRI_HEIGHT,
- BUTTON_START,
- BUTTON_END,
- FALSE);
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (PREV_HEIGHT - TRI_HEIGHT) / 2.0f,
+ (PREV_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (double) TRI_HEIGHT,
+ BUTTON_START,
+ BUTTON_END,
+ FALSE);
_finalize (cr, &cr_surf, &surf, PREV_X, PREV_Y);
// draw next-button drop-shadow
- _setup (&cr_surf, &surf, NEXT_WIDTH, NEXT_HEIGHT);
- _mask_next (cr_surf,
- (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
- TRI_WIDTH,
- TRI_HEIGHT,
- TRI_OFFSET);
- _fill (cr_surf,
- (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
- (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (double) TRI_HEIGHT,
- BUTTON_SHADOW,
- BUTTON_SHADOW,
- FALSE);
- _surface_blur (surf, 1);
- _finalize (cr, &cr_surf, &surf, NEXT_X, NEXT_Y + 1.0f);
+ if (priv->has_focus && priv->key_event == TRANSPORT_NEXT)
+ {
+ _setup (&cr_surf, &surf, NEXT_WIDTH+6, NEXT_HEIGHT+6);
+ _mask_next (cr_surf,
+ (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
+ TRI_WIDTH,
+ TRI_HEIGHT,
+ TRI_OFFSET);
+ _fill (cr_surf,
+ (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
+ (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (double) TRI_HEIGHT,
+ BUTTON_SHADOW_FOCUS,
+ BUTTON_SHADOW_FOCUS,
+ FALSE);
+ _surface_blur (surf, 3);
+ _finalize_repaint (cr, &cr_surf, &surf, NEXT_X, NEXT_Y + 0.5f, 3);
+ }
+ else
+ {
+ _setup (&cr_surf, &surf, NEXT_WIDTH, NEXT_HEIGHT);
+ _mask_next (cr_surf,
+ (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
+ TRI_WIDTH,
+ TRI_HEIGHT,
+ TRI_OFFSET);
+ _fill (cr_surf,
+ (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
+ (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (double) TRI_HEIGHT,
+ BUTTON_SHADOW,
+ BUTTON_SHADOW,
+ FALSE);
+ _surface_blur (surf, 1);
+ _finalize (cr, &cr_surf, &surf, NEXT_X, NEXT_Y + 1.0f);
+ }
// draw next-button
_setup (&cr_surf, &surf, NEXT_WIDTH, NEXT_HEIGHT);
_mask_next (cr_surf,
- (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
- (NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
- TRI_WIDTH,
- TRI_HEIGHT,
- TRI_OFFSET);
+ (NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
+ (NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
+ TRI_WIDTH,
+ TRI_HEIGHT,
+ TRI_OFFSET);
_fill (cr_surf,
(NEXT_WIDTH - (2.0f * TRI_WIDTH - TRI_OFFSET)) / 2.0f,
(NEXT_HEIGHT - TRI_HEIGHT) / 2.0f,
@@ -1177,60 +1553,108 @@ draw (GtkWidget* button, cairo_t *cr)
_finalize (cr, &cr_surf, &surf, NEXT_X, NEXT_Y);
// draw pause-button drop-shadow
- if(priv->current_state == PLAY){
- _setup (&cr_surf, &surf, PAUSE_WIDTH, PAUSE_HEIGHT);
- _mask_pause (cr_surf,
- (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
- (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
- BAR_WIDTH,
- BAR_HEIGHT - 2.0f * BAR_WIDTH,
- BAR_OFFSET);
- _fill (cr_surf,
- (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
- (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
- (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
- (double) BAR_HEIGHT,
- BUTTON_SHADOW,
- BUTTON_SHADOW,
- TRUE);
- _surface_blur (surf, 1);
- _finalize (cr, &cr_surf, &surf, PAUSE_X, PAUSE_Y + 1.0f);
+ if(priv->current_state == PLAY)
+ {
+ if (priv->has_focus && (priv->key_event == TRANSPORT_NADA || priv->key_event == TRANSPORT_PLAY_PAUSE))
+ {
+ _setup (&cr_surf, &surf, PAUSE_WIDTH+6, PAUSE_HEIGHT+6);
+ _mask_pause (cr_surf,
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
+ BAR_WIDTH,
+ BAR_HEIGHT - 2.0f * BAR_WIDTH,
+ BAR_OFFSET);
+ _fill (cr_surf,
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (double) BAR_HEIGHT,
+ BUTTON_SHADOW_FOCUS,
+ BUTTON_SHADOW_FOCUS,
+ TRUE);
+ _surface_blur (surf, 3);
+ _finalize_repaint (cr, &cr_surf, &surf, PAUSE_X, PAUSE_Y + 0.5f, 3);
+ }
+ else
+ {
+ _setup (&cr_surf, &surf, PAUSE_WIDTH, PAUSE_HEIGHT);
+ _mask_pause (cr_surf,
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
+ BAR_WIDTH,
+ BAR_HEIGHT - 2.0f * BAR_WIDTH,
+ BAR_OFFSET);
+ _fill (cr_surf,
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (double) BAR_HEIGHT,
+ BUTTON_SHADOW,
+ BUTTON_SHADOW,
+ TRUE);
+ _surface_blur (surf, 1);
+ _finalize (cr, &cr_surf, &surf, PAUSE_X, PAUSE_Y + 1.0f);
+ }
// draw pause-button
_setup (&cr_surf, &surf, PAUSE_WIDTH, PAUSE_HEIGHT);
_mask_pause (cr_surf,
- (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
- (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
- BAR_WIDTH,
- BAR_HEIGHT - 2.0f * BAR_WIDTH,
- BAR_OFFSET);
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
+ BAR_WIDTH,
+ BAR_HEIGHT - 2.0f * BAR_WIDTH,
+ BAR_OFFSET);
_fill (cr_surf,
- (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
- (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
- (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
- (double) BAR_HEIGHT,
- BUTTON_START,
- BUTTON_END,
- TRUE);
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (PAUSE_HEIGHT - BAR_HEIGHT) / 2.0f,
+ (PAUSE_WIDTH - (2.0f * BAR_WIDTH + BAR_OFFSET)) / 2.0f,
+ (double) BAR_HEIGHT,
+ BUTTON_START,
+ BUTTON_END,
+ TRUE);
_finalize (cr, &cr_surf, &surf, PAUSE_X, PAUSE_Y);
}
- else if(priv->current_state == PAUSE){
- _setup (&cr_surf, &surf, PLAY_WIDTH, PLAY_HEIGHT);
- _mask_play (cr_surf,
- PLAY_PADDING,
- PLAY_PADDING,
- PLAY_WIDTH - (2*PLAY_PADDING),
- PLAY_HEIGHT - (2*PLAY_PADDING));
- _fill (cr_surf,
- PLAY_PADDING,
- PLAY_PADDING,
- PLAY_WIDTH - (2*PLAY_PADDING),
- PLAY_HEIGHT - (2*PLAY_PADDING),
- BUTTON_SHADOW,
- BUTTON_SHADOW,
- FALSE);
- _surface_blur (surf, 1);
- _finalize (cr, &cr_surf, &surf, PAUSE_X-0.75f, PAUSE_Y + 1.0f);
+ else if(priv->current_state == PAUSE)
+ {
+ if (priv->has_focus && (priv->key_event == TRANSPORT_NADA || priv->key_event == TRANSPORT_PLAY_PAUSE))
+ {
+ _setup (&cr_surf, &surf, PLAY_WIDTH+6, PLAY_HEIGHT+6);
+ _mask_play (cr_surf,
+ PLAY_PADDING,
+ PLAY_PADDING,
+ PLAY_WIDTH - (2*PLAY_PADDING),
+ PLAY_HEIGHT - (2*PLAY_PADDING));
+ _fill (cr_surf,
+ PLAY_PADDING,
+ PLAY_PADDING,
+ PLAY_WIDTH - (2*PLAY_PADDING),
+ PLAY_HEIGHT - (2*PLAY_PADDING),
+ BUTTON_SHADOW_FOCUS,
+ BUTTON_SHADOW_FOCUS,
+ FALSE);
+ _surface_blur (surf, 3);
+ _finalize_repaint (cr, &cr_surf, &surf, PAUSE_X-0.5f, PAUSE_Y + 0.5f, 3);
+ }
+ else
+ {
+ _setup (&cr_surf, &surf, PLAY_WIDTH, PLAY_HEIGHT);
+ _mask_play (cr_surf,
+ PLAY_PADDING,
+ PLAY_PADDING,
+ PLAY_WIDTH - (2*PLAY_PADDING),
+ PLAY_HEIGHT - (2*PLAY_PADDING));
+ _fill (cr_surf,
+ PLAY_PADDING,
+ PLAY_PADDING,
+ PLAY_WIDTH - (2*PLAY_PADDING),
+ PLAY_HEIGHT - (2*PLAY_PADDING),
+ BUTTON_SHADOW,
+ BUTTON_SHADOW,
+ FALSE);
+ _surface_blur (surf, 1);
+ _finalize (cr, &cr_surf, &surf, PAUSE_X-0.75f, PAUSE_Y + 1.0f);
+ }
+
// draw play-button
_setup (&cr_surf, &surf, PLAY_WIDTH, PLAY_HEIGHT);
cairo_set_line_width (cr, 10.5);
@@ -1240,15 +1664,15 @@ draw (GtkWidget* button, cairo_t *cr)
PLAY_PADDING,
PLAY_PADDING,
PLAY_WIDTH - (2*PLAY_PADDING),
- PLAY_HEIGHT - (2*PLAY_PADDING));
+ PLAY_HEIGHT - (2*PLAY_PADDING));
_fill (cr_surf,
PLAY_PADDING,
PLAY_PADDING,
PLAY_WIDTH - (2*PLAY_PADDING),
PLAY_HEIGHT - (2*PLAY_PADDING),
- BUTTON_START,
- BUTTON_END,
- FALSE);
+ BUTTON_START,
+ BUTTON_END,
+ FALSE);
_finalize (cr, &cr_surf, &surf, PAUSE_X-0.5f, PAUSE_Y);
}
}
@@ -1271,7 +1695,7 @@ transport_widget_set_twin_item(TransportWidget* self,
/**
* transport_widget_update_state()
* Callback for updates from the other side of dbus
-**/
+**/
static void
transport_widget_property_update(DbusmenuMenuitem* item, gchar* property,
GValue* value, gpointer userdata)
diff --git a/src/transport-widget.h b/src/transport-widget.h
index 6ccce05..70ce6aa 100644
--- a/src/transport-widget.h
+++ b/src/transport-widget.h
@@ -66,7 +66,11 @@ typedef struct
void _color_shade (const CairoColorRGB *a, float k, CairoColorRGB *b);
GType transport_widget_get_type (void);
GtkWidget* transport_widget_new ( DbusmenuMenuitem *item );
-
+void transport_widget_react_to_key_press_event ( TransportWidget* widget,
+ TransportWidgetEvent transport_event );
+void transport_widget_react_to_key_release_event ( TransportWidget* widget,
+ TransportWidgetEvent transport_event );
+gboolean transport_widget_is_selected ( TransportWidget* widget );
G_END_DECLS
#endif