1 /* valacallable.c generated by valac, the Vala compiler
2  * generated from valacallable.vala, do not modify */
3 
4 /* valacallable.vala
5  *
6  * Copyright (C) 2011  Luca Bruno
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12 
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17 
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
21  *
22  * Author:
23  * 	Luca Bruno <lucabru@src.gnome.org>
24  */
25 
26 #include "vala.h"
27 #include <glib.h>
28 #include <valagee.h>
29 #include <glib-object.h>
30 
31 static GType vala_callable_get_type_once (void);
32 
33 ValaDataType*
vala_callable_get_return_type(ValaCallable * self)34 vala_callable_get_return_type (ValaCallable* self)
35 {
36 	g_return_val_if_fail (self != NULL, NULL);
37 	return VALA_CALLABLE_GET_INTERFACE (self)->get_return_type (self);
38 }
39 
40 void
vala_callable_set_return_type(ValaCallable * self,ValaDataType * value)41 vala_callable_set_return_type (ValaCallable* self,
42                                ValaDataType* value)
43 {
44 	g_return_if_fail (self != NULL);
45 	VALA_CALLABLE_GET_INTERFACE (self)->set_return_type (self, value);
46 }
47 
48 /**
49  * Appends parameter to this callable.
50  *
51  * @param param a formal parameter
52  */
53 void
vala_callable_add_parameter(ValaCallable * self,ValaParameter * param)54 vala_callable_add_parameter (ValaCallable* self,
55                              ValaParameter* param)
56 {
57 	g_return_if_fail (self != NULL);
58 	VALA_CALLABLE_GET_INTERFACE (self)->add_parameter (self, param);
59 }
60 
61 /**
62  * Returns the parameter list.
63  */
64 ValaList*
vala_callable_get_parameters(ValaCallable * self)65 vala_callable_get_parameters (ValaCallable* self)
66 {
67 	g_return_val_if_fail (self != NULL, NULL);
68 	return VALA_CALLABLE_GET_INTERFACE (self)->get_parameters (self);
69 }
70 
71 static void
vala_callable_default_init(ValaCallableIface * iface,gpointer iface_data)72 vala_callable_default_init (ValaCallableIface * iface,
73                             gpointer iface_data)
74 {
75 }
76 
77 /**
78  * Interface for all callable types.
79  */
80 static GType
vala_callable_get_type_once(void)81 vala_callable_get_type_once (void)
82 {
83 	static const GTypeInfo g_define_type_info = { sizeof (ValaCallableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_callable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
84 	GType vala_callable_type_id;
85 	vala_callable_type_id = g_type_register_static (G_TYPE_INTERFACE, "ValaCallable", &g_define_type_info, 0);
86 	g_type_interface_add_prerequisite (vala_callable_type_id, VALA_TYPE_SYMBOL);
87 	return vala_callable_type_id;
88 }
89 
90 GType
vala_callable_get_type(void)91 vala_callable_get_type (void)
92 {
93 	static volatile gsize vala_callable_type_id__volatile = 0;
94 	if (g_once_init_enter (&vala_callable_type_id__volatile)) {
95 		GType vala_callable_type_id;
96 		vala_callable_type_id = vala_callable_get_type_once ();
97 		g_once_init_leave (&vala_callable_type_id__volatile, vala_callable_type_id);
98 	}
99 	return vala_callable_type_id__volatile;
100 }
101 
102