girwriter: Fix methods returning non-null structs
[vala-lang.git] / gobject-introspection / gidlnode.h
blob66ac7ad38ebd93d9120a721341fa1d423c89c77f
1 /* GObject introspection: Parsed IDL
3 * Copyright (C) 2005 Matthias Clasen
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __G_IDL_NODE_H__
22 #define __G_IDL_NODE_H__
24 #include <glib.h>
26 G_BEGIN_DECLS
28 typedef struct _GIdlNode GIdlNode;
29 typedef struct _GIdlNodeFunction GIdlNodeFunction;
30 typedef struct _GIdlNodeParam GIdlNodeParam;
31 typedef struct _GIdlNodeType GIdlNodeType;
32 typedef struct _GIdlNodeInterface GIdlNodeInterface;
33 typedef struct _GIdlNodeSignal GIdlNodeSignal;
34 typedef struct _GIdlNodeProperty GIdlNodeProperty;
35 typedef struct _GIdlNodeVFunc GIdlNodeVFunc;
36 typedef struct _GIdlNodeField GIdlNodeField;
37 typedef struct _GIdlNodeValue GIdlNodeValue;
38 typedef struct _GIdlNodeEnum GIdlNodeEnum;
39 typedef struct _GIdlNodeBoxed GIdlNodeBoxed;
40 typedef struct _GIdlNodeStruct GIdlNodeStruct;
41 typedef struct _GIdlNodeConstant GIdlNodeConstant;
42 typedef struct _GIdlNodeErrorDomain GIdlNodeErrorDomain;
43 typedef struct _GIdlNodeXRef GIdlNodeXRef;
44 typedef struct _GIdlNodeUnion GIdlNodeUnion;
46 typedef enum
48 G_IDL_NODE_INVALID,
49 G_IDL_NODE_FUNCTION,
50 G_IDL_NODE_CALLBACK,
51 G_IDL_NODE_STRUCT,
52 G_IDL_NODE_BOXED,
53 G_IDL_NODE_ENUM,
54 G_IDL_NODE_FLAGS,
55 G_IDL_NODE_OBJECT,
56 G_IDL_NODE_INTERFACE,
57 G_IDL_NODE_CONSTANT,
58 G_IDL_NODE_ERROR_DOMAIN,
59 G_IDL_NODE_UNION,
60 G_IDL_NODE_PARAM,
61 G_IDL_NODE_TYPE,
62 G_IDL_NODE_PROPERTY,
63 G_IDL_NODE_SIGNAL,
64 G_IDL_NODE_VALUE,
65 G_IDL_NODE_VFUNC,
66 G_IDL_NODE_FIELD,
67 G_IDL_NODE_XREF
68 } GIdlNodeTypeId;
70 struct _GIdlNode
72 GIdlNodeTypeId type;
73 gchar *name;
76 struct _GIdlNodeXRef
78 GIdlNode node;
80 gchar *namespace;
83 struct _GIdlNodeFunction
85 GIdlNode node;
87 gboolean deprecated;
89 gboolean is_method;
90 gboolean is_setter;
91 gboolean is_getter;
92 gboolean is_constructor;
93 gboolean wraps_vfunc;
95 gchar *symbol;
97 GIdlNodeParam *result;
98 GList *parameters;
101 struct _GIdlNodeType
103 GIdlNode node;
105 gboolean is_pointer;
106 gboolean is_basic;
107 gboolean is_array;
108 gboolean is_glist;
109 gboolean is_gslist;
110 gboolean is_ghashtable;
111 gboolean is_interface;
112 gboolean is_error;
113 gint tag;
115 gchar *unparsed;
117 gboolean zero_terminated;
118 gboolean has_length;
119 gint length;
121 GIdlNodeType *parameter_type1;
122 GIdlNodeType *parameter_type2;
124 gchar *interface;
125 gchar **errors;
128 struct _GIdlNodeParam
130 GIdlNode node;
132 gboolean in;
133 gboolean out;
134 gboolean dipper;
135 gboolean optional;
136 gboolean retval;
137 gboolean null_ok;
138 gboolean transfer;
139 gboolean shallow_transfer;
141 GIdlNodeType *type;
144 struct _GIdlNodeProperty
146 GIdlNode node;
148 gboolean deprecated;
150 gchar *name;
151 gboolean readable;
152 gboolean writable;
153 gboolean construct;
154 gboolean construct_only;
156 GIdlNodeType *type;
159 struct _GIdlNodeSignal
161 GIdlNode node;
163 gboolean deprecated;
165 gboolean run_first;
166 gboolean run_last;
167 gboolean run_cleanup;
168 gboolean no_recurse;
169 gboolean detailed;
170 gboolean action;
171 gboolean no_hooks;
173 gboolean has_class_closure;
174 gboolean true_stops_emit;
176 gint class_closure;
178 GList *parameters;
179 GIdlNodeParam *result;
182 struct _GIdlNodeVFunc
184 GIdlNode node;
186 gboolean must_chain_up;
187 gboolean must_be_implemented;
188 gboolean must_not_be_implemented;
189 gboolean is_class_closure;
191 GList *parameters;
192 GIdlNodeParam *result;
194 gint offset;
197 struct _GIdlNodeField
199 GIdlNode node;
201 gboolean readable;
202 gboolean writable;
203 gint bits;
204 gint offset;
206 GIdlNodeType *type;
209 struct _GIdlNodeInterface
211 GIdlNode node;
213 gboolean deprecated;
215 gchar *gtype_name;
216 gchar *gtype_init;
218 gchar *parent;
220 GList *interfaces;
221 GList *prerequisites;
223 GList *members;
226 struct _GIdlNodeValue
228 GIdlNode node;
230 gboolean deprecated;
232 guint32 value;
235 struct _GIdlNodeConstant
237 GIdlNode node;
239 gboolean deprecated;
241 GIdlNodeType *type;
243 gchar *value;
246 struct _GIdlNodeEnum
248 GIdlNode node;
250 gboolean deprecated;
252 gchar *gtype_name;
253 gchar *gtype_init;
255 GList *values;
258 struct _GIdlNodeBoxed
260 GIdlNode node;
262 gboolean deprecated;
264 gchar *gtype_name;
265 gchar *gtype_init;
267 GList *members;
270 struct _GIdlNodeStruct
272 GIdlNode node;
274 gboolean deprecated;
276 GList *members;
279 struct _GIdlNodeUnion
281 GIdlNode node;
283 gboolean deprecated;
285 GList *members;
286 GList *discriminators;
288 gchar *gtype_name;
289 gchar *gtype_init;
291 gint discriminator_offset;
292 GIdlNodeType *discriminator_type;
296 struct _GIdlNodeErrorDomain
298 GIdlNode node;
300 gboolean deprecated;
302 gchar *name;
303 gchar *getquark;
304 gchar *codes;
308 GIdlNode *g_idl_node_new (GIdlNodeTypeId type);
309 void g_idl_node_free (GIdlNode *node);
310 guint32 g_idl_node_get_size (GIdlNode *node);
311 guint32 g_idl_node_get_full_size (GIdlNode *node);
312 void g_idl_node_build_metadata (GIdlNode *node,
313 GIdlModule *module,
314 GList *modules,
315 GHashTable *strings,
316 GHashTable *types,
317 guchar *data,
318 guint32 *offset,
319 guint32 *offset2);
320 int g_idl_node_cmp (GIdlNode *node,
321 GIdlNode *other);
322 gboolean g_idl_node_can_have_member (GIdlNode *node);
323 void g_idl_node_add_member (GIdlNode *node,
324 GIdlNodeFunction *member);
325 guint32 write_string (const gchar *str,
326 GHashTable *strings,
327 guchar *data,
328 guint32 *offset);
330 void init_stats (void);
331 void dump_stats (void);
333 G_END_DECLS
335 #endif /* __G_IDL_NODE_H__ */