1 /* valagsignalmodule.c generated by valac, the Vala compiler
2 * generated from valagsignalmodule.vala, do not modify */
3
4 /* valagsignalmodule.vala
5 *
6 * Copyright (C) 2006-2010 Jürg Billeter
7 * Copyright (C) 2006-2008 Raffaele Sandrini
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 * Author:
24 * Jürg Billeter <j@bitron.ch>
25 * Raffaele Sandrini <raffaele@sandrini.ch>
26 */
27
28 #include "valacodegen.h"
29 #include <vala.h>
30 #include <valaccode.h>
31 #include <valagee.h>
32 #include <glib-object.h>
33 #include <stdlib.h>
34 #include <string.h>
35 #include <glib.h>
36
37 #define _g_free0(var) (var = (g_free (var), NULL))
38 #define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
39 #define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
40 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
41 #define _vala_ccode_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_node_unref (var), NULL)))
42 #define _vala_target_value_unref0(var) ((var == NULL) ? NULL : (var = (vala_target_value_unref (var), NULL)))
43 #define _vala_map_unref0(var) ((var == NULL) ? NULL : (var = (vala_map_unref (var), NULL)))
44 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
45 #define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
46 #define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
47 #define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
48
49 static gpointer vala_gsignal_module_parent_class = NULL;
50
51 static gchar* vala_gsignal_module_get_marshaller_function (ValaGSignalModule* self,
52 ValaSignal* sig,
53 ValaList* params,
54 ValaDataType* return_type,
55 const gchar* prefix);
56 static gchar* vala_gsignal_module_get_marshaller_signature (ValaGSignalModule* self,
57 ValaSignal* sig,
58 ValaList* params,
59 ValaDataType* return_type);
60 static gchar* vala_gsignal_module_get_value_type_name_from_type_reference (ValaGSignalModule* self,
61 ValaDataType* t);
62 static gchar* vala_gsignal_module_get_value_type_name_from_parameter (ValaGSignalModule* self,
63 ValaParameter* p);
64 static ValaCCodeExpression* vala_gsignal_module_get_signal_name_cexpression (ValaGSignalModule* self,
65 ValaSignal* sig,
66 ValaExpression* detail_expr,
67 ValaCodeNode* node);
68 static ValaCCodeExpression* vala_gsignal_module_get_signal_id_cexpression (ValaGSignalModule* self,
69 ValaSignal* sig);
70 static ValaCCodeExpression* vala_gsignal_module_get_detail_cexpression (ValaGSignalModule* self,
71 ValaExpression* detail_expr,
72 ValaCodeNode* node);
73 static void vala_gsignal_module_real_visit_signal (ValaCodeVisitor* base,
74 ValaSignal* sig);
75 static void vala_gsignal_module_generate_marshaller (ValaGSignalModule* self,
76 ValaSignal* sig,
77 ValaList* params,
78 ValaDataType* return_type);
79 static ValaCCodeExpression* vala_gsignal_module_real_get_signal_creation (ValaCCodeBaseModule* base,
80 ValaSignal* sig,
81 ValaObjectTypeSymbol* type);
82 static void _vala_array_add1 (gchar** * array,
83 gint* length,
84 gint* size,
85 gchar* value);
86 static void _vala_array_add2 (gchar** * array,
87 gint* length,
88 gint* size,
89 gchar* value);
90 static void _vala_array_add3 (gchar** * array,
91 gint* length,
92 gint* size,
93 gchar* value);
94 static void _vala_array_add4 (gchar** * array,
95 gint* length,
96 gint* size,
97 gchar* value);
98 static void _vala_array_add5 (gchar** * array,
99 gint* length,
100 gint* size,
101 gchar* value);
102 static void _vala_array_add6 (gchar** * array,
103 gint* length,
104 gint* size,
105 gchar* value);
106 static void _vala_array_add7 (gchar** * array,
107 gint* length,
108 gint* size,
109 gchar* value);
110 static void _vala_array_add8 (gchar** * array,
111 gint* length,
112 gint* size,
113 gchar* value);
114 static void vala_gsignal_module_real_visit_element_access (ValaCodeVisitor* base,
115 ValaElementAccess* expr);
116 static gboolean vala_gsignal_module_in_gobject_instance (ValaGSignalModule* self,
117 ValaMethod* m);
118 static void vala_gsignal_module_real_visit_member_access (ValaCodeVisitor* base,
119 ValaMemberAccess* expr);
120 static void vala_gsignal_module_real_visit_method_call (ValaCodeVisitor* base,
121 ValaMethodCall* expr);
122 static ValaCCodeExpression* vala_gsignal_module_connect_signal (ValaGSignalModule* self,
123 ValaSignal* sig,
124 ValaExpression* signal_access,
125 ValaExpression* handler,
126 gboolean disconnect,
127 gboolean after,
128 ValaCodeNode* expr);
129 static GType vala_gsignal_module_get_type_once (void);
130 static void _vala_array_destroy (gpointer array,
131 gint array_length,
132 GDestroyNotify destroy_func);
133 static void _vala_array_free (gpointer array,
134 gint array_length,
135 GDestroyNotify destroy_func);
136
137 static gpointer
_vala_iterable_ref0(gpointer self)138 _vala_iterable_ref0 (gpointer self)
139 {
140 return self ? vala_iterable_ref (self) : NULL;
141 }
142
143 static gchar*
string_replace(const gchar * self,const gchar * old,const gchar * replacement)144 string_replace (const gchar* self,
145 const gchar* old,
146 const gchar* replacement)
147 {
148 gboolean _tmp0_ = FALSE;
149 gboolean _tmp1_ = FALSE;
150 GError* _inner_error0_ = NULL;
151 gchar* result = NULL;
152 g_return_val_if_fail (self != NULL, NULL);
153 g_return_val_if_fail (old != NULL, NULL);
154 g_return_val_if_fail (replacement != NULL, NULL);
155 if ((*((gchar*) self)) == '\0') {
156 _tmp1_ = TRUE;
157 } else {
158 _tmp1_ = (*((gchar*) old)) == '\0';
159 }
160 if (_tmp1_) {
161 _tmp0_ = TRUE;
162 } else {
163 _tmp0_ = g_strcmp0 (old, replacement) == 0;
164 }
165 if (_tmp0_) {
166 gchar* _tmp2_;
167 _tmp2_ = g_strdup (self);
168 result = _tmp2_;
169 return result;
170 }
171 {
172 GRegex* regex = NULL;
173 gchar* _tmp3_;
174 gchar* _tmp4_;
175 GRegex* _tmp5_;
176 GRegex* _tmp6_;
177 gchar* _tmp7_ = NULL;
178 GRegex* _tmp8_;
179 gchar* _tmp9_;
180 gchar* _tmp10_;
181 _tmp3_ = g_regex_escape_string (old, -1);
182 _tmp4_ = _tmp3_;
183 _tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
184 _tmp6_ = _tmp5_;
185 _g_free0 (_tmp4_);
186 regex = _tmp6_;
187 if (G_UNLIKELY (_inner_error0_ != NULL)) {
188 _g_free0 (_tmp7_);
189 _g_regex_unref0 (regex);
190 if (_inner_error0_->domain == G_REGEX_ERROR) {
191 goto __catch0_g_regex_error;
192 }
193 g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
194 g_clear_error (&_inner_error0_);
195 return NULL;
196 }
197 _tmp8_ = regex;
198 _tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
199 _tmp7_ = _tmp9_;
200 if (G_UNLIKELY (_inner_error0_ != NULL)) {
201 _g_free0 (_tmp7_);
202 _g_regex_unref0 (regex);
203 if (_inner_error0_->domain == G_REGEX_ERROR) {
204 goto __catch0_g_regex_error;
205 }
206 g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
207 g_clear_error (&_inner_error0_);
208 return NULL;
209 }
210 _tmp10_ = _tmp7_;
211 _tmp7_ = NULL;
212 result = _tmp10_;
213 _g_free0 (_tmp7_);
214 _g_regex_unref0 (regex);
215 return result;
216 }
217 goto __finally0;
218 __catch0_g_regex_error:
219 {
220 g_clear_error (&_inner_error0_);
221 g_assert_not_reached ();
222 }
223 __finally0:
224 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
225 g_clear_error (&_inner_error0_);
226 return NULL;
227 }
228
229 static gchar*
vala_gsignal_module_get_marshaller_function(ValaGSignalModule * self,ValaSignal * sig,ValaList * params,ValaDataType * return_type,const gchar * prefix)230 vala_gsignal_module_get_marshaller_function (ValaGSignalModule* self,
231 ValaSignal* sig,
232 ValaList* params,
233 ValaDataType* return_type,
234 const gchar* prefix)
235 {
236 gchar* signature = NULL;
237 gchar* _tmp0_;
238 gchar* ret = NULL;
239 gchar* _tmp3_;
240 gchar* _tmp4_;
241 gchar* _tmp5_;
242 ValaDataType* _tmp21_;
243 ValaDataType* _tmp22_;
244 gchar* result = NULL;
245 g_return_val_if_fail (self != NULL, NULL);
246 g_return_val_if_fail (sig != NULL, NULL);
247 g_return_val_if_fail (params != NULL, NULL);
248 g_return_val_if_fail (return_type != NULL, NULL);
249 _tmp0_ = vala_gsignal_module_get_marshaller_signature (self, sig, params, return_type);
250 signature = _tmp0_;
251 if (prefix == NULL) {
252 ValaSet* _tmp1_;
253 const gchar* _tmp2_;
254 _tmp1_ = ((ValaCCodeBaseModule*) self)->predefined_marshal_set;
255 _tmp2_ = signature;
256 if (vala_collection_contains ((ValaCollection*) _tmp1_, _tmp2_)) {
257 prefix = "g_cclosure_marshal";
258 } else {
259 prefix = "g_cclosure_user_marshal";
260 }
261 }
262 _tmp3_ = vala_get_ccode_marshaller_type_name ((ValaCodeNode*) return_type);
263 _tmp4_ = _tmp3_;
264 _tmp5_ = g_strdup_printf ("%s_%s_", prefix, _tmp4_);
265 _g_free0 (ret);
266 ret = _tmp5_;
267 _g_free0 (_tmp4_);
268 {
269 ValaList* _p_list = NULL;
270 ValaList* _tmp6_;
271 gint _p_size = 0;
272 ValaList* _tmp7_;
273 gint _tmp8_;
274 gint _tmp9_;
275 gint _p_index = 0;
276 _tmp6_ = _vala_iterable_ref0 (params);
277 _p_list = _tmp6_;
278 _tmp7_ = _p_list;
279 _tmp8_ = vala_collection_get_size ((ValaCollection*) _tmp7_);
280 _tmp9_ = _tmp8_;
281 _p_size = _tmp9_;
282 _p_index = -1;
283 while (TRUE) {
284 gint _tmp10_;
285 gint _tmp11_;
286 ValaParameter* p = NULL;
287 ValaList* _tmp12_;
288 gpointer _tmp13_;
289 const gchar* _tmp14_;
290 ValaParameter* _tmp15_;
291 gchar* _tmp16_;
292 gchar* _tmp17_;
293 gchar* _tmp18_;
294 gchar* _tmp19_;
295 gchar* _tmp20_;
296 _p_index = _p_index + 1;
297 _tmp10_ = _p_index;
298 _tmp11_ = _p_size;
299 if (!(_tmp10_ < _tmp11_)) {
300 break;
301 }
302 _tmp12_ = _p_list;
303 _tmp13_ = vala_list_get (_tmp12_, _p_index);
304 p = (ValaParameter*) _tmp13_;
305 _tmp14_ = ret;
306 _tmp15_ = p;
307 _tmp16_ = vala_get_ccode_marshaller_type_name ((ValaCodeNode*) _tmp15_);
308 _tmp17_ = _tmp16_;
309 _tmp18_ = string_replace (_tmp17_, ",", "_");
310 _tmp19_ = _tmp18_;
311 _tmp20_ = g_strdup_printf ("%s_%s", _tmp14_, _tmp19_);
312 _g_free0 (ret);
313 ret = _tmp20_;
314 _g_free0 (_tmp19_);
315 _g_free0 (_tmp17_);
316 _vala_code_node_unref0 (p);
317 }
318 _vala_iterable_unref0 (_p_list);
319 }
320 _tmp21_ = vala_callable_get_return_type ((ValaCallable*) sig);
321 _tmp22_ = _tmp21_;
322 if (vala_data_type_is_real_non_null_struct_type (_tmp22_)) {
323 const gchar* _tmp23_;
324 gchar* _tmp24_;
325 _tmp23_ = ret;
326 _tmp24_ = g_strconcat (_tmp23_, "_POINTER", NULL);
327 _g_free0 (ret);
328 ret = _tmp24_;
329 } else {
330 gint _tmp25_;
331 gint _tmp26_;
332 _tmp25_ = vala_collection_get_size ((ValaCollection*) params);
333 _tmp26_ = _tmp25_;
334 if (_tmp26_ == 0) {
335 const gchar* _tmp27_;
336 gchar* _tmp28_;
337 _tmp27_ = ret;
338 _tmp28_ = g_strconcat (_tmp27_, "_VOID", NULL);
339 _g_free0 (ret);
340 ret = _tmp28_;
341 }
342 }
343 result = ret;
344 _g_free0 (signature);
345 return result;
346 }
347
348 static gchar*
vala_gsignal_module_get_value_type_name_from_type_reference(ValaGSignalModule * self,ValaDataType * t)349 vala_gsignal_module_get_value_type_name_from_type_reference (ValaGSignalModule* self,
350 ValaDataType* t)
351 {
352 gboolean _tmp0_ = FALSE;
353 gchar* result = NULL;
354 g_return_val_if_fail (self != NULL, NULL);
355 g_return_val_if_fail (t != NULL, NULL);
356 if (G_TYPE_CHECK_INSTANCE_TYPE (t, VALA_TYPE_POINTER_TYPE)) {
357 _tmp0_ = TRUE;
358 } else {
359 _tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (t, VALA_TYPE_GENERIC_TYPE);
360 }
361 if (_tmp0_) {
362 gchar* _tmp1_;
363 _tmp1_ = g_strdup ("gpointer");
364 result = _tmp1_;
365 return result;
366 } else {
367 if (G_TYPE_CHECK_INSTANCE_TYPE (t, VALA_TYPE_VOID_TYPE)) {
368 gchar* _tmp2_;
369 _tmp2_ = g_strdup ("void");
370 result = _tmp2_;
371 return result;
372 } else {
373 gchar* _tmp3_;
374 gchar* _tmp4_;
375 ValaDataType* _tmp5_;
376 gchar* _tmp6_;
377 gchar* _tmp7_;
378 gboolean _tmp8_;
379 _tmp3_ = vala_get_ccode_type_id ((ValaCodeNode*) t);
380 _tmp4_ = _tmp3_;
381 _tmp5_ = ((ValaCCodeBaseModule*) self)->string_type;
382 _tmp6_ = vala_get_ccode_type_id ((ValaCodeNode*) _tmp5_);
383 _tmp7_ = _tmp6_;
384 _tmp8_ = g_strcmp0 (_tmp4_, _tmp7_) == 0;
385 _g_free0 (_tmp7_);
386 _g_free0 (_tmp4_);
387 if (_tmp8_) {
388 gchar* _tmp9_;
389 _tmp9_ = g_strdup ("const char*");
390 result = _tmp9_;
391 return result;
392 } else {
393 gboolean _tmp10_ = FALSE;
394 ValaTypeSymbol* _tmp11_;
395 ValaTypeSymbol* _tmp12_;
396 _tmp11_ = vala_data_type_get_type_symbol (t);
397 _tmp12_ = _tmp11_;
398 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, VALA_TYPE_CLASS)) {
399 _tmp10_ = TRUE;
400 } else {
401 ValaTypeSymbol* _tmp13_;
402 ValaTypeSymbol* _tmp14_;
403 _tmp13_ = vala_data_type_get_type_symbol (t);
404 _tmp14_ = _tmp13_;
405 _tmp10_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, VALA_TYPE_INTERFACE);
406 }
407 if (_tmp10_) {
408 gchar* _tmp15_;
409 _tmp15_ = g_strdup ("gpointer");
410 result = _tmp15_;
411 return result;
412 } else {
413 gboolean _tmp16_ = FALSE;
414 if (G_TYPE_CHECK_INSTANCE_TYPE (t, VALA_TYPE_VALUE_TYPE)) {
415 gboolean _tmp17_;
416 gboolean _tmp18_;
417 _tmp17_ = vala_data_type_get_nullable (t);
418 _tmp18_ = _tmp17_;
419 _tmp16_ = _tmp18_;
420 } else {
421 _tmp16_ = FALSE;
422 }
423 if (_tmp16_) {
424 gchar* _tmp19_;
425 _tmp19_ = g_strdup ("gpointer");
426 result = _tmp19_;
427 return result;
428 } else {
429 ValaTypeSymbol* _tmp20_;
430 ValaTypeSymbol* _tmp21_;
431 _tmp20_ = vala_data_type_get_type_symbol (t);
432 _tmp21_ = _tmp20_;
433 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, VALA_TYPE_STRUCT)) {
434 ValaStruct* st = NULL;
435 ValaTypeSymbol* _tmp22_;
436 ValaTypeSymbol* _tmp23_;
437 ValaStruct* _tmp24_;
438 _tmp22_ = vala_data_type_get_type_symbol (t);
439 _tmp23_ = _tmp22_;
440 st = G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, VALA_TYPE_STRUCT, ValaStruct);
441 _tmp24_ = st;
442 if (vala_struct_is_simple_type (_tmp24_)) {
443 ValaTypeSymbol* _tmp25_;
444 ValaTypeSymbol* _tmp26_;
445 gchar* _tmp27_;
446 _tmp25_ = vala_data_type_get_type_symbol (t);
447 _tmp26_ = _tmp25_;
448 _tmp27_ = vala_get_ccode_name ((ValaCodeNode*) _tmp26_);
449 result = _tmp27_;
450 return result;
451 } else {
452 gchar* _tmp28_;
453 _tmp28_ = g_strdup ("gpointer");
454 result = _tmp28_;
455 return result;
456 }
457 } else {
458 ValaTypeSymbol* _tmp29_;
459 ValaTypeSymbol* _tmp30_;
460 _tmp29_ = vala_data_type_get_type_symbol (t);
461 _tmp30_ = _tmp29_;
462 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp30_, VALA_TYPE_ENUM)) {
463 ValaEnum* en = NULL;
464 ValaTypeSymbol* _tmp31_;
465 ValaTypeSymbol* _tmp32_;
466 ValaEnum* _tmp33_;
467 gboolean _tmp34_;
468 gboolean _tmp35_;
469 _tmp31_ = vala_data_type_get_type_symbol (t);
470 _tmp32_ = _tmp31_;
471 en = G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, VALA_TYPE_ENUM, ValaEnum);
472 _tmp33_ = en;
473 _tmp34_ = vala_enum_get_is_flags (_tmp33_);
474 _tmp35_ = _tmp34_;
475 if (_tmp35_) {
476 gchar* _tmp36_;
477 _tmp36_ = g_strdup ("guint");
478 result = _tmp36_;
479 return result;
480 } else {
481 gchar* _tmp37_;
482 _tmp37_ = g_strdup ("gint");
483 result = _tmp37_;
484 return result;
485 }
486 } else {
487 if (G_TYPE_CHECK_INSTANCE_TYPE (t, VALA_TYPE_ARRAY_TYPE)) {
488 gchar* _tmp38_;
489 _tmp38_ = g_strdup ("gpointer");
490 result = _tmp38_;
491 return result;
492 } else {
493 if (G_TYPE_CHECK_INSTANCE_TYPE (t, VALA_TYPE_DELEGATE_TYPE)) {
494 gchar* _tmp39_;
495 _tmp39_ = g_strdup ("gpointer");
496 result = _tmp39_;
497 return result;
498 } else {
499 if (G_TYPE_CHECK_INSTANCE_TYPE (t, VALA_TYPE_ERROR_TYPE)) {
500 gchar* _tmp40_;
501 _tmp40_ = g_strdup ("gpointer");
502 result = _tmp40_;
503 return result;
504 }
505 }
506 }
507 }
508 }
509 }
510 }
511 }
512 }
513 }
514 result = NULL;
515 return result;
516 }
517
518 static gchar*
vala_gsignal_module_get_value_type_name_from_parameter(ValaGSignalModule * self,ValaParameter * p)519 vala_gsignal_module_get_value_type_name_from_parameter (ValaGSignalModule* self,
520 ValaParameter* p)
521 {
522 ValaParameterDirection _tmp0_;
523 ValaParameterDirection _tmp1_;
524 gchar* result = NULL;
525 g_return_val_if_fail (self != NULL, NULL);
526 g_return_val_if_fail (p != NULL, NULL);
527 _tmp0_ = vala_parameter_get_direction (p);
528 _tmp1_ = _tmp0_;
529 if (_tmp1_ != VALA_PARAMETER_DIRECTION_IN) {
530 gchar* _tmp2_;
531 _tmp2_ = g_strdup ("gpointer");
532 result = _tmp2_;
533 return result;
534 } else {
535 ValaDataType* _tmp3_;
536 ValaDataType* _tmp4_;
537 gchar* _tmp5_;
538 _tmp3_ = vala_variable_get_variable_type ((ValaVariable*) p);
539 _tmp4_ = _tmp3_;
540 _tmp5_ = vala_gsignal_module_get_value_type_name_from_type_reference (self, _tmp4_);
541 result = _tmp5_;
542 return result;
543 }
544 }
545
546 static gchar*
vala_gsignal_module_get_marshaller_signature(ValaGSignalModule * self,ValaSignal * sig,ValaList * params,ValaDataType * return_type)547 vala_gsignal_module_get_marshaller_signature (ValaGSignalModule* self,
548 ValaSignal* sig,
549 ValaList* params,
550 ValaDataType* return_type)
551 {
552 gchar* signature = NULL;
553 gchar* _tmp0_;
554 gchar* _tmp1_;
555 gchar* _tmp2_;
556 gboolean first = FALSE;
557 ValaDataType* _tmp21_;
558 ValaDataType* _tmp22_;
559 gchar* result = NULL;
560 g_return_val_if_fail (self != NULL, NULL);
561 g_return_val_if_fail (sig != NULL, NULL);
562 g_return_val_if_fail (params != NULL, NULL);
563 g_return_val_if_fail (return_type != NULL, NULL);
564 _tmp0_ = vala_get_ccode_marshaller_type_name ((ValaCodeNode*) return_type);
565 _tmp1_ = _tmp0_;
566 _tmp2_ = g_strdup_printf ("%s:", _tmp1_);
567 _g_free0 (signature);
568 signature = _tmp2_;
569 _g_free0 (_tmp1_);
570 first = TRUE;
571 {
572 ValaList* _p_list = NULL;
573 ValaList* _tmp3_;
574 gint _p_size = 0;
575 ValaList* _tmp4_;
576 gint _tmp5_;
577 gint _tmp6_;
578 gint _p_index = 0;
579 _tmp3_ = _vala_iterable_ref0 (params);
580 _p_list = _tmp3_;
581 _tmp4_ = _p_list;
582 _tmp5_ = vala_collection_get_size ((ValaCollection*) _tmp4_);
583 _tmp6_ = _tmp5_;
584 _p_size = _tmp6_;
585 _p_index = -1;
586 while (TRUE) {
587 gint _tmp7_;
588 gint _tmp8_;
589 ValaParameter* p = NULL;
590 ValaList* _tmp9_;
591 gpointer _tmp10_;
592 _p_index = _p_index + 1;
593 _tmp7_ = _p_index;
594 _tmp8_ = _p_size;
595 if (!(_tmp7_ < _tmp8_)) {
596 break;
597 }
598 _tmp9_ = _p_list;
599 _tmp10_ = vala_list_get (_tmp9_, _p_index);
600 p = (ValaParameter*) _tmp10_;
601 if (first) {
602 const gchar* _tmp11_;
603 ValaParameter* _tmp12_;
604 gchar* _tmp13_;
605 gchar* _tmp14_;
606 gchar* _tmp15_;
607 _tmp11_ = signature;
608 _tmp12_ = p;
609 _tmp13_ = vala_get_ccode_marshaller_type_name ((ValaCodeNode*) _tmp12_);
610 _tmp14_ = _tmp13_;
611 _tmp15_ = g_strconcat (_tmp11_, _tmp14_, NULL);
612 _g_free0 (signature);
613 signature = _tmp15_;
614 _g_free0 (_tmp14_);
615 first = FALSE;
616 } else {
617 const gchar* _tmp16_;
618 ValaParameter* _tmp17_;
619 gchar* _tmp18_;
620 gchar* _tmp19_;
621 gchar* _tmp20_;
622 _tmp16_ = signature;
623 _tmp17_ = p;
624 _tmp18_ = vala_get_ccode_marshaller_type_name ((ValaCodeNode*) _tmp17_);
625 _tmp19_ = _tmp18_;
626 _tmp20_ = g_strdup_printf ("%s,%s", _tmp16_, _tmp19_);
627 _g_free0 (signature);
628 signature = _tmp20_;
629 _g_free0 (_tmp19_);
630 }
631 _vala_code_node_unref0 (p);
632 }
633 _vala_iterable_unref0 (_p_list);
634 }
635 _tmp21_ = vala_callable_get_return_type ((ValaCallable*) sig);
636 _tmp22_ = _tmp21_;
637 if (vala_data_type_is_real_non_null_struct_type (_tmp22_)) {
638 const gchar* _tmp23_ = NULL;
639 const gchar* _tmp24_;
640 gchar* _tmp25_;
641 if (first) {
642 _tmp23_ = "POINTER";
643 } else {
644 _tmp23_ = ",POINTER";
645 }
646 _tmp24_ = signature;
647 _tmp25_ = g_strconcat (_tmp24_, _tmp23_, NULL);
648 _g_free0 (signature);
649 signature = _tmp25_;
650 } else {
651 gint _tmp26_;
652 gint _tmp27_;
653 _tmp26_ = vala_collection_get_size ((ValaCollection*) params);
654 _tmp27_ = _tmp26_;
655 if (_tmp27_ == 0) {
656 const gchar* _tmp28_;
657 gchar* _tmp29_;
658 _tmp28_ = signature;
659 _tmp29_ = g_strconcat (_tmp28_, "VOID", NULL);
660 _g_free0 (signature);
661 signature = _tmp29_;
662 }
663 }
664 result = signature;
665 return result;
666 }
667
668 static gpointer
_vala_ccode_node_ref0(gpointer self)669 _vala_ccode_node_ref0 (gpointer self)
670 {
671 return self ? vala_ccode_node_ref (self) : NULL;
672 }
673
674 static ValaCCodeExpression*
vala_gsignal_module_get_signal_name_cexpression(ValaGSignalModule * self,ValaSignal * sig,ValaExpression * detail_expr,ValaCodeNode * node)675 vala_gsignal_module_get_signal_name_cexpression (ValaGSignalModule* self,
676 ValaSignal* sig,
677 ValaExpression* detail_expr,
678 ValaCodeNode* node)
679 {
680 ValaTargetValue* detail_value = NULL;
681 ValaDataType* _tmp5_;
682 ValaDataType* _tmp6_;
683 gboolean _tmp7_;
684 ValaTargetValue* _tmp8_;
685 ValaArrayList* _tmp9_;
686 ValaArrayList* _tmp10_;
687 ValaTargetValue* _tmp11_;
688 ValaCCodeFunctionCall* ccall = NULL;
689 ValaCCodeIdentifier* _tmp12_;
690 ValaCCodeIdentifier* _tmp13_;
691 ValaCCodeFunctionCall* _tmp14_;
692 ValaCCodeFunctionCall* _tmp15_;
693 ValaCCodeFunctionCall* _tmp16_;
694 ValaCCodeConstant* _tmp17_;
695 ValaCCodeConstant* _tmp18_;
696 ValaCCodeFunctionCall* _tmp19_;
697 ValaCCodeExpression* _tmp20_;
698 ValaCCodeFunctionCall* _tmp21_;
699 ValaCCodeConstant* _tmp22_;
700 ValaCCodeConstant* _tmp23_;
701 ValaCCodeFunction* _tmp24_;
702 ValaCCodeFunction* _tmp25_;
703 ValaTargetValue* _tmp26_;
704 ValaCCodeExpression* _tmp27_;
705 ValaCCodeFunctionCall* _tmp28_;
706 ValaTargetValue* _tmp29_;
707 ValaCCodeExpression* _tmp30_;
708 ValaCCodeExpression* _tmp31_;
709 ValaCCodeExpression* result = NULL;
710 g_return_val_if_fail (self != NULL, NULL);
711 g_return_val_if_fail (sig != NULL, NULL);
712 g_return_val_if_fail (node != NULL, NULL);
713 if (detail_expr == NULL) {
714 ValaCCodeConstant* _tmp0_;
715 _tmp0_ = vala_ccode_base_module_get_signal_canonical_constant ((ValaCCodeBaseModule*) self, sig, NULL);
716 result = (ValaCCodeExpression*) _tmp0_;
717 return result;
718 }
719 if (G_TYPE_CHECK_INSTANCE_TYPE (detail_expr, VALA_TYPE_STRING_LITERAL)) {
720 gchar* _tmp1_;
721 gchar* _tmp2_;
722 ValaCCodeConstant* _tmp3_;
723 ValaCCodeExpression* _tmp4_;
724 _tmp1_ = vala_string_literal_eval (G_TYPE_CHECK_INSTANCE_CAST (detail_expr, VALA_TYPE_STRING_LITERAL, ValaStringLiteral));
725 _tmp2_ = _tmp1_;
726 _tmp3_ = vala_ccode_base_module_get_signal_canonical_constant ((ValaCCodeBaseModule*) self, sig, _tmp2_);
727 _tmp4_ = (ValaCCodeExpression*) _tmp3_;
728 _g_free0 (_tmp2_);
729 result = _tmp4_;
730 return result;
731 }
732 _tmp5_ = vala_expression_get_value_type (detail_expr);
733 _tmp6_ = _tmp5_;
734 _tmp7_ = TRUE;
735 _tmp8_ = vala_ccode_base_module_create_temp_value ((ValaCCodeBaseModule*) self, _tmp6_, FALSE, node, &_tmp7_);
736 detail_value = _tmp8_;
737 _tmp9_ = vala_ccode_base_module_get_temp_ref_values ((ValaCCodeBaseModule*) self);
738 _tmp10_ = _tmp9_;
739 _tmp11_ = detail_value;
740 vala_list_insert ((ValaList*) _tmp10_, 0, _tmp11_);
741 _tmp12_ = vala_ccode_identifier_new ("g_strconcat");
742 _tmp13_ = _tmp12_;
743 _tmp14_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp13_);
744 _tmp15_ = _tmp14_;
745 _vala_ccode_node_unref0 (_tmp13_);
746 ccall = _tmp15_;
747 _tmp16_ = ccall;
748 _tmp17_ = vala_ccode_base_module_get_signal_canonical_constant ((ValaCCodeBaseModule*) self, sig, "");
749 _tmp18_ = _tmp17_;
750 vala_ccode_function_call_add_argument (_tmp16_, (ValaCCodeExpression*) _tmp18_);
751 _vala_ccode_node_unref0 (_tmp18_);
752 _tmp19_ = ccall;
753 _tmp20_ = vala_get_cvalue (detail_expr);
754 vala_ccode_function_call_add_argument (_tmp19_, _tmp20_);
755 _tmp21_ = ccall;
756 _tmp22_ = vala_ccode_constant_new ("NULL");
757 _tmp23_ = _tmp22_;
758 vala_ccode_function_call_add_argument (_tmp21_, (ValaCCodeExpression*) _tmp23_);
759 _vala_ccode_node_unref0 (_tmp23_);
760 _tmp24_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
761 _tmp25_ = _tmp24_;
762 _tmp26_ = detail_value;
763 _tmp27_ = vala_get_cvalue_ (_tmp26_);
764 _tmp28_ = ccall;
765 vala_ccode_function_add_assignment (_tmp25_, _tmp27_, (ValaCCodeExpression*) _tmp28_);
766 _tmp29_ = detail_value;
767 _tmp30_ = vala_get_cvalue_ (_tmp29_);
768 _tmp31_ = _vala_ccode_node_ref0 (_tmp30_);
769 result = _tmp31_;
770 _vala_ccode_node_unref0 (ccall);
771 _vala_target_value_unref0 (detail_value);
772 return result;
773 }
774
775 static gpointer
_vala_code_node_ref0(gpointer self)776 _vala_code_node_ref0 (gpointer self)
777 {
778 return self ? vala_code_node_ref (self) : NULL;
779 }
780
781 static ValaCCodeExpression*
vala_gsignal_module_get_signal_id_cexpression(ValaGSignalModule * self,ValaSignal * sig)782 vala_gsignal_module_get_signal_id_cexpression (ValaGSignalModule* self,
783 ValaSignal* sig)
784 {
785 ValaTypeSymbol* cl = NULL;
786 ValaSymbol* _tmp0_;
787 ValaSymbol* _tmp1_;
788 ValaTypeSymbol* _tmp2_;
789 ValaCCodeIdentifier* signal_array = NULL;
790 gchar* _tmp3_;
791 gchar* _tmp4_;
792 gchar* _tmp5_;
793 gchar* _tmp6_;
794 ValaCCodeIdentifier* _tmp7_;
795 ValaCCodeIdentifier* _tmp8_;
796 ValaCCodeIdentifier* signal_enum_value = NULL;
797 gchar* _tmp9_;
798 gchar* _tmp10_;
799 gchar* _tmp11_;
800 gchar* _tmp12_;
801 gchar* _tmp13_;
802 gchar* _tmp14_;
803 ValaCCodeIdentifier* _tmp15_;
804 ValaCCodeIdentifier* _tmp16_;
805 ValaCCodeElementAccess* _tmp17_;
806 ValaCCodeExpression* result = NULL;
807 g_return_val_if_fail (self != NULL, NULL);
808 g_return_val_if_fail (sig != NULL, NULL);
809 _tmp0_ = vala_symbol_get_parent_symbol ((ValaSymbol*) sig);
810 _tmp1_ = _tmp0_;
811 _tmp2_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_TYPESYMBOL, ValaTypeSymbol));
812 cl = _tmp2_;
813 _tmp3_ = vala_get_ccode_lower_case_name ((ValaCodeNode*) cl, NULL);
814 _tmp4_ = _tmp3_;
815 _tmp5_ = g_strdup_printf ("%s_signals", _tmp4_);
816 _tmp6_ = _tmp5_;
817 _tmp7_ = vala_ccode_identifier_new (_tmp6_);
818 _tmp8_ = _tmp7_;
819 _g_free0 (_tmp6_);
820 _g_free0 (_tmp4_);
821 signal_array = _tmp8_;
822 _tmp9_ = vala_get_ccode_upper_case_name ((ValaSymbol*) cl, NULL);
823 _tmp10_ = _tmp9_;
824 _tmp11_ = vala_get_ccode_upper_case_name ((ValaSymbol*) sig, NULL);
825 _tmp12_ = _tmp11_;
826 _tmp13_ = g_strdup_printf ("%s_%s_SIGNAL", _tmp10_, _tmp12_);
827 _tmp14_ = _tmp13_;
828 _tmp15_ = vala_ccode_identifier_new (_tmp14_);
829 _tmp16_ = _tmp15_;
830 _g_free0 (_tmp14_);
831 _g_free0 (_tmp12_);
832 _g_free0 (_tmp10_);
833 signal_enum_value = _tmp16_;
834 _tmp17_ = vala_ccode_element_access_new ((ValaCCodeExpression*) signal_array, (ValaCCodeExpression*) signal_enum_value);
835 result = (ValaCCodeExpression*) _tmp17_;
836 _vala_ccode_node_unref0 (signal_enum_value);
837 _vala_ccode_node_unref0 (signal_array);
838 _vala_code_node_unref0 (cl);
839 return result;
840 }
841
842 static ValaCCodeExpression*
vala_gsignal_module_get_detail_cexpression(ValaGSignalModule * self,ValaExpression * detail_expr,ValaCodeNode * node)843 vala_gsignal_module_get_detail_cexpression (ValaGSignalModule* self,
844 ValaExpression* detail_expr,
845 ValaCodeNode* node)
846 {
847 ValaCCodeExpression* detail_cexpr = NULL;
848 ValaCCodeExpression* _tmp0_;
849 ValaCCodeExpression* _tmp1_;
850 ValaCCodeFunctionCall* detail_ccall = NULL;
851 ValaCCodeExpression* _tmp2_;
852 ValaCCodeFunctionCall* _tmp9_;
853 ValaCCodeExpression* _tmp10_;
854 ValaCCodeExpression* result = NULL;
855 g_return_val_if_fail (self != NULL, NULL);
856 g_return_val_if_fail (detail_expr != NULL, NULL);
857 g_return_val_if_fail (node != NULL, NULL);
858 _tmp0_ = vala_get_cvalue (detail_expr);
859 _tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
860 detail_cexpr = _tmp1_;
861 _tmp2_ = detail_cexpr;
862 if (vala_ccode_base_module_is_constant_ccode_expression (_tmp2_)) {
863 ValaCCodeIdentifier* _tmp3_;
864 ValaCCodeIdentifier* _tmp4_;
865 ValaCCodeFunctionCall* _tmp5_;
866 _tmp3_ = vala_ccode_identifier_new ("g_quark_from_static_string");
867 _tmp4_ = _tmp3_;
868 _tmp5_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp4_);
869 _vala_ccode_node_unref0 (detail_ccall);
870 detail_ccall = _tmp5_;
871 _vala_ccode_node_unref0 (_tmp4_);
872 } else {
873 ValaCCodeIdentifier* _tmp6_;
874 ValaCCodeIdentifier* _tmp7_;
875 ValaCCodeFunctionCall* _tmp8_;
876 _tmp6_ = vala_ccode_identifier_new ("g_quark_from_string");
877 _tmp7_ = _tmp6_;
878 _tmp8_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp7_);
879 _vala_ccode_node_unref0 (detail_ccall);
880 detail_ccall = _tmp8_;
881 _vala_ccode_node_unref0 (_tmp7_);
882 }
883 _tmp9_ = detail_ccall;
884 _tmp10_ = detail_cexpr;
885 vala_ccode_function_call_add_argument (_tmp9_, _tmp10_);
886 result = (ValaCCodeExpression*) detail_ccall;
887 _vala_ccode_node_unref0 (detail_cexpr);
888 return result;
889 }
890
891 static void
vala_gsignal_module_real_visit_signal(ValaCodeVisitor * base,ValaSignal * sig)892 vala_gsignal_module_real_visit_signal (ValaCodeVisitor* base,
893 ValaSignal* sig)
894 {
895 ValaGSignalModule * self;
896 gboolean _tmp0_ = FALSE;
897 ValaCCodeEnum* _tmp1_;
898 ValaList* params = NULL;
899 ValaList* _tmp15_;
900 ValaDataType* _tmp34_;
901 ValaDataType* _tmp35_;
902 self = (ValaGSignalModule*) base;
903 g_return_if_fail (sig != NULL);
904 _tmp1_ = ((ValaCCodeBaseModule*) self)->signal_enum;
905 if (_tmp1_ != NULL) {
906 ValaSymbol* _tmp2_;
907 ValaSymbol* _tmp3_;
908 _tmp2_ = vala_symbol_get_parent_symbol ((ValaSymbol*) sig);
909 _tmp3_ = _tmp2_;
910 _tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, VALA_TYPE_TYPESYMBOL);
911 } else {
912 _tmp0_ = FALSE;
913 }
914 if (_tmp0_) {
915 ValaCCodeEnum* _tmp4_;
916 ValaSymbol* _tmp5_;
917 ValaSymbol* _tmp6_;
918 gchar* _tmp7_;
919 gchar* _tmp8_;
920 gchar* _tmp9_;
921 gchar* _tmp10_;
922 gchar* _tmp11_;
923 gchar* _tmp12_;
924 ValaCCodeEnumValue* _tmp13_;
925 ValaCCodeEnumValue* _tmp14_;
926 _tmp4_ = ((ValaCCodeBaseModule*) self)->signal_enum;
927 _tmp5_ = vala_symbol_get_parent_symbol ((ValaSymbol*) sig);
928 _tmp6_ = _tmp5_;
929 _tmp7_ = vala_get_ccode_upper_case_name ((ValaSymbol*) G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, VALA_TYPE_TYPESYMBOL, ValaTypeSymbol), NULL);
930 _tmp8_ = _tmp7_;
931 _tmp9_ = vala_get_ccode_upper_case_name ((ValaSymbol*) sig, NULL);
932 _tmp10_ = _tmp9_;
933 _tmp11_ = g_strdup_printf ("%s_%s_SIGNAL", _tmp8_, _tmp10_);
934 _tmp12_ = _tmp11_;
935 _tmp13_ = vala_ccode_enum_value_new (_tmp12_, NULL);
936 _tmp14_ = _tmp13_;
937 vala_ccode_enum_add_value (_tmp4_, _tmp14_);
938 _vala_ccode_node_unref0 (_tmp14_);
939 _g_free0 (_tmp12_);
940 _g_free0 (_tmp10_);
941 _g_free0 (_tmp8_);
942 }
943 vala_code_node_accept_children ((ValaCodeNode*) sig, (ValaCodeVisitor*) self);
944 _tmp15_ = vala_callable_get_parameters ((ValaCallable*) sig);
945 params = _tmp15_;
946 {
947 ValaList* _p_list = NULL;
948 ValaList* _tmp16_;
949 ValaList* _tmp17_;
950 gint _p_size = 0;
951 ValaList* _tmp18_;
952 gint _tmp19_;
953 gint _tmp20_;
954 gint _p_index = 0;
955 _tmp16_ = params;
956 _tmp17_ = _vala_iterable_ref0 (_tmp16_);
957 _p_list = _tmp17_;
958 _tmp18_ = _p_list;
959 _tmp19_ = vala_collection_get_size ((ValaCollection*) _tmp18_);
960 _tmp20_ = _tmp19_;
961 _p_size = _tmp20_;
962 _p_index = -1;
963 while (TRUE) {
964 gint _tmp21_;
965 gint _tmp22_;
966 ValaParameter* p = NULL;
967 ValaList* _tmp23_;
968 gpointer _tmp24_;
969 ValaParameter* _tmp25_;
970 ValaCCodeFile* _tmp26_;
971 GHashFunc _tmp27_;
972 GEqualFunc _tmp28_;
973 GEqualFunc _tmp29_;
974 ValaHashMap* _tmp30_;
975 ValaHashMap* _tmp31_;
976 ValaCCodeParameter* _tmp32_;
977 ValaCCodeParameter* _tmp33_;
978 _p_index = _p_index + 1;
979 _tmp21_ = _p_index;
980 _tmp22_ = _p_size;
981 if (!(_tmp21_ < _tmp22_)) {
982 break;
983 }
984 _tmp23_ = _p_list;
985 _tmp24_ = vala_list_get (_tmp23_, _p_index);
986 p = (ValaParameter*) _tmp24_;
987 _tmp25_ = p;
988 _tmp26_ = ((ValaCCodeBaseModule*) self)->cfile;
989 _tmp27_ = g_direct_hash;
990 _tmp28_ = g_direct_equal;
991 _tmp29_ = g_direct_equal;
992 _tmp30_ = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_PARAMETER, (GBoxedCopyFunc) vala_ccode_node_ref, (GDestroyNotify) vala_ccode_node_unref, _tmp27_, _tmp28_, _tmp29_);
993 _tmp31_ = _tmp30_;
994 _tmp32_ = vala_ccode_method_module_generate_parameter ((ValaCCodeMethodModule*) self, _tmp25_, _tmp26_, (ValaMap*) _tmp31_, NULL);
995 _tmp33_ = _tmp32_;
996 _vala_ccode_node_unref0 (_tmp33_);
997 _vala_map_unref0 (_tmp31_);
998 _vala_code_node_unref0 (p);
999 }
1000 _vala_iterable_unref0 (_p_list);
1001 }
1002 _tmp34_ = vala_callable_get_return_type ((ValaCallable*) sig);
1003 _tmp35_ = _tmp34_;
1004 if (vala_data_type_is_real_non_null_struct_type (_tmp35_)) {
1005 ValaList* _tmp36_;
1006 ValaVoidType* _tmp37_;
1007 ValaVoidType* _tmp38_;
1008 _tmp36_ = params;
1009 _tmp37_ = vala_void_type_new (NULL);
1010 _tmp38_ = _tmp37_;
1011 vala_gsignal_module_generate_marshaller (self, sig, _tmp36_, (ValaDataType*) _tmp38_);
1012 _vala_code_node_unref0 (_tmp38_);
1013 } else {
1014 ValaList* _tmp39_;
1015 ValaDataType* _tmp40_;
1016 ValaDataType* _tmp41_;
1017 _tmp39_ = params;
1018 _tmp40_ = vala_callable_get_return_type ((ValaCallable*) sig);
1019 _tmp41_ = _tmp40_;
1020 vala_gsignal_module_generate_marshaller (self, sig, _tmp39_, _tmp41_);
1021 }
1022 }
1023
1024 static void
vala_gsignal_module_generate_marshaller(ValaGSignalModule * self,ValaSignal * sig,ValaList * params,ValaDataType * return_type)1025 vala_gsignal_module_generate_marshaller (ValaGSignalModule* self,
1026 ValaSignal* sig,
1027 ValaList* params,
1028 ValaDataType* return_type)
1029 {
1030 gchar* signature = NULL;
1031 gint n_params = 0;
1032 gint i = 0;
1033 gchar* _tmp0_;
1034 gboolean _tmp1_ = FALSE;
1035 ValaSet* _tmp2_;
1036 const gchar* _tmp3_;
1037 ValaCCodeFunction* signal_marshaller = NULL;
1038 gchar* _tmp6_;
1039 gchar* _tmp7_;
1040 ValaCCodeFunction* _tmp8_;
1041 ValaCCodeFunction* _tmp9_;
1042 ValaCCodeFunction* _tmp10_;
1043 ValaCCodeFunction* _tmp11_;
1044 ValaCCodeParameter* _tmp12_;
1045 ValaCCodeParameter* _tmp13_;
1046 ValaCCodeFunction* _tmp14_;
1047 ValaCCodeParameter* _tmp15_;
1048 ValaCCodeParameter* _tmp16_;
1049 ValaCCodeFunction* _tmp17_;
1050 ValaCCodeParameter* _tmp18_;
1051 ValaCCodeParameter* _tmp19_;
1052 ValaCCodeFunction* _tmp20_;
1053 ValaCCodeParameter* _tmp21_;
1054 ValaCCodeParameter* _tmp22_;
1055 ValaCCodeFunction* _tmp23_;
1056 ValaCCodeParameter* _tmp24_;
1057 ValaCCodeParameter* _tmp25_;
1058 ValaCCodeFunction* _tmp26_;
1059 ValaCCodeParameter* _tmp27_;
1060 ValaCCodeParameter* _tmp28_;
1061 ValaCCodeFunction* _tmp29_;
1062 ValaCCodeFunctionDeclarator* callback_decl = NULL;
1063 gchar* _tmp30_;
1064 gchar* _tmp31_;
1065 ValaCCodeFunctionDeclarator* _tmp32_;
1066 ValaCCodeFunctionDeclarator* _tmp33_;
1067 ValaCCodeFunctionDeclarator* _tmp34_;
1068 ValaCCodeParameter* _tmp35_;
1069 ValaCCodeParameter* _tmp36_;
1070 ValaDataType* _tmp105_;
1071 ValaDataType* _tmp106_;
1072 ValaCCodeFunctionDeclarator* _tmp113_;
1073 ValaCCodeParameter* _tmp114_;
1074 ValaCCodeParameter* _tmp115_;
1075 ValaCCodeFunction* _tmp116_;
1076 ValaCCodeFunction* _tmp117_;
1077 gchar* _tmp118_;
1078 gchar* _tmp119_;
1079 ValaCCodeFunctionDeclarator* _tmp120_;
1080 ValaCCodeTypeDefinition* _tmp121_;
1081 ValaCCodeTypeDefinition* _tmp122_;
1082 ValaCCodeFunction* _tmp123_;
1083 ValaCCodeFunction* _tmp124_;
1084 gchar* _tmp125_;
1085 gchar* _tmp126_;
1086 ValaCCodeVariableDeclarator* _tmp127_;
1087 ValaCCodeVariableDeclarator* _tmp128_;
1088 ValaCCodeFunction* _tmp129_;
1089 ValaCCodeFunction* _tmp130_;
1090 ValaCCodeIdentifier* _tmp131_;
1091 ValaCCodeIdentifier* _tmp132_;
1092 ValaCCodeCastExpression* _tmp133_;
1093 ValaCCodeCastExpression* _tmp134_;
1094 ValaCCodeVariableDeclarator* _tmp135_;
1095 ValaCCodeVariableDeclarator* _tmp136_;
1096 ValaCCodeFunction* _tmp137_;
1097 ValaCCodeFunction* _tmp138_;
1098 ValaCCodeVariableDeclarator* _tmp139_;
1099 ValaCCodeVariableDeclarator* _tmp140_;
1100 ValaCCodeFunction* _tmp141_;
1101 ValaCCodeFunction* _tmp142_;
1102 ValaCCodeVariableDeclarator* _tmp143_;
1103 ValaCCodeVariableDeclarator* _tmp144_;
1104 ValaCCodeFunctionCall* fc = NULL;
1105 gboolean _tmp145_ = FALSE;
1106 ValaTypeSymbol* _tmp146_;
1107 ValaTypeSymbol* _tmp147_;
1108 ValaCCodeIdentifier* _tmp167_;
1109 ValaCCodeIdentifier* _tmp168_;
1110 ValaCCodeFunctionCall* _tmp169_;
1111 ValaCCodeFunctionCall* _tmp170_;
1112 ValaCCodeIdentifier* _tmp171_;
1113 ValaCCodeIdentifier* _tmp172_;
1114 gchar* _tmp173_;
1115 gchar* _tmp174_;
1116 ValaCCodeConstant* _tmp175_;
1117 ValaCCodeConstant* _tmp176_;
1118 ValaCCodeBinaryExpression* _tmp177_;
1119 ValaCCodeBinaryExpression* _tmp178_;
1120 ValaCCodeFunction* _tmp179_;
1121 ValaCCodeFunction* _tmp180_;
1122 ValaCCodeFunctionCall* _tmp181_;
1123 ValaCCodeMemberAccess* data = NULL;
1124 ValaCCodeIdentifier* _tmp182_;
1125 ValaCCodeIdentifier* _tmp183_;
1126 ValaCCodeMemberAccess* _tmp184_;
1127 ValaCCodeMemberAccess* _tmp185_;
1128 ValaCCodeMemberAccess* param = NULL;
1129 ValaCCodeIdentifier* _tmp186_;
1130 ValaCCodeIdentifier* _tmp187_;
1131 ValaCCodeMemberAccess* _tmp188_;
1132 ValaCCodeMemberAccess* _tmp189_;
1133 ValaCCodeMemberAccess* _tmp190_;
1134 ValaCCodeMemberAccess* _tmp191_;
1135 ValaCCodeFunctionCall* cond = NULL;
1136 ValaCCodeConstant* _tmp192_;
1137 ValaCCodeConstant* _tmp193_;
1138 ValaCCodeFunctionCall* _tmp194_;
1139 ValaCCodeFunctionCall* _tmp195_;
1140 ValaCCodeFunctionCall* _tmp196_;
1141 ValaCCodeIdentifier* _tmp197_;
1142 ValaCCodeIdentifier* _tmp198_;
1143 ValaCCodeFunction* _tmp199_;
1144 ValaCCodeFunction* _tmp200_;
1145 ValaCCodeFunctionCall* _tmp201_;
1146 ValaCCodeFunction* _tmp202_;
1147 ValaCCodeFunction* _tmp203_;
1148 ValaCCodeIdentifier* _tmp204_;
1149 ValaCCodeIdentifier* _tmp205_;
1150 ValaCCodeMemberAccess* _tmp206_;
1151 ValaCCodeFunction* _tmp207_;
1152 ValaCCodeFunction* _tmp208_;
1153 ValaCCodeIdentifier* _tmp209_;
1154 ValaCCodeIdentifier* _tmp210_;
1155 ValaCCodeMemberAccess* _tmp211_;
1156 ValaCCodeFunction* _tmp212_;
1157 ValaCCodeFunction* _tmp213_;
1158 ValaCCodeFunction* _tmp214_;
1159 ValaCCodeFunction* _tmp215_;
1160 ValaCCodeIdentifier* _tmp216_;
1161 ValaCCodeIdentifier* _tmp217_;
1162 ValaCCodeMemberAccess* _tmp218_;
1163 ValaCCodeFunction* _tmp219_;
1164 ValaCCodeFunction* _tmp220_;
1165 ValaCCodeIdentifier* _tmp221_;
1166 ValaCCodeIdentifier* _tmp222_;
1167 ValaCCodeMemberAccess* _tmp223_;
1168 ValaCCodeFunction* _tmp224_;
1169 ValaCCodeFunction* _tmp225_;
1170 ValaCCodeCastExpression* c_assign_rhs = NULL;
1171 ValaCCodeIdentifier* _tmp226_;
1172 ValaCCodeIdentifier* _tmp227_;
1173 ValaCCodeIdentifier* _tmp228_;
1174 ValaCCodeIdentifier* _tmp229_;
1175 ValaCCodeIdentifier* _tmp230_;
1176 ValaCCodeIdentifier* _tmp231_;
1177 ValaCCodeMemberAccess* _tmp232_;
1178 ValaCCodeMemberAccess* _tmp233_;
1179 ValaCCodeConditionalExpression* _tmp234_;
1180 ValaCCodeConditionalExpression* _tmp235_;
1181 gchar* _tmp236_;
1182 gchar* _tmp237_;
1183 ValaCCodeCastExpression* _tmp238_;
1184 ValaCCodeCastExpression* _tmp239_;
1185 ValaCCodeFunction* _tmp240_;
1186 ValaCCodeFunction* _tmp241_;
1187 ValaCCodeIdentifier* _tmp242_;
1188 ValaCCodeIdentifier* _tmp243_;
1189 ValaCCodeCastExpression* _tmp244_;
1190 ValaCCodeIdentifier* _tmp245_;
1191 ValaCCodeIdentifier* _tmp246_;
1192 ValaCCodeFunctionCall* _tmp247_;
1193 ValaCCodeFunctionCall* _tmp248_;
1194 ValaCCodeIdentifier* _tmp249_;
1195 ValaCCodeIdentifier* _tmp250_;
1196 ValaDataType* _tmp374_;
1197 ValaDataType* _tmp375_;
1198 ValaCCodeFunctionCall* _tmp392_;
1199 ValaCCodeIdentifier* _tmp393_;
1200 ValaCCodeIdentifier* _tmp394_;
1201 gboolean _tmp395_ = FALSE;
1202 ValaTypeSymbol* _tmp396_;
1203 ValaTypeSymbol* _tmp397_;
1204 ValaCCodeFile* _tmp426_;
1205 ValaCCodeFunction* _tmp427_;
1206 ValaCCodeFile* _tmp428_;
1207 ValaCCodeFunction* _tmp429_;
1208 ValaSet* _tmp430_;
1209 const gchar* _tmp431_;
1210 g_return_if_fail (self != NULL);
1211 g_return_if_fail (sig != NULL);
1212 g_return_if_fail (params != NULL);
1213 g_return_if_fail (return_type != NULL);
1214 _tmp0_ = vala_gsignal_module_get_marshaller_signature (self, sig, params, return_type);
1215 _g_free0 (signature);
1216 signature = _tmp0_;
1217 _tmp2_ = ((ValaCCodeBaseModule*) self)->predefined_marshal_set;
1218 _tmp3_ = signature;
1219 if (vala_collection_contains ((ValaCollection*) _tmp2_, _tmp3_)) {
1220 _tmp1_ = TRUE;
1221 } else {
1222 ValaSet* _tmp4_;
1223 const gchar* _tmp5_;
1224 _tmp4_ = ((ValaCCodeBaseModule*) self)->user_marshal_set;
1225 _tmp5_ = signature;
1226 _tmp1_ = vala_collection_contains ((ValaCollection*) _tmp4_, _tmp5_);
1227 }
1228 if (_tmp1_) {
1229 _g_free0 (signature);
1230 return;
1231 }
1232 _tmp6_ = vala_gsignal_module_get_marshaller_function (self, sig, params, return_type, NULL);
1233 _tmp7_ = _tmp6_;
1234 _tmp8_ = vala_ccode_function_new (_tmp7_, "void");
1235 _tmp9_ = _tmp8_;
1236 _g_free0 (_tmp7_);
1237 signal_marshaller = _tmp9_;
1238 _tmp10_ = signal_marshaller;
1239 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp10_, VALA_CCODE_MODIFIERS_STATIC);
1240 _tmp11_ = signal_marshaller;
1241 _tmp12_ = vala_ccode_parameter_new ("closure", "GClosure *");
1242 _tmp13_ = _tmp12_;
1243 vala_ccode_function_add_parameter (_tmp11_, _tmp13_);
1244 _vala_ccode_node_unref0 (_tmp13_);
1245 _tmp14_ = signal_marshaller;
1246 _tmp15_ = vala_ccode_parameter_new ("return_value", "GValue *");
1247 _tmp16_ = _tmp15_;
1248 vala_ccode_function_add_parameter (_tmp14_, _tmp16_);
1249 _vala_ccode_node_unref0 (_tmp16_);
1250 _tmp17_ = signal_marshaller;
1251 _tmp18_ = vala_ccode_parameter_new ("n_param_values", "guint");
1252 _tmp19_ = _tmp18_;
1253 vala_ccode_function_add_parameter (_tmp17_, _tmp19_);
1254 _vala_ccode_node_unref0 (_tmp19_);
1255 _tmp20_ = signal_marshaller;
1256 _tmp21_ = vala_ccode_parameter_new ("param_values", "const GValue *");
1257 _tmp22_ = _tmp21_;
1258 vala_ccode_function_add_parameter (_tmp20_, _tmp22_);
1259 _vala_ccode_node_unref0 (_tmp22_);
1260 _tmp23_ = signal_marshaller;
1261 _tmp24_ = vala_ccode_parameter_new ("invocation_hint", "gpointer");
1262 _tmp25_ = _tmp24_;
1263 vala_ccode_function_add_parameter (_tmp23_, _tmp25_);
1264 _vala_ccode_node_unref0 (_tmp25_);
1265 _tmp26_ = signal_marshaller;
1266 _tmp27_ = vala_ccode_parameter_new ("marshal_data", "gpointer");
1267 _tmp28_ = _tmp27_;
1268 vala_ccode_function_add_parameter (_tmp26_, _tmp28_);
1269 _vala_ccode_node_unref0 (_tmp28_);
1270 _tmp29_ = signal_marshaller;
1271 vala_ccode_base_module_push_function ((ValaCCodeBaseModule*) self, _tmp29_);
1272 _tmp30_ = vala_gsignal_module_get_marshaller_function (self, sig, params, return_type, "GMarshalFunc");
1273 _tmp31_ = _tmp30_;
1274 _tmp32_ = vala_ccode_function_declarator_new (_tmp31_);
1275 _tmp33_ = _tmp32_;
1276 _g_free0 (_tmp31_);
1277 callback_decl = _tmp33_;
1278 _tmp34_ = callback_decl;
1279 _tmp35_ = vala_ccode_parameter_new ("data1", "gpointer");
1280 _tmp36_ = _tmp35_;
1281 vala_ccode_function_declarator_add_parameter (_tmp34_, _tmp36_);
1282 _vala_ccode_node_unref0 (_tmp36_);
1283 n_params = 1;
1284 {
1285 ValaList* _p_list = NULL;
1286 ValaList* _tmp37_;
1287 gint _p_size = 0;
1288 ValaList* _tmp38_;
1289 gint _tmp39_;
1290 gint _tmp40_;
1291 gint _p_index = 0;
1292 _tmp37_ = _vala_iterable_ref0 (params);
1293 _p_list = _tmp37_;
1294 _tmp38_ = _p_list;
1295 _tmp39_ = vala_collection_get_size ((ValaCollection*) _tmp38_);
1296 _tmp40_ = _tmp39_;
1297 _p_size = _tmp40_;
1298 _p_index = -1;
1299 while (TRUE) {
1300 gint _tmp41_;
1301 gint _tmp42_;
1302 ValaParameter* p = NULL;
1303 ValaList* _tmp43_;
1304 gpointer _tmp44_;
1305 ValaCCodeFunctionDeclarator* _tmp45_;
1306 gchar* _tmp46_;
1307 gchar* _tmp47_;
1308 ValaParameter* _tmp48_;
1309 gchar* _tmp49_;
1310 gchar* _tmp50_;
1311 ValaCCodeParameter* _tmp51_;
1312 ValaCCodeParameter* _tmp52_;
1313 gint _tmp53_;
1314 ValaParameter* _tmp54_;
1315 ValaDataType* _tmp55_;
1316 ValaDataType* _tmp56_;
1317 _p_index = _p_index + 1;
1318 _tmp41_ = _p_index;
1319 _tmp42_ = _p_size;
1320 if (!(_tmp41_ < _tmp42_)) {
1321 break;
1322 }
1323 _tmp43_ = _p_list;
1324 _tmp44_ = vala_list_get (_tmp43_, _p_index);
1325 p = (ValaParameter*) _tmp44_;
1326 _tmp45_ = callback_decl;
1327 _tmp46_ = g_strdup_printf ("arg_%d", n_params);
1328 _tmp47_ = _tmp46_;
1329 _tmp48_ = p;
1330 _tmp49_ = vala_gsignal_module_get_value_type_name_from_parameter (self, _tmp48_);
1331 _tmp50_ = _tmp49_;
1332 _tmp51_ = vala_ccode_parameter_new (_tmp47_, _tmp50_);
1333 _tmp52_ = _tmp51_;
1334 vala_ccode_function_declarator_add_parameter (_tmp45_, _tmp52_);
1335 _vala_ccode_node_unref0 (_tmp52_);
1336 _g_free0 (_tmp50_);
1337 _g_free0 (_tmp47_);
1338 _tmp53_ = n_params;
1339 n_params = _tmp53_ + 1;
1340 _tmp54_ = p;
1341 _tmp55_ = vala_variable_get_variable_type ((ValaVariable*) _tmp54_);
1342 _tmp56_ = _tmp55_;
1343 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp56_, VALA_TYPE_ARRAY_TYPE)) {
1344 ValaArrayType* array_type = NULL;
1345 ValaParameter* _tmp57_;
1346 ValaDataType* _tmp58_;
1347 ValaDataType* _tmp59_;
1348 ValaArrayType* _tmp60_;
1349 gchar* length_ctype = NULL;
1350 ValaParameter* _tmp61_;
1351 gchar* _tmp62_;
1352 _tmp57_ = p;
1353 _tmp58_ = vala_variable_get_variable_type ((ValaVariable*) _tmp57_);
1354 _tmp59_ = _tmp58_;
1355 _tmp60_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, VALA_TYPE_ARRAY_TYPE, ValaArrayType));
1356 array_type = _tmp60_;
1357 _tmp61_ = p;
1358 _tmp62_ = vala_get_ccode_array_length_type ((ValaCodeNode*) _tmp61_);
1359 length_ctype = _tmp62_;
1360 {
1361 gint j = 0;
1362 j = 0;
1363 {
1364 gboolean _tmp63_ = FALSE;
1365 _tmp63_ = TRUE;
1366 while (TRUE) {
1367 ValaArrayType* _tmp65_;
1368 gint _tmp66_;
1369 gint _tmp67_;
1370 ValaCCodeFunctionDeclarator* _tmp68_;
1371 gchar* _tmp69_;
1372 gchar* _tmp70_;
1373 const gchar* _tmp71_;
1374 ValaCCodeParameter* _tmp72_;
1375 ValaCCodeParameter* _tmp73_;
1376 gint _tmp74_;
1377 if (!_tmp63_) {
1378 gint _tmp64_;
1379 _tmp64_ = j;
1380 j = _tmp64_ + 1;
1381 }
1382 _tmp63_ = FALSE;
1383 _tmp65_ = array_type;
1384 _tmp66_ = vala_array_type_get_rank (_tmp65_);
1385 _tmp67_ = _tmp66_;
1386 if (!(j < _tmp67_)) {
1387 break;
1388 }
1389 _tmp68_ = callback_decl;
1390 _tmp69_ = g_strdup_printf ("arg_%d", n_params);
1391 _tmp70_ = _tmp69_;
1392 _tmp71_ = length_ctype;
1393 _tmp72_ = vala_ccode_parameter_new (_tmp70_, _tmp71_);
1394 _tmp73_ = _tmp72_;
1395 vala_ccode_function_declarator_add_parameter (_tmp68_, _tmp73_);
1396 _vala_ccode_node_unref0 (_tmp73_);
1397 _g_free0 (_tmp70_);
1398 _tmp74_ = n_params;
1399 n_params = _tmp74_ + 1;
1400 }
1401 }
1402 }
1403 _g_free0 (length_ctype);
1404 _vala_code_node_unref0 (array_type);
1405 } else {
1406 ValaParameter* _tmp75_;
1407 ValaDataType* _tmp76_;
1408 ValaDataType* _tmp77_;
1409 _tmp75_ = p;
1410 _tmp76_ = vala_variable_get_variable_type ((ValaVariable*) _tmp75_);
1411 _tmp77_ = _tmp76_;
1412 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp77_, VALA_TYPE_DELEGATE_TYPE)) {
1413 ValaDelegateType* delegate_type = NULL;
1414 ValaParameter* _tmp78_;
1415 ValaDataType* _tmp79_;
1416 ValaDataType* _tmp80_;
1417 ValaDelegateType* _tmp81_;
1418 ValaDelegate* _tmp82_;
1419 ValaDelegate* _tmp83_;
1420 gboolean _tmp84_;
1421 gboolean _tmp85_;
1422 _tmp78_ = p;
1423 _tmp79_ = vala_variable_get_variable_type ((ValaVariable*) _tmp78_);
1424 _tmp80_ = _tmp79_;
1425 delegate_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, VALA_TYPE_DELEGATE_TYPE, ValaDelegateType);
1426 _tmp81_ = delegate_type;
1427 _tmp82_ = vala_delegate_type_get_delegate_symbol (_tmp81_);
1428 _tmp83_ = _tmp82_;
1429 _tmp84_ = vala_delegate_get_has_target (_tmp83_);
1430 _tmp85_ = _tmp84_;
1431 if (_tmp85_) {
1432 ValaCCodeFunctionDeclarator* _tmp86_;
1433 gchar* _tmp87_;
1434 gchar* _tmp88_;
1435 ValaDataType* _tmp89_;
1436 gchar* _tmp90_;
1437 gchar* _tmp91_;
1438 ValaCCodeParameter* _tmp92_;
1439 ValaCCodeParameter* _tmp93_;
1440 gint _tmp94_;
1441 ValaDelegateType* _tmp95_;
1442 _tmp86_ = callback_decl;
1443 _tmp87_ = g_strdup_printf ("arg_%d", n_params);
1444 _tmp88_ = _tmp87_;
1445 _tmp89_ = ((ValaCCodeBaseModule*) self)->delegate_target_type;
1446 _tmp90_ = vala_get_ccode_name ((ValaCodeNode*) _tmp89_);
1447 _tmp91_ = _tmp90_;
1448 _tmp92_ = vala_ccode_parameter_new (_tmp88_, _tmp91_);
1449 _tmp93_ = _tmp92_;
1450 vala_ccode_function_declarator_add_parameter (_tmp86_, _tmp93_);
1451 _vala_ccode_node_unref0 (_tmp93_);
1452 _g_free0 (_tmp91_);
1453 _g_free0 (_tmp88_);
1454 _tmp94_ = n_params;
1455 n_params = _tmp94_ + 1;
1456 _tmp95_ = delegate_type;
1457 if (vala_data_type_is_disposable ((ValaDataType*) _tmp95_)) {
1458 ValaCCodeFunctionDeclarator* _tmp96_;
1459 gchar* _tmp97_;
1460 gchar* _tmp98_;
1461 ValaDelegateType* _tmp99_;
1462 gchar* _tmp100_;
1463 gchar* _tmp101_;
1464 ValaCCodeParameter* _tmp102_;
1465 ValaCCodeParameter* _tmp103_;
1466 gint _tmp104_;
1467 _tmp96_ = callback_decl;
1468 _tmp97_ = g_strdup_printf ("arg_%d", n_params);
1469 _tmp98_ = _tmp97_;
1470 _tmp99_ = ((ValaCCodeBaseModule*) self)->delegate_target_destroy_type;
1471 _tmp100_ = vala_get_ccode_name ((ValaCodeNode*) _tmp99_);
1472 _tmp101_ = _tmp100_;
1473 _tmp102_ = vala_ccode_parameter_new (_tmp98_, _tmp101_);
1474 _tmp103_ = _tmp102_;
1475 vala_ccode_function_declarator_add_parameter (_tmp96_, _tmp103_);
1476 _vala_ccode_node_unref0 (_tmp103_);
1477 _g_free0 (_tmp101_);
1478 _g_free0 (_tmp98_);
1479 _tmp104_ = n_params;
1480 n_params = _tmp104_ + 1;
1481 }
1482 }
1483 }
1484 }
1485 _vala_code_node_unref0 (p);
1486 }
1487 _vala_iterable_unref0 (_p_list);
1488 }
1489 _tmp105_ = vala_callable_get_return_type ((ValaCallable*) sig);
1490 _tmp106_ = _tmp105_;
1491 if (vala_data_type_is_real_non_null_struct_type (_tmp106_)) {
1492 ValaCCodeFunctionDeclarator* _tmp107_;
1493 gchar* _tmp108_;
1494 gchar* _tmp109_;
1495 ValaCCodeParameter* _tmp110_;
1496 ValaCCodeParameter* _tmp111_;
1497 gint _tmp112_;
1498 _tmp107_ = callback_decl;
1499 _tmp108_ = g_strdup_printf ("arg_%d", n_params);
1500 _tmp109_ = _tmp108_;
1501 _tmp110_ = vala_ccode_parameter_new (_tmp109_, "gpointer");
1502 _tmp111_ = _tmp110_;
1503 vala_ccode_function_declarator_add_parameter (_tmp107_, _tmp111_);
1504 _vala_ccode_node_unref0 (_tmp111_);
1505 _g_free0 (_tmp109_);
1506 _tmp112_ = n_params;
1507 n_params = _tmp112_ + 1;
1508 }
1509 _tmp113_ = callback_decl;
1510 _tmp114_ = vala_ccode_parameter_new ("data2", "gpointer");
1511 _tmp115_ = _tmp114_;
1512 vala_ccode_function_declarator_add_parameter (_tmp113_, _tmp115_);
1513 _vala_ccode_node_unref0 (_tmp115_);
1514 _tmp116_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1515 _tmp117_ = _tmp116_;
1516 _tmp118_ = vala_gsignal_module_get_value_type_name_from_type_reference (self, return_type);
1517 _tmp119_ = _tmp118_;
1518 _tmp120_ = callback_decl;
1519 _tmp121_ = vala_ccode_type_definition_new (_tmp119_, (ValaCCodeDeclarator*) _tmp120_);
1520 _tmp122_ = _tmp121_;
1521 vala_ccode_function_add_statement (_tmp117_, (ValaCCodeNode*) _tmp122_);
1522 _vala_ccode_node_unref0 (_tmp122_);
1523 _g_free0 (_tmp119_);
1524 _tmp123_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1525 _tmp124_ = _tmp123_;
1526 _tmp125_ = vala_gsignal_module_get_marshaller_function (self, sig, params, return_type, "GMarshalFunc");
1527 _tmp126_ = _tmp125_;
1528 _tmp127_ = vala_ccode_variable_declarator_new ("callback", NULL, NULL);
1529 _tmp128_ = _tmp127_;
1530 vala_ccode_function_add_declaration (_tmp124_, _tmp126_, (ValaCCodeDeclarator*) _tmp128_, VALA_CCODE_MODIFIERS_REGISTER);
1531 _vala_ccode_node_unref0 (_tmp128_);
1532 _g_free0 (_tmp126_);
1533 _tmp129_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1534 _tmp130_ = _tmp129_;
1535 _tmp131_ = vala_ccode_identifier_new ("closure");
1536 _tmp132_ = _tmp131_;
1537 _tmp133_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) _tmp132_, "GCClosure *");
1538 _tmp134_ = _tmp133_;
1539 _tmp135_ = vala_ccode_variable_declarator_new ("cc", (ValaCCodeExpression*) _tmp134_, NULL);
1540 _tmp136_ = _tmp135_;
1541 vala_ccode_function_add_declaration (_tmp130_, "GCClosure *", (ValaCCodeDeclarator*) _tmp136_, VALA_CCODE_MODIFIERS_REGISTER);
1542 _vala_ccode_node_unref0 (_tmp136_);
1543 _vala_ccode_node_unref0 (_tmp134_);
1544 _vala_ccode_node_unref0 (_tmp132_);
1545 _tmp137_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1546 _tmp138_ = _tmp137_;
1547 _tmp139_ = vala_ccode_variable_declarator_new ("data1", NULL, NULL);
1548 _tmp140_ = _tmp139_;
1549 vala_ccode_function_add_declaration (_tmp138_, "gpointer", (ValaCCodeDeclarator*) _tmp140_, VALA_CCODE_MODIFIERS_REGISTER);
1550 _vala_ccode_node_unref0 (_tmp140_);
1551 _tmp141_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1552 _tmp142_ = _tmp141_;
1553 _tmp143_ = vala_ccode_variable_declarator_new ("data2", NULL, NULL);
1554 _tmp144_ = _tmp143_;
1555 vala_ccode_function_add_declaration (_tmp142_, "gpointer", (ValaCCodeDeclarator*) _tmp144_, VALA_CCODE_MODIFIERS_REGISTER);
1556 _vala_ccode_node_unref0 (_tmp144_);
1557 _tmp146_ = vala_data_type_get_type_symbol (return_type);
1558 _tmp147_ = _tmp146_;
1559 if (_tmp147_ != NULL) {
1560 _tmp145_ = TRUE;
1561 } else {
1562 _tmp145_ = G_TYPE_CHECK_INSTANCE_TYPE (return_type, VALA_TYPE_ARRAY_TYPE);
1563 }
1564 if (_tmp145_) {
1565 ValaCCodeFunction* _tmp148_;
1566 ValaCCodeFunction* _tmp149_;
1567 gchar* _tmp150_;
1568 gchar* _tmp151_;
1569 ValaCCodeVariableDeclarator* _tmp152_;
1570 ValaCCodeVariableDeclarator* _tmp153_;
1571 ValaCCodeIdentifier* _tmp154_;
1572 ValaCCodeIdentifier* _tmp155_;
1573 ValaCCodeFunctionCall* _tmp156_;
1574 ValaCCodeFunctionCall* _tmp157_;
1575 ValaCCodeIdentifier* _tmp158_;
1576 ValaCCodeIdentifier* _tmp159_;
1577 ValaCCodeConstant* _tmp160_;
1578 ValaCCodeConstant* _tmp161_;
1579 ValaCCodeBinaryExpression* _tmp162_;
1580 ValaCCodeBinaryExpression* _tmp163_;
1581 ValaCCodeFunction* _tmp164_;
1582 ValaCCodeFunction* _tmp165_;
1583 ValaCCodeFunctionCall* _tmp166_;
1584 _tmp148_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1585 _tmp149_ = _tmp148_;
1586 _tmp150_ = vala_gsignal_module_get_value_type_name_from_type_reference (self, return_type);
1587 _tmp151_ = _tmp150_;
1588 _tmp152_ = vala_ccode_variable_declarator_new ("v_return", NULL, NULL);
1589 _tmp153_ = _tmp152_;
1590 vala_ccode_function_add_declaration (_tmp149_, _tmp151_, (ValaCCodeDeclarator*) _tmp153_, 0);
1591 _vala_ccode_node_unref0 (_tmp153_);
1592 _g_free0 (_tmp151_);
1593 _tmp154_ = vala_ccode_identifier_new ("g_return_if_fail");
1594 _tmp155_ = _tmp154_;
1595 _tmp156_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp155_);
1596 _vala_ccode_node_unref0 (fc);
1597 fc = _tmp156_;
1598 _vala_ccode_node_unref0 (_tmp155_);
1599 _tmp157_ = fc;
1600 _tmp158_ = vala_ccode_identifier_new ("return_value");
1601 _tmp159_ = _tmp158_;
1602 _tmp160_ = vala_ccode_constant_new ("NULL");
1603 _tmp161_ = _tmp160_;
1604 _tmp162_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_INEQUALITY, (ValaCCodeExpression*) _tmp159_, (ValaCCodeExpression*) _tmp161_);
1605 _tmp163_ = _tmp162_;
1606 vala_ccode_function_call_add_argument (_tmp157_, (ValaCCodeExpression*) _tmp163_);
1607 _vala_ccode_node_unref0 (_tmp163_);
1608 _vala_ccode_node_unref0 (_tmp161_);
1609 _vala_ccode_node_unref0 (_tmp159_);
1610 _tmp164_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1611 _tmp165_ = _tmp164_;
1612 _tmp166_ = fc;
1613 vala_ccode_function_add_expression (_tmp165_, (ValaCCodeExpression*) _tmp166_);
1614 }
1615 _tmp167_ = vala_ccode_identifier_new ("g_return_if_fail");
1616 _tmp168_ = _tmp167_;
1617 _tmp169_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp168_);
1618 _vala_ccode_node_unref0 (fc);
1619 fc = _tmp169_;
1620 _vala_ccode_node_unref0 (_tmp168_);
1621 _tmp170_ = fc;
1622 _tmp171_ = vala_ccode_identifier_new ("n_param_values");
1623 _tmp172_ = _tmp171_;
1624 _tmp173_ = g_strdup_printf ("%i", n_params);
1625 _tmp174_ = _tmp173_;
1626 _tmp175_ = vala_ccode_constant_new (_tmp174_);
1627 _tmp176_ = _tmp175_;
1628 _tmp177_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_EQUALITY, (ValaCCodeExpression*) _tmp172_, (ValaCCodeExpression*) _tmp176_);
1629 _tmp178_ = _tmp177_;
1630 vala_ccode_function_call_add_argument (_tmp170_, (ValaCCodeExpression*) _tmp178_);
1631 _vala_ccode_node_unref0 (_tmp178_);
1632 _vala_ccode_node_unref0 (_tmp176_);
1633 _g_free0 (_tmp174_);
1634 _vala_ccode_node_unref0 (_tmp172_);
1635 _tmp179_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1636 _tmp180_ = _tmp179_;
1637 _tmp181_ = fc;
1638 vala_ccode_function_add_expression (_tmp180_, (ValaCCodeExpression*) _tmp181_);
1639 _tmp182_ = vala_ccode_identifier_new ("closure");
1640 _tmp183_ = _tmp182_;
1641 _tmp184_ = vala_ccode_member_access_new ((ValaCCodeExpression*) _tmp183_, "data", TRUE);
1642 _tmp185_ = _tmp184_;
1643 _vala_ccode_node_unref0 (_tmp183_);
1644 data = _tmp185_;
1645 _tmp186_ = vala_ccode_identifier_new ("param_values");
1646 _tmp187_ = _tmp186_;
1647 _tmp188_ = vala_ccode_member_access_new ((ValaCCodeExpression*) _tmp187_, "data[0]", TRUE);
1648 _tmp189_ = _tmp188_;
1649 _tmp190_ = vala_ccode_member_access_new ((ValaCCodeExpression*) _tmp189_, "v_pointer", FALSE);
1650 _tmp191_ = _tmp190_;
1651 _vala_ccode_node_unref0 (_tmp189_);
1652 _vala_ccode_node_unref0 (_tmp187_);
1653 param = _tmp191_;
1654 _tmp192_ = vala_ccode_constant_new ("G_CCLOSURE_SWAP_DATA");
1655 _tmp193_ = _tmp192_;
1656 _tmp194_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp193_);
1657 _tmp195_ = _tmp194_;
1658 _vala_ccode_node_unref0 (_tmp193_);
1659 cond = _tmp195_;
1660 _tmp196_ = cond;
1661 _tmp197_ = vala_ccode_identifier_new ("closure");
1662 _tmp198_ = _tmp197_;
1663 vala_ccode_function_call_add_argument (_tmp196_, (ValaCCodeExpression*) _tmp198_);
1664 _vala_ccode_node_unref0 (_tmp198_);
1665 _tmp199_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1666 _tmp200_ = _tmp199_;
1667 _tmp201_ = cond;
1668 vala_ccode_function_open_if (_tmp200_, (ValaCCodeExpression*) _tmp201_);
1669 _tmp202_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1670 _tmp203_ = _tmp202_;
1671 _tmp204_ = vala_ccode_identifier_new ("data1");
1672 _tmp205_ = _tmp204_;
1673 _tmp206_ = data;
1674 vala_ccode_function_add_assignment (_tmp203_, (ValaCCodeExpression*) _tmp205_, (ValaCCodeExpression*) _tmp206_);
1675 _vala_ccode_node_unref0 (_tmp205_);
1676 _tmp207_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1677 _tmp208_ = _tmp207_;
1678 _tmp209_ = vala_ccode_identifier_new ("data2");
1679 _tmp210_ = _tmp209_;
1680 _tmp211_ = param;
1681 vala_ccode_function_add_assignment (_tmp208_, (ValaCCodeExpression*) _tmp210_, (ValaCCodeExpression*) _tmp211_);
1682 _vala_ccode_node_unref0 (_tmp210_);
1683 _tmp212_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1684 _tmp213_ = _tmp212_;
1685 vala_ccode_function_add_else (_tmp213_);
1686 _tmp214_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1687 _tmp215_ = _tmp214_;
1688 _tmp216_ = vala_ccode_identifier_new ("data1");
1689 _tmp217_ = _tmp216_;
1690 _tmp218_ = param;
1691 vala_ccode_function_add_assignment (_tmp215_, (ValaCCodeExpression*) _tmp217_, (ValaCCodeExpression*) _tmp218_);
1692 _vala_ccode_node_unref0 (_tmp217_);
1693 _tmp219_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1694 _tmp220_ = _tmp219_;
1695 _tmp221_ = vala_ccode_identifier_new ("data2");
1696 _tmp222_ = _tmp221_;
1697 _tmp223_ = data;
1698 vala_ccode_function_add_assignment (_tmp220_, (ValaCCodeExpression*) _tmp222_, (ValaCCodeExpression*) _tmp223_);
1699 _vala_ccode_node_unref0 (_tmp222_);
1700 _tmp224_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1701 _tmp225_ = _tmp224_;
1702 vala_ccode_function_close (_tmp225_);
1703 _tmp226_ = vala_ccode_identifier_new ("marshal_data");
1704 _tmp227_ = _tmp226_;
1705 _tmp228_ = vala_ccode_identifier_new ("marshal_data");
1706 _tmp229_ = _tmp228_;
1707 _tmp230_ = vala_ccode_identifier_new ("cc");
1708 _tmp231_ = _tmp230_;
1709 _tmp232_ = vala_ccode_member_access_new ((ValaCCodeExpression*) _tmp231_, "callback", TRUE);
1710 _tmp233_ = _tmp232_;
1711 _tmp234_ = vala_ccode_conditional_expression_new ((ValaCCodeExpression*) _tmp227_, (ValaCCodeExpression*) _tmp229_, (ValaCCodeExpression*) _tmp233_);
1712 _tmp235_ = _tmp234_;
1713 _tmp236_ = vala_gsignal_module_get_marshaller_function (self, sig, params, return_type, "GMarshalFunc");
1714 _tmp237_ = _tmp236_;
1715 _tmp238_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) _tmp235_, _tmp237_);
1716 _tmp239_ = _tmp238_;
1717 _g_free0 (_tmp237_);
1718 _vala_ccode_node_unref0 (_tmp235_);
1719 _vala_ccode_node_unref0 (_tmp233_);
1720 _vala_ccode_node_unref0 (_tmp231_);
1721 _vala_ccode_node_unref0 (_tmp229_);
1722 _vala_ccode_node_unref0 (_tmp227_);
1723 c_assign_rhs = _tmp239_;
1724 _tmp240_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
1725 _tmp241_ = _tmp240_;
1726 _tmp242_ = vala_ccode_identifier_new ("callback");
1727 _tmp243_ = _tmp242_;
1728 _tmp244_ = c_assign_rhs;
1729 vala_ccode_function_add_assignment (_tmp241_, (ValaCCodeExpression*) _tmp243_, (ValaCCodeExpression*) _tmp244_);
1730 _vala_ccode_node_unref0 (_tmp243_);
1731 _tmp245_ = vala_ccode_identifier_new ("callback");
1732 _tmp246_ = _tmp245_;
1733 _tmp247_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp246_);
1734 _vala_ccode_node_unref0 (fc);
1735 fc = _tmp247_;
1736 _vala_ccode_node_unref0 (_tmp246_);
1737 _tmp248_ = fc;
1738 _tmp249_ = vala_ccode_identifier_new ("data1");
1739 _tmp250_ = _tmp249_;
1740 vala_ccode_function_call_add_argument (_tmp248_, (ValaCCodeExpression*) _tmp250_);
1741 _vala_ccode_node_unref0 (_tmp250_);
1742 i = 1;
1743 {
1744 ValaList* _p_list = NULL;
1745 ValaList* _tmp251_;
1746 gint _p_size = 0;
1747 ValaList* _tmp252_;
1748 gint _tmp253_;
1749 gint _tmp254_;
1750 gint _p_index = 0;
1751 _tmp251_ = _vala_iterable_ref0 (params);
1752 _p_list = _tmp251_;
1753 _tmp252_ = _p_list;
1754 _tmp253_ = vala_collection_get_size ((ValaCollection*) _tmp252_);
1755 _tmp254_ = _tmp253_;
1756 _p_size = _tmp254_;
1757 _p_index = -1;
1758 while (TRUE) {
1759 gint _tmp255_;
1760 gint _tmp256_;
1761 ValaParameter* p = NULL;
1762 ValaList* _tmp257_;
1763 gpointer _tmp258_;
1764 ValaCCodeFunctionCall* inner_fc = NULL;
1765 ValaParameter* _tmp259_;
1766 ValaParameterDirection _tmp260_;
1767 ValaParameterDirection _tmp261_;
1768 ValaCCodeFunctionCall* _tmp283_;
1769 ValaCCodeIdentifier* _tmp284_;
1770 ValaCCodeIdentifier* _tmp285_;
1771 gchar* _tmp286_;
1772 gchar* _tmp287_;
1773 ValaCCodeIdentifier* _tmp288_;
1774 ValaCCodeIdentifier* _tmp289_;
1775 ValaCCodeBinaryExpression* _tmp290_;
1776 ValaCCodeBinaryExpression* _tmp291_;
1777 ValaCCodeFunctionCall* _tmp292_;
1778 ValaCCodeFunctionCall* _tmp293_;
1779 gint _tmp294_;
1780 ValaParameter* _tmp295_;
1781 ValaDataType* _tmp296_;
1782 ValaDataType* _tmp297_;
1783 _p_index = _p_index + 1;
1784 _tmp255_ = _p_index;
1785 _tmp256_ = _p_size;
1786 if (!(_tmp255_ < _tmp256_)) {
1787 break;
1788 }
1789 _tmp257_ = _p_list;
1790 _tmp258_ = vala_list_get (_tmp257_, _p_index);
1791 p = (ValaParameter*) _tmp258_;
1792 _tmp259_ = p;
1793 _tmp260_ = vala_parameter_get_direction (_tmp259_);
1794 _tmp261_ = _tmp260_;
1795 if (_tmp261_ != VALA_PARAMETER_DIRECTION_IN) {
1796 ValaCCodeIdentifier* _tmp262_;
1797 ValaCCodeIdentifier* _tmp263_;
1798 ValaCCodeFunctionCall* _tmp264_;
1799 _tmp262_ = vala_ccode_identifier_new ("g_value_get_pointer");
1800 _tmp263_ = _tmp262_;
1801 _tmp264_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp263_);
1802 _vala_ccode_node_unref0 (inner_fc);
1803 inner_fc = _tmp264_;
1804 _vala_ccode_node_unref0 (_tmp263_);
1805 } else {
1806 gboolean _tmp265_ = FALSE;
1807 ValaParameter* _tmp266_;
1808 ValaDataType* _tmp267_;
1809 ValaDataType* _tmp268_;
1810 _tmp266_ = p;
1811 _tmp267_ = vala_variable_get_variable_type ((ValaVariable*) _tmp266_);
1812 _tmp268_ = _tmp267_;
1813 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp268_, VALA_TYPE_VALUE_TYPE)) {
1814 ValaParameter* _tmp269_;
1815 ValaDataType* _tmp270_;
1816 ValaDataType* _tmp271_;
1817 gboolean _tmp272_;
1818 gboolean _tmp273_;
1819 _tmp269_ = p;
1820 _tmp270_ = vala_variable_get_variable_type ((ValaVariable*) _tmp269_);
1821 _tmp271_ = _tmp270_;
1822 _tmp272_ = vala_data_type_get_nullable (_tmp271_);
1823 _tmp273_ = _tmp272_;
1824 _tmp265_ = _tmp273_;
1825 } else {
1826 _tmp265_ = FALSE;
1827 }
1828 if (_tmp265_) {
1829 ValaCCodeIdentifier* _tmp274_;
1830 ValaCCodeIdentifier* _tmp275_;
1831 ValaCCodeFunctionCall* _tmp276_;
1832 _tmp274_ = vala_ccode_identifier_new ("g_value_get_pointer");
1833 _tmp275_ = _tmp274_;
1834 _tmp276_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp275_);
1835 _vala_ccode_node_unref0 (inner_fc);
1836 inner_fc = _tmp276_;
1837 _vala_ccode_node_unref0 (_tmp275_);
1838 } else {
1839 ValaParameter* _tmp277_;
1840 ValaDataType* _tmp278_;
1841 ValaDataType* _tmp279_;
1842 ValaCCodeExpression* _tmp280_;
1843 ValaCCodeExpression* _tmp281_;
1844 ValaCCodeFunctionCall* _tmp282_;
1845 _tmp277_ = p;
1846 _tmp278_ = vala_variable_get_variable_type ((ValaVariable*) _tmp277_);
1847 _tmp279_ = _tmp278_;
1848 _tmp280_ = vala_ccode_base_module_get_value_getter_function ((ValaCCodeBaseModule*) self, _tmp279_);
1849 _tmp281_ = _tmp280_;
1850 _tmp282_ = vala_ccode_function_call_new (_tmp281_);
1851 _vala_ccode_node_unref0 (inner_fc);
1852 inner_fc = _tmp282_;
1853 _vala_ccode_node_unref0 (_tmp281_);
1854 }
1855 }
1856 _tmp283_ = inner_fc;
1857 _tmp284_ = vala_ccode_identifier_new ("param_values");
1858 _tmp285_ = _tmp284_;
1859 _tmp286_ = g_strdup_printf ("%i", i);
1860 _tmp287_ = _tmp286_;
1861 _tmp288_ = vala_ccode_identifier_new (_tmp287_);
1862 _tmp289_ = _tmp288_;
1863 _tmp290_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, (ValaCCodeExpression*) _tmp285_, (ValaCCodeExpression*) _tmp289_);
1864 _tmp291_ = _tmp290_;
1865 vala_ccode_function_call_add_argument (_tmp283_, (ValaCCodeExpression*) _tmp291_);
1866 _vala_ccode_node_unref0 (_tmp291_);
1867 _vala_ccode_node_unref0 (_tmp289_);
1868 _g_free0 (_tmp287_);
1869 _vala_ccode_node_unref0 (_tmp285_);
1870 _tmp292_ = fc;
1871 _tmp293_ = inner_fc;
1872 vala_ccode_function_call_add_argument (_tmp292_, (ValaCCodeExpression*) _tmp293_);
1873 _tmp294_ = i;
1874 i = _tmp294_ + 1;
1875 _tmp295_ = p;
1876 _tmp296_ = vala_variable_get_variable_type ((ValaVariable*) _tmp295_);
1877 _tmp297_ = _tmp296_;
1878 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp297_, VALA_TYPE_ARRAY_TYPE)) {
1879 ValaArrayType* array_type = NULL;
1880 ValaParameter* _tmp298_;
1881 ValaDataType* _tmp299_;
1882 ValaDataType* _tmp300_;
1883 ValaArrayType* _tmp301_;
1884 gchar* length_value_function = NULL;
1885 ValaArrayType* _tmp302_;
1886 ValaDataType* _tmp303_;
1887 ValaDataType* _tmp304_;
1888 ValaTypeSymbol* _tmp305_;
1889 ValaTypeSymbol* _tmp306_;
1890 gchar* _tmp307_;
1891 gboolean _tmp308_ = FALSE;
1892 const gchar* _tmp309_;
1893 _tmp298_ = p;
1894 _tmp299_ = vala_variable_get_variable_type ((ValaVariable*) _tmp298_);
1895 _tmp300_ = _tmp299_;
1896 _tmp301_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp300_, VALA_TYPE_ARRAY_TYPE, ValaArrayType));
1897 array_type = _tmp301_;
1898 _tmp302_ = array_type;
1899 _tmp303_ = vala_array_type_get_length_type (_tmp302_);
1900 _tmp304_ = _tmp303_;
1901 _tmp305_ = vala_data_type_get_type_symbol (_tmp304_);
1902 _tmp306_ = _tmp305_;
1903 _tmp307_ = vala_get_ccode_get_value_function ((ValaCodeNode*) _tmp306_);
1904 length_value_function = _tmp307_;
1905 _tmp309_ = length_value_function;
1906 if (_tmp309_ != NULL) {
1907 const gchar* _tmp310_;
1908 _tmp310_ = length_value_function;
1909 _tmp308_ = g_strcmp0 (_tmp310_, "") != 0;
1910 } else {
1911 _tmp308_ = FALSE;
1912 }
1913 _vala_assert (_tmp308_, "length_value_function != null && length_value_function != \"\"");
1914 {
1915 gint j = 0;
1916 j = 0;
1917 {
1918 gboolean _tmp311_ = FALSE;
1919 _tmp311_ = TRUE;
1920 while (TRUE) {
1921 ValaArrayType* _tmp313_;
1922 gint _tmp314_;
1923 gint _tmp315_;
1924 const gchar* _tmp316_;
1925 ValaCCodeIdentifier* _tmp317_;
1926 ValaCCodeIdentifier* _tmp318_;
1927 ValaCCodeFunctionCall* _tmp319_;
1928 ValaCCodeFunctionCall* _tmp320_;
1929 ValaCCodeIdentifier* _tmp321_;
1930 ValaCCodeIdentifier* _tmp322_;
1931 gchar* _tmp323_;
1932 gchar* _tmp324_;
1933 ValaCCodeIdentifier* _tmp325_;
1934 ValaCCodeIdentifier* _tmp326_;
1935 ValaCCodeBinaryExpression* _tmp327_;
1936 ValaCCodeBinaryExpression* _tmp328_;
1937 ValaCCodeFunctionCall* _tmp329_;
1938 ValaCCodeFunctionCall* _tmp330_;
1939 gint _tmp331_;
1940 if (!_tmp311_) {
1941 gint _tmp312_;
1942 _tmp312_ = j;
1943 j = _tmp312_ + 1;
1944 }
1945 _tmp311_ = FALSE;
1946 _tmp313_ = array_type;
1947 _tmp314_ = vala_array_type_get_rank (_tmp313_);
1948 _tmp315_ = _tmp314_;
1949 if (!(j < _tmp315_)) {
1950 break;
1951 }
1952 _tmp316_ = length_value_function;
1953 _tmp317_ = vala_ccode_identifier_new (_tmp316_);
1954 _tmp318_ = _tmp317_;
1955 _tmp319_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp318_);
1956 _vala_ccode_node_unref0 (inner_fc);
1957 inner_fc = _tmp319_;
1958 _vala_ccode_node_unref0 (_tmp318_);
1959 _tmp320_ = inner_fc;
1960 _tmp321_ = vala_ccode_identifier_new ("param_values");
1961 _tmp322_ = _tmp321_;
1962 _tmp323_ = g_strdup_printf ("%i", i);
1963 _tmp324_ = _tmp323_;
1964 _tmp325_ = vala_ccode_identifier_new (_tmp324_);
1965 _tmp326_ = _tmp325_;
1966 _tmp327_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, (ValaCCodeExpression*) _tmp322_, (ValaCCodeExpression*) _tmp326_);
1967 _tmp328_ = _tmp327_;
1968 vala_ccode_function_call_add_argument (_tmp320_, (ValaCCodeExpression*) _tmp328_);
1969 _vala_ccode_node_unref0 (_tmp328_);
1970 _vala_ccode_node_unref0 (_tmp326_);
1971 _g_free0 (_tmp324_);
1972 _vala_ccode_node_unref0 (_tmp322_);
1973 _tmp329_ = fc;
1974 _tmp330_ = inner_fc;
1975 vala_ccode_function_call_add_argument (_tmp329_, (ValaCCodeExpression*) _tmp330_);
1976 _tmp331_ = i;
1977 i = _tmp331_ + 1;
1978 }
1979 }
1980 }
1981 _g_free0 (length_value_function);
1982 _vala_code_node_unref0 (array_type);
1983 } else {
1984 ValaParameter* _tmp332_;
1985 ValaDataType* _tmp333_;
1986 ValaDataType* _tmp334_;
1987 _tmp332_ = p;
1988 _tmp333_ = vala_variable_get_variable_type ((ValaVariable*) _tmp332_);
1989 _tmp334_ = _tmp333_;
1990 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp334_, VALA_TYPE_DELEGATE_TYPE)) {
1991 ValaDelegateType* delegate_type = NULL;
1992 ValaParameter* _tmp335_;
1993 ValaDataType* _tmp336_;
1994 ValaDataType* _tmp337_;
1995 ValaDelegateType* _tmp338_;
1996 ValaDelegate* _tmp339_;
1997 ValaDelegate* _tmp340_;
1998 gboolean _tmp341_;
1999 gboolean _tmp342_;
2000 _tmp335_ = p;
2001 _tmp336_ = vala_variable_get_variable_type ((ValaVariable*) _tmp335_);
2002 _tmp337_ = _tmp336_;
2003 delegate_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp337_, VALA_TYPE_DELEGATE_TYPE, ValaDelegateType);
2004 _tmp338_ = delegate_type;
2005 _tmp339_ = vala_delegate_type_get_delegate_symbol (_tmp338_);
2006 _tmp340_ = _tmp339_;
2007 _tmp341_ = vala_delegate_get_has_target (_tmp340_);
2008 _tmp342_ = _tmp341_;
2009 if (_tmp342_) {
2010 ValaCCodeIdentifier* _tmp343_;
2011 ValaCCodeIdentifier* _tmp344_;
2012 ValaCCodeFunctionCall* _tmp345_;
2013 ValaCCodeFunctionCall* _tmp346_;
2014 ValaCCodeIdentifier* _tmp347_;
2015 ValaCCodeIdentifier* _tmp348_;
2016 gchar* _tmp349_;
2017 gchar* _tmp350_;
2018 ValaCCodeIdentifier* _tmp351_;
2019 ValaCCodeIdentifier* _tmp352_;
2020 ValaCCodeBinaryExpression* _tmp353_;
2021 ValaCCodeBinaryExpression* _tmp354_;
2022 ValaCCodeFunctionCall* _tmp355_;
2023 ValaCCodeFunctionCall* _tmp356_;
2024 gint _tmp357_;
2025 ValaDelegateType* _tmp358_;
2026 _tmp343_ = vala_ccode_identifier_new ("g_value_get_pointer");
2027 _tmp344_ = _tmp343_;
2028 _tmp345_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp344_);
2029 _vala_ccode_node_unref0 (inner_fc);
2030 inner_fc = _tmp345_;
2031 _vala_ccode_node_unref0 (_tmp344_);
2032 _tmp346_ = inner_fc;
2033 _tmp347_ = vala_ccode_identifier_new ("param_values");
2034 _tmp348_ = _tmp347_;
2035 _tmp349_ = g_strdup_printf ("%i", i);
2036 _tmp350_ = _tmp349_;
2037 _tmp351_ = vala_ccode_identifier_new (_tmp350_);
2038 _tmp352_ = _tmp351_;
2039 _tmp353_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, (ValaCCodeExpression*) _tmp348_, (ValaCCodeExpression*) _tmp352_);
2040 _tmp354_ = _tmp353_;
2041 vala_ccode_function_call_add_argument (_tmp346_, (ValaCCodeExpression*) _tmp354_);
2042 _vala_ccode_node_unref0 (_tmp354_);
2043 _vala_ccode_node_unref0 (_tmp352_);
2044 _g_free0 (_tmp350_);
2045 _vala_ccode_node_unref0 (_tmp348_);
2046 _tmp355_ = fc;
2047 _tmp356_ = inner_fc;
2048 vala_ccode_function_call_add_argument (_tmp355_, (ValaCCodeExpression*) _tmp356_);
2049 _tmp357_ = i;
2050 i = _tmp357_ + 1;
2051 _tmp358_ = delegate_type;
2052 if (vala_data_type_is_disposable ((ValaDataType*) _tmp358_)) {
2053 ValaCCodeIdentifier* _tmp359_;
2054 ValaCCodeIdentifier* _tmp360_;
2055 ValaCCodeFunctionCall* _tmp361_;
2056 ValaCCodeFunctionCall* _tmp362_;
2057 ValaCCodeIdentifier* _tmp363_;
2058 ValaCCodeIdentifier* _tmp364_;
2059 gchar* _tmp365_;
2060 gchar* _tmp366_;
2061 ValaCCodeIdentifier* _tmp367_;
2062 ValaCCodeIdentifier* _tmp368_;
2063 ValaCCodeBinaryExpression* _tmp369_;
2064 ValaCCodeBinaryExpression* _tmp370_;
2065 ValaCCodeFunctionCall* _tmp371_;
2066 ValaCCodeFunctionCall* _tmp372_;
2067 gint _tmp373_;
2068 _tmp359_ = vala_ccode_identifier_new ("g_value_get_pointer");
2069 _tmp360_ = _tmp359_;
2070 _tmp361_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp360_);
2071 _vala_ccode_node_unref0 (inner_fc);
2072 inner_fc = _tmp361_;
2073 _vala_ccode_node_unref0 (_tmp360_);
2074 _tmp362_ = inner_fc;
2075 _tmp363_ = vala_ccode_identifier_new ("param_values");
2076 _tmp364_ = _tmp363_;
2077 _tmp365_ = g_strdup_printf ("%i", i);
2078 _tmp366_ = _tmp365_;
2079 _tmp367_ = vala_ccode_identifier_new (_tmp366_);
2080 _tmp368_ = _tmp367_;
2081 _tmp369_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, (ValaCCodeExpression*) _tmp364_, (ValaCCodeExpression*) _tmp368_);
2082 _tmp370_ = _tmp369_;
2083 vala_ccode_function_call_add_argument (_tmp362_, (ValaCCodeExpression*) _tmp370_);
2084 _vala_ccode_node_unref0 (_tmp370_);
2085 _vala_ccode_node_unref0 (_tmp368_);
2086 _g_free0 (_tmp366_);
2087 _vala_ccode_node_unref0 (_tmp364_);
2088 _tmp371_ = fc;
2089 _tmp372_ = inner_fc;
2090 vala_ccode_function_call_add_argument (_tmp371_, (ValaCCodeExpression*) _tmp372_);
2091 _tmp373_ = i;
2092 i = _tmp373_ + 1;
2093 }
2094 }
2095 }
2096 }
2097 _vala_ccode_node_unref0 (inner_fc);
2098 _vala_code_node_unref0 (p);
2099 }
2100 _vala_iterable_unref0 (_p_list);
2101 }
2102 _tmp374_ = vala_callable_get_return_type ((ValaCallable*) sig);
2103 _tmp375_ = _tmp374_;
2104 if (vala_data_type_is_real_non_null_struct_type (_tmp375_)) {
2105 ValaCCodeFunctionCall* inner_fc = NULL;
2106 ValaCCodeIdentifier* _tmp376_;
2107 ValaCCodeIdentifier* _tmp377_;
2108 ValaCCodeFunctionCall* _tmp378_;
2109 ValaCCodeFunctionCall* _tmp379_;
2110 ValaCCodeFunctionCall* _tmp380_;
2111 ValaCCodeIdentifier* _tmp381_;
2112 ValaCCodeIdentifier* _tmp382_;
2113 gchar* _tmp383_;
2114 gchar* _tmp384_;
2115 ValaCCodeIdentifier* _tmp385_;
2116 ValaCCodeIdentifier* _tmp386_;
2117 ValaCCodeBinaryExpression* _tmp387_;
2118 ValaCCodeBinaryExpression* _tmp388_;
2119 ValaCCodeFunctionCall* _tmp389_;
2120 ValaCCodeFunctionCall* _tmp390_;
2121 gint _tmp391_;
2122 _tmp376_ = vala_ccode_identifier_new ("g_value_get_pointer");
2123 _tmp377_ = _tmp376_;
2124 _tmp378_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp377_);
2125 _tmp379_ = _tmp378_;
2126 _vala_ccode_node_unref0 (_tmp377_);
2127 inner_fc = _tmp379_;
2128 _tmp380_ = inner_fc;
2129 _tmp381_ = vala_ccode_identifier_new ("param_values");
2130 _tmp382_ = _tmp381_;
2131 _tmp383_ = g_strdup_printf ("%i", i);
2132 _tmp384_ = _tmp383_;
2133 _tmp385_ = vala_ccode_identifier_new (_tmp384_);
2134 _tmp386_ = _tmp385_;
2135 _tmp387_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, (ValaCCodeExpression*) _tmp382_, (ValaCCodeExpression*) _tmp386_);
2136 _tmp388_ = _tmp387_;
2137 vala_ccode_function_call_add_argument (_tmp380_, (ValaCCodeExpression*) _tmp388_);
2138 _vala_ccode_node_unref0 (_tmp388_);
2139 _vala_ccode_node_unref0 (_tmp386_);
2140 _g_free0 (_tmp384_);
2141 _vala_ccode_node_unref0 (_tmp382_);
2142 _tmp389_ = fc;
2143 _tmp390_ = inner_fc;
2144 vala_ccode_function_call_add_argument (_tmp389_, (ValaCCodeExpression*) _tmp390_);
2145 _tmp391_ = i;
2146 i = _tmp391_ + 1;
2147 _vala_ccode_node_unref0 (inner_fc);
2148 }
2149 _tmp392_ = fc;
2150 _tmp393_ = vala_ccode_identifier_new ("data2");
2151 _tmp394_ = _tmp393_;
2152 vala_ccode_function_call_add_argument (_tmp392_, (ValaCCodeExpression*) _tmp394_);
2153 _vala_ccode_node_unref0 (_tmp394_);
2154 _tmp396_ = vala_data_type_get_type_symbol (return_type);
2155 _tmp397_ = _tmp396_;
2156 if (_tmp397_ != NULL) {
2157 _tmp395_ = TRUE;
2158 } else {
2159 _tmp395_ = G_TYPE_CHECK_INSTANCE_TYPE (return_type, VALA_TYPE_ARRAY_TYPE);
2160 }
2161 if (_tmp395_) {
2162 ValaCCodeFunction* _tmp398_;
2163 ValaCCodeFunction* _tmp399_;
2164 ValaCCodeIdentifier* _tmp400_;
2165 ValaCCodeIdentifier* _tmp401_;
2166 ValaCCodeFunctionCall* _tmp402_;
2167 ValaCCodeFunctionCall* set_fc = NULL;
2168 ValaCCodeFunctionCall* _tmp414_;
2169 ValaCCodeIdentifier* _tmp415_;
2170 ValaCCodeIdentifier* _tmp416_;
2171 ValaCCodeFunctionCall* _tmp417_;
2172 ValaCCodeIdentifier* _tmp418_;
2173 ValaCCodeIdentifier* _tmp419_;
2174 ValaCCodeFunction* _tmp420_;
2175 ValaCCodeFunction* _tmp421_;
2176 ValaCCodeFunctionCall* _tmp422_;
2177 _tmp398_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
2178 _tmp399_ = _tmp398_;
2179 _tmp400_ = vala_ccode_identifier_new ("v_return");
2180 _tmp401_ = _tmp400_;
2181 _tmp402_ = fc;
2182 vala_ccode_function_add_assignment (_tmp399_, (ValaCCodeExpression*) _tmp401_, (ValaCCodeExpression*) _tmp402_);
2183 _vala_ccode_node_unref0 (_tmp401_);
2184 if (G_TYPE_CHECK_INSTANCE_TYPE (return_type, VALA_TYPE_VALUE_TYPE)) {
2185 gboolean _tmp403_;
2186 gboolean _tmp404_;
2187 _tmp403_ = vala_data_type_get_nullable (return_type);
2188 _tmp404_ = _tmp403_;
2189 if (_tmp404_) {
2190 ValaCCodeIdentifier* _tmp405_;
2191 ValaCCodeIdentifier* _tmp406_;
2192 ValaCCodeFunctionCall* _tmp407_;
2193 _tmp405_ = vala_ccode_identifier_new ("g_value_set_pointer");
2194 _tmp406_ = _tmp405_;
2195 _tmp407_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp406_);
2196 _vala_ccode_node_unref0 (set_fc);
2197 set_fc = _tmp407_;
2198 _vala_ccode_node_unref0 (_tmp406_);
2199 } else {
2200 ValaCCodeExpression* _tmp408_;
2201 ValaCCodeExpression* _tmp409_;
2202 ValaCCodeFunctionCall* _tmp410_;
2203 _tmp408_ = vala_ccode_base_module_get_value_setter_function ((ValaCCodeBaseModule*) self, return_type);
2204 _tmp409_ = _tmp408_;
2205 _tmp410_ = vala_ccode_function_call_new (_tmp409_);
2206 _vala_ccode_node_unref0 (set_fc);
2207 set_fc = _tmp410_;
2208 _vala_ccode_node_unref0 (_tmp409_);
2209 }
2210 } else {
2211 ValaCCodeExpression* _tmp411_;
2212 ValaCCodeExpression* _tmp412_;
2213 ValaCCodeFunctionCall* _tmp413_;
2214 _tmp411_ = vala_ccode_base_module_get_value_taker_function ((ValaCCodeBaseModule*) self, return_type);
2215 _tmp412_ = _tmp411_;
2216 _tmp413_ = vala_ccode_function_call_new (_tmp412_);
2217 _vala_ccode_node_unref0 (set_fc);
2218 set_fc = _tmp413_;
2219 _vala_ccode_node_unref0 (_tmp412_);
2220 }
2221 _tmp414_ = set_fc;
2222 _tmp415_ = vala_ccode_identifier_new ("return_value");
2223 _tmp416_ = _tmp415_;
2224 vala_ccode_function_call_add_argument (_tmp414_, (ValaCCodeExpression*) _tmp416_);
2225 _vala_ccode_node_unref0 (_tmp416_);
2226 _tmp417_ = set_fc;
2227 _tmp418_ = vala_ccode_identifier_new ("v_return");
2228 _tmp419_ = _tmp418_;
2229 vala_ccode_function_call_add_argument (_tmp417_, (ValaCCodeExpression*) _tmp419_);
2230 _vala_ccode_node_unref0 (_tmp419_);
2231 _tmp420_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
2232 _tmp421_ = _tmp420_;
2233 _tmp422_ = set_fc;
2234 vala_ccode_function_add_expression (_tmp421_, (ValaCCodeExpression*) _tmp422_);
2235 _vala_ccode_node_unref0 (set_fc);
2236 } else {
2237 ValaCCodeFunction* _tmp423_;
2238 ValaCCodeFunction* _tmp424_;
2239 ValaCCodeFunctionCall* _tmp425_;
2240 _tmp423_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
2241 _tmp424_ = _tmp423_;
2242 _tmp425_ = fc;
2243 vala_ccode_function_add_expression (_tmp424_, (ValaCCodeExpression*) _tmp425_);
2244 }
2245 vala_ccode_base_module_pop_function ((ValaCCodeBaseModule*) self);
2246 _tmp426_ = ((ValaCCodeBaseModule*) self)->cfile;
2247 _tmp427_ = signal_marshaller;
2248 vala_ccode_file_add_function_declaration (_tmp426_, _tmp427_);
2249 _tmp428_ = ((ValaCCodeBaseModule*) self)->cfile;
2250 _tmp429_ = signal_marshaller;
2251 vala_ccode_file_add_function (_tmp428_, _tmp429_);
2252 _tmp430_ = ((ValaCCodeBaseModule*) self)->user_marshal_set;
2253 _tmp431_ = signature;
2254 vala_collection_add ((ValaCollection*) _tmp430_, _tmp431_);
2255 _vala_ccode_node_unref0 (c_assign_rhs);
2256 _vala_ccode_node_unref0 (cond);
2257 _vala_ccode_node_unref0 (param);
2258 _vala_ccode_node_unref0 (data);
2259 _vala_ccode_node_unref0 (fc);
2260 _vala_ccode_node_unref0 (callback_decl);
2261 _vala_ccode_node_unref0 (signal_marshaller);
2262 _g_free0 (signature);
2263 }
2264
2265 static void
_vala_array_add1(gchar *** array,gint * length,gint * size,gchar * value)2266 _vala_array_add1 (gchar** * array,
2267 gint* length,
2268 gint* size,
2269 gchar* value)
2270 {
2271 if ((*length) == (*size)) {
2272 *size = (*size) ? (2 * (*size)) : 4;
2273 *array = g_renew (gchar*, *array, (*size) + 1);
2274 }
2275 (*array)[(*length)++] = value;
2276 (*array)[*length] = NULL;
2277 }
2278
2279 static void
_vala_array_add2(gchar *** array,gint * length,gint * size,gchar * value)2280 _vala_array_add2 (gchar** * array,
2281 gint* length,
2282 gint* size,
2283 gchar* value)
2284 {
2285 if ((*length) == (*size)) {
2286 *size = (*size) ? (2 * (*size)) : 4;
2287 *array = g_renew (gchar*, *array, (*size) + 1);
2288 }
2289 (*array)[(*length)++] = value;
2290 (*array)[*length] = NULL;
2291 }
2292
2293 static void
_vala_array_add3(gchar *** array,gint * length,gint * size,gchar * value)2294 _vala_array_add3 (gchar** * array,
2295 gint* length,
2296 gint* size,
2297 gchar* value)
2298 {
2299 if ((*length) == (*size)) {
2300 *size = (*size) ? (2 * (*size)) : 4;
2301 *array = g_renew (gchar*, *array, (*size) + 1);
2302 }
2303 (*array)[(*length)++] = value;
2304 (*array)[*length] = NULL;
2305 }
2306
2307 static void
_vala_array_add4(gchar *** array,gint * length,gint * size,gchar * value)2308 _vala_array_add4 (gchar** * array,
2309 gint* length,
2310 gint* size,
2311 gchar* value)
2312 {
2313 if ((*length) == (*size)) {
2314 *size = (*size) ? (2 * (*size)) : 4;
2315 *array = g_renew (gchar*, *array, (*size) + 1);
2316 }
2317 (*array)[(*length)++] = value;
2318 (*array)[*length] = NULL;
2319 }
2320
2321 static void
_vala_array_add5(gchar *** array,gint * length,gint * size,gchar * value)2322 _vala_array_add5 (gchar** * array,
2323 gint* length,
2324 gint* size,
2325 gchar* value)
2326 {
2327 if ((*length) == (*size)) {
2328 *size = (*size) ? (2 * (*size)) : 4;
2329 *array = g_renew (gchar*, *array, (*size) + 1);
2330 }
2331 (*array)[(*length)++] = value;
2332 (*array)[*length] = NULL;
2333 }
2334
2335 static void
_vala_array_add6(gchar *** array,gint * length,gint * size,gchar * value)2336 _vala_array_add6 (gchar** * array,
2337 gint* length,
2338 gint* size,
2339 gchar* value)
2340 {
2341 if ((*length) == (*size)) {
2342 *size = (*size) ? (2 * (*size)) : 4;
2343 *array = g_renew (gchar*, *array, (*size) + 1);
2344 }
2345 (*array)[(*length)++] = value;
2346 (*array)[*length] = NULL;
2347 }
2348
2349 static void
_vala_array_add7(gchar *** array,gint * length,gint * size,gchar * value)2350 _vala_array_add7 (gchar** * array,
2351 gint* length,
2352 gint* size,
2353 gchar* value)
2354 {
2355 if ((*length) == (*size)) {
2356 *size = (*size) ? (2 * (*size)) : 4;
2357 *array = g_renew (gchar*, *array, (*size) + 1);
2358 }
2359 (*array)[(*length)++] = value;
2360 (*array)[*length] = NULL;
2361 }
2362
2363 static void
_vala_array_add8(gchar *** array,gint * length,gint * size,gchar * value)2364 _vala_array_add8 (gchar** * array,
2365 gint* length,
2366 gint* size,
2367 gchar* value)
2368 {
2369 if ((*length) == (*size)) {
2370 *size = (*size) ? (2 * (*size)) : 4;
2371 *array = g_renew (gchar*, *array, (*size) + 1);
2372 }
2373 (*array)[(*length)++] = value;
2374 (*array)[*length] = NULL;
2375 }
2376
2377 static gchar*
_vala_g_strjoinv(const gchar * separator,gchar ** str_array,gint str_array_length1)2378 _vala_g_strjoinv (const gchar* separator,
2379 gchar** str_array,
2380 gint str_array_length1)
2381 {
2382 gboolean _tmp0_ = FALSE;
2383 gchar* result = NULL;
2384 if (separator == NULL) {
2385 separator = "";
2386 }
2387 if (str_array != NULL) {
2388 gboolean _tmp1_ = FALSE;
2389 if (str_array_length1 > 0) {
2390 _tmp1_ = TRUE;
2391 } else {
2392 gboolean _tmp2_ = FALSE;
2393 if (str_array_length1 == -1) {
2394 const gchar* _tmp3_;
2395 _tmp3_ = str_array[0];
2396 _tmp2_ = _tmp3_ != NULL;
2397 } else {
2398 _tmp2_ = FALSE;
2399 }
2400 _tmp1_ = _tmp2_;
2401 }
2402 _tmp0_ = _tmp1_;
2403 } else {
2404 _tmp0_ = FALSE;
2405 }
2406 if (_tmp0_) {
2407 gint i = 0;
2408 gsize len = 0UL;
2409 gint _tmp16_;
2410 gint _tmp17_;
2411 const gchar* res = NULL;
2412 void* _tmp18_;
2413 void* ptr = NULL;
2414 const gchar* _tmp19_;
2415 const gchar* _tmp20_;
2416 void* _tmp21_;
2417 const gchar* _tmp31_;
2418 len = (gsize) 1;
2419 {
2420 gboolean _tmp4_ = FALSE;
2421 i = 0;
2422 _tmp4_ = TRUE;
2423 while (TRUE) {
2424 gboolean _tmp6_ = FALSE;
2425 gboolean _tmp7_ = FALSE;
2426 gint _tmp10_ = 0;
2427 const gchar* _tmp11_;
2428 if (!_tmp4_) {
2429 gint _tmp5_;
2430 _tmp5_ = i;
2431 i = _tmp5_ + 1;
2432 }
2433 _tmp4_ = FALSE;
2434 if (str_array_length1 != -1) {
2435 _tmp7_ = i < str_array_length1;
2436 } else {
2437 _tmp7_ = FALSE;
2438 }
2439 if (_tmp7_) {
2440 _tmp6_ = TRUE;
2441 } else {
2442 gboolean _tmp8_ = FALSE;
2443 if (str_array_length1 == -1) {
2444 const gchar* _tmp9_;
2445 _tmp9_ = str_array[i];
2446 _tmp8_ = _tmp9_ != NULL;
2447 } else {
2448 _tmp8_ = FALSE;
2449 }
2450 _tmp6_ = _tmp8_;
2451 }
2452 if (!_tmp6_) {
2453 break;
2454 }
2455 _tmp11_ = str_array[i];
2456 if (_tmp11_ != NULL) {
2457 const gchar* _tmp12_;
2458 gint _tmp13_;
2459 gint _tmp14_;
2460 _tmp12_ = str_array[i];
2461 _tmp13_ = strlen ((const gchar*) _tmp12_);
2462 _tmp14_ = _tmp13_;
2463 _tmp10_ = _tmp14_;
2464 } else {
2465 _tmp10_ = 0;
2466 }
2467 len += (gsize) _tmp10_;
2468 }
2469 }
2470 if (i == 0) {
2471 gchar* _tmp15_;
2472 _tmp15_ = g_strdup ("");
2473 result = _tmp15_;
2474 return result;
2475 }
2476 str_array_length1 = i;
2477 _tmp16_ = strlen ((const gchar*) separator);
2478 _tmp17_ = _tmp16_;
2479 len += (gsize) (_tmp17_ * (i - 1));
2480 _tmp18_ = g_malloc (len);
2481 res = _tmp18_;
2482 _tmp19_ = res;
2483 _tmp20_ = str_array[0];
2484 _tmp21_ = g_stpcpy ((void*) _tmp19_, (const gchar*) _tmp20_);
2485 ptr = _tmp21_;
2486 {
2487 gboolean _tmp22_ = FALSE;
2488 i = 1;
2489 _tmp22_ = TRUE;
2490 while (TRUE) {
2491 void* _tmp24_;
2492 void* _tmp25_;
2493 const gchar* _tmp26_ = NULL;
2494 const gchar* _tmp27_;
2495 void* _tmp29_;
2496 void* _tmp30_;
2497 if (!_tmp22_) {
2498 gint _tmp23_;
2499 _tmp23_ = i;
2500 i = _tmp23_ + 1;
2501 }
2502 _tmp22_ = FALSE;
2503 if (!(i < str_array_length1)) {
2504 break;
2505 }
2506 _tmp24_ = ptr;
2507 _tmp25_ = g_stpcpy (_tmp24_, (const gchar*) separator);
2508 ptr = _tmp25_;
2509 _tmp27_ = str_array[i];
2510 if (_tmp27_ != NULL) {
2511 const gchar* _tmp28_;
2512 _tmp28_ = str_array[i];
2513 _tmp26_ = (const gchar*) _tmp28_;
2514 } else {
2515 _tmp26_ = "";
2516 }
2517 _tmp29_ = ptr;
2518 _tmp30_ = g_stpcpy (_tmp29_, _tmp26_);
2519 ptr = _tmp30_;
2520 }
2521 }
2522 _tmp31_ = res;
2523 res = NULL;
2524 result = (gchar*) _tmp31_;
2525 return result;
2526 } else {
2527 gchar* _tmp32_;
2528 _tmp32_ = g_strdup ("");
2529 result = _tmp32_;
2530 return result;
2531 }
2532 }
2533
2534 static ValaCCodeExpression*
vala_gsignal_module_real_get_signal_creation(ValaCCodeBaseModule * base,ValaSignal * sig,ValaObjectTypeSymbol * type)2535 vala_gsignal_module_real_get_signal_creation (ValaCCodeBaseModule* base,
2536 ValaSignal* sig,
2537 ValaObjectTypeSymbol* type)
2538 {
2539 ValaGSignalModule * self;
2540 ValaCCodeFunctionCall* csignew = NULL;
2541 ValaCCodeIdentifier* _tmp0_;
2542 ValaCCodeIdentifier* _tmp1_;
2543 ValaCCodeFunctionCall* _tmp2_;
2544 ValaCCodeFunctionCall* _tmp3_;
2545 ValaCCodeFunctionCall* _tmp4_;
2546 gchar* _tmp5_;
2547 gchar* _tmp6_;
2548 gchar* _tmp7_;
2549 gchar* _tmp8_;
2550 ValaCCodeConstant* _tmp9_;
2551 ValaCCodeConstant* _tmp10_;
2552 ValaCCodeFunctionCall* _tmp11_;
2553 gchar* _tmp12_;
2554 gchar* _tmp13_;
2555 ValaCCodeIdentifier* _tmp14_;
2556 ValaCCodeIdentifier* _tmp15_;
2557 gchar** flags = NULL;
2558 gchar** _tmp16_;
2559 gint flags_length1;
2560 gint _flags_size_;
2561 gchar* run_type = NULL;
2562 gchar* _tmp17_;
2563 const gchar* _tmp18_;
2564 ValaVersionAttribute* _tmp27_;
2565 ValaVersionAttribute* _tmp28_;
2566 gboolean _tmp29_;
2567 gboolean _tmp30_;
2568 ValaCCodeFunctionCall* _tmp32_;
2569 gchar** _tmp33_;
2570 gint _tmp33__length1;
2571 gchar* _tmp34_;
2572 gchar* _tmp35_;
2573 ValaCCodeConstant* _tmp36_;
2574 ValaCCodeConstant* _tmp37_;
2575 ValaMethod* _tmp38_;
2576 ValaMethod* _tmp39_;
2577 ValaCCodeFunctionCall* _tmp61_;
2578 ValaCCodeConstant* _tmp62_;
2579 ValaCCodeConstant* _tmp63_;
2580 ValaCCodeFunctionCall* _tmp64_;
2581 ValaCCodeConstant* _tmp65_;
2582 ValaCCodeConstant* _tmp66_;
2583 ValaList* params = NULL;
2584 ValaList* _tmp67_;
2585 gchar* marshaller = NULL;
2586 ValaDataType* _tmp68_;
2587 ValaDataType* _tmp69_;
2588 ValaCCodeIdentifier* marshal_arg = NULL;
2589 const gchar* _tmp78_;
2590 ValaCCodeIdentifier* _tmp79_;
2591 ValaCCodeFunctionCall* _tmp80_;
2592 ValaCCodeIdentifier* _tmp81_;
2593 gboolean _tmp82_ = FALSE;
2594 ValaDataType* _tmp83_;
2595 ValaDataType* _tmp84_;
2596 gint params_len = 0;
2597 ValaDataType* _tmp158_;
2598 ValaDataType* _tmp159_;
2599 ValaCCodeFunctionCall* _tmp161_;
2600 gchar* _tmp162_;
2601 gchar* _tmp163_;
2602 ValaCCodeConstant* _tmp164_;
2603 ValaCCodeConstant* _tmp165_;
2604 ValaDataType* _tmp279_;
2605 ValaDataType* _tmp280_;
2606 ValaCCodeIdentifier* _tmp284_;
2607 const gchar* _tmp285_;
2608 ValaCCodeExpression* _tmp286_;
2609 ValaCCodeExpression* _tmp287_;
2610 ValaCCodeFunctionCall* _tmp288_;
2611 ValaCCodeAssignment* _tmp289_;
2612 ValaCCodeExpression* _tmp290_;
2613 ValaCCodeExpression* result = NULL;
2614 self = (ValaGSignalModule*) base;
2615 g_return_val_if_fail (sig != NULL, NULL);
2616 g_return_val_if_fail (type != NULL, NULL);
2617 _tmp0_ = vala_ccode_identifier_new ("g_signal_new");
2618 _tmp1_ = _tmp0_;
2619 _tmp2_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp1_);
2620 _tmp3_ = _tmp2_;
2621 _vala_ccode_node_unref0 (_tmp1_);
2622 csignew = _tmp3_;
2623 _tmp4_ = csignew;
2624 _tmp5_ = vala_get_ccode_name ((ValaCodeNode*) sig);
2625 _tmp6_ = _tmp5_;
2626 _tmp7_ = g_strdup_printf ("\"%s\"", _tmp6_);
2627 _tmp8_ = _tmp7_;
2628 _tmp9_ = vala_ccode_constant_new (_tmp8_);
2629 _tmp10_ = _tmp9_;
2630 vala_ccode_function_call_add_argument (_tmp4_, (ValaCCodeExpression*) _tmp10_);
2631 _vala_ccode_node_unref0 (_tmp10_);
2632 _g_free0 (_tmp8_);
2633 _g_free0 (_tmp6_);
2634 _tmp11_ = csignew;
2635 _tmp12_ = vala_get_ccode_type_id ((ValaCodeNode*) type);
2636 _tmp13_ = _tmp12_;
2637 _tmp14_ = vala_ccode_identifier_new (_tmp13_);
2638 _tmp15_ = _tmp14_;
2639 vala_ccode_function_call_add_argument (_tmp11_, (ValaCCodeExpression*) _tmp15_);
2640 _vala_ccode_node_unref0 (_tmp15_);
2641 _g_free0 (_tmp13_);
2642 _tmp16_ = g_new0 (gchar*, 0 + 1);
2643 flags = _tmp16_;
2644 flags_length1 = 0;
2645 _flags_size_ = flags_length1;
2646 _tmp17_ = vala_code_node_get_attribute_string ((ValaCodeNode*) sig, "Signal", "run", NULL);
2647 run_type = _tmp17_;
2648 _tmp18_ = run_type;
2649 if (g_strcmp0 (_tmp18_, "first") == 0) {
2650 gchar* _tmp19_;
2651 _tmp19_ = g_strdup ("G_SIGNAL_RUN_FIRST");
2652 _vala_array_add1 (&flags, &flags_length1, &_flags_size_, _tmp19_);
2653 } else {
2654 const gchar* _tmp20_;
2655 _tmp20_ = run_type;
2656 if (g_strcmp0 (_tmp20_, "cleanup") == 0) {
2657 gchar* _tmp21_;
2658 _tmp21_ = g_strdup ("G_SIGNAL_RUN_CLEANUP");
2659 _vala_array_add2 (&flags, &flags_length1, &_flags_size_, _tmp21_);
2660 } else {
2661 gchar* _tmp22_;
2662 _tmp22_ = g_strdup ("G_SIGNAL_RUN_LAST");
2663 _vala_array_add3 (&flags, &flags_length1, &_flags_size_, _tmp22_);
2664 }
2665 }
2666 if (vala_code_node_get_attribute_bool ((ValaCodeNode*) sig, "Signal", "detailed", FALSE)) {
2667 gchar* _tmp23_;
2668 _tmp23_ = g_strdup ("G_SIGNAL_DETAILED");
2669 _vala_array_add4 (&flags, &flags_length1, &_flags_size_, _tmp23_);
2670 }
2671 if (vala_code_node_get_attribute_bool ((ValaCodeNode*) sig, "Signal", "no_recurse", FALSE)) {
2672 gchar* _tmp24_;
2673 _tmp24_ = g_strdup ("G_SIGNAL_NO_RECURSE");
2674 _vala_array_add5 (&flags, &flags_length1, &_flags_size_, _tmp24_);
2675 }
2676 if (vala_code_node_get_attribute_bool ((ValaCodeNode*) sig, "Signal", "action", FALSE)) {
2677 gchar* _tmp25_;
2678 _tmp25_ = g_strdup ("G_SIGNAL_ACTION");
2679 _vala_array_add6 (&flags, &flags_length1, &_flags_size_, _tmp25_);
2680 }
2681 if (vala_code_node_get_attribute_bool ((ValaCodeNode*) sig, "Signal", "no_hooks", FALSE)) {
2682 gchar* _tmp26_;
2683 _tmp26_ = g_strdup ("G_SIGNAL_NO_HOOKS");
2684 _vala_array_add7 (&flags, &flags_length1, &_flags_size_, _tmp26_);
2685 }
2686 _tmp27_ = vala_symbol_get_version ((ValaSymbol*) sig);
2687 _tmp28_ = _tmp27_;
2688 _tmp29_ = vala_version_attribute_get_deprecated (_tmp28_);
2689 _tmp30_ = _tmp29_;
2690 if (_tmp30_) {
2691 gchar* _tmp31_;
2692 _tmp31_ = g_strdup ("G_SIGNAL_DEPRECATED");
2693 _vala_array_add8 (&flags, &flags_length1, &_flags_size_, _tmp31_);
2694 }
2695 _tmp32_ = csignew;
2696 _tmp33_ = flags;
2697 _tmp33__length1 = flags_length1;
2698 _tmp34_ = _vala_g_strjoinv (" | ", _tmp33_, (gint) _tmp33__length1);
2699 _tmp35_ = _tmp34_;
2700 _tmp36_ = vala_ccode_constant_new (_tmp35_);
2701 _tmp37_ = _tmp36_;
2702 vala_ccode_function_call_add_argument (_tmp32_, (ValaCCodeExpression*) _tmp37_);
2703 _vala_ccode_node_unref0 (_tmp37_);
2704 _g_free0 (_tmp35_);
2705 _tmp38_ = vala_signal_get_default_handler (sig);
2706 _tmp39_ = _tmp38_;
2707 if (_tmp39_ == NULL) {
2708 ValaCCodeFunctionCall* _tmp40_;
2709 ValaCCodeConstant* _tmp41_;
2710 ValaCCodeConstant* _tmp42_;
2711 _tmp40_ = csignew;
2712 _tmp41_ = vala_ccode_constant_new ("0");
2713 _tmp42_ = _tmp41_;
2714 vala_ccode_function_call_add_argument (_tmp40_, (ValaCCodeExpression*) _tmp42_);
2715 _vala_ccode_node_unref0 (_tmp42_);
2716 } else {
2717 ValaCCodeFunctionCall* struct_offset = NULL;
2718 ValaCCodeIdentifier* _tmp43_;
2719 ValaCCodeIdentifier* _tmp44_;
2720 ValaCCodeFunctionCall* _tmp45_;
2721 ValaCCodeFunctionCall* _tmp46_;
2722 ValaCCodeFunctionCall* _tmp47_;
2723 gchar* _tmp48_;
2724 gchar* _tmp49_;
2725 ValaCCodeIdentifier* _tmp50_;
2726 ValaCCodeIdentifier* _tmp51_;
2727 ValaCCodeFunctionCall* _tmp52_;
2728 ValaMethod* _tmp53_;
2729 ValaMethod* _tmp54_;
2730 gchar* _tmp55_;
2731 gchar* _tmp56_;
2732 ValaCCodeIdentifier* _tmp57_;
2733 ValaCCodeIdentifier* _tmp58_;
2734 ValaCCodeFunctionCall* _tmp59_;
2735 ValaCCodeFunctionCall* _tmp60_;
2736 _tmp43_ = vala_ccode_identifier_new ("G_STRUCT_OFFSET");
2737 _tmp44_ = _tmp43_;
2738 _tmp45_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp44_);
2739 _tmp46_ = _tmp45_;
2740 _vala_ccode_node_unref0 (_tmp44_);
2741 struct_offset = _tmp46_;
2742 _tmp47_ = struct_offset;
2743 _tmp48_ = vala_get_ccode_type_name (type);
2744 _tmp49_ = _tmp48_;
2745 _tmp50_ = vala_ccode_identifier_new (_tmp49_);
2746 _tmp51_ = _tmp50_;
2747 vala_ccode_function_call_add_argument (_tmp47_, (ValaCCodeExpression*) _tmp51_);
2748 _vala_ccode_node_unref0 (_tmp51_);
2749 _g_free0 (_tmp49_);
2750 _tmp52_ = struct_offset;
2751 _tmp53_ = vala_signal_get_default_handler (sig);
2752 _tmp54_ = _tmp53_;
2753 _tmp55_ = vala_get_ccode_vfunc_name (_tmp54_);
2754 _tmp56_ = _tmp55_;
2755 _tmp57_ = vala_ccode_identifier_new (_tmp56_);
2756 _tmp58_ = _tmp57_;
2757 vala_ccode_function_call_add_argument (_tmp52_, (ValaCCodeExpression*) _tmp58_);
2758 _vala_ccode_node_unref0 (_tmp58_);
2759 _g_free0 (_tmp56_);
2760 _tmp59_ = csignew;
2761 _tmp60_ = struct_offset;
2762 vala_ccode_function_call_add_argument (_tmp59_, (ValaCCodeExpression*) _tmp60_);
2763 _vala_ccode_node_unref0 (struct_offset);
2764 }
2765 _tmp61_ = csignew;
2766 _tmp62_ = vala_ccode_constant_new ("NULL");
2767 _tmp63_ = _tmp62_;
2768 vala_ccode_function_call_add_argument (_tmp61_, (ValaCCodeExpression*) _tmp63_);
2769 _vala_ccode_node_unref0 (_tmp63_);
2770 _tmp64_ = csignew;
2771 _tmp65_ = vala_ccode_constant_new ("NULL");
2772 _tmp66_ = _tmp65_;
2773 vala_ccode_function_call_add_argument (_tmp64_, (ValaCCodeExpression*) _tmp66_);
2774 _vala_ccode_node_unref0 (_tmp66_);
2775 _tmp67_ = vala_callable_get_parameters ((ValaCallable*) sig);
2776 params = _tmp67_;
2777 _tmp68_ = vala_callable_get_return_type ((ValaCallable*) sig);
2778 _tmp69_ = _tmp68_;
2779 if (vala_data_type_is_real_non_null_struct_type (_tmp69_)) {
2780 ValaList* _tmp70_;
2781 ValaVoidType* _tmp71_;
2782 ValaVoidType* _tmp72_;
2783 gchar* _tmp73_;
2784 _tmp70_ = params;
2785 _tmp71_ = vala_void_type_new (NULL);
2786 _tmp72_ = _tmp71_;
2787 _tmp73_ = vala_gsignal_module_get_marshaller_function (self, sig, _tmp70_, (ValaDataType*) _tmp72_, NULL);
2788 _g_free0 (marshaller);
2789 marshaller = _tmp73_;
2790 _vala_code_node_unref0 (_tmp72_);
2791 } else {
2792 ValaList* _tmp74_;
2793 ValaDataType* _tmp75_;
2794 ValaDataType* _tmp76_;
2795 gchar* _tmp77_;
2796 _tmp74_ = params;
2797 _tmp75_ = vala_callable_get_return_type ((ValaCallable*) sig);
2798 _tmp76_ = _tmp75_;
2799 _tmp77_ = vala_gsignal_module_get_marshaller_function (self, sig, _tmp74_, _tmp76_, NULL);
2800 _g_free0 (marshaller);
2801 marshaller = _tmp77_;
2802 }
2803 _tmp78_ = marshaller;
2804 _tmp79_ = vala_ccode_identifier_new (_tmp78_);
2805 marshal_arg = _tmp79_;
2806 _tmp80_ = csignew;
2807 _tmp81_ = marshal_arg;
2808 vala_ccode_function_call_add_argument (_tmp80_, (ValaCCodeExpression*) _tmp81_);
2809 _tmp83_ = vala_callable_get_return_type ((ValaCallable*) sig);
2810 _tmp84_ = _tmp83_;
2811 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp84_, VALA_TYPE_POINTER_TYPE)) {
2812 _tmp82_ = TRUE;
2813 } else {
2814 ValaDataType* _tmp85_;
2815 ValaDataType* _tmp86_;
2816 _tmp85_ = vala_callable_get_return_type ((ValaCallable*) sig);
2817 _tmp86_ = _tmp85_;
2818 _tmp82_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp86_, VALA_TYPE_GENERIC_TYPE);
2819 }
2820 if (_tmp82_) {
2821 ValaCCodeFunctionCall* _tmp87_;
2822 ValaCCodeConstant* _tmp88_;
2823 ValaCCodeConstant* _tmp89_;
2824 _tmp87_ = csignew;
2825 _tmp88_ = vala_ccode_constant_new ("G_TYPE_POINTER");
2826 _tmp89_ = _tmp88_;
2827 vala_ccode_function_call_add_argument (_tmp87_, (ValaCCodeExpression*) _tmp89_);
2828 _vala_ccode_node_unref0 (_tmp89_);
2829 } else {
2830 ValaDataType* _tmp90_;
2831 ValaDataType* _tmp91_;
2832 _tmp90_ = vala_callable_get_return_type ((ValaCallable*) sig);
2833 _tmp91_ = _tmp90_;
2834 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp91_, VALA_TYPE_ERROR_TYPE)) {
2835 ValaCCodeFunctionCall* _tmp92_;
2836 ValaCCodeConstant* _tmp93_;
2837 ValaCCodeConstant* _tmp94_;
2838 _tmp92_ = csignew;
2839 _tmp93_ = vala_ccode_constant_new ("G_TYPE_POINTER");
2840 _tmp94_ = _tmp93_;
2841 vala_ccode_function_call_add_argument (_tmp92_, (ValaCCodeExpression*) _tmp94_);
2842 _vala_ccode_node_unref0 (_tmp94_);
2843 } else {
2844 gboolean _tmp95_ = FALSE;
2845 ValaDataType* _tmp96_;
2846 ValaDataType* _tmp97_;
2847 _tmp96_ = vala_callable_get_return_type ((ValaCallable*) sig);
2848 _tmp97_ = _tmp96_;
2849 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp97_, VALA_TYPE_VALUE_TYPE)) {
2850 ValaDataType* _tmp98_;
2851 ValaDataType* _tmp99_;
2852 gboolean _tmp100_;
2853 gboolean _tmp101_;
2854 _tmp98_ = vala_callable_get_return_type ((ValaCallable*) sig);
2855 _tmp99_ = _tmp98_;
2856 _tmp100_ = vala_data_type_get_nullable (_tmp99_);
2857 _tmp101_ = _tmp100_;
2858 _tmp95_ = _tmp101_;
2859 } else {
2860 _tmp95_ = FALSE;
2861 }
2862 if (_tmp95_) {
2863 ValaCCodeFunctionCall* _tmp102_;
2864 ValaCCodeConstant* _tmp103_;
2865 ValaCCodeConstant* _tmp104_;
2866 _tmp102_ = csignew;
2867 _tmp103_ = vala_ccode_constant_new ("G_TYPE_POINTER");
2868 _tmp104_ = _tmp103_;
2869 vala_ccode_function_call_add_argument (_tmp102_, (ValaCCodeExpression*) _tmp104_);
2870 _vala_ccode_node_unref0 (_tmp104_);
2871 } else {
2872 ValaDataType* _tmp105_;
2873 ValaDataType* _tmp106_;
2874 ValaTypeSymbol* _tmp107_;
2875 ValaTypeSymbol* _tmp108_;
2876 _tmp105_ = vala_callable_get_return_type ((ValaCallable*) sig);
2877 _tmp106_ = _tmp105_;
2878 _tmp107_ = vala_data_type_get_type_symbol (_tmp106_);
2879 _tmp108_ = _tmp107_;
2880 if (_tmp108_ == NULL) {
2881 ValaCCodeFunctionCall* _tmp109_;
2882 ValaCCodeConstant* _tmp110_;
2883 ValaCCodeConstant* _tmp111_;
2884 _tmp109_ = csignew;
2885 _tmp110_ = vala_ccode_constant_new ("G_TYPE_NONE");
2886 _tmp111_ = _tmp110_;
2887 vala_ccode_function_call_add_argument (_tmp109_, (ValaCCodeExpression*) _tmp111_);
2888 _vala_ccode_node_unref0 (_tmp111_);
2889 } else {
2890 ValaDataType* _tmp112_;
2891 ValaDataType* _tmp113_;
2892 _tmp112_ = vala_callable_get_return_type ((ValaCallable*) sig);
2893 _tmp113_ = _tmp112_;
2894 if (vala_data_type_is_real_non_null_struct_type (_tmp113_)) {
2895 ValaCCodeFunctionCall* _tmp114_;
2896 ValaCCodeConstant* _tmp115_;
2897 ValaCCodeConstant* _tmp116_;
2898 _tmp114_ = csignew;
2899 _tmp115_ = vala_ccode_constant_new ("G_TYPE_NONE");
2900 _tmp116_ = _tmp115_;
2901 vala_ccode_function_call_add_argument (_tmp114_, (ValaCCodeExpression*) _tmp116_);
2902 _vala_ccode_node_unref0 (_tmp116_);
2903 } else {
2904 ValaCCodeFunctionCall* _tmp117_;
2905 ValaDataType* _tmp118_;
2906 ValaDataType* _tmp119_;
2907 ValaTypeSymbol* _tmp120_;
2908 ValaTypeSymbol* _tmp121_;
2909 gchar* _tmp122_;
2910 gchar* _tmp123_;
2911 ValaCCodeConstant* _tmp124_;
2912 ValaCCodeConstant* _tmp125_;
2913 _tmp117_ = csignew;
2914 _tmp118_ = vala_callable_get_return_type ((ValaCallable*) sig);
2915 _tmp119_ = _tmp118_;
2916 _tmp120_ = vala_data_type_get_type_symbol (_tmp119_);
2917 _tmp121_ = _tmp120_;
2918 _tmp122_ = vala_get_ccode_type_id ((ValaCodeNode*) _tmp121_);
2919 _tmp123_ = _tmp122_;
2920 _tmp124_ = vala_ccode_constant_new (_tmp123_);
2921 _tmp125_ = _tmp124_;
2922 vala_ccode_function_call_add_argument (_tmp117_, (ValaCCodeExpression*) _tmp125_);
2923 _vala_ccode_node_unref0 (_tmp125_);
2924 _g_free0 (_tmp123_);
2925 }
2926 }
2927 }
2928 }
2929 }
2930 params_len = 0;
2931 {
2932 ValaList* _param_list = NULL;
2933 ValaList* _tmp126_;
2934 ValaList* _tmp127_;
2935 gint _param_size = 0;
2936 ValaList* _tmp128_;
2937 gint _tmp129_;
2938 gint _tmp130_;
2939 gint _param_index = 0;
2940 _tmp126_ = params;
2941 _tmp127_ = _vala_iterable_ref0 (_tmp126_);
2942 _param_list = _tmp127_;
2943 _tmp128_ = _param_list;
2944 _tmp129_ = vala_collection_get_size ((ValaCollection*) _tmp128_);
2945 _tmp130_ = _tmp129_;
2946 _param_size = _tmp130_;
2947 _param_index = -1;
2948 while (TRUE) {
2949 gint _tmp131_;
2950 gint _tmp132_;
2951 ValaParameter* param = NULL;
2952 ValaList* _tmp133_;
2953 gpointer _tmp134_;
2954 gint _tmp135_;
2955 ValaParameter* _tmp136_;
2956 ValaDataType* _tmp137_;
2957 ValaDataType* _tmp138_;
2958 _param_index = _param_index + 1;
2959 _tmp131_ = _param_index;
2960 _tmp132_ = _param_size;
2961 if (!(_tmp131_ < _tmp132_)) {
2962 break;
2963 }
2964 _tmp133_ = _param_list;
2965 _tmp134_ = vala_list_get (_tmp133_, _param_index);
2966 param = (ValaParameter*) _tmp134_;
2967 _tmp135_ = params_len;
2968 params_len = _tmp135_ + 1;
2969 _tmp136_ = param;
2970 _tmp137_ = vala_variable_get_variable_type ((ValaVariable*) _tmp136_);
2971 _tmp138_ = _tmp137_;
2972 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp138_, VALA_TYPE_ARRAY_TYPE)) {
2973 ValaParameter* _tmp139_;
2974 ValaDataType* _tmp140_;
2975 ValaDataType* _tmp141_;
2976 gint _tmp142_;
2977 gint _tmp143_;
2978 _tmp139_ = param;
2979 _tmp140_ = vala_variable_get_variable_type ((ValaVariable*) _tmp139_);
2980 _tmp141_ = _tmp140_;
2981 _tmp142_ = vala_array_type_get_rank (G_TYPE_CHECK_INSTANCE_CAST (_tmp141_, VALA_TYPE_ARRAY_TYPE, ValaArrayType));
2982 _tmp143_ = _tmp142_;
2983 params_len += _tmp143_;
2984 } else {
2985 ValaParameter* _tmp144_;
2986 ValaDataType* _tmp145_;
2987 ValaDataType* _tmp146_;
2988 _tmp144_ = param;
2989 _tmp145_ = vala_variable_get_variable_type ((ValaVariable*) _tmp144_);
2990 _tmp146_ = _tmp145_;
2991 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp146_, VALA_TYPE_DELEGATE_TYPE)) {
2992 ValaDelegateType* delegate_type = NULL;
2993 ValaParameter* _tmp147_;
2994 ValaDataType* _tmp148_;
2995 ValaDataType* _tmp149_;
2996 ValaDelegateType* _tmp150_;
2997 ValaDelegate* _tmp151_;
2998 ValaDelegate* _tmp152_;
2999 gboolean _tmp153_;
3000 gboolean _tmp154_;
3001 _tmp147_ = param;
3002 _tmp148_ = vala_variable_get_variable_type ((ValaVariable*) _tmp147_);
3003 _tmp149_ = _tmp148_;
3004 delegate_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp149_, VALA_TYPE_DELEGATE_TYPE, ValaDelegateType);
3005 _tmp150_ = delegate_type;
3006 _tmp151_ = vala_delegate_type_get_delegate_symbol (_tmp150_);
3007 _tmp152_ = _tmp151_;
3008 _tmp153_ = vala_delegate_get_has_target (_tmp152_);
3009 _tmp154_ = _tmp153_;
3010 if (_tmp154_) {
3011 gint _tmp155_;
3012 ValaDelegateType* _tmp156_;
3013 _tmp155_ = params_len;
3014 params_len = _tmp155_ + 1;
3015 _tmp156_ = delegate_type;
3016 if (vala_data_type_is_disposable ((ValaDataType*) _tmp156_)) {
3017 gint _tmp157_;
3018 _tmp157_ = params_len;
3019 params_len = _tmp157_ + 1;
3020 }
3021 }
3022 }
3023 }
3024 _vala_code_node_unref0 (param);
3025 }
3026 _vala_iterable_unref0 (_param_list);
3027 }
3028 _tmp158_ = vala_callable_get_return_type ((ValaCallable*) sig);
3029 _tmp159_ = _tmp158_;
3030 if (vala_data_type_is_real_non_null_struct_type (_tmp159_)) {
3031 gint _tmp160_;
3032 _tmp160_ = params_len;
3033 params_len = _tmp160_ + 1;
3034 }
3035 _tmp161_ = csignew;
3036 _tmp162_ = g_strdup_printf ("%d", params_len);
3037 _tmp163_ = _tmp162_;
3038 _tmp164_ = vala_ccode_constant_new (_tmp163_);
3039 _tmp165_ = _tmp164_;
3040 vala_ccode_function_call_add_argument (_tmp161_, (ValaCCodeExpression*) _tmp165_);
3041 _vala_ccode_node_unref0 (_tmp165_);
3042 _g_free0 (_tmp163_);
3043 {
3044 ValaList* _param_list = NULL;
3045 ValaList* _tmp166_;
3046 ValaList* _tmp167_;
3047 gint _param_size = 0;
3048 ValaList* _tmp168_;
3049 gint _tmp169_;
3050 gint _tmp170_;
3051 gint _param_index = 0;
3052 _tmp166_ = params;
3053 _tmp167_ = _vala_iterable_ref0 (_tmp166_);
3054 _param_list = _tmp167_;
3055 _tmp168_ = _param_list;
3056 _tmp169_ = vala_collection_get_size ((ValaCollection*) _tmp168_);
3057 _tmp170_ = _tmp169_;
3058 _param_size = _tmp170_;
3059 _param_index = -1;
3060 while (TRUE) {
3061 gint _tmp171_;
3062 gint _tmp172_;
3063 ValaParameter* param = NULL;
3064 ValaList* _tmp173_;
3065 gpointer _tmp174_;
3066 ValaParameter* _tmp175_;
3067 ValaDataType* _tmp176_;
3068 ValaDataType* _tmp177_;
3069 _param_index = _param_index + 1;
3070 _tmp171_ = _param_index;
3071 _tmp172_ = _param_size;
3072 if (!(_tmp171_ < _tmp172_)) {
3073 break;
3074 }
3075 _tmp173_ = _param_list;
3076 _tmp174_ = vala_list_get (_tmp173_, _param_index);
3077 param = (ValaParameter*) _tmp174_;
3078 _tmp175_ = param;
3079 _tmp176_ = vala_variable_get_variable_type ((ValaVariable*) _tmp175_);
3080 _tmp177_ = _tmp176_;
3081 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp177_, VALA_TYPE_ARRAY_TYPE)) {
3082 ValaArrayType* array_type = NULL;
3083 ValaParameter* _tmp178_;
3084 ValaDataType* _tmp179_;
3085 ValaDataType* _tmp180_;
3086 ValaArrayType* _tmp181_;
3087 ValaArrayType* _tmp182_;
3088 ValaDataType* _tmp183_;
3089 ValaDataType* _tmp184_;
3090 ValaTypeSymbol* _tmp185_;
3091 ValaTypeSymbol* _tmp186_;
3092 ValaDataType* _tmp187_;
3093 ValaTypeSymbol* _tmp188_;
3094 ValaTypeSymbol* _tmp189_;
3095 ValaArrayType* _tmp196_;
3096 ValaDataType* _tmp197_;
3097 ValaDataType* _tmp198_;
3098 ValaTypeSymbol* _tmp199_;
3099 ValaTypeSymbol* _tmp200_;
3100 gchar* length_type_id = NULL;
3101 ValaArrayType* _tmp201_;
3102 ValaDataType* _tmp202_;
3103 ValaDataType* _tmp203_;
3104 ValaTypeSymbol* _tmp204_;
3105 ValaTypeSymbol* _tmp205_;
3106 gchar* _tmp206_;
3107 _tmp178_ = param;
3108 _tmp179_ = vala_variable_get_variable_type ((ValaVariable*) _tmp178_);
3109 _tmp180_ = _tmp179_;
3110 _tmp181_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp180_, VALA_TYPE_ARRAY_TYPE, ValaArrayType));
3111 array_type = _tmp181_;
3112 _tmp182_ = array_type;
3113 _tmp183_ = vala_array_type_get_element_type (_tmp182_);
3114 _tmp184_ = _tmp183_;
3115 _tmp185_ = vala_data_type_get_type_symbol (_tmp184_);
3116 _tmp186_ = _tmp185_;
3117 _tmp187_ = ((ValaCCodeBaseModule*) self)->string_type;
3118 _tmp188_ = vala_data_type_get_type_symbol (_tmp187_);
3119 _tmp189_ = _tmp188_;
3120 if (_tmp186_ == _tmp189_) {
3121 ValaCCodeFunctionCall* _tmp190_;
3122 ValaCCodeConstant* _tmp191_;
3123 ValaCCodeConstant* _tmp192_;
3124 _tmp190_ = csignew;
3125 _tmp191_ = vala_ccode_constant_new ("G_TYPE_STRV");
3126 _tmp192_ = _tmp191_;
3127 vala_ccode_function_call_add_argument (_tmp190_, (ValaCCodeExpression*) _tmp192_);
3128 _vala_ccode_node_unref0 (_tmp192_);
3129 } else {
3130 ValaCCodeFunctionCall* _tmp193_;
3131 ValaCCodeConstant* _tmp194_;
3132 ValaCCodeConstant* _tmp195_;
3133 _tmp193_ = csignew;
3134 _tmp194_ = vala_ccode_constant_new ("G_TYPE_POINTER");
3135 _tmp195_ = _tmp194_;
3136 vala_ccode_function_call_add_argument (_tmp193_, (ValaCCodeExpression*) _tmp195_);
3137 _vala_ccode_node_unref0 (_tmp195_);
3138 }
3139 _tmp196_ = array_type;
3140 _tmp197_ = vala_array_type_get_length_type (_tmp196_);
3141 _tmp198_ = _tmp197_;
3142 _tmp199_ = vala_data_type_get_type_symbol (_tmp198_);
3143 _tmp200_ = _tmp199_;
3144 _vala_assert (vala_get_ccode_has_type_id (_tmp200_), "get_ccode_has_type_id (array_type.length_type.type_symbol)");
3145 _tmp201_ = array_type;
3146 _tmp202_ = vala_array_type_get_length_type (_tmp201_);
3147 _tmp203_ = _tmp202_;
3148 _tmp204_ = vala_data_type_get_type_symbol (_tmp203_);
3149 _tmp205_ = _tmp204_;
3150 _tmp206_ = vala_get_ccode_type_id ((ValaCodeNode*) _tmp205_);
3151 length_type_id = _tmp206_;
3152 {
3153 gint i = 0;
3154 i = 0;
3155 {
3156 gboolean _tmp207_ = FALSE;
3157 _tmp207_ = TRUE;
3158 while (TRUE) {
3159 ValaArrayType* _tmp209_;
3160 gint _tmp210_;
3161 gint _tmp211_;
3162 ValaCCodeFunctionCall* _tmp212_;
3163 const gchar* _tmp213_;
3164 ValaCCodeConstant* _tmp214_;
3165 ValaCCodeConstant* _tmp215_;
3166 if (!_tmp207_) {
3167 gint _tmp208_;
3168 _tmp208_ = i;
3169 i = _tmp208_ + 1;
3170 }
3171 _tmp207_ = FALSE;
3172 _tmp209_ = array_type;
3173 _tmp210_ = vala_array_type_get_rank (_tmp209_);
3174 _tmp211_ = _tmp210_;
3175 if (!(i < _tmp211_)) {
3176 break;
3177 }
3178 _tmp212_ = csignew;
3179 _tmp213_ = length_type_id;
3180 _tmp214_ = vala_ccode_constant_new (_tmp213_);
3181 _tmp215_ = _tmp214_;
3182 vala_ccode_function_call_add_argument (_tmp212_, (ValaCCodeExpression*) _tmp215_);
3183 _vala_ccode_node_unref0 (_tmp215_);
3184 }
3185 }
3186 }
3187 _g_free0 (length_type_id);
3188 _vala_code_node_unref0 (array_type);
3189 } else {
3190 ValaParameter* _tmp216_;
3191 ValaDataType* _tmp217_;
3192 ValaDataType* _tmp218_;
3193 _tmp216_ = param;
3194 _tmp217_ = vala_variable_get_variable_type ((ValaVariable*) _tmp216_);
3195 _tmp218_ = _tmp217_;
3196 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp218_, VALA_TYPE_DELEGATE_TYPE)) {
3197 ValaDelegateType* delegate_type = NULL;
3198 ValaParameter* _tmp219_;
3199 ValaDataType* _tmp220_;
3200 ValaDataType* _tmp221_;
3201 ValaCCodeFunctionCall* _tmp222_;
3202 ValaCCodeConstant* _tmp223_;
3203 ValaCCodeConstant* _tmp224_;
3204 ValaDelegateType* _tmp225_;
3205 ValaDelegate* _tmp226_;
3206 ValaDelegate* _tmp227_;
3207 gboolean _tmp228_;
3208 gboolean _tmp229_;
3209 _tmp219_ = param;
3210 _tmp220_ = vala_variable_get_variable_type ((ValaVariable*) _tmp219_);
3211 _tmp221_ = _tmp220_;
3212 delegate_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp221_, VALA_TYPE_DELEGATE_TYPE, ValaDelegateType);
3213 _tmp222_ = csignew;
3214 _tmp223_ = vala_ccode_constant_new ("G_TYPE_POINTER");
3215 _tmp224_ = _tmp223_;
3216 vala_ccode_function_call_add_argument (_tmp222_, (ValaCCodeExpression*) _tmp224_);
3217 _vala_ccode_node_unref0 (_tmp224_);
3218 _tmp225_ = delegate_type;
3219 _tmp226_ = vala_delegate_type_get_delegate_symbol (_tmp225_);
3220 _tmp227_ = _tmp226_;
3221 _tmp228_ = vala_delegate_get_has_target (_tmp227_);
3222 _tmp229_ = _tmp228_;
3223 if (_tmp229_) {
3224 ValaCCodeFunctionCall* _tmp230_;
3225 ValaCCodeConstant* _tmp231_;
3226 ValaCCodeConstant* _tmp232_;
3227 ValaDelegateType* _tmp233_;
3228 _tmp230_ = csignew;
3229 _tmp231_ = vala_ccode_constant_new ("G_TYPE_POINTER");
3230 _tmp232_ = _tmp231_;
3231 vala_ccode_function_call_add_argument (_tmp230_, (ValaCCodeExpression*) _tmp232_);
3232 _vala_ccode_node_unref0 (_tmp232_);
3233 _tmp233_ = delegate_type;
3234 if (vala_data_type_is_disposable ((ValaDataType*) _tmp233_)) {
3235 ValaCCodeFunctionCall* _tmp234_;
3236 ValaCCodeConstant* _tmp235_;
3237 ValaCCodeConstant* _tmp236_;
3238 _tmp234_ = csignew;
3239 _tmp235_ = vala_ccode_constant_new ("G_TYPE_POINTER");
3240 _tmp236_ = _tmp235_;
3241 vala_ccode_function_call_add_argument (_tmp234_, (ValaCCodeExpression*) _tmp236_);
3242 _vala_ccode_node_unref0 (_tmp236_);
3243 }
3244 }
3245 } else {
3246 gboolean _tmp237_ = FALSE;
3247 gboolean _tmp238_ = FALSE;
3248 ValaParameter* _tmp239_;
3249 ValaDataType* _tmp240_;
3250 ValaDataType* _tmp241_;
3251 _tmp239_ = param;
3252 _tmp240_ = vala_variable_get_variable_type ((ValaVariable*) _tmp239_);
3253 _tmp241_ = _tmp240_;
3254 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp241_, VALA_TYPE_POINTER_TYPE)) {
3255 _tmp238_ = TRUE;
3256 } else {
3257 ValaParameter* _tmp242_;
3258 ValaDataType* _tmp243_;
3259 ValaDataType* _tmp244_;
3260 _tmp242_ = param;
3261 _tmp243_ = vala_variable_get_variable_type ((ValaVariable*) _tmp242_);
3262 _tmp244_ = _tmp243_;
3263 _tmp238_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp244_, VALA_TYPE_GENERIC_TYPE);
3264 }
3265 if (_tmp238_) {
3266 _tmp237_ = TRUE;
3267 } else {
3268 ValaParameter* _tmp245_;
3269 ValaParameterDirection _tmp246_;
3270 ValaParameterDirection _tmp247_;
3271 _tmp245_ = param;
3272 _tmp246_ = vala_parameter_get_direction (_tmp245_);
3273 _tmp247_ = _tmp246_;
3274 _tmp237_ = _tmp247_ != VALA_PARAMETER_DIRECTION_IN;
3275 }
3276 if (_tmp237_) {
3277 ValaCCodeFunctionCall* _tmp248_;
3278 ValaCCodeConstant* _tmp249_;
3279 ValaCCodeConstant* _tmp250_;
3280 _tmp248_ = csignew;
3281 _tmp249_ = vala_ccode_constant_new ("G_TYPE_POINTER");
3282 _tmp250_ = _tmp249_;
3283 vala_ccode_function_call_add_argument (_tmp248_, (ValaCCodeExpression*) _tmp250_);
3284 _vala_ccode_node_unref0 (_tmp250_);
3285 } else {
3286 ValaParameter* _tmp251_;
3287 ValaDataType* _tmp252_;
3288 ValaDataType* _tmp253_;
3289 _tmp251_ = param;
3290 _tmp252_ = vala_variable_get_variable_type ((ValaVariable*) _tmp251_);
3291 _tmp253_ = _tmp252_;
3292 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp253_, VALA_TYPE_ERROR_TYPE)) {
3293 ValaCCodeFunctionCall* _tmp254_;
3294 ValaCCodeConstant* _tmp255_;
3295 ValaCCodeConstant* _tmp256_;
3296 _tmp254_ = csignew;
3297 _tmp255_ = vala_ccode_constant_new ("G_TYPE_POINTER");
3298 _tmp256_ = _tmp255_;
3299 vala_ccode_function_call_add_argument (_tmp254_, (ValaCCodeExpression*) _tmp256_);
3300 _vala_ccode_node_unref0 (_tmp256_);
3301 } else {
3302 gboolean _tmp257_ = FALSE;
3303 ValaParameter* _tmp258_;
3304 ValaDataType* _tmp259_;
3305 ValaDataType* _tmp260_;
3306 _tmp258_ = param;
3307 _tmp259_ = vala_variable_get_variable_type ((ValaVariable*) _tmp258_);
3308 _tmp260_ = _tmp259_;
3309 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp260_, VALA_TYPE_VALUE_TYPE)) {
3310 ValaParameter* _tmp261_;
3311 ValaDataType* _tmp262_;
3312 ValaDataType* _tmp263_;
3313 gboolean _tmp264_;
3314 gboolean _tmp265_;
3315 _tmp261_ = param;
3316 _tmp262_ = vala_variable_get_variable_type ((ValaVariable*) _tmp261_);
3317 _tmp263_ = _tmp262_;
3318 _tmp264_ = vala_data_type_get_nullable (_tmp263_);
3319 _tmp265_ = _tmp264_;
3320 _tmp257_ = _tmp265_;
3321 } else {
3322 _tmp257_ = FALSE;
3323 }
3324 if (_tmp257_) {
3325 ValaCCodeFunctionCall* _tmp266_;
3326 ValaCCodeConstant* _tmp267_;
3327 ValaCCodeConstant* _tmp268_;
3328 _tmp266_ = csignew;
3329 _tmp267_ = vala_ccode_constant_new ("G_TYPE_POINTER");
3330 _tmp268_ = _tmp267_;
3331 vala_ccode_function_call_add_argument (_tmp266_, (ValaCCodeExpression*) _tmp268_);
3332 _vala_ccode_node_unref0 (_tmp268_);
3333 } else {
3334 ValaCCodeFunctionCall* _tmp269_;
3335 ValaParameter* _tmp270_;
3336 ValaDataType* _tmp271_;
3337 ValaDataType* _tmp272_;
3338 ValaTypeSymbol* _tmp273_;
3339 ValaTypeSymbol* _tmp274_;
3340 gchar* _tmp275_;
3341 gchar* _tmp276_;
3342 ValaCCodeConstant* _tmp277_;
3343 ValaCCodeConstant* _tmp278_;
3344 _tmp269_ = csignew;
3345 _tmp270_ = param;
3346 _tmp271_ = vala_variable_get_variable_type ((ValaVariable*) _tmp270_);
3347 _tmp272_ = _tmp271_;
3348 _tmp273_ = vala_data_type_get_type_symbol (_tmp272_);
3349 _tmp274_ = _tmp273_;
3350 _tmp275_ = vala_get_ccode_type_id ((ValaCodeNode*) _tmp274_);
3351 _tmp276_ = _tmp275_;
3352 _tmp277_ = vala_ccode_constant_new (_tmp276_);
3353 _tmp278_ = _tmp277_;
3354 vala_ccode_function_call_add_argument (_tmp269_, (ValaCCodeExpression*) _tmp278_);
3355 _vala_ccode_node_unref0 (_tmp278_);
3356 _g_free0 (_tmp276_);
3357 }
3358 }
3359 }
3360 }
3361 }
3362 _vala_code_node_unref0 (param);
3363 }
3364 _vala_iterable_unref0 (_param_list);
3365 }
3366 _tmp279_ = vala_callable_get_return_type ((ValaCallable*) sig);
3367 _tmp280_ = _tmp279_;
3368 if (vala_data_type_is_real_non_null_struct_type (_tmp280_)) {
3369 ValaCCodeFunctionCall* _tmp281_;
3370 ValaCCodeConstant* _tmp282_;
3371 ValaCCodeConstant* _tmp283_;
3372 _tmp281_ = csignew;
3373 _tmp282_ = vala_ccode_constant_new ("G_TYPE_POINTER");
3374 _tmp283_ = _tmp282_;
3375 vala_ccode_function_call_add_argument (_tmp281_, (ValaCCodeExpression*) _tmp283_);
3376 _vala_ccode_node_unref0 (_tmp283_);
3377 }
3378 _tmp284_ = marshal_arg;
3379 _tmp285_ = marshaller;
3380 vala_ccode_identifier_set_name (_tmp284_, _tmp285_);
3381 _tmp286_ = vala_gsignal_module_get_signal_id_cexpression (self, sig);
3382 _tmp287_ = _tmp286_;
3383 _tmp288_ = csignew;
3384 _tmp289_ = vala_ccode_assignment_new (_tmp287_, (ValaCCodeExpression*) _tmp288_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
3385 _tmp290_ = (ValaCCodeExpression*) _tmp289_;
3386 _vala_ccode_node_unref0 (_tmp287_);
3387 result = _tmp290_;
3388 _vala_ccode_node_unref0 (marshal_arg);
3389 _g_free0 (marshaller);
3390 _g_free0 (run_type);
3391 flags = (_vala_array_free (flags, flags_length1, (GDestroyNotify) g_free), NULL);
3392 _vala_ccode_node_unref0 (csignew);
3393 return result;
3394 }
3395
3396 static void
vala_gsignal_module_real_visit_element_access(ValaCodeVisitor * base,ValaElementAccess * expr)3397 vala_gsignal_module_real_visit_element_access (ValaCodeVisitor* base,
3398 ValaElementAccess* expr)
3399 {
3400 ValaGSignalModule * self;
3401 gboolean _tmp0_ = FALSE;
3402 ValaExpression* _tmp1_;
3403 ValaExpression* _tmp2_;
3404 self = (ValaGSignalModule*) base;
3405 g_return_if_fail (expr != NULL);
3406 _tmp1_ = vala_element_access_get_container (expr);
3407 _tmp2_ = _tmp1_;
3408 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, VALA_TYPE_MEMBER_ACCESS)) {
3409 ValaExpression* _tmp3_;
3410 ValaExpression* _tmp4_;
3411 ValaSymbol* _tmp5_;
3412 ValaSymbol* _tmp6_;
3413 _tmp3_ = vala_element_access_get_container (expr);
3414 _tmp4_ = _tmp3_;
3415 _tmp5_ = vala_expression_get_symbol_reference (_tmp4_);
3416 _tmp6_ = _tmp5_;
3417 _tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, VALA_TYPE_SIGNAL);
3418 } else {
3419 _tmp0_ = FALSE;
3420 }
3421 if (_tmp0_) {
3422 ValaCodeNode* _tmp7_;
3423 ValaCodeNode* _tmp8_;
3424 _tmp7_ = vala_code_node_get_parent_node ((ValaCodeNode*) expr);
3425 _tmp8_ = _tmp7_;
3426 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, VALA_TYPE_METHOD_CALL)) {
3427 ValaSignal* sig = NULL;
3428 ValaSymbol* _tmp9_;
3429 ValaSymbol* _tmp10_;
3430 ValaSignal* _tmp11_;
3431 ValaMemberAccess* ma = NULL;
3432 ValaExpression* _tmp12_;
3433 ValaExpression* _tmp13_;
3434 ValaMemberAccess* _tmp14_;
3435 ValaExpression* detail_expr = NULL;
3436 ValaList* _tmp15_;
3437 gpointer _tmp16_;
3438 ValaCCodeFunctionCall* ccall = NULL;
3439 gboolean _tmp17_ = FALSE;
3440 ValaSignal* _tmp18_;
3441 gboolean _tmp19_;
3442 gboolean _tmp20_;
3443 ValaCCodeFunctionCall* _tmp59_;
3444 _tmp9_ = vala_expression_get_symbol_reference ((ValaExpression*) expr);
3445 _tmp10_ = _tmp9_;
3446 _tmp11_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, VALA_TYPE_SIGNAL, ValaSignal));
3447 sig = _tmp11_;
3448 _tmp12_ = vala_element_access_get_container (expr);
3449 _tmp13_ = _tmp12_;
3450 _tmp14_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, VALA_TYPE_MEMBER_ACCESS, ValaMemberAccess));
3451 ma = _tmp14_;
3452 _tmp15_ = vala_element_access_get_indices (expr);
3453 _tmp16_ = vala_list_get (_tmp15_, 0);
3454 detail_expr = (ValaExpression*) _tmp16_;
3455 _tmp18_ = sig;
3456 _tmp19_ = vala_symbol_get_external_package ((ValaSymbol*) _tmp18_);
3457 _tmp20_ = _tmp19_;
3458 if (!_tmp20_) {
3459 ValaSourceReference* _tmp21_;
3460 ValaSourceReference* _tmp22_;
3461 ValaSourceFile* _tmp23_;
3462 ValaSourceFile* _tmp24_;
3463 ValaSignal* _tmp25_;
3464 ValaSourceReference* _tmp26_;
3465 ValaSourceReference* _tmp27_;
3466 ValaSourceFile* _tmp28_;
3467 ValaSourceFile* _tmp29_;
3468 _tmp21_ = vala_code_node_get_source_reference ((ValaCodeNode*) expr);
3469 _tmp22_ = _tmp21_;
3470 _tmp23_ = vala_source_reference_get_file (_tmp22_);
3471 _tmp24_ = _tmp23_;
3472 _tmp25_ = sig;
3473 _tmp26_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp25_);
3474 _tmp27_ = _tmp26_;
3475 _tmp28_ = vala_source_reference_get_file (_tmp27_);
3476 _tmp29_ = _tmp28_;
3477 _tmp17_ = _tmp24_ == _tmp29_;
3478 } else {
3479 _tmp17_ = FALSE;
3480 }
3481 if (_tmp17_) {
3482 ValaCCodeExpression* detail_cexpr = NULL;
3483 ValaExpression* _tmp30_;
3484 ValaCCodeExpression* _tmp31_;
3485 ValaCCodeIdentifier* _tmp32_;
3486 ValaCCodeIdentifier* _tmp33_;
3487 ValaCCodeFunctionCall* _tmp34_;
3488 ValaCCodeFunctionCall* _tmp35_;
3489 ValaMemberAccess* _tmp36_;
3490 ValaExpression* _tmp37_;
3491 ValaExpression* _tmp38_;
3492 ValaCCodeExpression* _tmp39_;
3493 ValaCCodeFunctionCall* _tmp40_;
3494 ValaSignal* _tmp41_;
3495 ValaCCodeExpression* _tmp42_;
3496 ValaCCodeExpression* _tmp43_;
3497 ValaCCodeFunctionCall* _tmp44_;
3498 ValaCCodeExpression* _tmp45_;
3499 _tmp30_ = detail_expr;
3500 _tmp31_ = vala_gsignal_module_get_detail_cexpression (self, _tmp30_, (ValaCodeNode*) expr);
3501 detail_cexpr = _tmp31_;
3502 _tmp32_ = vala_ccode_identifier_new ("g_signal_emit");
3503 _tmp33_ = _tmp32_;
3504 _tmp34_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp33_);
3505 _vala_ccode_node_unref0 (ccall);
3506 ccall = _tmp34_;
3507 _vala_ccode_node_unref0 (_tmp33_);
3508 _tmp35_ = ccall;
3509 _tmp36_ = ma;
3510 _tmp37_ = vala_member_access_get_inner (_tmp36_);
3511 _tmp38_ = _tmp37_;
3512 _tmp39_ = vala_get_cvalue (_tmp38_);
3513 vala_ccode_function_call_add_argument (_tmp35_, _tmp39_);
3514 _tmp40_ = ccall;
3515 _tmp41_ = sig;
3516 _tmp42_ = vala_gsignal_module_get_signal_id_cexpression (self, _tmp41_);
3517 _tmp43_ = _tmp42_;
3518 vala_ccode_function_call_add_argument (_tmp40_, _tmp43_);
3519 _vala_ccode_node_unref0 (_tmp43_);
3520 _tmp44_ = ccall;
3521 _tmp45_ = detail_cexpr;
3522 vala_ccode_function_call_add_argument (_tmp44_, _tmp45_);
3523 _vala_ccode_node_unref0 (detail_cexpr);
3524 } else {
3525 ValaCCodeExpression* signal_name_cexpr = NULL;
3526 ValaSignal* _tmp46_;
3527 ValaExpression* _tmp47_;
3528 ValaCCodeExpression* _tmp48_;
3529 ValaCCodeIdentifier* _tmp49_;
3530 ValaCCodeIdentifier* _tmp50_;
3531 ValaCCodeFunctionCall* _tmp51_;
3532 ValaCCodeFunctionCall* _tmp52_;
3533 ValaMemberAccess* _tmp53_;
3534 ValaExpression* _tmp54_;
3535 ValaExpression* _tmp55_;
3536 ValaCCodeExpression* _tmp56_;
3537 ValaCCodeFunctionCall* _tmp57_;
3538 ValaCCodeExpression* _tmp58_;
3539 _tmp46_ = sig;
3540 _tmp47_ = detail_expr;
3541 _tmp48_ = vala_gsignal_module_get_signal_name_cexpression (self, _tmp46_, _tmp47_, (ValaCodeNode*) expr);
3542 signal_name_cexpr = _tmp48_;
3543 _tmp49_ = vala_ccode_identifier_new ("g_signal_emit_by_name");
3544 _tmp50_ = _tmp49_;
3545 _tmp51_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp50_);
3546 _vala_ccode_node_unref0 (ccall);
3547 ccall = _tmp51_;
3548 _vala_ccode_node_unref0 (_tmp50_);
3549 _tmp52_ = ccall;
3550 _tmp53_ = ma;
3551 _tmp54_ = vala_member_access_get_inner (_tmp53_);
3552 _tmp55_ = _tmp54_;
3553 _tmp56_ = vala_get_cvalue (_tmp55_);
3554 vala_ccode_function_call_add_argument (_tmp52_, _tmp56_);
3555 _tmp57_ = ccall;
3556 _tmp58_ = signal_name_cexpr;
3557 vala_ccode_function_call_add_argument (_tmp57_, _tmp58_);
3558 _vala_ccode_node_unref0 (signal_name_cexpr);
3559 }
3560 _tmp59_ = ccall;
3561 vala_set_cvalue ((ValaExpression*) expr, (ValaCCodeExpression*) _tmp59_);
3562 _vala_ccode_node_unref0 (ccall);
3563 _vala_code_node_unref0 (detail_expr);
3564 _vala_code_node_unref0 (ma);
3565 _vala_code_node_unref0 (sig);
3566 } else {
3567 }
3568 } else {
3569 VALA_CODE_VISITOR_CLASS (vala_gsignal_module_parent_class)->visit_element_access ((ValaCodeVisitor*) G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_GOBJECT_MODULE, ValaGObjectModule), expr);
3570 }
3571 }
3572
3573 static gboolean
vala_gsignal_module_in_gobject_instance(ValaGSignalModule * self,ValaMethod * m)3574 vala_gsignal_module_in_gobject_instance (ValaGSignalModule* self,
3575 ValaMethod* m)
3576 {
3577 gboolean _result_ = FALSE;
3578 ValaMemberBinding _tmp0_;
3579 ValaMemberBinding _tmp1_;
3580 gboolean result = FALSE;
3581 g_return_val_if_fail (self != NULL, FALSE);
3582 g_return_val_if_fail (m != NULL, FALSE);
3583 _result_ = FALSE;
3584 _tmp0_ = vala_method_get_binding (m);
3585 _tmp1_ = _tmp0_;
3586 if (_tmp1_ == VALA_MEMBER_BINDING_INSTANCE) {
3587 ValaParameter* _tmp2_;
3588 ValaParameter* _tmp3_;
3589 ValaDataType* _tmp4_;
3590 ValaDataType* _tmp5_;
3591 ValaTypeSymbol* _tmp6_;
3592 ValaTypeSymbol* _tmp7_;
3593 ValaTypeSymbol* _tmp8_;
3594 _tmp2_ = vala_method_get_this_parameter (m);
3595 _tmp3_ = _tmp2_;
3596 _tmp4_ = vala_variable_get_variable_type ((ValaVariable*) _tmp3_);
3597 _tmp5_ = _tmp4_;
3598 _tmp6_ = vala_data_type_get_type_symbol (_tmp5_);
3599 _tmp7_ = _tmp6_;
3600 _tmp8_ = ((ValaCCodeBaseModule*) self)->gobject_type;
3601 _result_ = vala_typesymbol_is_subtype_of (_tmp7_, _tmp8_);
3602 }
3603 result = _result_;
3604 return result;
3605 }
3606
3607 static void
vala_gsignal_module_real_visit_member_access(ValaCodeVisitor * base,ValaMemberAccess * expr)3608 vala_gsignal_module_real_visit_member_access (ValaCodeVisitor* base,
3609 ValaMemberAccess* expr)
3610 {
3611 ValaGSignalModule * self;
3612 ValaSymbol* _tmp0_;
3613 ValaSymbol* _tmp1_;
3614 self = (ValaGSignalModule*) base;
3615 g_return_if_fail (expr != NULL);
3616 _tmp0_ = vala_expression_get_symbol_reference ((ValaExpression*) expr);
3617 _tmp1_ = _tmp0_;
3618 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALA_TYPE_SIGNAL)) {
3619 ValaCCodeExpression* pub_inst = NULL;
3620 ValaExpression* _tmp2_;
3621 ValaExpression* _tmp3_;
3622 ValaSignal* sig = NULL;
3623 ValaSymbol* _tmp8_;
3624 ValaSymbol* _tmp9_;
3625 ValaSignal* _tmp10_;
3626 ValaTypeSymbol* cl = NULL;
3627 ValaSignal* _tmp11_;
3628 ValaSymbol* _tmp12_;
3629 ValaSymbol* _tmp13_;
3630 ValaTypeSymbol* _tmp14_;
3631 gboolean _tmp15_ = FALSE;
3632 ValaExpression* _tmp16_;
3633 ValaExpression* _tmp17_;
3634 gboolean _tmp51_ = FALSE;
3635 ValaSignal* _tmp52_;
3636 gboolean _tmp53_;
3637 gboolean _tmp54_;
3638 pub_inst = NULL;
3639 _tmp2_ = vala_member_access_get_inner (expr);
3640 _tmp3_ = _tmp2_;
3641 if (_tmp3_ != NULL) {
3642 ValaExpression* _tmp4_;
3643 ValaExpression* _tmp5_;
3644 ValaCCodeExpression* _tmp6_;
3645 ValaCCodeExpression* _tmp7_;
3646 _tmp4_ = vala_member_access_get_inner (expr);
3647 _tmp5_ = _tmp4_;
3648 _tmp6_ = vala_get_cvalue (_tmp5_);
3649 _tmp7_ = _vala_ccode_node_ref0 (_tmp6_);
3650 _vala_ccode_node_unref0 (pub_inst);
3651 pub_inst = _tmp7_;
3652 }
3653 _tmp8_ = vala_expression_get_symbol_reference ((ValaExpression*) expr);
3654 _tmp9_ = _tmp8_;
3655 _tmp10_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, VALA_TYPE_SIGNAL, ValaSignal));
3656 sig = _tmp10_;
3657 _tmp11_ = sig;
3658 _tmp12_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp11_);
3659 _tmp13_ = _tmp12_;
3660 _tmp14_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, VALA_TYPE_TYPESYMBOL, ValaTypeSymbol));
3661 cl = _tmp14_;
3662 _tmp16_ = vala_member_access_get_inner (expr);
3663 _tmp17_ = _tmp16_;
3664 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, VALA_TYPE_BASE_ACCESS)) {
3665 ValaSignal* _tmp18_;
3666 gboolean _tmp19_;
3667 gboolean _tmp20_;
3668 _tmp18_ = sig;
3669 _tmp19_ = vala_signal_get_is_virtual (_tmp18_);
3670 _tmp20_ = _tmp19_;
3671 _tmp15_ = _tmp20_;
3672 } else {
3673 _tmp15_ = FALSE;
3674 }
3675 if (_tmp15_) {
3676 ValaMethod* m = NULL;
3677 ValaSignal* _tmp21_;
3678 ValaMethod* _tmp22_;
3679 ValaMethod* _tmp23_;
3680 ValaMethod* _tmp24_;
3681 ValaClass* base_class = NULL;
3682 ValaMethod* _tmp25_;
3683 ValaSymbol* _tmp26_;
3684 ValaSymbol* _tmp27_;
3685 ValaClass* _tmp28_;
3686 ValaCCodeFunctionCall* vcast = NULL;
3687 ValaClass* _tmp29_;
3688 gchar* _tmp30_;
3689 gchar* _tmp31_;
3690 ValaCCodeIdentifier* _tmp32_;
3691 ValaCCodeIdentifier* _tmp33_;
3692 ValaCCodeFunctionCall* _tmp34_;
3693 ValaCCodeFunctionCall* _tmp35_;
3694 ValaCCodeFunctionCall* _tmp36_;
3695 ValaClass* _tmp37_;
3696 ValaClass* _tmp38_;
3697 gchar* _tmp39_;
3698 gchar* _tmp40_;
3699 gchar* _tmp41_;
3700 gchar* _tmp42_;
3701 ValaCCodeIdentifier* _tmp43_;
3702 ValaCCodeIdentifier* _tmp44_;
3703 ValaCCodeFunctionCall* _tmp45_;
3704 ValaMethod* _tmp46_;
3705 const gchar* _tmp47_;
3706 const gchar* _tmp48_;
3707 ValaCCodeMemberAccess* _tmp49_;
3708 ValaCCodeMemberAccess* _tmp50_;
3709 _tmp21_ = sig;
3710 _tmp22_ = vala_signal_get_default_handler (_tmp21_);
3711 _tmp23_ = _tmp22_;
3712 _tmp24_ = _vala_code_node_ref0 (_tmp23_);
3713 m = _tmp24_;
3714 _tmp25_ = m;
3715 _tmp26_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp25_);
3716 _tmp27_ = _tmp26_;
3717 _tmp28_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, VALA_TYPE_CLASS, ValaClass));
3718 base_class = _tmp28_;
3719 _tmp29_ = base_class;
3720 _tmp30_ = vala_get_ccode_class_type_function (_tmp29_);
3721 _tmp31_ = _tmp30_;
3722 _tmp32_ = vala_ccode_identifier_new (_tmp31_);
3723 _tmp33_ = _tmp32_;
3724 _tmp34_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp33_);
3725 _tmp35_ = _tmp34_;
3726 _vala_ccode_node_unref0 (_tmp33_);
3727 _g_free0 (_tmp31_);
3728 vcast = _tmp35_;
3729 _tmp36_ = vcast;
3730 _tmp37_ = vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self);
3731 _tmp38_ = _tmp37_;
3732 _tmp39_ = vala_get_ccode_lower_case_name ((ValaCodeNode*) _tmp38_, NULL);
3733 _tmp40_ = _tmp39_;
3734 _tmp41_ = g_strdup_printf ("%s_parent_class", _tmp40_);
3735 _tmp42_ = _tmp41_;
3736 _tmp43_ = vala_ccode_identifier_new (_tmp42_);
3737 _tmp44_ = _tmp43_;
3738 vala_ccode_function_call_add_argument (_tmp36_, (ValaCCodeExpression*) _tmp44_);
3739 _vala_ccode_node_unref0 (_tmp44_);
3740 _g_free0 (_tmp42_);
3741 _g_free0 (_tmp40_);
3742 _tmp45_ = vcast;
3743 _tmp46_ = m;
3744 _tmp47_ = vala_symbol_get_name ((ValaSymbol*) _tmp46_);
3745 _tmp48_ = _tmp47_;
3746 _tmp49_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) _tmp45_, _tmp48_);
3747 _tmp50_ = _tmp49_;
3748 vala_set_cvalue ((ValaExpression*) expr, (ValaCCodeExpression*) _tmp50_);
3749 _vala_ccode_node_unref0 (_tmp50_);
3750 _vala_ccode_node_unref0 (vcast);
3751 _vala_code_node_unref0 (base_class);
3752 _vala_code_node_unref0 (m);
3753 _vala_code_node_unref0 (cl);
3754 _vala_code_node_unref0 (sig);
3755 _vala_ccode_node_unref0 (pub_inst);
3756 return;
3757 }
3758 _tmp52_ = sig;
3759 _tmp53_ = vala_symbol_get_external_package ((ValaSymbol*) _tmp52_);
3760 _tmp54_ = _tmp53_;
3761 if (!_tmp54_) {
3762 ValaSourceReference* _tmp55_;
3763 ValaSourceReference* _tmp56_;
3764 ValaSourceFile* _tmp57_;
3765 ValaSourceFile* _tmp58_;
3766 ValaSignal* _tmp59_;
3767 ValaSourceReference* _tmp60_;
3768 ValaSourceReference* _tmp61_;
3769 ValaSourceFile* _tmp62_;
3770 ValaSourceFile* _tmp63_;
3771 _tmp55_ = vala_code_node_get_source_reference ((ValaCodeNode*) expr);
3772 _tmp56_ = _tmp55_;
3773 _tmp57_ = vala_source_reference_get_file (_tmp56_);
3774 _tmp58_ = _tmp57_;
3775 _tmp59_ = sig;
3776 _tmp60_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp59_);
3777 _tmp61_ = _tmp60_;
3778 _tmp62_ = vala_source_reference_get_file (_tmp61_);
3779 _tmp63_ = _tmp62_;
3780 _tmp51_ = _tmp58_ == _tmp63_;
3781 } else {
3782 _tmp51_ = FALSE;
3783 }
3784 if (_tmp51_) {
3785 ValaCCodeFunctionCall* ccall = NULL;
3786 ValaCCodeIdentifier* _tmp64_;
3787 ValaCCodeIdentifier* _tmp65_;
3788 ValaCCodeFunctionCall* _tmp66_;
3789 ValaCCodeFunctionCall* _tmp67_;
3790 ValaCCodeFunctionCall* _tmp68_;
3791 ValaCCodeExpression* _tmp69_;
3792 ValaCCodeFunctionCall* _tmp70_;
3793 ValaSignal* _tmp71_;
3794 ValaCCodeExpression* _tmp72_;
3795 ValaCCodeExpression* _tmp73_;
3796 ValaCCodeFunctionCall* _tmp74_;
3797 ValaCCodeConstant* _tmp75_;
3798 ValaCCodeConstant* _tmp76_;
3799 ValaCCodeFunctionCall* _tmp77_;
3800 _tmp64_ = vala_ccode_identifier_new ("g_signal_emit");
3801 _tmp65_ = _tmp64_;
3802 _tmp66_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp65_);
3803 _tmp67_ = _tmp66_;
3804 _vala_ccode_node_unref0 (_tmp65_);
3805 ccall = _tmp67_;
3806 _tmp68_ = ccall;
3807 _tmp69_ = pub_inst;
3808 vala_ccode_function_call_add_argument (_tmp68_, _tmp69_);
3809 _tmp70_ = ccall;
3810 _tmp71_ = sig;
3811 _tmp72_ = vala_gsignal_module_get_signal_id_cexpression (self, _tmp71_);
3812 _tmp73_ = _tmp72_;
3813 vala_ccode_function_call_add_argument (_tmp70_, _tmp73_);
3814 _vala_ccode_node_unref0 (_tmp73_);
3815 _tmp74_ = ccall;
3816 _tmp75_ = vala_ccode_constant_new ("0");
3817 _tmp76_ = _tmp75_;
3818 vala_ccode_function_call_add_argument (_tmp74_, (ValaCCodeExpression*) _tmp76_);
3819 _vala_ccode_node_unref0 (_tmp76_);
3820 _tmp77_ = ccall;
3821 vala_set_cvalue ((ValaExpression*) expr, (ValaCCodeExpression*) _tmp77_);
3822 _vala_ccode_node_unref0 (ccall);
3823 } else {
3824 ValaSignal* _tmp78_;
3825 _tmp78_ = sig;
3826 if (vala_get_ccode_has_emitter (_tmp78_)) {
3827 gchar* emitter_func = NULL;
3828 ValaSignal* _tmp79_;
3829 ValaMethod* _tmp80_;
3830 ValaMethod* _tmp81_;
3831 ValaCCodeFunctionCall* ccall = NULL;
3832 const gchar* _tmp110_;
3833 ValaCCodeIdentifier* _tmp111_;
3834 ValaCCodeIdentifier* _tmp112_;
3835 ValaCCodeFunctionCall* _tmp113_;
3836 ValaCCodeFunctionCall* _tmp114_;
3837 ValaCCodeFunctionCall* _tmp115_;
3838 ValaCCodeExpression* _tmp116_;
3839 ValaCCodeFunctionCall* _tmp117_;
3840 _tmp79_ = sig;
3841 _tmp80_ = vala_signal_get_emitter (_tmp79_);
3842 _tmp81_ = _tmp80_;
3843 if (_tmp81_ != NULL) {
3844 gboolean _tmp82_ = FALSE;
3845 ValaSignal* _tmp83_;
3846 gboolean _tmp84_;
3847 gboolean _tmp85_;
3848 ValaSignal* _tmp99_;
3849 ValaMethod* _tmp100_;
3850 ValaMethod* _tmp101_;
3851 gchar* _tmp102_;
3852 _tmp83_ = sig;
3853 _tmp84_ = vala_symbol_get_external_package ((ValaSymbol*) _tmp83_);
3854 _tmp85_ = _tmp84_;
3855 if (!_tmp85_) {
3856 ValaSourceReference* _tmp86_;
3857 ValaSourceReference* _tmp87_;
3858 ValaSourceFile* _tmp88_;
3859 ValaSourceFile* _tmp89_;
3860 ValaSignal* _tmp90_;
3861 ValaSourceReference* _tmp91_;
3862 ValaSourceReference* _tmp92_;
3863 ValaSourceFile* _tmp93_;
3864 ValaSourceFile* _tmp94_;
3865 _tmp86_ = vala_code_node_get_source_reference ((ValaCodeNode*) expr);
3866 _tmp87_ = _tmp86_;
3867 _tmp88_ = vala_source_reference_get_file (_tmp87_);
3868 _tmp89_ = _tmp88_;
3869 _tmp90_ = sig;
3870 _tmp91_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp90_);
3871 _tmp92_ = _tmp91_;
3872 _tmp93_ = vala_source_reference_get_file (_tmp92_);
3873 _tmp94_ = _tmp93_;
3874 _tmp82_ = _tmp89_ != _tmp94_;
3875 } else {
3876 _tmp82_ = FALSE;
3877 }
3878 if (_tmp82_) {
3879 ValaSignal* _tmp95_;
3880 ValaMethod* _tmp96_;
3881 ValaMethod* _tmp97_;
3882 ValaCCodeFile* _tmp98_;
3883 _tmp95_ = sig;
3884 _tmp96_ = vala_signal_get_emitter (_tmp95_);
3885 _tmp97_ = _tmp96_;
3886 _tmp98_ = ((ValaCCodeBaseModule*) self)->cfile;
3887 vala_ccode_base_module_generate_method_declaration ((ValaCCodeBaseModule*) self, _tmp97_, _tmp98_);
3888 }
3889 _tmp99_ = sig;
3890 _tmp100_ = vala_signal_get_emitter (_tmp99_);
3891 _tmp101_ = _tmp100_;
3892 _tmp102_ = vala_get_ccode_lower_case_name ((ValaCodeNode*) _tmp101_, NULL);
3893 _g_free0 (emitter_func);
3894 emitter_func = _tmp102_;
3895 } else {
3896 ValaTypeSymbol* _tmp103_;
3897 gchar* _tmp104_;
3898 gchar* _tmp105_;
3899 ValaSignal* _tmp106_;
3900 gchar* _tmp107_;
3901 gchar* _tmp108_;
3902 gchar* _tmp109_;
3903 _tmp103_ = cl;
3904 _tmp104_ = vala_get_ccode_lower_case_name ((ValaCodeNode*) _tmp103_, NULL);
3905 _tmp105_ = _tmp104_;
3906 _tmp106_ = sig;
3907 _tmp107_ = vala_get_ccode_lower_case_name ((ValaCodeNode*) _tmp106_, NULL);
3908 _tmp108_ = _tmp107_;
3909 _tmp109_ = g_strdup_printf ("%s_%s", _tmp105_, _tmp108_);
3910 _g_free0 (emitter_func);
3911 emitter_func = _tmp109_;
3912 _g_free0 (_tmp108_);
3913 _g_free0 (_tmp105_);
3914 }
3915 _tmp110_ = emitter_func;
3916 _tmp111_ = vala_ccode_identifier_new (_tmp110_);
3917 _tmp112_ = _tmp111_;
3918 _tmp113_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp112_);
3919 _tmp114_ = _tmp113_;
3920 _vala_ccode_node_unref0 (_tmp112_);
3921 ccall = _tmp114_;
3922 _tmp115_ = ccall;
3923 _tmp116_ = pub_inst;
3924 vala_ccode_function_call_add_argument (_tmp115_, _tmp116_);
3925 _tmp117_ = ccall;
3926 vala_set_cvalue ((ValaExpression*) expr, (ValaCCodeExpression*) _tmp117_);
3927 _vala_ccode_node_unref0 (ccall);
3928 _g_free0 (emitter_func);
3929 } else {
3930 ValaCCodeFunctionCall* ccall = NULL;
3931 ValaCCodeIdentifier* _tmp118_;
3932 ValaCCodeIdentifier* _tmp119_;
3933 ValaCCodeFunctionCall* _tmp120_;
3934 ValaCCodeFunctionCall* _tmp121_;
3935 ValaCCodeFunctionCall* _tmp122_;
3936 ValaCCodeExpression* _tmp123_;
3937 ValaCCodeFunctionCall* _tmp124_;
3938 ValaSignal* _tmp125_;
3939 ValaCCodeConstant* _tmp126_;
3940 ValaCCodeConstant* _tmp127_;
3941 ValaCCodeFunctionCall* _tmp128_;
3942 _tmp118_ = vala_ccode_identifier_new ("g_signal_emit_by_name");
3943 _tmp119_ = _tmp118_;
3944 _tmp120_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp119_);
3945 _tmp121_ = _tmp120_;
3946 _vala_ccode_node_unref0 (_tmp119_);
3947 ccall = _tmp121_;
3948 _tmp122_ = ccall;
3949 _tmp123_ = pub_inst;
3950 vala_ccode_function_call_add_argument (_tmp122_, _tmp123_);
3951 _tmp124_ = ccall;
3952 _tmp125_ = sig;
3953 _tmp126_ = vala_ccode_base_module_get_signal_canonical_constant ((ValaCCodeBaseModule*) self, _tmp125_, NULL);
3954 _tmp127_ = _tmp126_;
3955 vala_ccode_function_call_add_argument (_tmp124_, (ValaCCodeExpression*) _tmp127_);
3956 _vala_ccode_node_unref0 (_tmp127_);
3957 _tmp128_ = ccall;
3958 vala_set_cvalue ((ValaExpression*) expr, (ValaCCodeExpression*) _tmp128_);
3959 _vala_ccode_node_unref0 (ccall);
3960 }
3961 }
3962 _vala_code_node_unref0 (cl);
3963 _vala_code_node_unref0 (sig);
3964 _vala_ccode_node_unref0 (pub_inst);
3965 } else {
3966 VALA_CODE_VISITOR_CLASS (vala_gsignal_module_parent_class)->visit_member_access ((ValaCodeVisitor*) G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_GOBJECT_MODULE, ValaGObjectModule), expr);
3967 }
3968 }
3969
3970 static void
vala_gsignal_module_real_visit_method_call(ValaCodeVisitor * base,ValaMethodCall * expr)3971 vala_gsignal_module_real_visit_method_call (ValaCodeVisitor* base,
3972 ValaMethodCall* expr)
3973 {
3974 ValaGSignalModule * self;
3975 ValaMethodType* method_type = NULL;
3976 ValaExpression* _tmp0_;
3977 ValaExpression* _tmp1_;
3978 ValaDataType* _tmp2_;
3979 ValaDataType* _tmp3_;
3980 ValaMethodType* _tmp4_;
3981 gboolean _tmp5_ = FALSE;
3982 ValaMethodType* _tmp6_;
3983 ValaSignal* sig = NULL;
3984 ValaMethodType* _tmp12_;
3985 ValaMethod* _tmp13_;
3986 ValaMethod* _tmp14_;
3987 ValaSymbol* _tmp15_;
3988 ValaSymbol* _tmp16_;
3989 ValaSignal* _tmp17_;
3990 ValaExpression* signal_access = NULL;
3991 ValaExpression* _tmp18_;
3992 ValaExpression* _tmp19_;
3993 ValaExpression* _tmp20_;
3994 ValaExpression* _tmp21_;
3995 ValaExpression* _tmp22_;
3996 ValaExpression* handler = NULL;
3997 ValaList* _tmp23_;
3998 gpointer _tmp24_;
3999 gboolean disconnect = FALSE;
4000 ValaMethodType* _tmp25_;
4001 ValaMethod* _tmp26_;
4002 ValaMethod* _tmp27_;
4003 const gchar* _tmp28_;
4004 const gchar* _tmp29_;
4005 gboolean after = FALSE;
4006 ValaMethodType* _tmp30_;
4007 ValaMethod* _tmp31_;
4008 ValaMethod* _tmp32_;
4009 const gchar* _tmp33_;
4010 const gchar* _tmp34_;
4011 ValaCCodeExpression* cexpr = NULL;
4012 ValaSignal* _tmp35_;
4013 ValaExpression* _tmp36_;
4014 ValaExpression* _tmp37_;
4015 ValaCCodeExpression* _tmp38_;
4016 ValaCCodeExpression* _tmp39_;
4017 self = (ValaGSignalModule*) base;
4018 g_return_if_fail (expr != NULL);
4019 _tmp0_ = vala_method_call_get_call (expr);
4020 _tmp1_ = _tmp0_;
4021 _tmp2_ = vala_expression_get_value_type (_tmp1_);
4022 _tmp3_ = _tmp2_;
4023 _tmp4_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, VALA_TYPE_METHOD_TYPE) ? ((ValaMethodType*) _tmp3_) : NULL);
4024 method_type = _tmp4_;
4025 _tmp6_ = method_type;
4026 if (_tmp6_ == NULL) {
4027 _tmp5_ = TRUE;
4028 } else {
4029 ValaMethodType* _tmp7_;
4030 ValaMethod* _tmp8_;
4031 ValaMethod* _tmp9_;
4032 ValaSymbol* _tmp10_;
4033 ValaSymbol* _tmp11_;
4034 _tmp7_ = method_type;
4035 _tmp8_ = vala_method_type_get_method_symbol (_tmp7_);
4036 _tmp9_ = _tmp8_;
4037 _tmp10_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp9_);
4038 _tmp11_ = _tmp10_;
4039 _tmp5_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, VALA_TYPE_SIGNAL);
4040 }
4041 if (_tmp5_) {
4042 VALA_CODE_VISITOR_CLASS (vala_gsignal_module_parent_class)->visit_method_call ((ValaCodeVisitor*) G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_GOBJECT_MODULE, ValaGObjectModule), expr);
4043 _vala_code_node_unref0 (method_type);
4044 return;
4045 }
4046 _tmp12_ = method_type;
4047 _tmp13_ = vala_method_type_get_method_symbol (_tmp12_);
4048 _tmp14_ = _tmp13_;
4049 _tmp15_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp14_);
4050 _tmp16_ = _tmp15_;
4051 _tmp17_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, VALA_TYPE_SIGNAL, ValaSignal));
4052 sig = _tmp17_;
4053 _tmp18_ = vala_method_call_get_call (expr);
4054 _tmp19_ = _tmp18_;
4055 _tmp20_ = vala_member_access_get_inner (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, VALA_TYPE_MEMBER_ACCESS, ValaMemberAccess));
4056 _tmp21_ = _tmp20_;
4057 _tmp22_ = _vala_code_node_ref0 (_tmp21_);
4058 signal_access = _tmp22_;
4059 _tmp23_ = vala_method_call_get_argument_list (expr);
4060 _tmp24_ = vala_list_get (_tmp23_, 0);
4061 handler = (ValaExpression*) _tmp24_;
4062 _tmp25_ = method_type;
4063 _tmp26_ = vala_method_type_get_method_symbol (_tmp25_);
4064 _tmp27_ = _tmp26_;
4065 _tmp28_ = vala_symbol_get_name ((ValaSymbol*) _tmp27_);
4066 _tmp29_ = _tmp28_;
4067 disconnect = g_strcmp0 (_tmp29_, "disconnect") == 0;
4068 _tmp30_ = method_type;
4069 _tmp31_ = vala_method_type_get_method_symbol (_tmp30_);
4070 _tmp32_ = _tmp31_;
4071 _tmp33_ = vala_symbol_get_name ((ValaSymbol*) _tmp32_);
4072 _tmp34_ = _tmp33_;
4073 after = g_strcmp0 (_tmp34_, "connect_after") == 0;
4074 _tmp35_ = sig;
4075 _tmp36_ = signal_access;
4076 _tmp37_ = handler;
4077 _tmp38_ = vala_gsignal_module_connect_signal (self, _tmp35_, _tmp36_, _tmp37_, disconnect, after, (ValaCodeNode*) expr);
4078 cexpr = _tmp38_;
4079 _tmp39_ = cexpr;
4080 vala_set_cvalue ((ValaExpression*) expr, _tmp39_);
4081 _vala_ccode_node_unref0 (cexpr);
4082 _vala_code_node_unref0 (handler);
4083 _vala_code_node_unref0 (signal_access);
4084 _vala_code_node_unref0 (sig);
4085 _vala_code_node_unref0 (method_type);
4086 }
4087
4088 static ValaCCodeExpression*
vala_gsignal_module_connect_signal(ValaGSignalModule * self,ValaSignal * sig,ValaExpression * signal_access,ValaExpression * handler,gboolean disconnect,gboolean after,ValaCodeNode * expr)4089 vala_gsignal_module_connect_signal (ValaGSignalModule* self,
4090 ValaSignal* sig,
4091 ValaExpression* signal_access,
4092 ValaExpression* handler,
4093 gboolean disconnect,
4094 gboolean after,
4095 ValaCodeNode* expr)
4096 {
4097 gchar* connect_func = NULL;
4098 ValaDelegateType* dt = NULL;
4099 ValaSymbol* _tmp0_;
4100 ValaSymbol* _tmp1_;
4101 ValaMethod* m = NULL;
4102 ValaSymbol* _tmp23_;
4103 ValaSymbol* _tmp24_;
4104 ValaMethod* _tmp25_;
4105 ValaCCodeFunctionCall* ccall = NULL;
4106 const gchar* _tmp48_;
4107 ValaCCodeIdentifier* _tmp49_;
4108 ValaCCodeIdentifier* _tmp50_;
4109 ValaCCodeFunctionCall* _tmp51_;
4110 ValaCCodeFunctionCall* _tmp52_;
4111 ValaCCodeExpression* signal_name_cexpr = NULL;
4112 ValaMemberAccess* ma = NULL;
4113 ValaMemberAccess* _tmp65_;
4114 ValaExpression* _tmp66_;
4115 ValaExpression* _tmp67_;
4116 ValaCCodeFunctionCall* _tmp160_;
4117 ValaCCodeExpression* _tmp161_;
4118 ValaCCodeCastExpression* _tmp162_;
4119 ValaCCodeCastExpression* _tmp163_;
4120 gboolean _tmp164_ = FALSE;
4121 ValaMethod* _tmp165_;
4122 gboolean _tmp240_ = FALSE;
4123 ValaCCodeExpression* result = NULL;
4124 g_return_val_if_fail (self != NULL, NULL);
4125 g_return_val_if_fail (sig != NULL, NULL);
4126 g_return_val_if_fail (signal_access != NULL, NULL);
4127 g_return_val_if_fail (handler != NULL, NULL);
4128 g_return_val_if_fail (expr != NULL, NULL);
4129 dt = NULL;
4130 _tmp0_ = vala_expression_get_symbol_reference (handler);
4131 _tmp1_ = _tmp0_;
4132 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALA_TYPE_VARIABLE)) {
4133 ValaSymbol* _tmp2_;
4134 ValaSymbol* _tmp3_;
4135 ValaDataType* _tmp4_;
4136 ValaDataType* _tmp5_;
4137 ValaDelegateType* _tmp6_;
4138 gboolean _tmp7_ = FALSE;
4139 ValaDelegateType* _tmp8_;
4140 ValaSymbol* _tmp15_;
4141 ValaSymbol* _tmp16_;
4142 ValaExpression* _tmp17_;
4143 ValaExpression* _tmp18_;
4144 _tmp2_ = vala_expression_get_symbol_reference (handler);
4145 _tmp3_ = _tmp2_;
4146 _tmp4_ = vala_variable_get_variable_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, VALA_TYPE_VARIABLE, ValaVariable));
4147 _tmp5_ = _tmp4_;
4148 _tmp6_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, VALA_TYPE_DELEGATE_TYPE) ? ((ValaDelegateType*) _tmp5_) : NULL);
4149 _vala_code_node_unref0 (dt);
4150 dt = _tmp6_;
4151 _tmp8_ = dt;
4152 if (_tmp8_ != NULL) {
4153 ValaCodeContext* _tmp9_;
4154 ValaCodeContext* _tmp10_;
4155 gboolean _tmp11_;
4156 gboolean _tmp12_;
4157 _tmp9_ = vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self);
4158 _tmp10_ = _tmp9_;
4159 _tmp11_ = vala_code_context_get_experimental (_tmp10_);
4160 _tmp12_ = _tmp11_;
4161 _tmp7_ = !_tmp12_;
4162 } else {
4163 _tmp7_ = FALSE;
4164 }
4165 if (_tmp7_) {
4166 ValaSourceReference* _tmp13_;
4167 ValaSourceReference* _tmp14_;
4168 _tmp13_ = vala_code_node_get_source_reference ((ValaCodeNode*) handler);
4169 _tmp14_ = _tmp13_;
4170 vala_report_warning (_tmp14_, "Connecting delegates to signals is experimental");
4171 }
4172 _tmp15_ = vala_expression_get_symbol_reference (handler);
4173 _tmp16_ = _tmp15_;
4174 _tmp17_ = vala_variable_get_initializer (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, VALA_TYPE_VARIABLE, ValaVariable));
4175 _tmp18_ = _tmp17_;
4176 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, VALA_TYPE_LAMBDA_EXPRESSION)) {
4177 ValaSymbol* _tmp19_;
4178 ValaSymbol* _tmp20_;
4179 ValaExpression* _tmp21_;
4180 ValaExpression* _tmp22_;
4181 _tmp19_ = vala_expression_get_symbol_reference (handler);
4182 _tmp20_ = _tmp19_;
4183 _tmp21_ = vala_variable_get_initializer (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, VALA_TYPE_VARIABLE, ValaVariable));
4184 _tmp22_ = _tmp21_;
4185 handler = _tmp22_;
4186 }
4187 }
4188 _tmp23_ = vala_expression_get_symbol_reference (handler);
4189 _tmp24_ = _tmp23_;
4190 _tmp25_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, VALA_TYPE_METHOD) ? ((ValaMethod*) _tmp24_) : NULL);
4191 m = _tmp25_;
4192 if (!disconnect) {
4193 if (G_TYPE_CHECK_INSTANCE_TYPE (sig, VALA_TYPE_DYNAMIC_SIGNAL)) {
4194 if (!after) {
4195 gchar* _tmp26_;
4196 _tmp26_ = vala_ccode_base_module_get_dynamic_signal_connect_wrapper_name ((ValaCCodeBaseModule*) self, G_TYPE_CHECK_INSTANCE_CAST (sig, VALA_TYPE_DYNAMIC_SIGNAL, ValaDynamicSignal));
4197 _g_free0 (connect_func);
4198 connect_func = _tmp26_;
4199 } else {
4200 gchar* _tmp27_;
4201 _tmp27_ = vala_ccode_base_module_get_dynamic_signal_connect_after_wrapper_name ((ValaCCodeBaseModule*) self, G_TYPE_CHECK_INSTANCE_CAST (sig, VALA_TYPE_DYNAMIC_SIGNAL, ValaDynamicSignal));
4202 _g_free0 (connect_func);
4203 connect_func = _tmp27_;
4204 }
4205 } else {
4206 gboolean _tmp28_ = FALSE;
4207 gboolean _tmp29_ = FALSE;
4208 ValaMethod* _tmp30_;
4209 _tmp30_ = m;
4210 if (_tmp30_ != NULL) {
4211 ValaMethod* _tmp31_;
4212 gboolean _tmp32_;
4213 gboolean _tmp33_;
4214 _tmp31_ = m;
4215 _tmp32_ = vala_method_get_closure (_tmp31_);
4216 _tmp33_ = _tmp32_;
4217 _tmp29_ = _tmp33_;
4218 } else {
4219 _tmp29_ = FALSE;
4220 }
4221 if (_tmp29_) {
4222 _tmp28_ = TRUE;
4223 } else {
4224 gboolean _tmp34_ = FALSE;
4225 ValaDelegateType* _tmp35_;
4226 _tmp35_ = dt;
4227 if (_tmp35_ != NULL) {
4228 ValaDelegateType* _tmp36_;
4229 gboolean _tmp37_;
4230 gboolean _tmp38_;
4231 _tmp36_ = dt;
4232 _tmp37_ = vala_data_type_get_value_owned ((ValaDataType*) _tmp36_);
4233 _tmp38_ = _tmp37_;
4234 _tmp34_ = _tmp38_;
4235 } else {
4236 _tmp34_ = FALSE;
4237 }
4238 _tmp28_ = _tmp34_;
4239 }
4240 if (_tmp28_) {
4241 gchar* _tmp39_;
4242 _tmp39_ = g_strdup ("g_signal_connect_data");
4243 _g_free0 (connect_func);
4244 connect_func = _tmp39_;
4245 } else {
4246 gboolean _tmp40_ = FALSE;
4247 ValaMethod* _tmp41_;
4248 _tmp41_ = m;
4249 if (_tmp41_ != NULL) {
4250 ValaMethod* _tmp42_;
4251 _tmp42_ = m;
4252 _tmp40_ = vala_gsignal_module_in_gobject_instance (self, _tmp42_);
4253 } else {
4254 _tmp40_ = FALSE;
4255 }
4256 if (_tmp40_) {
4257 gchar* _tmp43_;
4258 _tmp43_ = g_strdup ("g_signal_connect_object");
4259 _g_free0 (connect_func);
4260 connect_func = _tmp43_;
4261 } else {
4262 if (!after) {
4263 gchar* _tmp44_;
4264 _tmp44_ = g_strdup ("g_signal_connect");
4265 _g_free0 (connect_func);
4266 connect_func = _tmp44_;
4267 } else {
4268 gchar* _tmp45_;
4269 _tmp45_ = g_strdup ("g_signal_connect_after");
4270 _g_free0 (connect_func);
4271 connect_func = _tmp45_;
4272 }
4273 }
4274 }
4275 }
4276 } else {
4277 if (G_TYPE_CHECK_INSTANCE_TYPE (sig, VALA_TYPE_DYNAMIC_SIGNAL)) {
4278 gchar* _tmp46_;
4279 _tmp46_ = vala_ccode_base_module_get_dynamic_signal_disconnect_wrapper_name ((ValaCCodeBaseModule*) self, G_TYPE_CHECK_INSTANCE_CAST (sig, VALA_TYPE_DYNAMIC_SIGNAL, ValaDynamicSignal));
4280 _g_free0 (connect_func);
4281 connect_func = _tmp46_;
4282 } else {
4283 gchar* _tmp47_;
4284 _tmp47_ = g_strdup ("g_signal_handlers_disconnect_matched");
4285 _g_free0 (connect_func);
4286 connect_func = _tmp47_;
4287 }
4288 }
4289 _tmp48_ = connect_func;
4290 _tmp49_ = vala_ccode_identifier_new (_tmp48_);
4291 _tmp50_ = _tmp49_;
4292 _tmp51_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp50_);
4293 _tmp52_ = _tmp51_;
4294 _vala_ccode_node_unref0 (_tmp50_);
4295 ccall = _tmp52_;
4296 signal_name_cexpr = NULL;
4297 if (G_TYPE_CHECK_INSTANCE_TYPE (signal_access, VALA_TYPE_ELEMENT_ACCESS)) {
4298 ValaElementAccess* ea = NULL;
4299 ValaElementAccess* _tmp53_;
4300 ValaElementAccess* _tmp54_;
4301 ValaExpression* _tmp55_;
4302 ValaExpression* _tmp56_;
4303 ValaMemberAccess* _tmp57_;
4304 ValaExpression* detail_expr = NULL;
4305 ValaElementAccess* _tmp58_;
4306 ValaList* _tmp59_;
4307 gpointer _tmp60_;
4308 ValaExpression* _tmp61_;
4309 ValaCCodeExpression* _tmp62_;
4310 _tmp53_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (signal_access, VALA_TYPE_ELEMENT_ACCESS, ValaElementAccess));
4311 ea = _tmp53_;
4312 _tmp54_ = ea;
4313 _tmp55_ = vala_element_access_get_container (_tmp54_);
4314 _tmp56_ = _tmp55_;
4315 _tmp57_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, VALA_TYPE_MEMBER_ACCESS, ValaMemberAccess));
4316 _vala_code_node_unref0 (ma);
4317 ma = _tmp57_;
4318 _tmp58_ = ea;
4319 _tmp59_ = vala_element_access_get_indices (_tmp58_);
4320 _tmp60_ = vala_list_get (_tmp59_, 0);
4321 detail_expr = (ValaExpression*) _tmp60_;
4322 _tmp61_ = detail_expr;
4323 _tmp62_ = vala_gsignal_module_get_signal_name_cexpression (self, sig, _tmp61_, expr);
4324 _vala_ccode_node_unref0 (signal_name_cexpr);
4325 signal_name_cexpr = _tmp62_;
4326 _vala_code_node_unref0 (detail_expr);
4327 _vala_code_node_unref0 (ea);
4328 } else {
4329 ValaMemberAccess* _tmp63_;
4330 ValaCCodeExpression* _tmp64_;
4331 _tmp63_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (signal_access, VALA_TYPE_MEMBER_ACCESS, ValaMemberAccess));
4332 _vala_code_node_unref0 (ma);
4333 ma = _tmp63_;
4334 _tmp64_ = vala_gsignal_module_get_signal_name_cexpression (self, sig, NULL, expr);
4335 _vala_ccode_node_unref0 (signal_name_cexpr);
4336 signal_name_cexpr = _tmp64_;
4337 }
4338 _tmp65_ = ma;
4339 _tmp66_ = vala_member_access_get_inner (_tmp65_);
4340 _tmp67_ = _tmp66_;
4341 if (_tmp67_ != NULL) {
4342 ValaCCodeFunctionCall* _tmp68_;
4343 ValaMemberAccess* _tmp69_;
4344 ValaExpression* _tmp70_;
4345 ValaExpression* _tmp71_;
4346 ValaCCodeExpression* _tmp72_;
4347 ValaCCodeExpression* _tmp73_;
4348 _tmp68_ = ccall;
4349 _tmp69_ = ma;
4350 _tmp70_ = vala_member_access_get_inner (_tmp69_);
4351 _tmp71_ = _tmp70_;
4352 _tmp72_ = vala_ccode_base_module_get_ccodenode ((ValaCCodeBaseModule*) self, _tmp71_);
4353 _tmp73_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, VALA_TYPE_CCODE_EXPRESSION, ValaCCodeExpression);
4354 vala_ccode_function_call_add_argument (_tmp68_, _tmp73_);
4355 _vala_ccode_node_unref0 (_tmp73_);
4356 } else {
4357 ValaCCodeFunctionCall* _tmp74_;
4358 ValaCCodeExpression* _tmp75_;
4359 ValaCCodeExpression* _tmp76_;
4360 _tmp74_ = ccall;
4361 _tmp75_ = vala_ccode_base_module_get_this_cexpression ((ValaCCodeBaseModule*) self);
4362 _tmp76_ = _tmp75_;
4363 vala_ccode_function_call_add_argument (_tmp74_, _tmp76_);
4364 _vala_ccode_node_unref0 (_tmp76_);
4365 }
4366 if (G_TYPE_CHECK_INSTANCE_TYPE (sig, VALA_TYPE_DYNAMIC_SIGNAL)) {
4367 ValaCCodeFunctionCall* _tmp77_;
4368 gchar* _tmp78_;
4369 gchar* _tmp79_;
4370 gchar* _tmp80_;
4371 gchar* _tmp81_;
4372 ValaCCodeConstant* _tmp82_;
4373 ValaCCodeConstant* _tmp83_;
4374 _tmp77_ = ccall;
4375 _tmp78_ = vala_get_ccode_name ((ValaCodeNode*) sig);
4376 _tmp79_ = _tmp78_;
4377 _tmp80_ = g_strdup_printf ("\"%s\"", _tmp79_);
4378 _tmp81_ = _tmp80_;
4379 _tmp82_ = vala_ccode_constant_new (_tmp81_);
4380 _tmp83_ = _tmp82_;
4381 vala_ccode_function_call_add_argument (_tmp77_, (ValaCCodeExpression*) _tmp83_);
4382 _vala_ccode_node_unref0 (_tmp83_);
4383 _g_free0 (_tmp81_);
4384 _g_free0 (_tmp79_);
4385 } else {
4386 if (!disconnect) {
4387 ValaCCodeFunctionCall* _tmp84_;
4388 ValaCCodeExpression* _tmp85_;
4389 _tmp84_ = ccall;
4390 _tmp85_ = signal_name_cexpr;
4391 vala_ccode_function_call_add_argument (_tmp84_, _tmp85_);
4392 } else {
4393 ValaLocalVariable* temp_decl = NULL;
4394 ValaDataType* _tmp92_;
4395 ValaLocalVariable* _tmp93_;
4396 ValaLocalVariable* _tmp94_;
4397 ValaCCodeFunctionCall* parse_call = NULL;
4398 ValaCCodeIdentifier* _tmp95_;
4399 ValaCCodeIdentifier* _tmp96_;
4400 ValaCCodeFunctionCall* _tmp97_;
4401 ValaCCodeFunctionCall* _tmp98_;
4402 ValaCCodeFunctionCall* _tmp99_;
4403 ValaCCodeExpression* _tmp100_;
4404 ValaTypeSymbol* decl_type = NULL;
4405 ValaSymbol* _tmp101_;
4406 ValaSymbol* _tmp102_;
4407 ValaTypeSymbol* _tmp103_;
4408 ValaCCodeFunctionCall* _tmp104_;
4409 ValaTypeSymbol* _tmp105_;
4410 gchar* _tmp106_;
4411 gchar* _tmp107_;
4412 ValaCCodeIdentifier* _tmp108_;
4413 ValaCCodeIdentifier* _tmp109_;
4414 ValaCCodeFunctionCall* _tmp110_;
4415 ValaLocalVariable* _tmp111_;
4416 const gchar* _tmp112_;
4417 const gchar* _tmp113_;
4418 ValaCCodeExpression* _tmp114_;
4419 ValaCCodeExpression* _tmp115_;
4420 ValaCCodeUnaryExpression* _tmp116_;
4421 ValaCCodeUnaryExpression* _tmp117_;
4422 ValaLocalVariable* detail_temp_decl = NULL;
4423 ValaCCodeFunction* _tmp138_;
4424 ValaCCodeFunction* _tmp139_;
4425 ValaCCodeFunctionCall* _tmp140_;
4426 ValaCCodeFunctionCall* _tmp141_;
4427 ValaLocalVariable* _tmp142_;
4428 const gchar* _tmp143_;
4429 const gchar* _tmp144_;
4430 ValaCCodeExpression* _tmp145_;
4431 ValaCCodeExpression* _tmp146_;
4432 ValaLocalVariable* _tmp147_;
4433 ValaCCodeFunctionCall* _tmp157_;
4434 ValaCCodeConstant* _tmp158_;
4435 ValaCCodeConstant* _tmp159_;
4436 if (!G_TYPE_CHECK_INSTANCE_TYPE (signal_access, VALA_TYPE_ELEMENT_ACCESS)) {
4437 ValaCCodeFunctionCall* _tmp86_;
4438 ValaCCodeConstant* _tmp87_;
4439 ValaCCodeConstant* _tmp88_;
4440 _tmp86_ = ccall;
4441 _tmp87_ = vala_ccode_constant_new ("G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA");
4442 _tmp88_ = _tmp87_;
4443 vala_ccode_function_call_add_argument (_tmp86_, (ValaCCodeExpression*) _tmp88_);
4444 _vala_ccode_node_unref0 (_tmp88_);
4445 } else {
4446 ValaCCodeFunctionCall* _tmp89_;
4447 ValaCCodeConstant* _tmp90_;
4448 ValaCCodeConstant* _tmp91_;
4449 _tmp89_ = ccall;
4450 _tmp90_ = vala_ccode_constant_new ("G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SI" \
4451 "GNAL_MATCH_DATA");
4452 _tmp91_ = _tmp90_;
4453 vala_ccode_function_call_add_argument (_tmp89_, (ValaCCodeExpression*) _tmp91_);
4454 _vala_ccode_node_unref0 (_tmp91_);
4455 }
4456 _tmp92_ = ((ValaCCodeBaseModule*) self)->uint_type;
4457 _tmp93_ = vala_ccode_base_module_get_temp_variable ((ValaCCodeBaseModule*) self, _tmp92_, TRUE, NULL, FALSE);
4458 temp_decl = _tmp93_;
4459 _tmp94_ = temp_decl;
4460 vala_ccode_base_module_emit_temp_var ((ValaCCodeBaseModule*) self, _tmp94_, FALSE);
4461 _tmp95_ = vala_ccode_identifier_new ("g_signal_parse_name");
4462 _tmp96_ = _tmp95_;
4463 _tmp97_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp96_);
4464 _tmp98_ = _tmp97_;
4465 _vala_ccode_node_unref0 (_tmp96_);
4466 parse_call = _tmp98_;
4467 _tmp99_ = parse_call;
4468 _tmp100_ = signal_name_cexpr;
4469 vala_ccode_function_call_add_argument (_tmp99_, _tmp100_);
4470 _tmp101_ = vala_symbol_get_parent_symbol ((ValaSymbol*) sig);
4471 _tmp102_ = _tmp101_;
4472 _tmp103_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp102_, VALA_TYPE_TYPESYMBOL, ValaTypeSymbol));
4473 decl_type = _tmp103_;
4474 _tmp104_ = parse_call;
4475 _tmp105_ = decl_type;
4476 _tmp106_ = vala_get_ccode_type_id ((ValaCodeNode*) _tmp105_);
4477 _tmp107_ = _tmp106_;
4478 _tmp108_ = vala_ccode_identifier_new (_tmp107_);
4479 _tmp109_ = _tmp108_;
4480 vala_ccode_function_call_add_argument (_tmp104_, (ValaCCodeExpression*) _tmp109_);
4481 _vala_ccode_node_unref0 (_tmp109_);
4482 _g_free0 (_tmp107_);
4483 _tmp110_ = parse_call;
4484 _tmp111_ = temp_decl;
4485 _tmp112_ = vala_symbol_get_name ((ValaSymbol*) _tmp111_);
4486 _tmp113_ = _tmp112_;
4487 _tmp114_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp113_);
4488 _tmp115_ = _tmp114_;
4489 _tmp116_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp115_);
4490 _tmp117_ = _tmp116_;
4491 vala_ccode_function_call_add_argument (_tmp110_, (ValaCCodeExpression*) _tmp117_);
4492 _vala_ccode_node_unref0 (_tmp117_);
4493 _vala_ccode_node_unref0 (_tmp115_);
4494 detail_temp_decl = NULL;
4495 if (!G_TYPE_CHECK_INSTANCE_TYPE (signal_access, VALA_TYPE_ELEMENT_ACCESS)) {
4496 ValaCCodeFunctionCall* _tmp118_;
4497 ValaCCodeConstant* _tmp119_;
4498 ValaCCodeConstant* _tmp120_;
4499 ValaCCodeFunctionCall* _tmp121_;
4500 ValaCCodeConstant* _tmp122_;
4501 ValaCCodeConstant* _tmp123_;
4502 _tmp118_ = parse_call;
4503 _tmp119_ = vala_ccode_constant_new ("NULL");
4504 _tmp120_ = _tmp119_;
4505 vala_ccode_function_call_add_argument (_tmp118_, (ValaCCodeExpression*) _tmp120_);
4506 _vala_ccode_node_unref0 (_tmp120_);
4507 _tmp121_ = parse_call;
4508 _tmp122_ = vala_ccode_constant_new ("FALSE");
4509 _tmp123_ = _tmp122_;
4510 vala_ccode_function_call_add_argument (_tmp121_, (ValaCCodeExpression*) _tmp123_);
4511 _vala_ccode_node_unref0 (_tmp123_);
4512 } else {
4513 ValaDataType* _tmp124_;
4514 ValaLocalVariable* _tmp125_;
4515 ValaLocalVariable* _tmp126_;
4516 ValaCCodeFunctionCall* _tmp127_;
4517 ValaLocalVariable* _tmp128_;
4518 const gchar* _tmp129_;
4519 const gchar* _tmp130_;
4520 ValaCCodeExpression* _tmp131_;
4521 ValaCCodeExpression* _tmp132_;
4522 ValaCCodeUnaryExpression* _tmp133_;
4523 ValaCCodeUnaryExpression* _tmp134_;
4524 ValaCCodeFunctionCall* _tmp135_;
4525 ValaCCodeConstant* _tmp136_;
4526 ValaCCodeConstant* _tmp137_;
4527 _tmp124_ = ((ValaCCodeBaseModule*) self)->gquark_type;
4528 _tmp125_ = vala_ccode_base_module_get_temp_variable ((ValaCCodeBaseModule*) self, _tmp124_, TRUE, NULL, FALSE);
4529 _vala_code_node_unref0 (detail_temp_decl);
4530 detail_temp_decl = _tmp125_;
4531 _tmp126_ = detail_temp_decl;
4532 vala_ccode_base_module_emit_temp_var ((ValaCCodeBaseModule*) self, _tmp126_, FALSE);
4533 _tmp127_ = parse_call;
4534 _tmp128_ = detail_temp_decl;
4535 _tmp129_ = vala_symbol_get_name ((ValaSymbol*) _tmp128_);
4536 _tmp130_ = _tmp129_;
4537 _tmp131_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp130_);
4538 _tmp132_ = _tmp131_;
4539 _tmp133_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp132_);
4540 _tmp134_ = _tmp133_;
4541 vala_ccode_function_call_add_argument (_tmp127_, (ValaCCodeExpression*) _tmp134_);
4542 _vala_ccode_node_unref0 (_tmp134_);
4543 _vala_ccode_node_unref0 (_tmp132_);
4544 _tmp135_ = parse_call;
4545 _tmp136_ = vala_ccode_constant_new ("TRUE");
4546 _tmp137_ = _tmp136_;
4547 vala_ccode_function_call_add_argument (_tmp135_, (ValaCCodeExpression*) _tmp137_);
4548 _vala_ccode_node_unref0 (_tmp137_);
4549 }
4550 _tmp138_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
4551 _tmp139_ = _tmp138_;
4552 _tmp140_ = parse_call;
4553 vala_ccode_function_add_expression (_tmp139_, (ValaCCodeExpression*) _tmp140_);
4554 _tmp141_ = ccall;
4555 _tmp142_ = temp_decl;
4556 _tmp143_ = vala_symbol_get_name ((ValaSymbol*) _tmp142_);
4557 _tmp144_ = _tmp143_;
4558 _tmp145_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp144_);
4559 _tmp146_ = _tmp145_;
4560 vala_ccode_function_call_add_argument (_tmp141_, _tmp146_);
4561 _vala_ccode_node_unref0 (_tmp146_);
4562 _tmp147_ = detail_temp_decl;
4563 if (_tmp147_ == NULL) {
4564 ValaCCodeFunctionCall* _tmp148_;
4565 ValaCCodeConstant* _tmp149_;
4566 ValaCCodeConstant* _tmp150_;
4567 _tmp148_ = ccall;
4568 _tmp149_ = vala_ccode_constant_new ("0");
4569 _tmp150_ = _tmp149_;
4570 vala_ccode_function_call_add_argument (_tmp148_, (ValaCCodeExpression*) _tmp150_);
4571 _vala_ccode_node_unref0 (_tmp150_);
4572 } else {
4573 ValaCCodeFunctionCall* _tmp151_;
4574 ValaLocalVariable* _tmp152_;
4575 const gchar* _tmp153_;
4576 const gchar* _tmp154_;
4577 ValaCCodeExpression* _tmp155_;
4578 ValaCCodeExpression* _tmp156_;
4579 _tmp151_ = ccall;
4580 _tmp152_ = detail_temp_decl;
4581 _tmp153_ = vala_symbol_get_name ((ValaSymbol*) _tmp152_);
4582 _tmp154_ = _tmp153_;
4583 _tmp155_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp154_);
4584 _tmp156_ = _tmp155_;
4585 vala_ccode_function_call_add_argument (_tmp151_, _tmp156_);
4586 _vala_ccode_node_unref0 (_tmp156_);
4587 }
4588 _tmp157_ = ccall;
4589 _tmp158_ = vala_ccode_constant_new ("NULL");
4590 _tmp159_ = _tmp158_;
4591 vala_ccode_function_call_add_argument (_tmp157_, (ValaCCodeExpression*) _tmp159_);
4592 _vala_ccode_node_unref0 (_tmp159_);
4593 _vala_code_node_unref0 (detail_temp_decl);
4594 _vala_code_node_unref0 (decl_type);
4595 _vala_ccode_node_unref0 (parse_call);
4596 _vala_code_node_unref0 (temp_decl);
4597 }
4598 }
4599 _tmp160_ = ccall;
4600 _tmp161_ = vala_get_cvalue (handler);
4601 _tmp162_ = vala_ccode_cast_expression_new (_tmp161_, "GCallback");
4602 _tmp163_ = _tmp162_;
4603 vala_ccode_function_call_add_argument (_tmp160_, (ValaCCodeExpression*) _tmp163_);
4604 _vala_ccode_node_unref0 (_tmp163_);
4605 _tmp165_ = m;
4606 if (_tmp165_ != NULL) {
4607 ValaMethod* _tmp166_;
4608 gboolean _tmp167_;
4609 gboolean _tmp168_;
4610 _tmp166_ = m;
4611 _tmp167_ = vala_method_get_closure (_tmp166_);
4612 _tmp168_ = _tmp167_;
4613 _tmp164_ = _tmp168_;
4614 } else {
4615 _tmp164_ = FALSE;
4616 }
4617 if (_tmp164_) {
4618 ValaCCodeExpression* handler_destroy_notify = NULL;
4619 ValaCCodeFunctionCall* _tmp169_;
4620 ValaCCodeExpression* _tmp170_ = NULL;
4621 ValaCCodeExpression* _tmp171_;
4622 ValaCCodeExpression* _tmp172_;
4623 ValaCCodeFunctionCall* _tmp173_;
4624 ValaCCodeExpression* _tmp174_;
4625 ValaCCodeCastExpression* _tmp175_;
4626 ValaCCodeCastExpression* _tmp176_;
4627 _tmp169_ = ccall;
4628 _tmp171_ = vala_ccode_base_module_get_delegate_target_cexpression ((ValaCCodeBaseModule*) self, handler, &_tmp170_);
4629 _vala_ccode_node_unref0 (handler_destroy_notify);
4630 handler_destroy_notify = _tmp170_;
4631 _tmp172_ = _tmp171_;
4632 vala_ccode_function_call_add_argument (_tmp169_, _tmp172_);
4633 _vala_ccode_node_unref0 (_tmp172_);
4634 _tmp173_ = ccall;
4635 _tmp174_ = handler_destroy_notify;
4636 _tmp175_ = vala_ccode_cast_expression_new (_tmp174_, "GClosureNotify");
4637 _tmp176_ = _tmp175_;
4638 vala_ccode_function_call_add_argument (_tmp173_, (ValaCCodeExpression*) _tmp176_);
4639 _vala_ccode_node_unref0 (_tmp176_);
4640 if (!after) {
4641 ValaCCodeFunctionCall* _tmp177_;
4642 ValaCCodeConstant* _tmp178_;
4643 ValaCCodeConstant* _tmp179_;
4644 _tmp177_ = ccall;
4645 _tmp178_ = vala_ccode_constant_new ("0");
4646 _tmp179_ = _tmp178_;
4647 vala_ccode_function_call_add_argument (_tmp177_, (ValaCCodeExpression*) _tmp179_);
4648 _vala_ccode_node_unref0 (_tmp179_);
4649 } else {
4650 ValaCCodeFunctionCall* _tmp180_;
4651 ValaCCodeConstant* _tmp181_;
4652 ValaCCodeConstant* _tmp182_;
4653 _tmp180_ = ccall;
4654 _tmp181_ = vala_ccode_constant_new ("G_CONNECT_AFTER");
4655 _tmp182_ = _tmp181_;
4656 vala_ccode_function_call_add_argument (_tmp180_, (ValaCCodeExpression*) _tmp182_);
4657 _vala_ccode_node_unref0 (_tmp182_);
4658 }
4659 _vala_ccode_node_unref0 (handler_destroy_notify);
4660 } else {
4661 gboolean _tmp183_ = FALSE;
4662 ValaMethod* _tmp184_;
4663 _tmp184_ = m;
4664 if (_tmp184_ != NULL) {
4665 ValaMethod* _tmp185_;
4666 ValaMemberBinding _tmp186_;
4667 ValaMemberBinding _tmp187_;
4668 _tmp185_ = m;
4669 _tmp186_ = vala_method_get_binding (_tmp185_);
4670 _tmp187_ = _tmp186_;
4671 _tmp183_ = _tmp187_ == VALA_MEMBER_BINDING_INSTANCE;
4672 } else {
4673 _tmp183_ = FALSE;
4674 }
4675 if (_tmp183_) {
4676 gboolean _tmp203_ = FALSE;
4677 gboolean _tmp204_ = FALSE;
4678 if (G_TYPE_CHECK_INSTANCE_TYPE (handler, VALA_TYPE_MEMBER_ACCESS)) {
4679 ValaMemberAccess* right_ma = NULL;
4680 ValaMemberAccess* _tmp188_;
4681 ValaMemberAccess* _tmp189_;
4682 ValaExpression* _tmp190_;
4683 ValaExpression* _tmp191_;
4684 _tmp188_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (handler, VALA_TYPE_MEMBER_ACCESS, ValaMemberAccess));
4685 right_ma = _tmp188_;
4686 _tmp189_ = right_ma;
4687 _tmp190_ = vala_member_access_get_inner (_tmp189_);
4688 _tmp191_ = _tmp190_;
4689 if (_tmp191_ != NULL) {
4690 ValaCCodeFunctionCall* _tmp192_;
4691 ValaMemberAccess* _tmp193_;
4692 ValaExpression* _tmp194_;
4693 ValaExpression* _tmp195_;
4694 ValaCCodeExpression* _tmp196_;
4695 _tmp192_ = ccall;
4696 _tmp193_ = right_ma;
4697 _tmp194_ = vala_member_access_get_inner (_tmp193_);
4698 _tmp195_ = _tmp194_;
4699 _tmp196_ = vala_get_cvalue (_tmp195_);
4700 vala_ccode_function_call_add_argument (_tmp192_, _tmp196_);
4701 } else {
4702 ValaCCodeFunctionCall* _tmp197_;
4703 ValaCCodeExpression* _tmp198_;
4704 ValaCCodeExpression* _tmp199_;
4705 _tmp197_ = ccall;
4706 _tmp198_ = vala_ccode_base_module_get_this_cexpression ((ValaCCodeBaseModule*) self);
4707 _tmp199_ = _tmp198_;
4708 vala_ccode_function_call_add_argument (_tmp197_, _tmp199_);
4709 _vala_ccode_node_unref0 (_tmp199_);
4710 }
4711 _vala_code_node_unref0 (right_ma);
4712 } else {
4713 if (G_TYPE_CHECK_INSTANCE_TYPE (handler, VALA_TYPE_LAMBDA_EXPRESSION)) {
4714 ValaCCodeFunctionCall* _tmp200_;
4715 ValaCCodeExpression* _tmp201_;
4716 ValaCCodeExpression* _tmp202_;
4717 _tmp200_ = ccall;
4718 _tmp201_ = vala_ccode_base_module_get_this_cexpression ((ValaCCodeBaseModule*) self);
4719 _tmp202_ = _tmp201_;
4720 vala_ccode_function_call_add_argument (_tmp200_, _tmp202_);
4721 _vala_ccode_node_unref0 (_tmp202_);
4722 }
4723 }
4724 if (!disconnect) {
4725 _tmp204_ = !G_TYPE_CHECK_INSTANCE_TYPE (sig, VALA_TYPE_DYNAMIC_SIGNAL);
4726 } else {
4727 _tmp204_ = FALSE;
4728 }
4729 if (_tmp204_) {
4730 ValaMethod* _tmp205_;
4731 _tmp205_ = m;
4732 _tmp203_ = vala_gsignal_module_in_gobject_instance (self, _tmp205_);
4733 } else {
4734 _tmp203_ = FALSE;
4735 }
4736 if (_tmp203_) {
4737 if (!after) {
4738 ValaCCodeFunctionCall* _tmp206_;
4739 ValaCCodeConstant* _tmp207_;
4740 ValaCCodeConstant* _tmp208_;
4741 _tmp206_ = ccall;
4742 _tmp207_ = vala_ccode_constant_new ("0");
4743 _tmp208_ = _tmp207_;
4744 vala_ccode_function_call_add_argument (_tmp206_, (ValaCCodeExpression*) _tmp208_);
4745 _vala_ccode_node_unref0 (_tmp208_);
4746 } else {
4747 ValaCCodeFunctionCall* _tmp209_;
4748 ValaCCodeConstant* _tmp210_;
4749 ValaCCodeConstant* _tmp211_;
4750 _tmp209_ = ccall;
4751 _tmp210_ = vala_ccode_constant_new ("G_CONNECT_AFTER");
4752 _tmp211_ = _tmp210_;
4753 vala_ccode_function_call_add_argument (_tmp209_, (ValaCCodeExpression*) _tmp211_);
4754 _vala_ccode_node_unref0 (_tmp211_);
4755 }
4756 }
4757 } else {
4758 gboolean _tmp212_ = FALSE;
4759 ValaDelegateType* _tmp213_;
4760 _tmp213_ = dt;
4761 if (_tmp213_ != NULL) {
4762 ValaDelegateType* _tmp214_;
4763 ValaDelegate* _tmp215_;
4764 ValaDelegate* _tmp216_;
4765 gboolean _tmp217_;
4766 gboolean _tmp218_;
4767 _tmp214_ = dt;
4768 _tmp215_ = vala_delegate_type_get_delegate_symbol (_tmp214_);
4769 _tmp216_ = _tmp215_;
4770 _tmp217_ = vala_delegate_get_has_target (_tmp216_);
4771 _tmp218_ = _tmp217_;
4772 _tmp212_ = _tmp218_;
4773 } else {
4774 _tmp212_ = FALSE;
4775 }
4776 if (_tmp212_) {
4777 ValaCCodeExpression* handler_destroy_notify = NULL;
4778 ValaCCodeFunctionCall* _tmp219_;
4779 ValaCCodeExpression* _tmp220_ = NULL;
4780 ValaCCodeExpression* _tmp221_;
4781 ValaCCodeExpression* _tmp222_;
4782 gboolean _tmp223_ = FALSE;
4783 _tmp219_ = ccall;
4784 _tmp221_ = vala_ccode_base_module_get_delegate_target_cexpression ((ValaCCodeBaseModule*) self, handler, &_tmp220_);
4785 _vala_ccode_node_unref0 (handler_destroy_notify);
4786 handler_destroy_notify = _tmp220_;
4787 _tmp222_ = _tmp221_;
4788 vala_ccode_function_call_add_argument (_tmp219_, _tmp222_);
4789 _vala_ccode_node_unref0 (_tmp222_);
4790 if (!disconnect) {
4791 ValaDelegateType* _tmp224_;
4792 gboolean _tmp225_;
4793 gboolean _tmp226_;
4794 _tmp224_ = dt;
4795 _tmp225_ = vala_data_type_get_value_owned ((ValaDataType*) _tmp224_);
4796 _tmp226_ = _tmp225_;
4797 _tmp223_ = _tmp226_;
4798 } else {
4799 _tmp223_ = FALSE;
4800 }
4801 if (_tmp223_) {
4802 ValaCCodeFunctionCall* _tmp227_;
4803 ValaCCodeExpression* _tmp228_;
4804 ValaCCodeCastExpression* _tmp229_;
4805 ValaCCodeCastExpression* _tmp230_;
4806 _tmp227_ = ccall;
4807 _tmp228_ = handler_destroy_notify;
4808 _tmp229_ = vala_ccode_cast_expression_new (_tmp228_, "GClosureNotify");
4809 _tmp230_ = _tmp229_;
4810 vala_ccode_function_call_add_argument (_tmp227_, (ValaCCodeExpression*) _tmp230_);
4811 _vala_ccode_node_unref0 (_tmp230_);
4812 if (!after) {
4813 ValaCCodeFunctionCall* _tmp231_;
4814 ValaCCodeConstant* _tmp232_;
4815 ValaCCodeConstant* _tmp233_;
4816 _tmp231_ = ccall;
4817 _tmp232_ = vala_ccode_constant_new ("0");
4818 _tmp233_ = _tmp232_;
4819 vala_ccode_function_call_add_argument (_tmp231_, (ValaCCodeExpression*) _tmp233_);
4820 _vala_ccode_node_unref0 (_tmp233_);
4821 } else {
4822 ValaCCodeFunctionCall* _tmp234_;
4823 ValaCCodeConstant* _tmp235_;
4824 ValaCCodeConstant* _tmp236_;
4825 _tmp234_ = ccall;
4826 _tmp235_ = vala_ccode_constant_new ("G_CONNECT_AFTER");
4827 _tmp236_ = _tmp235_;
4828 vala_ccode_function_call_add_argument (_tmp234_, (ValaCCodeExpression*) _tmp236_);
4829 _vala_ccode_node_unref0 (_tmp236_);
4830 }
4831 }
4832 _vala_ccode_node_unref0 (handler_destroy_notify);
4833 } else {
4834 ValaCCodeFunctionCall* _tmp237_;
4835 ValaCCodeConstant* _tmp238_;
4836 ValaCCodeConstant* _tmp239_;
4837 _tmp237_ = ccall;
4838 _tmp238_ = vala_ccode_constant_new ("NULL");
4839 _tmp239_ = _tmp238_;
4840 vala_ccode_function_call_add_argument (_tmp237_, (ValaCCodeExpression*) _tmp239_);
4841 _vala_ccode_node_unref0 (_tmp239_);
4842 }
4843 }
4844 }
4845 if (disconnect) {
4846 _tmp240_ = TRUE;
4847 } else {
4848 ValaCodeNode* _tmp241_;
4849 ValaCodeNode* _tmp242_;
4850 _tmp241_ = vala_code_node_get_parent_node (expr);
4851 _tmp242_ = _tmp241_;
4852 _tmp240_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp242_, VALA_TYPE_EXPRESSION_STATEMENT);
4853 }
4854 if (_tmp240_) {
4855 ValaCCodeFunction* _tmp243_;
4856 ValaCCodeFunction* _tmp244_;
4857 ValaCCodeFunctionCall* _tmp245_;
4858 _tmp243_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
4859 _tmp244_ = _tmp243_;
4860 _tmp245_ = ccall;
4861 vala_ccode_function_add_expression (_tmp244_, (ValaCCodeExpression*) _tmp245_);
4862 result = NULL;
4863 _vala_code_node_unref0 (ma);
4864 _vala_ccode_node_unref0 (signal_name_cexpr);
4865 _vala_ccode_node_unref0 (ccall);
4866 _vala_code_node_unref0 (m);
4867 _vala_code_node_unref0 (dt);
4868 _g_free0 (connect_func);
4869 return result;
4870 } else {
4871 ValaLocalVariable* temp_var = NULL;
4872 ValaDataType* _tmp246_;
4873 ValaLocalVariable* _tmp247_;
4874 ValaCCodeExpression* temp_ref = NULL;
4875 ValaLocalVariable* _tmp248_;
4876 const gchar* _tmp249_;
4877 const gchar* _tmp250_;
4878 ValaCCodeExpression* _tmp251_;
4879 ValaLocalVariable* _tmp252_;
4880 ValaCCodeFunction* _tmp253_;
4881 ValaCCodeFunction* _tmp254_;
4882 ValaCCodeExpression* _tmp255_;
4883 ValaCCodeFunctionCall* _tmp256_;
4884 _tmp246_ = ((ValaCCodeBaseModule*) self)->ulong_type;
4885 _tmp247_ = vala_ccode_base_module_get_temp_variable ((ValaCCodeBaseModule*) self, _tmp246_, TRUE, NULL, FALSE);
4886 temp_var = _tmp247_;
4887 _tmp248_ = temp_var;
4888 _tmp249_ = vala_symbol_get_name ((ValaSymbol*) _tmp248_);
4889 _tmp250_ = _tmp249_;
4890 _tmp251_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp250_);
4891 temp_ref = _tmp251_;
4892 _tmp252_ = temp_var;
4893 vala_ccode_base_module_emit_temp_var ((ValaCCodeBaseModule*) self, _tmp252_, FALSE);
4894 _tmp253_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
4895 _tmp254_ = _tmp253_;
4896 _tmp255_ = temp_ref;
4897 _tmp256_ = ccall;
4898 vala_ccode_function_add_assignment (_tmp254_, _tmp255_, (ValaCCodeExpression*) _tmp256_);
4899 result = temp_ref;
4900 _vala_code_node_unref0 (temp_var);
4901 _vala_code_node_unref0 (ma);
4902 _vala_ccode_node_unref0 (signal_name_cexpr);
4903 _vala_ccode_node_unref0 (ccall);
4904 _vala_code_node_unref0 (m);
4905 _vala_code_node_unref0 (dt);
4906 _g_free0 (connect_func);
4907 return result;
4908 }
4909 _vala_code_node_unref0 (ma);
4910 _vala_ccode_node_unref0 (signal_name_cexpr);
4911 _vala_ccode_node_unref0 (ccall);
4912 _vala_code_node_unref0 (m);
4913 _vala_code_node_unref0 (dt);
4914 _g_free0 (connect_func);
4915 }
4916
4917 ValaGSignalModule*
vala_gsignal_module_construct(GType object_type)4918 vala_gsignal_module_construct (GType object_type)
4919 {
4920 ValaGSignalModule* self = NULL;
4921 self = (ValaGSignalModule*) vala_gobject_module_construct (object_type);
4922 return self;
4923 }
4924
4925 ValaGSignalModule*
vala_gsignal_module_new(void)4926 vala_gsignal_module_new (void)
4927 {
4928 return vala_gsignal_module_construct (VALA_TYPE_GSIGNAL_MODULE);
4929 }
4930
4931 static void
vala_gsignal_module_class_init(ValaGSignalModuleClass * klass,gpointer klass_data)4932 vala_gsignal_module_class_init (ValaGSignalModuleClass * klass,
4933 gpointer klass_data)
4934 {
4935 vala_gsignal_module_parent_class = g_type_class_peek_parent (klass);
4936 ((ValaCodeVisitorClass *) klass)->visit_signal = (void (*) (ValaCodeVisitor*, ValaSignal*)) vala_gsignal_module_real_visit_signal;
4937 ((ValaCCodeBaseModuleClass *) klass)->get_signal_creation = (ValaCCodeExpression* (*) (ValaCCodeBaseModule*, ValaSignal*, ValaObjectTypeSymbol*)) vala_gsignal_module_real_get_signal_creation;
4938 ((ValaCodeVisitorClass *) klass)->visit_element_access = (void (*) (ValaCodeVisitor*, ValaElementAccess*)) vala_gsignal_module_real_visit_element_access;
4939 ((ValaCodeVisitorClass *) klass)->visit_member_access = (void (*) (ValaCodeVisitor*, ValaMemberAccess*)) vala_gsignal_module_real_visit_member_access;
4940 ((ValaCodeVisitorClass *) klass)->visit_method_call = (void (*) (ValaCodeVisitor*, ValaMethodCall*)) vala_gsignal_module_real_visit_method_call;
4941 }
4942
4943 static void
vala_gsignal_module_instance_init(ValaGSignalModule * self,gpointer klass)4944 vala_gsignal_module_instance_init (ValaGSignalModule * self,
4945 gpointer klass)
4946 {
4947 }
4948
4949 static GType
vala_gsignal_module_get_type_once(void)4950 vala_gsignal_module_get_type_once (void)
4951 {
4952 static const GTypeInfo g_define_type_info = { sizeof (ValaGSignalModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_gsignal_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaGSignalModule), 0, (GInstanceInitFunc) vala_gsignal_module_instance_init, NULL };
4953 GType vala_gsignal_module_type_id;
4954 vala_gsignal_module_type_id = g_type_register_static (VALA_TYPE_GOBJECT_MODULE, "ValaGSignalModule", &g_define_type_info, 0);
4955 return vala_gsignal_module_type_id;
4956 }
4957
4958 GType
vala_gsignal_module_get_type(void)4959 vala_gsignal_module_get_type (void)
4960 {
4961 static volatile gsize vala_gsignal_module_type_id__volatile = 0;
4962 if (g_once_init_enter (&vala_gsignal_module_type_id__volatile)) {
4963 GType vala_gsignal_module_type_id;
4964 vala_gsignal_module_type_id = vala_gsignal_module_get_type_once ();
4965 g_once_init_leave (&vala_gsignal_module_type_id__volatile, vala_gsignal_module_type_id);
4966 }
4967 return vala_gsignal_module_type_id__volatile;
4968 }
4969
4970 static void
_vala_array_destroy(gpointer array,gint array_length,GDestroyNotify destroy_func)4971 _vala_array_destroy (gpointer array,
4972 gint array_length,
4973 GDestroyNotify destroy_func)
4974 {
4975 if ((array != NULL) && (destroy_func != NULL)) {
4976 gint i;
4977 for (i = 0; i < array_length; i = i + 1) {
4978 if (((gpointer*) array)[i] != NULL) {
4979 destroy_func (((gpointer*) array)[i]);
4980 }
4981 }
4982 }
4983 }
4984
4985 static void
_vala_array_free(gpointer array,gint array_length,GDestroyNotify destroy_func)4986 _vala_array_free (gpointer array,
4987 gint array_length,
4988 GDestroyNotify destroy_func)
4989 {
4990 _vala_array_destroy (array, array_length, destroy_func);
4991 g_free (array);
4992 }
4993
4994