1
/* filter-parser-genre.c generated by valac 0.16.1, the Vala compiler
2
* generated from filter-parser-genre.vala, do not modify */
5
* Copyright (C) 2011 Canonical Ltd
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License version 3 as
9
* published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
* Authored by Alex Launi <alex.launi@canonical.com>
24
#include <glib-object.h>
30
#define UNITY_MUSIC_LENS_TYPE_FILTER_PARSER (unity_music_lens_filter_parser_get_type ())
31
#define UNITY_MUSIC_LENS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParser))
32
#define UNITY_MUSIC_LENS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
33
#define UNITY_MUSIC_LENS_IS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
34
#define UNITY_MUSIC_LENS_IS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
35
#define UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
37
typedef struct _UnityMusicLensFilterParser UnityMusicLensFilterParser;
38
typedef struct _UnityMusicLensFilterParserClass UnityMusicLensFilterParserClass;
39
typedef struct _UnityMusicLensFilterParserPrivate UnityMusicLensFilterParserPrivate;
41
#define UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER (unity_music_lens_genre_filter_parser_get_type ())
42
#define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParser))
43
#define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserClass))
44
#define UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER))
45
#define UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER))
46
#define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserClass))
48
typedef struct _UnityMusicLensGenreFilterParser UnityMusicLensGenreFilterParser;
49
typedef struct _UnityMusicLensGenreFilterParserClass UnityMusicLensGenreFilterParserClass;
50
typedef struct _UnityMusicLensGenreFilterParserPrivate UnityMusicLensGenreFilterParserPrivate;
52
#define UNITY_MUSIC_LENS_TYPE_GENRE (unity_music_lens_genre_get_type ())
53
#define UNITY_MUSIC_LENS_GENRE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenre))
54
#define UNITY_MUSIC_LENS_GENRE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenreClass))
55
#define UNITY_MUSIC_LENS_IS_GENRE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_GENRE))
56
#define UNITY_MUSIC_LENS_IS_GENRE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_GENRE))
57
#define UNITY_MUSIC_LENS_GENRE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_GENRE, UnityMusicLensGenreClass))
59
typedef struct _UnityMusicLensGenre UnityMusicLensGenre;
60
typedef struct _UnityMusicLensGenreClass UnityMusicLensGenreClass;
61
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
62
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
64
struct _UnityMusicLensFilterParser {
65
GObject parent_instance;
66
UnityMusicLensFilterParserPrivate * priv;
69
struct _UnityMusicLensFilterParserClass {
70
GObjectClass parent_class;
71
gchar* (*parse) (UnityMusicLensFilterParser* self);
72
const gchar* (*get_id) (UnityMusicLensFilterParser* self);
75
struct _UnityMusicLensGenreFilterParser {
76
UnityMusicLensFilterParser parent_instance;
77
UnityMusicLensGenreFilterParserPrivate * priv;
80
struct _UnityMusicLensGenreFilterParserClass {
81
UnityMusicLensFilterParserClass parent_class;
84
struct _UnityMusicLensGenreFilterParserPrivate {
85
UnityMusicLensGenre* _map;
89
static gpointer unity_music_lens_genre_filter_parser_parent_class = NULL;
91
GType unity_music_lens_filter_parser_get_type (void) G_GNUC_CONST;
92
GType unity_music_lens_genre_filter_parser_get_type (void) G_GNUC_CONST;
93
GType unity_music_lens_genre_get_type (void) G_GNUC_CONST;
94
#define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserPrivate))
96
UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_DUMMY_PROPERTY,
97
UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_ID,
98
UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_MAP
100
UnityMusicLensGenreFilterParser* unity_music_lens_genre_filter_parser_new (UnityCheckOptionFilterCompact* filter);
101
UnityMusicLensGenreFilterParser* unity_music_lens_genre_filter_parser_construct (GType object_type, UnityCheckOptionFilterCompact* filter);
102
UnityMusicLensFilterParser* unity_music_lens_filter_parser_construct (GType object_type, UnityFilter* filter);
103
UnityMusicLensGenre* unity_music_lens_genre_new (void);
104
UnityMusicLensGenre* unity_music_lens_genre_construct (GType object_type);
105
static void unity_music_lens_genre_filter_parser_set_map (UnityMusicLensGenreFilterParser* self, UnityMusicLensGenre* value);
106
static gchar* unity_music_lens_genre_filter_parser_real_parse (UnityMusicLensFilterParser* base);
107
GList* unity_music_lens_genre_filter_parser_get_all_selected_genres (UnityMusicLensGenreFilterParser* self);
108
UnityFilter* unity_music_lens_filter_parser_get_filter (UnityMusicLensFilterParser* self);
109
static void _g_object_unref0_ (gpointer var);
110
static void _g_list_free__g_object_unref0_ (GList* self);
111
UnityMusicLensGenre* unity_music_lens_genre_filter_parser_get_map (UnityMusicLensGenreFilterParser* self);
112
static void unity_music_lens_genre_filter_parser_finalize (GObject* obj);
113
const gchar* unity_music_lens_filter_parser_get_id (UnityMusicLensFilterParser* self);
114
static void _vala_unity_music_lens_genre_filter_parser_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
115
static void _vala_unity_music_lens_genre_filter_parser_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
118
UnityMusicLensGenreFilterParser* unity_music_lens_genre_filter_parser_construct (GType object_type, UnityCheckOptionFilterCompact* filter) {
119
UnityMusicLensGenreFilterParser * self = NULL;
120
UnityCheckOptionFilterCompact* _tmp0_;
121
UnityMusicLensGenre* _tmp1_;
122
UnityMusicLensGenre* _tmp2_;
123
g_return_val_if_fail (filter != NULL, NULL);
125
self = (UnityMusicLensGenreFilterParser*) unity_music_lens_filter_parser_construct (object_type, (UnityFilter*) _tmp0_);
126
_tmp1_ = unity_music_lens_genre_new ();
128
unity_music_lens_genre_filter_parser_set_map (self, _tmp2_);
129
_g_object_unref0 (_tmp2_);
134
UnityMusicLensGenreFilterParser* unity_music_lens_genre_filter_parser_new (UnityCheckOptionFilterCompact* filter) {
135
return unity_music_lens_genre_filter_parser_construct (UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, filter);
139
static gchar* unity_music_lens_genre_filter_parser_real_parse (UnityMusicLensFilterParser* base) {
140
UnityMusicLensGenreFilterParser * self;
141
gchar* result = NULL;
143
self = (UnityMusicLensGenreFilterParser*) base;
144
_tmp0_ = g_strdup ("");
150
static gpointer _g_object_ref0 (gpointer self) {
151
return self ? g_object_ref (self) : NULL;
155
static void _g_object_unref0_ (gpointer var) {
156
(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
160
static void _g_list_free__g_object_unref0_ (GList* self) {
161
g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
166
GList* unity_music_lens_genre_filter_parser_get_all_selected_genres (UnityMusicLensGenreFilterParser* self) {
167
GList* result = NULL;
174
g_return_val_if_fail (self != NULL, NULL);
175
_tmp0_ = unity_music_lens_filter_parser_get_filter ((UnityMusicLensFilterParser*) self);
177
_tmp2_ = ((UnityOptionsFilter*) (UNITY_IS_CHECK_OPTION_FILTER_COMPACT (_tmp1_) ? ((UnityCheckOptionFilterCompact*) _tmp1_) : NULL))->options;
182
GList* option_collection = NULL;
183
GList* option_it = NULL;
184
option_collection = _tmp3_;
185
for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
186
UnityFilterOption* _tmp4_;
187
UnityFilterOption* option = NULL;
188
_tmp4_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
191
UnityFilterOption* _tmp5_;
195
_tmp6_ = unity_filter_option_get_active (_tmp5_);
198
UnityFilterOption* _tmp8_;
199
UnityFilterOption* _tmp9_;
201
_tmp9_ = _g_object_ref0 (_tmp8_);
202
active = g_list_append (active, _tmp9_);
204
_g_object_unref0 (option);
213
static const gchar* unity_music_lens_genre_filter_parser_real_get_id (UnityMusicLensFilterParser* base) {
215
UnityMusicLensGenreFilterParser* self;
216
self = (UnityMusicLensGenreFilterParser*) base;
222
UnityMusicLensGenre* unity_music_lens_genre_filter_parser_get_map (UnityMusicLensGenreFilterParser* self) {
223
UnityMusicLensGenre* result;
224
UnityMusicLensGenre* _tmp0_;
225
g_return_val_if_fail (self != NULL, NULL);
226
_tmp0_ = self->priv->_map;
232
static void unity_music_lens_genre_filter_parser_set_map (UnityMusicLensGenreFilterParser* self, UnityMusicLensGenre* value) {
233
UnityMusicLensGenre* _tmp0_;
234
UnityMusicLensGenre* _tmp1_;
235
g_return_if_fail (self != NULL);
237
_tmp1_ = _g_object_ref0 (_tmp0_);
238
_g_object_unref0 (self->priv->_map);
239
self->priv->_map = _tmp1_;
240
g_object_notify ((GObject *) self, "map");
244
static void unity_music_lens_genre_filter_parser_class_init (UnityMusicLensGenreFilterParserClass * klass) {
245
unity_music_lens_genre_filter_parser_parent_class = g_type_class_peek_parent (klass);
246
g_type_class_add_private (klass, sizeof (UnityMusicLensGenreFilterParserPrivate));
247
UNITY_MUSIC_LENS_FILTER_PARSER_CLASS (klass)->parse = unity_music_lens_genre_filter_parser_real_parse;
248
UNITY_MUSIC_LENS_FILTER_PARSER_CLASS (klass)->get_id = unity_music_lens_genre_filter_parser_real_get_id;
249
G_OBJECT_CLASS (klass)->get_property = _vala_unity_music_lens_genre_filter_parser_get_property;
250
G_OBJECT_CLASS (klass)->set_property = _vala_unity_music_lens_genre_filter_parser_set_property;
251
G_OBJECT_CLASS (klass)->finalize = unity_music_lens_genre_filter_parser_finalize;
252
g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_ID, g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
253
g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_MAP, g_param_spec_object ("map", "map", "map", UNITY_MUSIC_LENS_TYPE_GENRE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
257
static void unity_music_lens_genre_filter_parser_instance_init (UnityMusicLensGenreFilterParser * self) {
258
self->priv = UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_GET_PRIVATE (self);
262
static void unity_music_lens_genre_filter_parser_finalize (GObject* obj) {
263
UnityMusicLensGenreFilterParser * self;
264
self = UNITY_MUSIC_LENS_GENRE_FILTER_PARSER (obj);
265
_g_object_unref0 (self->priv->_map);
266
G_OBJECT_CLASS (unity_music_lens_genre_filter_parser_parent_class)->finalize (obj);
270
GType unity_music_lens_genre_filter_parser_get_type (void) {
271
static volatile gsize unity_music_lens_genre_filter_parser_type_id__volatile = 0;
272
if (g_once_init_enter (&unity_music_lens_genre_filter_parser_type_id__volatile)) {
273
static const GTypeInfo g_define_type_info = { sizeof (UnityMusicLensGenreFilterParserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_lens_genre_filter_parser_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicLensGenreFilterParser), 0, (GInstanceInitFunc) unity_music_lens_genre_filter_parser_instance_init, NULL };
274
GType unity_music_lens_genre_filter_parser_type_id;
275
unity_music_lens_genre_filter_parser_type_id = g_type_register_static (UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, "UnityMusicLensGenreFilterParser", &g_define_type_info, 0);
276
g_once_init_leave (&unity_music_lens_genre_filter_parser_type_id__volatile, unity_music_lens_genre_filter_parser_type_id);
278
return unity_music_lens_genre_filter_parser_type_id__volatile;
282
static void _vala_unity_music_lens_genre_filter_parser_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
283
UnityMusicLensGenreFilterParser * self;
284
self = UNITY_MUSIC_LENS_GENRE_FILTER_PARSER (object);
285
switch (property_id) {
286
case UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_ID:
287
g_value_set_string (value, unity_music_lens_filter_parser_get_id ((UnityMusicLensFilterParser*) self));
289
case UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_MAP:
290
g_value_set_object (value, unity_music_lens_genre_filter_parser_get_map (self));
293
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
299
static void _vala_unity_music_lens_genre_filter_parser_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
300
UnityMusicLensGenreFilterParser * self;
301
self = UNITY_MUSIC_LENS_GENRE_FILTER_PARSER (object);
302
switch (property_id) {
303
case UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_MAP:
304
unity_music_lens_genre_filter_parser_set_map (self, g_value_get_object (value));
307
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);