Back to index

libunity  5.92.0
test-lens.c
Go to the documentation of this file.
00001 /* test-lens.c generated by valac 0.17.2, the Vala compiler
00002  * generated from test-lens.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2011 Canonical Ltd
00006  *
00007  * This program is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 3 as
00009  * published by the Free Software Foundation.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  * Authored by Michal Hruby <michal.hruby@canonical.com>
00020  *
00021  */
00022 
00023 #include <glib.h>
00024 #include <glib-object.h>
00025 #include <unity-internal.h>
00026 #include <stdlib.h>
00027 #include <string.h>
00028 #include <config.h>
00029 #include <gio/gio.h>
00030 #include <unity-protocol.h>
00031 #include <dee.h>
00032 #include <gobject/gvaluecollector.h>
00033 
00034 
00035 #define TYPE_MAIN (main_get_type ())
00036 #define MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN, Main))
00037 #define MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN, MainClass))
00038 #define IS_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN))
00039 #define IS_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN))
00040 #define MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN, MainClass))
00041 
00042 typedef struct _Main Main;
00043 typedef struct _MainClass MainClass;
00044 typedef struct _MainPrivate MainPrivate;
00045 typedef struct _Block1Data Block1Data;
00046 #define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
00047 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00048 typedef struct _Block2Data Block2Data;
00049 typedef struct _Block3Data Block3Data;
00050 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00051 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
00052 #define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
00053 #define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
00054 typedef struct _Block4Data Block4Data;
00055 typedef struct _Block5Data Block5Data;
00056 
00057 #define MAIN_TYPE_SIGNAL_WRAPPER (main_signal_wrapper_get_type ())
00058 #define MAIN_SIGNAL_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAIN_TYPE_SIGNAL_WRAPPER, MainSignalWrapper))
00059 #define MAIN_SIGNAL_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAIN_TYPE_SIGNAL_WRAPPER, MainSignalWrapperClass))
00060 #define MAIN_IS_SIGNAL_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAIN_TYPE_SIGNAL_WRAPPER))
00061 #define MAIN_IS_SIGNAL_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAIN_TYPE_SIGNAL_WRAPPER))
00062 #define MAIN_SIGNAL_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAIN_TYPE_SIGNAL_WRAPPER, MainSignalWrapperClass))
00063 
00064 typedef struct _MainSignalWrapper MainSignalWrapper;
00065 typedef struct _MainSignalWrapperClass MainSignalWrapperClass;
00066 typedef struct _Block6Data Block6Data;
00067 
00068 #define MAIN_TYPE_TEST_MERGE_STRATEGY (main_test_merge_strategy_get_type ())
00069 #define MAIN_TEST_MERGE_STRATEGY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAIN_TYPE_TEST_MERGE_STRATEGY, MainTestMergeStrategy))
00070 #define MAIN_TEST_MERGE_STRATEGY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAIN_TYPE_TEST_MERGE_STRATEGY, MainTestMergeStrategyClass))
00071 #define MAIN_IS_TEST_MERGE_STRATEGY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAIN_TYPE_TEST_MERGE_STRATEGY))
00072 #define MAIN_IS_TEST_MERGE_STRATEGY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAIN_TYPE_TEST_MERGE_STRATEGY))
00073 #define MAIN_TEST_MERGE_STRATEGY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAIN_TYPE_TEST_MERGE_STRATEGY, MainTestMergeStrategyClass))
00074 
00075 typedef struct _MainTestMergeStrategy MainTestMergeStrategy;
00076 typedef struct _MainTestMergeStrategyClass MainTestMergeStrategyClass;
00077 typedef struct _MainTestMergeStrategyPrivate MainTestMergeStrategyPrivate;
00078 typedef struct _Block7Data Block7Data;
00079 typedef struct _Block8Data Block8Data;
00080 typedef struct _Block9Data Block9Data;
00081 typedef struct _Block10Data Block10Data;
00082 typedef struct _Block11Data Block11Data;
00083 typedef struct _Block12Data Block12Data;
00084 #define _g_free0(var) (var = (g_free (var), NULL))
00085 typedef struct _Block13Data Block13Data;
00086 typedef struct _Block14Data Block14Data;
00087 typedef struct _Block15Data Block15Data;
00088 #define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
00089 typedef struct _Block16Data Block16Data;
00090 typedef struct _Block17Data Block17Data;
00091 typedef struct _Block18Data Block18Data;
00092 typedef struct _Block19Data Block19Data;
00093 typedef struct _Block20Data Block20Data;
00094 typedef struct _Block21Data Block21Data;
00095 typedef struct _MainSignalWrapperPrivate MainSignalWrapperPrivate;
00096 typedef struct _MainParamSpecSignalWrapper MainParamSpecSignalWrapper;
00097 typedef struct _ParamSpecMain ParamSpecMain;
00098 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
00099 
00100 struct _Main {
00101        GTypeInstance parent_instance;
00102        volatile int ref_count;
00103        MainPrivate * priv;
00104 };
00105 
00106 struct _MainClass {
00107        GTypeClass parent_class;
00108        void (*finalize) (Main *self);
00109 };
00110 
00111 struct _Block1Data {
00112        int _ref_count_;
00113        gboolean timeout_reached;
00114        GMainLoop* ml;
00115 };
00116 
00117 struct _Block2Data {
00118        int _ref_count_;
00119        gboolean scope_up;
00120        GMainLoop* ml;
00121 };
00122 
00123 struct _Block3Data {
00124        int _ref_count_;
00125        GDBusConnection* bus;
00126        GFunc cb;
00127        gpointer cb_target;
00128 };
00129 
00130 struct _Block4Data {
00131        int _ref_count_;
00132        GMainLoop* ml;
00133 };
00134 
00135 struct _Block5Data {
00136        int _ref_count_;
00137        GMainLoop* ml;
00138        gboolean got_global_search;
00139        gboolean got_lens_search;
00140 };
00141 
00142 struct _Block6Data {
00143        int _ref_count_;
00144        GMainLoop* ml;
00145        gboolean got_search_changed;
00146 };
00147 
00148 struct _MainTestMergeStrategy {
00149        GObject parent_instance;
00150        MainTestMergeStrategyPrivate * priv;
00151        gint n_rows;
00152 };
00153 
00154 struct _MainTestMergeStrategyClass {
00155        GObjectClass parent_class;
00156 };
00157 
00158 struct _Block7Data {
00159        int _ref_count_;
00160        GMainLoop* ml;
00161 };
00162 
00163 struct _Block8Data {
00164        int _ref_count_;
00165        GMainLoop* ml;
00166        gboolean got_search_changed;
00167        gboolean finish_called;
00168 };
00169 
00170 struct _Block9Data {
00171        int _ref_count_;
00172        Block8Data * _data8_;
00173        UnityLensSearch* lens_search;
00174 };
00175 
00176 struct _Block10Data {
00177        int _ref_count_;
00178        GMainLoop* ml;
00179        gboolean got_search_changed;
00180        gboolean finish_called;
00181        GVariant* result1;
00182        GVariant* result2;
00183 };
00184 
00185 struct _Block11Data {
00186        int _ref_count_;
00187        Block10Data * _data10_;
00188        UnityLensSearch* lens_search;
00189 };
00190 
00191 struct _Block12Data {
00192        int _ref_count_;
00193        GMainLoop* ml;
00194        GCancellable* canc1;
00195        GCancellable* canc2;
00196        gboolean got_search_changed;
00197        guint finish_calls;
00198        gchar* order;
00199        GMainLoop* reply_ml;
00200        gint replies;
00201 };
00202 
00203 struct _Block13Data {
00204        int _ref_count_;
00205        Block12Data * _data12_;
00206        UnityLensSearch* lens_search;
00207 };
00208 
00209 struct _Block14Data {
00210        int _ref_count_;
00211        gboolean got_search_changed;
00212        GMainLoop* ml;
00213        guint64 seqnum;
00214 };
00215 
00216 struct _Block15Data {
00217        int _ref_count_;
00218        Block14Data * _data14_;
00219        UnityLensSearch* lens_search;
00220 };
00221 
00222 struct _Block16Data {
00223        int _ref_count_;
00224        gboolean got_search_changed;
00225        GMainLoop* ml;
00226        gchar* hint_reply;
00227 };
00228 
00229 struct _Block17Data {
00230        int _ref_count_;
00231        Block16Data * _data16_;
00232        UnityLensSearch* lens_search;
00233 };
00234 
00235 struct _Block18Data {
00236        int _ref_count_;
00237        GMainLoop* ml;
00238 };
00239 
00240 struct _Block19Data {
00241        int _ref_count_;
00242        GMainLoop* ml;
00243        guint64 seqnum;
00244        gboolean got_activate_uri_signal;
00245 };
00246 
00247 struct _Block20Data {
00248        int _ref_count_;
00249        GMainLoop* ml;
00250        gboolean got_activate_uri_signal;
00251        gboolean got_preview_uri_signal;
00252        UnityPreviewAction* action;
00253        UnityProtocolPreview* reconstructed;
00254        gboolean got_action_activated_signal;
00255 };
00256 
00257 struct _Block21Data {
00258        int _ref_count_;
00259        GMainLoop* ml;
00260        gboolean got_activate_uri_signal;
00261        gboolean got_preview_uri_signal;
00262        gchar* request_item_signal_uri;
00263        gint request_item_signal_count;
00264        UnitySeriesPreview* series_preview;
00265        UnityProtocolSeriesPreview* sp_reconstructed;
00266        UnityProtocolGenericPreview* gp_reconstructed;
00267 };
00268 
00269 struct _MainSignalWrapper {
00270        GTypeInstance parent_instance;
00271        volatile int ref_count;
00272        MainSignalWrapperPrivate * priv;
00273 };
00274 
00275 struct _MainSignalWrapperClass {
00276        GTypeClass parent_class;
00277        void (*finalize) (MainSignalWrapper *self);
00278 };
00279 
00280 struct _MainSignalWrapperPrivate {
00281        GObject* obj;
00282        gulong sig_id;
00283 };
00284 
00285 struct _MainParamSpecSignalWrapper {
00286        GParamSpec parent_instance;
00287 };
00288 
00289 struct _ParamSpecMain {
00290        GParamSpec parent_instance;
00291 };
00292 
00293 
00294 static gpointer main_parent_class = NULL;
00295 static gboolean main_remote_scope_test;
00296 static gboolean main_remote_scope_test = FALSE;
00297 static UnityLens* main_exported_lens;
00298 static UnityLens* main_exported_lens = NULL;
00299 static gboolean main_name_owned;
00300 static gboolean main_name_owned = FALSE;
00301 static UnityScope* main_local_scope;
00302 static UnityScope* main_local_scope = NULL;
00303 static gpointer main_signal_wrapper_parent_class = NULL;
00304 static gpointer main_test_merge_strategy_parent_class = NULL;
00305 static UnityMergeStrategyIface* main_test_merge_strategy_unity_merge_strategy_parent_iface = NULL;
00306 
00307 gpointer main_ref (gpointer instance);
00308 void main_unref (gpointer instance);
00309 GParamSpec* param_spec_main (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00310 void value_set_main (GValue* value, gpointer v_object);
00311 void value_take_main (GValue* value, gpointer v_object);
00312 gpointer value_get_main (const GValue* value);
00313 GType main_get_type (void) G_GNUC_CONST;
00314 enum  {
00315        MAIN_DUMMY_PROPERTY
00316 };
00317 gint main_main (gchar** args, int args_length1);
00318 static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
00319 void main_test_lens_export (void);
00320 static void _main_test_lens_export_gtest_data_func (gpointer self);
00321 void main_test_remote_scope_init (void);
00322 static void _main_test_remote_scope_init_gtest_data_func (gpointer self);
00323 void main_test_local_scope_init (void);
00324 static void _main_test_local_scope_init_gtest_data_func (gpointer self);
00325 void main_test_local_scope_search_on_first_view (void);
00326 static void _main_test_local_scope_search_on_first_view_gtest_data_func (gpointer self);
00327 void main_test_lens_search (void);
00328 static void _main_test_lens_search_gtest_data_func (gpointer self);
00329 void main_test_local_scope_search (void);
00330 static void _main_test_local_scope_search_gtest_data_func (gpointer self);
00331 void main_test_merge_strategy (void);
00332 static void _main_test_merge_strategy_gtest_data_func (gpointer self);
00333 void main_test_lens_return_after_scope_finish (void);
00334 static void _main_test_lens_return_after_scope_finish_gtest_data_func (gpointer self);
00335 void main_test_lens_successive_searches (void);
00336 static void _main_test_lens_successive_searches_gtest_data_func (gpointer self);
00337 void main_test_lens_two_searches (void);
00338 static void _main_test_lens_two_searches_gtest_data_func (gpointer self);
00339 void main_test_lens_model_sync (void);
00340 static void _main_test_lens_model_sync_gtest_data_func (gpointer self);
00341 void main_test_lens_reply_hint (void);
00342 static void _main_test_lens_reply_hint_gtest_data_func (gpointer self);
00343 void main_test_lens_sources (void);
00344 static void _main_test_lens_sources_gtest_data_func (gpointer self);
00345 void main_test_lens_activation (void);
00346 static void _main_test_lens_activation_gtest_data_func (gpointer self);
00347 void main_test_lens_preview (void);
00348 static void _main_test_lens_preview_gtest_data_func (gpointer self);
00349 void main_test_lens_preview_signal (void);
00350 static void _main_test_lens_preview_signal_gtest_data_func (gpointer self);
00351 gboolean main_run_with_timeout (GMainLoop* ml, guint timeout_ms);
00352 static Block1Data* block1_data_ref (Block1Data* _data1_);
00353 static void block1_data_unref (void * _userdata_);
00354 static gboolean __lambda7_ (Block1Data* _data1_);
00355 static gboolean ___lambda7__gsource_func (gpointer self);
00356 static void __lambda2_ (void);
00357 static void ___lambda2__gbus_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00358 static void __lambda3_ (void);
00359 static void ___lambda3__gbus_name_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00360 static void __lambda4_ (void);
00361 static void ___lambda4__gbus_name_lost_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00362 static Block2Data* block2_data_ref (Block2Data* _data2_);
00363 static void block2_data_unref (void * _userdata_);
00364 static void __lambda5_ (Block2Data* _data2_);
00365 static void ___lambda5__gbus_name_appeared_callback (GDBusConnection* connection, const gchar* name, const gchar* name_owner, gpointer self);
00366 static void __lambda6_ (Block2Data* _data2_);
00367 static void ___lambda6__gbus_name_vanished_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00368 static void main_flush_bus (void);
00369 static void main_call_lens_method (const gchar* method_name, GVariant* parameters, GFunc cb, void* cb_target);
00370 static Block3Data* block3_data_ref (Block3Data* _data3_);
00371 static void block3_data_unref (void * _userdata_);
00372 static void __lambda11_ (Block3Data* _data3_, GObject* obj, GAsyncResult* res);
00373 static void ___lambda11__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
00374 static void main_call_lens_search (const gchar* search_string, GFunc cb, void* cb_target);
00375 static void main_call_lens_activate (const gchar* uri, guint action_type, GFunc cb, void* cb_target);
00376 static void main_call_lens_update_preview_property (const gchar* uri, GHashTable* props, GFunc cb, void* cb_target);
00377 static GVariant* _variant_new1 (GHashTable* value);
00378 static Block4Data* block4_data_ref (Block4Data* _data4_);
00379 static void block4_data_unref (void * _userdata_);
00380 static gboolean __lambda10_ (Block4Data* _data4_);
00381 static gboolean ___lambda10__gsource_func (gpointer self);
00382 static Block5Data* block5_data_ref (Block5Data* _data5_);
00383 static void block5_data_unref (void * _userdata_);
00384 gpointer main_signal_wrapper_ref (gpointer instance);
00385 void main_signal_wrapper_unref (gpointer instance);
00386 GParamSpec* main_param_spec_signal_wrapper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00387 void main_value_set_signal_wrapper (GValue* value, gpointer v_object);
00388 void main_value_take_signal_wrapper (GValue* value, gpointer v_object);
00389 gpointer main_value_get_signal_wrapper (const GValue* value);
00390 GType main_signal_wrapper_get_type (void) G_GNUC_CONST;
00391 static void __lambda9_ (Block5Data* _data5_, UnityLensSearch* lens_search, UnitySearchType search_type);
00392 static void ___lambda9__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00393 MainSignalWrapper* main_signal_wrapper_new (GObject* o, gulong signal_id);
00394 MainSignalWrapper* main_signal_wrapper_construct (GType object_type, GObject* o, gulong signal_id);
00395 static void _vala_array_add1 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00396 static Block6Data* block6_data_ref (Block6Data* _data6_);
00397 static void block6_data_unref (void * _userdata_);
00398 static void __lambda12_ (Block6Data* _data6_, UnityLensSearch* lens_search);
00399 static void ___lambda12__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00400 static void _vala_array_add2 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00401 static MainTestMergeStrategy* main_test_merge_strategy_new (void);
00402 static MainTestMergeStrategy* main_test_merge_strategy_construct (GType object_type);
00403 static GType main_test_merge_strategy_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
00404 static Block7Data* block7_data_ref (Block7Data* _data7_);
00405 static void block7_data_unref (void * _userdata_);
00406 static gboolean __lambda8_ (Block7Data* _data7_);
00407 static gboolean ___lambda8__gsource_func (gpointer self);
00408 static Block8Data* block8_data_ref (Block8Data* _data8_);
00409 static void block8_data_unref (void * _userdata_);
00410 static void __lambda13_ (Block8Data* _data8_, UnityLensSearch* lens_search);
00411 static Block9Data* block9_data_ref (Block9Data* _data9_);
00412 static void block9_data_unref (void * _userdata_);
00413 static gboolean __lambda14_ (Block9Data* _data9_);
00414 static gboolean ___lambda14__gsource_func (gpointer self);
00415 static void ___lambda13__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00416 static void _vala_array_add3 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00417 static void __lambda15_ (Block8Data* _data8_);
00418 static void ___lambda15__gfunc (gconstpointer data, gpointer self);
00419 static Block10Data* block10_data_ref (Block10Data* _data10_);
00420 static void block10_data_unref (void * _userdata_);
00421 static void __lambda16_ (Block10Data* _data10_, UnityLensSearch* lens_search);
00422 static Block11Data* block11_data_ref (Block11Data* _data11_);
00423 static void block11_data_unref (void * _userdata_);
00424 static gboolean __lambda17_ (Block11Data* _data11_);
00425 static gboolean ___lambda17__gsource_func (gpointer self);
00426 static void ___lambda16__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00427 static void _vala_array_add4 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00428 static void __lambda18_ (Block10Data* _data10_, GVariant* _result_);
00429 static void ___lambda18__gfunc (gconstpointer data, gpointer self);
00430 static void __lambda19_ (Block10Data* _data10_, GVariant* _result_);
00431 static void ___lambda19__gfunc (gconstpointer data, gpointer self);
00432 static Block12Data* block12_data_ref (Block12Data* _data12_);
00433 static void block12_data_unref (void * _userdata_);
00434 static void __lambda20_ (Block12Data* _data12_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00435 static Block13Data* block13_data_ref (Block13Data* _data13_);
00436 static void block13_data_unref (void * _userdata_);
00437 static gboolean __lambda21_ (Block13Data* _data13_);
00438 static gboolean ___lambda21__gsource_func (gpointer self);
00439 static void ___lambda20__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00440 static void _vala_array_add5 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00441 static void __lambda22_ (Block12Data* _data12_);
00442 static void ___lambda22__gfunc (gconstpointer data, gpointer self);
00443 static void __lambda23_ (Block12Data* _data12_);
00444 static void ___lambda23__gfunc (gconstpointer data, gpointer self);
00445 static gboolean __lambda24_ (void);
00446 static gboolean ___lambda24__gsource_func (gpointer self);
00447 static Block14Data* block14_data_ref (Block14Data* _data14_);
00448 static void block14_data_unref (void * _userdata_);
00449 static void __lambda25_ (Block14Data* _data14_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00450 static Block15Data* block15_data_ref (Block15Data* _data15_);
00451 static void block15_data_unref (void * _userdata_);
00452 static gboolean __lambda26_ (Block15Data* _data15_);
00453 static gboolean ___lambda26__gsource_func (gpointer self);
00454 static void ___lambda25__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00455 static void _vala_array_add6 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00456 static void __lambda27_ (Block14Data* _data14_, GVariant* reply);
00457 static GHashTable* _variant_get2 (GVariant* value);
00458 static void ___lambda27__gfunc (gconstpointer data, gpointer self);
00459 static Block16Data* block16_data_ref (Block16Data* _data16_);
00460 static void block16_data_unref (void * _userdata_);
00461 static void __lambda28_ (Block16Data* _data16_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00462 static Block17Data* block17_data_ref (Block17Data* _data17_);
00463 static void block17_data_unref (void * _userdata_);
00464 static gboolean __lambda29_ (Block17Data* _data17_);
00465 static gboolean ___lambda29__gsource_func (gpointer self);
00466 static void ___lambda28__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00467 static void _vala_array_add7 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00468 static void __lambda30_ (Block16Data* _data16_, GVariant* reply);
00469 static GHashTable* _variant_get3 (GVariant* value);
00470 static void ___lambda30__gfunc (gconstpointer data, gpointer self);
00471 static Block18Data* block18_data_ref (Block18Data* _data18_);
00472 static void block18_data_unref (void * _userdata_);
00473 static gboolean __lambda31_ (Block18Data* _data18_);
00474 static gboolean ___lambda31__gsource_func (gpointer self);
00475 static void __lambda32_ (UnityLensSearch* lens_search);
00476 static void ___lambda32__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00477 static void _vala_array_add8 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00478 static void __lambda33_ (Block18Data* _data18_);
00479 static void ___lambda33__gfunc (gconstpointer data, gpointer self);
00480 static gboolean __lambda34_ (Block18Data* _data18_);
00481 static gboolean ___lambda34__gsource_func (gpointer self);
00482 static gboolean __lambda35_ (Block18Data* _data18_);
00483 static gboolean ___lambda35__gsource_func (gpointer self);
00484 static void __lambda36_ (Block18Data* _data18_);
00485 static void ___lambda36__gfunc (gconstpointer data, gpointer self);
00486 static gboolean __lambda37_ (Block18Data* _data18_);
00487 static gboolean ___lambda37__gsource_func (gpointer self);
00488 static Block19Data* block19_data_ref (Block19Data* _data19_);
00489 static void block19_data_unref (void * _userdata_);
00490 static void __lambda38_ (UnityLensSearch* lens_search);
00491 static void ___lambda38__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00492 static void _vala_array_add9 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00493 static void __lambda39_ (Block19Data* _data19_, GVariant* search_ret);
00494 static GHashTable* _variant_get4 (GVariant* value);
00495 static void ___lambda39__gfunc (gconstpointer data, gpointer self);
00496 static UnityActivationResponse* __lambda40_ (Block19Data* _data19_, const gchar* uri);
00497 static UnityActivationResponse* ___lambda40__unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self);
00498 static void _vala_array_add10 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00499 static void __lambda41_ (Block19Data* _data19_);
00500 static void ___lambda41__gfunc (gconstpointer data, gpointer self);
00501 static Block20Data* block20_data_ref (Block20Data* _data20_);
00502 static void block20_data_unref (void * _userdata_);
00503 static UnityActivationResponse* __lambda42_ (Block20Data* _data20_, const gchar* uri);
00504 static UnityActivationResponse* ___lambda42__unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self);
00505 static void _vala_array_add11 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00506 static UnityPreview* __lambda43_ (Block20Data* _data20_, const gchar* uri);
00507 static UnityPreview* ___lambda43__unity_scope_preview_uri (UnityScope* _sender, const gchar* uri, gpointer self);
00508 static void _vala_array_add12 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00509 static void __lambda44_ (Block20Data* _data20_, GVariant* reply);
00510 static void _variant_get5 (GVariant* value, UnityProtocolActivationReplyRaw* result);
00511 static void ___lambda44__gfunc (gconstpointer data, gpointer self);
00512 static UnityActivationResponse* __lambda45_ (Block20Data* _data20_);
00513 static UnityActivationResponse* ___lambda45__unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
00514 static void __lambda46_ (Block20Data* _data20_, GVariant* reply);
00515 static void ___lambda46__gfunc (gconstpointer data, gpointer self);
00516 static Block21Data* block21_data_ref (Block21Data* _data21_);
00517 static void block21_data_unref (void * _userdata_);
00518 static UnityActivationResponse* __lambda47_ (Block21Data* _data21_, const gchar* uri);
00519 static UnityActivationResponse* ___lambda47__unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self);
00520 static void _vala_array_add13 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00521 static UnityPreview* __lambda48_ (Block21Data* _data21_, const gchar* uri);
00522 static UnityPreview* ___lambda48__unity_series_preview_request_item_preview (UnitySeriesPreview* _sender, const gchar* uri, gpointer self);
00523 static void _vala_array_add14 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00524 static UnityPreview* __lambda49_ (Block21Data* _data21_, const gchar* uri);
00525 static UnityPreview* ___lambda49__unity_scope_preview_uri (UnityScope* _sender, const gchar* uri, gpointer self);
00526 static void _vala_array_add15 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value);
00527 static void __lambda50_ (Block21Data* _data21_, GVariant* reply);
00528 static void _variant_get6 (GVariant* value, UnityProtocolActivationReplyRaw* result);
00529 static void ___lambda50__gfunc (gconstpointer data, gpointer self);
00530 static void __lambda51_ (Block21Data* _data21_, GVariant* reply);
00531 static GHashTable* _variant_get7 (GVariant* value);
00532 static void ___lambda51__gfunc (gconstpointer data, gpointer self);
00533 static GHashTable* _variant_get8 (GVariant* value);
00534 static void __lambda52_ (Block21Data* _data21_, GVariant* reply);
00535 static GHashTable* _variant_get9 (GVariant* value);
00536 static void ___lambda52__gfunc (gconstpointer data, gpointer self);
00537 Main* main_new (void);
00538 Main* main_construct (GType object_type);
00539 #define MAIN_SIGNAL_WRAPPER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MAIN_TYPE_SIGNAL_WRAPPER, MainSignalWrapperPrivate))
00540 enum  {
00541        MAIN_SIGNAL_WRAPPER_DUMMY_PROPERTY
00542 };
00543 static void main_signal_wrapper_finalize (MainSignalWrapper* obj);
00544 enum  {
00545        MAIN_TEST_MERGE_STRATEGY_DUMMY_PROPERTY
00546 };
00547 static DeeModelIter* main_test_merge_strategy_real_merge_result (UnityMergeStrategy* base, DeeModel* target, GVariant** row, int row_length1);
00548 static void main_test_merge_strategy_finalize (GObject* obj);
00549 static void main_finalize (Main* obj);
00550 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00551 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00552 
00553 
00554 static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) {
00555        int i;
00556        for (i = 0; i < stack_length; i++) {
00557               if (g_strcmp0 (stack[i], needle) == 0) {
00558                      return TRUE;
00559               }
00560        }
00561        return FALSE;
00562 }
00563 
00564 
00565 static void _main_test_lens_export_gtest_data_func (gpointer self) {
00566        main_test_lens_export ();
00567 }
00568 
00569 
00570 static void _main_test_remote_scope_init_gtest_data_func (gpointer self) {
00571        main_test_remote_scope_init ();
00572 }
00573 
00574 
00575 static void _main_test_local_scope_init_gtest_data_func (gpointer self) {
00576        main_test_local_scope_init ();
00577 }
00578 
00579 
00580 static void _main_test_local_scope_search_on_first_view_gtest_data_func (gpointer self) {
00581        main_test_local_scope_search_on_first_view ();
00582 }
00583 
00584 
00585 static void _main_test_lens_search_gtest_data_func (gpointer self) {
00586        main_test_lens_search ();
00587 }
00588 
00589 
00590 static void _main_test_local_scope_search_gtest_data_func (gpointer self) {
00591        main_test_local_scope_search ();
00592 }
00593 
00594 
00595 static void _main_test_merge_strategy_gtest_data_func (gpointer self) {
00596        main_test_merge_strategy ();
00597 }
00598 
00599 
00600 static void _main_test_lens_return_after_scope_finish_gtest_data_func (gpointer self) {
00601        main_test_lens_return_after_scope_finish ();
00602 }
00603 
00604 
00605 static void _main_test_lens_successive_searches_gtest_data_func (gpointer self) {
00606        main_test_lens_successive_searches ();
00607 }
00608 
00609 
00610 static void _main_test_lens_two_searches_gtest_data_func (gpointer self) {
00611        main_test_lens_two_searches ();
00612 }
00613 
00614 
00615 static void _main_test_lens_model_sync_gtest_data_func (gpointer self) {
00616        main_test_lens_model_sync ();
00617 }
00618 
00619 
00620 static void _main_test_lens_reply_hint_gtest_data_func (gpointer self) {
00621        main_test_lens_reply_hint ();
00622 }
00623 
00624 
00625 static void _main_test_lens_sources_gtest_data_func (gpointer self) {
00626        main_test_lens_sources ();
00627 }
00628 
00629 
00630 static void _main_test_lens_activation_gtest_data_func (gpointer self) {
00631        main_test_lens_activation ();
00632 }
00633 
00634 
00635 static void _main_test_lens_preview_gtest_data_func (gpointer self) {
00636        main_test_lens_preview ();
00637 }
00638 
00639 
00640 static void _main_test_lens_preview_signal_gtest_data_func (gpointer self) {
00641        main_test_lens_preview_signal ();
00642 }
00643 
00644 
00645 gint main_main (gchar** args, int args_length1) {
00646        gint result = 0;
00647        gchar** _tmp0_;
00648        gint _tmp0__length1;
00649        gboolean _tmp1_;
00650        gboolean _tmp2_;
00651        _tmp0_ = args;
00652        _tmp0__length1 = args_length1;
00653        if (_vala_string_array_contains (_tmp0_, _tmp0__length1, "--with-remote-scope")) {
00654               main_remote_scope_test = TRUE;
00655        }
00656        _tmp1_ = main_remote_scope_test;
00657        if (_tmp1_) {
00658               g_setenv ("LIBUNITY_LENS_DIRECTORY", TESTDIR "/data", TRUE);
00659        } else {
00660               g_setenv ("LIBUNITY_LENS_DIRECTORY", TESTDIR, TRUE);
00661        }
00662        g_test_init (&args_length1, &args, NULL);
00663        g_test_add_data_func ("/Unit/Lens/Export", NULL, _main_test_lens_export_gtest_data_func);
00664        _tmp2_ = main_remote_scope_test;
00665        if (_tmp2_) {
00666               g_test_add_data_func ("/Integration/RemoteScope/Initialize", NULL, _main_test_remote_scope_init_gtest_data_func);
00667        }
00668        g_test_add_data_func ("/Unit/LocalScope/Initialize", NULL, _main_test_local_scope_init_gtest_data_func);
00669        g_test_add_data_func ("/Unit/LocalScope/SearchOnView", NULL, _main_test_local_scope_search_on_first_view_gtest_data_func);
00670        g_test_add_data_func ("/Unit/Lens/Search", NULL, _main_test_lens_search_gtest_data_func);
00671        g_test_add_data_func ("/Unit/LocalScope/SearchChanged", NULL, _main_test_local_scope_search_gtest_data_func);
00672        g_test_add_data_func ("/Unit/LocalScope/MergeStrategy", NULL, _main_test_merge_strategy_gtest_data_func);
00673        g_test_add_data_func ("/Unit/Lens/ReturnAfterScopeFinish", NULL, _main_test_lens_return_after_scope_finish_gtest_data_func);
00674        g_test_add_data_func ("/Unit/Lens/SuccessiveSearches", NULL, _main_test_lens_successive_searches_gtest_data_func);
00675        g_test_add_data_func ("/Unit/Lens/TwoSearches", NULL, _main_test_lens_two_searches_gtest_data_func);
00676        g_test_add_data_func ("/Unit/Lens/ModelSync", NULL, _main_test_lens_model_sync_gtest_data_func);
00677        g_test_add_data_func ("/Unit/Lens/ReplyHint", NULL, _main_test_lens_reply_hint_gtest_data_func);
00678        g_test_add_data_func ("/Unit/Lens/Sources", NULL, _main_test_lens_sources_gtest_data_func);
00679        g_test_add_data_func ("/Unit/Lens/Activation", NULL, _main_test_lens_activation_gtest_data_func);
00680        g_test_add_data_func ("/Unit/Lens/Preview", NULL, _main_test_lens_preview_gtest_data_func);
00681        g_test_add_data_func ("/Unit/Lens/PreviewSignal", NULL, _main_test_lens_preview_signal_gtest_data_func);
00682        g_test_run ();
00683        result = 0;
00684        return result;
00685 }
00686 
00687 
00688 int main (int argc, char ** argv) {
00689        g_type_init ();
00690        return main_main (argv, argc);
00691 }
00692 
00693 
00694 static gpointer _g_main_loop_ref0 (gpointer self) {
00695        return self ? g_main_loop_ref (self) : NULL;
00696 }
00697 
00698 
00699 static Block1Data* block1_data_ref (Block1Data* _data1_) {
00700        g_atomic_int_inc (&_data1_->_ref_count_);
00701        return _data1_;
00702 }
00703 
00704 
00705 static void block1_data_unref (void * _userdata_) {
00706        Block1Data* _data1_;
00707        _data1_ = (Block1Data*) _userdata_;
00708        if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
00709               _g_main_loop_unref0 (_data1_->ml);
00710               g_slice_free (Block1Data, _data1_);
00711        }
00712 }
00713 
00714 
00715 static gboolean __lambda7_ (Block1Data* _data1_) {
00716        gboolean result = FALSE;
00717        GMainLoop* _tmp0_;
00718        _data1_->timeout_reached = TRUE;
00719        g_debug ("test-lens.vala:89: Timeout reached");
00720        _tmp0_ = _data1_->ml;
00721        g_main_loop_quit (_tmp0_);
00722        result = FALSE;
00723        return result;
00724 }
00725 
00726 
00727 static gboolean ___lambda7__gsource_func (gpointer self) {
00728        gboolean result;
00729        result = __lambda7_ (self);
00730        return result;
00731 }
00732 
00733 
00734 gboolean main_run_with_timeout (GMainLoop* ml, guint timeout_ms) {
00735        gboolean result = FALSE;
00736        Block1Data* _data1_;
00737        GMainLoop* _tmp0_;
00738        GMainLoop* _tmp1_;
00739        guint _tmp2_;
00740        guint _tmp3_ = 0U;
00741        guint t_id;
00742        GMainLoop* _tmp4_;
00743        gboolean _tmp5_;
00744        gboolean _tmp7_;
00745        g_return_val_if_fail (ml != NULL, FALSE);
00746        _data1_ = g_slice_new0 (Block1Data);
00747        _data1_->_ref_count_ = 1;
00748        _tmp0_ = ml;
00749        _tmp1_ = _g_main_loop_ref0 (_tmp0_);
00750        _data1_->ml = _tmp1_;
00751        _data1_->timeout_reached = FALSE;
00752        _tmp2_ = timeout_ms;
00753        _tmp3_ = g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp2_, ___lambda7__gsource_func, block1_data_ref (_data1_), block1_data_unref);
00754        t_id = _tmp3_;
00755        _tmp4_ = _data1_->ml;
00756        g_main_loop_run (_tmp4_);
00757        _tmp5_ = _data1_->timeout_reached;
00758        if (!_tmp5_) {
00759               guint _tmp6_;
00760               _tmp6_ = t_id;
00761               g_source_remove (_tmp6_);
00762        }
00763        _tmp7_ = _data1_->timeout_reached;
00764        result = !_tmp7_;
00765        block1_data_unref (_data1_);
00766        _data1_ = NULL;
00767        return result;
00768 }
00769 
00770 
00771 static void __lambda2_ (void) {
00772 }
00773 
00774 
00775 static void ___lambda2__gbus_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00776        __lambda2_ ();
00777 }
00778 
00779 
00780 static void __lambda3_ (void) {
00781        main_name_owned = TRUE;
00782 }
00783 
00784 
00785 static void ___lambda3__gbus_name_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00786        __lambda3_ ();
00787 }
00788 
00789 
00790 static void __lambda4_ (void) {
00791        g_debug ("test-lens.vala:109: Name lost");
00792        g_assert_not_reached ();
00793 }
00794 
00795 
00796 static void ___lambda4__gbus_name_lost_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00797        __lambda4_ ();
00798 }
00799 
00800 
00801 static gpointer _g_object_ref0 (gpointer self) {
00802        return self ? g_object_ref (self) : NULL;
00803 }
00804 
00805 
00806 void main_test_lens_export (void) {
00807        UnityLens* _tmp0_;
00808        UnityLens* lens;
00809        UnityLens* _tmp1_;
00810        GError * _inner_error_ = NULL;
00811        g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "com.canonical.Unity.Lens.Test", 0, (GClosure*) ((___lambda2__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda2__gbus_acquired_callback, NULL, NULL)), (GClosure*) ((___lambda3__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda3__gbus_name_acquired_callback, NULL, NULL)), (GClosure*) ((___lambda4__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda4__gbus_name_lost_callback, NULL, NULL)));
00812        _tmp0_ = unity_lens_new ("/com/canonical/Unity/Lens/Test", "unity_lens_test");
00813        lens = _tmp0_;
00814        unity_lens_set_search_in_global (lens, FALSE);
00815        unity_lens_set_search_hint (lens, "Search hint");
00816        unity_lens_export (lens, &_inner_error_);
00817        if (_inner_error_ != NULL) {
00818               _g_object_unref0 (lens);
00819               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);
00820               g_clear_error (&_inner_error_);
00821               return;
00822        }
00823        _tmp1_ = _g_object_ref0 (lens);
00824        _g_object_unref0 (main_exported_lens);
00825        main_exported_lens = _tmp1_;
00826        _g_object_unref0 (lens);
00827 }
00828 
00829 
00830 void main_test_local_scope_init (void) {
00831        UnityLens* _tmp0_;
00832        UnityScope* _tmp1_;
00833        UnityScope* scope;
00834        UnityScope* _tmp2_;
00835        UnityLens* _tmp3_;
00836        _tmp0_ = main_exported_lens;
00837        _vala_assert (_tmp0_ != NULL, "exported_lens != null");
00838        _tmp1_ = unity_scope_new ("/com/canonical/Unity/LocalScope/Test");
00839        scope = _tmp1_;
00840        _tmp2_ = _g_object_ref0 (scope);
00841        _g_object_unref0 (main_local_scope);
00842        main_local_scope = _tmp2_;
00843        _tmp3_ = main_exported_lens;
00844        unity_lens_add_local_scope (_tmp3_, scope);
00845        _g_object_unref0 (scope);
00846 }
00847 
00848 
00849 static Block2Data* block2_data_ref (Block2Data* _data2_) {
00850        g_atomic_int_inc (&_data2_->_ref_count_);
00851        return _data2_;
00852 }
00853 
00854 
00855 static void block2_data_unref (void * _userdata_) {
00856        Block2Data* _data2_;
00857        _data2_ = (Block2Data*) _userdata_;
00858        if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
00859               _g_main_loop_unref0 (_data2_->ml);
00860               g_slice_free (Block2Data, _data2_);
00861        }
00862 }
00863 
00864 
00865 static void __lambda5_ (Block2Data* _data2_) {
00866        _data2_->scope_up = TRUE;
00867        g_main_loop_quit (_data2_->ml);
00868 }
00869 
00870 
00871 static void ___lambda5__gbus_name_appeared_callback (GDBusConnection* connection, const gchar* name, const gchar* name_owner, gpointer self) {
00872        __lambda5_ (self);
00873 }
00874 
00875 
00876 static void __lambda6_ (Block2Data* _data2_) {
00877        _data2_->scope_up = FALSE;
00878 }
00879 
00880 
00881 static void ___lambda6__gbus_name_vanished_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00882        __lambda6_ (self);
00883 }
00884 
00885 
00886 void main_test_remote_scope_init (void) {
00887        Block2Data* _data2_;
00888        UnityLens* _tmp0_;
00889        GMainLoop* _tmp1_;
00890        guint _tmp2_ = 0U;
00891        guint watch_id;
00892        GMainLoop* _tmp3_;
00893        GMainLoop* _tmp4_;
00894        _data2_ = g_slice_new0 (Block2Data);
00895        _data2_->_ref_count_ = 1;
00896        _tmp0_ = main_exported_lens;
00897        _vala_assert (_tmp0_ != NULL, "exported_lens != null");
00898        _data2_->scope_up = FALSE;
00899        _tmp1_ = g_main_loop_new (NULL, FALSE);
00900        _data2_->ml = _tmp1_;
00901        _tmp2_ = g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "com.canonical.Unity.Scope0.Test", 0, (GClosure*) ((___lambda5__gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda5__gbus_name_appeared_callback, block2_data_ref (_data2_), block2_data_unref)), (GClosure*) ((___lambda6__gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda6__gbus_name_vanished_callback, block2_data_ref (_data2_), block2_data_unref)));
00902        watch_id = _tmp2_;
00903        main_run_with_timeout (_data2_->ml, (guint) 2000);
00904        _vala_assert (_data2_->scope_up == TRUE, "scope_up == true");
00905        main_flush_bus ();
00906        _tmp3_ = g_main_loop_new (NULL, FALSE);
00907        _tmp4_ = _tmp3_;
00908        main_run_with_timeout (_tmp4_, (guint) 500);
00909        _g_main_loop_unref0 (_tmp4_);
00910        g_bus_unwatch_name (watch_id);
00911        _vala_assert (_data2_->scope_up == TRUE, "scope_up == true");
00912        block2_data_unref (_data2_);
00913        _data2_ = NULL;
00914 }
00915 
00916 
00917 static Block3Data* block3_data_ref (Block3Data* _data3_) {
00918        g_atomic_int_inc (&_data3_->_ref_count_);
00919        return _data3_;
00920 }
00921 
00922 
00923 static void block3_data_unref (void * _userdata_) {
00924        Block3Data* _data3_;
00925        _data3_ = (Block3Data*) _userdata_;
00926        if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
00927               _g_object_unref0 (_data3_->bus);
00928               g_slice_free (Block3Data, _data3_);
00929        }
00930 }
00931 
00932 
00933 static void __lambda11_ (Block3Data* _data3_, GObject* obj, GAsyncResult* res) {
00934        GError * _inner_error_ = NULL;
00935        g_return_if_fail (res != NULL);
00936        {
00937               GDBusConnection* _tmp0_;
00938               GAsyncResult* _tmp1_;
00939               GVariant* _tmp2_ = NULL;
00940               GVariant* reply;
00941               GFunc _tmp3_;
00942               void* _tmp3__target;
00943               _tmp0_ = _data3_->bus;
00944               _tmp1_ = res;
00945               _tmp2_ = g_dbus_connection_call_finish (_tmp0_, _tmp1_, &_inner_error_);
00946               reply = _tmp2_;
00947               if (_inner_error_ != NULL) {
00948                      goto __catch1_g_error;
00949               }
00950               _tmp3_ = _data3_->cb;
00951               _tmp3__target = _data3_->cb_target;
00952               if (_tmp3_ != NULL) {
00953                      GFunc _tmp4_;
00954                      void* _tmp4__target;
00955                      _tmp4_ = _data3_->cb;
00956                      _tmp4__target = _data3_->cb_target;
00957                      _tmp4_ (reply, _tmp4__target);
00958               }
00959               _g_variant_unref0 (reply);
00960        }
00961        goto __finally1;
00962        __catch1_g_error:
00963        {
00964               GError* e = NULL;
00965               GError* _tmp5_;
00966               const gchar* _tmp6_;
00967               e = _inner_error_;
00968               _inner_error_ = NULL;
00969               _tmp5_ = e;
00970               _tmp6_ = _tmp5_->message;
00971               g_warning ("test-lens.vala:189: %s", _tmp6_);
00972               _g_error_free0 (e);
00973        }
00974        __finally1:
00975        if (_inner_error_ != NULL) {
00976               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);
00977               g_clear_error (&_inner_error_);
00978               return;
00979        }
00980 }
00981 
00982 
00983 static void ___lambda11__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
00984        __lambda11_ (self, source_object, res);
00985        block3_data_unref (self);
00986 }
00987 
00988 
00989 static void main_call_lens_method (const gchar* method_name, GVariant* parameters, GFunc cb, void* cb_target) {
00990        Block3Data* _data3_;
00991        GFunc _tmp0_;
00992        void* _tmp0__target;
00993        GDBusConnection* _tmp3_;
00994        const gchar* _tmp4_;
00995        GVariant* _tmp5_;
00996        GError * _inner_error_ = NULL;
00997        g_return_if_fail (method_name != NULL);
00998        _data3_ = g_slice_new0 (Block3Data);
00999        _data3_->_ref_count_ = 1;
01000        _tmp0_ = cb;
01001        _tmp0__target = cb_target;
01002        _data3_->cb = _tmp0_;
01003        _data3_->cb_target = _tmp0__target;
01004        _data3_->bus = NULL;
01005        {
01006               GDBusConnection* _tmp1_ = NULL;
01007               GDBusConnection* _tmp2_;
01008               _tmp1_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
01009               _tmp2_ = _tmp1_;
01010               if (_inner_error_ != NULL) {
01011                      goto __catch0_g_error;
01012               }
01013               _g_object_unref0 (_data3_->bus);
01014               _data3_->bus = _tmp2_;
01015        }
01016        goto __finally0;
01017        __catch0_g_error:
01018        {
01019               GError* e = NULL;
01020               e = _inner_error_;
01021               _inner_error_ = NULL;
01022               _g_error_free0 (e);
01023        }
01024        __finally0:
01025        if (_inner_error_ != NULL) {
01026               block3_data_unref (_data3_);
01027               _data3_ = NULL;
01028               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);
01029               g_clear_error (&_inner_error_);
01030               return;
01031        }
01032        _tmp3_ = _data3_->bus;
01033        _tmp4_ = method_name;
01034        _tmp5_ = parameters;
01035        g_dbus_connection_call (_tmp3_, "com.canonical.Unity.Lens.Test", "/com/canonical/Unity/Lens/Test", "com.canonical.Unity.Lens", _tmp4_, _tmp5_, NULL, 0, -1, NULL, ___lambda11__gasync_ready_callback, block3_data_ref (_data3_));
01036        block3_data_unref (_data3_);
01037        _data3_ = NULL;
01038 }
01039 
01040 
01041 static void main_call_lens_search (const gchar* search_string, GFunc cb, void* cb_target) {
01042        GVariantType* _tmp0_;
01043        GVariantType* _tmp1_;
01044        GVariantBuilder* _tmp2_;
01045        GVariantBuilder* _tmp3_;
01046        GVariantBuilder* vb;
01047        const gchar* _tmp4_;
01048        GVariantType* _tmp5_;
01049        GVariantType* _tmp6_;
01050        GVariant* _tmp7_ = NULL;
01051        GVariant* _tmp8_;
01052        GFunc _tmp9_;
01053        void* _tmp9__target;
01054        g_return_if_fail (search_string != NULL);
01055        _tmp0_ = g_variant_type_new ("(sa{sv})");
01056        _tmp1_ = _tmp0_;
01057        _tmp2_ = g_variant_builder_new (_tmp1_);
01058        _tmp3_ = _tmp2_;
01059        _g_variant_type_free0 (_tmp1_);
01060        vb = _tmp3_;
01061        _tmp4_ = search_string;
01062        g_variant_builder_add (vb, "s", _tmp4_, NULL);
01063        _tmp5_ = g_variant_type_new ("a{sv}");
01064        _tmp6_ = _tmp5_;
01065        g_variant_builder_open (vb, _tmp6_);
01066        _g_variant_type_free0 (_tmp6_);
01067        g_variant_builder_close (vb);
01068        _tmp7_ = g_variant_builder_end (vb);
01069        g_variant_ref_sink (_tmp7_);
01070        _tmp8_ = _tmp7_;
01071        _tmp9_ = cb;
01072        _tmp9__target = cb_target;
01073        main_call_lens_method ("Search", _tmp8_, _tmp9_, _tmp9__target);
01074        _g_variant_unref0 (_tmp8_);
01075        _g_variant_builder_unref0 (vb);
01076 }
01077 
01078 
01079 static void main_call_lens_activate (const gchar* uri, guint action_type, GFunc cb, void* cb_target) {
01080        const gchar* _tmp0_;
01081        guint _tmp1_;
01082        GVariant* _tmp2_;
01083        GVariant* parameters;
01084        GFunc _tmp3_;
01085        void* _tmp3__target;
01086        g_return_if_fail (uri != NULL);
01087        _tmp0_ = uri;
01088        _tmp1_ = action_type;
01089        _tmp2_ = g_variant_new ("(su)", _tmp0_, _tmp1_, NULL);
01090        g_variant_ref_sink (_tmp2_);
01091        parameters = _tmp2_;
01092        _tmp3_ = cb;
01093        _tmp3__target = cb_target;
01094        main_call_lens_method ("Activate", parameters, _tmp3_, _tmp3__target);
01095        _g_variant_unref0 (parameters);
01096 }
01097 
01098 
01099 static GVariant* _variant_new1 (GHashTable* value) {
01100        GVariantBuilder _tmp6_;
01101        GHashTableIter _tmp7_;
01102        gpointer _tmp8_;
01103        gpointer _tmp9_;
01104        g_hash_table_iter_init (&_tmp7_, value);
01105        g_variant_builder_init (&_tmp6_, G_VARIANT_TYPE ("a{sv}"));
01106        while (g_hash_table_iter_next (&_tmp7_, &_tmp8_, &_tmp9_)) {
01107               gchar* _key;
01108               GVariant* _value;
01109               _key = (gchar*) _tmp8_;
01110               _value = (GVariant*) _tmp9_;
01111               g_variant_builder_add (&_tmp6_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
01112        }
01113        return g_variant_ref_sink (g_variant_builder_end (&_tmp6_));
01114 }
01115 
01116 
01117 static void main_call_lens_update_preview_property (const gchar* uri, GHashTable* props, GFunc cb, void* cb_target) {
01118        GVariantType* _tmp0_;
01119        GVariantType* _tmp1_;
01120        GVariantBuilder* _tmp2_;
01121        GVariantBuilder* _tmp3_;
01122        GVariantBuilder* vb;
01123        const gchar* _tmp4_;
01124        GHashTable* _tmp5_;
01125        GVariant* _tmp10_;
01126        GVariant* _tmp11_ = NULL;
01127        GVariant* _tmp12_;
01128        GFunc _tmp13_;
01129        void* _tmp13__target;
01130        g_return_if_fail (uri != NULL);
01131        g_return_if_fail (props != NULL);
01132        _tmp0_ = g_variant_type_new ("(sa{sv})");
01133        _tmp1_ = _tmp0_;
01134        _tmp2_ = g_variant_builder_new (_tmp1_);
01135        _tmp3_ = _tmp2_;
01136        _g_variant_type_free0 (_tmp1_);
01137        vb = _tmp3_;
01138        _tmp4_ = uri;
01139        g_variant_builder_add (vb, "s", _tmp4_, NULL);
01140        _tmp5_ = props;
01141        _tmp10_ = _variant_new1 (_tmp5_);
01142        g_variant_builder_add_value (vb, _tmp10_);
01143        _tmp11_ = g_variant_builder_end (vb);
01144        g_variant_ref_sink (_tmp11_);
01145        _tmp12_ = _tmp11_;
01146        _tmp13_ = cb;
01147        _tmp13__target = cb_target;
01148        main_call_lens_method ("UpdatePreviewProperty", _tmp12_, _tmp13_, _tmp13__target);
01149        _g_variant_unref0 (_tmp12_);
01150        _g_variant_builder_unref0 (vb);
01151 }
01152 
01153 
01154 static Block4Data* block4_data_ref (Block4Data* _data4_) {
01155        g_atomic_int_inc (&_data4_->_ref_count_);
01156        return _data4_;
01157 }
01158 
01159 
01160 static void block4_data_unref (void * _userdata_) {
01161        Block4Data* _data4_;
01162        _data4_ = (Block4Data*) _userdata_;
01163        if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
01164               _g_main_loop_unref0 (_data4_->ml);
01165               g_slice_free (Block4Data, _data4_);
01166        }
01167 }
01168 
01169 
01170 static gboolean __lambda10_ (Block4Data* _data4_) {
01171        gboolean result = FALSE;
01172        gboolean _tmp0_;
01173        gboolean _tmp1_;
01174        _tmp0_ = main_name_owned;
01175        if (_tmp0_) {
01176               g_main_loop_quit (_data4_->ml);
01177        }
01178        _tmp1_ = main_name_owned;
01179        result = !_tmp1_;
01180        return result;
01181 }
01182 
01183 
01184 static gboolean ___lambda10__gsource_func (gpointer self) {
01185        gboolean result;
01186        result = __lambda10_ (self);
01187        return result;
01188 }
01189 
01190 
01191 void main_test_lens_search (void) {
01192        Block4Data* _data4_;
01193        GMainLoop* _tmp0_;
01194        _data4_ = g_slice_new0 (Block4Data);
01195        _data4_->_ref_count_ = 1;
01196        _tmp0_ = g_main_loop_new (NULL, FALSE);
01197        _data4_->ml = _tmp0_;
01198        g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda10__gsource_func, block4_data_ref (_data4_), block4_data_unref);
01199        g_main_loop_run (_data4_->ml);
01200        main_call_lens_search ("foo", NULL, NULL);
01201        block4_data_unref (_data4_);
01202        _data4_ = NULL;
01203 }
01204 
01205 
01206 static Block5Data* block5_data_ref (Block5Data* _data5_) {
01207        g_atomic_int_inc (&_data5_->_ref_count_);
01208        return _data5_;
01209 }
01210 
01211 
01212 static void block5_data_unref (void * _userdata_) {
01213        Block5Data* _data5_;
01214        _data5_ = (Block5Data*) _userdata_;
01215        if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
01216               _g_main_loop_unref0 (_data5_->ml);
01217               g_slice_free (Block5Data, _data5_);
01218        }
01219 }
01220 
01221 
01222 static void __lambda9_ (Block5Data* _data5_, UnityLensSearch* lens_search, UnitySearchType search_type) {
01223        UnityLensSearch* _tmp0_;
01224        const gchar* _tmp1_;
01225        const gchar* _tmp2_;
01226        UnitySearchType _tmp3_;
01227        UnityLensSearch* _tmp4_;
01228        g_return_if_fail (lens_search != NULL);
01229        _tmp0_ = lens_search;
01230        _tmp1_ = unity_lens_search_get_search_string (_tmp0_);
01231        _tmp2_ = _tmp1_;
01232        _vala_assert (g_strcmp0 (_tmp2_, "") == 0, "lens_search.search_string == \"\"");
01233        _tmp3_ = search_type;
01234        if (_tmp3_ == UNITY_SEARCH_TYPE_GLOBAL) {
01235               _data5_->got_global_search = TRUE;
01236        } else {
01237               _data5_->got_lens_search = TRUE;
01238        }
01239        _tmp4_ = lens_search;
01240        g_signal_emit_by_name (_tmp4_, "finished");
01241        g_main_loop_quit (_data5_->ml);
01242 }
01243 
01244 
01245 static void ___lambda9__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
01246        __lambda9_ (self, search, search_type);
01247 }
01248 
01249 
01250 static void _vala_array_add1 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
01251        if ((*length) == (*size)) {
01252               *size = (*size) ? (2 * (*size)) : 4;
01253               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
01254        }
01255        (*array)[(*length)++] = value;
01256        (*array)[*length] = NULL;
01257 }
01258 
01259 
01260 void main_test_local_scope_search_on_first_view (void) {
01261        Block5Data* _data5_;
01262        MainSignalWrapper** signals;
01263        gint signals_length1;
01264        gint _signals_size_;
01265        UnityScope* _tmp0_;
01266        GMainLoop* _tmp1_;
01267        MainSignalWrapper** _tmp2_;
01268        gint _tmp2__length1;
01269        UnityScope* _tmp3_;
01270        UnityScope* _tmp4_;
01271        gulong _tmp5_ = 0UL;
01272        MainSignalWrapper* _tmp6_;
01273        UnityScope* _tmp7_;
01274        UnityScope* _tmp8_;
01275        _data5_ = g_slice_new0 (Block5Data);
01276        _data5_->_ref_count_ = 1;
01277        signals = NULL;
01278        signals_length1 = 0;
01279        _signals_size_ = signals_length1;
01280        _tmp0_ = main_local_scope;
01281        _vala_assert (_tmp0_ != NULL, "local_scope != null");
01282        _tmp1_ = g_main_loop_new (NULL, FALSE);
01283        _data5_->ml = _tmp1_;
01284        _data5_->got_global_search = FALSE;
01285        _data5_->got_lens_search = FALSE;
01286        _tmp2_ = signals;
01287        _tmp2__length1 = signals_length1;
01288        _tmp3_ = main_local_scope;
01289        _tmp4_ = main_local_scope;
01290        _tmp5_ = g_signal_connect_data (_tmp4_, "search-changed", (GCallback) ___lambda9__unity_scope_search_changed, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
01291        _tmp6_ = main_signal_wrapper_new ((GObject*) _tmp3_, _tmp5_);
01292        _vala_array_add1 (&signals, &signals_length1, &_signals_size_, _tmp6_);
01293        _tmp7_ = main_local_scope;
01294        unity_scope_set_view_type_internal (_tmp7_, UNITY_PROTOCOL_VIEW_TYPE_HOME_VIEW);
01295        main_run_with_timeout (_data5_->ml, (guint) 1000);
01296        _vala_assert (_data5_->got_global_search == TRUE, "got_global_search == true");
01297        _tmp8_ = main_local_scope;
01298        unity_scope_set_view_type_internal (_tmp8_, UNITY_PROTOCOL_VIEW_TYPE_HIDDEN);
01299        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
01300        block5_data_unref (_data5_);
01301        _data5_ = NULL;
01302 }
01303 
01304 
01305 static Block6Data* block6_data_ref (Block6Data* _data6_) {
01306        g_atomic_int_inc (&_data6_->_ref_count_);
01307        return _data6_;
01308 }
01309 
01310 
01311 static void block6_data_unref (void * _userdata_) {
01312        Block6Data* _data6_;
01313        _data6_ = (Block6Data*) _userdata_;
01314        if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
01315               _g_main_loop_unref0 (_data6_->ml);
01316               g_slice_free (Block6Data, _data6_);
01317        }
01318 }
01319 
01320 
01321 static void __lambda12_ (Block6Data* _data6_, UnityLensSearch* lens_search) {
01322        UnityLensSearch* _tmp0_;
01323        const gchar* _tmp1_;
01324        const gchar* _tmp2_;
01325        UnityLensSearch* _tmp3_;
01326        g_return_if_fail (lens_search != NULL);
01327        _tmp0_ = lens_search;
01328        _tmp1_ = unity_lens_search_get_search_string (_tmp0_);
01329        _tmp2_ = _tmp1_;
01330        _vala_assert (g_strcmp0 (_tmp2_, "foo") == 0, "lens_search.search_string == \"foo\"");
01331        _data6_->got_search_changed = TRUE;
01332        _tmp3_ = lens_search;
01333        g_signal_emit_by_name (_tmp3_, "finished");
01334        g_main_loop_quit (_data6_->ml);
01335 }
01336 
01337 
01338 static void ___lambda12__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
01339        __lambda12_ (self, search);
01340 }
01341 
01342 
01343 static void _vala_array_add2 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
01344        if ((*length) == (*size)) {
01345               *size = (*size) ? (2 * (*size)) : 4;
01346               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
01347        }
01348        (*array)[(*length)++] = value;
01349        (*array)[*length] = NULL;
01350 }
01351 
01352 
01353 void main_test_local_scope_search (void) {
01354        Block6Data* _data6_;
01355        MainSignalWrapper** signals;
01356        gint signals_length1;
01357        gint _signals_size_;
01358        UnityScope* _tmp0_;
01359        GMainLoop* _tmp1_;
01360        MainSignalWrapper** _tmp2_;
01361        gint _tmp2__length1;
01362        UnityScope* _tmp3_;
01363        UnityScope* _tmp4_;
01364        gulong _tmp5_ = 0UL;
01365        MainSignalWrapper* _tmp6_;
01366        _data6_ = g_slice_new0 (Block6Data);
01367        _data6_->_ref_count_ = 1;
01368        signals = NULL;
01369        signals_length1 = 0;
01370        _signals_size_ = signals_length1;
01371        _tmp0_ = main_local_scope;
01372        _vala_assert (_tmp0_ != NULL, "local_scope != null");
01373        _tmp1_ = g_main_loop_new (NULL, FALSE);
01374        _data6_->ml = _tmp1_;
01375        _data6_->got_search_changed = FALSE;
01376        _tmp2_ = signals;
01377        _tmp2__length1 = signals_length1;
01378        _tmp3_ = main_local_scope;
01379        _tmp4_ = main_local_scope;
01380        _tmp5_ = g_signal_connect_data (_tmp4_, "search-changed", (GCallback) ___lambda12__unity_scope_search_changed, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
01381        _tmp6_ = main_signal_wrapper_new ((GObject*) _tmp3_, _tmp5_);
01382        _vala_array_add2 (&signals, &signals_length1, &_signals_size_, _tmp6_);
01383        main_run_with_timeout (_data6_->ml, (guint) 1000);
01384        _vala_assert (_data6_->got_search_changed == TRUE, "got_search_changed == true");
01385        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
01386        block6_data_unref (_data6_);
01387        _data6_ = NULL;
01388 }
01389 
01390 
01391 void main_test_merge_strategy (void) {
01392        UnityLens* _tmp0_;
01393        UnityScope* _tmp1_;
01394        UnityLens* _tmp2_;
01395        UnityMergeStrategy* _tmp3_;
01396        UnityMergeStrategy* _tmp4_;
01397        UnityMergeStrategy* _tmp5_;
01398        UnityMergeStrategy* old_merge_strategy;
01399        UnityScope* _tmp6_;
01400        DeeSerializableModel* _tmp7_;
01401        DeeSerializableModel* _tmp8_;
01402        MainTestMergeStrategy* _tmp9_;
01403        MainTestMergeStrategy* merge_strategy;
01404        UnityLens* _tmp10_;
01405        UnityScope* _tmp11_;
01406        DeeSerializableModel* _tmp12_;
01407        DeeSerializableModel* _tmp13_;
01408        UnityScope* _tmp14_;
01409        DeeSerializableModel* _tmp15_;
01410        DeeSerializableModel* _tmp16_;
01411        gint _tmp17_;
01412        UnityLens* _tmp18_;
01413        _tmp0_ = main_exported_lens;
01414        _vala_assert (_tmp0_ != NULL, "exported_lens != null");
01415        _tmp1_ = main_local_scope;
01416        _vala_assert (_tmp1_ != NULL, "local_scope != null");
01417        _tmp2_ = main_exported_lens;
01418        _tmp3_ = unity_lens_get_merge_strategy (_tmp2_);
01419        _tmp4_ = _tmp3_;
01420        _tmp5_ = _g_object_ref0 (_tmp4_);
01421        old_merge_strategy = _tmp5_;
01422        _tmp6_ = main_local_scope;
01423        _tmp7_ = unity_scope_get_results_model (_tmp6_);
01424        _tmp8_ = _tmp7_;
01425        dee_model_clear ((DeeModel*) _tmp8_);
01426        _tmp9_ = main_test_merge_strategy_new ();
01427        merge_strategy = _tmp9_;
01428        _tmp10_ = main_exported_lens;
01429        unity_lens_set_merge_strategy (_tmp10_, (UnityMergeStrategy*) merge_strategy);
01430        _tmp11_ = main_local_scope;
01431        _tmp12_ = unity_scope_get_results_model (_tmp11_);
01432        _tmp13_ = _tmp12_;
01433        dee_model_append ((DeeModel*) _tmp13_, "uri", "icon", 0, "mimetype", "display-name", "comment", "dnd-uri", NULL);
01434        _tmp14_ = main_local_scope;
01435        _tmp15_ = unity_scope_get_results_model (_tmp14_);
01436        _tmp16_ = _tmp15_;
01437        dee_model_append ((DeeModel*) _tmp16_, "uri", "icon", 0, "mimetype", "display-name", "comment", "dnd-uri", NULL);
01438        _tmp17_ = merge_strategy->n_rows;
01439        _vala_assert (_tmp17_ == 2, "merge_strategy.n_rows == 2");
01440        _tmp18_ = main_exported_lens;
01441        unity_lens_set_merge_strategy (_tmp18_, old_merge_strategy);
01442        _g_object_unref0 (merge_strategy);
01443        _g_object_unref0 (old_merge_strategy);
01444 }
01445 
01446 
01447 static Block7Data* block7_data_ref (Block7Data* _data7_) {
01448        g_atomic_int_inc (&_data7_->_ref_count_);
01449        return _data7_;
01450 }
01451 
01452 
01453 static void block7_data_unref (void * _userdata_) {
01454        Block7Data* _data7_;
01455        _data7_ = (Block7Data*) _userdata_;
01456        if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
01457               _g_main_loop_unref0 (_data7_->ml);
01458               g_slice_free (Block7Data, _data7_);
01459        }
01460 }
01461 
01462 
01463 static gboolean __lambda8_ (Block7Data* _data7_) {
01464        gboolean result = FALSE;
01465        g_main_loop_quit (_data7_->ml);
01466        result = FALSE;
01467        return result;
01468 }
01469 
01470 
01471 static gboolean ___lambda8__gsource_func (gpointer self) {
01472        gboolean result;
01473        result = __lambda8_ (self);
01474        return result;
01475 }
01476 
01477 
01478 static void main_flush_bus (void) {
01479        Block7Data* _data7_;
01480        GMainLoop* _tmp2_;
01481        GError * _inner_error_ = NULL;
01482        _data7_ = g_slice_new0 (Block7Data);
01483        _data7_->_ref_count_ = 1;
01484        {
01485               GDBusConnection* _tmp0_ = NULL;
01486               GDBusConnection* bus;
01487               GDBusConnection* _tmp1_;
01488               _tmp0_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
01489               bus = _tmp0_;
01490               if (_inner_error_ != NULL) {
01491                      goto __catch2_g_error;
01492               }
01493               _tmp1_ = bus;
01494               g_dbus_connection_flush_sync (_tmp1_, NULL, &_inner_error_);
01495               if (_inner_error_ != NULL) {
01496                      _g_object_unref0 (bus);
01497                      goto __catch2_g_error;
01498               }
01499               _g_object_unref0 (bus);
01500        }
01501        goto __finally2;
01502        __catch2_g_error:
01503        {
01504               GError* e = NULL;
01505               e = _inner_error_;
01506               _inner_error_ = NULL;
01507               _g_error_free0 (e);
01508        }
01509        __finally2:
01510        if (_inner_error_ != NULL) {
01511               block7_data_unref (_data7_);
01512               _data7_ = NULL;
01513               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);
01514               g_clear_error (&_inner_error_);
01515               return;
01516        }
01517        _tmp2_ = g_main_loop_new (NULL, FALSE);
01518        _data7_->ml = _tmp2_;
01519        g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda8__gsource_func, block7_data_ref (_data7_), block7_data_unref);
01520        g_main_loop_run (_data7_->ml);
01521        block7_data_unref (_data7_);
01522        _data7_ = NULL;
01523 }
01524 
01525 
01526 static Block8Data* block8_data_ref (Block8Data* _data8_) {
01527        g_atomic_int_inc (&_data8_->_ref_count_);
01528        return _data8_;
01529 }
01530 
01531 
01532 static void block8_data_unref (void * _userdata_) {
01533        Block8Data* _data8_;
01534        _data8_ = (Block8Data*) _userdata_;
01535        if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
01536               _g_main_loop_unref0 (_data8_->ml);
01537               g_slice_free (Block8Data, _data8_);
01538        }
01539 }
01540 
01541 
01542 static Block9Data* block9_data_ref (Block9Data* _data9_) {
01543        g_atomic_int_inc (&_data9_->_ref_count_);
01544        return _data9_;
01545 }
01546 
01547 
01548 static void block9_data_unref (void * _userdata_) {
01549        Block9Data* _data9_;
01550        _data9_ = (Block9Data*) _userdata_;
01551        if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
01552               _g_object_unref0 (_data9_->lens_search);
01553               block8_data_unref (_data9_->_data8_);
01554               _data9_->_data8_ = NULL;
01555               g_slice_free (Block9Data, _data9_);
01556        }
01557 }
01558 
01559 
01560 static gboolean __lambda14_ (Block9Data* _data9_) {
01561        Block8Data* _data8_;
01562        gboolean result = FALSE;
01563        UnityLensSearch* _tmp0_;
01564        _data8_ = _data9_->_data8_;
01565        _data8_->finish_called = TRUE;
01566        _tmp0_ = _data9_->lens_search;
01567        g_signal_emit_by_name (_tmp0_, "finished");
01568        result = FALSE;
01569        return result;
01570 }
01571 
01572 
01573 static gboolean ___lambda14__gsource_func (gpointer self) {
01574        gboolean result;
01575        result = __lambda14_ (self);
01576        return result;
01577 }
01578 
01579 
01580 static void __lambda13_ (Block8Data* _data8_, UnityLensSearch* lens_search) {
01581        Block9Data* _data9_;
01582        UnityLensSearch* _tmp0_;
01583        UnityLensSearch* _tmp1_;
01584        g_return_if_fail (lens_search != NULL);
01585        _data9_ = g_slice_new0 (Block9Data);
01586        _data9_->_ref_count_ = 1;
01587        _data9_->_data8_ = block8_data_ref (_data8_);
01588        _tmp0_ = lens_search;
01589        _tmp1_ = _g_object_ref0 (_tmp0_);
01590        _data9_->lens_search = _tmp1_;
01591        _data8_->got_search_changed = TRUE;
01592        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 750, ___lambda14__gsource_func, block9_data_ref (_data9_), block9_data_unref);
01593        block9_data_unref (_data9_);
01594        _data9_ = NULL;
01595 }
01596 
01597 
01598 static void ___lambda13__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
01599        __lambda13_ (self, search);
01600 }
01601 
01602 
01603 static void _vala_array_add3 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
01604        if ((*length) == (*size)) {
01605               *size = (*size) ? (2 * (*size)) : 4;
01606               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
01607        }
01608        (*array)[(*length)++] = value;
01609        (*array)[*length] = NULL;
01610 }
01611 
01612 
01613 static void __lambda15_ (Block8Data* _data8_) {
01614        g_main_loop_quit (_data8_->ml);
01615 }
01616 
01617 
01618 static void ___lambda15__gfunc (gconstpointer data, gpointer self) {
01619        __lambda15_ (self);
01620 }
01621 
01622 
01623 void main_test_lens_return_after_scope_finish (void) {
01624        Block8Data* _data8_;
01625        MainSignalWrapper** signals;
01626        gint signals_length1;
01627        gint _signals_size_;
01628        UnityScope* _tmp0_;
01629        GMainLoop* _tmp1_;
01630        MainSignalWrapper** _tmp2_;
01631        gint _tmp2__length1;
01632        UnityScope* _tmp3_;
01633        UnityScope* _tmp4_;
01634        gulong _tmp5_ = 0UL;
01635        MainSignalWrapper* _tmp6_;
01636        _data8_ = g_slice_new0 (Block8Data);
01637        _data8_->_ref_count_ = 1;
01638        signals = NULL;
01639        signals_length1 = 0;
01640        _signals_size_ = signals_length1;
01641        _tmp0_ = main_local_scope;
01642        _vala_assert (_tmp0_ != NULL, "local_scope != null");
01643        _tmp1_ = g_main_loop_new (NULL, FALSE);
01644        _data8_->ml = _tmp1_;
01645        _data8_->got_search_changed = FALSE;
01646        _data8_->finish_called = FALSE;
01647        _tmp2_ = signals;
01648        _tmp2__length1 = signals_length1;
01649        _tmp3_ = main_local_scope;
01650        _tmp4_ = main_local_scope;
01651        _tmp5_ = g_signal_connect_data (_tmp4_, "search-changed", (GCallback) ___lambda13__unity_scope_search_changed, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
01652        _tmp6_ = main_signal_wrapper_new ((GObject*) _tmp3_, _tmp5_);
01653        _vala_array_add3 (&signals, &signals_length1, &_signals_size_, _tmp6_);
01654        main_call_lens_search ("qoo", ___lambda15__gfunc, _data8_);
01655        main_run_with_timeout (_data8_->ml, (guint) 5000);
01656        _vala_assert (_data8_->got_search_changed == TRUE, "got_search_changed == true");
01657        _vala_assert (_data8_->finish_called == TRUE, "finish_called == true");
01658        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
01659        block8_data_unref (_data8_);
01660        _data8_ = NULL;
01661 }
01662 
01663 
01664 static Block10Data* block10_data_ref (Block10Data* _data10_) {
01665        g_atomic_int_inc (&_data10_->_ref_count_);
01666        return _data10_;
01667 }
01668 
01669 
01670 static void block10_data_unref (void * _userdata_) {
01671        Block10Data* _data10_;
01672        _data10_ = (Block10Data*) _userdata_;
01673        if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
01674               _g_variant_unref0 (_data10_->result2);
01675               _g_variant_unref0 (_data10_->result1);
01676               _g_main_loop_unref0 (_data10_->ml);
01677               g_slice_free (Block10Data, _data10_);
01678        }
01679 }
01680 
01681 
01682 static Block11Data* block11_data_ref (Block11Data* _data11_) {
01683        g_atomic_int_inc (&_data11_->_ref_count_);
01684        return _data11_;
01685 }
01686 
01687 
01688 static void block11_data_unref (void * _userdata_) {
01689        Block11Data* _data11_;
01690        _data11_ = (Block11Data*) _userdata_;
01691        if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
01692               _g_object_unref0 (_data11_->lens_search);
01693               block10_data_unref (_data11_->_data10_);
01694               _data11_->_data10_ = NULL;
01695               g_slice_free (Block11Data, _data11_);
01696        }
01697 }
01698 
01699 
01700 static gboolean __lambda17_ (Block11Data* _data11_) {
01701        Block10Data* _data10_;
01702        gboolean result = FALSE;
01703        UnityLensSearch* _tmp0_;
01704        DeeSerializableModel* _tmp1_;
01705        DeeSerializableModel* _tmp2_;
01706        UnityLensSearch* _tmp3_;
01707        DeeSerializableModel* _tmp4_;
01708        DeeSerializableModel* _tmp5_;
01709        UnityLensSearch* _tmp6_;
01710        _data10_ = _data11_->_data10_;
01711        _tmp0_ = _data11_->lens_search;
01712        _tmp1_ = unity_lens_search_get_results_model (_tmp0_);
01713        _tmp2_ = _tmp1_;
01714        dee_model_clear ((DeeModel*) _tmp2_);
01715        _tmp3_ = _data11_->lens_search;
01716        _tmp4_ = unity_lens_search_get_results_model (_tmp3_);
01717        _tmp5_ = _tmp4_;
01718        dee_model_append ((DeeModel*) _tmp5_, "", "", 0, "", "", "", "", NULL);
01719        _tmp6_ = _data11_->lens_search;
01720        g_signal_emit_by_name (_tmp6_, "finished");
01721        _data10_->finish_called = TRUE;
01722        result = FALSE;
01723        return result;
01724 }
01725 
01726 
01727 static gboolean ___lambda17__gsource_func (gpointer self) {
01728        gboolean result;
01729        result = __lambda17_ (self);
01730        return result;
01731 }
01732 
01733 
01734 static void __lambda16_ (Block10Data* _data10_, UnityLensSearch* lens_search) {
01735        Block11Data* _data11_;
01736        UnityLensSearch* _tmp0_;
01737        UnityLensSearch* _tmp1_;
01738        g_return_if_fail (lens_search != NULL);
01739        _data11_ = g_slice_new0 (Block11Data);
01740        _data11_->_ref_count_ = 1;
01741        _data11_->_data10_ = block10_data_ref (_data10_);
01742        _tmp0_ = lens_search;
01743        _tmp1_ = _g_object_ref0 (_tmp0_);
01744        _data11_->lens_search = _tmp1_;
01745        _data10_->got_search_changed = TRUE;
01746        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 750, ___lambda17__gsource_func, block11_data_ref (_data11_), block11_data_unref);
01747        block11_data_unref (_data11_);
01748        _data11_ = NULL;
01749 }
01750 
01751 
01752 static void ___lambda16__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
01753        __lambda16_ (self, search);
01754 }
01755 
01756 
01757 static void _vala_array_add4 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
01758        if ((*length) == (*size)) {
01759               *size = (*size) ? (2 * (*size)) : 4;
01760               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
01761        }
01762        (*array)[(*length)++] = value;
01763        (*array)[*length] = NULL;
01764 }
01765 
01766 
01767 static gpointer _g_variant_ref0 (gpointer self) {
01768        return self ? g_variant_ref (self) : NULL;
01769 }
01770 
01771 
01772 static void __lambda18_ (Block10Data* _data10_, GVariant* _result_) {
01773        GVariant* _tmp0_;
01774        GVariant* _tmp1_;
01775        _tmp0_ = _result_;
01776        _tmp1_ = _g_variant_ref0 (_tmp0_);
01777        _g_variant_unref0 (_data10_->result1);
01778        _data10_->result1 = _tmp1_;
01779 }
01780 
01781 
01782 static void ___lambda18__gfunc (gconstpointer data, gpointer self) {
01783        __lambda18_ (self, data);
01784 }
01785 
01786 
01787 static void __lambda19_ (Block10Data* _data10_, GVariant* _result_) {
01788        GVariant* _tmp0_;
01789        GVariant* _tmp1_;
01790        _tmp0_ = _result_;
01791        _tmp1_ = _g_variant_ref0 (_tmp0_);
01792        _g_variant_unref0 (_data10_->result2);
01793        _data10_->result2 = _tmp1_;
01794        g_main_loop_quit (_data10_->ml);
01795 }
01796 
01797 
01798 static void ___lambda19__gfunc (gconstpointer data, gpointer self) {
01799        __lambda19_ (self, data);
01800 }
01801 
01802 
01803 void main_test_lens_successive_searches (void) {
01804        Block10Data* _data10_;
01805        MainSignalWrapper** signals;
01806        gint signals_length1;
01807        gint _signals_size_;
01808        UnityScope* _tmp0_;
01809        GMainLoop* _tmp1_;
01810        MainSignalWrapper** _tmp2_;
01811        gint _tmp2__length1;
01812        UnityScope* _tmp3_;
01813        UnityScope* _tmp4_;
01814        gulong _tmp5_ = 0UL;
01815        MainSignalWrapper* _tmp6_;
01816        gboolean _tmp7_ = FALSE;
01817        _data10_ = g_slice_new0 (Block10Data);
01818        _data10_->_ref_count_ = 1;
01819        signals = NULL;
01820        signals_length1 = 0;
01821        _signals_size_ = signals_length1;
01822        _tmp0_ = main_local_scope;
01823        _vala_assert (_tmp0_ != NULL, "local_scope != null");
01824        _tmp1_ = g_main_loop_new (NULL, FALSE);
01825        _data10_->ml = _tmp1_;
01826        _data10_->got_search_changed = FALSE;
01827        _data10_->finish_called = FALSE;
01828        _tmp2_ = signals;
01829        _tmp2__length1 = signals_length1;
01830        _tmp3_ = main_local_scope;
01831        _tmp4_ = main_local_scope;
01832        _tmp5_ = g_signal_connect_data (_tmp4_, "search-changed", (GCallback) ___lambda16__unity_scope_search_changed, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
01833        _tmp6_ = main_signal_wrapper_new ((GObject*) _tmp3_, _tmp5_);
01834        _vala_array_add4 (&signals, &signals_length1, &_signals_size_, _tmp6_);
01835        _data10_->result1 = NULL;
01836        _data10_->result2 = NULL;
01837        main_call_lens_search ("successive-searches", ___lambda18__gfunc, _data10_);
01838        main_call_lens_search ("successive-searches", ___lambda19__gfunc, _data10_);
01839        main_run_with_timeout (_data10_->ml, (guint) 5000);
01840        _vala_assert (_data10_->got_search_changed == TRUE, "got_search_changed == true");
01841        _vala_assert (_data10_->finish_called == TRUE, "finish_called == true");
01842        _tmp7_ = g_variant_equal (_data10_->result1, _data10_->result2);
01843        _vala_assert (_tmp7_, "result1.equal (result2)");
01844        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
01845        block10_data_unref (_data10_);
01846        _data10_ = NULL;
01847 }
01848 
01849 
01850 static Block12Data* block12_data_ref (Block12Data* _data12_) {
01851        g_atomic_int_inc (&_data12_->_ref_count_);
01852        return _data12_;
01853 }
01854 
01855 
01856 static void block12_data_unref (void * _userdata_) {
01857        Block12Data* _data12_;
01858        _data12_ = (Block12Data*) _userdata_;
01859        if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
01860               _g_main_loop_unref0 (_data12_->reply_ml);
01861               _g_free0 (_data12_->order);
01862               _g_object_unref0 (_data12_->canc2);
01863               _g_object_unref0 (_data12_->canc1);
01864               _g_main_loop_unref0 (_data12_->ml);
01865               g_slice_free (Block12Data, _data12_);
01866        }
01867 }
01868 
01869 
01870 static Block13Data* block13_data_ref (Block13Data* _data13_) {
01871        g_atomic_int_inc (&_data13_->_ref_count_);
01872        return _data13_;
01873 }
01874 
01875 
01876 static void block13_data_unref (void * _userdata_) {
01877        Block13Data* _data13_;
01878        _data13_ = (Block13Data*) _userdata_;
01879        if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
01880               _g_object_unref0 (_data13_->lens_search);
01881               block12_data_unref (_data13_->_data12_);
01882               _data13_->_data12_ = NULL;
01883               g_slice_free (Block13Data, _data13_);
01884        }
01885 }
01886 
01887 
01888 static gboolean __lambda21_ (Block13Data* _data13_) {
01889        Block12Data* _data12_;
01890        gboolean result = FALSE;
01891        guint _tmp0_;
01892        UnityLensSearch* _tmp1_;
01893        _data12_ = _data13_->_data12_;
01894        _tmp0_ = _data12_->finish_calls;
01895        _data12_->finish_calls = _tmp0_ + 1;
01896        _tmp1_ = _data13_->lens_search;
01897        g_signal_emit_by_name (_tmp1_, "finished");
01898        if (_data12_->finish_calls == ((guint) 2)) {
01899               GMainLoop* _tmp2_;
01900               _tmp2_ = _data12_->ml;
01901               g_main_loop_quit (_tmp2_);
01902        }
01903        result = FALSE;
01904        return result;
01905 }
01906 
01907 
01908 static gboolean ___lambda21__gsource_func (gpointer self) {
01909        gboolean result;
01910        result = __lambda21_ (self);
01911        return result;
01912 }
01913 
01914 
01915 static void __lambda20_ (Block12Data* _data12_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
01916        Block13Data* _data13_;
01917        UnityLensSearch* _tmp0_;
01918        UnityLensSearch* _tmp1_;
01919        UnityLensSearch* _tmp2_;
01920        const gchar* _tmp3_;
01921        const gchar* _tmp4_;
01922        const gchar* _tmp5_;
01923        GQuark _tmp7_ = 0U;
01924        static GQuark _tmp6_label0 = 0;
01925        static GQuark _tmp6_label1 = 0;
01926        GMainLoop* _tmp12_;
01927        g_return_if_fail (lens_search != NULL);
01928        g_return_if_fail (cancellable != NULL);
01929        _data13_ = g_slice_new0 (Block13Data);
01930        _data13_->_ref_count_ = 1;
01931        _data13_->_data12_ = block12_data_ref (_data12_);
01932        _tmp0_ = lens_search;
01933        _tmp1_ = _g_object_ref0 (_tmp0_);
01934        _data13_->lens_search = _tmp1_;
01935        _data12_->got_search_changed = TRUE;
01936        _tmp2_ = _data13_->lens_search;
01937        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
01938        _tmp4_ = _tmp3_;
01939        _tmp5_ = _tmp4_;
01940        _tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
01941        if (_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("foo1")))) {
01942               switch (0) {
01943                      default:
01944                      {
01945                             GCancellable* _tmp8_;
01946                             GCancellable* _tmp9_;
01947                             _tmp8_ = cancellable;
01948                             _tmp9_ = _g_object_ref0 (_tmp8_);
01949                             _g_object_unref0 (_data12_->canc1);
01950                             _data12_->canc1 = _tmp9_;
01951                             break;
01952                      }
01953               }
01954        } else if (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("foo2")))) {
01955               switch (0) {
01956                      default:
01957                      {
01958                             GCancellable* _tmp10_;
01959                             GCancellable* _tmp11_;
01960                             _tmp10_ = cancellable;
01961                             _tmp11_ = _g_object_ref0 (_tmp10_);
01962                             _g_object_unref0 (_data12_->canc2);
01963                             _data12_->canc2 = _tmp11_;
01964                             break;
01965                      }
01966               }
01967        } else {
01968               switch (0) {
01969                      default:
01970                      {
01971                             g_assert_not_reached ();
01972                      }
01973               }
01974        }
01975        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 1000, ___lambda21__gsource_func, block13_data_ref (_data13_), block13_data_unref);
01976        _tmp12_ = _data12_->ml;
01977        g_main_loop_quit (_tmp12_);
01978        block13_data_unref (_data13_);
01979        _data13_ = NULL;
01980 }
01981 
01982 
01983 static void ___lambda20__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
01984        __lambda20_ (self, search, search_type, cancellable);
01985 }
01986 
01987 
01988 static void _vala_array_add5 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
01989        if ((*length) == (*size)) {
01990               *size = (*size) ? (2 * (*size)) : 4;
01991               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
01992        }
01993        (*array)[(*length)++] = value;
01994        (*array)[*length] = NULL;
01995 }
01996 
01997 
01998 static void __lambda22_ (Block12Data* _data12_) {
01999        gchar* _tmp0_;
02000        _tmp0_ = g_strconcat (_data12_->order, "1", NULL);
02001        _g_free0 (_data12_->order);
02002        _data12_->order = _tmp0_;
02003        _data12_->replies = _data12_->replies + 1;
02004        if (_data12_->replies == 2) {
02005               g_main_loop_quit (_data12_->reply_ml);
02006        }
02007 }
02008 
02009 
02010 static void ___lambda22__gfunc (gconstpointer data, gpointer self) {
02011        __lambda22_ (self);
02012 }
02013 
02014 
02015 static void __lambda23_ (Block12Data* _data12_) {
02016        gchar* _tmp0_;
02017        _tmp0_ = g_strconcat (_data12_->order, "2", NULL);
02018        _g_free0 (_data12_->order);
02019        _data12_->order = _tmp0_;
02020        _data12_->replies = _data12_->replies + 1;
02021        if (_data12_->replies == 2) {
02022               g_main_loop_quit (_data12_->reply_ml);
02023        }
02024 }
02025 
02026 
02027 static void ___lambda23__gfunc (gconstpointer data, gpointer self) {
02028        __lambda23_ (self);
02029 }
02030 
02031 
02032 static gboolean __lambda24_ (void) {
02033        gboolean result = FALSE;
02034        g_assert_not_reached ();
02035        return result;
02036 }
02037 
02038 
02039 static gboolean ___lambda24__gsource_func (gpointer self) {
02040        gboolean result;
02041        result = __lambda24_ ();
02042        return result;
02043 }
02044 
02045 
02046 void main_test_lens_two_searches (void) {
02047        Block12Data* _data12_;
02048        MainSignalWrapper** signals;
02049        gint signals_length1;
02050        gint _signals_size_;
02051        UnityScope* _tmp0_;
02052        GMainLoop* _tmp1_;
02053        MainSignalWrapper** _tmp2_;
02054        gint _tmp2__length1;
02055        UnityScope* _tmp3_;
02056        UnityScope* _tmp4_;
02057        gulong _tmp5_ = 0UL;
02058        MainSignalWrapper* _tmp6_;
02059        gchar* _tmp7_;
02060        GMainLoop* _tmp8_;
02061        GFunc foo1_finished_cb;
02062        void* foo1_finished_cb_target;
02063        GDestroyNotify foo1_finished_cb_target_destroy_notify;
02064        GFunc foo2_finished_cb;
02065        void* foo2_finished_cb_target;
02066        GDestroyNotify foo2_finished_cb_target_destroy_notify;
02067        guint _tmp9_ = 0U;
02068        guint bad_timer;
02069        GMainLoop* _tmp10_;
02070        GMainLoop* _tmp11_;
02071        GMainLoop* _tmp12_;
02072        gboolean _tmp13_ = FALSE;
02073        gboolean _tmp14_ = FALSE;
02074        _data12_ = g_slice_new0 (Block12Data);
02075        _data12_->_ref_count_ = 1;
02076        signals = NULL;
02077        signals_length1 = 0;
02078        _signals_size_ = signals_length1;
02079        _tmp0_ = main_local_scope;
02080        _vala_assert (_tmp0_ != NULL, "local_scope != null");
02081        _tmp1_ = g_main_loop_new (NULL, FALSE);
02082        _data12_->ml = _tmp1_;
02083        _data12_->canc1 = NULL;
02084        _data12_->canc2 = NULL;
02085        _data12_->got_search_changed = FALSE;
02086        _data12_->finish_calls = (guint) 0;
02087        _tmp2_ = signals;
02088        _tmp2__length1 = signals_length1;
02089        _tmp3_ = main_local_scope;
02090        _tmp4_ = main_local_scope;
02091        _tmp5_ = g_signal_connect_data (_tmp4_, "search-changed", (GCallback) ___lambda20__unity_scope_search_changed, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
02092        _tmp6_ = main_signal_wrapper_new ((GObject*) _tmp3_, _tmp5_);
02093        _vala_array_add5 (&signals, &signals_length1, &_signals_size_, _tmp6_);
02094        _tmp7_ = g_strdup ("");
02095        _data12_->order = _tmp7_;
02096        _tmp8_ = g_main_loop_new (NULL, FALSE);
02097        _data12_->reply_ml = _tmp8_;
02098        _data12_->replies = 0;
02099        foo1_finished_cb = ___lambda22__gfunc;
02100        foo1_finished_cb_target = block12_data_ref (_data12_);
02101        foo1_finished_cb_target_destroy_notify = block12_data_unref;
02102        foo2_finished_cb = ___lambda23__gfunc;
02103        foo2_finished_cb_target = block12_data_ref (_data12_);
02104        foo2_finished_cb_target_destroy_notify = block12_data_unref;
02105        _tmp9_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda24__gsource_func, NULL, NULL);
02106        bad_timer = _tmp9_;
02107        main_call_lens_search ("foo1", foo1_finished_cb, foo1_finished_cb_target);
02108        _tmp10_ = _data12_->ml;
02109        g_main_loop_run (_tmp10_);
02110        main_flush_bus ();
02111        _tmp11_ = g_main_loop_new (NULL, FALSE);
02112        _g_main_loop_unref0 (_data12_->ml);
02113        _data12_->ml = _tmp11_;
02114        main_call_lens_search ("foo2", foo2_finished_cb, foo2_finished_cb_target);
02115        _tmp12_ = _data12_->ml;
02116        g_main_loop_run (_tmp12_);
02117        g_source_remove (bad_timer);
02118        _vala_assert (_data12_->canc1 != NULL, "canc1 != null");
02119        _vala_assert (_data12_->canc2 != NULL, "canc2 != null");
02120        _tmp13_ = g_cancellable_is_cancelled (_data12_->canc1);
02121        _vala_assert (_tmp13_ == TRUE, "canc1.is_cancelled () == true");
02122        _tmp14_ = g_cancellable_is_cancelled (_data12_->canc2);
02123        _vala_assert (_tmp14_ == FALSE, "canc2.is_cancelled () == false");
02124        main_flush_bus ();
02125        g_main_loop_run (_data12_->reply_ml);
02126        _vala_assert (g_strcmp0 (_data12_->order, "12") == 0, "order == \"12\"");
02127        (foo2_finished_cb_target_destroy_notify == NULL) ? NULL : (foo2_finished_cb_target_destroy_notify (foo2_finished_cb_target), NULL);
02128        foo2_finished_cb = NULL;
02129        foo2_finished_cb_target = NULL;
02130        foo2_finished_cb_target_destroy_notify = NULL;
02131        (foo1_finished_cb_target_destroy_notify == NULL) ? NULL : (foo1_finished_cb_target_destroy_notify (foo1_finished_cb_target), NULL);
02132        foo1_finished_cb = NULL;
02133        foo1_finished_cb_target = NULL;
02134        foo1_finished_cb_target_destroy_notify = NULL;
02135        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
02136        block12_data_unref (_data12_);
02137        _data12_ = NULL;
02138 }
02139 
02140 
02141 static Block14Data* block14_data_ref (Block14Data* _data14_) {
02142        g_atomic_int_inc (&_data14_->_ref_count_);
02143        return _data14_;
02144 }
02145 
02146 
02147 static void block14_data_unref (void * _userdata_) {
02148        Block14Data* _data14_;
02149        _data14_ = (Block14Data*) _userdata_;
02150        if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
02151               _g_main_loop_unref0 (_data14_->ml);
02152               g_slice_free (Block14Data, _data14_);
02153        }
02154 }
02155 
02156 
02157 static Block15Data* block15_data_ref (Block15Data* _data15_) {
02158        g_atomic_int_inc (&_data15_->_ref_count_);
02159        return _data15_;
02160 }
02161 
02162 
02163 static void block15_data_unref (void * _userdata_) {
02164        Block15Data* _data15_;
02165        _data15_ = (Block15Data*) _userdata_;
02166        if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
02167               _g_object_unref0 (_data15_->lens_search);
02168               block14_data_unref (_data15_->_data14_);
02169               _data15_->_data14_ = NULL;
02170               g_slice_free (Block15Data, _data15_);
02171        }
02172 }
02173 
02174 
02175 static gboolean __lambda26_ (Block15Data* _data15_) {
02176        Block14Data* _data14_;
02177        gboolean result = FALSE;
02178        UnityLensSearch* _tmp0_;
02179        DeeSerializableModel* _tmp1_;
02180        DeeSerializableModel* _tmp2_;
02181        DeeSerializableModel* _tmp3_;
02182        DeeSerializableModel* model;
02183        UnityLensSearch* _tmp4_;
02184        _data14_ = _data15_->_data14_;
02185        _tmp0_ = _data15_->lens_search;
02186        _tmp1_ = unity_lens_search_get_results_model (_tmp0_);
02187        _tmp2_ = _tmp1_;
02188        _tmp3_ = _g_object_ref0 (_tmp2_);
02189        model = _tmp3_;
02190        dee_model_append ((DeeModel*) model, "uri", "icon", 0, "mimetype", "display-name", "comment", "dnd-uri", NULL);
02191        _tmp4_ = _data15_->lens_search;
02192        g_signal_emit_by_name (_tmp4_, "finished");
02193        result = FALSE;
02194        _g_object_unref0 (model);
02195        return result;
02196 }
02197 
02198 
02199 static gboolean ___lambda26__gsource_func (gpointer self) {
02200        gboolean result;
02201        result = __lambda26_ (self);
02202        return result;
02203 }
02204 
02205 
02206 static void __lambda25_ (Block14Data* _data14_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
02207        Block15Data* _data15_;
02208        UnityLensSearch* _tmp0_;
02209        UnityLensSearch* _tmp1_;
02210        UnityLensSearch* _tmp2_;
02211        const gchar* _tmp3_;
02212        const gchar* _tmp4_;
02213        g_return_if_fail (lens_search != NULL);
02214        g_return_if_fail (cancellable != NULL);
02215        _data15_ = g_slice_new0 (Block15Data);
02216        _data15_->_ref_count_ = 1;
02217        _data15_->_data14_ = block14_data_ref (_data14_);
02218        _tmp0_ = lens_search;
02219        _tmp1_ = _g_object_ref0 (_tmp0_);
02220        _data15_->lens_search = _tmp1_;
02221        _tmp2_ = _data15_->lens_search;
02222        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
02223        _tmp4_ = _tmp3_;
02224        _vala_assert (g_strcmp0 (_tmp4_, "model-sync") == 0, "lens_search.search_string == \"model-sync\"");
02225        _data14_->got_search_changed = TRUE;
02226        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 300, ___lambda26__gsource_func, block15_data_ref (_data15_), block15_data_unref);
02227        block15_data_unref (_data15_);
02228        _data15_ = NULL;
02229 }
02230 
02231 
02232 static void ___lambda25__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
02233        __lambda25_ (self, search, search_type, cancellable);
02234 }
02235 
02236 
02237 static void _vala_array_add6 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
02238        if ((*length) == (*size)) {
02239               *size = (*size) ? (2 * (*size)) : 4;
02240               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
02241        }
02242        (*array)[(*length)++] = value;
02243        (*array)[*length] = NULL;
02244 }
02245 
02246 
02247 static GHashTable* _variant_get2 (GVariant* value) {
02248        GHashTable* _tmp5_;
02249        GVariantIter _tmp6_;
02250        GVariant* _tmp7_;
02251        GVariant* _tmp8_;
02252        _tmp5_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
02253        g_variant_iter_init (&_tmp6_, value);
02254        while (g_variant_iter_loop (&_tmp6_, "{?*}", &_tmp7_, &_tmp8_)) {
02255               g_hash_table_insert (_tmp5_, g_variant_dup_string (_tmp7_, NULL), g_variant_get_variant (_tmp8_));
02256        }
02257        return _tmp5_;
02258 }
02259 
02260 
02261 static void __lambda27_ (Block14Data* _data14_, GVariant* reply) {
02262        GVariant* _tmp0_;
02263        GVariant* _tmp1_;
02264        GVariant* _tmp2_ = NULL;
02265        GVariant* _tmp3_;
02266        GHashTable* _tmp4_;
02267        GHashTable* _tmp9_;
02268        GHashTable* ht;
02269        gconstpointer _tmp10_ = NULL;
02270        GVariant* seqnum_v;
02271        guint64 _tmp11_ = 0ULL;
02272        _tmp0_ = reply;
02273        _vala_assert (_tmp0_ != NULL, "reply != null");
02274        _tmp1_ = reply;
02275        _tmp2_ = g_variant_get_child_value (_tmp1_, (gsize) 0);
02276        _tmp3_ = _tmp2_;
02277        _tmp4_ = _variant_get2 (_tmp3_);
02278        _tmp9_ = _tmp4_;
02279        _g_variant_unref0 (_tmp3_);
02280        ht = _tmp9_;
02281        _tmp10_ = g_hash_table_lookup (ht, "model-seqnum");
02282        seqnum_v = (GVariant*) _tmp10_;
02283        _vala_assert (seqnum_v != NULL, "seqnum_v != null");
02284        _tmp11_ = g_variant_get_uint64 (seqnum_v);
02285        _data14_->seqnum = _tmp11_;
02286        g_main_loop_quit (_data14_->ml);
02287        _g_hash_table_unref0 (ht);
02288 }
02289 
02290 
02291 static void ___lambda27__gfunc (gconstpointer data, gpointer self) {
02292        __lambda27_ (self, data);
02293 }
02294 
02295 
02296 void main_test_lens_model_sync (void) {
02297        Block14Data* _data14_;
02298        MainSignalWrapper** signals;
02299        gint signals_length1;
02300        gint _signals_size_;
02301        UnityScope* _tmp0_;
02302        GMainLoop* _tmp1_;
02303        MainSignalWrapper** _tmp2_;
02304        gint _tmp2__length1;
02305        UnityScope* _tmp3_;
02306        UnityScope* _tmp4_;
02307        gulong _tmp5_ = 0UL;
02308        MainSignalWrapper* _tmp6_;
02309        _data14_ = g_slice_new0 (Block14Data);
02310        _data14_->_ref_count_ = 1;
02311        signals = NULL;
02312        signals_length1 = 0;
02313        _signals_size_ = signals_length1;
02314        _tmp0_ = main_local_scope;
02315        _vala_assert (_tmp0_ != NULL, "local_scope != null");
02316        _data14_->got_search_changed = FALSE;
02317        _tmp1_ = g_main_loop_new (NULL, FALSE);
02318        _data14_->ml = _tmp1_;
02319        _tmp2_ = signals;
02320        _tmp2__length1 = signals_length1;
02321        _tmp3_ = main_local_scope;
02322        _tmp4_ = main_local_scope;
02323        _tmp5_ = g_signal_connect_data (_tmp4_, "search-changed", (GCallback) ___lambda25__unity_scope_search_changed, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
02324        _tmp6_ = main_signal_wrapper_new ((GObject*) _tmp3_, _tmp5_);
02325        _vala_array_add6 (&signals, &signals_length1, &_signals_size_, _tmp6_);
02326        _data14_->seqnum = (guint64) 0;
02327        main_call_lens_search ("model-sync", ___lambda27__gfunc, _data14_);
02328        main_run_with_timeout (_data14_->ml, (guint) 3000);
02329        _vala_assert (_data14_->got_search_changed == TRUE, "got_search_changed == true");
02330        _vala_assert (_data14_->seqnum > ((guint64) 0), "seqnum > 0");
02331        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
02332        block14_data_unref (_data14_);
02333        _data14_ = NULL;
02334 }
02335 
02336 
02337 static Block16Data* block16_data_ref (Block16Data* _data16_) {
02338        g_atomic_int_inc (&_data16_->_ref_count_);
02339        return _data16_;
02340 }
02341 
02342 
02343 static void block16_data_unref (void * _userdata_) {
02344        Block16Data* _data16_;
02345        _data16_ = (Block16Data*) _userdata_;
02346        if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
02347               _g_free0 (_data16_->hint_reply);
02348               _g_main_loop_unref0 (_data16_->ml);
02349               g_slice_free (Block16Data, _data16_);
02350        }
02351 }
02352 
02353 
02354 static Block17Data* block17_data_ref (Block17Data* _data17_) {
02355        g_atomic_int_inc (&_data17_->_ref_count_);
02356        return _data17_;
02357 }
02358 
02359 
02360 static void block17_data_unref (void * _userdata_) {
02361        Block17Data* _data17_;
02362        _data17_ = (Block17Data*) _userdata_;
02363        if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
02364               _g_object_unref0 (_data17_->lens_search);
02365               block16_data_unref (_data17_->_data16_);
02366               _data17_->_data16_ = NULL;
02367               g_slice_free (Block17Data, _data17_);
02368        }
02369 }
02370 
02371 
02372 static gboolean __lambda29_ (Block17Data* _data17_) {
02373        Block16Data* _data16_;
02374        gboolean result = FALSE;
02375        UnityLensSearch* _tmp0_;
02376        DeeSerializableModel* _tmp1_;
02377        DeeSerializableModel* _tmp2_;
02378        DeeSerializableModel* _tmp3_;
02379        DeeSerializableModel* model;
02380        UnityLensSearch* _tmp4_;
02381        GVariant* _tmp5_;
02382        GVariant* _tmp6_;
02383        UnityLensSearch* _tmp7_;
02384        _data16_ = _data17_->_data16_;
02385        _tmp0_ = _data17_->lens_search;
02386        _tmp1_ = unity_lens_search_get_results_model (_tmp0_);
02387        _tmp2_ = _tmp1_;
02388        _tmp3_ = _g_object_ref0 (_tmp2_);
02389        model = _tmp3_;
02390        dee_model_append ((DeeModel*) model, "uri", "icon", 0, "mimetype", "display-name", "comment", "dnd-uri", NULL);
02391        _tmp4_ = _data17_->lens_search;
02392        _tmp5_ = g_variant_new_string ("value");
02393        g_variant_ref_sink (_tmp5_);
02394        _tmp6_ = _tmp5_;
02395        unity_lens_search_set_reply_hint (_tmp4_, "test-reply-hint", _tmp6_);
02396        _g_variant_unref0 (_tmp6_);
02397        _tmp7_ = _data17_->lens_search;
02398        g_signal_emit_by_name (_tmp7_, "finished");
02399        result = FALSE;
02400        _g_object_unref0 (model);
02401        return result;
02402 }
02403 
02404 
02405 static gboolean ___lambda29__gsource_func (gpointer self) {
02406        gboolean result;
02407        result = __lambda29_ (self);
02408        return result;
02409 }
02410 
02411 
02412 static void __lambda28_ (Block16Data* _data16_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
02413        Block17Data* _data17_;
02414        UnityLensSearch* _tmp0_;
02415        UnityLensSearch* _tmp1_;
02416        UnityLensSearch* _tmp2_;
02417        const gchar* _tmp3_;
02418        const gchar* _tmp4_;
02419        g_return_if_fail (lens_search != NULL);
02420        g_return_if_fail (cancellable != NULL);
02421        _data17_ = g_slice_new0 (Block17Data);
02422        _data17_->_ref_count_ = 1;
02423        _data17_->_data16_ = block16_data_ref (_data16_);
02424        _tmp0_ = lens_search;
02425        _tmp1_ = _g_object_ref0 (_tmp0_);
02426        _data17_->lens_search = _tmp1_;
02427        _tmp2_ = _data17_->lens_search;
02428        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
02429        _tmp4_ = _tmp3_;
02430        _vala_assert (g_strcmp0 (_tmp4_, "reply-hint") == 0, "lens_search.search_string == \"reply-hint\"");
02431        _data16_->got_search_changed = TRUE;
02432        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 10, ___lambda29__gsource_func, block17_data_ref (_data17_), block17_data_unref);
02433        block17_data_unref (_data17_);
02434        _data17_ = NULL;
02435 }
02436 
02437 
02438 static void ___lambda28__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
02439        __lambda28_ (self, search, search_type, cancellable);
02440 }
02441 
02442 
02443 static void _vala_array_add7 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
02444        if ((*length) == (*size)) {
02445               *size = (*size) ? (2 * (*size)) : 4;
02446               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
02447        }
02448        (*array)[(*length)++] = value;
02449        (*array)[*length] = NULL;
02450 }
02451 
02452 
02453 static GHashTable* _variant_get3 (GVariant* value) {
02454        GHashTable* _tmp5_;
02455        GVariantIter _tmp6_;
02456        GVariant* _tmp7_;
02457        GVariant* _tmp8_;
02458        _tmp5_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
02459        g_variant_iter_init (&_tmp6_, value);
02460        while (g_variant_iter_loop (&_tmp6_, "{?*}", &_tmp7_, &_tmp8_)) {
02461               g_hash_table_insert (_tmp5_, g_variant_dup_string (_tmp7_, NULL), g_variant_get_variant (_tmp8_));
02462        }
02463        return _tmp5_;
02464 }
02465 
02466 
02467 static void __lambda30_ (Block16Data* _data16_, GVariant* reply) {
02468        GVariant* _tmp0_;
02469        GVariant* _tmp1_;
02470        GVariant* _tmp2_ = NULL;
02471        GVariant* _tmp3_;
02472        GHashTable* _tmp4_;
02473        GHashTable* _tmp9_;
02474        GHashTable* ht;
02475        gconstpointer _tmp10_ = NULL;
02476        GVariant* hint_v;
02477        const gchar* _tmp11_ = NULL;
02478        gchar* _tmp12_;
02479        _tmp0_ = reply;
02480        _vala_assert (_tmp0_ != NULL, "reply != null");
02481        _tmp1_ = reply;
02482        _tmp2_ = g_variant_get_child_value (_tmp1_, (gsize) 0);
02483        _tmp3_ = _tmp2_;
02484        _tmp4_ = _variant_get3 (_tmp3_);
02485        _tmp9_ = _tmp4_;
02486        _g_variant_unref0 (_tmp3_);
02487        ht = _tmp9_;
02488        _tmp10_ = g_hash_table_lookup (ht, "test-reply-hint");
02489        hint_v = (GVariant*) _tmp10_;
02490        _vala_assert (hint_v != NULL, "hint_v != null");
02491        _tmp11_ = g_variant_get_string (hint_v, NULL);
02492        _tmp12_ = g_strdup (_tmp11_);
02493        _g_free0 (_data16_->hint_reply);
02494        _data16_->hint_reply = _tmp12_;
02495        g_main_loop_quit (_data16_->ml);
02496        _g_hash_table_unref0 (ht);
02497 }
02498 
02499 
02500 static void ___lambda30__gfunc (gconstpointer data, gpointer self) {
02501        __lambda30_ (self, data);
02502 }
02503 
02504 
02505 void main_test_lens_reply_hint (void) {
02506        Block16Data* _data16_;
02507        MainSignalWrapper** signals;
02508        gint signals_length1;
02509        gint _signals_size_;
02510        UnityScope* _tmp0_;
02511        GMainLoop* _tmp1_;
02512        MainSignalWrapper** _tmp2_;
02513        gint _tmp2__length1;
02514        UnityScope* _tmp3_;
02515        UnityScope* _tmp4_;
02516        gulong _tmp5_ = 0UL;
02517        MainSignalWrapper* _tmp6_;
02518        _data16_ = g_slice_new0 (Block16Data);
02519        _data16_->_ref_count_ = 1;
02520        signals = NULL;
02521        signals_length1 = 0;
02522        _signals_size_ = signals_length1;
02523        _tmp0_ = main_local_scope;
02524        _vala_assert (_tmp0_ != NULL, "local_scope != null");
02525        _data16_->got_search_changed = FALSE;
02526        _tmp1_ = g_main_loop_new (NULL, FALSE);
02527        _data16_->ml = _tmp1_;
02528        _tmp2_ = signals;
02529        _tmp2__length1 = signals_length1;
02530        _tmp3_ = main_local_scope;
02531        _tmp4_ = main_local_scope;
02532        _tmp5_ = g_signal_connect_data (_tmp4_, "search-changed", (GCallback) ___lambda28__unity_scope_search_changed, block16_data_ref (_data16_), (GClosureNotify) block16_data_unref, 0);
02533        _tmp6_ = main_signal_wrapper_new ((GObject*) _tmp3_, _tmp5_);
02534        _vala_array_add7 (&signals, &signals_length1, &_signals_size_, _tmp6_);
02535        _data16_->hint_reply = NULL;
02536        main_call_lens_search ("reply-hint", ___lambda30__gfunc, _data16_);
02537        main_run_with_timeout (_data16_->ml, (guint) 3000);
02538        _vala_assert (_data16_->got_search_changed == TRUE, "got_search_changed == true");
02539        _vala_assert (g_strcmp0 (_data16_->hint_reply, "value") == 0, "hint_reply == \"value\"");
02540        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
02541        block16_data_unref (_data16_);
02542        _data16_ = NULL;
02543 }
02544 
02545 
02546 static Block18Data* block18_data_ref (Block18Data* _data18_) {
02547        g_atomic_int_inc (&_data18_->_ref_count_);
02548        return _data18_;
02549 }
02550 
02551 
02552 static void block18_data_unref (void * _userdata_) {
02553        Block18Data* _data18_;
02554        _data18_ = (Block18Data*) _userdata_;
02555        if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
02556               _g_main_loop_unref0 (_data18_->ml);
02557               g_slice_free (Block18Data, _data18_);
02558        }
02559 }
02560 
02561 
02562 static gboolean __lambda31_ (Block18Data* _data18_) {
02563        gboolean result = FALSE;
02564        GMainLoop* _tmp0_;
02565        _tmp0_ = _data18_->ml;
02566        g_main_loop_quit (_tmp0_);
02567        result = FALSE;
02568        return result;
02569 }
02570 
02571 
02572 static gboolean ___lambda31__gsource_func (gpointer self) {
02573        gboolean result;
02574        result = __lambda31_ (self);
02575        return result;
02576 }
02577 
02578 
02579 static void __lambda32_ (UnityLensSearch* lens_search) {
02580        UnityLensSearch* _tmp0_;
02581        const gchar* _tmp1_;
02582        const gchar* _tmp2_;
02583        gboolean _tmp3_ = FALSE;
02584        UnityLensSearch* _tmp4_;
02585        g_return_if_fail (lens_search != NULL);
02586        _tmp0_ = lens_search;
02587        _tmp1_ = unity_lens_search_get_search_string (_tmp0_);
02588        _tmp2_ = _tmp1_;
02589        _tmp3_ = g_str_has_prefix (_tmp2_, "sources-test");
02590        _vala_assert (_tmp3_, "lens_search.search_string.has_prefix (\"sources-test\")");
02591        _tmp4_ = lens_search;
02592        g_signal_emit_by_name (_tmp4_, "finished");
02593 }
02594 
02595 
02596 static void ___lambda32__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
02597        __lambda32_ (search);
02598 }
02599 
02600 
02601 static void _vala_array_add8 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
02602        if ((*length) == (*size)) {
02603               *size = (*size) ? (2 * (*size)) : 4;
02604               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
02605        }
02606        (*array)[(*length)++] = value;
02607        (*array)[*length] = NULL;
02608 }
02609 
02610 
02611 static void __lambda33_ (Block18Data* _data18_) {
02612        GMainLoop* _tmp0_;
02613        _tmp0_ = _data18_->ml;
02614        g_main_loop_quit (_tmp0_);
02615 }
02616 
02617 
02618 static void ___lambda33__gfunc (gconstpointer data, gpointer self) {
02619        __lambda33_ (self);
02620 }
02621 
02622 
02623 static gboolean __lambda34_ (Block18Data* _data18_) {
02624        gboolean result = FALSE;
02625        GMainLoop* _tmp0_;
02626        _tmp0_ = _data18_->ml;
02627        g_main_loop_quit (_tmp0_);
02628        result = FALSE;
02629        return result;
02630 }
02631 
02632 
02633 static gboolean ___lambda34__gsource_func (gpointer self) {
02634        gboolean result;
02635        result = __lambda34_ (self);
02636        return result;
02637 }
02638 
02639 
02640 static gboolean __lambda35_ (Block18Data* _data18_) {
02641        gboolean result = FALSE;
02642        GMainLoop* _tmp0_;
02643        _tmp0_ = _data18_->ml;
02644        g_main_loop_quit (_tmp0_);
02645        result = FALSE;
02646        return result;
02647 }
02648 
02649 
02650 static gboolean ___lambda35__gsource_func (gpointer self) {
02651        gboolean result;
02652        result = __lambda35_ (self);
02653        return result;
02654 }
02655 
02656 
02657 static void __lambda36_ (Block18Data* _data18_) {
02658        GMainLoop* _tmp0_;
02659        _tmp0_ = _data18_->ml;
02660        g_main_loop_quit (_tmp0_);
02661 }
02662 
02663 
02664 static void ___lambda36__gfunc (gconstpointer data, gpointer self) {
02665        __lambda36_ (self);
02666 }
02667 
02668 
02669 static gboolean __lambda37_ (Block18Data* _data18_) {
02670        gboolean result = FALSE;
02671        GMainLoop* _tmp0_;
02672        _tmp0_ = _data18_->ml;
02673        g_main_loop_quit (_tmp0_);
02674        result = FALSE;
02675        return result;
02676 }
02677 
02678 
02679 static gboolean ___lambda37__gsource_func (gpointer self) {
02680        gboolean result;
02681        result = __lambda37_ (self);
02682        return result;
02683 }
02684 
02685 
02686 void main_test_lens_sources (void) {
02687        Block18Data* _data18_;
02688        MainSignalWrapper** signals;
02689        gint signals_length1;
02690        gint _signals_size_;
02691        UnityScope* _tmp0_;
02692        UnityScope* _tmp1_;
02693        UnityOptionsFilter* _tmp2_;
02694        UnityOptionsFilter* _tmp3_;
02695        UnityFilterOption* _tmp4_ = NULL;
02696        UnityFilterOption* _tmp5_;
02697        UnityScope* _tmp6_;
02698        UnityOptionsFilter* _tmp7_;
02699        UnityOptionsFilter* _tmp8_;
02700        UnityFilterOption* _tmp9_ = NULL;
02701        UnityFilterOption* _tmp10_;
02702        GMainLoop* _tmp11_;
02703        GMainLoop* _tmp12_;
02704        GMainLoop* _tmp13_;
02705        MainSignalWrapper** _tmp14_;
02706        gint _tmp14__length1;
02707        UnityScope* _tmp15_;
02708        UnityScope* _tmp16_;
02709        gulong _tmp17_ = 0UL;
02710        MainSignalWrapper* _tmp18_;
02711        GMainLoop* _tmp19_;
02712        GMainLoop* _tmp20_;
02713        GMainLoop* _tmp21_;
02714        gboolean found1;
02715        gboolean found2;
02716        gboolean remote1;
02717        gboolean remote2;
02718        UnityLens* _tmp22_;
02719        UnityOptionsFilter* _tmp23_ = NULL;
02720        GList* _tmp24_;
02721        gboolean _tmp52_;
02722        gboolean _tmp53_;
02723        gboolean _tmp54_;
02724        UnityScope* _tmp57_;
02725        UnityOptionsFilter* _tmp58_;
02726        UnityOptionsFilter* _tmp59_;
02727        GMainLoop* _tmp60_;
02728        GMainLoop* _tmp61_;
02729        GMainLoop* _tmp62_;
02730        GMainLoop* _tmp63_;
02731        GMainLoop* _tmp64_;
02732        GMainLoop* _tmp65_;
02733        UnityLens* _tmp66_;
02734        UnityOptionsFilter* _tmp67_ = NULL;
02735        GList* _tmp68_;
02736        gboolean _tmp96_;
02737        gboolean _tmp97_;
02738        gboolean _tmp98_;
02739        _data18_ = g_slice_new0 (Block18Data);
02740        _data18_->_ref_count_ = 1;
02741        signals = NULL;
02742        signals_length1 = 0;
02743        _signals_size_ = signals_length1;
02744        _tmp0_ = main_local_scope;
02745        _vala_assert (_tmp0_ != NULL, "local_scope != null");
02746        _tmp1_ = main_local_scope;
02747        _tmp2_ = unity_scope_get_sources (_tmp1_);
02748        _tmp3_ = _tmp2_;
02749        _tmp4_ = unity_options_filter_add_option (_tmp3_, "id1", "Source1", NULL);
02750        _tmp5_ = _tmp4_;
02751        _g_object_unref0 (_tmp5_);
02752        _tmp6_ = main_local_scope;
02753        _tmp7_ = unity_scope_get_sources (_tmp6_);
02754        _tmp8_ = _tmp7_;
02755        _tmp9_ = unity_options_filter_add_option (_tmp8_, "id2", "Source2", NULL);
02756        _tmp10_ = _tmp9_;
02757        _g_object_unref0 (_tmp10_);
02758        _tmp11_ = g_main_loop_new (NULL, FALSE);
02759        _data18_->ml = _tmp11_;
02760        g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda31__gsource_func, block18_data_ref (_data18_), block18_data_unref);
02761        _tmp12_ = _data18_->ml;
02762        g_main_loop_run (_tmp12_);
02763        _tmp13_ = g_main_loop_new (NULL, FALSE);
02764        _g_main_loop_unref0 (_data18_->ml);
02765        _data18_->ml = _tmp13_;
02766        _tmp14_ = signals;
02767        _tmp14__length1 = signals_length1;
02768        _tmp15_ = main_local_scope;
02769        _tmp16_ = main_local_scope;
02770        _tmp17_ = g_signal_connect (_tmp16_, "search-changed", (GCallback) ___lambda32__unity_scope_search_changed, NULL);
02771        _tmp18_ = main_signal_wrapper_new ((GObject*) _tmp15_, _tmp17_);
02772        _vala_array_add8 (&signals, &signals_length1, &_signals_size_, _tmp18_);
02773        main_call_lens_search ("sources-test", ___lambda33__gfunc, _data18_);
02774        _tmp19_ = _data18_->ml;
02775        g_main_loop_run (_tmp19_);
02776        _tmp20_ = g_main_loop_new (NULL, FALSE);
02777        _g_main_loop_unref0 (_data18_->ml);
02778        _data18_->ml = _tmp20_;
02779        g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda34__gsource_func, block18_data_ref (_data18_), block18_data_unref);
02780        _tmp21_ = _data18_->ml;
02781        g_main_loop_run (_tmp21_);
02782        found1 = FALSE;
02783        found2 = FALSE;
02784        remote1 = FALSE;
02785        remote2 = FALSE;
02786        _tmp22_ = main_exported_lens;
02787        _tmp23_ = unity_lens_get_sources_internal (_tmp22_);
02788        _tmp24_ = _tmp23_->options;
02789        {
02790               GList* filter_option_collection = NULL;
02791               GList* filter_option_it = NULL;
02792               filter_option_collection = _tmp24_;
02793               for (filter_option_it = filter_option_collection; filter_option_it != NULL; filter_option_it = filter_option_it->next) {
02794                      UnityFilterOption* _tmp25_;
02795                      UnityFilterOption* filter_option = NULL;
02796                      _tmp25_ = _g_object_ref0 ((UnityFilterOption*) filter_option_it->data);
02797                      filter_option = _tmp25_;
02798                      {
02799                             gboolean _tmp26_ = FALSE;
02800                             UnityFilterOption* _tmp27_;
02801                             const gchar* _tmp28_;
02802                             const gchar* _tmp29_;
02803                             gboolean _tmp30_ = FALSE;
02804                             gboolean _tmp34_;
02805                             _tmp27_ = filter_option;
02806                             _tmp28_ = unity_filter_option_get_id (_tmp27_);
02807                             _tmp29_ = _tmp28_;
02808                             _tmp30_ = g_str_has_suffix (_tmp29_, "id1");
02809                             if (_tmp30_) {
02810                                    UnityFilterOption* _tmp31_;
02811                                    const gchar* _tmp32_;
02812                                    const gchar* _tmp33_;
02813                                    _tmp31_ = filter_option;
02814                                    _tmp32_ = unity_filter_option_get_id (_tmp31_);
02815                                    _tmp33_ = _tmp32_;
02816                                    _tmp26_ = g_strcmp0 (_tmp33_, "id1") != 0;
02817                             } else {
02818                                    _tmp26_ = FALSE;
02819                             }
02820                             _tmp34_ = _tmp26_;
02821                             if (_tmp34_) {
02822                                    found1 = TRUE;
02823                             } else {
02824                                    gboolean _tmp35_ = FALSE;
02825                                    UnityFilterOption* _tmp36_;
02826                                    const gchar* _tmp37_;
02827                                    const gchar* _tmp38_;
02828                                    gboolean _tmp39_ = FALSE;
02829                                    gboolean _tmp43_;
02830                                    _tmp36_ = filter_option;
02831                                    _tmp37_ = unity_filter_option_get_id (_tmp36_);
02832                                    _tmp38_ = _tmp37_;
02833                                    _tmp39_ = g_str_has_suffix (_tmp38_, "id2");
02834                                    if (_tmp39_) {
02835                                           UnityFilterOption* _tmp40_;
02836                                           const gchar* _tmp41_;
02837                                           const gchar* _tmp42_;
02838                                           _tmp40_ = filter_option;
02839                                           _tmp41_ = unity_filter_option_get_id (_tmp40_);
02840                                           _tmp42_ = _tmp41_;
02841                                           _tmp35_ = g_strcmp0 (_tmp42_, "id2") != 0;
02842                                    } else {
02843                                           _tmp35_ = FALSE;
02844                                    }
02845                                    _tmp43_ = _tmp35_;
02846                                    if (_tmp43_) {
02847                                           found2 = TRUE;
02848                                    } else {
02849                                           UnityFilterOption* _tmp44_;
02850                                           const gchar* _tmp45_;
02851                                           const gchar* _tmp46_;
02852                                           gboolean _tmp47_ = FALSE;
02853                                           _tmp44_ = filter_option;
02854                                           _tmp45_ = unity_filter_option_get_id (_tmp44_);
02855                                           _tmp46_ = _tmp45_;
02856                                           _tmp47_ = g_str_has_suffix (_tmp46_, "id1-remote");
02857                                           if (_tmp47_) {
02858                                                  remote1 = TRUE;
02859                                           } else {
02860                                                  UnityFilterOption* _tmp48_;
02861                                                  const gchar* _tmp49_;
02862                                                  const gchar* _tmp50_;
02863                                                  gboolean _tmp51_ = FALSE;
02864                                                  _tmp48_ = filter_option;
02865                                                  _tmp49_ = unity_filter_option_get_id (_tmp48_);
02866                                                  _tmp50_ = _tmp49_;
02867                                                  _tmp51_ = g_str_has_suffix (_tmp50_, "id2-remote");
02868                                                  if (_tmp51_) {
02869                                                         remote2 = TRUE;
02870                                                  }
02871                                           }
02872                                    }
02873                             }
02874                             _g_object_unref0 (filter_option);
02875                      }
02876               }
02877        }
02878        _tmp52_ = found1;
02879        _vala_assert (_tmp52_, "found1");
02880        _tmp53_ = found2;
02881        _vala_assert (_tmp53_, "found2");
02882        _tmp54_ = main_remote_scope_test;
02883        if (_tmp54_) {
02884               gboolean _tmp55_;
02885               gboolean _tmp56_;
02886               _tmp55_ = remote1;
02887               _vala_assert (_tmp55_, "remote1");
02888               _tmp56_ = remote2;
02889               _vala_assert (_tmp56_, "remote2");
02890        }
02891        _tmp57_ = main_local_scope;
02892        _tmp58_ = unity_scope_get_sources (_tmp57_);
02893        _tmp59_ = _tmp58_;
02894        unity_options_filter_remove_option (_tmp59_, "id1");
02895        _tmp60_ = g_main_loop_new (NULL, FALSE);
02896        _g_main_loop_unref0 (_data18_->ml);
02897        _data18_->ml = _tmp60_;
02898        g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda35__gsource_func, block18_data_ref (_data18_), block18_data_unref);
02899        _tmp61_ = _data18_->ml;
02900        g_main_loop_run (_tmp61_);
02901        _tmp62_ = g_main_loop_new (NULL, FALSE);
02902        _g_main_loop_unref0 (_data18_->ml);
02903        _data18_->ml = _tmp62_;
02904        main_call_lens_search ("sources-test-2", ___lambda36__gfunc, _data18_);
02905        _tmp63_ = _data18_->ml;
02906        g_main_loop_run (_tmp63_);
02907        _tmp64_ = g_main_loop_new (NULL, FALSE);
02908        _g_main_loop_unref0 (_data18_->ml);
02909        _data18_->ml = _tmp64_;
02910        g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda37__gsource_func, block18_data_ref (_data18_), block18_data_unref);
02911        _tmp65_ = _data18_->ml;
02912        g_main_loop_run (_tmp65_);
02913        found1 = FALSE;
02914        found2 = FALSE;
02915        remote1 = FALSE;
02916        remote2 = FALSE;
02917        _tmp66_ = main_exported_lens;
02918        _tmp67_ = unity_lens_get_sources_internal (_tmp66_);
02919        _tmp68_ = _tmp67_->options;
02920        {
02921               GList* filter_option_collection = NULL;
02922               GList* filter_option_it = NULL;
02923               filter_option_collection = _tmp68_;
02924               for (filter_option_it = filter_option_collection; filter_option_it != NULL; filter_option_it = filter_option_it->next) {
02925                      UnityFilterOption* _tmp69_;
02926                      UnityFilterOption* filter_option = NULL;
02927                      _tmp69_ = _g_object_ref0 ((UnityFilterOption*) filter_option_it->data);
02928                      filter_option = _tmp69_;
02929                      {
02930                             gboolean _tmp70_ = FALSE;
02931                             UnityFilterOption* _tmp71_;
02932                             const gchar* _tmp72_;
02933                             const gchar* _tmp73_;
02934                             gboolean _tmp74_ = FALSE;
02935                             gboolean _tmp78_;
02936                             _tmp71_ = filter_option;
02937                             _tmp72_ = unity_filter_option_get_id (_tmp71_);
02938                             _tmp73_ = _tmp72_;
02939                             _tmp74_ = g_str_has_suffix (_tmp73_, "id1");
02940                             if (_tmp74_) {
02941                                    UnityFilterOption* _tmp75_;
02942                                    const gchar* _tmp76_;
02943                                    const gchar* _tmp77_;
02944                                    _tmp75_ = filter_option;
02945                                    _tmp76_ = unity_filter_option_get_id (_tmp75_);
02946                                    _tmp77_ = _tmp76_;
02947                                    _tmp70_ = g_strcmp0 (_tmp77_, "id1") != 0;
02948                             } else {
02949                                    _tmp70_ = FALSE;
02950                             }
02951                             _tmp78_ = _tmp70_;
02952                             if (_tmp78_) {
02953                                    found1 = TRUE;
02954                             } else {
02955                                    gboolean _tmp79_ = FALSE;
02956                                    UnityFilterOption* _tmp80_;
02957                                    const gchar* _tmp81_;
02958                                    const gchar* _tmp82_;
02959                                    gboolean _tmp83_ = FALSE;
02960                                    gboolean _tmp87_;
02961                                    _tmp80_ = filter_option;
02962                                    _tmp81_ = unity_filter_option_get_id (_tmp80_);
02963                                    _tmp82_ = _tmp81_;
02964                                    _tmp83_ = g_str_has_suffix (_tmp82_, "id2");
02965                                    if (_tmp83_) {
02966                                           UnityFilterOption* _tmp84_;
02967                                           const gchar* _tmp85_;
02968                                           const gchar* _tmp86_;
02969                                           _tmp84_ = filter_option;
02970                                           _tmp85_ = unity_filter_option_get_id (_tmp84_);
02971                                           _tmp86_ = _tmp85_;
02972                                           _tmp79_ = g_strcmp0 (_tmp86_, "id2") != 0;
02973                                    } else {
02974                                           _tmp79_ = FALSE;
02975                                    }
02976                                    _tmp87_ = _tmp79_;
02977                                    if (_tmp87_) {
02978                                           found2 = TRUE;
02979                                    } else {
02980                                           UnityFilterOption* _tmp88_;
02981                                           const gchar* _tmp89_;
02982                                           const gchar* _tmp90_;
02983                                           gboolean _tmp91_ = FALSE;
02984                                           _tmp88_ = filter_option;
02985                                           _tmp89_ = unity_filter_option_get_id (_tmp88_);
02986                                           _tmp90_ = _tmp89_;
02987                                           _tmp91_ = g_str_has_suffix (_tmp90_, "id1-remote");
02988                                           if (_tmp91_) {
02989                                                  remote1 = TRUE;
02990                                           } else {
02991                                                  UnityFilterOption* _tmp92_;
02992                                                  const gchar* _tmp93_;
02993                                                  const gchar* _tmp94_;
02994                                                  gboolean _tmp95_ = FALSE;
02995                                                  _tmp92_ = filter_option;
02996                                                  _tmp93_ = unity_filter_option_get_id (_tmp92_);
02997                                                  _tmp94_ = _tmp93_;
02998                                                  _tmp95_ = g_str_has_suffix (_tmp94_, "id2-remote");
02999                                                  if (_tmp95_) {
03000                                                         remote2 = TRUE;
03001                                                  }
03002                                           }
03003                                    }
03004                             }
03005                             _g_object_unref0 (filter_option);
03006                      }
03007               }
03008        }
03009        _tmp96_ = found1;
03010        _vala_assert (_tmp96_ == FALSE, "found1 == false");
03011        _tmp97_ = found2;
03012        _vala_assert (_tmp97_, "found2");
03013        _tmp98_ = main_remote_scope_test;
03014        if (_tmp98_) {
03015               gboolean _tmp99_;
03016               gboolean _tmp100_;
03017               _tmp99_ = remote1;
03018               _vala_assert (_tmp99_ == FALSE, "remote1 == false");
03019               _tmp100_ = remote2;
03020               _vala_assert (_tmp100_, "remote2");
03021        }
03022        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
03023        block18_data_unref (_data18_);
03024        _data18_ = NULL;
03025 }
03026 
03027 
03028 static Block19Data* block19_data_ref (Block19Data* _data19_) {
03029        g_atomic_int_inc (&_data19_->_ref_count_);
03030        return _data19_;
03031 }
03032 
03033 
03034 static void block19_data_unref (void * _userdata_) {
03035        Block19Data* _data19_;
03036        _data19_ = (Block19Data*) _userdata_;
03037        if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
03038               _g_main_loop_unref0 (_data19_->ml);
03039               g_slice_free (Block19Data, _data19_);
03040        }
03041 }
03042 
03043 
03044 static void __lambda38_ (UnityLensSearch* lens_search) {
03045        UnityLensSearch* _tmp0_;
03046        const gchar* _tmp1_;
03047        const gchar* _tmp2_;
03048        gboolean _tmp3_ = FALSE;
03049        UnityLensSearch* _tmp4_;
03050        DeeSerializableModel* _tmp5_;
03051        DeeSerializableModel* _tmp6_;
03052        DeeSerializableModel* _tmp7_;
03053        DeeSerializableModel* model;
03054        UnityLensSearch* _tmp8_;
03055        g_return_if_fail (lens_search != NULL);
03056        _tmp0_ = lens_search;
03057        _tmp1_ = unity_lens_search_get_search_string (_tmp0_);
03058        _tmp2_ = _tmp1_;
03059        _tmp3_ = g_str_has_prefix (_tmp2_, "activation-test");
03060        _vala_assert (_tmp3_, "lens_search.search_string.has_prefix (\"activation-test\")");
03061        _tmp4_ = lens_search;
03062        _tmp5_ = unity_lens_search_get_results_model (_tmp4_);
03063        _tmp6_ = _tmp5_;
03064        _tmp7_ = _g_object_ref0 (_tmp6_);
03065        model = _tmp7_;
03066        dee_model_clear ((DeeModel*) model);
03067        dee_model_append ((DeeModel*) model, "scheme://local/", "icon", 0, "mimetype", "display-name", "comment", "dnd-uri", NULL);
03068        _tmp8_ = lens_search;
03069        g_signal_emit_by_name (_tmp8_, "finished");
03070        _g_object_unref0 (model);
03071 }
03072 
03073 
03074 static void ___lambda38__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
03075        __lambda38_ (search);
03076 }
03077 
03078 
03079 static void _vala_array_add9 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
03080        if ((*length) == (*size)) {
03081               *size = (*size) ? (2 * (*size)) : 4;
03082               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
03083        }
03084        (*array)[(*length)++] = value;
03085        (*array)[*length] = NULL;
03086 }
03087 
03088 
03089 static GHashTable* _variant_get4 (GVariant* value) {
03090        GHashTable* _tmp4_;
03091        GVariantIter _tmp5_;
03092        GVariant* _tmp6_;
03093        GVariant* _tmp7_;
03094        _tmp4_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
03095        g_variant_iter_init (&_tmp5_, value);
03096        while (g_variant_iter_loop (&_tmp5_, "{?*}", &_tmp6_, &_tmp7_)) {
03097               g_hash_table_insert (_tmp4_, g_variant_dup_string (_tmp6_, NULL), g_variant_get_variant (_tmp7_));
03098        }
03099        return _tmp4_;
03100 }
03101 
03102 
03103 static void __lambda39_ (Block19Data* _data19_, GVariant* search_ret) {
03104        GVariant* _tmp0_;
03105        GVariant* _tmp1_ = NULL;
03106        GVariant* _tmp2_;
03107        GHashTable* _tmp3_;
03108        GHashTable* _tmp8_;
03109        GHashTable* ht;
03110        gconstpointer _tmp9_ = NULL;
03111        guint64 _tmp10_ = 0ULL;
03112        GMainLoop* _tmp11_;
03113        _tmp0_ = search_ret;
03114        _tmp1_ = g_variant_get_child_value (_tmp0_, (gsize) 0);
03115        _tmp2_ = _tmp1_;
03116        _tmp3_ = _variant_get4 (_tmp2_);
03117        _tmp8_ = _tmp3_;
03118        _g_variant_unref0 (_tmp2_);
03119        ht = _tmp8_;
03120        _tmp9_ = g_hash_table_lookup (ht, "model-seqnum");
03121        _tmp10_ = g_variant_get_uint64 ((GVariant*) _tmp9_);
03122        _data19_->seqnum = _tmp10_;
03123        _tmp11_ = _data19_->ml;
03124        g_main_loop_quit (_tmp11_);
03125        _g_hash_table_unref0 (ht);
03126 }
03127 
03128 
03129 static void ___lambda39__gfunc (gconstpointer data, gpointer self) {
03130        __lambda39_ (self, data);
03131 }
03132 
03133 
03134 static UnityActivationResponse* __lambda40_ (Block19Data* _data19_, const gchar* uri) {
03135        UnityActivationResponse* result = NULL;
03136        const gchar* _tmp0_;
03137        g_return_val_if_fail (uri != NULL, NULL);
03138        _tmp0_ = uri;
03139        _vala_assert (g_strcmp0 (_tmp0_, "scheme://local/") == 0, "uri == \"scheme://local/\"");
03140        _data19_->got_activate_uri_signal = TRUE;
03141        result = NULL;
03142        return result;
03143 }
03144 
03145 
03146 static UnityActivationResponse* ___lambda40__unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self) {
03147        UnityActivationResponse* result;
03148        result = __lambda40_ (self, uri);
03149        return result;
03150 }
03151 
03152 
03153 static void _vala_array_add10 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
03154        if ((*length) == (*size)) {
03155               *size = (*size) ? (2 * (*size)) : 4;
03156               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
03157        }
03158        (*array)[(*length)++] = value;
03159        (*array)[*length] = NULL;
03160 }
03161 
03162 
03163 static void __lambda41_ (Block19Data* _data19_) {
03164        GMainLoop* _tmp0_;
03165        _tmp0_ = _data19_->ml;
03166        g_main_loop_quit (_tmp0_);
03167 }
03168 
03169 
03170 static void ___lambda41__gfunc (gconstpointer data, gpointer self) {
03171        __lambda41_ (self);
03172 }
03173 
03174 
03175 void main_test_lens_activation (void) {
03176        Block19Data* _data19_;
03177        MainSignalWrapper** signals;
03178        gint signals_length1;
03179        gint _signals_size_;
03180        UnityScope* _tmp0_;
03181        GMainLoop* _tmp1_;
03182        MainSignalWrapper** _tmp2_;
03183        gint _tmp2__length1;
03184        UnityScope* _tmp3_;
03185        UnityScope* _tmp4_;
03186        gulong _tmp5_ = 0UL;
03187        MainSignalWrapper* _tmp6_;
03188        GMainLoop* _tmp7_;
03189        UnityLens* _tmp8_;
03190        DeeModel* _tmp9_ = NULL;
03191        DeeSharedModel* _tmp10_;
03192        DeeSharedModel* lens_results_model;
03193        DeeModelIter* _tmp11_ = NULL;
03194        DeeModelIter* iter;
03195        const gchar* _tmp12_ = NULL;
03196        gchar* _tmp13_;
03197        gchar* mangled_uri;
03198        MainSignalWrapper** _tmp14_;
03199        gint _tmp14__length1;
03200        UnityScope* _tmp15_;
03201        UnityScope* _tmp16_;
03202        gulong _tmp17_ = 0UL;
03203        MainSignalWrapper* _tmp18_;
03204        GMainLoop* _tmp19_;
03205        GMainLoop* _tmp20_;
03206        _data19_ = g_slice_new0 (Block19Data);
03207        _data19_->_ref_count_ = 1;
03208        signals = NULL;
03209        signals_length1 = 0;
03210        _signals_size_ = signals_length1;
03211        _tmp0_ = main_local_scope;
03212        _vala_assert (_tmp0_ != NULL, "local_scope != null");
03213        _tmp1_ = g_main_loop_new (NULL, FALSE);
03214        _data19_->ml = _tmp1_;
03215        _tmp2_ = signals;
03216        _tmp2__length1 = signals_length1;
03217        _tmp3_ = main_local_scope;
03218        _tmp4_ = main_local_scope;
03219        _tmp5_ = g_signal_connect (_tmp4_, "search-changed", (GCallback) ___lambda38__unity_scope_search_changed, NULL);
03220        _tmp6_ = main_signal_wrapper_new ((GObject*) _tmp3_, _tmp5_);
03221        _vala_array_add9 (&signals, &signals_length1, &_signals_size_, _tmp6_);
03222        _data19_->seqnum = (guint64) 0;
03223        main_call_lens_search ("activation-test", ___lambda39__gfunc, _data19_);
03224        _tmp7_ = _data19_->ml;
03225        main_run_with_timeout (_tmp7_, (guint) 5000);
03226        _tmp8_ = main_exported_lens;
03227        _tmp9_ = unity_lens_get_model_internal (_tmp8_, 0);
03228        _tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, dee_shared_model_get_type ()) ? ((DeeSharedModel*) _tmp9_) : NULL);
03229        lens_results_model = _tmp10_;
03230        _tmp11_ = dee_model_get_first_iter ((DeeModel*) lens_results_model);
03231        iter = _tmp11_;
03232        _tmp12_ = dee_model_get_string ((DeeModel*) lens_results_model, iter, (guint) 0);
03233        _tmp13_ = g_strdup (_tmp12_);
03234        mangled_uri = _tmp13_;
03235        _data19_->got_activate_uri_signal = FALSE;
03236        _tmp14_ = signals;
03237        _tmp14__length1 = signals_length1;
03238        _tmp15_ = main_local_scope;
03239        _tmp16_ = main_local_scope;
03240        _tmp17_ = g_signal_connect_data (_tmp16_, "activate-uri", (GCallback) ___lambda40__unity_scope_activate_uri, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
03241        _tmp18_ = main_signal_wrapper_new ((GObject*) _tmp15_, _tmp17_);
03242        _vala_array_add10 (&signals, &signals_length1, &_signals_size_, _tmp18_);
03243        _tmp19_ = g_main_loop_new (NULL, FALSE);
03244        _g_main_loop_unref0 (_data19_->ml);
03245        _data19_->ml = _tmp19_;
03246        main_call_lens_activate (mangled_uri, (guint) 0, ___lambda41__gfunc, _data19_);
03247        _tmp20_ = _data19_->ml;
03248        main_run_with_timeout (_tmp20_, (guint) 5000);
03249        _vala_assert (_data19_->got_activate_uri_signal, "got_activate_uri_signal");
03250        _g_free0 (mangled_uri);
03251        _g_object_unref0 (lens_results_model);
03252        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
03253        block19_data_unref (_data19_);
03254        _data19_ = NULL;
03255 }
03256 
03257 
03258 static Block20Data* block20_data_ref (Block20Data* _data20_) {
03259        g_atomic_int_inc (&_data20_->_ref_count_);
03260        return _data20_;
03261 }
03262 
03263 
03264 static void block20_data_unref (void * _userdata_) {
03265        Block20Data* _data20_;
03266        _data20_ = (Block20Data*) _userdata_;
03267        if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
03268               _g_object_unref0 (_data20_->reconstructed);
03269               _g_object_unref0 (_data20_->action);
03270               _g_main_loop_unref0 (_data20_->ml);
03271               g_slice_free (Block20Data, _data20_);
03272        }
03273 }
03274 
03275 
03276 static UnityActivationResponse* __lambda42_ (Block20Data* _data20_, const gchar* uri) {
03277        UnityActivationResponse* result = NULL;
03278        g_return_val_if_fail (uri != NULL, NULL);
03279        _data20_->got_activate_uri_signal = TRUE;
03280        result = NULL;
03281        return result;
03282 }
03283 
03284 
03285 static UnityActivationResponse* ___lambda42__unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self) {
03286        UnityActivationResponse* result;
03287        result = __lambda42_ (self, uri);
03288        return result;
03289 }
03290 
03291 
03292 static void _vala_array_add11 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
03293        if ((*length) == (*size)) {
03294               *size = (*size) ? (2 * (*size)) : 4;
03295               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
03296        }
03297        (*array)[(*length)++] = value;
03298        (*array)[*length] = NULL;
03299 }
03300 
03301 
03302 static UnityPreview* __lambda43_ (Block20Data* _data20_, const gchar* uri) {
03303        UnityPreview* result = NULL;
03304        const gchar* _tmp0_;
03305        UnityGenericPreview* _tmp1_;
03306        UnityGenericPreview* p;
03307        UnityPreviewAction* _tmp2_;
03308        g_return_val_if_fail (uri != NULL, NULL);
03309        _tmp0_ = uri;
03310        _vala_assert (g_strcmp0 (_tmp0_, "scheme://local/") == 0, "uri == \"scheme://local/\"");
03311        _data20_->got_preview_uri_signal = TRUE;
03312        _tmp1_ = unity_generic_preview_new ("An item", "description", NULL);
03313        p = _tmp1_;
03314        _tmp2_ = unity_preview_action_new ("button1", "Do stuff!", NULL);
03315        _g_object_unref0 (_data20_->action);
03316        _data20_->action = _tmp2_;
03317        unity_preview_add_action ((UnityPreview*) p, _data20_->action);
03318        result = (UnityPreview*) p;
03319        return result;
03320 }
03321 
03322 
03323 static UnityPreview* ___lambda43__unity_scope_preview_uri (UnityScope* _sender, const gchar* uri, gpointer self) {
03324        UnityPreview* result;
03325        result = __lambda43_ (self, uri);
03326        return result;
03327 }
03328 
03329 
03330 static void _vala_array_add12 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
03331        if ((*length) == (*size)) {
03332               *size = (*size) ? (2 * (*size)) : 4;
03333               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
03334        }
03335        (*array)[(*length)++] = value;
03336        (*array)[*length] = NULL;
03337 }
03338 
03339 
03340 static void _variant_get5 (GVariant* value, UnityProtocolActivationReplyRaw* result) {
03341        UnityProtocolActivationReplyRaw _tmp3_;
03342        GVariantIter _tmp4_;
03343        GVariant* _tmp5_;
03344        GVariant* _tmp6_;
03345        GVariant* _tmp7_;
03346        GHashTable* _tmp8_;
03347        GVariantIter _tmp9_;
03348        GVariant* _tmp10_;
03349        GVariant* _tmp11_;
03350        g_variant_iter_init (&_tmp4_, value);
03351        _tmp5_ = g_variant_iter_next_value (&_tmp4_);
03352        _tmp3_.uri = g_variant_dup_string (_tmp5_, NULL);
03353        g_variant_unref (_tmp5_);
03354        _tmp6_ = g_variant_iter_next_value (&_tmp4_);
03355        _tmp3_.handled = g_variant_get_uint32 (_tmp6_);
03356        g_variant_unref (_tmp6_);
03357        _tmp7_ = g_variant_iter_next_value (&_tmp4_);
03358        _tmp8_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
03359        g_variant_iter_init (&_tmp9_, _tmp7_);
03360        while (g_variant_iter_loop (&_tmp9_, "{?*}", &_tmp10_, &_tmp11_)) {
03361               g_hash_table_insert (_tmp8_, g_variant_dup_string (_tmp10_, NULL), g_variant_get_variant (_tmp11_));
03362        }
03363        _tmp3_.hints = _tmp8_;
03364        g_variant_unref (_tmp7_);
03365        *result = _tmp3_;
03366 }
03367 
03368 
03369 static void __lambda44_ (Block20Data* _data20_, GVariant* reply) {
03370        GVariant* _tmp0_;
03371        GVariant* _tmp1_ = NULL;
03372        GVariant* v;
03373        UnityProtocolActivationReplyRaw _tmp2_;
03374        UnityProtocolActivationReplyRaw reply_struct;
03375        UnityProtocolActivationReplyRaw _tmp12_;
03376        GHashTable* _tmp13_;
03377        gconstpointer _tmp14_ = NULL;
03378        UnityProtocolPreview* _tmp15_ = NULL;
03379        GMainLoop* _tmp16_;
03380        _tmp0_ = reply;
03381        _tmp1_ = g_variant_get_child_value (_tmp0_, (gsize) 0);
03382        v = _tmp1_;
03383        _variant_get5 (v, &_tmp2_);
03384        reply_struct = _tmp2_;
03385        _tmp12_ = reply_struct;
03386        _tmp13_ = _tmp12_.hints;
03387        _tmp14_ = g_hash_table_lookup (_tmp13_, "preview");
03388        _tmp15_ = unity_protocol_preview_parse ((GVariant*) _tmp14_);
03389        _g_object_unref0 (_data20_->reconstructed);
03390        _data20_->reconstructed = _tmp15_;
03391        _tmp16_ = _data20_->ml;
03392        g_main_loop_quit (_tmp16_);
03393        unity_protocol_activation_reply_raw_destroy (&reply_struct);
03394        _g_variant_unref0 (v);
03395 }
03396 
03397 
03398 static void ___lambda44__gfunc (gconstpointer data, gpointer self) {
03399        __lambda44_ (self, data);
03400 }
03401 
03402 
03403 static UnityActivationResponse* __lambda45_ (Block20Data* _data20_) {
03404        UnityActivationResponse* result = NULL;
03405        UnityActivationResponse* _tmp0_;
03406        _data20_->got_action_activated_signal = TRUE;
03407        _tmp0_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
03408        g_object_ref_sink (_tmp0_);
03409        result = _tmp0_;
03410        return result;
03411 }
03412 
03413 
03414 static UnityActivationResponse* ___lambda45__unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self) {
03415        UnityActivationResponse* result;
03416        result = __lambda45_ (self);
03417        return result;
03418 }
03419 
03420 
03421 static void __lambda46_ (Block20Data* _data20_, GVariant* reply) {
03422        GMainLoop* _tmp0_;
03423        _tmp0_ = _data20_->ml;
03424        g_main_loop_quit (_tmp0_);
03425 }
03426 
03427 
03428 static void ___lambda46__gfunc (gconstpointer data, gpointer self) {
03429        __lambda46_ (self, data);
03430 }
03431 
03432 
03433 void main_test_lens_preview (void) {
03434        Block20Data* _data20_;
03435        MainSignalWrapper** signals;
03436        gint signals_length1;
03437        gint _signals_size_;
03438        UnityScope* _tmp0_;
03439        GMainLoop* _tmp1_;
03440        UnityLens* _tmp2_;
03441        DeeModel* _tmp3_ = NULL;
03442        DeeSharedModel* _tmp4_;
03443        DeeSharedModel* lens_results_model;
03444        DeeModelIter* _tmp5_ = NULL;
03445        DeeModelIter* iter;
03446        const gchar* _tmp6_ = NULL;
03447        gchar* _tmp7_;
03448        gchar* mangled_uri;
03449        MainSignalWrapper** _tmp8_;
03450        gint _tmp8__length1;
03451        UnityScope* _tmp9_;
03452        UnityScope* _tmp10_;
03453        gulong _tmp11_ = 0UL;
03454        MainSignalWrapper* _tmp12_;
03455        MainSignalWrapper** _tmp13_;
03456        gint _tmp13__length1;
03457        UnityScope* _tmp14_;
03458        UnityScope* _tmp15_;
03459        gulong _tmp16_ = 0UL;
03460        MainSignalWrapper* _tmp17_;
03461        GMainLoop* _tmp18_;
03462        GMainLoop* _tmp19_;
03463        GMainLoop* _tmp20_;
03464        const gchar* _tmp21_;
03465        const gchar* _tmp22_;
03466        gchar* _tmp23_ = NULL;
03467        gchar* _tmp24_;
03468        GMainLoop* _tmp25_;
03469        _data20_ = g_slice_new0 (Block20Data);
03470        _data20_->_ref_count_ = 1;
03471        signals = NULL;
03472        signals_length1 = 0;
03473        _signals_size_ = signals_length1;
03474        _tmp0_ = main_local_scope;
03475        _vala_assert (_tmp0_ != NULL, "local_scope != null");
03476        _tmp1_ = g_main_loop_new (NULL, FALSE);
03477        _data20_->ml = _tmp1_;
03478        _tmp2_ = main_exported_lens;
03479        _tmp3_ = unity_lens_get_model_internal (_tmp2_, 0);
03480        _tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, dee_shared_model_get_type ()) ? ((DeeSharedModel*) _tmp3_) : NULL);
03481        lens_results_model = _tmp4_;
03482        _tmp5_ = dee_model_get_first_iter ((DeeModel*) lens_results_model);
03483        iter = _tmp5_;
03484        _tmp6_ = dee_model_get_string ((DeeModel*) lens_results_model, iter, (guint) 0);
03485        _tmp7_ = g_strdup (_tmp6_);
03486        mangled_uri = _tmp7_;
03487        _data20_->got_activate_uri_signal = FALSE;
03488        _data20_->got_preview_uri_signal = FALSE;
03489        _data20_->action = NULL;
03490        _tmp8_ = signals;
03491        _tmp8__length1 = signals_length1;
03492        _tmp9_ = main_local_scope;
03493        _tmp10_ = main_local_scope;
03494        _tmp11_ = g_signal_connect_data (_tmp10_, "activate-uri", (GCallback) ___lambda42__unity_scope_activate_uri, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
03495        _tmp12_ = main_signal_wrapper_new ((GObject*) _tmp9_, _tmp11_);
03496        _vala_array_add11 (&signals, &signals_length1, &_signals_size_, _tmp12_);
03497        _tmp13_ = signals;
03498        _tmp13__length1 = signals_length1;
03499        _tmp14_ = main_local_scope;
03500        _tmp15_ = main_local_scope;
03501        _tmp16_ = g_signal_connect_data (_tmp15_, "preview-uri", (GCallback) ___lambda43__unity_scope_preview_uri, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
03502        _tmp17_ = main_signal_wrapper_new ((GObject*) _tmp14_, _tmp16_);
03503        _vala_array_add12 (&signals, &signals_length1, &_signals_size_, _tmp17_);
03504        _tmp18_ = g_main_loop_new (NULL, FALSE);
03505        _g_main_loop_unref0 (_data20_->ml);
03506        _data20_->ml = _tmp18_;
03507        _data20_->reconstructed = NULL;
03508        main_call_lens_activate (mangled_uri, (guint) 1, ___lambda44__gfunc, _data20_);
03509        _tmp19_ = _data20_->ml;
03510        main_run_with_timeout (_tmp19_, (guint) 5000);
03511        _vala_assert (_data20_->reconstructed != NULL, "reconstructed != null");
03512        _vala_assert (_data20_->action != NULL, "action != null");
03513        _vala_assert (_data20_->got_preview_uri_signal, "got_preview_uri_signal");
03514        _vala_assert (!_data20_->got_activate_uri_signal, "!got_activate_uri_signal");
03515        _data20_->got_action_activated_signal = FALSE;
03516        g_signal_connect_data (_data20_->action, "activated", (GCallback) ___lambda45__unity_preview_action_activated, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
03517        _tmp20_ = g_main_loop_new (NULL, FALSE);
03518        _g_main_loop_unref0 (_data20_->ml);
03519        _data20_->ml = _tmp20_;
03520        _tmp21_ = unity_preview_action_get_id (_data20_->action);
03521        _tmp22_ = _tmp21_;
03522        _tmp23_ = g_strdup_printf ("%s:%s", _tmp22_, mangled_uri);
03523        _tmp24_ = _tmp23_;
03524        main_call_lens_activate (_tmp24_, (guint) 2, ___lambda46__gfunc, _data20_);
03525        _g_free0 (_tmp24_);
03526        _tmp25_ = _data20_->ml;
03527        main_run_with_timeout (_tmp25_, (guint) 5000);
03528        _vala_assert (_data20_->got_action_activated_signal, "got_action_activated_signal");
03529        _g_free0 (mangled_uri);
03530        _g_object_unref0 (lens_results_model);
03531        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
03532        block20_data_unref (_data20_);
03533        _data20_ = NULL;
03534 }
03535 
03536 
03537 static Block21Data* block21_data_ref (Block21Data* _data21_) {
03538        g_atomic_int_inc (&_data21_->_ref_count_);
03539        return _data21_;
03540 }
03541 
03542 
03543 static void block21_data_unref (void * _userdata_) {
03544        Block21Data* _data21_;
03545        _data21_ = (Block21Data*) _userdata_;
03546        if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
03547               _g_object_unref0 (_data21_->gp_reconstructed);
03548               _g_object_unref0 (_data21_->sp_reconstructed);
03549               _g_object_unref0 (_data21_->series_preview);
03550               _g_free0 (_data21_->request_item_signal_uri);
03551               _g_main_loop_unref0 (_data21_->ml);
03552               g_slice_free (Block21Data, _data21_);
03553        }
03554 }
03555 
03556 
03557 static UnityActivationResponse* __lambda47_ (Block21Data* _data21_, const gchar* uri) {
03558        UnityActivationResponse* result = NULL;
03559        g_return_val_if_fail (uri != NULL, NULL);
03560        _data21_->got_activate_uri_signal = TRUE;
03561        result = NULL;
03562        return result;
03563 }
03564 
03565 
03566 static UnityActivationResponse* ___lambda47__unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self) {
03567        UnityActivationResponse* result;
03568        result = __lambda47_ (self, uri);
03569        return result;
03570 }
03571 
03572 
03573 static void _vala_array_add13 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
03574        if ((*length) == (*size)) {
03575               *size = (*size) ? (2 * (*size)) : 4;
03576               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
03577        }
03578        (*array)[(*length)++] = value;
03579        (*array)[*length] = NULL;
03580 }
03581 
03582 
03583 static UnityPreview* __lambda48_ (Block21Data* _data21_, const gchar* uri) {
03584        UnityPreview* result = NULL;
03585        gint _tmp0_;
03586        const gchar* _tmp1_;
03587        gchar* _tmp2_;
03588        UnityGenericPreview* _tmp3_;
03589        g_return_val_if_fail (uri != NULL, NULL);
03590        _tmp0_ = _data21_->request_item_signal_count;
03591        _data21_->request_item_signal_count = _tmp0_ + 1;
03592        _tmp1_ = uri;
03593        _tmp2_ = g_strdup (_tmp1_);
03594        _g_free0 (_data21_->request_item_signal_uri);
03595        _data21_->request_item_signal_uri = _tmp2_;
03596        _tmp3_ = unity_generic_preview_new ("child preview", "this is a child preview", NULL);
03597        result = (UnityPreview*) _tmp3_;
03598        return result;
03599 }
03600 
03601 
03602 static UnityPreview* ___lambda48__unity_series_preview_request_item_preview (UnitySeriesPreview* _sender, const gchar* uri, gpointer self) {
03603        UnityPreview* result;
03604        result = __lambda48_ (self, uri);
03605        return result;
03606 }
03607 
03608 
03609 static void _vala_array_add14 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
03610        if ((*length) == (*size)) {
03611               *size = (*size) ? (2 * (*size)) : 4;
03612               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
03613        }
03614        (*array)[(*length)++] = value;
03615        (*array)[*length] = NULL;
03616 }
03617 
03618 
03619 static UnityPreview* __lambda49_ (Block21Data* _data21_, const gchar* uri) {
03620        UnityPreview* result = NULL;
03621        const gchar* _tmp0_;
03622        UnityPreview* _tmp1_;
03623        g_return_val_if_fail (uri != NULL, NULL);
03624        _tmp0_ = uri;
03625        _vala_assert (g_strcmp0 (_tmp0_, "scheme://local/") == 0, "uri == \"scheme://local/\"");
03626        _data21_->got_preview_uri_signal = TRUE;
03627        _tmp1_ = _g_object_ref0 ((UnityPreview*) _data21_->series_preview);
03628        result = _tmp1_;
03629        return result;
03630 }
03631 
03632 
03633 static UnityPreview* ___lambda49__unity_scope_preview_uri (UnityScope* _sender, const gchar* uri, gpointer self) {
03634        UnityPreview* result;
03635        result = __lambda49_ (self, uri);
03636        return result;
03637 }
03638 
03639 
03640 static void _vala_array_add15 (MainSignalWrapper*** array, int* length, int* size, MainSignalWrapper* value) {
03641        if ((*length) == (*size)) {
03642               *size = (*size) ? (2 * (*size)) : 4;
03643               *array = g_renew (MainSignalWrapper*, *array, (*size) + 1);
03644        }
03645        (*array)[(*length)++] = value;
03646        (*array)[*length] = NULL;
03647 }
03648 
03649 
03650 static void _variant_get6 (GVariant* value, UnityProtocolActivationReplyRaw* result) {
03651        UnityProtocolActivationReplyRaw _tmp3_;
03652        GVariantIter _tmp4_;
03653        GVariant* _tmp5_;
03654        GVariant* _tmp6_;
03655        GVariant* _tmp7_;
03656        GHashTable* _tmp8_;
03657        GVariantIter _tmp9_;
03658        GVariant* _tmp10_;
03659        GVariant* _tmp11_;
03660        g_variant_iter_init (&_tmp4_, value);
03661        _tmp5_ = g_variant_iter_next_value (&_tmp4_);
03662        _tmp3_.uri = g_variant_dup_string (_tmp5_, NULL);
03663        g_variant_unref (_tmp5_);
03664        _tmp6_ = g_variant_iter_next_value (&_tmp4_);
03665        _tmp3_.handled = g_variant_get_uint32 (_tmp6_);
03666        g_variant_unref (_tmp6_);
03667        _tmp7_ = g_variant_iter_next_value (&_tmp4_);
03668        _tmp8_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
03669        g_variant_iter_init (&_tmp9_, _tmp7_);
03670        while (g_variant_iter_loop (&_tmp9_, "{?*}", &_tmp10_, &_tmp11_)) {
03671               g_hash_table_insert (_tmp8_, g_variant_dup_string (_tmp10_, NULL), g_variant_get_variant (_tmp11_));
03672        }
03673        _tmp3_.hints = _tmp8_;
03674        g_variant_unref (_tmp7_);
03675        *result = _tmp3_;
03676 }
03677 
03678 
03679 static void __lambda50_ (Block21Data* _data21_, GVariant* reply) {
03680        GVariant* _tmp0_;
03681        GVariant* _tmp1_ = NULL;
03682        GVariant* v;
03683        UnityProtocolActivationReplyRaw _tmp2_;
03684        UnityProtocolActivationReplyRaw reply_struct;
03685        UnityProtocolActivationReplyRaw _tmp12_;
03686        GHashTable* _tmp13_;
03687        gconstpointer _tmp14_ = NULL;
03688        UnityProtocolPreview* _tmp15_ = NULL;
03689        GMainLoop* _tmp16_;
03690        _tmp0_ = reply;
03691        _tmp1_ = g_variant_get_child_value (_tmp0_, (gsize) 0);
03692        v = _tmp1_;
03693        _variant_get6 (v, &_tmp2_);
03694        reply_struct = _tmp2_;
03695        _tmp12_ = reply_struct;
03696        _tmp13_ = _tmp12_.hints;
03697        _tmp14_ = g_hash_table_lookup (_tmp13_, "preview");
03698        _tmp15_ = unity_protocol_preview_parse ((GVariant*) _tmp14_);
03699        _g_object_unref0 (_data21_->sp_reconstructed);
03700        _data21_->sp_reconstructed = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, UNITY_PROTOCOL_TYPE_SERIES_PREVIEW, UnityProtocolSeriesPreview);
03701        _tmp16_ = _data21_->ml;
03702        g_main_loop_quit (_tmp16_);
03703        unity_protocol_activation_reply_raw_destroy (&reply_struct);
03704        _g_variant_unref0 (v);
03705 }
03706 
03707 
03708 static void ___lambda50__gfunc (gconstpointer data, gpointer self) {
03709        __lambda50_ (self, data);
03710 }
03711 
03712 
03713 static GHashTable* _variant_get7 (GVariant* value) {
03714        GHashTable* _tmp4_;
03715        GVariantIter _tmp5_;
03716        GVariant* _tmp6_;
03717        GVariant* _tmp7_;
03718        _tmp4_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
03719        g_variant_iter_init (&_tmp5_, value);
03720        while (g_variant_iter_loop (&_tmp5_, "{?*}", &_tmp6_, &_tmp7_)) {
03721               g_hash_table_insert (_tmp4_, g_variant_dup_string (_tmp6_, NULL), g_variant_get_variant (_tmp7_));
03722        }
03723        return _tmp4_;
03724 }
03725 
03726 
03727 static void __lambda51_ (Block21Data* _data21_, GVariant* reply) {
03728        GVariant* _tmp0_;
03729        GVariant* _tmp1_ = NULL;
03730        GVariant* _tmp2_;
03731        GHashTable* _tmp3_;
03732        GHashTable* _tmp8_;
03733        GHashTable* ht;
03734        gboolean _tmp9_ = FALSE;
03735        gconstpointer _tmp10_ = NULL;
03736        UnityProtocolPreview* _tmp11_ = NULL;
03737        GMainLoop* _tmp12_;
03738        _tmp0_ = reply;
03739        _tmp1_ = g_variant_get_child_value (_tmp0_, (gsize) 0);
03740        _tmp2_ = _tmp1_;
03741        _tmp3_ = _variant_get7 (_tmp2_);
03742        _tmp8_ = _tmp3_;
03743        _g_variant_unref0 (_tmp2_);
03744        ht = _tmp8_;
03745        _tmp9_ = g_hash_table_contains (ht, "preview");
03746        _vala_assert (_tmp9_, "ht.contains(\"preview\")");
03747        _tmp10_ = g_hash_table_lookup (ht, "preview");
03748        _tmp11_ = unity_protocol_preview_parse ((GVariant*) _tmp10_);
03749        _g_object_unref0 (_data21_->gp_reconstructed);
03750        _data21_->gp_reconstructed = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, UNITY_PROTOCOL_TYPE_GENERIC_PREVIEW, UnityProtocolGenericPreview);
03751        _tmp12_ = _data21_->ml;
03752        g_main_loop_quit (_tmp12_);
03753        _g_hash_table_unref0 (ht);
03754 }
03755 
03756 
03757 static void ___lambda51__gfunc (gconstpointer data, gpointer self) {
03758        __lambda51_ (self, data);
03759 }
03760 
03761 
03762 static GHashTable* _variant_get8 (GVariant* value) {
03763        GHashTable* _tmp51_;
03764        GVariantIter _tmp52_;
03765        GVariant* _tmp53_;
03766        GVariant* _tmp54_;
03767        _tmp51_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
03768        g_variant_iter_init (&_tmp52_, value);
03769        while (g_variant_iter_loop (&_tmp52_, "{?*}", &_tmp53_, &_tmp54_)) {
03770               g_hash_table_insert (_tmp51_, g_variant_dup_string (_tmp53_, NULL), g_variant_get_variant (_tmp54_));
03771        }
03772        return _tmp51_;
03773 }
03774 
03775 
03776 static GHashTable* _variant_get9 (GVariant* value) {
03777        GHashTable* _tmp4_;
03778        GVariantIter _tmp5_;
03779        GVariant* _tmp6_;
03780        GVariant* _tmp7_;
03781        _tmp4_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
03782        g_variant_iter_init (&_tmp5_, value);
03783        while (g_variant_iter_loop (&_tmp5_, "{?*}", &_tmp6_, &_tmp7_)) {
03784               g_hash_table_insert (_tmp4_, g_variant_dup_string (_tmp6_, NULL), g_variant_get_variant (_tmp7_));
03785        }
03786        return _tmp4_;
03787 }
03788 
03789 
03790 static void __lambda52_ (Block21Data* _data21_, GVariant* reply) {
03791        GVariant* _tmp0_;
03792        GVariant* _tmp1_ = NULL;
03793        GVariant* _tmp2_;
03794        GHashTable* _tmp3_;
03795        GHashTable* _tmp8_;
03796        GHashTable* ht;
03797        gboolean _tmp9_ = FALSE;
03798        gconstpointer _tmp10_ = NULL;
03799        UnityProtocolPreview* _tmp11_ = NULL;
03800        GMainLoop* _tmp12_;
03801        _tmp0_ = reply;
03802        _tmp1_ = g_variant_get_child_value (_tmp0_, (gsize) 0);
03803        _tmp2_ = _tmp1_;
03804        _tmp3_ = _variant_get9 (_tmp2_);
03805        _tmp8_ = _tmp3_;
03806        _g_variant_unref0 (_tmp2_);
03807        ht = _tmp8_;
03808        _tmp9_ = g_hash_table_contains (ht, "preview");
03809        _vala_assert (_tmp9_ == TRUE, "ht.contains(\"preview\") == true");
03810        _tmp10_ = g_hash_table_lookup (ht, "preview");
03811        _tmp11_ = unity_protocol_preview_parse ((GVariant*) _tmp10_);
03812        _g_object_unref0 (_data21_->gp_reconstructed);
03813        _data21_->gp_reconstructed = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, UNITY_PROTOCOL_TYPE_GENERIC_PREVIEW, UnityProtocolGenericPreview);
03814        _tmp12_ = _data21_->ml;
03815        g_main_loop_quit (_tmp12_);
03816        _g_hash_table_unref0 (ht);
03817 }
03818 
03819 
03820 static void ___lambda52__gfunc (gconstpointer data, gpointer self) {
03821        __lambda52_ (self, data);
03822 }
03823 
03824 
03825 void main_test_lens_preview_signal (void) {
03826        Block21Data* _data21_;
03827        MainSignalWrapper** signals;
03828        gint signals_length1;
03829        gint _signals_size_;
03830        UnityScope* _tmp0_;
03831        GMainLoop* _tmp1_;
03832        UnityLens* _tmp2_;
03833        DeeModel* _tmp3_ = NULL;
03834        DeeSharedModel* _tmp4_;
03835        DeeSharedModel* lens_results_model;
03836        DeeModelIter* _tmp5_ = NULL;
03837        DeeModelIter* iter;
03838        const gchar* _tmp6_ = NULL;
03839        gchar* _tmp7_;
03840        gchar* mangled_uri;
03841        UnityPreviewAction* action;
03842        MainSignalWrapper** _tmp8_;
03843        gint _tmp8__length1;
03844        UnityScope* _tmp9_;
03845        UnityScope* _tmp10_;
03846        gulong _tmp11_ = 0UL;
03847        MainSignalWrapper* _tmp12_;
03848        UnitySeriesItem* _tmp13_;
03849        UnitySeriesItem* item1;
03850        UnitySeriesItem* _tmp14_;
03851        UnitySeriesItem* item2;
03852        UnitySeriesItem* _tmp15_;
03853        UnitySeriesItem* _tmp16_;
03854        UnitySeriesItem** _tmp17_ = NULL;
03855        UnitySeriesItem** _tmp18_;
03856        gint _tmp18__length1;
03857        UnitySeriesPreview* _tmp19_;
03858        UnitySeriesPreview* _tmp20_;
03859        MainSignalWrapper** _tmp21_;
03860        gint _tmp21__length1;
03861        gulong _tmp22_ = 0UL;
03862        MainSignalWrapper* _tmp23_;
03863        MainSignalWrapper** _tmp24_;
03864        gint _tmp24__length1;
03865        UnityScope* _tmp25_;
03866        UnityScope* _tmp26_;
03867        gulong _tmp27_ = 0UL;
03868        MainSignalWrapper* _tmp28_;
03869        GMainLoop* _tmp29_;
03870        GMainLoop* _tmp30_;
03871        gint _tmp31_;
03872        gint _tmp32_;
03873        GHashTable* _tmp33_ = NULL;
03874        GHashTable* updates;
03875        GHashTable* _tmp34_;
03876        GHashTable* _tmp35_;
03877        guint _tmp36_ = 0U;
03878        GHashTable* _tmp37_;
03879        gboolean _tmp38_ = FALSE;
03880        GHashTable* _tmp39_;
03881        gconstpointer _tmp40_ = NULL;
03882        gint32 _tmp41_ = 0;
03883        GMainLoop* _tmp42_;
03884        GHashTable* _tmp43_;
03885        GMainLoop* _tmp44_;
03886        const gchar* _tmp45_;
03887        const gchar* _tmp46_;
03888        gint _tmp47_;
03889        GMainLoop* _tmp48_;
03890        GVariant* _tmp49_ = NULL;
03891        GVariant* updates_var;
03892        GHashTable* _tmp50_;
03893        GHashTable* _tmp55_;
03894        GMainLoop* _tmp56_;
03895        const gchar* _tmp57_;
03896        const gchar* _tmp58_;
03897        gint _tmp59_;
03898        _data21_ = g_slice_new0 (Block21Data);
03899        _data21_->_ref_count_ = 1;
03900        signals = NULL;
03901        signals_length1 = 0;
03902        _signals_size_ = signals_length1;
03903        _tmp0_ = main_local_scope;
03904        _vala_assert (_tmp0_ != NULL, "local_scope != null");
03905        _tmp1_ = g_main_loop_new (NULL, FALSE);
03906        _data21_->ml = _tmp1_;
03907        _tmp2_ = main_exported_lens;
03908        _tmp3_ = unity_lens_get_model_internal (_tmp2_, 0);
03909        _tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, dee_shared_model_get_type ()) ? ((DeeSharedModel*) _tmp3_) : NULL);
03910        lens_results_model = _tmp4_;
03911        _tmp5_ = dee_model_get_first_iter ((DeeModel*) lens_results_model);
03912        iter = _tmp5_;
03913        _tmp6_ = dee_model_get_string ((DeeModel*) lens_results_model, iter, (guint) 0);
03914        _tmp7_ = g_strdup (_tmp6_);
03915        mangled_uri = _tmp7_;
03916        _data21_->got_activate_uri_signal = FALSE;
03917        _data21_->got_preview_uri_signal = FALSE;
03918        _data21_->request_item_signal_uri = NULL;
03919        _data21_->request_item_signal_count = 0;
03920        action = NULL;
03921        _tmp8_ = signals;
03922        _tmp8__length1 = signals_length1;
03923        _tmp9_ = main_local_scope;
03924        _tmp10_ = main_local_scope;
03925        _tmp11_ = g_signal_connect_data (_tmp10_, "activate-uri", (GCallback) ___lambda47__unity_scope_activate_uri, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
03926        _tmp12_ = main_signal_wrapper_new ((GObject*) _tmp9_, _tmp11_);
03927        _vala_array_add13 (&signals, &signals_length1, &_signals_size_, _tmp12_);
03928        _tmp13_ = unity_series_item_new ("file:///series_item_1.jpg", "Item #1", NULL);
03929        item1 = _tmp13_;
03930        _tmp14_ = unity_series_item_new ("file:///series_item_2.jpg", "Item #2", NULL);
03931        item2 = _tmp14_;
03932        _tmp15_ = _g_object_ref0 (item1);
03933        _tmp16_ = _g_object_ref0 (item2);
03934        _tmp17_ = g_new0 (UnitySeriesItem*, 2 + 1);
03935        _tmp17_[0] = _tmp15_;
03936        _tmp17_[1] = _tmp16_;
03937        _tmp18_ = _tmp17_;
03938        _tmp18__length1 = 2;
03939        _tmp19_ = unity_series_preview_new (_tmp18_, 2, "file:///series_item_1.jpg");
03940        _tmp20_ = _tmp19_;
03941        _tmp18_ = (_vala_array_free (_tmp18_, _tmp18__length1, (GDestroyNotify) g_object_unref), NULL);
03942        _data21_->series_preview = _tmp20_;
03943        _tmp21_ = signals;
03944        _tmp21__length1 = signals_length1;
03945        _tmp22_ = g_signal_connect_data (_data21_->series_preview, "request-item-preview", (GCallback) ___lambda48__unity_series_preview_request_item_preview, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
03946        _tmp23_ = main_signal_wrapper_new ((GObject*) _data21_->series_preview, _tmp22_);
03947        _vala_array_add14 (&signals, &signals_length1, &_signals_size_, _tmp23_);
03948        _tmp24_ = signals;
03949        _tmp24__length1 = signals_length1;
03950        _tmp25_ = main_local_scope;
03951        _tmp26_ = main_local_scope;
03952        _tmp27_ = g_signal_connect_data (_tmp26_, "preview-uri", (GCallback) ___lambda49__unity_scope_preview_uri, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
03953        _tmp28_ = main_signal_wrapper_new ((GObject*) _tmp25_, _tmp27_);
03954        _vala_array_add15 (&signals, &signals_length1, &_signals_size_, _tmp28_);
03955        _tmp29_ = g_main_loop_new (NULL, FALSE);
03956        _g_main_loop_unref0 (_data21_->ml);
03957        _data21_->ml = _tmp29_;
03958        _data21_->sp_reconstructed = NULL;
03959        main_call_lens_activate (mangled_uri, (guint) UNITY_PROTOCOL_ACTION_TYPE_PREVIEW_RESULT, ___lambda50__gfunc, _data21_);
03960        _tmp30_ = _data21_->ml;
03961        main_run_with_timeout (_tmp30_, (guint) 5000);
03962        _vala_assert (_data21_->sp_reconstructed != NULL, "sp_reconstructed != null");
03963        _tmp31_ = unity_protocol_series_preview_get_selected_item (_data21_->sp_reconstructed);
03964        _tmp32_ = _tmp31_;
03965        _vala_assert (_tmp32_ == 0, "sp_reconstructed.selected_item == 0");
03966        _vala_assert (_data21_->got_preview_uri_signal, "got_preview_uri_signal");
03967        _vala_assert (!_data21_->got_activate_uri_signal, "!got_activate_uri_signal");
03968        unity_protocol_preview_begin_updates ((UnityProtocolPreview*) _data21_->sp_reconstructed);
03969        unity_protocol_series_preview_set_selected_item (_data21_->sp_reconstructed, 1);
03970        _tmp33_ = unity_protocol_preview_end_updates_as_hashtable ((UnityProtocolPreview*) _data21_->sp_reconstructed);
03971        updates = _tmp33_;
03972        _tmp34_ = updates;
03973        _vala_assert (_tmp34_ != NULL, "updates != null");
03974        _tmp35_ = updates;
03975        _tmp36_ = g_hash_table_size (_tmp35_);
03976        _vala_assert (_tmp36_ == ((guint) 1), "updates.size() == 1");
03977        _tmp37_ = updates;
03978        _tmp38_ = g_hash_table_contains (_tmp37_, "series-active-index");
03979        _vala_assert (_tmp38_, "updates.contains(\"series-active-index\")");
03980        _tmp39_ = updates;
03981        _tmp40_ = g_hash_table_lookup (_tmp39_, "series-active-index");
03982        _tmp41_ = g_variant_get_int32 ((GVariant*) _tmp40_);
03983        _vala_assert (_tmp41_ == ((gint32) 1), "updates[\"series-active-index\"].get_int32() == 1");
03984        _data21_->gp_reconstructed = NULL;
03985        _tmp42_ = g_main_loop_new (NULL, FALSE);
03986        _g_main_loop_unref0 (_data21_->ml);
03987        _data21_->ml = _tmp42_;
03988        _tmp43_ = updates;
03989        main_call_lens_update_preview_property (mangled_uri, _tmp43_, ___lambda51__gfunc, _data21_);
03990        _tmp44_ = _data21_->ml;
03991        main_run_with_timeout (_tmp44_, (guint) 5000);
03992        _vala_assert (_data21_->gp_reconstructed != NULL, "gp_reconstructed != null");
03993        _tmp45_ = unity_series_item_get_uri (item2);
03994        _tmp46_ = _tmp45_;
03995        _vala_assert (g_strcmp0 (_data21_->request_item_signal_uri, _tmp46_) == 0, "request_item_signal_uri == item2.uri");
03996        _tmp47_ = _data21_->request_item_signal_count;
03997        _vala_assert (_tmp47_ > 1, "request_item_signal_count > 1");
03998        _tmp48_ = g_main_loop_new (NULL, FALSE);
03999        _g_main_loop_unref0 (_data21_->ml);
04000        _data21_->ml = _tmp48_;
04001        _data21_->request_item_signal_count = 0;
04002        unity_protocol_preview_begin_updates ((UnityProtocolPreview*) _data21_->sp_reconstructed);
04003        unity_protocol_series_preview_set_selected_item (_data21_->sp_reconstructed, 1);
04004        _tmp49_ = unity_protocol_preview_end_updates ((UnityProtocolPreview*) _data21_->sp_reconstructed);
04005        updates_var = _tmp49_;
04006        _tmp50_ = _variant_get8 (updates_var);
04007        _g_hash_table_unref0 (updates);
04008        updates = _tmp50_;
04009        _tmp55_ = updates;
04010        main_call_lens_update_preview_property (mangled_uri, _tmp55_, ___lambda52__gfunc, _data21_);
04011        _tmp56_ = _data21_->ml;
04012        main_run_with_timeout (_tmp56_, (guint) 5000);
04013        _vala_assert (_data21_->gp_reconstructed != NULL, "gp_reconstructed != null");
04014        _tmp57_ = unity_series_item_get_uri (item2);
04015        _tmp58_ = _tmp57_;
04016        _vala_assert (g_strcmp0 (_data21_->request_item_signal_uri, _tmp58_) == 0, "request_item_signal_uri == item2.uri");
04017        _tmp59_ = _data21_->request_item_signal_count;
04018        _vala_assert (_tmp59_ == 0, "request_item_signal_count == 0");
04019        _g_variant_unref0 (updates_var);
04020        _g_hash_table_unref0 (updates);
04021        _g_object_unref0 (item2);
04022        _g_object_unref0 (item1);
04023        _g_object_unref0 (action);
04024        _g_free0 (mangled_uri);
04025        _g_object_unref0 (lens_results_model);
04026        signals = (_vala_array_free (signals, signals_length1, (GDestroyNotify) main_signal_wrapper_unref), NULL);
04027        block21_data_unref (_data21_);
04028        _data21_ = NULL;
04029 }
04030 
04031 
04032 Main* main_construct (GType object_type) {
04033        Main* self = NULL;
04034        self = (Main*) g_type_create_instance (object_type);
04035        return self;
04036 }
04037 
04038 
04039 Main* main_new (void) {
04040        return main_construct (TYPE_MAIN);
04041 }
04042 
04043 
04044 MainSignalWrapper* main_signal_wrapper_construct (GType object_type, GObject* o, gulong signal_id) {
04045        MainSignalWrapper* self = NULL;
04046        GObject* _tmp0_;
04047        gulong _tmp1_;
04048        g_return_val_if_fail (o != NULL, NULL);
04049        self = (MainSignalWrapper*) g_type_create_instance (object_type);
04050        _tmp0_ = o;
04051        self->priv->obj = _tmp0_;
04052        _tmp1_ = signal_id;
04053        self->priv->sig_id = _tmp1_;
04054        return self;
04055 }
04056 
04057 
04058 MainSignalWrapper* main_signal_wrapper_new (GObject* o, gulong signal_id) {
04059        return main_signal_wrapper_construct (MAIN_TYPE_SIGNAL_WRAPPER, o, signal_id);
04060 }
04061 
04062 
04063 static void main_value_signal_wrapper_init (GValue* value) {
04064        value->data[0].v_pointer = NULL;
04065 }
04066 
04067 
04068 static void main_value_signal_wrapper_free_value (GValue* value) {
04069        if (value->data[0].v_pointer) {
04070               main_signal_wrapper_unref (value->data[0].v_pointer);
04071        }
04072 }
04073 
04074 
04075 static void main_value_signal_wrapper_copy_value (const GValue* src_value, GValue* dest_value) {
04076        if (src_value->data[0].v_pointer) {
04077               dest_value->data[0].v_pointer = main_signal_wrapper_ref (src_value->data[0].v_pointer);
04078        } else {
04079               dest_value->data[0].v_pointer = NULL;
04080        }
04081 }
04082 
04083 
04084 static gpointer main_value_signal_wrapper_peek_pointer (const GValue* value) {
04085        return value->data[0].v_pointer;
04086 }
04087 
04088 
04089 static gchar* main_value_signal_wrapper_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
04090        if (collect_values[0].v_pointer) {
04091               MainSignalWrapper* object;
04092               object = collect_values[0].v_pointer;
04093               if (object->parent_instance.g_class == NULL) {
04094                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
04095               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
04096                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
04097               }
04098               value->data[0].v_pointer = main_signal_wrapper_ref (object);
04099        } else {
04100               value->data[0].v_pointer = NULL;
04101        }
04102        return NULL;
04103 }
04104 
04105 
04106 static gchar* main_value_signal_wrapper_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
04107        MainSignalWrapper** object_p;
04108        object_p = collect_values[0].v_pointer;
04109        if (!object_p) {
04110               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
04111        }
04112        if (!value->data[0].v_pointer) {
04113               *object_p = NULL;
04114        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
04115               *object_p = value->data[0].v_pointer;
04116        } else {
04117               *object_p = main_signal_wrapper_ref (value->data[0].v_pointer);
04118        }
04119        return NULL;
04120 }
04121 
04122 
04123 GParamSpec* main_param_spec_signal_wrapper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
04124        MainParamSpecSignalWrapper* spec;
04125        g_return_val_if_fail (g_type_is_a (object_type, MAIN_TYPE_SIGNAL_WRAPPER), NULL);
04126        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
04127        G_PARAM_SPEC (spec)->value_type = object_type;
04128        return G_PARAM_SPEC (spec);
04129 }
04130 
04131 
04132 gpointer main_value_get_signal_wrapper (const GValue* value) {
04133        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAIN_TYPE_SIGNAL_WRAPPER), NULL);
04134        return value->data[0].v_pointer;
04135 }
04136 
04137 
04138 void main_value_set_signal_wrapper (GValue* value, gpointer v_object) {
04139        MainSignalWrapper* old;
04140        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAIN_TYPE_SIGNAL_WRAPPER));
04141        old = value->data[0].v_pointer;
04142        if (v_object) {
04143               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, MAIN_TYPE_SIGNAL_WRAPPER));
04144               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
04145               value->data[0].v_pointer = v_object;
04146               main_signal_wrapper_ref (value->data[0].v_pointer);
04147        } else {
04148               value->data[0].v_pointer = NULL;
04149        }
04150        if (old) {
04151               main_signal_wrapper_unref (old);
04152        }
04153 }
04154 
04155 
04156 void main_value_take_signal_wrapper (GValue* value, gpointer v_object) {
04157        MainSignalWrapper* old;
04158        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAIN_TYPE_SIGNAL_WRAPPER));
04159        old = value->data[0].v_pointer;
04160        if (v_object) {
04161               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, MAIN_TYPE_SIGNAL_WRAPPER));
04162               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
04163               value->data[0].v_pointer = v_object;
04164        } else {
04165               value->data[0].v_pointer = NULL;
04166        }
04167        if (old) {
04168               main_signal_wrapper_unref (old);
04169        }
04170 }
04171 
04172 
04173 static void main_signal_wrapper_class_init (MainSignalWrapperClass * klass) {
04174        main_signal_wrapper_parent_class = g_type_class_peek_parent (klass);
04175        MAIN_SIGNAL_WRAPPER_CLASS (klass)->finalize = main_signal_wrapper_finalize;
04176        g_type_class_add_private (klass, sizeof (MainSignalWrapperPrivate));
04177 }
04178 
04179 
04180 static void main_signal_wrapper_instance_init (MainSignalWrapper * self) {
04181        self->priv = MAIN_SIGNAL_WRAPPER_GET_PRIVATE (self);
04182        self->ref_count = 1;
04183 }
04184 
04185 
04186 static void main_signal_wrapper_finalize (MainSignalWrapper* obj) {
04187        MainSignalWrapper * self;
04188        GObject* _tmp0_;
04189        gulong _tmp1_;
04190        self = G_TYPE_CHECK_INSTANCE_CAST (obj, MAIN_TYPE_SIGNAL_WRAPPER, MainSignalWrapper);
04191        _tmp0_ = self->priv->obj;
04192        _tmp1_ = self->priv->sig_id;
04193        g_signal_handler_disconnect (_tmp0_, _tmp1_);
04194 }
04195 
04196 
04197 GType main_signal_wrapper_get_type (void) {
04198        static volatile gsize main_signal_wrapper_type_id__volatile = 0;
04199        if (g_once_init_enter (&main_signal_wrapper_type_id__volatile)) {
04200               static const GTypeValueTable g_define_type_value_table = { main_value_signal_wrapper_init, main_value_signal_wrapper_free_value, main_value_signal_wrapper_copy_value, main_value_signal_wrapper_peek_pointer, "p", main_value_signal_wrapper_collect_value, "p", main_value_signal_wrapper_lcopy_value };
04201               static const GTypeInfo g_define_type_info = { sizeof (MainSignalWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_signal_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MainSignalWrapper), 0, (GInstanceInitFunc) main_signal_wrapper_instance_init, &g_define_type_value_table };
04202               static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
04203               GType main_signal_wrapper_type_id;
04204               main_signal_wrapper_type_id = g_type_register_fundamental (g_type_fundamental_next (), "MainSignalWrapper", &g_define_type_info, &g_define_type_fundamental_info, 0);
04205               g_once_init_leave (&main_signal_wrapper_type_id__volatile, main_signal_wrapper_type_id);
04206        }
04207        return main_signal_wrapper_type_id__volatile;
04208 }
04209 
04210 
04211 gpointer main_signal_wrapper_ref (gpointer instance) {
04212        MainSignalWrapper* self;
04213        self = instance;
04214        g_atomic_int_inc (&self->ref_count);
04215        return instance;
04216 }
04217 
04218 
04219 void main_signal_wrapper_unref (gpointer instance) {
04220        MainSignalWrapper* self;
04221        self = instance;
04222        if (g_atomic_int_dec_and_test (&self->ref_count)) {
04223               MAIN_SIGNAL_WRAPPER_GET_CLASS (self)->finalize (self);
04224               g_type_free_instance ((GTypeInstance *) self);
04225        }
04226 }
04227 
04228 
04229 static DeeModelIter* main_test_merge_strategy_real_merge_result (UnityMergeStrategy* base, DeeModel* target, GVariant** row, int row_length1) {
04230        MainTestMergeStrategy * self;
04231        DeeModelIter* result = NULL;
04232        gint _tmp0_;
04233        GVariant** _tmp1_;
04234        gint _tmp1__length1;
04235        GVariant** _tmp2_;
04236        gint _tmp2__length1;
04237        GVariant* _tmp3_;
04238        const gchar* _tmp4_ = NULL;
04239        gboolean _tmp5_ = FALSE;
04240        GVariant** _tmp6_;
04241        gint _tmp6__length1;
04242        GVariant* _tmp7_;
04243        const gchar* _tmp8_ = NULL;
04244        GVariant** _tmp9_;
04245        gint _tmp9__length1;
04246        GVariant* _tmp10_;
04247        guint32 _tmp11_ = 0U;
04248        GVariant** _tmp12_;
04249        gint _tmp12__length1;
04250        GVariant* _tmp13_;
04251        const gchar* _tmp14_ = NULL;
04252        GVariant** _tmp15_;
04253        gint _tmp15__length1;
04254        GVariant* _tmp16_;
04255        const gchar* _tmp17_ = NULL;
04256        GVariant** _tmp18_;
04257        gint _tmp18__length1;
04258        GVariant* _tmp19_;
04259        const gchar* _tmp20_ = NULL;
04260        GVariant** _tmp21_;
04261        gint _tmp21__length1;
04262        GVariant* _tmp22_;
04263        const gchar* _tmp23_ = NULL;
04264        DeeModel* _tmp24_;
04265        guint _tmp25_ = 0U;
04266        self = (MainTestMergeStrategy*) base;
04267        g_return_val_if_fail (target != NULL, NULL);
04268        _tmp0_ = self->n_rows;
04269        self->n_rows = _tmp0_ + 1;
04270        _tmp1_ = row;
04271        _tmp1__length1 = row_length1;
04272        _vala_assert (_tmp1__length1 == 7, "row.length == 7");
04273        _tmp2_ = row;
04274        _tmp2__length1 = row_length1;
04275        _tmp3_ = _tmp2_[0];
04276        _tmp4_ = g_variant_get_string (_tmp3_, NULL);
04277        _tmp5_ = g_str_has_suffix (_tmp4_, "uri");
04278        _vala_assert (_tmp5_, "row[0].get_string().has_suffix (\"uri\")");
04279        _tmp6_ = row;
04280        _tmp6__length1 = row_length1;
04281        _tmp7_ = _tmp6_[1];
04282        _tmp8_ = g_variant_get_string (_tmp7_, NULL);
04283        _vala_assert (g_strcmp0 (_tmp8_, "icon") == 0, "row[1].get_string() == \"icon\"");
04284        _tmp9_ = row;
04285        _tmp9__length1 = row_length1;
04286        _tmp10_ = _tmp9_[2];
04287        _tmp11_ = g_variant_get_uint32 (_tmp10_);
04288        _vala_assert (_tmp11_ == ((guint32) 0), "row[2].get_uint32() == 0");
04289        _tmp12_ = row;
04290        _tmp12__length1 = row_length1;
04291        _tmp13_ = _tmp12_[3];
04292        _tmp14_ = g_variant_get_string (_tmp13_, NULL);
04293        _vala_assert (g_strcmp0 (_tmp14_, "mimetype") == 0, "row[3].get_string() == \"mimetype\"");
04294        _tmp15_ = row;
04295        _tmp15__length1 = row_length1;
04296        _tmp16_ = _tmp15_[4];
04297        _tmp17_ = g_variant_get_string (_tmp16_, NULL);
04298        _vala_assert (g_strcmp0 (_tmp17_, "display-name") == 0, "row[4].get_string() == \"display-name\"");
04299        _tmp18_ = row;
04300        _tmp18__length1 = row_length1;
04301        _tmp19_ = _tmp18_[5];
04302        _tmp20_ = g_variant_get_string (_tmp19_, NULL);
04303        _vala_assert (g_strcmp0 (_tmp20_, "comment") == 0, "row[5].get_string() == \"comment\"");
04304        _tmp21_ = row;
04305        _tmp21__length1 = row_length1;
04306        _tmp22_ = _tmp21_[6];
04307        _tmp23_ = g_variant_get_string (_tmp22_, NULL);
04308        _vala_assert (g_strcmp0 (_tmp23_, "dnd-uri") == 0, "row[6].get_string() == \"dnd-uri\"");
04309        _tmp24_ = target;
04310        _tmp25_ = dee_model_get_n_rows (_tmp24_);
04311        _vala_assert (_tmp25_ == ((guint) 0), "target.get_n_rows () == 0");
04312        result = NULL;
04313        return result;
04314 }
04315 
04316 
04317 static MainTestMergeStrategy* main_test_merge_strategy_construct (GType object_type) {
04318        MainTestMergeStrategy * self = NULL;
04319        self = (MainTestMergeStrategy*) g_object_new (object_type, NULL);
04320        return self;
04321 }
04322 
04323 
04324 static MainTestMergeStrategy* main_test_merge_strategy_new (void) {
04325        return main_test_merge_strategy_construct (MAIN_TYPE_TEST_MERGE_STRATEGY);
04326 }
04327 
04328 
04329 static void main_test_merge_strategy_class_init (MainTestMergeStrategyClass * klass) {
04330        main_test_merge_strategy_parent_class = g_type_class_peek_parent (klass);
04331        G_OBJECT_CLASS (klass)->finalize = main_test_merge_strategy_finalize;
04332 }
04333 
04334 
04335 static void main_test_merge_strategy_unity_merge_strategy_interface_init (UnityMergeStrategyIface * iface) {
04336        main_test_merge_strategy_unity_merge_strategy_parent_iface = g_type_interface_peek_parent (iface);
04337        iface->merge_result = (DeeModelIter* (*)(UnityMergeStrategy*, DeeModel*, GVariant**, int)) main_test_merge_strategy_real_merge_result;
04338 }
04339 
04340 
04341 static void main_test_merge_strategy_instance_init (MainTestMergeStrategy * self) {
04342        self->n_rows = 0;
04343 }
04344 
04345 
04346 static void main_test_merge_strategy_finalize (GObject* obj) {
04347        MainTestMergeStrategy * self;
04348        self = G_TYPE_CHECK_INSTANCE_CAST (obj, MAIN_TYPE_TEST_MERGE_STRATEGY, MainTestMergeStrategy);
04349        G_OBJECT_CLASS (main_test_merge_strategy_parent_class)->finalize (obj);
04350 }
04351 
04352 
04353 static GType main_test_merge_strategy_get_type (void) {
04354        static volatile gsize main_test_merge_strategy_type_id__volatile = 0;
04355        if (g_once_init_enter (&main_test_merge_strategy_type_id__volatile)) {
04356               static const GTypeInfo g_define_type_info = { sizeof (MainTestMergeStrategyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_test_merge_strategy_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MainTestMergeStrategy), 0, (GInstanceInitFunc) main_test_merge_strategy_instance_init, NULL };
04357               static const GInterfaceInfo unity_merge_strategy_info = { (GInterfaceInitFunc) main_test_merge_strategy_unity_merge_strategy_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
04358               GType main_test_merge_strategy_type_id;
04359               main_test_merge_strategy_type_id = g_type_register_static (G_TYPE_OBJECT, "MainTestMergeStrategy", &g_define_type_info, 0);
04360               g_type_add_interface_static (main_test_merge_strategy_type_id, UNITY_TYPE_MERGE_STRATEGY, &unity_merge_strategy_info);
04361               g_once_init_leave (&main_test_merge_strategy_type_id__volatile, main_test_merge_strategy_type_id);
04362        }
04363        return main_test_merge_strategy_type_id__volatile;
04364 }
04365 
04366 
04367 static void value_main_init (GValue* value) {
04368        value->data[0].v_pointer = NULL;
04369 }
04370 
04371 
04372 static void value_main_free_value (GValue* value) {
04373        if (value->data[0].v_pointer) {
04374               main_unref (value->data[0].v_pointer);
04375        }
04376 }
04377 
04378 
04379 static void value_main_copy_value (const GValue* src_value, GValue* dest_value) {
04380        if (src_value->data[0].v_pointer) {
04381               dest_value->data[0].v_pointer = main_ref (src_value->data[0].v_pointer);
04382        } else {
04383               dest_value->data[0].v_pointer = NULL;
04384        }
04385 }
04386 
04387 
04388 static gpointer value_main_peek_pointer (const GValue* value) {
04389        return value->data[0].v_pointer;
04390 }
04391 
04392 
04393 static gchar* value_main_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
04394        if (collect_values[0].v_pointer) {
04395               Main* object;
04396               object = collect_values[0].v_pointer;
04397               if (object->parent_instance.g_class == NULL) {
04398                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
04399               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
04400                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
04401               }
04402               value->data[0].v_pointer = main_ref (object);
04403        } else {
04404               value->data[0].v_pointer = NULL;
04405        }
04406        return NULL;
04407 }
04408 
04409 
04410 static gchar* value_main_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
04411        Main** object_p;
04412        object_p = collect_values[0].v_pointer;
04413        if (!object_p) {
04414               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
04415        }
04416        if (!value->data[0].v_pointer) {
04417               *object_p = NULL;
04418        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
04419               *object_p = value->data[0].v_pointer;
04420        } else {
04421               *object_p = main_ref (value->data[0].v_pointer);
04422        }
04423        return NULL;
04424 }
04425 
04426 
04427 GParamSpec* param_spec_main (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
04428        ParamSpecMain* spec;
04429        g_return_val_if_fail (g_type_is_a (object_type, TYPE_MAIN), NULL);
04430        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
04431        G_PARAM_SPEC (spec)->value_type = object_type;
04432        return G_PARAM_SPEC (spec);
04433 }
04434 
04435 
04436 gpointer value_get_main (const GValue* value) {
04437        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN), NULL);
04438        return value->data[0].v_pointer;
04439 }
04440 
04441 
04442 void value_set_main (GValue* value, gpointer v_object) {
04443        Main* old;
04444        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN));
04445        old = value->data[0].v_pointer;
04446        if (v_object) {
04447               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN));
04448               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
04449               value->data[0].v_pointer = v_object;
04450               main_ref (value->data[0].v_pointer);
04451        } else {
04452               value->data[0].v_pointer = NULL;
04453        }
04454        if (old) {
04455               main_unref (old);
04456        }
04457 }
04458 
04459 
04460 void value_take_main (GValue* value, gpointer v_object) {
04461        Main* old;
04462        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN));
04463        old = value->data[0].v_pointer;
04464        if (v_object) {
04465               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN));
04466               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
04467               value->data[0].v_pointer = v_object;
04468        } else {
04469               value->data[0].v_pointer = NULL;
04470        }
04471        if (old) {
04472               main_unref (old);
04473        }
04474 }
04475 
04476 
04477 static void main_class_init (MainClass * klass) {
04478        main_parent_class = g_type_class_peek_parent (klass);
04479        MAIN_CLASS (klass)->finalize = main_finalize;
04480 }
04481 
04482 
04483 static void main_instance_init (Main * self) {
04484        self->ref_count = 1;
04485 }
04486 
04487 
04488 static void main_finalize (Main* obj) {
04489        Main * self;
04490        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAIN, Main);
04491 }
04492 
04493 
04494 GType main_get_type (void) {
04495        static volatile gsize main_type_id__volatile = 0;
04496        if (g_once_init_enter (&main_type_id__volatile)) {
04497               static const GTypeValueTable g_define_type_value_table = { value_main_init, value_main_free_value, value_main_copy_value, value_main_peek_pointer, "p", value_main_collect_value, "p", value_main_lcopy_value };
04498               static const GTypeInfo g_define_type_info = { sizeof (MainClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Main), 0, (GInstanceInitFunc) main_instance_init, &g_define_type_value_table };
04499               static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
04500               GType main_type_id;
04501               main_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Main", &g_define_type_info, &g_define_type_fundamental_info, 0);
04502               g_once_init_leave (&main_type_id__volatile, main_type_id);
04503        }
04504        return main_type_id__volatile;
04505 }
04506 
04507 
04508 gpointer main_ref (gpointer instance) {
04509        Main* self;
04510        self = instance;
04511        g_atomic_int_inc (&self->ref_count);
04512        return instance;
04513 }
04514 
04515 
04516 void main_unref (gpointer instance) {
04517        Main* self;
04518        self = instance;
04519        if (g_atomic_int_dec_and_test (&self->ref_count)) {
04520               MAIN_GET_CLASS (self)->finalize (self);
04521               g_type_free_instance ((GTypeInstance *) self);
04522        }
04523 }
04524 
04525 
04526 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
04527        if ((array != NULL) && (destroy_func != NULL)) {
04528               int i;
04529               for (i = 0; i < array_length; i = i + 1) {
04530                      if (((gpointer*) array)[i] != NULL) {
04531                             destroy_func (((gpointer*) array)[i]);
04532                      }
04533               }
04534        }
04535 }
04536 
04537 
04538 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
04539        _vala_array_destroy (array, array_length, destroy_func);
04540        g_free (array);
04541 }
04542 
04543 
04544