diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2011-01-27 15:57:39 -0500 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2011-01-27 15:57:39 -0500 |
commit | 759793a2dda77abd227921e119bb329271c36a55 (patch) | |
tree | 248c4ba64e9464f58a64c22c69f24a294ff16a84 /src/player-controller.c | |
parent | 500000a82b6785e2bf7732ee87f36c6a44d2767c (diff) | |
parent | 6b2132fb4e700fe84a26adeac5126e8afbc507b3 (diff) | |
download | ayatana-indicator-sound-759793a2dda77abd227921e119bb329271c36a55.tar.gz ayatana-indicator-sound-759793a2dda77abd227921e119bb329271c36a55.tar.bz2 ayatana-indicator-sound-759793a2dda77abd227921e119bb329271c36a55.zip |
Import upstream version 0.5.7
Diffstat (limited to 'src/player-controller.c')
-rw-r--r-- | src/player-controller.c | 160 |
1 files changed, 1 insertions, 159 deletions
diff --git a/src/player-controller.c b/src/player-controller.c index c4583d9..2aa709f 100644 --- a/src/player-controller.c +++ b/src/player-controller.c @@ -1,4 +1,4 @@ -/* player-controller.c generated by valac 0.11.3, the Vala compiler +/* player-controller.c generated by valac 0.11.5, the Vala compiler * generated from player-controller.vala, do not modify */ /* @@ -226,16 +226,12 @@ GType transport_menuitem_get_type (void) G_GNUC_CONST; PlaylistsMenuitem* playlists_menuitem_new (PlayerController* parent); PlaylistsMenuitem* playlists_menuitem_construct (GType object_type, PlayerController* parent); gint player_controller_get_menu_offset (PlayerController* self); -static gchar* player_controller_format_player_name (gchar* app_info_name); gboolean mpris2_controller_connected (Mpris2Controller* self); void mpris2_controller_initial_update (Mpris2Controller* self); const gchar* player_controller_get_icon_name (PlayerController* self); static void player_controller_finalize (GObject* obj); 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) { @@ -616,130 +612,6 @@ static void player_controller_construct_widgets (PlayerController* self) { } -static gchar* string_strip (const gchar* self) { - gchar* result = NULL; - gchar* _tmp0_ = NULL; - gchar* _result_; - g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = g_strdup (self); - _result_ = _tmp0_; - g_strstrip (_result_); - result = _result_; - return result; -} - - -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 gchar* string_slice (const gchar* self, glong start, glong end) { - gchar* result = NULL; - gint _tmp0_; - glong string_length; - gboolean _tmp1_ = FALSE; - 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); - _tmp0_ = strlen (self); - string_length = (glong) _tmp0_; - if (start < 0) { - start = string_length + start; - } - if (end < 0) { - end = string_length + end; - } - if (start >= 0) { - _tmp1_ = start <= string_length; - } else { - _tmp1_ = FALSE; - } - g_return_val_if_fail (_tmp1_, NULL); - if (end >= 0) { - _tmp2_ = end <= string_length; - } else { - _tmp2_ = FALSE; - } - g_return_val_if_fail (_tmp2_, NULL); - g_return_val_if_fail (start <= end, NULL); - _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 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_; - gchar** _tmp6_; - gchar** tokens; - gint _tmp9_; - g_return_val_if_fail (app_info_name != NULL, NULL); - _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) { - gchar* _tmp7_; - gchar* _tmp8_; - _tmp7_ = g_strdup (tokens[0]); - _tmp8_ = _tmp7_; - _g_free0 (_result_); - _result_ = _tmp8_; - } - _tmp9_ = strlen (_result_); - if (_tmp9_ > 1) { - gchar* _tmp10_ = NULL; - gchar* _tmp11_; - gint _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, (glong) _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:202: PlayerController->format_player_name - : %" \ -"s", _result_); - result = _result_; - tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL); - _g_free0 (app_info_name); - return result; -} - - static void player_controller_determine_state (PlayerController* self) { gboolean _tmp0_; g_return_if_fail (self != NULL); @@ -926,34 +798,4 @@ static void _vala_player_controller_set_property (GObject * object, guint proper } -static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { - if ((array != NULL) && (destroy_func != NULL)) { - int i; - for (i = 0; i < array_length; i = i + 1) { - if (((gpointer*) array)[i] != NULL) { - destroy_func (((gpointer*) array)[i]); - } - } - } -} - - -static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { - _vala_array_destroy (array, array_length, destroy_func); - g_free (array); -} - - -static gint _vala_array_length (gpointer array) { - int length; - length = 0; - if (array) { - while (((gpointer*) array)[length]) { - length++; - } - } - return length; -} - - |