Back to index

libunity  5.92.0
test-vala.c
Go to the documentation of this file.
00001 /* test-vala.c generated by valac 0.17.2, the Vala compiler
00002  * generated from test-vala.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2010 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 Neil Jagdish Patel <neil.patel@canonical.com>
00020  *
00021  */
00022 
00023 #include <glib.h>
00024 #include <glib-object.h>
00025 #include <stdlib.h>
00026 #include <string.h>
00027 #include <config.h>
00028 #include <gobject/gvaluecollector.h>
00029 
00030 
00031 #define TYPE_MAIN (main_get_type ())
00032 #define MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN, Main))
00033 #define MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN, MainClass))
00034 #define IS_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN))
00035 #define IS_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN))
00036 #define MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN, MainClass))
00037 
00038 typedef struct _Main Main;
00039 typedef struct _MainClass MainClass;
00040 typedef struct _MainPrivate MainPrivate;
00041 
00042 #define UNITY_TEST_TYPE_IO_SUITE (unity_test_io_suite_get_type ())
00043 #define UNITY_TEST_IO_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_IO_SUITE, UnityTestIOSuite))
00044 #define UNITY_TEST_IO_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_IO_SUITE, UnityTestIOSuiteClass))
00045 #define UNITY_TEST_IS_IO_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_IO_SUITE))
00046 #define UNITY_TEST_IS_IO_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_IO_SUITE))
00047 #define UNITY_TEST_IO_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_IO_SUITE, UnityTestIOSuiteClass))
00048 
00049 typedef struct _UnityTestIOSuite UnityTestIOSuite;
00050 typedef struct _UnityTestIOSuiteClass UnityTestIOSuiteClass;
00051 
00052 #define UNITY_TEST_TYPE_APP_INFO_MANAGER_SUITE (unity_test_app_info_manager_suite_get_type ())
00053 #define UNITY_TEST_APP_INFO_MANAGER_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_APP_INFO_MANAGER_SUITE, UnityTestAppInfoManagerSuite))
00054 #define UNITY_TEST_APP_INFO_MANAGER_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_APP_INFO_MANAGER_SUITE, UnityTestAppInfoManagerSuiteClass))
00055 #define UNITY_TEST_IS_APP_INFO_MANAGER_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_APP_INFO_MANAGER_SUITE))
00056 #define UNITY_TEST_IS_APP_INFO_MANAGER_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_APP_INFO_MANAGER_SUITE))
00057 #define UNITY_TEST_APP_INFO_MANAGER_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_APP_INFO_MANAGER_SUITE, UnityTestAppInfoManagerSuiteClass))
00058 
00059 typedef struct _UnityTestAppInfoManagerSuite UnityTestAppInfoManagerSuite;
00060 typedef struct _UnityTestAppInfoManagerSuiteClass UnityTestAppInfoManagerSuiteClass;
00061 
00062 #define UNITY_TEST_TYPE_LAUNCHER_SUITE (unity_test_launcher_suite_get_type ())
00063 #define UNITY_TEST_LAUNCHER_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_LAUNCHER_SUITE, UnityTestLauncherSuite))
00064 #define UNITY_TEST_LAUNCHER_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_LAUNCHER_SUITE, UnityTestLauncherSuiteClass))
00065 #define UNITY_TEST_IS_LAUNCHER_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_LAUNCHER_SUITE))
00066 #define UNITY_TEST_IS_LAUNCHER_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_LAUNCHER_SUITE))
00067 #define UNITY_TEST_LAUNCHER_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_LAUNCHER_SUITE, UnityTestLauncherSuiteClass))
00068 
00069 typedef struct _UnityTestLauncherSuite UnityTestLauncherSuite;
00070 typedef struct _UnityTestLauncherSuiteClass UnityTestLauncherSuiteClass;
00071 
00072 #define UNITY_TEST_TYPE_FILTER_SUITE (unity_test_filter_suite_get_type ())
00073 #define UNITY_TEST_FILTER_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_FILTER_SUITE, UnityTestFilterSuite))
00074 #define UNITY_TEST_FILTER_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_FILTER_SUITE, UnityTestFilterSuiteClass))
00075 #define UNITY_TEST_IS_FILTER_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_FILTER_SUITE))
00076 #define UNITY_TEST_IS_FILTER_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_FILTER_SUITE))
00077 #define UNITY_TEST_FILTER_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_FILTER_SUITE, UnityTestFilterSuiteClass))
00078 
00079 typedef struct _UnityTestFilterSuite UnityTestFilterSuite;
00080 typedef struct _UnityTestFilterSuiteClass UnityTestFilterSuiteClass;
00081 
00082 #define UNITY_TEST_TYPE_PREVIEW_SUITE (unity_test_preview_suite_get_type ())
00083 #define UNITY_TEST_PREVIEW_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_PREVIEW_SUITE, UnityTestPreviewSuite))
00084 #define UNITY_TEST_PREVIEW_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_PREVIEW_SUITE, UnityTestPreviewSuiteClass))
00085 #define UNITY_TEST_IS_PREVIEW_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_PREVIEW_SUITE))
00086 #define UNITY_TEST_IS_PREVIEW_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_PREVIEW_SUITE))
00087 #define UNITY_TEST_PREVIEW_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_PREVIEW_SUITE, UnityTestPreviewSuiteClass))
00088 
00089 typedef struct _UnityTestPreviewSuite UnityTestPreviewSuite;
00090 typedef struct _UnityTestPreviewSuiteClass UnityTestPreviewSuiteClass;
00091 
00092 #define UNITY_TEST_TYPE_SCOPE_SUITE (unity_test_scope_suite_get_type ())
00093 #define UNITY_TEST_SCOPE_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TEST_TYPE_SCOPE_SUITE, UnityTestScopeSuite))
00094 #define UNITY_TEST_SCOPE_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TEST_TYPE_SCOPE_SUITE, UnityTestScopeSuiteClass))
00095 #define UNITY_TEST_IS_SCOPE_SUITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TEST_TYPE_SCOPE_SUITE))
00096 #define UNITY_TEST_IS_SCOPE_SUITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TEST_TYPE_SCOPE_SUITE))
00097 #define UNITY_TEST_SCOPE_SUITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TEST_TYPE_SCOPE_SUITE, UnityTestScopeSuiteClass))
00098 
00099 typedef struct _UnityTestScopeSuite UnityTestScopeSuite;
00100 typedef struct _UnityTestScopeSuiteClass UnityTestScopeSuiteClass;
00101 #define _unity_test_io_suite_unref0(var) ((var == NULL) ? NULL : (var = (unity_test_io_suite_unref (var), NULL)))
00102 #define _unity_test_app_info_manager_suite_unref0(var) ((var == NULL) ? NULL : (var = (unity_test_app_info_manager_suite_unref (var), NULL)))
00103 #define _unity_test_launcher_suite_unref0(var) ((var == NULL) ? NULL : (var = (unity_test_launcher_suite_unref (var), NULL)))
00104 #define _unity_test_filter_suite_unref0(var) ((var == NULL) ? NULL : (var = (unity_test_filter_suite_unref (var), NULL)))
00105 #define _unity_test_preview_suite_unref0(var) ((var == NULL) ? NULL : (var = (unity_test_preview_suite_unref (var), NULL)))
00106 #define _unity_test_scope_suite_unref0(var) ((var == NULL) ? NULL : (var = (unity_test_scope_suite_unref (var), NULL)))
00107 typedef struct _ParamSpecMain ParamSpecMain;
00108 
00109 struct _Main {
00110        GTypeInstance parent_instance;
00111        volatile int ref_count;
00112        MainPrivate * priv;
00113 };
00114 
00115 struct _MainClass {
00116        GTypeClass parent_class;
00117        void (*finalize) (Main *self);
00118 };
00119 
00120 struct _ParamSpecMain {
00121        GParamSpec parent_instance;
00122 };
00123 
00124 
00125 static gpointer main_parent_class = NULL;
00126 
00127 gpointer main_ref (gpointer instance);
00128 void main_unref (gpointer instance);
00129 GParamSpec* param_spec_main (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00130 void value_set_main (GValue* value, gpointer v_object);
00131 void value_take_main (GValue* value, gpointer v_object);
00132 gpointer value_get_main (const GValue* value);
00133 GType main_get_type (void) G_GNUC_CONST;
00134 enum  {
00135        MAIN_DUMMY_PROPERTY
00136 };
00137 gint main_main (gchar** args, int args_length1);
00138 gpointer unity_test_io_suite_ref (gpointer instance);
00139 void unity_test_io_suite_unref (gpointer instance);
00140 GParamSpec* unity_test_param_spec_io_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00141 void unity_test_value_set_io_suite (GValue* value, gpointer v_object);
00142 void unity_test_value_take_io_suite (GValue* value, gpointer v_object);
00143 gpointer unity_test_value_get_io_suite (const GValue* value);
00144 GType unity_test_io_suite_get_type (void) G_GNUC_CONST;
00145 gpointer unity_test_app_info_manager_suite_ref (gpointer instance);
00146 void unity_test_app_info_manager_suite_unref (gpointer instance);
00147 GParamSpec* unity_test_param_spec_app_info_manager_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00148 void unity_test_value_set_app_info_manager_suite (GValue* value, gpointer v_object);
00149 void unity_test_value_take_app_info_manager_suite (GValue* value, gpointer v_object);
00150 gpointer unity_test_value_get_app_info_manager_suite (const GValue* value);
00151 GType unity_test_app_info_manager_suite_get_type (void) G_GNUC_CONST;
00152 gpointer unity_test_launcher_suite_ref (gpointer instance);
00153 void unity_test_launcher_suite_unref (gpointer instance);
00154 GParamSpec* unity_test_param_spec_launcher_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00155 void unity_test_value_set_launcher_suite (GValue* value, gpointer v_object);
00156 void unity_test_value_take_launcher_suite (GValue* value, gpointer v_object);
00157 gpointer unity_test_value_get_launcher_suite (const GValue* value);
00158 GType unity_test_launcher_suite_get_type (void) G_GNUC_CONST;
00159 gpointer unity_test_filter_suite_ref (gpointer instance);
00160 void unity_test_filter_suite_unref (gpointer instance);
00161 GParamSpec* unity_test_param_spec_filter_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00162 void unity_test_value_set_filter_suite (GValue* value, gpointer v_object);
00163 void unity_test_value_take_filter_suite (GValue* value, gpointer v_object);
00164 gpointer unity_test_value_get_filter_suite (const GValue* value);
00165 GType unity_test_filter_suite_get_type (void) G_GNUC_CONST;
00166 gpointer unity_test_preview_suite_ref (gpointer instance);
00167 void unity_test_preview_suite_unref (gpointer instance);
00168 GParamSpec* unity_test_param_spec_preview_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00169 void unity_test_value_set_preview_suite (GValue* value, gpointer v_object);
00170 void unity_test_value_take_preview_suite (GValue* value, gpointer v_object);
00171 gpointer unity_test_value_get_preview_suite (const GValue* value);
00172 GType unity_test_preview_suite_get_type (void) G_GNUC_CONST;
00173 gpointer unity_test_scope_suite_ref (gpointer instance);
00174 void unity_test_scope_suite_unref (gpointer instance);
00175 GParamSpec* unity_test_param_spec_scope_suite (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00176 void unity_test_value_set_scope_suite (GValue* value, gpointer v_object);
00177 void unity_test_value_take_scope_suite (GValue* value, gpointer v_object);
00178 gpointer unity_test_value_get_scope_suite (const GValue* value);
00179 GType unity_test_scope_suite_get_type (void) G_GNUC_CONST;
00180 UnityTestIOSuite* unity_test_io_suite_new (void);
00181 UnityTestIOSuite* unity_test_io_suite_construct (GType object_type);
00182 UnityTestAppInfoManagerSuite* unity_test_app_info_manager_suite_new (void);
00183 UnityTestAppInfoManagerSuite* unity_test_app_info_manager_suite_construct (GType object_type);
00184 UnityTestLauncherSuite* unity_test_launcher_suite_new (void);
00185 UnityTestLauncherSuite* unity_test_launcher_suite_construct (GType object_type);
00186 UnityTestFilterSuite* unity_test_filter_suite_new (void);
00187 UnityTestFilterSuite* unity_test_filter_suite_construct (GType object_type);
00188 UnityTestPreviewSuite* unity_test_preview_suite_new (void);
00189 UnityTestPreviewSuite* unity_test_preview_suite_construct (GType object_type);
00190 UnityTestScopeSuite* unity_test_scope_suite_new (void);
00191 UnityTestScopeSuite* unity_test_scope_suite_construct (GType object_type);
00192 Main* main_new (void);
00193 Main* main_construct (GType object_type);
00194 static void main_finalize (Main* obj);
00195 
00196 
00197 gint main_main (gchar** args, int args_length1) {
00198        gint result = 0;
00199        UnityTestIOSuite* io = NULL;
00200        UnityTestAppInfoManagerSuite* appinfo_manager = NULL;
00201        UnityTestLauncherSuite* launcher = NULL;
00202        UnityTestFilterSuite* filter_suite = NULL;
00203        UnityTestPreviewSuite* preview_suite = NULL;
00204        UnityTestScopeSuite* scope_suite = NULL;
00205        UnityTestIOSuite* _tmp0_;
00206        UnityTestAppInfoManagerSuite* _tmp1_;
00207        UnityTestLauncherSuite* _tmp2_;
00208        UnityTestFilterSuite* _tmp3_;
00209        UnityTestPreviewSuite* _tmp4_;
00210        UnityTestScopeSuite* _tmp5_;
00211        g_setenv ("XDG_DATA_HOME", TESTDIR "/data", TRUE);
00212        g_test_init (&args_length1, &args, NULL);
00213        _tmp0_ = unity_test_io_suite_new ();
00214        _unity_test_io_suite_unref0 (io);
00215        io = _tmp0_;
00216        _tmp1_ = unity_test_app_info_manager_suite_new ();
00217        _unity_test_app_info_manager_suite_unref0 (appinfo_manager);
00218        appinfo_manager = _tmp1_;
00219        _tmp2_ = unity_test_launcher_suite_new ();
00220        _unity_test_launcher_suite_unref0 (launcher);
00221        launcher = _tmp2_;
00222        _tmp3_ = unity_test_filter_suite_new ();
00223        _unity_test_filter_suite_unref0 (filter_suite);
00224        filter_suite = _tmp3_;
00225        _tmp4_ = unity_test_preview_suite_new ();
00226        _unity_test_preview_suite_unref0 (preview_suite);
00227        preview_suite = _tmp4_;
00228        _tmp5_ = unity_test_scope_suite_new ();
00229        _unity_test_scope_suite_unref0 (scope_suite);
00230        scope_suite = _tmp5_;
00231        g_test_run ();
00232        result = 0;
00233        _unity_test_scope_suite_unref0 (scope_suite);
00234        _unity_test_preview_suite_unref0 (preview_suite);
00235        _unity_test_filter_suite_unref0 (filter_suite);
00236        _unity_test_launcher_suite_unref0 (launcher);
00237        _unity_test_app_info_manager_suite_unref0 (appinfo_manager);
00238        _unity_test_io_suite_unref0 (io);
00239        return result;
00240 }
00241 
00242 
00243 int main (int argc, char ** argv) {
00244        g_type_init ();
00245        return main_main (argv, argc);
00246 }
00247 
00248 
00249 Main* main_construct (GType object_type) {
00250        Main* self = NULL;
00251        self = (Main*) g_type_create_instance (object_type);
00252        return self;
00253 }
00254 
00255 
00256 Main* main_new (void) {
00257        return main_construct (TYPE_MAIN);
00258 }
00259 
00260 
00261 static void value_main_init (GValue* value) {
00262        value->data[0].v_pointer = NULL;
00263 }
00264 
00265 
00266 static void value_main_free_value (GValue* value) {
00267        if (value->data[0].v_pointer) {
00268               main_unref (value->data[0].v_pointer);
00269        }
00270 }
00271 
00272 
00273 static void value_main_copy_value (const GValue* src_value, GValue* dest_value) {
00274        if (src_value->data[0].v_pointer) {
00275               dest_value->data[0].v_pointer = main_ref (src_value->data[0].v_pointer);
00276        } else {
00277               dest_value->data[0].v_pointer = NULL;
00278        }
00279 }
00280 
00281 
00282 static gpointer value_main_peek_pointer (const GValue* value) {
00283        return value->data[0].v_pointer;
00284 }
00285 
00286 
00287 static gchar* value_main_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00288        if (collect_values[0].v_pointer) {
00289               Main* object;
00290               object = collect_values[0].v_pointer;
00291               if (object->parent_instance.g_class == NULL) {
00292                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00293               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
00294                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00295               }
00296               value->data[0].v_pointer = main_ref (object);
00297        } else {
00298               value->data[0].v_pointer = NULL;
00299        }
00300        return NULL;
00301 }
00302 
00303 
00304 static gchar* value_main_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00305        Main** object_p;
00306        object_p = collect_values[0].v_pointer;
00307        if (!object_p) {
00308               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
00309        }
00310        if (!value->data[0].v_pointer) {
00311               *object_p = NULL;
00312        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
00313               *object_p = value->data[0].v_pointer;
00314        } else {
00315               *object_p = main_ref (value->data[0].v_pointer);
00316        }
00317        return NULL;
00318 }
00319 
00320 
00321 GParamSpec* param_spec_main (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
00322        ParamSpecMain* spec;
00323        g_return_val_if_fail (g_type_is_a (object_type, TYPE_MAIN), NULL);
00324        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
00325        G_PARAM_SPEC (spec)->value_type = object_type;
00326        return G_PARAM_SPEC (spec);
00327 }
00328 
00329 
00330 gpointer value_get_main (const GValue* value) {
00331        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN), NULL);
00332        return value->data[0].v_pointer;
00333 }
00334 
00335 
00336 void value_set_main (GValue* value, gpointer v_object) {
00337        Main* old;
00338        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN));
00339        old = value->data[0].v_pointer;
00340        if (v_object) {
00341               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN));
00342               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00343               value->data[0].v_pointer = v_object;
00344               main_ref (value->data[0].v_pointer);
00345        } else {
00346               value->data[0].v_pointer = NULL;
00347        }
00348        if (old) {
00349               main_unref (old);
00350        }
00351 }
00352 
00353 
00354 void value_take_main (GValue* value, gpointer v_object) {
00355        Main* old;
00356        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN));
00357        old = value->data[0].v_pointer;
00358        if (v_object) {
00359               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN));
00360               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00361               value->data[0].v_pointer = v_object;
00362        } else {
00363               value->data[0].v_pointer = NULL;
00364        }
00365        if (old) {
00366               main_unref (old);
00367        }
00368 }
00369 
00370 
00371 static void main_class_init (MainClass * klass) {
00372        main_parent_class = g_type_class_peek_parent (klass);
00373        MAIN_CLASS (klass)->finalize = main_finalize;
00374 }
00375 
00376 
00377 static void main_instance_init (Main * self) {
00378        self->ref_count = 1;
00379 }
00380 
00381 
00382 static void main_finalize (Main* obj) {
00383        Main * self;
00384        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAIN, Main);
00385 }
00386 
00387 
00388 GType main_get_type (void) {
00389        static volatile gsize main_type_id__volatile = 0;
00390        if (g_once_init_enter (&main_type_id__volatile)) {
00391               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 };
00392               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 };
00393               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) };
00394               GType main_type_id;
00395               main_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Main", &g_define_type_info, &g_define_type_fundamental_info, 0);
00396               g_once_init_leave (&main_type_id__volatile, main_type_id);
00397        }
00398        return main_type_id__volatile;
00399 }
00400 
00401 
00402 gpointer main_ref (gpointer instance) {
00403        Main* self;
00404        self = instance;
00405        g_atomic_int_inc (&self->ref_count);
00406        return instance;
00407 }
00408 
00409 
00410 void main_unref (gpointer instance) {
00411        Main* self;
00412        self = instance;
00413        if (g_atomic_int_dec_and_test (&self->ref_count)) {
00414               MAIN_GET_CLASS (self)->finalize (self);
00415               g_type_free_instance ((GTypeInstance *) self);
00416        }
00417 }
00418 
00419 
00420