Back to index

libunity  5.92.0
unity-lens.c
Go to the documentation of this file.
00001 /* unity-lens.c generated by valac 0.17.2, the Vala compiler
00002  * generated from unity-lens.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 
00032 
00033 #define UNITY_TYPE_LENS_IMPL (unity_lens_impl_get_type ())
00034 #define UNITY_LENS_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_LENS_IMPL, UnityLensImpl))
00035 #define UNITY_LENS_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_LENS_IMPL, UnityLensImplClass))
00036 #define UNITY_IS_LENS_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_LENS_IMPL))
00037 #define UNITY_IS_LENS_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_LENS_IMPL))
00038 #define UNITY_LENS_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_LENS_IMPL, UnityLensImplClass))
00039 
00040 typedef struct _UnityLensImpl UnityLensImpl;
00041 typedef struct _UnityLensImplClass UnityLensImplClass;
00042 #define _g_free0(var) (var = (g_free (var), NULL))
00043 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00044 #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
00045 
00046 #define UNITY_TYPE_RESULTS_SYNCHRONIZER (unity_results_synchronizer_get_type ())
00047 #define UNITY_RESULTS_SYNCHRONIZER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_RESULTS_SYNCHRONIZER, UnityResultsSynchronizer))
00048 #define UNITY_RESULTS_SYNCHRONIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_RESULTS_SYNCHRONIZER, UnityResultsSynchronizerClass))
00049 #define UNITY_IS_RESULTS_SYNCHRONIZER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_RESULTS_SYNCHRONIZER))
00050 #define UNITY_IS_RESULTS_SYNCHRONIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_RESULTS_SYNCHRONIZER))
00051 #define UNITY_RESULTS_SYNCHRONIZER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_RESULTS_SYNCHRONIZER, UnityResultsSynchronizerClass))
00052 
00053 typedef struct _UnityResultsSynchronizer UnityResultsSynchronizer;
00054 typedef struct _UnityResultsSynchronizerClass UnityResultsSynchronizerClass;
00055 
00056 struct _UnityLensPrivate {
00057        gboolean _active;
00058        gboolean _visible;
00059        gboolean _searching;
00060        gboolean _exported;
00061        gboolean _search_in_global;
00062        gchar* _id;
00063        gchar* _dbus_path;
00064        gchar* _search_hint;
00065        gchar* _sources_display_name;
00066        UnityLensImpl* _pimpl;
00067        GList* _categories;
00068        GList* _filters;
00069 };
00070 
00071 
00072 static gpointer unity_lens_parent_class = NULL;
00073 
00074 GType unity_lens_impl_get_type (void) G_GNUC_CONST;
00075 #define UNITY_LENS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_LENS, UnityLensPrivate))
00076 enum  {
00077        UNITY_LENS_DUMMY_PROPERTY,
00078        UNITY_LENS_ACTIVE,
00079        UNITY_LENS_VISIBLE,
00080        UNITY_LENS_SEARCHING,
00081        UNITY_LENS_EXPORTED,
00082        UNITY_LENS_SEARCH_IN_GLOBAL,
00083        UNITY_LENS_ID,
00084        UNITY_LENS_DBUS_PATH,
00085        UNITY_LENS_SEARCH_HINT,
00086        UNITY_LENS_FILTERS,
00087        UNITY_LENS_CATEGORIES,
00088        UNITY_LENS_MERGE_STRATEGY,
00089        UNITY_LENS_GLOBAL_MERGE_STRATEGY,
00090        UNITY_LENS_SOURCES_DISPLAY_NAME
00091 };
00092 static void _g_object_unref0_ (gpointer var);
00093 static void _g_list_free__g_object_unref0_ (GList* self);
00094 #define UNITY_LENS_SOURCES_FILTER_ID "unity-sources"
00095 void unity_lens_impl_export (UnityLensImpl* self, GError** error);
00096 static void unity_lens_set_exported (UnityLens* self, gboolean value);
00097 void unity_lens_impl_add_local_scope (UnityLensImpl* self, UnityScope* scope);
00098 void unity_lens_set_active_internal (UnityLens* self, gboolean is_active);
00099 static void unity_lens_set_active (UnityLens* self, gboolean value);
00100 UnityOptionsFilter* unity_lens_get_sources_internal (UnityLens* self);
00101 UnityOptionsFilter* unity_lens_impl_get_sources (UnityLensImpl* self);
00102 DeeModel* unity_lens_get_model_internal (UnityLens* self, gint index);
00103 DeeModel* unity_lens_impl_get_model (UnityLensImpl* self, gint index);
00104 static void unity_lens_set_searching (UnityLens* self, gboolean value);
00105 void unity_lens_impl_load_filters (UnityLensImpl* self, GList* filters);
00106 void unity_lens_impl_load_categories (UnityLensImpl* self, GList* categories);
00107 GType unity_results_synchronizer_get_type (void) G_GNUC_CONST;
00108 UnityResultsSynchronizer* unity_lens_impl_get_results_sync (UnityLensImpl* self);
00109 UnityMergeStrategy* unity_results_synchronizer_get_merge_strategy (UnityResultsSynchronizer* self);
00110 void unity_results_synchronizer_set_merge_strategy (UnityResultsSynchronizer* self, UnityMergeStrategy* value);
00111 UnityResultsSynchronizer* unity_lens_impl_get_global_results_sync (UnityLensImpl* self);
00112 static GObject * unity_lens_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00113 UnityLensImpl* unity_lens_impl_new (UnityLens* owner);
00114 UnityLensImpl* unity_lens_impl_construct (GType object_type, UnityLens* owner);
00115 static void unity_lens_finalize (GObject* obj);
00116 static void _vala_unity_lens_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00117 static void _vala_unity_lens_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00118 
00119 
00120 static void _g_object_unref0_ (gpointer var) {
00121        (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
00122 }
00123 
00124 
00125 static void _g_list_free__g_object_unref0_ (GList* self) {
00126        g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
00127        g_list_free (self);
00128 }
00129 
00130 
00131 UnityLens* unity_lens_construct (GType object_type, const gchar* dbus_path_, const gchar* id_) {
00132        UnityLens * self = NULL;
00133        const gchar* _tmp0_;
00134        const gchar* _tmp1_;
00135        g_return_val_if_fail (dbus_path_ != NULL, NULL);
00136        g_return_val_if_fail (id_ != NULL, NULL);
00137        _tmp0_ = dbus_path_;
00138        _tmp1_ = id_;
00139        self = (UnityLens*) g_object_new (object_type, "dbus-path", _tmp0_, "id", _tmp1_, "sources-display-name", "", NULL);
00140        return self;
00141 }
00142 
00143 
00144 UnityLens* unity_lens_new (const gchar* dbus_path_, const gchar* id_) {
00145        return unity_lens_construct (UNITY_TYPE_LENS, dbus_path_, id_);
00146 }
00147 
00148 
00149 void unity_lens_export (UnityLens* self, GError** error) {
00150        gboolean _tmp0_;
00151        GError * _inner_error_ = NULL;
00152        g_return_if_fail (self != NULL);
00153        _tmp0_ = self->priv->_exported;
00154        if (!_tmp0_) {
00155               UnityLensImpl* _tmp1_;
00156               _tmp1_ = self->priv->_pimpl;
00157               unity_lens_impl_export (_tmp1_, &_inner_error_);
00158               if (_inner_error_ != NULL) {
00159                      if (_inner_error_->domain == G_IO_ERROR) {
00160                             g_propagate_error (error, _inner_error_);
00161                             return;
00162                      } else {
00163                             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);
00164                             g_clear_error (&_inner_error_);
00165                             return;
00166                      }
00167               }
00168               unity_lens_set_exported (self, TRUE);
00169        }
00170 }
00171 
00172 
00173 void unity_lens_add_local_scope (UnityLens* self, UnityScope* scope) {
00174        UnityLensImpl* _tmp0_;
00175        UnityScope* _tmp1_;
00176        g_return_if_fail (self != NULL);
00177        g_return_if_fail (scope != NULL);
00178        _tmp0_ = self->priv->_pimpl;
00179        _tmp1_ = scope;
00180        unity_lens_impl_add_local_scope (_tmp0_, _tmp1_);
00181 }
00182 
00183 
00184 void unity_lens_set_active_internal (UnityLens* self, gboolean is_active) {
00185        gboolean _tmp0_;
00186        g_return_if_fail (self != NULL);
00187        _tmp0_ = is_active;
00188        unity_lens_set_active (self, _tmp0_);
00189 }
00190 
00191 
00192 UnityOptionsFilter* unity_lens_get_sources_internal (UnityLens* self) {
00193        UnityOptionsFilter* result = NULL;
00194        UnityLensImpl* _tmp0_;
00195        UnityOptionsFilter* _tmp1_ = NULL;
00196        g_return_val_if_fail (self != NULL, NULL);
00197        _tmp0_ = self->priv->_pimpl;
00198        _tmp1_ = unity_lens_impl_get_sources (_tmp0_);
00199        result = _tmp1_;
00200        return result;
00201 }
00202 
00203 
00204 DeeModel* unity_lens_get_model_internal (UnityLens* self, gint index) {
00205        DeeModel* result = NULL;
00206        UnityLensImpl* _tmp0_;
00207        gint _tmp1_;
00208        DeeModel* _tmp2_ = NULL;
00209        g_return_val_if_fail (self != NULL, NULL);
00210        _tmp0_ = self->priv->_pimpl;
00211        _tmp1_ = index;
00212        _tmp2_ = unity_lens_impl_get_model (_tmp0_, _tmp1_);
00213        result = _tmp2_;
00214        return result;
00215 }
00216 
00217 
00218 gboolean unity_lens_get_active (UnityLens* self) {
00219        gboolean result;
00220        gboolean _tmp0_;
00221        g_return_val_if_fail (self != NULL, FALSE);
00222        _tmp0_ = self->priv->_active;
00223        result = _tmp0_;
00224        return result;
00225 }
00226 
00227 
00228 static void unity_lens_set_active (UnityLens* self, gboolean value) {
00229        gboolean _tmp0_;
00230        g_return_if_fail (self != NULL);
00231        _tmp0_ = value;
00232        self->priv->_active = _tmp0_;
00233        g_object_notify ((GObject *) self, "active");
00234 }
00235 
00236 
00237 gboolean unity_lens_get_visible (UnityLens* self) {
00238        gboolean result;
00239        gboolean _tmp0_;
00240        g_return_val_if_fail (self != NULL, FALSE);
00241        _tmp0_ = self->priv->_visible;
00242        result = _tmp0_;
00243        return result;
00244 }
00245 
00246 
00247 void unity_lens_set_visible (UnityLens* self, gboolean value) {
00248        gboolean _tmp0_;
00249        g_return_if_fail (self != NULL);
00250        _tmp0_ = value;
00251        self->priv->_visible = _tmp0_;
00252        g_object_notify ((GObject *) self, "visible");
00253 }
00254 
00255 
00256 gboolean unity_lens_get_searching (UnityLens* self) {
00257        gboolean result;
00258        gboolean _tmp0_;
00259        g_return_val_if_fail (self != NULL, FALSE);
00260        _tmp0_ = self->priv->_searching;
00261        result = _tmp0_;
00262        return result;
00263 }
00264 
00265 
00266 static void unity_lens_set_searching (UnityLens* self, gboolean value) {
00267        gboolean _tmp0_;
00268        g_return_if_fail (self != NULL);
00269        _tmp0_ = value;
00270        self->priv->_searching = _tmp0_;
00271        g_object_notify ((GObject *) self, "searching");
00272 }
00273 
00274 
00275 gboolean unity_lens_get_exported (UnityLens* self) {
00276        gboolean result;
00277        gboolean _tmp0_;
00278        g_return_val_if_fail (self != NULL, FALSE);
00279        _tmp0_ = self->priv->_exported;
00280        result = _tmp0_;
00281        return result;
00282 }
00283 
00284 
00285 static void unity_lens_set_exported (UnityLens* self, gboolean value) {
00286        gboolean _tmp0_;
00287        g_return_if_fail (self != NULL);
00288        _tmp0_ = value;
00289        self->priv->_exported = _tmp0_;
00290        g_object_notify ((GObject *) self, "exported");
00291 }
00292 
00293 
00294 gboolean unity_lens_get_search_in_global (UnityLens* self) {
00295        gboolean result;
00296        gboolean _tmp0_;
00297        g_return_val_if_fail (self != NULL, FALSE);
00298        _tmp0_ = self->priv->_search_in_global;
00299        result = _tmp0_;
00300        return result;
00301 }
00302 
00303 
00304 void unity_lens_set_search_in_global (UnityLens* self, gboolean value) {
00305        gboolean _tmp0_;
00306        g_return_if_fail (self != NULL);
00307        _tmp0_ = value;
00308        self->priv->_search_in_global = _tmp0_;
00309        g_object_notify ((GObject *) self, "search-in-global");
00310 }
00311 
00312 
00313 const gchar* unity_lens_get_id (UnityLens* self) {
00314        const gchar* result;
00315        const gchar* _tmp0_;
00316        g_return_val_if_fail (self != NULL, NULL);
00317        _tmp0_ = self->priv->_id;
00318        result = _tmp0_;
00319        return result;
00320 }
00321 
00322 
00323 static void unity_lens_set_id (UnityLens* self, const gchar* value) {
00324        const gchar* _tmp0_;
00325        gchar* _tmp1_;
00326        g_return_if_fail (self != NULL);
00327        _tmp0_ = value;
00328        _tmp1_ = g_strdup (_tmp0_);
00329        _g_free0 (self->priv->_id);
00330        self->priv->_id = _tmp1_;
00331        g_object_notify ((GObject *) self, "id");
00332 }
00333 
00334 
00335 const gchar* unity_lens_get_dbus_path (UnityLens* self) {
00336        const gchar* result;
00337        const gchar* _tmp0_;
00338        g_return_val_if_fail (self != NULL, NULL);
00339        _tmp0_ = self->priv->_dbus_path;
00340        result = _tmp0_;
00341        return result;
00342 }
00343 
00344 
00345 static void unity_lens_set_dbus_path (UnityLens* self, const gchar* value) {
00346        const gchar* _tmp0_;
00347        gchar* _tmp1_;
00348        g_return_if_fail (self != NULL);
00349        _tmp0_ = value;
00350        _tmp1_ = g_strdup (_tmp0_);
00351        _g_free0 (self->priv->_dbus_path);
00352        self->priv->_dbus_path = _tmp1_;
00353        g_object_notify ((GObject *) self, "dbus-path");
00354 }
00355 
00356 
00357 const gchar* unity_lens_get_search_hint (UnityLens* self) {
00358        const gchar* result;
00359        const gchar* _tmp0_;
00360        g_return_val_if_fail (self != NULL, NULL);
00361        _tmp0_ = self->priv->_search_hint;
00362        result = _tmp0_;
00363        return result;
00364 }
00365 
00366 
00367 void unity_lens_set_search_hint (UnityLens* self, const gchar* value) {
00368        const gchar* _tmp0_;
00369        gchar* _tmp1_;
00370        g_return_if_fail (self != NULL);
00371        _tmp0_ = value;
00372        _tmp1_ = g_strdup (_tmp0_);
00373        _g_free0 (self->priv->_search_hint);
00374        self->priv->_search_hint = _tmp1_;
00375        g_object_notify ((GObject *) self, "search-hint");
00376 }
00377 
00378 
00379 GList* unity_lens_get_filters (UnityLens* self) {
00380        GList* result;
00381        GList* _tmp0_;
00382        g_return_val_if_fail (self != NULL, NULL);
00383        _tmp0_ = self->priv->_filters;
00384        result = _tmp0_;
00385        return result;
00386 }
00387 
00388 
00389 static gpointer _g_object_ref0 (gpointer self) {
00390        return self ? g_object_ref (self) : NULL;
00391 }
00392 
00393 
00394 void unity_lens_set_filters (UnityLens* self, GList* value) {
00395        GList* _tmp0_;
00396        UnityLensImpl* _tmp4_;
00397        GList* _tmp5_;
00398        g_return_if_fail (self != NULL);
00399        __g_list_free__g_object_unref0_0 (self->priv->_filters);
00400        self->priv->_filters = NULL;
00401        _tmp0_ = value;
00402        {
00403               GList* f_collection = NULL;
00404               GList* f_it = NULL;
00405               f_collection = _tmp0_;
00406               for (f_it = f_collection; f_it != NULL; f_it = f_it->next) {
00407                      UnityFilter* _tmp1_;
00408                      UnityFilter* f = NULL;
00409                      _tmp1_ = _g_object_ref0 ((UnityFilter*) f_it->data);
00410                      f = _tmp1_;
00411                      {
00412                             UnityFilter* _tmp2_;
00413                             UnityFilter* _tmp3_;
00414                             _tmp2_ = f;
00415                             _tmp3_ = _g_object_ref0 (_tmp2_);
00416                             self->priv->_filters = g_list_prepend (self->priv->_filters, _tmp3_);
00417                             _g_object_unref0 (f);
00418                      }
00419               }
00420        }
00421        self->priv->_filters = g_list_reverse (self->priv->_filters);
00422        _tmp4_ = self->priv->_pimpl;
00423        _tmp5_ = self->priv->_filters;
00424        unity_lens_impl_load_filters (_tmp4_, _tmp5_);
00425        g_object_notify ((GObject *) self, "filters");
00426 }
00427 
00428 
00429 GList* unity_lens_get_categories (UnityLens* self) {
00430        GList* result;
00431        GList* _tmp0_;
00432        g_return_val_if_fail (self != NULL, NULL);
00433        _tmp0_ = self->priv->_categories;
00434        result = _tmp0_;
00435        return result;
00436 }
00437 
00438 
00439 void unity_lens_set_categories (UnityLens* self, GList* value) {
00440        GList* _tmp0_;
00441        g_return_if_fail (self != NULL);
00442        _tmp0_ = self->priv->_categories;
00443        if (_tmp0_ == NULL) {
00444               GList* _tmp1_;
00445               UnityLensImpl* _tmp5_;
00446               GList* _tmp6_;
00447               __g_list_free__g_object_unref0_0 (self->priv->_categories);
00448               self->priv->_categories = NULL;
00449               _tmp1_ = value;
00450               {
00451                      GList* cat_collection = NULL;
00452                      GList* cat_it = NULL;
00453                      cat_collection = _tmp1_;
00454                      for (cat_it = cat_collection; cat_it != NULL; cat_it = cat_it->next) {
00455                             UnityCategory* _tmp2_;
00456                             UnityCategory* cat = NULL;
00457                             _tmp2_ = _g_object_ref0 ((UnityCategory*) cat_it->data);
00458                             cat = _tmp2_;
00459                             {
00460                                    UnityCategory* _tmp3_;
00461                                    UnityCategory* _tmp4_;
00462                                    _tmp3_ = cat;
00463                                    _tmp4_ = _g_object_ref0 (_tmp3_);
00464                                    self->priv->_categories = g_list_prepend (self->priv->_categories, _tmp4_);
00465                                    _g_object_unref0 (cat);
00466                             }
00467                      }
00468               }
00469               self->priv->_categories = g_list_reverse (self->priv->_categories);
00470               _tmp5_ = self->priv->_pimpl;
00471               _tmp6_ = self->priv->_categories;
00472               unity_lens_impl_load_categories (_tmp5_, _tmp6_);
00473        } else {
00474               g_warning ("unity-lens.vala:62: Categories can only be set once");
00475        }
00476        g_object_notify ((GObject *) self, "categories");
00477 }
00478 
00479 
00480 UnityMergeStrategy* unity_lens_get_merge_strategy (UnityLens* self) {
00481        UnityMergeStrategy* result;
00482        UnityLensImpl* _tmp0_;
00483        UnityResultsSynchronizer* _tmp1_;
00484        UnityResultsSynchronizer* _tmp2_;
00485        UnityMergeStrategy* _tmp3_;
00486        UnityMergeStrategy* _tmp4_;
00487        g_return_val_if_fail (self != NULL, NULL);
00488        _tmp0_ = self->priv->_pimpl;
00489        _tmp1_ = unity_lens_impl_get_results_sync (_tmp0_);
00490        _tmp2_ = _tmp1_;
00491        _tmp3_ = unity_results_synchronizer_get_merge_strategy (_tmp2_);
00492        _tmp4_ = _tmp3_;
00493        result = _tmp4_;
00494        return result;
00495 }
00496 
00497 
00498 void unity_lens_set_merge_strategy (UnityLens* self, UnityMergeStrategy* value) {
00499        UnityLensImpl* _tmp0_;
00500        UnityResultsSynchronizer* _tmp1_;
00501        UnityResultsSynchronizer* _tmp2_;
00502        UnityMergeStrategy* _tmp3_;
00503        g_return_if_fail (self != NULL);
00504        _tmp0_ = self->priv->_pimpl;
00505        _tmp1_ = unity_lens_impl_get_results_sync (_tmp0_);
00506        _tmp2_ = _tmp1_;
00507        _tmp3_ = value;
00508        unity_results_synchronizer_set_merge_strategy (_tmp2_, _tmp3_);
00509        g_object_notify ((GObject *) self, "merge-strategy");
00510 }
00511 
00512 
00513 UnityMergeStrategy* unity_lens_get_global_merge_strategy (UnityLens* self) {
00514        UnityMergeStrategy* result;
00515        UnityLensImpl* _tmp0_;
00516        UnityResultsSynchronizer* _tmp1_;
00517        UnityResultsSynchronizer* _tmp2_;
00518        UnityMergeStrategy* _tmp3_;
00519        UnityMergeStrategy* _tmp4_;
00520        g_return_val_if_fail (self != NULL, NULL);
00521        _tmp0_ = self->priv->_pimpl;
00522        _tmp1_ = unity_lens_impl_get_global_results_sync (_tmp0_);
00523        _tmp2_ = _tmp1_;
00524        _tmp3_ = unity_results_synchronizer_get_merge_strategy (_tmp2_);
00525        _tmp4_ = _tmp3_;
00526        result = _tmp4_;
00527        return result;
00528 }
00529 
00530 
00531 void unity_lens_set_global_merge_strategy (UnityLens* self, UnityMergeStrategy* value) {
00532        UnityLensImpl* _tmp0_;
00533        UnityResultsSynchronizer* _tmp1_;
00534        UnityResultsSynchronizer* _tmp2_;
00535        UnityMergeStrategy* _tmp3_;
00536        g_return_if_fail (self != NULL);
00537        _tmp0_ = self->priv->_pimpl;
00538        _tmp1_ = unity_lens_impl_get_global_results_sync (_tmp0_);
00539        _tmp2_ = _tmp1_;
00540        _tmp3_ = value;
00541        unity_results_synchronizer_set_merge_strategy (_tmp2_, _tmp3_);
00542        g_object_notify ((GObject *) self, "global-merge-strategy");
00543 }
00544 
00545 
00546 const gchar* unity_lens_get_sources_display_name (UnityLens* self) {
00547        const gchar* result;
00548        const gchar* _tmp0_;
00549        g_return_val_if_fail (self != NULL, NULL);
00550        _tmp0_ = self->priv->_sources_display_name;
00551        result = _tmp0_;
00552        return result;
00553 }
00554 
00555 
00556 void unity_lens_set_sources_display_name (UnityLens* self, const gchar* value) {
00557        const gchar* _tmp0_;
00558        gchar* _tmp1_;
00559        g_return_if_fail (self != NULL);
00560        _tmp0_ = value;
00561        _tmp1_ = g_strdup (_tmp0_);
00562        _g_free0 (self->priv->_sources_display_name);
00563        self->priv->_sources_display_name = _tmp1_;
00564        g_object_notify ((GObject *) self, "sources-display-name");
00565 }
00566 
00567 
00568 static GObject * unity_lens_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
00569        GObject * obj;
00570        GObjectClass * parent_class;
00571        UnityLens * self;
00572        UnityLensImpl* _tmp0_;
00573        parent_class = G_OBJECT_CLASS (unity_lens_parent_class);
00574        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
00575        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_LENS, UnityLens);
00576        _tmp0_ = unity_lens_impl_new (self);
00577        _g_object_unref0 (self->priv->_pimpl);
00578        self->priv->_pimpl = _tmp0_;
00579        return obj;
00580 }
00581 
00582 
00583 static void unity_lens_class_init (UnityLensClass * klass) {
00584        unity_lens_parent_class = g_type_class_peek_parent (klass);
00585        g_type_class_add_private (klass, sizeof (UnityLensPrivate));
00586        G_OBJECT_CLASS (klass)->get_property = _vala_unity_lens_get_property;
00587        G_OBJECT_CLASS (klass)->set_property = _vala_unity_lens_set_property;
00588        G_OBJECT_CLASS (klass)->constructor = unity_lens_constructor;
00589        G_OBJECT_CLASS (klass)->finalize = unity_lens_finalize;
00590        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_ACTIVE, g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
00591        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_VISIBLE, g_param_spec_boolean ("visible", "visible", "visible", TRUE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00592        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_SEARCHING, g_param_spec_boolean ("searching", "searching", "searching", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
00593        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_EXPORTED, g_param_spec_boolean ("exported", "exported", "exported", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
00594        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_SEARCH_IN_GLOBAL, g_param_spec_boolean ("search-in-global", "search-in-global", "search-in-global", TRUE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00595        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_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));
00596        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_DBUS_PATH, g_param_spec_string ("dbus-path", "dbus-path", "dbus-path", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00597        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_SEARCH_HINT, g_param_spec_string ("search-hint", "search-hint", "search-hint", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00598        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_FILTERS, g_param_spec_pointer ("filters", "filters", "filters", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00599        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_CATEGORIES, g_param_spec_pointer ("categories", "categories", "categories", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00600        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_MERGE_STRATEGY, g_param_spec_object ("merge-strategy", "merge-strategy", "merge-strategy", UNITY_TYPE_MERGE_STRATEGY, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00601        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_GLOBAL_MERGE_STRATEGY, g_param_spec_object ("global-merge-strategy", "global-merge-strategy", "global-merge-strategy", UNITY_TYPE_MERGE_STRATEGY, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00602        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_SOURCES_DISPLAY_NAME, g_param_spec_string ("sources-display-name", "sources-display-name", "sources-display-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
00603 }
00604 
00605 
00606 static void unity_lens_instance_init (UnityLens * self) {
00607        self->priv = UNITY_LENS_GET_PRIVATE (self);
00608        self->priv->_active = FALSE;
00609        self->priv->_visible = TRUE;
00610        self->priv->_searching = FALSE;
00611        self->priv->_exported = FALSE;
00612        self->priv->_search_in_global = TRUE;
00613        self->priv->_categories = NULL;
00614        self->priv->_filters = NULL;
00615 }
00616 
00617 
00618 static void unity_lens_finalize (GObject* obj) {
00619        UnityLens * self;
00620        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_LENS, UnityLens);
00621        _g_free0 (self->priv->_id);
00622        _g_free0 (self->priv->_dbus_path);
00623        _g_free0 (self->priv->_search_hint);
00624        _g_free0 (self->priv->_sources_display_name);
00625        _g_object_unref0 (self->priv->_pimpl);
00626        __g_list_free__g_object_unref0_0 (self->priv->_categories);
00627        __g_list_free__g_object_unref0_0 (self->priv->_filters);
00628        G_OBJECT_CLASS (unity_lens_parent_class)->finalize (obj);
00629 }
00630 
00631 
00632 GType unity_lens_get_type (void) {
00633        static volatile gsize unity_lens_type_id__volatile = 0;
00634        if (g_once_init_enter (&unity_lens_type_id__volatile)) {
00635               static const GTypeInfo g_define_type_info = { sizeof (UnityLensClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_lens_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityLens), 0, (GInstanceInitFunc) unity_lens_instance_init, NULL };
00636               GType unity_lens_type_id;
00637               unity_lens_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityLens", &g_define_type_info, 0);
00638               g_once_init_leave (&unity_lens_type_id__volatile, unity_lens_type_id);
00639        }
00640        return unity_lens_type_id__volatile;
00641 }
00642 
00643 
00644 static void _vala_unity_lens_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
00645        UnityLens * self;
00646        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_LENS, UnityLens);
00647        switch (property_id) {
00648               case UNITY_LENS_ACTIVE:
00649               g_value_set_boolean (value, unity_lens_get_active (self));
00650               break;
00651               case UNITY_LENS_VISIBLE:
00652               g_value_set_boolean (value, unity_lens_get_visible (self));
00653               break;
00654               case UNITY_LENS_SEARCHING:
00655               g_value_set_boolean (value, unity_lens_get_searching (self));
00656               break;
00657               case UNITY_LENS_EXPORTED:
00658               g_value_set_boolean (value, unity_lens_get_exported (self));
00659               break;
00660               case UNITY_LENS_SEARCH_IN_GLOBAL:
00661               g_value_set_boolean (value, unity_lens_get_search_in_global (self));
00662               break;
00663               case UNITY_LENS_ID:
00664               g_value_set_string (value, unity_lens_get_id (self));
00665               break;
00666               case UNITY_LENS_DBUS_PATH:
00667               g_value_set_string (value, unity_lens_get_dbus_path (self));
00668               break;
00669               case UNITY_LENS_SEARCH_HINT:
00670               g_value_set_string (value, unity_lens_get_search_hint (self));
00671               break;
00672               case UNITY_LENS_FILTERS:
00673               g_value_set_pointer (value, unity_lens_get_filters (self));
00674               break;
00675               case UNITY_LENS_CATEGORIES:
00676               g_value_set_pointer (value, unity_lens_get_categories (self));
00677               break;
00678               case UNITY_LENS_MERGE_STRATEGY:
00679               g_value_set_object (value, unity_lens_get_merge_strategy (self));
00680               break;
00681               case UNITY_LENS_GLOBAL_MERGE_STRATEGY:
00682               g_value_set_object (value, unity_lens_get_global_merge_strategy (self));
00683               break;
00684               case UNITY_LENS_SOURCES_DISPLAY_NAME:
00685               g_value_set_string (value, unity_lens_get_sources_display_name (self));
00686               break;
00687               default:
00688               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00689               break;
00690        }
00691 }
00692 
00693 
00694 static void _vala_unity_lens_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
00695        UnityLens * self;
00696        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_LENS, UnityLens);
00697        switch (property_id) {
00698               case UNITY_LENS_ACTIVE:
00699               unity_lens_set_active (self, g_value_get_boolean (value));
00700               break;
00701               case UNITY_LENS_VISIBLE:
00702               unity_lens_set_visible (self, g_value_get_boolean (value));
00703               break;
00704               case UNITY_LENS_SEARCHING:
00705               unity_lens_set_searching (self, g_value_get_boolean (value));
00706               break;
00707               case UNITY_LENS_EXPORTED:
00708               unity_lens_set_exported (self, g_value_get_boolean (value));
00709               break;
00710               case UNITY_LENS_SEARCH_IN_GLOBAL:
00711               unity_lens_set_search_in_global (self, g_value_get_boolean (value));
00712               break;
00713               case UNITY_LENS_ID:
00714               unity_lens_set_id (self, g_value_get_string (value));
00715               break;
00716               case UNITY_LENS_DBUS_PATH:
00717               unity_lens_set_dbus_path (self, g_value_get_string (value));
00718               break;
00719               case UNITY_LENS_SEARCH_HINT:
00720               unity_lens_set_search_hint (self, g_value_get_string (value));
00721               break;
00722               case UNITY_LENS_FILTERS:
00723               unity_lens_set_filters (self, g_value_get_pointer (value));
00724               break;
00725               case UNITY_LENS_CATEGORIES:
00726               unity_lens_set_categories (self, g_value_get_pointer (value));
00727               break;
00728               case UNITY_LENS_MERGE_STRATEGY:
00729               unity_lens_set_merge_strategy (self, g_value_get_object (value));
00730               break;
00731               case UNITY_LENS_GLOBAL_MERGE_STRATEGY:
00732               unity_lens_set_global_merge_strategy (self, g_value_get_object (value));
00733               break;
00734               case UNITY_LENS_SOURCES_DISPLAY_NAME:
00735               unity_lens_set_sources_display_name (self, g_value_get_string (value));
00736               break;
00737               default:
00738               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00739               break;
00740        }
00741 }
00742 
00743 
00744