src/Builder4/GtkView.bjs
[app.Builder.js] / ~~~~~testfile.vala.c
1 /* ~~~~~testfile.vala.c generated by valac, the Vala compiler
2  * generated from ~~~~~testfile.vala, do not modify */
3
4
5 #include <glib.h>
6 #include <glib-object.h>
7 #include <gtk/gtk.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include <gdk/gdk.h>
11
12
13 #define TYPE_ABOUT (about_get_type ())
14 #define ABOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ABOUT, About))
15 #define ABOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ABOUT, AboutClass))
16 #define IS_ABOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ABOUT))
17 #define IS_ABOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ABOUT))
18 #define ABOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ABOUT, AboutClass))
19
20 typedef struct _About About;
21 typedef struct _AboutClass AboutClass;
22 typedef struct _AboutPrivate AboutPrivate;
23 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
24
25 struct _About {
26         GObject parent_instance;
27         AboutPrivate * priv;
28         GtkAboutDialog* el;
29 };
30
31 struct _AboutClass {
32         GObjectClass parent_class;
33 };
34
35 struct _AboutPrivate {
36         About* _this;
37 };
38
39
40 extern About* _About;
41 About* _About = NULL;
42 static gpointer about_parent_class = NULL;
43
44 GType about_get_type (void) G_GNUC_CONST;
45 #define ABOUT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ABOUT, AboutPrivate))
46 enum  {
47         ABOUT_DUMMY_PROPERTY
48 };
49 About* about_singleton (void);
50 About* about_new (void);
51 About* about_construct (GType object_type);
52 static gboolean __lambda2_ (About* self, GtkWidget* _self_, GdkEventAny* event);
53 static gboolean ___lambda2__gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self);
54 static void __lambda3_ (About* self, gint rid);
55 static void ___lambda3__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
56 void about_show (About* self, GtkWindow* parent);
57 static void about_finalize (GObject* obj);
58 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
59 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
60
61
62 static gpointer _g_object_ref0 (gpointer self) {
63         return self ? g_object_ref (self) : NULL;
64 }
65
66
67 About* about_singleton (void) {
68         About* result = NULL;
69         About* _tmp0_ = NULL;
70         About* _tmp2_ = NULL;
71         About* _tmp3_ = NULL;
72         _tmp0_ = _About;
73         if (_tmp0_ == NULL) {
74                 About* _tmp1_ = NULL;
75                 _tmp1_ = about_new ();
76                 _g_object_unref0 (_About);
77                 _About = _tmp1_;
78         }
79         _tmp2_ = _About;
80         _tmp3_ = _g_object_ref0 (_tmp2_);
81         result = _tmp3_;
82         return result;
83 }
84
85
86 static gboolean __lambda2_ (About* self, GtkWidget* _self_, GdkEventAny* event) {
87         gboolean result = FALSE;
88         GtkAboutDialog* _tmp0_ = NULL;
89         _tmp0_ = self->el;
90         gtk_widget_hide ((GtkWidget*) _tmp0_);
91         result = TRUE;
92         return result;
93 }
94
95
96 static gboolean ___lambda2__gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self) {
97         gboolean result;
98         result = __lambda2_ ((About*) self, _sender, event);
99         return result;
100 }
101
102
103 static void __lambda3_ (About* self, gint rid) {
104         GtkAboutDialog* _tmp0_ = NULL;
105         _tmp0_ = self->el;
106         gtk_widget_hide ((GtkWidget*) _tmp0_);
107 }
108
109
110 static void ___lambda3__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
111         __lambda3_ ((About*) self, response_id);
112 }
113
114
115 About* about_construct (GType object_type) {
116         About * self = NULL;
117         About* _tmp0_ = NULL;
118         GtkAboutDialog* _tmp1_ = NULL;
119         GtkAboutDialog* _tmp2_ = NULL;
120         GtkAboutDialog* _tmp3_ = NULL;
121         GtkAboutDialog* _tmp4_ = NULL;
122         gchar* _tmp5_ = NULL;
123         gchar** _tmp6_ = NULL;
124         gchar** _tmp7_ = NULL;
125         gint _tmp7__length1 = 0;
126         GtkAboutDialog* _tmp8_ = NULL;
127         GtkAboutDialog* _tmp9_ = NULL;
128         GtkAboutDialog* _tmp10_ = NULL;
129         GtkAboutDialog* _tmp11_ = NULL;
130         GtkAboutDialog* _tmp12_ = NULL;
131         self = (About*) g_object_new (object_type, NULL);
132         _tmp0_ = _g_object_ref0 (self);
133         _g_object_unref0 (self->priv->_this);
134         self->priv->_this = _tmp0_;
135         _tmp1_ = (GtkAboutDialog*) gtk_about_dialog_new ();
136         g_object_ref_sink (_tmp1_);
137         _g_object_unref0 (self->el);
138         self->el = _tmp1_;
139         _tmp2_ = self->el;
140         gtk_about_dialog_set_program_name (_tmp2_, "app.Builder.js");
141         _tmp3_ = self->el;
142         gtk_about_dialog_set_license (_tmp3_, "LGPL");
143         _tmp4_ = self->el;
144         _tmp5_ = g_strdup ("Alan Knowles");
145         _tmp6_ = g_new0 (gchar*, 1 + 1);
146         _tmp6_[0] = _tmp5_;
147         _tmp7_ = _tmp6_;
148         _tmp7__length1 = 1;
149         gtk_about_dialog_set_authors (_tmp4_, _tmp7_);
150         _tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
151         _tmp8_ = self->el;
152         gtk_about_dialog_set_website (_tmp8_, "http://www.akbkhome.com/blog.php");
153         _tmp9_ = self->el;
154         gtk_window_set_modal ((GtkWindow*) _tmp9_, TRUE);
155         _tmp10_ = self->el;
156         gtk_about_dialog_set_copyright (_tmp10_, "LGPL");
157         _tmp11_ = self->el;
158         g_signal_connect_object ((GtkWidget*) _tmp11_, "delete-event", (GCallback) ___lambda2__gtk_widget_delete_event, self, 0);
159         _tmp12_ = self->el;
160         g_signal_connect_object ((GtkDialog*) _tmp12_, "response", (GCallback) ___lambda3__gtk_dialog_response, self, 0);
161         return self;
162 }
163
164
165 About* about_new (void) {
166         return about_construct (TYPE_ABOUT);
167 }
168
169
170 void about_show (About* self, GtkWindow* parent) {
171         GtkAboutDialog* _tmp0_ = NULL;
172         GtkWindow* _tmp1_ = NULL;
173         GtkAboutDialog* _tmp2_ = NULL;
174         GtkAboutDialog* _tmp3_ = NULL;
175         _tmp0_ = self->el;
176         _tmp1_ = parent;
177         gtk_window_set_transient_for ((GtkWindow*) _tmp0_, _tmp1_);
178         _tmp2_ = self->el;
179         gtk_window_set_modal ((GtkWindow*) _tmp2_, TRUE);
180         _tmp3_ = self->el;
181         gtk_widget_show ((GtkWidget*) _tmp3_);
182 }
183
184
185 static void about_class_init (AboutClass * klass) {
186         about_parent_class = g_type_class_peek_parent (klass);
187         g_type_class_add_private (klass, sizeof (AboutPrivate));
188         G_OBJECT_CLASS (klass)->finalize = about_finalize;
189 }
190
191
192 static void about_instance_init (About * self) {
193         self->priv = ABOUT_GET_PRIVATE (self);
194 }
195
196
197 static void about_finalize (GObject* obj) {
198         About * self;
199         self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ABOUT, About);
200         _g_object_unref0 (self->el);
201         _g_object_unref0 (self->priv->_this);
202         G_OBJECT_CLASS (about_parent_class)->finalize (obj);
203 }
204
205
206 GType about_get_type (void) {
207         static volatile gsize about_type_id__volatile = 0;
208         if (g_once_init_enter (&about_type_id__volatile)) {
209                 static const GTypeInfo g_define_type_info = { sizeof (AboutClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) about_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (About), 0, (GInstanceInitFunc) about_instance_init, NULL };
210                 GType about_type_id;
211                 about_type_id = g_type_register_static (G_TYPE_OBJECT, "About", &g_define_type_info, 0);
212                 g_once_init_leave (&about_type_id__volatile, about_type_id);
213         }
214         return about_type_id__volatile;
215 }
216
217
218 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
219         if ((array != NULL) && (destroy_func != NULL)) {
220                 int i;
221                 for (i = 0; i < array_length; i = i + 1) {
222                         if (((gpointer*) array)[i] != NULL) {
223                                 destroy_func (((gpointer*) array)[i]);
224                         }
225                 }
226         }
227 }
228
229
230 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
231         _vala_array_destroy (array, array_length, destroy_func);
232         g_free (array);
233 }
234
235
236