1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
|
/* valainterfacetype.c generated by valac, the Vala compiler
* generated from valainterfacetype.vala, do not modify */
/* valainterfacetype.vala
*
* Copyright (C) 2007-2008 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jürg Billeter <j@bitron.ch>
*/
#include <glib.h>
#include <glib-object.h>
#include "vala.h"
#include <valagee.h>
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
struct _ValaInterfaceTypePrivate {
ValaInterface* _interface_symbol;
};
static gint ValaInterfaceType_private_offset;
static gpointer vala_interface_type_parent_class = NULL;
static ValaDataType* vala_interface_type_real_copy (ValaDataType* base);
static void vala_interface_type_finalize (ValaCodeNode * obj);
static inline gpointer
vala_interface_type_get_instance_private (ValaInterfaceType* self)
{
return G_STRUCT_MEMBER_P (self, ValaInterfaceType_private_offset);
}
ValaInterfaceType*
vala_interface_type_construct (GType object_type,
ValaInterface* interface_symbol)
{
ValaInterfaceType* self = NULL;
g_return_val_if_fail (interface_symbol != NULL, NULL);
self = (ValaInterfaceType*) vala_reference_type_construct (object_type);
vala_interface_type_set_interface_symbol (self, interface_symbol);
return self;
}
ValaInterfaceType*
vala_interface_type_new (ValaInterface* interface_symbol)
{
return vala_interface_type_construct (VALA_TYPE_INTERFACE_TYPE, interface_symbol);
}
static ValaDataType*
vala_interface_type_real_copy (ValaDataType* base)
{
ValaInterfaceType * self;
ValaDataType* result = NULL;
ValaInterfaceType* _result_ = NULL;
ValaInterface* _tmp0_;
ValaInterfaceType* _tmp1_;
ValaInterfaceType* _tmp2_;
ValaSourceReference* _tmp3_;
ValaSourceReference* _tmp4_;
ValaInterfaceType* _tmp5_;
gboolean _tmp6_;
gboolean _tmp7_;
ValaInterfaceType* _tmp8_;
gboolean _tmp9_;
gboolean _tmp10_;
ValaInterfaceType* _tmp11_;
gboolean _tmp12_;
gboolean _tmp13_;
ValaInterfaceType* _tmp14_;
gboolean _tmp15_;
gboolean _tmp16_;
self = (ValaInterfaceType*) base;
_tmp0_ = self->priv->_interface_symbol;
_tmp1_ = vala_interface_type_new (_tmp0_);
_result_ = _tmp1_;
_tmp2_ = _result_;
_tmp3_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
_tmp4_ = _tmp3_;
vala_code_node_set_source_reference ((ValaCodeNode*) _tmp2_, _tmp4_);
_tmp5_ = _result_;
_tmp6_ = vala_data_type_get_value_owned ((ValaDataType*) self);
_tmp7_ = _tmp6_;
vala_data_type_set_value_owned ((ValaDataType*) _tmp5_, _tmp7_);
_tmp8_ = _result_;
_tmp9_ = vala_data_type_get_nullable ((ValaDataType*) self);
_tmp10_ = _tmp9_;
vala_data_type_set_nullable ((ValaDataType*) _tmp8_, _tmp10_);
_tmp11_ = _result_;
_tmp12_ = vala_data_type_get_is_dynamic ((ValaDataType*) self);
_tmp13_ = _tmp12_;
vala_data_type_set_is_dynamic ((ValaDataType*) _tmp11_, _tmp13_);
_tmp14_ = _result_;
_tmp15_ = vala_data_type_get_floating_reference ((ValaDataType*) self);
_tmp16_ = _tmp15_;
vala_data_type_set_floating_reference ((ValaDataType*) _tmp14_, _tmp16_);
{
ValaList* _arg_list = NULL;
ValaList* _tmp17_;
gint _arg_size = 0;
ValaList* _tmp18_;
gint _tmp19_;
gint _tmp20_;
gint _arg_index = 0;
_tmp17_ = vala_data_type_get_type_arguments ((ValaDataType*) self);
_arg_list = _tmp17_;
_tmp18_ = _arg_list;
_tmp19_ = vala_collection_get_size ((ValaCollection*) _tmp18_);
_tmp20_ = _tmp19_;
_arg_size = _tmp20_;
_arg_index = -1;
while (TRUE) {
gint _tmp21_;
gint _tmp22_;
gint _tmp23_;
ValaDataType* arg = NULL;
ValaList* _tmp24_;
gint _tmp25_;
gpointer _tmp26_;
ValaInterfaceType* _tmp27_;
ValaDataType* _tmp28_;
ValaDataType* _tmp29_;
ValaDataType* _tmp30_;
_tmp21_ = _arg_index;
_arg_index = _tmp21_ + 1;
_tmp22_ = _arg_index;
_tmp23_ = _arg_size;
if (!(_tmp22_ < _tmp23_)) {
break;
}
_tmp24_ = _arg_list;
_tmp25_ = _arg_index;
_tmp26_ = vala_list_get (_tmp24_, _tmp25_);
arg = (ValaDataType*) _tmp26_;
_tmp27_ = _result_;
_tmp28_ = arg;
_tmp29_ = vala_data_type_copy (_tmp28_);
_tmp30_ = _tmp29_;
vala_data_type_add_type_argument ((ValaDataType*) _tmp27_, _tmp30_);
_vala_code_node_unref0 (_tmp30_);
_vala_code_node_unref0 (arg);
}
_vala_iterable_unref0 (_arg_list);
}
result = (ValaDataType*) _result_;
return result;
}
ValaInterface*
vala_interface_type_get_interface_symbol (ValaInterfaceType* self)
{
ValaInterface* result;
ValaInterface* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->_interface_symbol;
result = _tmp0_;
return result;
}
void
vala_interface_type_set_interface_symbol (ValaInterfaceType* self,
ValaInterface* value)
{
g_return_if_fail (self != NULL);
self->priv->_interface_symbol = value;
}
static void
vala_interface_type_class_init (ValaInterfaceTypeClass * klass)
{
vala_interface_type_parent_class = g_type_class_peek_parent (klass);
((ValaCodeNodeClass *) klass)->finalize = vala_interface_type_finalize;
g_type_class_adjust_private_offset (klass, &ValaInterfaceType_private_offset);
((ValaDataTypeClass *) klass)->copy = (ValaDataType* (*) (ValaDataType*)) vala_interface_type_real_copy;
}
static void
vala_interface_type_instance_init (ValaInterfaceType * self)
{
self->priv = vala_interface_type_get_instance_private (self);
}
static void
vala_interface_type_finalize (ValaCodeNode * obj)
{
ValaInterfaceType * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_INTERFACE_TYPE, ValaInterfaceType);
VALA_CODE_NODE_CLASS (vala_interface_type_parent_class)->finalize (obj);
}
/**
* An interface type.
*/
GType
vala_interface_type_get_type (void)
{
static volatile gsize vala_interface_type_type_id__volatile = 0;
if (g_once_init_enter (&vala_interface_type_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (ValaInterfaceTypeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_interface_type_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaInterfaceType), 0, (GInstanceInitFunc) vala_interface_type_instance_init, NULL };
GType vala_interface_type_type_id;
vala_interface_type_type_id = g_type_register_static (VALA_TYPE_REFERENCE_TYPE, "ValaInterfaceType", &g_define_type_info, 0);
ValaInterfaceType_private_offset = g_type_add_instance_private (vala_interface_type_type_id, sizeof (ValaInterfaceTypePrivate));
g_once_init_leave (&vala_interface_type_type_id__volatile, vala_interface_type_type_id);
}
return vala_interface_type_type_id__volatile;
}
|