Back to index

libunity  5.92.0
unity-scope.c
Go to the documentation of this file.
00001 /* unity-scope.c generated by valac 0.17.2, the Vala compiler
00002  * generated from unity-scope.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 <unity-protocol.h>
00032 
00033 
00034 #define UNITY_TYPE_SCOPE_IMPL (unity_scope_impl_get_type ())
00035 #define UNITY_SCOPE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_SCOPE_IMPL, UnityScopeImpl))
00036 #define UNITY_SCOPE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_SCOPE_IMPL, UnityScopeImplClass))
00037 #define UNITY_IS_SCOPE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_SCOPE_IMPL))
00038 #define UNITY_IS_SCOPE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_SCOPE_IMPL))
00039 #define UNITY_SCOPE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_SCOPE_IMPL, UnityScopeImplClass))
00040 
00041 typedef struct _UnityScopeImpl UnityScopeImpl;
00042 typedef struct _UnityScopeImplClass UnityScopeImplClass;
00043 #define _g_free0(var) (var = (g_free (var), NULL))
00044 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00045 #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
00046 #define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
00047 typedef struct _UnityScopeImplPrivate UnityScopeImplPrivate;
00048 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00049 typedef struct _UnityScopeActivateData UnityScopeActivateData;
00050 typedef struct _UnityScopeUpdatePreviewPropertyData UnityScopeUpdatePreviewPropertyData;
00051 typedef struct _UnityScopeSearchData UnityScopeSearchData;
00052 typedef struct _UnityScopeGlobalSearchData UnityScopeGlobalSearchData;
00053 
00054 struct _UnityScopePrivate {
00055        gboolean _active;
00056        gboolean _exported;
00057        gboolean _search_in_global;
00058        gchar* _dbus_path;
00059        UnityOptionsFilter* _sources;
00060        UnityLensSearch* last_search[2];
00061        UnityScopeImpl* _pimpl;
00062        gboolean is_local;
00063 };
00064 
00065 struct _UnityScopeImpl {
00066        GObject parent_instance;
00067        UnityScopeImplPrivate * priv;
00068        DeeSerializableModel* _results_model;
00069        DeeSerializableModel* _global_results_model;
00070        DeeSerializableModel* _filters_model;
00071 };
00072 
00073 struct _UnityScopeImplClass {
00074        GObjectClass parent_class;
00075 };
00076 
00077 struct _UnityScopeActivateData {
00078        int _state_;
00079        GObject* _source_object_;
00080        GAsyncResult* _res_;
00081        GSimpleAsyncResult* _async_result;
00082        UnityScope* self;
00083        gchar* uri;
00084        UnityProtocolActionType action_type;
00085        UnityProtocolActivationReplyRaw result;
00086        UnityScopeImpl* _tmp0_;
00087        const gchar* _tmp1_;
00088        UnityProtocolActionType _tmp2_;
00089        UnityProtocolActivationReplyRaw _tmp3_;
00090        UnityProtocolActivationReplyRaw reply;
00091        GError* e;
00092        GError* _tmp4_;
00093        const gchar* _tmp5_;
00094        const gchar* _tmp6_;
00095        gchar* _tmp7_;
00096        gchar* _tmp8_;
00097        UnityProtocolActivationReplyRaw res;
00098        const gchar* _tmp9_;
00099        gchar* _tmp10_;
00100        GHashTable* _tmp11_;
00101        GError * _inner_error_;
00102 };
00103 
00104 struct _UnityScopeUpdatePreviewPropertyData {
00105        int _state_;
00106        GObject* _source_object_;
00107        GAsyncResult* _res_;
00108        GSimpleAsyncResult* _async_result;
00109        UnityScope* self;
00110        gchar* uri;
00111        GHashTable* values;
00112        GHashTable* result;
00113        UnityScopeImpl* _tmp0_;
00114        const gchar* _tmp1_;
00115        GHashTable* _tmp2_;
00116        GHashTable* _tmp3_;
00117        GHashTable* reply;
00118        GError* e;
00119        GError* _tmp4_;
00120        const gchar* _tmp5_;
00121        const gchar* _tmp6_;
00122        gchar* _tmp7_;
00123        gchar* _tmp8_;
00124        GHashFunc _tmp9_;
00125        GEqualFunc _tmp10_;
00126        GHashTable* _tmp11_;
00127        GError * _inner_error_;
00128 };
00129 
00130 struct _UnityScopeSearchData {
00131        int _state_;
00132        GObject* _source_object_;
00133        GAsyncResult* _res_;
00134        GSimpleAsyncResult* _async_result;
00135        UnityScope* self;
00136        gchar* search_string;
00137        GHashTable* hints;
00138        GHashTable* result;
00139        UnityScopeImpl* _tmp0_;
00140        const gchar* _tmp1_;
00141        GHashTable* _tmp2_;
00142        GHashTable* _tmp3_;
00143        GHashTable* _result_;
00144        GError * _inner_error_;
00145 };
00146 
00147 struct _UnityScopeGlobalSearchData {
00148        int _state_;
00149        GObject* _source_object_;
00150        GAsyncResult* _res_;
00151        GSimpleAsyncResult* _async_result;
00152        UnityScope* self;
00153        gchar* search_string;
00154        GHashTable* hints;
00155        GHashTable* result;
00156        UnityScopeImpl* _tmp0_;
00157        const gchar* _tmp1_;
00158        GHashTable* _tmp2_;
00159        GHashTable* _tmp3_;
00160        GHashTable* _result_;
00161        GError * _inner_error_;
00162 };
00163 
00164 
00165 static gpointer unity_scope_parent_class = NULL;
00166 
00167 GType unity_scope_impl_get_type (void) G_GNUC_CONST;
00168 #define UNITY_SCOPE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_SCOPE, UnityScopePrivate))
00169 enum  {
00170        UNITY_SCOPE_DUMMY_PROPERTY,
00171        UNITY_SCOPE_ACTIVE,
00172        UNITY_SCOPE_EXPORTED,
00173        UNITY_SCOPE_SEARCH_IN_GLOBAL,
00174        UNITY_SCOPE_DBUS_PATH,
00175        UNITY_SCOPE_SOURCES,
00176        UNITY_SCOPE_FILTERS,
00177        UNITY_SCOPE_RESULTS_MODEL,
00178        UNITY_SCOPE_GLOBAL_RESULTS_MODEL
00179 };
00180 static void _g_object_unref0_ (gpointer var);
00181 static void _g_list_free__g_object_unref0_ (GList* self);
00182 void unity_scope_impl_export (UnityScopeImpl* self, GError** error);
00183 static void unity_scope_set_exported (UnityScope* self, gboolean value);
00184 static void unity_scope_prepare_search (UnityScope* self);
00185 static void _g_free0_ (gpointer var);
00186 static void _g_variant_unref0_ (gpointer var);
00187 void unity_scope_impl_update_search_key (UnityScopeImpl* self, UnityLensSearch* ls, UnitySearchType search_type);
00188 void unity_scope_impl_schedule_search_changed (UnityScopeImpl* self, UnityLensSearch* search, UnitySearchType search_type, gboolean wait_for_view, GAsyncReadyCallback _callback_, gpointer _user_data_);
00189 void unity_scope_impl_schedule_search_changed_finish (UnityScopeImpl* self, GAsyncResult* _res_);
00190 void unity_scope_impl_invalidate_search (UnityScopeImpl* self, UnitySearchType search_type);
00191 UnityLensSearch* unity_scope_get_last_search (UnityScope* self, UnitySearchType search_type);
00192 void unity_scope_set_last_search (UnityScope* self, UnityLensSearch* search, UnitySearchType search_type);
00193 void unity_scope_set_view_type_internal (UnityScope* self, UnityProtocolViewType view_type);
00194 void unity_scope_impl_set_view_type (UnityScopeImpl* self, UnityProtocolViewType value);
00195 void unity_scope_set_active_sources_internal (UnityScope* self, gchar** active_sources_, int active_sources__length1);
00196 static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
00197 void unity_filter_option_set_active (UnityFilterOption* self, gboolean value);
00198 void unity_scope_set_local (UnityScope* self, gboolean is_local_);
00199 DeeSerializableModel* unity_scope_get_filter_model (UnityScope* self);
00200 static void unity_scope_activate_data_free (gpointer _data);
00201 void unity_scope_activate (UnityScope* self, const gchar* uri, UnityProtocolActionType action_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
00202 void unity_scope_activate_finish (UnityScope* self, GAsyncResult* _res_, UnityProtocolActivationReplyRaw* result);
00203 static gboolean unity_scope_activate_co (UnityScopeActivateData* _data_);
00204 static void unity_scope_activate_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00205 static void unity_scope_update_preview_property_data_free (gpointer _data);
00206 void unity_scope_update_preview_property (UnityScope* self, const gchar* uri, GHashTable* values, GAsyncReadyCallback _callback_, gpointer _user_data_);
00207 GHashTable* unity_scope_update_preview_property_finish (UnityScope* self, GAsyncResult* _res_);
00208 static gboolean unity_scope_update_preview_property_co (UnityScopeUpdatePreviewPropertyData* _data_);
00209 static void unity_scope_update_preview_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00210 static void unity_scope_search_data_free (gpointer _data);
00211 void unity_scope_search (UnityScope* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
00212 GHashTable* unity_scope_search_finish (UnityScope* self, GAsyncResult* _res_, GError** error);
00213 static gboolean unity_scope_search_co (UnityScopeSearchData* _data_);
00214 static void unity_scope_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00215 static void unity_scope_global_search_data_free (gpointer _data);
00216 void unity_scope_global_search (UnityScope* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
00217 GHashTable* unity_scope_global_search_finish (UnityScope* self, GAsyncResult* _res_, GError** error);
00218 static gboolean unity_scope_global_search_co (UnityScopeGlobalSearchData* _data_);
00219 static void unity_scope_global_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00220 void unity_scope_set_sources (UnityScope* self, UnityOptionsFilter* value);
00221 static void g_cclosure_user_marshal_OBJECT__STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
00222 static void g_cclosure_user_marshal_VOID__BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
00223 static void g_cclosure_user_marshal_VOID__OBJECT_ENUM_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
00224 static void g_cclosure_user_marshal_STRING__OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
00225 static GObject * unity_scope_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00226 UnityScopeImpl* unity_scope_impl_new (UnityScope* owner);
00227 UnityScopeImpl* unity_scope_impl_construct (GType object_type, UnityScope* owner);
00228 static void unity_scope_finalize (GObject* obj);
00229 static void _vala_unity_scope_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00230 static void _vala_unity_scope_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00231 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00232 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00233 
00234 
00235 GType unity_search_type_get_type (void) {
00236        static volatile gsize unity_search_type_type_id__volatile = 0;
00237        if (g_once_init_enter (&unity_search_type_type_id__volatile)) {
00238               static const GEnumValue values[] = {{UNITY_SEARCH_TYPE_DEFAULT, "UNITY_SEARCH_TYPE_DEFAULT", "default"}, {UNITY_SEARCH_TYPE_GLOBAL, "UNITY_SEARCH_TYPE_GLOBAL", "global"}, {UNITY_SEARCH_TYPE_N_TYPES, "UNITY_SEARCH_TYPE_N_TYPES", "n-types"}, {0, NULL, NULL}};
00239               GType unity_search_type_type_id;
00240               unity_search_type_type_id = g_enum_register_static ("UnitySearchType", values);
00241               g_once_init_leave (&unity_search_type_type_id__volatile, unity_search_type_type_id);
00242        }
00243        return unity_search_type_type_id__volatile;
00244 }
00245 
00246 
00247 static void _g_object_unref0_ (gpointer var) {
00248        (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
00249 }
00250 
00251 
00252 static void _g_list_free__g_object_unref0_ (GList* self) {
00253        g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
00254        g_list_free (self);
00255 }
00256 
00257 
00258 UnityScope* unity_scope_construct (GType object_type, const gchar* dbus_path_) {
00259        UnityScope * self = NULL;
00260        const gchar* _tmp0_;
00261        g_return_val_if_fail (dbus_path_ != NULL, NULL);
00262        _tmp0_ = dbus_path_;
00263        self = (UnityScope*) g_object_new (object_type, "dbus-path", _tmp0_, NULL);
00264        return self;
00265 }
00266 
00267 
00268 UnityScope* unity_scope_new (const gchar* dbus_path_) {
00269        return unity_scope_construct (UNITY_TYPE_SCOPE, dbus_path_);
00270 }
00271 
00272 
00273 void unity_scope_export (UnityScope* self, GError** error) {
00274        gboolean _tmp0_ = FALSE;
00275        gboolean _tmp1_;
00276        gboolean _tmp3_;
00277        GError * _inner_error_ = NULL;
00278        g_return_if_fail (self != NULL);
00279        _tmp1_ = self->priv->_exported;
00280        if (!_tmp1_) {
00281               gboolean _tmp2_;
00282               _tmp2_ = self->priv->is_local;
00283               _tmp0_ = !_tmp2_;
00284        } else {
00285               _tmp0_ = FALSE;
00286        }
00287        _tmp3_ = _tmp0_;
00288        if (_tmp3_) {
00289               UnityScopeImpl* _tmp4_;
00290               _tmp4_ = self->priv->_pimpl;
00291               unity_scope_impl_export (_tmp4_, &_inner_error_);
00292               if (_inner_error_ != NULL) {
00293                      if (_inner_error_->domain == G_IO_ERROR) {
00294                             g_propagate_error (error, _inner_error_);
00295                             return;
00296                      } else {
00297                             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);
00298                             g_clear_error (&_inner_error_);
00299                             return;
00300                      }
00301               }
00302               unity_scope_set_exported (self, TRUE);
00303               unity_scope_prepare_search (self);
00304        }
00305 }
00306 
00307 
00308 static gpointer _g_object_ref0 (gpointer self) {
00309        return self ? g_object_ref (self) : NULL;
00310 }
00311 
00312 
00313 UnityFilter* unity_scope_get_filter (UnityScope* self, const gchar* id) {
00314        UnityFilter* result = NULL;
00315        GList* _tmp0_;
00316        g_return_val_if_fail (self != NULL, NULL);
00317        g_return_val_if_fail (id != NULL, NULL);
00318        _tmp0_ = self->_filters;
00319        {
00320               GList* filter_collection = NULL;
00321               GList* filter_it = NULL;
00322               filter_collection = _tmp0_;
00323               for (filter_it = filter_collection; filter_it != NULL; filter_it = filter_it->next) {
00324                      UnityFilter* _tmp1_;
00325                      UnityFilter* filter = NULL;
00326                      _tmp1_ = _g_object_ref0 ((UnityFilter*) filter_it->data);
00327                      filter = _tmp1_;
00328                      {
00329                             UnityFilter* _tmp2_;
00330                             const gchar* _tmp3_;
00331                             const gchar* _tmp4_;
00332                             const gchar* _tmp5_;
00333                             _tmp2_ = filter;
00334                             _tmp3_ = unity_filter_get_id (_tmp2_);
00335                             _tmp4_ = _tmp3_;
00336                             _tmp5_ = id;
00337                             if (g_strcmp0 (_tmp4_, _tmp5_) == 0) {
00338                                    result = filter;
00339                                    return result;
00340                             }
00341                             _g_object_unref0 (filter);
00342                      }
00343               }
00344        }
00345        result = NULL;
00346        return result;
00347 }
00348 
00349 
00360 static void _g_free0_ (gpointer var) {
00361        var = (g_free (var), NULL);
00362 }
00363 
00364 
00365 static void _g_variant_unref0_ (gpointer var) {
00366        (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
00367 }
00368 
00369 
00370 void unity_scope_queue_search_changed (UnityScope* self, UnitySearchType search_type) {
00371        UnitySearchType _tmp0_;
00372        UnitySearchType _tmp1_;
00373        gboolean is_global_search;
00374        UnitySearchType _tmp2_;
00375        UnityLensSearch* _tmp3_;
00376        UnityLensSearch* _tmp4_;
00377        UnityLensSearch* search;
00378        UnitySearchType _tmp5_;
00379        UnityLensSearch* _tmp6_;
00380        UnityScopeImpl* _tmp21_;
00381        UnityLensSearch* _tmp22_;
00382        UnitySearchType _tmp23_;
00383        UnityScopeImpl* _tmp24_;
00384        UnityLensSearch* _tmp25_;
00385        UnitySearchType _tmp26_;
00386        g_return_if_fail (self != NULL);
00387        _tmp0_ = search_type;
00388        g_return_if_fail (_tmp0_ < UNITY_SEARCH_TYPE_N_TYPES);
00389        _tmp1_ = search_type;
00390        is_global_search = _tmp1_ == UNITY_SEARCH_TYPE_GLOBAL;
00391        _tmp2_ = search_type;
00392        _tmp3_ = self->priv->last_search[_tmp2_];
00393        _tmp4_ = _g_object_ref0 (_tmp3_);
00394        search = _tmp4_;
00395        _tmp5_ = search_type;
00396        unity_scope_invalidate_search (self, _tmp5_);
00397        _tmp6_ = search;
00398        if (_tmp6_ == NULL) {
00399               GHashFunc _tmp7_;
00400               GEqualFunc _tmp8_;
00401               GHashTable* _tmp9_;
00402               GHashTable* ht;
00403               DeeSerializableModel* _tmp10_ = NULL;
00404               gboolean _tmp11_;
00405               DeeSerializableModel* _tmp16_;
00406               DeeSerializableModel* _tmp17_;
00407               DeeSerializableModel* model;
00408               GHashTable* _tmp18_;
00409               DeeSerializableModel* _tmp19_;
00410               UnityLensSearch* _tmp20_;
00411               _tmp7_ = g_str_hash;
00412               _tmp8_ = g_str_equal;
00413               _tmp9_ = g_hash_table_new_full (_tmp7_, _tmp8_, _g_free0_, _g_variant_unref0_);
00414               ht = _tmp9_;
00415               _tmp11_ = is_global_search;
00416               if (_tmp11_) {
00417                      DeeSerializableModel* _tmp12_;
00418                      DeeSerializableModel* _tmp13_;
00419                      _tmp12_ = unity_scope_get_global_results_model (self);
00420                      _tmp13_ = _tmp12_;
00421                      _tmp10_ = _tmp13_;
00422               } else {
00423                      DeeSerializableModel* _tmp14_;
00424                      DeeSerializableModel* _tmp15_;
00425                      _tmp14_ = unity_scope_get_results_model (self);
00426                      _tmp15_ = _tmp14_;
00427                      _tmp10_ = _tmp15_;
00428               }
00429               _tmp16_ = _tmp10_;
00430               _tmp17_ = _g_object_ref0 (_tmp16_);
00431               model = _tmp17_;
00432               _tmp18_ = ht;
00433               _tmp19_ = model;
00434               _tmp20_ = unity_lens_search_new ("", _tmp18_, _tmp19_);
00435               g_object_ref_sink (_tmp20_);
00436               _g_object_unref0 (search);
00437               search = _tmp20_;
00438               _g_object_unref0 (model);
00439               _g_hash_table_unref0 (ht);
00440        }
00441        _tmp21_ = self->priv->_pimpl;
00442        _tmp22_ = search;
00443        _tmp23_ = search_type;
00444        unity_scope_impl_update_search_key (_tmp21_, _tmp22_, _tmp23_);
00445        _tmp24_ = self->priv->_pimpl;
00446        _tmp25_ = search;
00447        _tmp26_ = search_type;
00448        unity_scope_impl_schedule_search_changed (_tmp24_, _tmp25_, _tmp26_, TRUE, NULL, NULL);
00449        _g_object_unref0 (search);
00450 }
00451 
00452 
00463 void unity_scope_invalidate_search (UnityScope* self, UnitySearchType search_type) {
00464        UnitySearchType _tmp0_;
00465        UnityScopeImpl* _tmp1_;
00466        UnitySearchType _tmp2_;
00467        UnitySearchType _tmp3_;
00468        UnityLensSearch* _tmp4_;
00469        g_return_if_fail (self != NULL);
00470        _tmp0_ = search_type;
00471        g_return_if_fail (_tmp0_ < UNITY_SEARCH_TYPE_N_TYPES);
00472        _tmp1_ = self->priv->_pimpl;
00473        _tmp2_ = search_type;
00474        unity_scope_impl_invalidate_search (_tmp1_, _tmp2_);
00475        _tmp3_ = search_type;
00476        _g_object_unref0 (self->priv->last_search[_tmp3_]);
00477        self->priv->last_search[_tmp3_] = NULL;
00478        _tmp4_ = self->priv->last_search[_tmp3_];
00479 }
00480 
00481 
00482 UnityLensSearch* unity_scope_get_last_search (UnityScope* self, UnitySearchType search_type) {
00483        UnityLensSearch* result = NULL;
00484        UnitySearchType _tmp0_;
00485        UnityLensSearch* _tmp1_;
00486        g_return_val_if_fail (self != NULL, NULL);
00487        _tmp0_ = search_type;
00488        _tmp1_ = self->priv->last_search[_tmp0_];
00489        result = _tmp1_;
00490        return result;
00491 }
00492 
00493 
00494 void unity_scope_set_last_search (UnityScope* self, UnityLensSearch* search, UnitySearchType search_type) {
00495        UnitySearchType _tmp0_;
00496        UnityLensSearch* _tmp1_;
00497        UnityLensSearch* _tmp2_;
00498        UnityLensSearch* _tmp3_;
00499        g_return_if_fail (self != NULL);
00500        g_return_if_fail (search != NULL);
00501        _tmp0_ = search_type;
00502        _tmp1_ = search;
00503        _tmp2_ = _g_object_ref0 (_tmp1_);
00504        _g_object_unref0 (self->priv->last_search[_tmp0_]);
00505        self->priv->last_search[_tmp0_] = _tmp2_;
00506        _tmp3_ = self->priv->last_search[_tmp0_];
00507 }
00508 
00509 
00510 void unity_scope_set_view_type_internal (UnityScope* self, UnityProtocolViewType view_type) {
00511        UnityScopeImpl* _tmp0_;
00512        UnityProtocolViewType _tmp1_;
00513        g_return_if_fail (self != NULL);
00514        _tmp0_ = self->priv->_pimpl;
00515        _tmp1_ = view_type;
00516        unity_scope_impl_set_view_type (_tmp0_, _tmp1_);
00517 }
00518 
00519 
00520 static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) {
00521        int i;
00522        for (i = 0; i < stack_length; i++) {
00523               if (g_strcmp0 (stack[i], needle) == 0) {
00524                      return TRUE;
00525               }
00526        }
00527        return FALSE;
00528 }
00529 
00530 
00531 void unity_scope_set_active_sources_internal (UnityScope* self, gchar** active_sources_, int active_sources__length1) {
00532        UnityOptionsFilter* _tmp0_;
00533        GList* _tmp1_;
00534        gchar** _tmp8_;
00535        gint _tmp8__length1;
00536        g_return_if_fail (self != NULL);
00537        _tmp0_ = self->priv->_sources;
00538        _tmp1_ = _tmp0_->options;
00539        {
00540               GList* filter_option_collection = NULL;
00541               GList* filter_option_it = NULL;
00542               filter_option_collection = _tmp1_;
00543               for (filter_option_it = filter_option_collection; filter_option_it != NULL; filter_option_it = filter_option_it->next) {
00544                      UnityFilterOption* _tmp2_;
00545                      UnityFilterOption* filter_option = NULL;
00546                      _tmp2_ = _g_object_ref0 ((UnityFilterOption*) filter_option_it->data);
00547                      filter_option = _tmp2_;
00548                      {
00549                             UnityFilterOption* _tmp3_;
00550                             UnityFilterOption* _tmp4_;
00551                             const gchar* _tmp5_;
00552                             const gchar* _tmp6_;
00553                             gchar** _tmp7_;
00554                             gint _tmp7__length1;
00555                             _tmp3_ = filter_option;
00556                             _tmp4_ = filter_option;
00557                             _tmp5_ = unity_filter_option_get_id (_tmp4_);
00558                             _tmp6_ = _tmp5_;
00559                             _tmp7_ = active_sources_;
00560                             _tmp7__length1 = active_sources__length1;
00561                             unity_filter_option_set_active (_tmp3_, _vala_string_array_contains (_tmp7_, _tmp7__length1, _tmp6_));
00562                             _g_object_unref0 (filter_option);
00563                      }
00564               }
00565        }
00566        _tmp8_ = active_sources_;
00567        _tmp8__length1 = active_sources__length1;
00568        g_signal_emit_by_name (self, "active-sources-changed", _tmp8_, _tmp8__length1);
00569 }
00570 
00571 
00572 void unity_scope_set_local (UnityScope* self, gboolean is_local_) {
00573        gboolean _tmp0_;
00574        gboolean _tmp1_;
00575        g_return_if_fail (self != NULL);
00576        _tmp0_ = is_local_;
00577        self->priv->is_local = _tmp0_;
00578        _tmp1_ = self->priv->is_local;
00579        if (_tmp1_) {
00580               unity_scope_prepare_search (self);
00581        }
00582 }
00583 
00584 
00585 static void unity_scope_prepare_search (UnityScope* self) {
00586        gboolean _tmp0_;
00587        g_return_if_fail (self != NULL);
00588        _tmp0_ = self->priv->_search_in_global;
00589        if (_tmp0_) {
00590               unity_scope_queue_search_changed (self, UNITY_SEARCH_TYPE_GLOBAL);
00591        }
00592 }
00593 
00594 
00595 DeeSerializableModel* unity_scope_get_filter_model (UnityScope* self) {
00596        DeeSerializableModel* result = NULL;
00597        UnityScopeImpl* _tmp0_;
00598        DeeSerializableModel* _tmp1_;
00599        g_return_val_if_fail (self != NULL, NULL);
00600        _tmp0_ = self->priv->_pimpl;
00601        _tmp1_ = _tmp0_->_filters_model;
00602        result = _tmp1_;
00603        return result;
00604 }
00605 
00606 
00607 static void unity_scope_activate_data_free (gpointer _data) {
00608        UnityScopeActivateData* _data_;
00609        _data_ = _data;
00610        _g_free0 (_data_->uri);
00611        unity_protocol_activation_reply_raw_destroy (&_data_->result);
00612        _g_object_unref0 (_data_->self);
00613        g_slice_free (UnityScopeActivateData, _data_);
00614 }
00615 
00616 
00617 void unity_scope_activate (UnityScope* self, const gchar* uri, UnityProtocolActionType action_type, GAsyncReadyCallback _callback_, gpointer _user_data_) {
00618        UnityScopeActivateData* _data_;
00619        UnityScope* _tmp0_;
00620        const gchar* _tmp1_;
00621        gchar* _tmp2_;
00622        UnityProtocolActionType _tmp3_;
00623        _data_ = g_slice_new0 (UnityScopeActivateData);
00624        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_scope_activate);
00625        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_scope_activate_data_free);
00626        _tmp0_ = _g_object_ref0 (self);
00627        _data_->self = _tmp0_;
00628        _tmp1_ = uri;
00629        _tmp2_ = g_strdup (_tmp1_);
00630        _data_->uri = _tmp2_;
00631        _tmp3_ = action_type;
00632        _data_->action_type = _tmp3_;
00633        unity_scope_activate_co (_data_);
00634 }
00635 
00636 
00637 void unity_scope_activate_finish (UnityScope* self, GAsyncResult* _res_, UnityProtocolActivationReplyRaw* result) {
00638        UnityScopeActivateData* _data_;
00639        UnityProtocolActivationReplyRaw _tmp0_ = {0};
00640        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
00641        unity_protocol_activation_reply_raw_copy (&_data_->result, &_tmp0_);
00642        *result = _tmp0_;
00643 }
00644 
00645 
00646 static void unity_scope_activate_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
00647        UnityScopeActivateData* _data_;
00648        _data_ = _user_data_;
00649        _data_->_source_object_ = source_object;
00650        _data_->_res_ = _res_;
00651        unity_scope_activate_co (_data_);
00652 }
00653 
00654 
00655 static const gchar* string_to_string (const gchar* self) {
00656        const gchar* result = NULL;
00657        g_return_val_if_fail (self != NULL, NULL);
00658        result = self;
00659        return result;
00660 }
00661 
00662 
00663 static gboolean unity_scope_activate_co (UnityScopeActivateData* _data_) {
00664        switch (_data_->_state_) {
00665               case 0:
00666               goto _state_0;
00667               case 1:
00668               goto _state_1;
00669               default:
00670               g_assert_not_reached ();
00671        }
00672        _state_0:
00673        {
00674               _data_->_tmp0_ = _data_->self->priv->_pimpl;
00675               _data_->_tmp1_ = _data_->uri;
00676               _data_->_tmp2_ = _data_->action_type;
00677               memset (&_data_->_tmp3_, 0, sizeof (UnityProtocolActivationReplyRaw));
00678               _data_->_state_ = 1;
00679               unity_protocol_scope_service_activate ((UnityProtocolScopeService*) _data_->_tmp0_, _data_->_tmp1_, (guint) _data_->_tmp2_, unity_scope_activate_ready, _data_);
00680               return FALSE;
00681               _state_1:
00682               unity_protocol_scope_service_activate_finish ((UnityProtocolScopeService*) _data_->_tmp0_, _data_->_res_, &_data_->_tmp3_, &_data_->_inner_error_);
00683               _data_->reply = _data_->_tmp3_;
00684               if (_data_->_inner_error_ != NULL) {
00685                      goto __catch19_g_error;
00686               }
00687               _data_->result = _data_->reply;
00688               if (_data_->_state_ == 0) {
00689                      g_simple_async_result_complete_in_idle (_data_->_async_result);
00690               } else {
00691                      g_simple_async_result_complete (_data_->_async_result);
00692               }
00693               g_object_unref (_data_->_async_result);
00694               return FALSE;
00695        }
00696        goto __finally19;
00697        __catch19_g_error:
00698        {
00699               _data_->e = _data_->_inner_error_;
00700               _data_->_inner_error_ = NULL;
00701               _data_->_tmp4_ = _data_->e;
00702               _data_->_tmp5_ = _data_->_tmp4_->message;
00703               _data_->_tmp6_ = NULL;
00704               _data_->_tmp6_ = string_to_string (_data_->_tmp5_);
00705               _data_->_tmp7_ = NULL;
00706               _data_->_tmp7_ = g_strconcat ("Unable to activate scope: ", _data_->_tmp6_, NULL);
00707               _data_->_tmp8_ = _data_->_tmp7_;
00708               g_warning ("unity-scope.vala:200: %s", _data_->_tmp8_);
00709               _g_free0 (_data_->_tmp8_);
00710               _g_error_free0 (_data_->e);
00711        }
00712        __finally19:
00713        if (_data_->_inner_error_ != NULL) {
00714               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
00715               g_clear_error (&_data_->_inner_error_);
00716               return FALSE;
00717        }
00718        memset (&_data_->res, 0, sizeof (UnityProtocolActivationReplyRaw));
00719        _data_->_tmp9_ = _data_->uri;
00720        _data_->_tmp10_ = g_strdup (_data_->_tmp9_);
00721        _g_free0 (_data_->res.uri);
00722        _data_->res.uri = _data_->_tmp10_;
00723        _data_->res.handled = (guint) UNITY_HANDLED_TYPE_NOT_HANDLED;
00724        _data_->_tmp11_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_variant_unref0_);
00725        _g_hash_table_unref0 (_data_->res.hints);
00726        _data_->res.hints = _data_->_tmp11_;
00727        _data_->result = _data_->res;
00728        if (_data_->_state_ == 0) {
00729               g_simple_async_result_complete_in_idle (_data_->_async_result);
00730        } else {
00731               g_simple_async_result_complete (_data_->_async_result);
00732        }
00733        g_object_unref (_data_->_async_result);
00734        return FALSE;
00735        unity_protocol_activation_reply_raw_destroy (&_data_->res);
00736        if (_data_->_state_ == 0) {
00737               g_simple_async_result_complete_in_idle (_data_->_async_result);
00738        } else {
00739               g_simple_async_result_complete (_data_->_async_result);
00740        }
00741        g_object_unref (_data_->_async_result);
00742        return FALSE;
00743 }
00744 
00745 
00746 static void unity_scope_update_preview_property_data_free (gpointer _data) {
00747        UnityScopeUpdatePreviewPropertyData* _data_;
00748        _data_ = _data;
00749        _g_free0 (_data_->uri);
00750        _g_hash_table_unref0 (_data_->values);
00751        _g_hash_table_unref0 (_data_->result);
00752        _g_object_unref0 (_data_->self);
00753        g_slice_free (UnityScopeUpdatePreviewPropertyData, _data_);
00754 }
00755 
00756 
00757 static gpointer _g_hash_table_ref0 (gpointer self) {
00758        return self ? g_hash_table_ref (self) : NULL;
00759 }
00760 
00761 
00762 void unity_scope_update_preview_property (UnityScope* self, const gchar* uri, GHashTable* values, GAsyncReadyCallback _callback_, gpointer _user_data_) {
00763        UnityScopeUpdatePreviewPropertyData* _data_;
00764        UnityScope* _tmp0_;
00765        const gchar* _tmp1_;
00766        gchar* _tmp2_;
00767        GHashTable* _tmp3_;
00768        GHashTable* _tmp4_;
00769        _data_ = g_slice_new0 (UnityScopeUpdatePreviewPropertyData);
00770        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_scope_update_preview_property);
00771        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_scope_update_preview_property_data_free);
00772        _tmp0_ = _g_object_ref0 (self);
00773        _data_->self = _tmp0_;
00774        _tmp1_ = uri;
00775        _tmp2_ = g_strdup (_tmp1_);
00776        _data_->uri = _tmp2_;
00777        _tmp3_ = values;
00778        _tmp4_ = _g_hash_table_ref0 (_tmp3_);
00779        _data_->values = _tmp4_;
00780        unity_scope_update_preview_property_co (_data_);
00781 }
00782 
00783 
00784 GHashTable* unity_scope_update_preview_property_finish (UnityScope* self, GAsyncResult* _res_) {
00785        GHashTable* result;
00786        UnityScopeUpdatePreviewPropertyData* _data_;
00787        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
00788        result = _data_->result;
00789        _data_->result = NULL;
00790        return result;
00791 }
00792 
00793 
00794 static void unity_scope_update_preview_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
00795        UnityScopeUpdatePreviewPropertyData* _data_;
00796        _data_ = _user_data_;
00797        _data_->_source_object_ = source_object;
00798        _data_->_res_ = _res_;
00799        unity_scope_update_preview_property_co (_data_);
00800 }
00801 
00802 
00803 static gboolean unity_scope_update_preview_property_co (UnityScopeUpdatePreviewPropertyData* _data_) {
00804        switch (_data_->_state_) {
00805               case 0:
00806               goto _state_0;
00807               case 1:
00808               goto _state_1;
00809               default:
00810               g_assert_not_reached ();
00811        }
00812        _state_0:
00813        {
00814               _data_->_tmp0_ = _data_->self->priv->_pimpl;
00815               _data_->_tmp1_ = _data_->uri;
00816               _data_->_tmp2_ = _data_->values;
00817               _data_->_state_ = 1;
00818               unity_protocol_scope_service_update_preview_property ((UnityProtocolScopeService*) _data_->_tmp0_, _data_->_tmp1_, _data_->_tmp2_, unity_scope_update_preview_property_ready, _data_);
00819               return FALSE;
00820               _state_1:
00821               _data_->_tmp3_ = NULL;
00822               _data_->_tmp3_ = unity_protocol_scope_service_update_preview_property_finish ((UnityProtocolScopeService*) _data_->_tmp0_, _data_->_res_, &_data_->_inner_error_);
00823               _data_->reply = _data_->_tmp3_;
00824               if (_data_->_inner_error_ != NULL) {
00825                      goto __catch20_g_error;
00826               }
00827               _data_->result = _data_->reply;
00828               if (_data_->_state_ == 0) {
00829                      g_simple_async_result_complete_in_idle (_data_->_async_result);
00830               } else {
00831                      g_simple_async_result_complete (_data_->_async_result);
00832               }
00833               g_object_unref (_data_->_async_result);
00834               return FALSE;
00835        }
00836        goto __finally20;
00837        __catch20_g_error:
00838        {
00839               _data_->e = _data_->_inner_error_;
00840               _data_->_inner_error_ = NULL;
00841               _data_->_tmp4_ = _data_->e;
00842               _data_->_tmp5_ = _data_->_tmp4_->message;
00843               _data_->_tmp6_ = NULL;
00844               _data_->_tmp6_ = string_to_string (_data_->_tmp5_);
00845               _data_->_tmp7_ = NULL;
00846               _data_->_tmp7_ = g_strconcat ("Unable to update preview property: ", _data_->_tmp6_, NULL);
00847               _data_->_tmp8_ = _data_->_tmp7_;
00848               g_warning ("unity-scope.vala:215: %s", _data_->_tmp8_);
00849               _g_free0 (_data_->_tmp8_);
00850               _g_error_free0 (_data_->e);
00851        }
00852        __finally20:
00853        if (_data_->_inner_error_ != NULL) {
00854               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
00855               g_clear_error (&_data_->_inner_error_);
00856               return FALSE;
00857        }
00858        _data_->_tmp9_ = g_str_hash;
00859        _data_->_tmp10_ = g_str_equal;
00860        _data_->_tmp11_ = g_hash_table_new_full (_data_->_tmp9_, _data_->_tmp10_, _g_free0_, _g_variant_unref0_);
00861        _data_->result = _data_->_tmp11_;
00862        if (_data_->_state_ == 0) {
00863               g_simple_async_result_complete_in_idle (_data_->_async_result);
00864        } else {
00865               g_simple_async_result_complete (_data_->_async_result);
00866        }
00867        g_object_unref (_data_->_async_result);
00868        return FALSE;
00869        if (_data_->_state_ == 0) {
00870               g_simple_async_result_complete_in_idle (_data_->_async_result);
00871        } else {
00872               g_simple_async_result_complete (_data_->_async_result);
00873        }
00874        g_object_unref (_data_->_async_result);
00875        return FALSE;
00876 }
00877 
00878 
00879 static void unity_scope_search_data_free (gpointer _data) {
00880        UnityScopeSearchData* _data_;
00881        _data_ = _data;
00882        _g_free0 (_data_->search_string);
00883        _g_hash_table_unref0 (_data_->hints);
00884        _g_hash_table_unref0 (_data_->result);
00885        _g_object_unref0 (_data_->self);
00886        g_slice_free (UnityScopeSearchData, _data_);
00887 }
00888 
00889 
00890 void unity_scope_search (UnityScope* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_) {
00891        UnityScopeSearchData* _data_;
00892        UnityScope* _tmp0_;
00893        const gchar* _tmp1_;
00894        gchar* _tmp2_;
00895        GHashTable* _tmp3_;
00896        GHashTable* _tmp4_;
00897        _data_ = g_slice_new0 (UnityScopeSearchData);
00898        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_scope_search);
00899        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_scope_search_data_free);
00900        _tmp0_ = _g_object_ref0 (self);
00901        _data_->self = _tmp0_;
00902        _tmp1_ = search_string;
00903        _tmp2_ = g_strdup (_tmp1_);
00904        _data_->search_string = _tmp2_;
00905        _tmp3_ = hints;
00906        _tmp4_ = _g_hash_table_ref0 (_tmp3_);
00907        _data_->hints = _tmp4_;
00908        unity_scope_search_co (_data_);
00909 }
00910 
00911 
00912 GHashTable* unity_scope_search_finish (UnityScope* self, GAsyncResult* _res_, GError** error) {
00913        GHashTable* result;
00914        UnityScopeSearchData* _data_;
00915        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
00916               return NULL;
00917        }
00918        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
00919        result = _data_->result;
00920        _data_->result = NULL;
00921        return result;
00922 }
00923 
00924 
00925 static void unity_scope_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
00926        UnityScopeSearchData* _data_;
00927        _data_ = _user_data_;
00928        _data_->_source_object_ = source_object;
00929        _data_->_res_ = _res_;
00930        unity_scope_search_co (_data_);
00931 }
00932 
00933 
00934 static gboolean unity_scope_search_co (UnityScopeSearchData* _data_) {
00935        switch (_data_->_state_) {
00936               case 0:
00937               goto _state_0;
00938               case 1:
00939               goto _state_1;
00940               default:
00941               g_assert_not_reached ();
00942        }
00943        _state_0:
00944        _data_->_tmp0_ = _data_->self->priv->_pimpl;
00945        _data_->_tmp1_ = _data_->search_string;
00946        _data_->_tmp2_ = _data_->hints;
00947        _data_->_state_ = 1;
00948        unity_protocol_scope_service_search ((UnityProtocolScopeService*) _data_->_tmp0_, _data_->_tmp1_, _data_->_tmp2_, unity_scope_search_ready, _data_);
00949        return FALSE;
00950        _state_1:
00951        _data_->_tmp3_ = NULL;
00952        _data_->_tmp3_ = unity_protocol_scope_service_search_finish ((UnityProtocolScopeService*) _data_->_tmp0_, _data_->_res_, &_data_->_inner_error_);
00953        _data_->_result_ = _data_->_tmp3_;
00954        if (_data_->_inner_error_ != NULL) {
00955               g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
00956               g_error_free (_data_->_inner_error_);
00957               if (_data_->_state_ == 0) {
00958                      g_simple_async_result_complete_in_idle (_data_->_async_result);
00959               } else {
00960                      g_simple_async_result_complete (_data_->_async_result);
00961               }
00962               g_object_unref (_data_->_async_result);
00963               return FALSE;
00964        }
00965        _data_->result = _data_->_result_;
00966        if (_data_->_state_ == 0) {
00967               g_simple_async_result_complete_in_idle (_data_->_async_result);
00968        } else {
00969               g_simple_async_result_complete (_data_->_async_result);
00970        }
00971        g_object_unref (_data_->_async_result);
00972        return FALSE;
00973        _g_hash_table_unref0 (_data_->_result_);
00974        if (_data_->_state_ == 0) {
00975               g_simple_async_result_complete_in_idle (_data_->_async_result);
00976        } else {
00977               g_simple_async_result_complete (_data_->_async_result);
00978        }
00979        g_object_unref (_data_->_async_result);
00980        return FALSE;
00981 }
00982 
00983 
00984 static void unity_scope_global_search_data_free (gpointer _data) {
00985        UnityScopeGlobalSearchData* _data_;
00986        _data_ = _data;
00987        _g_free0 (_data_->search_string);
00988        _g_hash_table_unref0 (_data_->hints);
00989        _g_hash_table_unref0 (_data_->result);
00990        _g_object_unref0 (_data_->self);
00991        g_slice_free (UnityScopeGlobalSearchData, _data_);
00992 }
00993 
00994 
00995 void unity_scope_global_search (UnityScope* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_) {
00996        UnityScopeGlobalSearchData* _data_;
00997        UnityScope* _tmp0_;
00998        const gchar* _tmp1_;
00999        gchar* _tmp2_;
01000        GHashTable* _tmp3_;
01001        GHashTable* _tmp4_;
01002        _data_ = g_slice_new0 (UnityScopeGlobalSearchData);
01003        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_scope_global_search);
01004        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_scope_global_search_data_free);
01005        _tmp0_ = _g_object_ref0 (self);
01006        _data_->self = _tmp0_;
01007        _tmp1_ = search_string;
01008        _tmp2_ = g_strdup (_tmp1_);
01009        _data_->search_string = _tmp2_;
01010        _tmp3_ = hints;
01011        _tmp4_ = _g_hash_table_ref0 (_tmp3_);
01012        _data_->hints = _tmp4_;
01013        unity_scope_global_search_co (_data_);
01014 }
01015 
01016 
01017 GHashTable* unity_scope_global_search_finish (UnityScope* self, GAsyncResult* _res_, GError** error) {
01018        GHashTable* result;
01019        UnityScopeGlobalSearchData* _data_;
01020        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
01021               return NULL;
01022        }
01023        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
01024        result = _data_->result;
01025        _data_->result = NULL;
01026        return result;
01027 }
01028 
01029 
01030 static void unity_scope_global_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
01031        UnityScopeGlobalSearchData* _data_;
01032        _data_ = _user_data_;
01033        _data_->_source_object_ = source_object;
01034        _data_->_res_ = _res_;
01035        unity_scope_global_search_co (_data_);
01036 }
01037 
01038 
01039 static gboolean unity_scope_global_search_co (UnityScopeGlobalSearchData* _data_) {
01040        switch (_data_->_state_) {
01041               case 0:
01042               goto _state_0;
01043               case 1:
01044               goto _state_1;
01045               default:
01046               g_assert_not_reached ();
01047        }
01048        _state_0:
01049        _data_->_tmp0_ = _data_->self->priv->_pimpl;
01050        _data_->_tmp1_ = _data_->search_string;
01051        _data_->_tmp2_ = _data_->hints;
01052        _data_->_state_ = 1;
01053        unity_protocol_scope_service_global_search ((UnityProtocolScopeService*) _data_->_tmp0_, _data_->_tmp1_, _data_->_tmp2_, unity_scope_global_search_ready, _data_);
01054        return FALSE;
01055        _state_1:
01056        _data_->_tmp3_ = NULL;
01057        _data_->_tmp3_ = unity_protocol_scope_service_global_search_finish ((UnityProtocolScopeService*) _data_->_tmp0_, _data_->_res_, &_data_->_inner_error_);
01058        _data_->_result_ = _data_->_tmp3_;
01059        if (_data_->_inner_error_ != NULL) {
01060               g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
01061               g_error_free (_data_->_inner_error_);
01062               if (_data_->_state_ == 0) {
01063                      g_simple_async_result_complete_in_idle (_data_->_async_result);
01064               } else {
01065                      g_simple_async_result_complete (_data_->_async_result);
01066               }
01067               g_object_unref (_data_->_async_result);
01068               return FALSE;
01069        }
01070        _data_->result = _data_->_result_;
01071        if (_data_->_state_ == 0) {
01072               g_simple_async_result_complete_in_idle (_data_->_async_result);
01073        } else {
01074               g_simple_async_result_complete (_data_->_async_result);
01075        }
01076        g_object_unref (_data_->_async_result);
01077        return FALSE;
01078        _g_hash_table_unref0 (_data_->_result_);
01079        if (_data_->_state_ == 0) {
01080               g_simple_async_result_complete_in_idle (_data_->_async_result);
01081        } else {
01082               g_simple_async_result_complete (_data_->_async_result);
01083        }
01084        g_object_unref (_data_->_async_result);
01085        return FALSE;
01086 }
01087 
01088 
01089 gboolean unity_scope_get_active (UnityScope* self) {
01090        gboolean result;
01091        gboolean _tmp0_;
01092        g_return_val_if_fail (self != NULL, FALSE);
01093        _tmp0_ = self->priv->_active;
01094        result = _tmp0_;
01095        return result;
01096 }
01097 
01098 
01099 void unity_scope_set_active (UnityScope* self, gboolean value) {
01100        gboolean _tmp0_;
01101        g_return_if_fail (self != NULL);
01102        _tmp0_ = value;
01103        self->priv->_active = _tmp0_;
01104        g_object_notify ((GObject *) self, "active");
01105 }
01106 
01107 
01108 gboolean unity_scope_get_exported (UnityScope* self) {
01109        gboolean result;
01110        gboolean _tmp0_;
01111        g_return_val_if_fail (self != NULL, FALSE);
01112        _tmp0_ = self->priv->_exported;
01113        result = _tmp0_;
01114        return result;
01115 }
01116 
01117 
01118 static void unity_scope_set_exported (UnityScope* self, gboolean value) {
01119        gboolean _tmp0_;
01120        g_return_if_fail (self != NULL);
01121        _tmp0_ = value;
01122        self->priv->_exported = _tmp0_;
01123        g_object_notify ((GObject *) self, "exported");
01124 }
01125 
01126 
01127 gboolean unity_scope_get_search_in_global (UnityScope* self) {
01128        gboolean result;
01129        gboolean _tmp0_;
01130        g_return_val_if_fail (self != NULL, FALSE);
01131        _tmp0_ = self->priv->_search_in_global;
01132        result = _tmp0_;
01133        return result;
01134 }
01135 
01136 
01137 void unity_scope_set_search_in_global (UnityScope* self, gboolean value) {
01138        gboolean _tmp0_;
01139        g_return_if_fail (self != NULL);
01140        _tmp0_ = value;
01141        self->priv->_search_in_global = _tmp0_;
01142        g_object_notify ((GObject *) self, "search-in-global");
01143 }
01144 
01145 
01146 const gchar* unity_scope_get_dbus_path (UnityScope* self) {
01147        const gchar* result;
01148        const gchar* _tmp0_;
01149        g_return_val_if_fail (self != NULL, NULL);
01150        _tmp0_ = self->priv->_dbus_path;
01151        result = _tmp0_;
01152        return result;
01153 }
01154 
01155 
01156 static void unity_scope_set_dbus_path (UnityScope* self, const gchar* value) {
01157        const gchar* _tmp0_;
01158        gchar* _tmp1_;
01159        g_return_if_fail (self != NULL);
01160        _tmp0_ = value;
01161        _tmp1_ = g_strdup (_tmp0_);
01162        _g_free0 (self->priv->_dbus_path);
01163        self->priv->_dbus_path = _tmp1_;
01164        g_object_notify ((GObject *) self, "dbus-path");
01165 }
01166 
01167 
01168 UnityOptionsFilter* unity_scope_get_sources (UnityScope* self) {
01169        UnityOptionsFilter* result;
01170        UnityOptionsFilter* _tmp0_;
01171        g_return_val_if_fail (self != NULL, NULL);
01172        _tmp0_ = self->priv->_sources;
01173        result = _tmp0_;
01174        return result;
01175 }
01176 
01177 
01178 void unity_scope_set_sources (UnityScope* self, UnityOptionsFilter* value) {
01179        UnityOptionsFilter* _tmp0_;
01180        UnityOptionsFilter* _tmp1_;
01181        g_return_if_fail (self != NULL);
01182        _tmp0_ = value;
01183        _tmp1_ = _g_object_ref0 (_tmp0_);
01184        _g_object_unref0 (self->priv->_sources);
01185        self->priv->_sources = _tmp1_;
01186        g_object_notify ((GObject *) self, "sources");
01187 }
01188 
01189 
01190 GList* unity_scope_get_filters (UnityScope* self) {
01191        GList* result;
01192        GList* _tmp0_;
01193        g_return_val_if_fail (self != NULL, NULL);
01194        _tmp0_ = self->_filters;
01195        result = _tmp0_;
01196        return result;
01197 }
01198 
01199 
01200 DeeSerializableModel* unity_scope_get_results_model (UnityScope* self) {
01201        DeeSerializableModel* result;
01202        UnityScopeImpl* _tmp0_;
01203        DeeSerializableModel* _tmp1_;
01204        g_return_val_if_fail (self != NULL, NULL);
01205        _tmp0_ = self->priv->_pimpl;
01206        _tmp1_ = _tmp0_->_results_model;
01207        result = _tmp1_;
01208        return result;
01209 }
01210 
01211 
01212 DeeSerializableModel* unity_scope_get_global_results_model (UnityScope* self) {
01213        DeeSerializableModel* result;
01214        UnityScopeImpl* _tmp0_;
01215        DeeSerializableModel* _tmp1_;
01216        g_return_val_if_fail (self != NULL, NULL);
01217        _tmp0_ = self->priv->_pimpl;
01218        _tmp1_ = _tmp0_->_global_results_model;
01219        result = _tmp1_;
01220        return result;
01221 }
01222 
01223 
01224 static void g_cclosure_user_marshal_OBJECT__STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
01225        typedef gpointer (*GMarshalFunc_OBJECT__STRING) (gpointer data1, const char* arg_1, gpointer data2);
01226        register GMarshalFunc_OBJECT__STRING callback;
01227        register GCClosure * cc;
01228        register gpointer data1;
01229        register gpointer data2;
01230        gpointer v_return;
01231        cc = (GCClosure *) closure;
01232        g_return_if_fail (return_value != NULL);
01233        g_return_if_fail (n_param_values == 2);
01234        if (G_CCLOSURE_SWAP_DATA (closure)) {
01235               data1 = closure->data;
01236               data2 = param_values->data[0].v_pointer;
01237        } else {
01238               data1 = param_values->data[0].v_pointer;
01239               data2 = closure->data;
01240        }
01241        callback = (GMarshalFunc_OBJECT__STRING) (marshal_data ? marshal_data : cc->callback);
01242        v_return = callback (data1, g_value_get_string (param_values + 1), data2);
01243        g_value_take_object (return_value, v_return);
01244 }
01245 
01246 
01247 static void g_cclosure_user_marshal_VOID__BOXED_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
01248        typedef void (*GMarshalFunc_VOID__BOXED_INT) (gpointer data1, gpointer arg_1, gint arg_2, gpointer data2);
01249        register GMarshalFunc_VOID__BOXED_INT callback;
01250        register GCClosure * cc;
01251        register gpointer data1;
01252        register gpointer data2;
01253        cc = (GCClosure *) closure;
01254        g_return_if_fail (n_param_values == 3);
01255        if (G_CCLOSURE_SWAP_DATA (closure)) {
01256               data1 = closure->data;
01257               data2 = param_values->data[0].v_pointer;
01258        } else {
01259               data1 = param_values->data[0].v_pointer;
01260               data2 = closure->data;
01261        }
01262        callback = (GMarshalFunc_VOID__BOXED_INT) (marshal_data ? marshal_data : cc->callback);
01263        callback (data1, g_value_get_boxed (param_values + 1), g_value_get_int (param_values + 2), data2);
01264 }
01265 
01266 
01267 static void g_cclosure_user_marshal_VOID__OBJECT_ENUM_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
01268        typedef void (*GMarshalFunc_VOID__OBJECT_ENUM_OBJECT) (gpointer data1, gpointer arg_1, gint arg_2, gpointer arg_3, gpointer data2);
01269        register GMarshalFunc_VOID__OBJECT_ENUM_OBJECT callback;
01270        register GCClosure * cc;
01271        register gpointer data1;
01272        register gpointer data2;
01273        cc = (GCClosure *) closure;
01274        g_return_if_fail (n_param_values == 4);
01275        if (G_CCLOSURE_SWAP_DATA (closure)) {
01276               data1 = closure->data;
01277               data2 = param_values->data[0].v_pointer;
01278        } else {
01279               data1 = param_values->data[0].v_pointer;
01280               data2 = closure->data;
01281        }
01282        callback = (GMarshalFunc_VOID__OBJECT_ENUM_OBJECT) (marshal_data ? marshal_data : cc->callback);
01283        callback (data1, g_value_get_object (param_values + 1), g_value_get_enum (param_values + 2), g_value_get_object (param_values + 3), data2);
01284 }
01285 
01286 
01287 static void g_cclosure_user_marshal_STRING__OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
01288        typedef const char* (*GMarshalFunc_STRING__OBJECT) (gpointer data1, gpointer arg_1, gpointer data2);
01289        register GMarshalFunc_STRING__OBJECT callback;
01290        register GCClosure * cc;
01291        register gpointer data1;
01292        register gpointer data2;
01293        const char* v_return;
01294        cc = (GCClosure *) closure;
01295        g_return_if_fail (return_value != NULL);
01296        g_return_if_fail (n_param_values == 2);
01297        if (G_CCLOSURE_SWAP_DATA (closure)) {
01298               data1 = closure->data;
01299               data2 = param_values->data[0].v_pointer;
01300        } else {
01301               data1 = param_values->data[0].v_pointer;
01302               data2 = closure->data;
01303        }
01304        callback = (GMarshalFunc_STRING__OBJECT) (marshal_data ? marshal_data : cc->callback);
01305        v_return = callback (data1, g_value_get_object (param_values + 1), data2);
01306        g_value_take_string (return_value, v_return);
01307 }
01308 
01309 
01310 static GObject * unity_scope_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
01311        GObject * obj;
01312        GObjectClass * parent_class;
01313        UnityScope * self;
01314        UnityCheckOptionFilter* _tmp0_;
01315        UnityCheckOptionFilter* _tmp1_;
01316        UnityScopeImpl* _tmp2_;
01317        parent_class = G_OBJECT_CLASS (unity_scope_parent_class);
01318        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
01319        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_SCOPE, UnityScope);
01320        _tmp0_ = unity_check_option_filter_new ("sources", "Sources", NULL, TRUE);
01321        _tmp1_ = _tmp0_;
01322        unity_scope_set_sources (self, (UnityOptionsFilter*) _tmp1_);
01323        _g_object_unref0 (_tmp1_);
01324        _tmp2_ = unity_scope_impl_new (self);
01325        _g_object_unref0 (self->priv->_pimpl);
01326        self->priv->_pimpl = _tmp2_;
01327        G_STATIC_ASSERT (UNITY_SEARCH_TYPE_N_TYPES == 2);
01328        return obj;
01329 }
01330 
01331 
01332 static void unity_scope_class_init (UnityScopeClass * klass) {
01333        unity_scope_parent_class = g_type_class_peek_parent (klass);
01334        g_type_class_add_private (klass, sizeof (UnityScopePrivate));
01335        G_OBJECT_CLASS (klass)->get_property = _vala_unity_scope_get_property;
01336        G_OBJECT_CLASS (klass)->set_property = _vala_unity_scope_set_property;
01337        G_OBJECT_CLASS (klass)->constructor = unity_scope_constructor;
01338        G_OBJECT_CLASS (klass)->finalize = unity_scope_finalize;
01339        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SCOPE_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));
01340        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SCOPE_EXPORTED, g_param_spec_boolean ("exported", "exported", "exported", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
01341        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SCOPE_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));
01342        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SCOPE_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));
01343        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SCOPE_SOURCES, g_param_spec_object ("sources", "sources", "sources", UNITY_TYPE_OPTIONS_FILTER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01344        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SCOPE_FILTERS, g_param_spec_pointer ("filters", "filters", "filters", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
01345        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SCOPE_RESULTS_MODEL, g_param_spec_object ("results-model", "results-model", "results-model", dee_serializable_model_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
01346        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SCOPE_GLOBAL_RESULTS_MODEL, g_param_spec_object ("global-results-model", "global-results-model", "global-results-model", dee_serializable_model_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
01347        g_signal_new ("activate_uri", UNITY_TYPE_SCOPE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_OBJECT__STRING, UNITY_TYPE_ACTIVATION_RESPONSE, 1, G_TYPE_STRING);
01348        g_signal_new ("preview_uri", UNITY_TYPE_SCOPE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_OBJECT__STRING, UNITY_TYPE_PREVIEW, 1, G_TYPE_STRING);
01349        g_signal_new ("filters_changed", UNITY_TYPE_SCOPE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
01350        g_signal_new ("active_sources_changed", UNITY_TYPE_SCOPE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED_INT, G_TYPE_NONE, 2, G_TYPE_STRV, G_TYPE_INT);
01351        g_signal_new ("search_changed", UNITY_TYPE_SCOPE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_ENUM_OBJECT, G_TYPE_NONE, 3, UNITY_TYPE_LENS_SEARCH, UNITY_TYPE_SEARCH_TYPE, g_cancellable_get_type ());
01352        g_signal_new ("generate_search_key", UNITY_TYPE_SCOPE, G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_user_marshal_STRING__OBJECT, G_TYPE_STRING, 1, UNITY_TYPE_LENS_SEARCH);
01353 }
01354 
01355 
01356 static void unity_scope_instance_init (UnityScope * self) {
01357        self->priv = UNITY_SCOPE_GET_PRIVATE (self);
01358        self->priv->_active = FALSE;
01359        self->priv->_exported = FALSE;
01360        self->priv->_search_in_global = TRUE;
01361        self->priv->is_local = FALSE;
01362        self->_filters = NULL;
01363 }
01364 
01365 
01366 static void unity_scope_finalize (GObject* obj) {
01367        UnityScope * self;
01368        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_SCOPE, UnityScope);
01369        _g_free0 (self->priv->_dbus_path);
01370        _g_object_unref0 (self->priv->_sources);
01371        _vala_array_destroy (self->priv->last_search, 2, (GDestroyNotify) g_object_unref);
01372        _g_object_unref0 (self->priv->_pimpl);
01373        __g_list_free__g_object_unref0_0 (self->_filters);
01374        G_OBJECT_CLASS (unity_scope_parent_class)->finalize (obj);
01375 }
01376 
01377 
01378 GType unity_scope_get_type (void) {
01379        static volatile gsize unity_scope_type_id__volatile = 0;
01380        if (g_once_init_enter (&unity_scope_type_id__volatile)) {
01381               static const GTypeInfo g_define_type_info = { sizeof (UnityScopeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_scope_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityScope), 0, (GInstanceInitFunc) unity_scope_instance_init, NULL };
01382               GType unity_scope_type_id;
01383               unity_scope_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityScope", &g_define_type_info, 0);
01384               g_once_init_leave (&unity_scope_type_id__volatile, unity_scope_type_id);
01385        }
01386        return unity_scope_type_id__volatile;
01387 }
01388 
01389 
01390 static void _vala_unity_scope_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
01391        UnityScope * self;
01392        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_SCOPE, UnityScope);
01393        switch (property_id) {
01394               case UNITY_SCOPE_ACTIVE:
01395               g_value_set_boolean (value, unity_scope_get_active (self));
01396               break;
01397               case UNITY_SCOPE_EXPORTED:
01398               g_value_set_boolean (value, unity_scope_get_exported (self));
01399               break;
01400               case UNITY_SCOPE_SEARCH_IN_GLOBAL:
01401               g_value_set_boolean (value, unity_scope_get_search_in_global (self));
01402               break;
01403               case UNITY_SCOPE_DBUS_PATH:
01404               g_value_set_string (value, unity_scope_get_dbus_path (self));
01405               break;
01406               case UNITY_SCOPE_SOURCES:
01407               g_value_set_object (value, unity_scope_get_sources (self));
01408               break;
01409               case UNITY_SCOPE_FILTERS:
01410               g_value_set_pointer (value, unity_scope_get_filters (self));
01411               break;
01412               case UNITY_SCOPE_RESULTS_MODEL:
01413               g_value_set_object (value, unity_scope_get_results_model (self));
01414               break;
01415               case UNITY_SCOPE_GLOBAL_RESULTS_MODEL:
01416               g_value_set_object (value, unity_scope_get_global_results_model (self));
01417               break;
01418               default:
01419               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01420               break;
01421        }
01422 }
01423 
01424 
01425 static void _vala_unity_scope_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
01426        UnityScope * self;
01427        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_SCOPE, UnityScope);
01428        switch (property_id) {
01429               case UNITY_SCOPE_ACTIVE:
01430               unity_scope_set_active (self, g_value_get_boolean (value));
01431               break;
01432               case UNITY_SCOPE_EXPORTED:
01433               unity_scope_set_exported (self, g_value_get_boolean (value));
01434               break;
01435               case UNITY_SCOPE_SEARCH_IN_GLOBAL:
01436               unity_scope_set_search_in_global (self, g_value_get_boolean (value));
01437               break;
01438               case UNITY_SCOPE_DBUS_PATH:
01439               unity_scope_set_dbus_path (self, g_value_get_string (value));
01440               break;
01441               case UNITY_SCOPE_SOURCES:
01442               unity_scope_set_sources (self, g_value_get_object (value));
01443               break;
01444               default:
01445               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01446               break;
01447        }
01448 }
01449 
01450 
01451 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
01452        if ((array != NULL) && (destroy_func != NULL)) {
01453               int i;
01454               for (i = 0; i < array_length; i = i + 1) {
01455                      if (((gpointer*) array)[i] != NULL) {
01456                             destroy_func (((gpointer*) array)[i]);
01457                      }
01458               }
01459        }
01460 }
01461 
01462 
01463 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
01464        _vala_array_destroy (array, array_length, destroy_func);
01465        g_free (array);
01466 }
01467 
01468 
01469