Back to index

unity-lens-music  6.0.0
filter-parser.c
Go to the documentation of this file.
00001 /* filter-parser.c generated by valac 0.14.2, the Vala compiler
00002  * generated from filter-parser.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2011 Canonical Ltd
00006  *
00007  * This program is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 3 as
00009  * published by the Free Software Foundation.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  * Authored by Alex Launi <alex.launi@canonical.com>
00020  *
00021  */
00022 
00023 #include <glib.h>
00024 #include <glib-object.h>
00025 #include <stdlib.h>
00026 #include <string.h>
00027 #include <unity.h>
00028 
00029 
00030 #define UNITY_MUSIC_LENS_TYPE_FILTER_PARSER (unity_music_lens_filter_parser_get_type ())
00031 #define UNITY_MUSIC_LENS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParser))
00032 #define UNITY_MUSIC_LENS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
00033 #define UNITY_MUSIC_LENS_IS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
00034 #define UNITY_MUSIC_LENS_IS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
00035 #define UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
00036 
00037 typedef struct _UnityMusicLensFilterParser UnityMusicLensFilterParser;
00038 typedef struct _UnityMusicLensFilterParserClass UnityMusicLensFilterParserClass;
00039 typedef struct _UnityMusicLensFilterParserPrivate UnityMusicLensFilterParserPrivate;
00040 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00041 
00042 struct _UnityMusicLensFilterParser {
00043        GObject parent_instance;
00044        UnityMusicLensFilterParserPrivate * priv;
00045 };
00046 
00047 struct _UnityMusicLensFilterParserClass {
00048        GObjectClass parent_class;
00049        gchar* (*parse) (UnityMusicLensFilterParser* self);
00050        const gchar* (*get_id) (UnityMusicLensFilterParser* self);
00051 };
00052 
00053 struct _UnityMusicLensFilterParserPrivate {
00054        UnityFilter* _filter;
00055 };
00056 
00057 
00058 static gpointer unity_music_lens_filter_parser_parent_class = NULL;
00059 
00060 GType unity_music_lens_filter_parser_get_type (void) G_GNUC_CONST;
00061 #define UNITY_MUSIC_LENS_FILTER_PARSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserPrivate))
00062 enum  {
00063        UNITY_MUSIC_LENS_FILTER_PARSER_DUMMY_PROPERTY,
00064        UNITY_MUSIC_LENS_FILTER_PARSER_FILTER,
00065        UNITY_MUSIC_LENS_FILTER_PARSER_ID
00066 };
00067 UnityMusicLensFilterParser* unity_music_lens_filter_parser_construct (GType object_type, UnityFilter* filter);
00068 void unity_music_lens_filter_parser_set_filter (UnityMusicLensFilterParser* self, UnityFilter* value);
00069 gchar* unity_music_lens_filter_parser_parse (UnityMusicLensFilterParser* self);
00070 static gchar* unity_music_lens_filter_parser_real_parse (UnityMusicLensFilterParser* self);
00071 UnityFilter* unity_music_lens_filter_parser_get_filter (UnityMusicLensFilterParser* self);
00072 const gchar* unity_music_lens_filter_parser_get_id (UnityMusicLensFilterParser* self);
00073 static void unity_music_lens_filter_parser_finalize (GObject* obj);
00074 static void _vala_unity_music_lens_filter_parser_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00075 static void _vala_unity_music_lens_filter_parser_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00076 
00077 
00078 UnityMusicLensFilterParser* unity_music_lens_filter_parser_construct (GType object_type, UnityFilter* filter) {
00079        UnityMusicLensFilterParser * self = NULL;
00080        UnityFilter* _tmp0_;
00081        g_return_val_if_fail (filter != NULL, NULL);
00082        self = (UnityMusicLensFilterParser*) g_object_new (object_type, NULL);
00083        _tmp0_ = filter;
00084        unity_music_lens_filter_parser_set_filter (self, _tmp0_);
00085        return self;
00086 }
00087 
00088 
00089 static gchar* unity_music_lens_filter_parser_real_parse (UnityMusicLensFilterParser* self) {
00090        g_critical ("Type `%s' does not implement abstract method `unity_music_lens_filter_parser_parse'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
00091        return NULL;
00092 }
00093 
00094 
00095 gchar* unity_music_lens_filter_parser_parse (UnityMusicLensFilterParser* self) {
00096        g_return_val_if_fail (self != NULL, NULL);
00097        return UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS (self)->parse (self);
00098 }
00099 
00100 
00101 UnityFilter* unity_music_lens_filter_parser_get_filter (UnityMusicLensFilterParser* self) {
00102        UnityFilter* result;
00103        UnityFilter* _tmp0_;
00104        g_return_val_if_fail (self != NULL, NULL);
00105        _tmp0_ = self->priv->_filter;
00106        result = _tmp0_;
00107        return result;
00108 }
00109 
00110 
00111 static gpointer _g_object_ref0 (gpointer self) {
00112        return self ? g_object_ref (self) : NULL;
00113 }
00114 
00115 
00116 void unity_music_lens_filter_parser_set_filter (UnityMusicLensFilterParser* self, UnityFilter* value) {
00117        UnityFilter* _tmp0_;
00118        UnityFilter* _tmp1_;
00119        g_return_if_fail (self != NULL);
00120        _tmp0_ = value;
00121        _tmp1_ = _g_object_ref0 (_tmp0_);
00122        _g_object_unref0 (self->priv->_filter);
00123        self->priv->_filter = _tmp1_;
00124        g_object_notify ((GObject *) self, "filter");
00125 }
00126 
00127 
00128 const gchar* unity_music_lens_filter_parser_get_id (UnityMusicLensFilterParser* self) {
00129        g_return_val_if_fail (self != NULL, NULL);
00130        return UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS (self)->get_id (self);
00131 }
00132 
00133 
00134 static void unity_music_lens_filter_parser_class_init (UnityMusicLensFilterParserClass * klass) {
00135        unity_music_lens_filter_parser_parent_class = g_type_class_peek_parent (klass);
00136        g_type_class_add_private (klass, sizeof (UnityMusicLensFilterParserPrivate));
00137        UNITY_MUSIC_LENS_FILTER_PARSER_CLASS (klass)->parse = unity_music_lens_filter_parser_real_parse;
00138        G_OBJECT_CLASS (klass)->get_property = _vala_unity_music_lens_filter_parser_get_property;
00139        G_OBJECT_CLASS (klass)->set_property = _vala_unity_music_lens_filter_parser_set_property;
00140        G_OBJECT_CLASS (klass)->finalize = unity_music_lens_filter_parser_finalize;
00141        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));
00142        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));
00143 }
00144 
00145 
00146 static void unity_music_lens_filter_parser_instance_init (UnityMusicLensFilterParser * self) {
00147        self->priv = UNITY_MUSIC_LENS_FILTER_PARSER_GET_PRIVATE (self);
00148 }
00149 
00150 
00151 static void unity_music_lens_filter_parser_finalize (GObject* obj) {
00152        UnityMusicLensFilterParser * self;
00153        self = UNITY_MUSIC_LENS_FILTER_PARSER (obj);
00154        _g_object_unref0 (self->priv->_filter);
00155        G_OBJECT_CLASS (unity_music_lens_filter_parser_parent_class)->finalize (obj);
00156 }
00157 
00158 
00159 GType unity_music_lens_filter_parser_get_type (void) {
00160        static volatile gsize unity_music_lens_filter_parser_type_id__volatile = 0;
00161        if (g_once_init_enter (&unity_music_lens_filter_parser_type_id__volatile)) {
00162               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 };
00163               GType unity_music_lens_filter_parser_type_id;
00164               unity_music_lens_filter_parser_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicLensFilterParser", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
00165               g_once_init_leave (&unity_music_lens_filter_parser_type_id__volatile, unity_music_lens_filter_parser_type_id);
00166        }
00167        return unity_music_lens_filter_parser_type_id__volatile;
00168 }
00169 
00170 
00171 static void _vala_unity_music_lens_filter_parser_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
00172        UnityMusicLensFilterParser * self;
00173        self = UNITY_MUSIC_LENS_FILTER_PARSER (object);
00174        switch (property_id) {
00175               case UNITY_MUSIC_LENS_FILTER_PARSER_FILTER:
00176               g_value_set_object (value, unity_music_lens_filter_parser_get_filter (self));
00177               break;
00178               default:
00179               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00180               break;
00181        }
00182 }
00183 
00184 
00185 static void _vala_unity_music_lens_filter_parser_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
00186        UnityMusicLensFilterParser * self;
00187        self = UNITY_MUSIC_LENS_FILTER_PARSER (object);
00188        switch (property_id) {
00189               case UNITY_MUSIC_LENS_FILTER_PARSER_FILTER:
00190               unity_music_lens_filter_parser_set_filter (self, g_value_get_object (value));
00191               break;
00192               default:
00193               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00194               break;
00195        }
00196 }
00197 
00198 
00199