Back to index

libunity  5.92.0
unity-lens-filters.c
Go to the documentation of this file.
00001 /* unity-lens-filters.c generated by valac 0.17.2, the Vala compiler
00002  * generated from unity-lens-filters.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2011 Canonical, Ltd.
00006  *
00007  * This library is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU Lesser General Public License
00009  * version 3.0 as published by the Free Software Foundation.
00010  *
00011  * This library 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 Lesser General Public License version 3.0 for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library. If not, see
00018  * <http://www.gnu.org/licenses/>.
00019  *
00020  * Authored by Neil Jagdish Patel <neil.patel@canonical.com>
00021  *
00022  */
00023 
00024 #include <glib.h>
00025 #include <glib-object.h>
00026 #include "unity.h"
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <gio/gio.h>
00030 #include <dee.h>
00031 #include <float.h>
00032 #include <math.h>
00033 
00034 
00035 #define UNITY_TYPE_FILTER_COLUMN (unity_filter_column_get_type ())
00036 #define _g_free0(var) (var = (g_free (var), NULL))
00037 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00038 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
00039 #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
00040 #define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))
00041 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00042 #define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
00043 #define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
00044 #define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
00045 
00046 typedef enum  {
00047        UNITY_FILTER_COLUMN_ID = 0,
00048        UNITY_FILTER_COLUMN_NAME,
00049        UNITY_FILTER_COLUMN_ICON_HINT,
00050        UNITY_FILTER_COLUMN_RENDERER_NAME,
00051        UNITY_FILTER_COLUMN_RENDERER_STATE,
00052        UNITY_FILTER_COLUMN_VISIBLE,
00053        UNITY_FILTER_COLUMN_COLLAPSED,
00054        UNITY_FILTER_COLUMN_FILTERING
00055 } UnityFilterColumn;
00056 
00057 struct _UnityFilterPrivate {
00058        gchar* _id;
00059        gchar* _display_name;
00060        GIcon* _icon_hint;
00061        UnityFilterRenderer _renderer;
00062        gboolean _visible;
00063        gboolean _collapsed;
00064        gboolean _filtering;
00065        DeeModel* _model;
00066        DeeModelIter* _iter;
00067 };
00068 
00069 struct _UnityFilterOptionPrivate {
00070        gchar* _id;
00071        gchar* _display_name;
00072        GIcon* _icon_hint;
00073        gboolean _active;
00074 };
00075 
00076 struct _UnityOptionsFilterPrivate {
00077        UnityOptionsFilterSortType _sort_type;
00078 };
00079 
00080 struct _UnityRatingsFilterPrivate {
00081        gfloat _rating;
00082 };
00083 
00084 
00085 static gpointer unity_filter_parent_class = NULL;
00086 static gpointer unity_filter_option_parent_class = NULL;
00087 static gpointer unity_options_filter_parent_class = NULL;
00088 static gpointer unity_radio_option_filter_parent_class = NULL;
00089 static gpointer unity_check_option_filter_parent_class = NULL;
00090 static gpointer unity_check_option_filter_compact_parent_class = NULL;
00091 static gpointer unity_ratings_filter_parent_class = NULL;
00092 static gpointer unity_multi_range_filter_parent_class = NULL;
00093 
00094 GType unity_filter_column_get_type (void) G_GNUC_CONST;
00095 #define UNITY_FILTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_FILTER, UnityFilterPrivate))
00096 enum  {
00097        UNITY_FILTER_DUMMY_PROPERTY,
00098        UNITY_FILTER_ID,
00099        UNITY_FILTER_DISPLAY_NAME,
00100        UNITY_FILTER_ICON_HINT,
00101        UNITY_FILTER_RENDERER,
00102        UNITY_FILTER_VISIBLE,
00103        UNITY_FILTER_COLLAPSED,
00104        UNITY_FILTER_FILTERING
00105 };
00106 void unity_filter_set_model_and_iter (UnityFilter* self, DeeModel* model, DeeModelIter* iter);
00107 static void unity_filter_on_row_changed (UnityFilter* self, DeeModel* model, DeeModelIter* iter);
00108 static void _unity_filter_on_row_changed_dee_model_row_changed (DeeModel* _sender, DeeModelIter* iter, gpointer self);
00109 void unity_filter_set_filtering (UnityFilter* self, gboolean value);
00110 void unity_filter_update (UnityFilter* self, GVariant* properties);
00111 GHashTable* unity_filter_get_hints (UnityFilter* self);
00112 static GHashTable* unity_filter_real_get_hints (UnityFilter* self);
00113 static void unity_filter_real_update (UnityFilter* self, GVariant* properties);
00114 const gchar* unity_filter_get_renderer_name (UnityFilterRenderer renderer);
00115 UnityFilterRenderer unity_filter_renderer_for_name (const gchar* renderer_name);
00116 void unity_filter_set_display_name (UnityFilter* self, const gchar* value);
00117 static void unity_filter_finalize (GObject* obj);
00118 static void _vala_unity_filter_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00119 static void _vala_unity_filter_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00120 #define UNITY_FILTER_OPTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_FILTER_OPTION, UnityFilterOptionPrivate))
00121 enum  {
00122        UNITY_FILTER_OPTION_DUMMY_PROPERTY,
00123        UNITY_FILTER_OPTION_ID,
00124        UNITY_FILTER_OPTION_DISPLAY_NAME,
00125        UNITY_FILTER_OPTION_ICON_HINT,
00126        UNITY_FILTER_OPTION_ACTIVE
00127 };
00128 void unity_filter_option_set_active (UnityFilterOption* self, gboolean value);
00129 static void unity_filter_option_finalize (GObject* obj);
00130 static void _vala_unity_filter_option_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00131 static void _vala_unity_filter_option_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00132 #define UNITY_OPTIONS_FILTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_OPTIONS_FILTER, UnityOptionsFilterPrivate))
00133 enum  {
00134        UNITY_OPTIONS_FILTER_DUMMY_PROPERTY,
00135        UNITY_OPTIONS_FILTER_SORT_TYPE
00136 };
00137 static void _g_object_unref0_ (gpointer var);
00138 static void _g_list_free__g_object_unref0_ (GList* self);
00139 static gint unity_options_filter_sort_by_display_name (UnityFilterOption* f1, UnityFilterOption* f2);
00140 static gint _unity_options_filter_sort_by_display_name_gcompare_func (gconstpointer a, gconstpointer b);
00141 static gint unity_options_filter_sort_by_id (UnityFilterOption* f1, UnityFilterOption* f2);
00142 static gint _unity_options_filter_sort_by_id_gcompare_func (gconstpointer a, gconstpointer b);
00143 static void unity_options_filter_real_update (UnityFilter* base, GVariant* properties);
00144 void unity_options_filter_load_or_update_options (UnityOptionsFilter* self, GVariant* array);
00145 void unity_options_filter_find_and_update_option (UnityOptionsFilter* self, const gchar* id, const gchar* name, const gchar* icon_hint_s, gboolean active);
00146 static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
00147 static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
00148 static GHashTable* unity_options_filter_real_get_hints (UnityFilter* base);
00149 static void _g_free0_ (gpointer var);
00150 static void _g_variant_unref0_ (gpointer var);
00151 static void unity_options_filter_finalize (GObject* obj);
00152 static void _vala_unity_options_filter_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00153 static void _vala_unity_options_filter_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00154 enum  {
00155        UNITY_RADIO_OPTION_FILTER_DUMMY_PROPERTY
00156 };
00157 enum  {
00158        UNITY_CHECK_OPTION_FILTER_DUMMY_PROPERTY
00159 };
00160 enum  {
00161        UNITY_CHECK_OPTION_FILTER_COMPACT_DUMMY_PROPERTY
00162 };
00163 #define UNITY_RATINGS_FILTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_RATINGS_FILTER, UnityRatingsFilterPrivate))
00164 enum  {
00165        UNITY_RATINGS_FILTER_DUMMY_PROPERTY,
00166        UNITY_RATINGS_FILTER_RATING
00167 };
00168 static void unity_ratings_filter_real_update (UnityFilter* base, GVariant* properties);
00169 void unity_ratings_filter_set_rating (UnityRatingsFilter* self, gfloat value);
00170 static GHashTable* unity_ratings_filter_real_get_hints (UnityFilter* base);
00171 static GVariant* _variant_new16 (gdouble value);
00172 static void unity_ratings_filter_finalize (GObject* obj);
00173 static void _vala_unity_ratings_filter_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00174 static void _vala_unity_ratings_filter_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00175 enum  {
00176        UNITY_MULTI_RANGE_FILTER_DUMMY_PROPERTY
00177 };
00178 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00179 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00180 
00181 
00182 GType unity_filter_column_get_type (void) {
00183        static volatile gsize unity_filter_column_type_id__volatile = 0;
00184        if (g_once_init_enter (&unity_filter_column_type_id__volatile)) {
00185               static const GEnumValue values[] = {{UNITY_FILTER_COLUMN_ID, "UNITY_FILTER_COLUMN_ID", "id"}, {UNITY_FILTER_COLUMN_NAME, "UNITY_FILTER_COLUMN_NAME", "name"}, {UNITY_FILTER_COLUMN_ICON_HINT, "UNITY_FILTER_COLUMN_ICON_HINT", "icon-hint"}, {UNITY_FILTER_COLUMN_RENDERER_NAME, "UNITY_FILTER_COLUMN_RENDERER_NAME", "renderer-name"}, {UNITY_FILTER_COLUMN_RENDERER_STATE, "UNITY_FILTER_COLUMN_RENDERER_STATE", "renderer-state"}, {UNITY_FILTER_COLUMN_VISIBLE, "UNITY_FILTER_COLUMN_VISIBLE", "visible"}, {UNITY_FILTER_COLUMN_COLLAPSED, "UNITY_FILTER_COLUMN_COLLAPSED", "collapsed"}, {UNITY_FILTER_COLUMN_FILTERING, "UNITY_FILTER_COLUMN_FILTERING", "filtering"}, {0, NULL, NULL}};
00186               GType unity_filter_column_type_id;
00187               unity_filter_column_type_id = g_enum_register_static ("UnityFilterColumn", values);
00188               g_once_init_leave (&unity_filter_column_type_id__volatile, unity_filter_column_type_id);
00189        }
00190        return unity_filter_column_type_id__volatile;
00191 }
00192 
00193 
00194 GType unity_filter_renderer_get_type (void) {
00195        static volatile gsize unity_filter_renderer_type_id__volatile = 0;
00196        if (g_once_init_enter (&unity_filter_renderer_type_id__volatile)) {
00197               static const GEnumValue values[] = {{UNITY_FILTER_RENDERER_CHECK_OPTIONS, "UNITY_FILTER_RENDERER_CHECK_OPTIONS", "check-options"}, {UNITY_FILTER_RENDERER_RADIO_OPTIONS, "UNITY_FILTER_RENDERER_RADIO_OPTIONS", "radio-options"}, {UNITY_FILTER_RENDERER_MULTIRANGE, "UNITY_FILTER_RENDERER_MULTIRANGE", "multirange"}, {UNITY_FILTER_RENDERER_RATINGS, "UNITY_FILTER_RENDERER_RATINGS", "ratings"}, {UNITY_FILTER_RENDERER_CHECK_OPTIONS_COMPACT, "UNITY_FILTER_RENDERER_CHECK_OPTIONS_COMPACT", "check-options-compact"}, {0, NULL, NULL}};
00198               GType unity_filter_renderer_type_id;
00199               unity_filter_renderer_type_id = g_enum_register_static ("UnityFilterRenderer", values);
00200               g_once_init_leave (&unity_filter_renderer_type_id__volatile, unity_filter_renderer_type_id);
00201        }
00202        return unity_filter_renderer_type_id__volatile;
00203 }
00204 
00205 
00206 static gpointer _g_object_ref0 (gpointer self) {
00207        return self ? g_object_ref (self) : NULL;
00208 }
00209 
00210 
00211 static void _unity_filter_on_row_changed_dee_model_row_changed (DeeModel* _sender, DeeModelIter* iter, gpointer self) {
00212        unity_filter_on_row_changed (self, _sender, iter);
00213 }
00214 
00215 
00216 void unity_filter_set_model_and_iter (UnityFilter* self, DeeModel* model, DeeModelIter* iter) {
00217        DeeModel* _tmp0_;
00218        DeeModel* _tmp1_;
00219        DeeModelIter* _tmp2_;
00220        DeeModel* _tmp3_;
00221        DeeModel* _tmp4_;
00222        DeeModelIter* _tmp5_;
00223        g_return_if_fail (self != NULL);
00224        g_return_if_fail (model != NULL);
00225        g_return_if_fail (iter != NULL);
00226        _tmp0_ = model;
00227        _tmp1_ = _g_object_ref0 (_tmp0_);
00228        _g_object_unref0 (self->priv->_model);
00229        self->priv->_model = _tmp1_;
00230        _tmp2_ = iter;
00231        self->priv->_iter = _tmp2_;
00232        _tmp3_ = self->priv->_model;
00233        g_signal_connect_object (_tmp3_, "row-changed", (GCallback) _unity_filter_on_row_changed_dee_model_row_changed, self, 0);
00234        _tmp4_ = model;
00235        _tmp5_ = iter;
00236        unity_filter_on_row_changed (self, _tmp4_, _tmp5_);
00237 }
00238 
00239 
00240 static void unity_filter_on_row_changed (UnityFilter* self, DeeModel* model, DeeModelIter* iter) {
00241        DeeModelIter* _tmp0_;
00242        DeeModelIter* _tmp1_;
00243        DeeModel* _tmp2_;
00244        DeeModelIter* _tmp3_;
00245        gboolean _tmp4_ = FALSE;
00246        DeeModel* _tmp5_;
00247        DeeModelIter* _tmp6_;
00248        GVariant* _tmp7_ = NULL;
00249        GVariant* properties;
00250        GVariant* _tmp8_;
00251        g_return_if_fail (self != NULL);
00252        g_return_if_fail (model != NULL);
00253        g_return_if_fail (iter != NULL);
00254        _tmp0_ = iter;
00255        _tmp1_ = self->priv->_iter;
00256        if (_tmp0_ != _tmp1_) {
00257               return;
00258        }
00259        _tmp2_ = model;
00260        _tmp3_ = iter;
00261        _tmp4_ = dee_model_get_bool (_tmp2_, _tmp3_, (guint) UNITY_FILTER_COLUMN_FILTERING);
00262        unity_filter_set_filtering (self, _tmp4_);
00263        _tmp5_ = model;
00264        _tmp6_ = iter;
00265        _tmp7_ = dee_model_get_value (_tmp5_, _tmp6_, (guint) UNITY_FILTER_COLUMN_RENDERER_STATE);
00266        properties = _tmp7_;
00267        _tmp8_ = properties;
00268        unity_filter_update (self, _tmp8_);
00269        _g_variant_unref0 (properties);
00270 }
00271 
00272 
00273 static GHashTable* unity_filter_real_get_hints (UnityFilter* self) {
00274        g_critical ("Type `%s' does not implement abstract method `unity_filter_get_hints'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
00275        return NULL;
00276 }
00277 
00278 
00279 GHashTable* unity_filter_get_hints (UnityFilter* self) {
00280        g_return_val_if_fail (self != NULL, NULL);
00281        return UNITY_FILTER_GET_CLASS (self)->get_hints (self);
00282 }
00283 
00284 
00285 static void unity_filter_real_update (UnityFilter* self, GVariant* properties) {
00286        g_critical ("Type `%s' does not implement abstract method `unity_filter_update'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
00287        return;
00288 }
00289 
00290 
00291 void unity_filter_update (UnityFilter* self, GVariant* properties) {
00292        g_return_if_fail (self != NULL);
00293        UNITY_FILTER_GET_CLASS (self)->update (self, properties);
00294 }
00295 
00296 
00297 const gchar* unity_filter_get_renderer_name (UnityFilterRenderer renderer) {
00298        const gchar* result = NULL;
00299        UnityFilterRenderer _tmp0_;
00300        _tmp0_ = renderer;
00301        switch (_tmp0_) {
00302               case UNITY_FILTER_RENDERER_CHECK_OPTIONS:
00303               {
00304                      result = "filter-checkoption";
00305                      return result;
00306               }
00307               case UNITY_FILTER_RENDERER_CHECK_OPTIONS_COMPACT:
00308               {
00309                      result = "filter-checkoption-compact";
00310                      return result;
00311               }
00312               case UNITY_FILTER_RENDERER_RADIO_OPTIONS:
00313               {
00314                      result = "filter-radiooption";
00315                      return result;
00316               }
00317               case UNITY_FILTER_RENDERER_RATINGS:
00318               {
00319                      result = "filter-ratings";
00320                      return result;
00321               }
00322               case UNITY_FILTER_RENDERER_MULTIRANGE:
00323               {
00324                      result = "filter-multirange";
00325                      return result;
00326               }
00327               default:
00328               {
00329                      result = "invalid-renderer";
00330                      return result;
00331               }
00332        }
00333 }
00334 
00335 
00336 UnityFilterRenderer unity_filter_renderer_for_name (const gchar* renderer_name) {
00337        UnityFilterRenderer result = 0;
00338        const gchar* _tmp0_;
00339        const gchar* _tmp1_;
00340        GQuark _tmp3_ = 0U;
00341        static GQuark _tmp2_label0 = 0;
00342        static GQuark _tmp2_label1 = 0;
00343        static GQuark _tmp2_label2 = 0;
00344        static GQuark _tmp2_label3 = 0;
00345        static GQuark _tmp2_label4 = 0;
00346        g_return_val_if_fail (renderer_name != NULL, 0);
00347        _tmp0_ = renderer_name;
00348        _tmp1_ = _tmp0_;
00349        _tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
00350        if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("filter-checkoption")))) {
00351               switch (0) {
00352                      default:
00353                      {
00354                             result = UNITY_FILTER_RENDERER_CHECK_OPTIONS;
00355                             return result;
00356                      }
00357               }
00358        } else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("filter-checkoption-compact")))) {
00359               switch (0) {
00360                      default:
00361                      {
00362                             result = UNITY_FILTER_RENDERER_CHECK_OPTIONS_COMPACT;
00363                             return result;
00364                      }
00365               }
00366        } else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("filter-radiooption")))) {
00367               switch (0) {
00368                      default:
00369                      {
00370                             result = UNITY_FILTER_RENDERER_RADIO_OPTIONS;
00371                             return result;
00372                      }
00373               }
00374        } else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("filter-ratings")))) {
00375               switch (0) {
00376                      default:
00377                      {
00378                             result = UNITY_FILTER_RENDERER_RATINGS;
00379                             return result;
00380                      }
00381               }
00382        } else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("filter-multirange")))) {
00383               switch (0) {
00384                      default:
00385                      {
00386                             result = UNITY_FILTER_RENDERER_MULTIRANGE;
00387                             return result;
00388                      }
00389               }
00390        } else {
00391               switch (0) {
00392                      default:
00393                      {
00394                             result = UNITY_FILTER_RENDERER_RATINGS;
00395                             return result;
00396                      }
00397               }
00398        }
00399 }
00400 
00401 
00402 UnityFilter* unity_filter_construct (GType object_type) {
00403        UnityFilter * self = NULL;
00404        self = (UnityFilter*) g_object_new (object_type, NULL);
00405        return self;
00406 }
00407 
00408 
00409 const gchar* unity_filter_get_id (UnityFilter* self) {
00410        const gchar* result;
00411        const gchar* _tmp0_;
00412        g_return_val_if_fail (self != NULL, NULL);
00413        _tmp0_ = self->priv->_id;
00414        result = _tmp0_;
00415        return result;
00416 }
00417 
00418 
00419 static void unity_filter_set_id (UnityFilter* self, const gchar* value) {
00420        const gchar* _tmp0_;
00421        gchar* _tmp1_;
00422        g_return_if_fail (self != NULL);
00423        _tmp0_ = value;
00424        _tmp1_ = g_strdup (_tmp0_);
00425        _g_free0 (self->priv->_id);
00426        self->priv->_id = _tmp1_;
00427        g_object_notify ((GObject *) self, "id");
00428 }
00429 
00430 
00431 const gchar* unity_filter_get_display_name (UnityFilter* self) {
00432        const gchar* result;
00433        const gchar* _tmp0_;
00434        g_return_val_if_fail (self != NULL, NULL);
00435        _tmp0_ = self->priv->_display_name;
00436        result = _tmp0_;
00437        return result;
00438 }
00439 
00440 
00441 void unity_filter_set_display_name (UnityFilter* self, const gchar* value) {
00442        const gchar* _tmp0_;
00443        gchar* _tmp1_;
00444        g_return_if_fail (self != NULL);
00445        _tmp0_ = value;
00446        _tmp1_ = g_strdup (_tmp0_);
00447        _g_free0 (self->priv->_display_name);
00448        self->priv->_display_name = _tmp1_;
00449        g_object_notify ((GObject *) self, "display-name");
00450 }
00451 
00452 
00453 GIcon* unity_filter_get_icon_hint (UnityFilter* self) {
00454        GIcon* result;
00455        GIcon* _tmp0_;
00456        g_return_val_if_fail (self != NULL, NULL);
00457        _tmp0_ = self->priv->_icon_hint;
00458        result = _tmp0_;
00459        return result;
00460 }
00461 
00462 
00463 static void unity_filter_set_icon_hint (UnityFilter* self, GIcon* value) {
00464        GIcon* _tmp0_;
00465        GIcon* _tmp1_;
00466        g_return_if_fail (self != NULL);
00467        _tmp0_ = value;
00468        _tmp1_ = _g_object_ref0 (_tmp0_);
00469        _g_object_unref0 (self->priv->_icon_hint);
00470        self->priv->_icon_hint = _tmp1_;
00471        g_object_notify ((GObject *) self, "icon-hint");
00472 }
00473 
00474 
00475 UnityFilterRenderer unity_filter_get_renderer (UnityFilter* self) {
00476        UnityFilterRenderer result;
00477        UnityFilterRenderer _tmp0_;
00478        g_return_val_if_fail (self != NULL, 0);
00479        _tmp0_ = self->priv->_renderer;
00480        result = _tmp0_;
00481        return result;
00482 }
00483 
00484 
00485 static void unity_filter_set_renderer (UnityFilter* self, UnityFilterRenderer value) {
00486        UnityFilterRenderer _tmp0_;
00487        g_return_if_fail (self != NULL);
00488        _tmp0_ = value;
00489        self->priv->_renderer = _tmp0_;
00490        g_object_notify ((GObject *) self, "renderer");
00491 }
00492 
00493 
00494 gboolean unity_filter_get_visible (UnityFilter* self) {
00495        gboolean result;
00496        gboolean _tmp0_;
00497        g_return_val_if_fail (self != NULL, FALSE);
00498        _tmp0_ = self->priv->_visible;
00499        result = _tmp0_;
00500        return result;
00501 }
00502 
00503 
00504 void unity_filter_set_visible (UnityFilter* self, gboolean value) {
00505        gboolean _tmp0_;
00506        g_return_if_fail (self != NULL);
00507        _tmp0_ = value;
00508        self->priv->_visible = _tmp0_;
00509        g_object_notify ((GObject *) self, "visible");
00510 }
00511 
00512 
00513 gboolean unity_filter_get_collapsed (UnityFilter* self) {
00514        gboolean result;
00515        gboolean _tmp0_;
00516        g_return_val_if_fail (self != NULL, FALSE);
00517        _tmp0_ = self->priv->_collapsed;
00518        result = _tmp0_;
00519        return result;
00520 }
00521 
00522 
00523 static void unity_filter_set_collapsed (UnityFilter* self, gboolean value) {
00524        gboolean _tmp0_;
00525        g_return_if_fail (self != NULL);
00526        _tmp0_ = value;
00527        self->priv->_collapsed = _tmp0_;
00528        g_object_notify ((GObject *) self, "collapsed");
00529 }
00530 
00531 
00532 gboolean unity_filter_get_filtering (UnityFilter* self) {
00533        gboolean result;
00534        gboolean _tmp0_;
00535        g_return_val_if_fail (self != NULL, FALSE);
00536        _tmp0_ = self->priv->_filtering;
00537        result = _tmp0_;
00538        return result;
00539 }
00540 
00541 
00542 void unity_filter_set_filtering (UnityFilter* self, gboolean value) {
00543        gboolean _tmp0_;
00544        g_return_if_fail (self != NULL);
00545        _tmp0_ = value;
00546        self->priv->_filtering = _tmp0_;
00547        g_object_notify ((GObject *) self, "filtering");
00548 }
00549 
00550 
00551 static void unity_filter_class_init (UnityFilterClass * klass) {
00552        unity_filter_parent_class = g_type_class_peek_parent (klass);
00553        g_type_class_add_private (klass, sizeof (UnityFilterPrivate));
00554        UNITY_FILTER_CLASS (klass)->get_hints = unity_filter_real_get_hints;
00555        UNITY_FILTER_CLASS (klass)->update = unity_filter_real_update;
00556        G_OBJECT_CLASS (klass)->get_property = _vala_unity_filter_get_property;
00557        G_OBJECT_CLASS (klass)->set_property = _vala_unity_filter_set_property;
00558        G_OBJECT_CLASS (klass)->finalize = unity_filter_finalize;
00559        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_ID, g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00560        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_DISPLAY_NAME, g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
00561        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_ICON_HINT, g_param_spec_object ("icon-hint", "icon-hint", "icon-hint", G_TYPE_ICON, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00562        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_RENDERER, g_param_spec_enum ("renderer", "renderer", "renderer", UNITY_TYPE_FILTER_RENDERER, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00563        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_VISIBLE, g_param_spec_boolean ("visible", "visible", "visible", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
00564        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_COLLAPSED, g_param_spec_boolean ("collapsed", "collapsed", "collapsed", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00565        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_FILTERING, g_param_spec_boolean ("filtering", "filtering", "filtering", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
00566        g_signal_new ("changed", UNITY_TYPE_FILTER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
00567 }
00568 
00569 
00570 static void unity_filter_instance_init (UnityFilter * self) {
00571        self->priv = UNITY_FILTER_GET_PRIVATE (self);
00572 }
00573 
00574 
00575 static void unity_filter_finalize (GObject* obj) {
00576        UnityFilter * self;
00577        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_FILTER, UnityFilter);
00578        _g_free0 (self->priv->_id);
00579        _g_free0 (self->priv->_display_name);
00580        _g_object_unref0 (self->priv->_icon_hint);
00581        _g_object_unref0 (self->priv->_model);
00582        G_OBJECT_CLASS (unity_filter_parent_class)->finalize (obj);
00583 }
00584 
00585 
00586 GType unity_filter_get_type (void) {
00587        static volatile gsize unity_filter_type_id__volatile = 0;
00588        if (g_once_init_enter (&unity_filter_type_id__volatile)) {
00589               static const GTypeInfo g_define_type_info = { sizeof (UnityFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityFilter), 0, (GInstanceInitFunc) unity_filter_instance_init, NULL };
00590               GType unity_filter_type_id;
00591               unity_filter_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityFilter", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
00592               g_once_init_leave (&unity_filter_type_id__volatile, unity_filter_type_id);
00593        }
00594        return unity_filter_type_id__volatile;
00595 }
00596 
00597 
00598 static void _vala_unity_filter_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
00599        UnityFilter * self;
00600        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_FILTER, UnityFilter);
00601        switch (property_id) {
00602               case UNITY_FILTER_ID:
00603               g_value_set_string (value, unity_filter_get_id (self));
00604               break;
00605               case UNITY_FILTER_DISPLAY_NAME:
00606               g_value_set_string (value, unity_filter_get_display_name (self));
00607               break;
00608               case UNITY_FILTER_ICON_HINT:
00609               g_value_set_object (value, unity_filter_get_icon_hint (self));
00610               break;
00611               case UNITY_FILTER_RENDERER:
00612               g_value_set_enum (value, unity_filter_get_renderer (self));
00613               break;
00614               case UNITY_FILTER_VISIBLE:
00615               g_value_set_boolean (value, unity_filter_get_visible (self));
00616               break;
00617               case UNITY_FILTER_COLLAPSED:
00618               g_value_set_boolean (value, unity_filter_get_collapsed (self));
00619               break;
00620               case UNITY_FILTER_FILTERING:
00621               g_value_set_boolean (value, unity_filter_get_filtering (self));
00622               break;
00623               default:
00624               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00625               break;
00626        }
00627 }
00628 
00629 
00630 static void _vala_unity_filter_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
00631        UnityFilter * self;
00632        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_FILTER, UnityFilter);
00633        switch (property_id) {
00634               case UNITY_FILTER_ID:
00635               unity_filter_set_id (self, g_value_get_string (value));
00636               break;
00637               case UNITY_FILTER_DISPLAY_NAME:
00638               unity_filter_set_display_name (self, g_value_get_string (value));
00639               break;
00640               case UNITY_FILTER_ICON_HINT:
00641               unity_filter_set_icon_hint (self, g_value_get_object (value));
00642               break;
00643               case UNITY_FILTER_RENDERER:
00644               unity_filter_set_renderer (self, g_value_get_enum (value));
00645               break;
00646               case UNITY_FILTER_VISIBLE:
00647               unity_filter_set_visible (self, g_value_get_boolean (value));
00648               break;
00649               case UNITY_FILTER_COLLAPSED:
00650               unity_filter_set_collapsed (self, g_value_get_boolean (value));
00651               break;
00652               case UNITY_FILTER_FILTERING:
00653               unity_filter_set_filtering (self, g_value_get_boolean (value));
00654               break;
00655               default:
00656               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00657               break;
00658        }
00659 }
00660 
00661 
00662 UnityFilterOption* unity_filter_option_construct (GType object_type, const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean active) {
00663        UnityFilterOption * self = NULL;
00664        const gchar* _tmp0_;
00665        const gchar* _tmp1_;
00666        GIcon* _tmp2_;
00667        gboolean _tmp3_;
00668        g_return_val_if_fail (id != NULL, NULL);
00669        g_return_val_if_fail (display_name != NULL, NULL);
00670        _tmp0_ = id;
00671        _tmp1_ = display_name;
00672        _tmp2_ = icon_hint;
00673        _tmp3_ = active;
00674        self = (UnityFilterOption*) g_object_new (object_type, "id", _tmp0_, "display-name", _tmp1_, "icon-hint", _tmp2_, "active", _tmp3_, NULL);
00675        return self;
00676 }
00677 
00678 
00679 UnityFilterOption* unity_filter_option_new (const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean active) {
00680        return unity_filter_option_construct (UNITY_TYPE_FILTER_OPTION, id, display_name, icon_hint, active);
00681 }
00682 
00683 
00684 const gchar* unity_filter_option_get_id (UnityFilterOption* self) {
00685        const gchar* result;
00686        const gchar* _tmp0_;
00687        g_return_val_if_fail (self != NULL, NULL);
00688        _tmp0_ = self->priv->_id;
00689        result = _tmp0_;
00690        return result;
00691 }
00692 
00693 
00694 static void unity_filter_option_set_id (UnityFilterOption* self, const gchar* value) {
00695        const gchar* _tmp0_;
00696        gchar* _tmp1_;
00697        g_return_if_fail (self != NULL);
00698        _tmp0_ = value;
00699        _tmp1_ = g_strdup (_tmp0_);
00700        _g_free0 (self->priv->_id);
00701        self->priv->_id = _tmp1_;
00702        g_object_notify ((GObject *) self, "id");
00703 }
00704 
00705 
00706 const gchar* unity_filter_option_get_display_name (UnityFilterOption* self) {
00707        const gchar* result;
00708        const gchar* _tmp0_;
00709        g_return_val_if_fail (self != NULL, NULL);
00710        _tmp0_ = self->priv->_display_name;
00711        result = _tmp0_;
00712        return result;
00713 }
00714 
00715 
00716 static void unity_filter_option_set_display_name (UnityFilterOption* self, const gchar* value) {
00717        const gchar* _tmp0_;
00718        gchar* _tmp1_;
00719        g_return_if_fail (self != NULL);
00720        _tmp0_ = value;
00721        _tmp1_ = g_strdup (_tmp0_);
00722        _g_free0 (self->priv->_display_name);
00723        self->priv->_display_name = _tmp1_;
00724        g_object_notify ((GObject *) self, "display-name");
00725 }
00726 
00727 
00728 GIcon* unity_filter_option_get_icon_hint (UnityFilterOption* self) {
00729        GIcon* result;
00730        GIcon* _tmp0_;
00731        g_return_val_if_fail (self != NULL, NULL);
00732        _tmp0_ = self->priv->_icon_hint;
00733        result = _tmp0_;
00734        return result;
00735 }
00736 
00737 
00738 static void unity_filter_option_set_icon_hint (UnityFilterOption* self, GIcon* value) {
00739        GIcon* _tmp0_;
00740        GIcon* _tmp1_;
00741        g_return_if_fail (self != NULL);
00742        _tmp0_ = value;
00743        _tmp1_ = _g_object_ref0 (_tmp0_);
00744        _g_object_unref0 (self->priv->_icon_hint);
00745        self->priv->_icon_hint = _tmp1_;
00746        g_object_notify ((GObject *) self, "icon-hint");
00747 }
00748 
00749 
00750 gboolean unity_filter_option_get_active (UnityFilterOption* self) {
00751        gboolean result;
00752        gboolean _tmp0_;
00753        g_return_val_if_fail (self != NULL, FALSE);
00754        _tmp0_ = self->priv->_active;
00755        result = _tmp0_;
00756        return result;
00757 }
00758 
00759 
00760 void unity_filter_option_set_active (UnityFilterOption* self, gboolean value) {
00761        gboolean _tmp0_;
00762        g_return_if_fail (self != NULL);
00763        _tmp0_ = value;
00764        self->priv->_active = _tmp0_;
00765        g_object_notify ((GObject *) self, "active");
00766 }
00767 
00768 
00769 static void unity_filter_option_class_init (UnityFilterOptionClass * klass) {
00770        unity_filter_option_parent_class = g_type_class_peek_parent (klass);
00771        g_type_class_add_private (klass, sizeof (UnityFilterOptionPrivate));
00772        G_OBJECT_CLASS (klass)->get_property = _vala_unity_filter_option_get_property;
00773        G_OBJECT_CLASS (klass)->set_property = _vala_unity_filter_option_set_property;
00774        G_OBJECT_CLASS (klass)->finalize = unity_filter_option_finalize;
00775        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_OPTION_ID, g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00776        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_OPTION_DISPLAY_NAME, g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00777        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_OPTION_ICON_HINT, g_param_spec_object ("icon-hint", "icon-hint", "icon-hint", G_TYPE_ICON, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00778        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_FILTER_OPTION_ACTIVE, g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
00779 }
00780 
00781 
00782 static void unity_filter_option_instance_init (UnityFilterOption * self) {
00783        self->priv = UNITY_FILTER_OPTION_GET_PRIVATE (self);
00784 }
00785 
00786 
00787 static void unity_filter_option_finalize (GObject* obj) {
00788        UnityFilterOption * self;
00789        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_FILTER_OPTION, UnityFilterOption);
00790        _g_free0 (self->priv->_id);
00791        _g_free0 (self->priv->_display_name);
00792        _g_object_unref0 (self->priv->_icon_hint);
00793        G_OBJECT_CLASS (unity_filter_option_parent_class)->finalize (obj);
00794 }
00795 
00796 
00797 GType unity_filter_option_get_type (void) {
00798        static volatile gsize unity_filter_option_type_id__volatile = 0;
00799        if (g_once_init_enter (&unity_filter_option_type_id__volatile)) {
00800               static const GTypeInfo g_define_type_info = { sizeof (UnityFilterOptionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_filter_option_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityFilterOption), 0, (GInstanceInitFunc) unity_filter_option_instance_init, NULL };
00801               GType unity_filter_option_type_id;
00802               unity_filter_option_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityFilterOption", &g_define_type_info, 0);
00803               g_once_init_leave (&unity_filter_option_type_id__volatile, unity_filter_option_type_id);
00804        }
00805        return unity_filter_option_type_id__volatile;
00806 }
00807 
00808 
00809 static void _vala_unity_filter_option_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
00810        UnityFilterOption * self;
00811        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_FILTER_OPTION, UnityFilterOption);
00812        switch (property_id) {
00813               case UNITY_FILTER_OPTION_ID:
00814               g_value_set_string (value, unity_filter_option_get_id (self));
00815               break;
00816               case UNITY_FILTER_OPTION_DISPLAY_NAME:
00817               g_value_set_string (value, unity_filter_option_get_display_name (self));
00818               break;
00819               case UNITY_FILTER_OPTION_ICON_HINT:
00820               g_value_set_object (value, unity_filter_option_get_icon_hint (self));
00821               break;
00822               case UNITY_FILTER_OPTION_ACTIVE:
00823               g_value_set_boolean (value, unity_filter_option_get_active (self));
00824               break;
00825               default:
00826               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00827               break;
00828        }
00829 }
00830 
00831 
00832 static void _vala_unity_filter_option_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
00833        UnityFilterOption * self;
00834        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_FILTER_OPTION, UnityFilterOption);
00835        switch (property_id) {
00836               case UNITY_FILTER_OPTION_ID:
00837               unity_filter_option_set_id (self, g_value_get_string (value));
00838               break;
00839               case UNITY_FILTER_OPTION_DISPLAY_NAME:
00840               unity_filter_option_set_display_name (self, g_value_get_string (value));
00841               break;
00842               case UNITY_FILTER_OPTION_ICON_HINT:
00843               unity_filter_option_set_icon_hint (self, g_value_get_object (value));
00844               break;
00845               case UNITY_FILTER_OPTION_ACTIVE:
00846               unity_filter_option_set_active (self, g_value_get_boolean (value));
00847               break;
00848               default:
00849               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00850               break;
00851        }
00852 }
00853 
00854 
00855 GType unity_options_filter_sort_type_get_type (void) {
00856        static volatile gsize unity_options_filter_sort_type_type_id__volatile = 0;
00857        if (g_once_init_enter (&unity_options_filter_sort_type_type_id__volatile)) {
00858               static const GEnumValue values[] = {{UNITY_OPTIONS_FILTER_SORT_TYPE_MANUAL, "UNITY_OPTIONS_FILTER_SORT_TYPE_MANUAL", "manual"}, {UNITY_OPTIONS_FILTER_SORT_TYPE_DISPLAY_NAME, "UNITY_OPTIONS_FILTER_SORT_TYPE_DISPLAY_NAME", "display-name"}, {UNITY_OPTIONS_FILTER_SORT_TYPE_ID, "UNITY_OPTIONS_FILTER_SORT_TYPE_ID", "id"}, {0, NULL, NULL}};
00859               GType unity_options_filter_sort_type_type_id;
00860               unity_options_filter_sort_type_type_id = g_enum_register_static ("UnityOptionsFilterSortType", values);
00861               g_once_init_leave (&unity_options_filter_sort_type_type_id__volatile, unity_options_filter_sort_type_type_id);
00862        }
00863        return unity_options_filter_sort_type_type_id__volatile;
00864 }
00865 
00866 
00867 static void _g_object_unref0_ (gpointer var) {
00868        (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
00869 }
00870 
00871 
00872 static void _g_list_free__g_object_unref0_ (GList* self) {
00873        g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
00874        g_list_free (self);
00875 }
00876 
00877 
00878 static gint _unity_options_filter_sort_by_display_name_gcompare_func (gconstpointer a, gconstpointer b) {
00879        gint result;
00880        result = unity_options_filter_sort_by_display_name (a, b);
00881        return result;
00882 }
00883 
00884 
00885 static gint _unity_options_filter_sort_by_id_gcompare_func (gconstpointer a, gconstpointer b) {
00886        gint result;
00887        result = unity_options_filter_sort_by_id (a, b);
00888        return result;
00889 }
00890 
00891 
00892 UnityFilterOption* unity_options_filter_add_option (UnityOptionsFilter* self, const gchar* id, const gchar* display_name, GIcon* icon_hint) {
00893        UnityFilterOption* result = NULL;
00894        const gchar* _tmp0_;
00895        const gchar* _tmp1_;
00896        GIcon* _tmp2_;
00897        UnityFilterOption* _tmp3_;
00898        UnityFilterOption* option;
00899        UnityOptionsFilterSortType _tmp4_;
00900        g_return_val_if_fail (self != NULL, NULL);
00901        g_return_val_if_fail (id != NULL, NULL);
00902        g_return_val_if_fail (display_name != NULL, NULL);
00903        _tmp0_ = id;
00904        _tmp1_ = display_name;
00905        _tmp2_ = icon_hint;
00906        _tmp3_ = unity_filter_option_new (_tmp0_, _tmp1_, _tmp2_, FALSE);
00907        option = _tmp3_;
00908        _tmp4_ = self->priv->_sort_type;
00909        switch (_tmp4_) {
00910               case UNITY_OPTIONS_FILTER_SORT_TYPE_DISPLAY_NAME:
00911               {
00912                      UnityFilterOption* _tmp5_;
00913                      UnityFilterOption* _tmp6_;
00914                      _tmp5_ = option;
00915                      _tmp6_ = _g_object_ref0 (_tmp5_);
00916                      self->options = g_list_insert_sorted (self->options, _tmp6_, _unity_options_filter_sort_by_display_name_gcompare_func);
00917                      break;
00918               }
00919               case UNITY_OPTIONS_FILTER_SORT_TYPE_ID:
00920               {
00921                      UnityFilterOption* _tmp7_;
00922                      UnityFilterOption* _tmp8_;
00923                      _tmp7_ = option;
00924                      _tmp8_ = _g_object_ref0 (_tmp7_);
00925                      self->options = g_list_insert_sorted (self->options, _tmp8_, _unity_options_filter_sort_by_id_gcompare_func);
00926                      break;
00927               }
00928               default:
00929               case UNITY_OPTIONS_FILTER_SORT_TYPE_MANUAL:
00930               {
00931                      UnityFilterOption* _tmp9_;
00932                      UnityFilterOption* _tmp10_;
00933                      _tmp9_ = option;
00934                      _tmp10_ = _g_object_ref0 (_tmp9_);
00935                      self->options = g_list_append (self->options, _tmp10_);
00936                      break;
00937               }
00938        }
00939        g_signal_emit_by_name ((UnityFilter*) self, "changed");
00940        result = option;
00941        return result;
00942 }
00943 
00944 
00945 static gint unity_options_filter_sort_by_display_name (UnityFilterOption* f1, UnityFilterOption* f2) {
00946        gint result = 0;
00947        UnityFilterOption* _tmp0_;
00948        const gchar* _tmp1_;
00949        const gchar* _tmp2_;
00950        UnityFilterOption* _tmp3_;
00951        const gchar* _tmp4_;
00952        const gchar* _tmp5_;
00953        gint _tmp6_ = 0;
00954        g_return_val_if_fail (f1 != NULL, 0);
00955        g_return_val_if_fail (f2 != NULL, 0);
00956        _tmp0_ = f1;
00957        _tmp1_ = unity_filter_option_get_display_name (_tmp0_);
00958        _tmp2_ = _tmp1_;
00959        _tmp3_ = f2;
00960        _tmp4_ = unity_filter_option_get_display_name (_tmp3_);
00961        _tmp5_ = _tmp4_;
00962        _tmp6_ = g_utf8_collate (_tmp2_, _tmp5_);
00963        result = _tmp6_;
00964        return result;
00965 }
00966 
00967 
00968 static gint unity_options_filter_sort_by_id (UnityFilterOption* f1, UnityFilterOption* f2) {
00969        gint result = 0;
00970        UnityFilterOption* _tmp0_;
00971        const gchar* _tmp1_;
00972        const gchar* _tmp2_;
00973        UnityFilterOption* _tmp3_;
00974        const gchar* _tmp4_;
00975        const gchar* _tmp5_;
00976        gint _tmp6_ = 0;
00977        g_return_val_if_fail (f1 != NULL, 0);
00978        g_return_val_if_fail (f2 != NULL, 0);
00979        _tmp0_ = f1;
00980        _tmp1_ = unity_filter_option_get_id (_tmp0_);
00981        _tmp2_ = _tmp1_;
00982        _tmp3_ = f2;
00983        _tmp4_ = unity_filter_option_get_id (_tmp3_);
00984        _tmp5_ = _tmp4_;
00985        _tmp6_ = g_utf8_collate (_tmp2_, _tmp5_);
00986        result = _tmp6_;
00987        return result;
00988 }
00989 
00990 
00991 UnityFilterOption* unity_options_filter_get_option (UnityOptionsFilter* self, const gchar* id) {
00992        UnityFilterOption* result = NULL;
00993        GList* _tmp0_;
00994        g_return_val_if_fail (self != NULL, NULL);
00995        g_return_val_if_fail (id != NULL, NULL);
00996        _tmp0_ = self->options;
00997        {
00998               GList* option_collection = NULL;
00999               GList* option_it = NULL;
01000               option_collection = _tmp0_;
01001               for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
01002                      UnityFilterOption* _tmp1_;
01003                      UnityFilterOption* option = NULL;
01004                      _tmp1_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
01005                      option = _tmp1_;
01006                      {
01007                             UnityFilterOption* _tmp2_;
01008                             const gchar* _tmp3_;
01009                             const gchar* _tmp4_;
01010                             const gchar* _tmp5_;
01011                             _tmp2_ = option;
01012                             _tmp3_ = unity_filter_option_get_id (_tmp2_);
01013                             _tmp4_ = _tmp3_;
01014                             _tmp5_ = id;
01015                             if (g_strcmp0 (_tmp4_, _tmp5_) == 0) {
01016                                    result = option;
01017                                    return result;
01018                             }
01019                             _g_object_unref0 (option);
01020                      }
01021               }
01022        }
01023        result = NULL;
01024        return result;
01025 }
01026 
01027 
01034 gboolean unity_options_filter_remove_option (UnityOptionsFilter* self, const gchar* id) {
01035        gboolean result = FALSE;
01036        GList* element;
01037        GList* _tmp13_;
01038        GList* _tmp16_;
01039        g_return_val_if_fail (self != NULL, FALSE);
01040        g_return_val_if_fail (id != NULL, FALSE);
01041        element = NULL;
01042        {
01043               GList* _tmp0_;
01044               GList* _tmp1_ = NULL;
01045               GList* it;
01046               _tmp0_ = self->options;
01047               _tmp1_ = g_list_first (_tmp0_);
01048               it = _tmp1_;
01049               {
01050                      gboolean _tmp2_;
01051                      _tmp2_ = TRUE;
01052                      while (TRUE) {
01053                             gboolean _tmp3_;
01054                             GList* _tmp6_;
01055                             GList* _tmp7_;
01056                             gconstpointer _tmp8_;
01057                             const gchar* _tmp9_;
01058                             const gchar* _tmp10_;
01059                             const gchar* _tmp11_;
01060                             _tmp3_ = _tmp2_;
01061                             if (!_tmp3_) {
01062                                    GList* _tmp4_;
01063                                    GList* _tmp5_;
01064                                    _tmp4_ = it;
01065                                    _tmp5_ = _tmp4_->next;
01066                                    it = _tmp5_;
01067                             }
01068                             _tmp2_ = FALSE;
01069                             _tmp6_ = it;
01070                             if (!(_tmp6_ != NULL)) {
01071                                    break;
01072                             }
01073                             _tmp7_ = it;
01074                             _tmp8_ = _tmp7_->data;
01075                             _tmp9_ = unity_filter_option_get_id ((UnityFilterOption*) _tmp8_);
01076                             _tmp10_ = _tmp9_;
01077                             _tmp11_ = id;
01078                             if (g_strcmp0 (_tmp10_, _tmp11_) == 0) {
01079                                    GList* _tmp12_;
01080                                    _tmp12_ = it;
01081                                    element = _tmp12_;
01082                                    break;
01083                             }
01084                      }
01085               }
01086        }
01087        _tmp13_ = element;
01088        if (_tmp13_ != NULL) {
01089               GList* _tmp14_;
01090               GList* _tmp15_;
01091               _tmp14_ = element;
01092               _g_object_unref0 (_tmp14_->data);
01093               _tmp14_->data = NULL;
01094               _tmp15_ = element;
01095               self->options = g_list_delete_link (self->options, _tmp15_);
01096               g_signal_emit_by_name ((UnityFilter*) self, "changed");
01097        }
01098        _tmp16_ = element;
01099        result = _tmp16_ != NULL;
01100        return result;
01101 }
01102 
01103 
01104 static void unity_options_filter_real_update (UnityFilter* base, GVariant* properties) {
01105        UnityOptionsFilter * self;
01106        GVariantIter* iter = NULL;
01107        GVariant* _tmp0_;
01108        self = (UnityOptionsFilter*) base;
01109        g_return_if_fail (properties != NULL);
01110        _tmp0_ = properties;
01111        g_variant_get (_tmp0_, "a{sv}", &iter, NULL);
01112        {
01113               gint i;
01114               i = 0;
01115               {
01116                      gboolean _tmp1_;
01117                      _tmp1_ = TRUE;
01118                      while (TRUE) {
01119                             gboolean _tmp2_;
01120                             gint _tmp4_;
01121                             GVariantIter* _tmp5_;
01122                             gsize _tmp6_ = 0UL;
01123                             gchar* key = NULL;
01124                             GVariant* val = NULL;
01125                             GVariantIter* _tmp7_;
01126                             const gchar* _tmp8_;
01127                             _tmp2_ = _tmp1_;
01128                             if (!_tmp2_) {
01129                                    gint _tmp3_;
01130                                    _tmp3_ = i;
01131                                    i = _tmp3_ + 1;
01132                             }
01133                             _tmp1_ = FALSE;
01134                             _tmp4_ = i;
01135                             _tmp5_ = iter;
01136                             _tmp6_ = g_variant_iter_n_children (_tmp5_);
01137                             if (!(((gsize) _tmp4_) < _tmp6_)) {
01138                                    break;
01139                             }
01140                             _tmp7_ = iter;
01141                             g_variant_iter_next (_tmp7_, "{sv}", &key, &val, NULL);
01142                             _tmp8_ = key;
01143                             if (g_strcmp0 (_tmp8_, "options") == 0) {
01144                                    GVariant* _tmp9_;
01145                                    _tmp9_ = val;
01146                                    unity_options_filter_load_or_update_options (self, _tmp9_);
01147                             }
01148                             _g_variant_unref0 (val);
01149                             _g_free0 (key);
01150                      }
01151               }
01152        }
01153        g_signal_emit_by_name ((UnityFilter*) self, "changed");
01154        _g_variant_iter_free0 (iter);
01155 }
01156 
01157 
01158 static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) {
01159        if ((*length) == (*size)) {
01160               *size = (*size) ? (2 * (*size)) : 4;
01161               *array = g_renew (gchar*, *array, (*size) + 1);
01162        }
01163        (*array)[(*length)++] = value;
01164        (*array)[*length] = NULL;
01165 }
01166 
01167 
01168 static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) {
01169        int i;
01170        for (i = 0; i < stack_length; i++) {
01171               if (g_strcmp0 (stack[i], needle) == 0) {
01172                      return TRUE;
01173               }
01174        }
01175        return FALSE;
01176 }
01177 
01178 
01179 void unity_options_filter_load_or_update_options (UnityOptionsFilter* self, GVariant* array) {
01180        GVariantIter* iter = NULL;
01181        GVariant* _tmp0_;
01182        gchar** _tmp1_ = NULL;
01183        gchar** option_ids;
01184        gint option_ids_length1;
01185        gint _option_ids_size_;
01186        GList* _tmp16_;
01187        guint _tmp17_ = 0U;
01188        gchar** _tmp18_;
01189        gint _tmp18__length1;
01190        g_return_if_fail (self != NULL);
01191        g_return_if_fail (array != NULL);
01192        _tmp0_ = array;
01193        g_variant_get (_tmp0_, "a(sssb)", &iter, NULL);
01194        _tmp1_ = g_new0 (gchar*, 0 + 1);
01195        option_ids = _tmp1_;
01196        option_ids_length1 = 0;
01197        _option_ids_size_ = option_ids_length1;
01198        {
01199               gint i;
01200               i = 0;
01201               {
01202                      gboolean _tmp2_;
01203                      _tmp2_ = TRUE;
01204                      while (TRUE) {
01205                             gboolean _tmp3_;
01206                             gint _tmp5_;
01207                             GVariantIter* _tmp6_;
01208                             gsize _tmp7_ = 0UL;
01209                             gchar* b_id = NULL;
01210                             gchar* b_name = NULL;
01211                             gchar* b_icon_hint = NULL;
01212                             gboolean b_active = FALSE;
01213                             GVariantIter* _tmp8_;
01214                             const gchar* _tmp9_;
01215                             const gchar* _tmp10_;
01216                             const gchar* _tmp11_;
01217                             gboolean _tmp12_;
01218                             gchar** _tmp13_;
01219                             gint _tmp13__length1;
01220                             const gchar* _tmp14_;
01221                             gchar* _tmp15_;
01222                             _tmp3_ = _tmp2_;
01223                             if (!_tmp3_) {
01224                                    gint _tmp4_;
01225                                    _tmp4_ = i;
01226                                    i = _tmp4_ + 1;
01227                             }
01228                             _tmp2_ = FALSE;
01229                             _tmp5_ = i;
01230                             _tmp6_ = iter;
01231                             _tmp7_ = g_variant_iter_n_children (_tmp6_);
01232                             if (!(((gsize) _tmp5_) < _tmp7_)) {
01233                                    break;
01234                             }
01235                             _tmp8_ = iter;
01236                             g_variant_iter_next (_tmp8_, "(sssb)", &b_id, &b_name, &b_icon_hint, &b_active, NULL);
01237                             _tmp9_ = b_id;
01238                             _tmp10_ = b_name;
01239                             _tmp11_ = b_icon_hint;
01240                             _tmp12_ = b_active;
01241                             unity_options_filter_find_and_update_option (self, _tmp9_, _tmp10_, _tmp11_, _tmp12_);
01242                             _tmp13_ = option_ids;
01243                             _tmp13__length1 = option_ids_length1;
01244                             _tmp14_ = b_id;
01245                             _tmp15_ = g_strdup (_tmp14_);
01246                             _vala_array_add1 (&option_ids, &option_ids_length1, &_option_ids_size_, _tmp15_);
01247                             _g_free0 (b_icon_hint);
01248                             _g_free0 (b_name);
01249                             _g_free0 (b_id);
01250                      }
01251               }
01252        }
01253        _tmp16_ = self->options;
01254        _tmp17_ = g_list_length (_tmp16_);
01255        _tmp18_ = option_ids;
01256        _tmp18__length1 = option_ids_length1;
01257        if (_tmp17_ != ((guint) _tmp18__length1)) {
01258               GList* _tmp19_;
01259               GList* l;
01260               _tmp19_ = self->options;
01261               l = _tmp19_;
01262               while (TRUE) {
01263                      GList* _tmp20_;
01264                      GList* _tmp21_;
01265                      gconstpointer _tmp22_;
01266                      const gchar* _tmp23_;
01267                      const gchar* _tmp24_;
01268                      const gchar* id;
01269                      GList* _tmp25_;
01270                      GList* to_remove;
01271                      GList* _tmp26_;
01272                      GList* _tmp27_;
01273                      const gchar* _tmp28_;
01274                      gchar** _tmp29_;
01275                      gint _tmp29__length1;
01276                      _tmp20_ = l;
01277                      if (!(_tmp20_ != NULL)) {
01278                             break;
01279                      }
01280                      _tmp21_ = l;
01281                      _tmp22_ = _tmp21_->data;
01282                      _tmp23_ = unity_filter_option_get_id ((UnityFilterOption*) _tmp22_);
01283                      _tmp24_ = _tmp23_;
01284                      id = _tmp24_;
01285                      _tmp25_ = l;
01286                      to_remove = _tmp25_;
01287                      _tmp26_ = l;
01288                      _tmp27_ = _tmp26_->next;
01289                      l = _tmp27_;
01290                      _tmp28_ = id;
01291                      _tmp29_ = option_ids;
01292                      _tmp29__length1 = option_ids_length1;
01293                      if (!_vala_string_array_contains (_tmp29_, _tmp29__length1, _tmp28_)) {
01294                             GList* _tmp30_;
01295                             GList* _tmp31_;
01296                             _tmp30_ = to_remove;
01297                             _g_object_unref0 (_tmp30_->data);
01298                             _tmp30_->data = NULL;
01299                             _tmp31_ = to_remove;
01300                             self->options = g_list_delete_link (self->options, _tmp31_);
01301                      }
01302               }
01303        }
01304        option_ids = (_vala_array_free (option_ids, option_ids_length1, (GDestroyNotify) g_free), NULL);
01305        _g_variant_iter_free0 (iter);
01306 }
01307 
01308 
01309 void unity_options_filter_find_and_update_option (UnityOptionsFilter* self, const gchar* id, const gchar* name, const gchar* icon_hint_s, gboolean active) {
01310        GList* _tmp0_;
01311        GIcon* icon_hint;
01312        const gchar* _tmp15_;
01313        const gchar* _tmp16_;
01314        GIcon* _tmp17_;
01315        gboolean _tmp18_;
01316        UnityFilterOption* _tmp19_;
01317        UnityFilterOption* option;
01318        UnityFilterOption* _tmp20_;
01319        UnityFilterOption* _tmp21_;
01320        GError * _inner_error_ = NULL;
01321        g_return_if_fail (self != NULL);
01322        g_return_if_fail (id != NULL);
01323        g_return_if_fail (name != NULL);
01324        g_return_if_fail (icon_hint_s != NULL);
01325        _tmp0_ = self->options;
01326        {
01327               GList* option_collection = NULL;
01328               GList* option_it = NULL;
01329               option_collection = _tmp0_;
01330               for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
01331                      UnityFilterOption* _tmp1_;
01332                      UnityFilterOption* option = NULL;
01333                      _tmp1_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
01334                      option = _tmp1_;
01335                      {
01336                             UnityFilterOption* _tmp2_;
01337                             const gchar* _tmp3_;
01338                             const gchar* _tmp4_;
01339                             const gchar* _tmp5_;
01340                             _tmp2_ = option;
01341                             _tmp3_ = unity_filter_option_get_id (_tmp2_);
01342                             _tmp4_ = _tmp3_;
01343                             _tmp5_ = id;
01344                             if (g_strcmp0 (_tmp4_, _tmp5_) == 0) {
01345                                    UnityFilterOption* _tmp6_;
01346                                    gboolean _tmp7_;
01347                                    _tmp6_ = option;
01348                                    _tmp7_ = active;
01349                                    unity_filter_option_set_active (_tmp6_, _tmp7_);
01350                                    _g_object_unref0 (option);
01351                                    return;
01352                             }
01353                             _g_object_unref0 (option);
01354                      }
01355               }
01356        }
01357        icon_hint = NULL;
01358        {
01359               const gchar* _tmp8_;
01360               _tmp8_ = icon_hint_s;
01361               if (g_strcmp0 (_tmp8_, "") != 0) {
01362                      const gchar* _tmp9_;
01363                      GIcon* _tmp10_ = NULL;
01364                      GIcon* _tmp11_;
01365                      _tmp9_ = icon_hint_s;
01366                      _tmp10_ = g_icon_new_for_string (_tmp9_, &_inner_error_);
01367                      _tmp11_ = _tmp10_;
01368                      if (_inner_error_ != NULL) {
01369                             goto __catch17_g_error;
01370                      }
01371                      _g_object_unref0 (icon_hint);
01372                      icon_hint = _tmp11_;
01373               }
01374        }
01375        goto __finally17;
01376        __catch17_g_error:
01377        {
01378               GError* e = NULL;
01379               const gchar* _tmp12_;
01380               GError* _tmp13_;
01381               const gchar* _tmp14_;
01382               e = _inner_error_;
01383               _inner_error_ = NULL;
01384               _tmp12_ = icon_hint_s;
01385               _tmp13_ = e;
01386               _tmp14_ = _tmp13_->message;
01387               g_warning ("unity-lens-filters.vala:302: Unable to parse GIcon data '%s': %s", _tmp12_, _tmp14_);
01388               _g_error_free0 (e);
01389        }
01390        __finally17:
01391        if (_inner_error_ != NULL) {
01392               _g_object_unref0 (icon_hint);
01393               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);
01394               g_clear_error (&_inner_error_);
01395               return;
01396        }
01397        _tmp15_ = id;
01398        _tmp16_ = name;
01399        _tmp17_ = icon_hint;
01400        _tmp18_ = active;
01401        _tmp19_ = unity_filter_option_new (_tmp15_, _tmp16_, _tmp17_, _tmp18_);
01402        option = _tmp19_;
01403        _tmp20_ = option;
01404        _tmp21_ = _g_object_ref0 (_tmp20_);
01405        self->options = g_list_append (self->options, _tmp21_);
01406        _g_object_unref0 (option);
01407        _g_object_unref0 (icon_hint);
01408 }
01409 
01410 
01411 static void _g_free0_ (gpointer var) {
01412        var = (g_free (var), NULL);
01413 }
01414 
01415 
01416 static void _g_variant_unref0_ (gpointer var) {
01417        (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
01418 }
01419 
01420 
01421 static GHashTable* unity_options_filter_real_get_hints (UnityFilter* base) {
01422        UnityOptionsFilter * self;
01423        GHashTable* result = NULL;
01424        GVariantType* _tmp0_;
01425        GVariantType* _tmp1_;
01426        GVariantBuilder* _tmp2_;
01427        GVariantBuilder* _tmp3_;
01428        GVariantBuilder* b;
01429        GList* _tmp4_;
01430        GHashTable* _tmp28_;
01431        GHashTable* hash;
01432        gchar* _tmp29_;
01433        GVariantBuilder* _tmp30_;
01434        GVariant* _tmp31_ = NULL;
01435        self = (UnityOptionsFilter*) base;
01436        _tmp0_ = g_variant_type_new ("a(sssb)");
01437        _tmp1_ = _tmp0_;
01438        _tmp2_ = g_variant_builder_new (_tmp1_);
01439        _tmp3_ = _tmp2_;
01440        _g_variant_type_free0 (_tmp1_);
01441        b = _tmp3_;
01442        _tmp4_ = self->options;
01443        {
01444               GList* option_collection = NULL;
01445               GList* option_it = NULL;
01446               option_collection = _tmp4_;
01447               for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
01448                      UnityFilterOption* _tmp5_;
01449                      UnityFilterOption* option = NULL;
01450                      _tmp5_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
01451                      option = _tmp5_;
01452                      {
01453                             gchar* _tmp6_ = NULL;
01454                             UnityFilterOption* _tmp7_;
01455                             GIcon* _tmp8_;
01456                             GIcon* _tmp9_;
01457                             const gchar* _tmp15_;
01458                             gchar* _tmp16_;
01459                             gchar* icon_string;
01460                             GVariantBuilder* _tmp17_;
01461                             UnityFilterOption* _tmp18_;
01462                             const gchar* _tmp19_;
01463                             const gchar* _tmp20_;
01464                             UnityFilterOption* _tmp21_;
01465                             const gchar* _tmp22_;
01466                             const gchar* _tmp23_;
01467                             const gchar* _tmp24_;
01468                             UnityFilterOption* _tmp25_;
01469                             gboolean _tmp26_;
01470                             gboolean _tmp27_;
01471                             _tmp7_ = option;
01472                             _tmp8_ = unity_filter_option_get_icon_hint (_tmp7_);
01473                             _tmp9_ = _tmp8_;
01474                             if (_tmp9_ != NULL) {
01475                                    UnityFilterOption* _tmp10_;
01476                                    GIcon* _tmp11_;
01477                                    GIcon* _tmp12_;
01478                                    gchar* _tmp13_ = NULL;
01479                                    _tmp10_ = option;
01480                                    _tmp11_ = unity_filter_option_get_icon_hint (_tmp10_);
01481                                    _tmp12_ = _tmp11_;
01482                                    _tmp13_ = g_icon_to_string (_tmp12_);
01483                                    _g_free0 (_tmp6_);
01484                                    _tmp6_ = _tmp13_;
01485                             } else {
01486                                    gchar* _tmp14_;
01487                                    _tmp14_ = g_strdup ("");
01488                                    _g_free0 (_tmp6_);
01489                                    _tmp6_ = _tmp14_;
01490                             }
01491                             _tmp15_ = _tmp6_;
01492                             _tmp16_ = g_strdup (_tmp15_);
01493                             icon_string = _tmp16_;
01494                             _tmp17_ = b;
01495                             _tmp18_ = option;
01496                             _tmp19_ = unity_filter_option_get_id (_tmp18_);
01497                             _tmp20_ = _tmp19_;
01498                             _tmp21_ = option;
01499                             _tmp22_ = unity_filter_option_get_display_name (_tmp21_);
01500                             _tmp23_ = _tmp22_;
01501                             _tmp24_ = icon_string;
01502                             _tmp25_ = option;
01503                             _tmp26_ = unity_filter_option_get_active (_tmp25_);
01504                             _tmp27_ = _tmp26_;
01505                             g_variant_builder_add (_tmp17_, "(sssb)", _tmp20_, _tmp23_, _tmp24_, _tmp27_, NULL);
01506                             _g_free0 (icon_string);
01507                             _g_free0 (_tmp6_);
01508                             _g_object_unref0 (option);
01509                      }
01510               }
01511        }
01512        _tmp28_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_variant_unref0_);
01513        hash = _tmp28_;
01514        _tmp29_ = g_strdup ("options");
01515        _tmp30_ = b;
01516        _tmp31_ = g_variant_builder_end (_tmp30_);
01517        g_variant_ref_sink (_tmp31_);
01518        g_hash_table_insert (hash, _tmp29_, _tmp31_);
01519        result = hash;
01520        _g_variant_builder_unref0 (b);
01521        return result;
01522 }
01523 
01524 
01525 UnityOptionsFilter* unity_options_filter_construct (GType object_type) {
01526        UnityOptionsFilter * self = NULL;
01527        self = (UnityOptionsFilter*) unity_filter_construct (object_type);
01528        return self;
01529 }
01530 
01531 
01532 UnityOptionsFilter* unity_options_filter_new (void) {
01533        return unity_options_filter_construct (UNITY_TYPE_OPTIONS_FILTER);
01534 }
01535 
01536 
01537 UnityOptionsFilterSortType unity_options_filter_get_sort_type (UnityOptionsFilter* self) {
01538        UnityOptionsFilterSortType result;
01539        UnityOptionsFilterSortType _tmp0_;
01540        g_return_val_if_fail (self != NULL, 0);
01541        _tmp0_ = self->priv->_sort_type;
01542        result = _tmp0_;
01543        return result;
01544 }
01545 
01546 
01547 void unity_options_filter_set_sort_type (UnityOptionsFilter* self, UnityOptionsFilterSortType value) {
01548        UnityOptionsFilterSortType _tmp0_;
01549        g_return_if_fail (self != NULL);
01550        _tmp0_ = value;
01551        self->priv->_sort_type = _tmp0_;
01552        g_object_notify ((GObject *) self, "sort-type");
01553 }
01554 
01555 
01556 static void unity_options_filter_class_init (UnityOptionsFilterClass * klass) {
01557        unity_options_filter_parent_class = g_type_class_peek_parent (klass);
01558        g_type_class_add_private (klass, sizeof (UnityOptionsFilterPrivate));
01559        UNITY_FILTER_CLASS (klass)->update = unity_options_filter_real_update;
01560        UNITY_FILTER_CLASS (klass)->get_hints = unity_options_filter_real_get_hints;
01561        G_OBJECT_CLASS (klass)->get_property = _vala_unity_options_filter_get_property;
01562        G_OBJECT_CLASS (klass)->set_property = _vala_unity_options_filter_set_property;
01563        G_OBJECT_CLASS (klass)->finalize = unity_options_filter_finalize;
01564        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_OPTIONS_FILTER_SORT_TYPE, g_param_spec_enum ("sort-type", "sort-type", "sort-type", UNITY_OPTIONS_FILTER_TYPE_SORT_TYPE, UNITY_OPTIONS_FILTER_SORT_TYPE_MANUAL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01565 }
01566 
01567 
01568 static void unity_options_filter_instance_init (UnityOptionsFilter * self) {
01569        self->priv = UNITY_OPTIONS_FILTER_GET_PRIVATE (self);
01570        self->priv->_sort_type = UNITY_OPTIONS_FILTER_SORT_TYPE_MANUAL;
01571 }
01572 
01573 
01574 static void unity_options_filter_finalize (GObject* obj) {
01575        UnityOptionsFilter * self;
01576        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_OPTIONS_FILTER, UnityOptionsFilter);
01577        __g_list_free__g_object_unref0_0 (self->options);
01578        G_OBJECT_CLASS (unity_options_filter_parent_class)->finalize (obj);
01579 }
01580 
01581 
01582 GType unity_options_filter_get_type (void) {
01583        static volatile gsize unity_options_filter_type_id__volatile = 0;
01584        if (g_once_init_enter (&unity_options_filter_type_id__volatile)) {
01585               static const GTypeInfo g_define_type_info = { sizeof (UnityOptionsFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_options_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityOptionsFilter), 0, (GInstanceInitFunc) unity_options_filter_instance_init, NULL };
01586               GType unity_options_filter_type_id;
01587               unity_options_filter_type_id = g_type_register_static (UNITY_TYPE_FILTER, "UnityOptionsFilter", &g_define_type_info, 0);
01588               g_once_init_leave (&unity_options_filter_type_id__volatile, unity_options_filter_type_id);
01589        }
01590        return unity_options_filter_type_id__volatile;
01591 }
01592 
01593 
01594 static void _vala_unity_options_filter_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
01595        UnityOptionsFilter * self;
01596        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_OPTIONS_FILTER, UnityOptionsFilter);
01597        switch (property_id) {
01598               case UNITY_OPTIONS_FILTER_SORT_TYPE:
01599               g_value_set_enum (value, unity_options_filter_get_sort_type (self));
01600               break;
01601               default:
01602               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01603               break;
01604        }
01605 }
01606 
01607 
01608 static void _vala_unity_options_filter_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
01609        UnityOptionsFilter * self;
01610        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_OPTIONS_FILTER, UnityOptionsFilter);
01611        switch (property_id) {
01612               case UNITY_OPTIONS_FILTER_SORT_TYPE:
01613               unity_options_filter_set_sort_type (self, g_value_get_enum (value));
01614               break;
01615               default:
01616               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01617               break;
01618        }
01619 }
01620 
01621 
01622 UnityRadioOptionFilter* unity_radio_option_filter_construct (GType object_type, const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01623        UnityRadioOptionFilter * self = NULL;
01624        const gchar* _tmp0_;
01625        const gchar* _tmp1_;
01626        GIcon* _tmp2_;
01627        gboolean _tmp3_;
01628        g_return_val_if_fail (id != NULL, NULL);
01629        g_return_val_if_fail (display_name != NULL, NULL);
01630        _tmp0_ = id;
01631        _tmp1_ = display_name;
01632        _tmp2_ = icon_hint;
01633        _tmp3_ = collapsed;
01634        self = (UnityRadioOptionFilter*) g_object_new (object_type, "id", _tmp0_, "display-name", _tmp1_, "icon-hint", _tmp2_, "collapsed", _tmp3_, "renderer", UNITY_FILTER_RENDERER_RADIO_OPTIONS, "visible", TRUE, "filtering", FALSE, NULL);
01635        return self;
01636 }
01637 
01638 
01639 UnityRadioOptionFilter* unity_radio_option_filter_new (const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01640        return unity_radio_option_filter_construct (UNITY_TYPE_RADIO_OPTION_FILTER, id, display_name, icon_hint, collapsed);
01641 }
01642 
01643 
01644 UnityFilterOption* unity_radio_option_filter_get_active_option (UnityRadioOptionFilter* self) {
01645        UnityFilterOption* result = NULL;
01646        GList* _tmp0_;
01647        g_return_val_if_fail (self != NULL, NULL);
01648        _tmp0_ = ((UnityOptionsFilter*) self)->options;
01649        {
01650               GList* option_collection = NULL;
01651               GList* option_it = NULL;
01652               option_collection = _tmp0_;
01653               for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
01654                      UnityFilterOption* _tmp1_;
01655                      UnityFilterOption* option = NULL;
01656                      _tmp1_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
01657                      option = _tmp1_;
01658                      {
01659                             UnityFilterOption* _tmp2_;
01660                             gboolean _tmp3_;
01661                             gboolean _tmp4_;
01662                             _tmp2_ = option;
01663                             _tmp3_ = unity_filter_option_get_active (_tmp2_);
01664                             _tmp4_ = _tmp3_;
01665                             if (_tmp4_) {
01666                                    result = option;
01667                                    return result;
01668                             }
01669                             _g_object_unref0 (option);
01670                      }
01671               }
01672        }
01673        result = NULL;
01674        return result;
01675 }
01676 
01677 
01678 static void unity_radio_option_filter_class_init (UnityRadioOptionFilterClass * klass) {
01679        unity_radio_option_filter_parent_class = g_type_class_peek_parent (klass);
01680 }
01681 
01682 
01683 static void unity_radio_option_filter_instance_init (UnityRadioOptionFilter * self) {
01684 }
01685 
01686 
01687 GType unity_radio_option_filter_get_type (void) {
01688        static volatile gsize unity_radio_option_filter_type_id__volatile = 0;
01689        if (g_once_init_enter (&unity_radio_option_filter_type_id__volatile)) {
01690               static const GTypeInfo g_define_type_info = { sizeof (UnityRadioOptionFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_radio_option_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityRadioOptionFilter), 0, (GInstanceInitFunc) unity_radio_option_filter_instance_init, NULL };
01691               GType unity_radio_option_filter_type_id;
01692               unity_radio_option_filter_type_id = g_type_register_static (UNITY_TYPE_OPTIONS_FILTER, "UnityRadioOptionFilter", &g_define_type_info, 0);
01693               g_once_init_leave (&unity_radio_option_filter_type_id__volatile, unity_radio_option_filter_type_id);
01694        }
01695        return unity_radio_option_filter_type_id__volatile;
01696 }
01697 
01698 
01699 UnityCheckOptionFilter* unity_check_option_filter_construct (GType object_type, const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01700        UnityCheckOptionFilter * self = NULL;
01701        const gchar* _tmp0_;
01702        const gchar* _tmp1_;
01703        GIcon* _tmp2_;
01704        gboolean _tmp3_;
01705        g_return_val_if_fail (id != NULL, NULL);
01706        g_return_val_if_fail (display_name != NULL, NULL);
01707        _tmp0_ = id;
01708        _tmp1_ = display_name;
01709        _tmp2_ = icon_hint;
01710        _tmp3_ = collapsed;
01711        self = (UnityCheckOptionFilter*) g_object_new (object_type, "id", _tmp0_, "display-name", _tmp1_, "icon-hint", _tmp2_, "collapsed", _tmp3_, "renderer", UNITY_FILTER_RENDERER_CHECK_OPTIONS, "visible", TRUE, "filtering", FALSE, NULL);
01712        return self;
01713 }
01714 
01715 
01716 UnityCheckOptionFilter* unity_check_option_filter_new (const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01717        return unity_check_option_filter_construct (UNITY_TYPE_CHECK_OPTION_FILTER, id, display_name, icon_hint, collapsed);
01718 }
01719 
01720 
01721 static void unity_check_option_filter_class_init (UnityCheckOptionFilterClass * klass) {
01722        unity_check_option_filter_parent_class = g_type_class_peek_parent (klass);
01723 }
01724 
01725 
01726 static void unity_check_option_filter_instance_init (UnityCheckOptionFilter * self) {
01727 }
01728 
01729 
01730 GType unity_check_option_filter_get_type (void) {
01731        static volatile gsize unity_check_option_filter_type_id__volatile = 0;
01732        if (g_once_init_enter (&unity_check_option_filter_type_id__volatile)) {
01733               static const GTypeInfo g_define_type_info = { sizeof (UnityCheckOptionFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_check_option_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityCheckOptionFilter), 0, (GInstanceInitFunc) unity_check_option_filter_instance_init, NULL };
01734               GType unity_check_option_filter_type_id;
01735               unity_check_option_filter_type_id = g_type_register_static (UNITY_TYPE_OPTIONS_FILTER, "UnityCheckOptionFilter", &g_define_type_info, 0);
01736               g_once_init_leave (&unity_check_option_filter_type_id__volatile, unity_check_option_filter_type_id);
01737        }
01738        return unity_check_option_filter_type_id__volatile;
01739 }
01740 
01741 
01742 UnityCheckOptionFilterCompact* unity_check_option_filter_compact_construct (GType object_type, const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01743        UnityCheckOptionFilterCompact * self = NULL;
01744        const gchar* _tmp0_;
01745        const gchar* _tmp1_;
01746        GIcon* _tmp2_;
01747        gboolean _tmp3_;
01748        g_return_val_if_fail (id != NULL, NULL);
01749        g_return_val_if_fail (display_name != NULL, NULL);
01750        _tmp0_ = id;
01751        _tmp1_ = display_name;
01752        _tmp2_ = icon_hint;
01753        _tmp3_ = collapsed;
01754        self = (UnityCheckOptionFilterCompact*) g_object_new (object_type, "id", _tmp0_, "display-name", _tmp1_, "icon-hint", _tmp2_, "collapsed", _tmp3_, "renderer", UNITY_FILTER_RENDERER_CHECK_OPTIONS_COMPACT, "visible", TRUE, "filtering", FALSE, NULL);
01755        return self;
01756 }
01757 
01758 
01759 UnityCheckOptionFilterCompact* unity_check_option_filter_compact_new (const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01760        return unity_check_option_filter_compact_construct (UNITY_TYPE_CHECK_OPTION_FILTER_COMPACT, id, display_name, icon_hint, collapsed);
01761 }
01762 
01763 
01764 static void unity_check_option_filter_compact_class_init (UnityCheckOptionFilterCompactClass * klass) {
01765        unity_check_option_filter_compact_parent_class = g_type_class_peek_parent (klass);
01766 }
01767 
01768 
01769 static void unity_check_option_filter_compact_instance_init (UnityCheckOptionFilterCompact * self) {
01770 }
01771 
01772 
01773 GType unity_check_option_filter_compact_get_type (void) {
01774        static volatile gsize unity_check_option_filter_compact_type_id__volatile = 0;
01775        if (g_once_init_enter (&unity_check_option_filter_compact_type_id__volatile)) {
01776               static const GTypeInfo g_define_type_info = { sizeof (UnityCheckOptionFilterCompactClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_check_option_filter_compact_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityCheckOptionFilterCompact), 0, (GInstanceInitFunc) unity_check_option_filter_compact_instance_init, NULL };
01777               GType unity_check_option_filter_compact_type_id;
01778               unity_check_option_filter_compact_type_id = g_type_register_static (UNITY_TYPE_OPTIONS_FILTER, "UnityCheckOptionFilterCompact", &g_define_type_info, 0);
01779               g_once_init_leave (&unity_check_option_filter_compact_type_id__volatile, unity_check_option_filter_compact_type_id);
01780        }
01781        return unity_check_option_filter_compact_type_id__volatile;
01782 }
01783 
01784 
01785 UnityRatingsFilter* unity_ratings_filter_construct (GType object_type, const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01786        UnityRatingsFilter * self = NULL;
01787        const gchar* _tmp0_;
01788        const gchar* _tmp1_;
01789        GIcon* _tmp2_;
01790        gboolean _tmp3_;
01791        g_return_val_if_fail (id != NULL, NULL);
01792        g_return_val_if_fail (display_name != NULL, NULL);
01793        _tmp0_ = id;
01794        _tmp1_ = display_name;
01795        _tmp2_ = icon_hint;
01796        _tmp3_ = collapsed;
01797        self = (UnityRatingsFilter*) g_object_new (object_type, "id", _tmp0_, "display-name", _tmp1_, "icon-hint", _tmp2_, "collapsed", _tmp3_, "renderer", UNITY_FILTER_RENDERER_RATINGS, "rating", 0.0f, "visible", TRUE, "filtering", FALSE, NULL);
01798        return self;
01799 }
01800 
01801 
01802 UnityRatingsFilter* unity_ratings_filter_new (const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01803        return unity_ratings_filter_construct (UNITY_TYPE_RATINGS_FILTER, id, display_name, icon_hint, collapsed);
01804 }
01805 
01806 
01807 static void unity_ratings_filter_real_update (UnityFilter* base, GVariant* properties) {
01808        UnityRatingsFilter * self;
01809        GVariantIter* iter = NULL;
01810        GVariant* _tmp0_;
01811        self = (UnityRatingsFilter*) base;
01812        g_return_if_fail (properties != NULL);
01813        _tmp0_ = properties;
01814        g_variant_get (_tmp0_, "a{sv}", &iter, NULL);
01815        {
01816               gint i;
01817               i = 0;
01818               {
01819                      gboolean _tmp1_;
01820                      _tmp1_ = TRUE;
01821                      while (TRUE) {
01822                             gboolean _tmp2_;
01823                             gint _tmp4_;
01824                             GVariantIter* _tmp5_;
01825                             gsize _tmp6_ = 0UL;
01826                             gchar* key = NULL;
01827                             GVariant* val = NULL;
01828                             GVariantIter* _tmp7_;
01829                             const gchar* _tmp8_;
01830                             _tmp2_ = _tmp1_;
01831                             if (!_tmp2_) {
01832                                    gint _tmp3_;
01833                                    _tmp3_ = i;
01834                                    i = _tmp3_ + 1;
01835                             }
01836                             _tmp1_ = FALSE;
01837                             _tmp4_ = i;
01838                             _tmp5_ = iter;
01839                             _tmp6_ = g_variant_iter_n_children (_tmp5_);
01840                             if (!(((gsize) _tmp4_) < _tmp6_)) {
01841                                    break;
01842                             }
01843                             _tmp7_ = iter;
01844                             g_variant_iter_next (_tmp7_, "{sv}", &key, &val, NULL);
01845                             _tmp8_ = key;
01846                             if (g_strcmp0 (_tmp8_, "rating") == 0) {
01847                                    GVariant* _tmp9_;
01848                                    gdouble _tmp10_ = 0.0;
01849                                    _tmp9_ = val;
01850                                    _tmp10_ = g_variant_get_double (_tmp9_);
01851                                    unity_ratings_filter_set_rating (self, (gfloat) _tmp10_);
01852                             }
01853                             _g_variant_unref0 (val);
01854                             _g_free0 (key);
01855                      }
01856               }
01857        }
01858        g_signal_emit_by_name ((UnityFilter*) self, "changed");
01859        _g_variant_iter_free0 (iter);
01860 }
01861 
01862 
01863 static GVariant* _variant_new16 (gdouble value) {
01864        return g_variant_ref_sink (g_variant_new_double (value));
01865 }
01866 
01867 
01868 static GHashTable* unity_ratings_filter_real_get_hints (UnityFilter* base) {
01869        UnityRatingsFilter * self;
01870        GHashTable* result = NULL;
01871        GHashTable* _tmp0_;
01872        GHashTable* hash;
01873        gchar* _tmp1_;
01874        GVariant* _tmp2_;
01875        self = (UnityRatingsFilter*) base;
01876        _tmp0_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_variant_unref0_);
01877        hash = _tmp0_;
01878        _tmp1_ = g_strdup ("rating");
01879        _tmp2_ = _variant_new16 (0.0);
01880        g_hash_table_insert (hash, _tmp1_, _tmp2_);
01881        result = hash;
01882        return result;
01883 }
01884 
01885 
01886 gfloat unity_ratings_filter_get_rating (UnityRatingsFilter* self) {
01887        gfloat result;
01888        gfloat _tmp0_;
01889        g_return_val_if_fail (self != NULL, 0.0F);
01890        _tmp0_ = self->priv->_rating;
01891        result = _tmp0_;
01892        return result;
01893 }
01894 
01895 
01896 void unity_ratings_filter_set_rating (UnityRatingsFilter* self, gfloat value) {
01897        gfloat _tmp0_;
01898        g_return_if_fail (self != NULL);
01899        _tmp0_ = value;
01900        self->priv->_rating = _tmp0_;
01901        g_object_notify ((GObject *) self, "rating");
01902 }
01903 
01904 
01905 static void unity_ratings_filter_class_init (UnityRatingsFilterClass * klass) {
01906        unity_ratings_filter_parent_class = g_type_class_peek_parent (klass);
01907        g_type_class_add_private (klass, sizeof (UnityRatingsFilterPrivate));
01908        UNITY_FILTER_CLASS (klass)->update = unity_ratings_filter_real_update;
01909        UNITY_FILTER_CLASS (klass)->get_hints = unity_ratings_filter_real_get_hints;
01910        G_OBJECT_CLASS (klass)->get_property = _vala_unity_ratings_filter_get_property;
01911        G_OBJECT_CLASS (klass)->set_property = _vala_unity_ratings_filter_set_property;
01912        G_OBJECT_CLASS (klass)->finalize = unity_ratings_filter_finalize;
01913        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_RATINGS_FILTER_RATING, g_param_spec_float ("rating", "rating", "rating", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
01914 }
01915 
01916 
01917 static void unity_ratings_filter_instance_init (UnityRatingsFilter * self) {
01918        self->priv = UNITY_RATINGS_FILTER_GET_PRIVATE (self);
01919 }
01920 
01921 
01922 static void unity_ratings_filter_finalize (GObject* obj) {
01923        UnityRatingsFilter * self;
01924        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_RATINGS_FILTER, UnityRatingsFilter);
01925        G_OBJECT_CLASS (unity_ratings_filter_parent_class)->finalize (obj);
01926 }
01927 
01928 
01929 GType unity_ratings_filter_get_type (void) {
01930        static volatile gsize unity_ratings_filter_type_id__volatile = 0;
01931        if (g_once_init_enter (&unity_ratings_filter_type_id__volatile)) {
01932               static const GTypeInfo g_define_type_info = { sizeof (UnityRatingsFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_ratings_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityRatingsFilter), 0, (GInstanceInitFunc) unity_ratings_filter_instance_init, NULL };
01933               GType unity_ratings_filter_type_id;
01934               unity_ratings_filter_type_id = g_type_register_static (UNITY_TYPE_FILTER, "UnityRatingsFilter", &g_define_type_info, 0);
01935               g_once_init_leave (&unity_ratings_filter_type_id__volatile, unity_ratings_filter_type_id);
01936        }
01937        return unity_ratings_filter_type_id__volatile;
01938 }
01939 
01940 
01941 static void _vala_unity_ratings_filter_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
01942        UnityRatingsFilter * self;
01943        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_RATINGS_FILTER, UnityRatingsFilter);
01944        switch (property_id) {
01945               case UNITY_RATINGS_FILTER_RATING:
01946               g_value_set_float (value, unity_ratings_filter_get_rating (self));
01947               break;
01948               default:
01949               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01950               break;
01951        }
01952 }
01953 
01954 
01955 static void _vala_unity_ratings_filter_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
01956        UnityRatingsFilter * self;
01957        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_RATINGS_FILTER, UnityRatingsFilter);
01958        switch (property_id) {
01959               case UNITY_RATINGS_FILTER_RATING:
01960               unity_ratings_filter_set_rating (self, g_value_get_float (value));
01961               break;
01962               default:
01963               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01964               break;
01965        }
01966 }
01967 
01968 
01969 UnityMultiRangeFilter* unity_multi_range_filter_construct (GType object_type, const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01970        UnityMultiRangeFilter * self = NULL;
01971        const gchar* _tmp0_;
01972        const gchar* _tmp1_;
01973        GIcon* _tmp2_;
01974        gboolean _tmp3_;
01975        g_return_val_if_fail (id != NULL, NULL);
01976        g_return_val_if_fail (display_name != NULL, NULL);
01977        _tmp0_ = id;
01978        _tmp1_ = display_name;
01979        _tmp2_ = icon_hint;
01980        _tmp3_ = collapsed;
01981        self = (UnityMultiRangeFilter*) g_object_new (object_type, "id", _tmp0_, "display-name", _tmp1_, "icon-hint", _tmp2_, "collapsed", _tmp3_, "renderer", UNITY_FILTER_RENDERER_MULTIRANGE, "visible", TRUE, "filtering", FALSE, NULL);
01982        return self;
01983 }
01984 
01985 
01986 UnityMultiRangeFilter* unity_multi_range_filter_new (const gchar* id, const gchar* display_name, GIcon* icon_hint, gboolean collapsed) {
01987        return unity_multi_range_filter_construct (UNITY_TYPE_MULTI_RANGE_FILTER, id, display_name, icon_hint, collapsed);
01988 }
01989 
01990 
01991 UnityFilterOption* unity_multi_range_filter_get_first_active (UnityMultiRangeFilter* self) {
01992        UnityFilterOption* result = NULL;
01993        GList* _tmp0_;
01994        g_return_val_if_fail (self != NULL, NULL);
01995        _tmp0_ = ((UnityOptionsFilter*) self)->options;
01996        {
01997               GList* option_collection = NULL;
01998               GList* option_it = NULL;
01999               option_collection = _tmp0_;
02000               for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
02001                      UnityFilterOption* _tmp1_;
02002                      UnityFilterOption* option = NULL;
02003                      _tmp1_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
02004                      option = _tmp1_;
02005                      {
02006                             UnityFilterOption* _tmp2_;
02007                             gboolean _tmp3_;
02008                             gboolean _tmp4_;
02009                             _tmp2_ = option;
02010                             _tmp3_ = unity_filter_option_get_active (_tmp2_);
02011                             _tmp4_ = _tmp3_;
02012                             if (_tmp4_) {
02013                                    result = option;
02014                                    return result;
02015                             }
02016                             _g_object_unref0 (option);
02017                      }
02018               }
02019        }
02020        result = NULL;
02021        return result;
02022 }
02023 
02024 
02025 UnityFilterOption* unity_multi_range_filter_get_last_active (UnityMultiRangeFilter* self) {
02026        UnityFilterOption* result = NULL;
02027        UnityFilterOption* ret;
02028        GList* _tmp0_;
02029        g_return_val_if_fail (self != NULL, NULL);
02030        ret = NULL;
02031        _tmp0_ = ((UnityOptionsFilter*) self)->options;
02032        {
02033               GList* option_collection = NULL;
02034               GList* option_it = NULL;
02035               option_collection = _tmp0_;
02036               for (option_it = option_collection; option_it != NULL; option_it = option_it->next) {
02037                      UnityFilterOption* _tmp1_;
02038                      UnityFilterOption* option = NULL;
02039                      _tmp1_ = _g_object_ref0 ((UnityFilterOption*) option_it->data);
02040                      option = _tmp1_;
02041                      {
02042                             UnityFilterOption* _tmp2_;
02043                             gboolean _tmp3_;
02044                             gboolean _tmp4_;
02045                             _tmp2_ = option;
02046                             _tmp3_ = unity_filter_option_get_active (_tmp2_);
02047                             _tmp4_ = _tmp3_;
02048                             if (_tmp4_) {
02049                                    UnityFilterOption* _tmp5_;
02050                                    UnityFilterOption* _tmp6_;
02051                                    _tmp5_ = option;
02052                                    _tmp6_ = _g_object_ref0 (_tmp5_);
02053                                    _g_object_unref0 (ret);
02054                                    ret = _tmp6_;
02055                             }
02056                             _g_object_unref0 (option);
02057                      }
02058               }
02059        }
02060        result = ret;
02061        return result;
02062 }
02063 
02064 
02065 static void unity_multi_range_filter_class_init (UnityMultiRangeFilterClass * klass) {
02066        unity_multi_range_filter_parent_class = g_type_class_peek_parent (klass);
02067 }
02068 
02069 
02070 static void unity_multi_range_filter_instance_init (UnityMultiRangeFilter * self) {
02071 }
02072 
02073 
02074 GType unity_multi_range_filter_get_type (void) {
02075        static volatile gsize unity_multi_range_filter_type_id__volatile = 0;
02076        if (g_once_init_enter (&unity_multi_range_filter_type_id__volatile)) {
02077               static const GTypeInfo g_define_type_info = { sizeof (UnityMultiRangeFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_multi_range_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMultiRangeFilter), 0, (GInstanceInitFunc) unity_multi_range_filter_instance_init, NULL };
02078               GType unity_multi_range_filter_type_id;
02079               unity_multi_range_filter_type_id = g_type_register_static (UNITY_TYPE_OPTIONS_FILTER, "UnityMultiRangeFilter", &g_define_type_info, 0);
02080               g_once_init_leave (&unity_multi_range_filter_type_id__volatile, unity_multi_range_filter_type_id);
02081        }
02082        return unity_multi_range_filter_type_id__volatile;
02083 }
02084 
02085 
02086 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
02087        if ((array != NULL) && (destroy_func != NULL)) {
02088               int i;
02089               for (i = 0; i < array_length; i = i + 1) {
02090                      if (((gpointer*) array)[i] != NULL) {
02091                             destroy_func (((gpointer*) array)[i]);
02092                      }
02093               }
02094        }
02095 }
02096 
02097 
02098 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
02099        _vala_array_destroy (array, array_length, destroy_func);
02100        g_free (array);
02101 }
02102 
02103 
02104