1
/* filter-parser.c generated by valac 0.16.1, the Vala compiler
2
* generated from filter-parser.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;
40
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
42
struct _UnityMusicLensFilterParser {
43
GObject parent_instance;
44
UnityMusicLensFilterParserPrivate * priv;
47
struct _UnityMusicLensFilterParserClass {
48
GObjectClass parent_class;
49
gchar* (*parse) (UnityMusicLensFilterParser* self);
50
const gchar* (*get_id) (UnityMusicLensFilterParser* self);
53
struct _UnityMusicLensFilterParserPrivate {
58
static gpointer unity_music_lens_filter_parser_parent_class = NULL;
60
GType unity_music_lens_filter_parser_get_type (void) G_GNUC_CONST;
61
#define UNITY_MUSIC_LENS_FILTER_PARSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserPrivate))
63
UNITY_MUSIC_LENS_FILTER_PARSER_DUMMY_PROPERTY,
64
UNITY_MUSIC_LENS_FILTER_PARSER_FILTER,
65
UNITY_MUSIC_LENS_FILTER_PARSER_ID
67
UnityMusicLensFilterParser* unity_music_lens_filter_parser_construct (GType object_type, UnityFilter* filter);
68
void unity_music_lens_filter_parser_set_filter (UnityMusicLensFilterParser* self, UnityFilter* value);
69
gchar* unity_music_lens_filter_parser_parse (UnityMusicLensFilterParser* self);
70
static gchar* unity_music_lens_filter_parser_real_parse (UnityMusicLensFilterParser* self);
71
UnityFilter* unity_music_lens_filter_parser_get_filter (UnityMusicLensFilterParser* self);
72
const gchar* unity_music_lens_filter_parser_get_id (UnityMusicLensFilterParser* self);
73
static void unity_music_lens_filter_parser_finalize (GObject* obj);
74
static void _vala_unity_music_lens_filter_parser_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
75
static void _vala_unity_music_lens_filter_parser_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
78
UnityMusicLensFilterParser* unity_music_lens_filter_parser_construct (GType object_type, UnityFilter* filter) {
79
UnityMusicLensFilterParser * self = NULL;
81
g_return_val_if_fail (filter != NULL, NULL);
82
self = (UnityMusicLensFilterParser*) g_object_new (object_type, NULL);
84
unity_music_lens_filter_parser_set_filter (self, _tmp0_);
89
static gchar* unity_music_lens_filter_parser_real_parse (UnityMusicLensFilterParser* self) {
90
g_critical ("Type `%s' does not implement abstract method `unity_music_lens_filter_parser_parse'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
95
gchar* unity_music_lens_filter_parser_parse (UnityMusicLensFilterParser* self) {
96
g_return_val_if_fail (self != NULL, NULL);
97
return UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS (self)->parse (self);
101
UnityFilter* unity_music_lens_filter_parser_get_filter (UnityMusicLensFilterParser* self) {
104
g_return_val_if_fail (self != NULL, NULL);
105
_tmp0_ = self->priv->_filter;
111
static gpointer _g_object_ref0 (gpointer self) {
112
return self ? g_object_ref (self) : NULL;
116
void unity_music_lens_filter_parser_set_filter (UnityMusicLensFilterParser* self, UnityFilter* value) {
119
g_return_if_fail (self != NULL);
121
_tmp1_ = _g_object_ref0 (_tmp0_);
122
_g_object_unref0 (self->priv->_filter);
123
self->priv->_filter = _tmp1_;
124
g_object_notify ((GObject *) self, "filter");
128
const gchar* unity_music_lens_filter_parser_get_id (UnityMusicLensFilterParser* self) {
129
g_return_val_if_fail (self != NULL, NULL);
130
return UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS (self)->get_id (self);
134
static void unity_music_lens_filter_parser_class_init (UnityMusicLensFilterParserClass * klass) {
135
unity_music_lens_filter_parser_parent_class = g_type_class_peek_parent (klass);
136
g_type_class_add_private (klass, sizeof (UnityMusicLensFilterParserPrivate));
137
UNITY_MUSIC_LENS_FILTER_PARSER_CLASS (klass)->parse = unity_music_lens_filter_parser_real_parse;
138
G_OBJECT_CLASS (klass)->get_property = _vala_unity_music_lens_filter_parser_get_property;
139
G_OBJECT_CLASS (klass)->set_property = _vala_unity_music_lens_filter_parser_set_property;
140
G_OBJECT_CLASS (klass)->finalize = unity_music_lens_filter_parser_finalize;
141
g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_FILTER_PARSER_FILTER, g_param_spec_object ("filter", "filter", "filter", UNITY_TYPE_FILTER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
142
g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_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));
146
static void unity_music_lens_filter_parser_instance_init (UnityMusicLensFilterParser * self) {
147
self->priv = UNITY_MUSIC_LENS_FILTER_PARSER_GET_PRIVATE (self);
151
static void unity_music_lens_filter_parser_finalize (GObject* obj) {
152
UnityMusicLensFilterParser * self;
153
self = UNITY_MUSIC_LENS_FILTER_PARSER (obj);
154
_g_object_unref0 (self->priv->_filter);
155
G_OBJECT_CLASS (unity_music_lens_filter_parser_parent_class)->finalize (obj);
159
GType unity_music_lens_filter_parser_get_type (void) {
160
static volatile gsize unity_music_lens_filter_parser_type_id__volatile = 0;
161
if (g_once_init_enter (&unity_music_lens_filter_parser_type_id__volatile)) {
162
static const GTypeInfo g_define_type_info = { sizeof (UnityMusicLensFilterParserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_lens_filter_parser_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicLensFilterParser), 0, (GInstanceInitFunc) unity_music_lens_filter_parser_instance_init, NULL };
163
GType unity_music_lens_filter_parser_type_id;
164
unity_music_lens_filter_parser_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicLensFilterParser", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
165
g_once_init_leave (&unity_music_lens_filter_parser_type_id__volatile, unity_music_lens_filter_parser_type_id);
167
return unity_music_lens_filter_parser_type_id__volatile;
171
static void _vala_unity_music_lens_filter_parser_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
172
UnityMusicLensFilterParser * self;
173
self = UNITY_MUSIC_LENS_FILTER_PARSER (object);
174
switch (property_id) {
175
case UNITY_MUSIC_LENS_FILTER_PARSER_FILTER:
176
g_value_set_object (value, unity_music_lens_filter_parser_get_filter (self));
179
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
185
static void _vala_unity_music_lens_filter_parser_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
186
UnityMusicLensFilterParser * self;
187
self = UNITY_MUSIC_LENS_FILTER_PARSER (object);
188
switch (property_id) {
189
case UNITY_MUSIC_LENS_FILTER_PARSER_FILTER:
190
unity_music_lens_filter_parser_set_filter (self, g_value_get_object (value));
193
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);