1 /* GObject introspection: Parsed GIR
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_IR_NODE_H__
22 #define __G_IR_NODE_H__
26 #include "girmodule.h"
30 typedef struct _GIrTypelibBuild GIrTypelibBuild;
31 typedef struct _GIrNode GIrNode;
32 typedef struct _GIrNodeFunction GIrNodeFunction;
33 typedef struct _GIrNodeParam GIrNodeParam;
34 typedef struct _GIrNodeType GIrNodeType;
35 typedef struct _GIrNodeInterface GIrNodeInterface;
36 typedef struct _GIrNodeSignal GIrNodeSignal;
37 typedef struct _GIrNodeProperty GIrNodeProperty;
38 typedef struct _GIrNodeVFunc GIrNodeVFunc;
39 typedef struct _GIrNodeField GIrNodeField;
40 typedef struct _GIrNodeValue GIrNodeValue;
41 typedef struct _GIrNodeEnum GIrNodeEnum;
42 typedef struct _GIrNodeBoxed GIrNodeBoxed;
43 typedef struct _GIrNodeStruct GIrNodeStruct;
44 typedef struct _GIrNodeConstant GIrNodeConstant;
45 typedef struct _GIrNodeErrorDomain GIrNodeErrorDomain;
46 typedef struct _GIrNodeXRef GIrNodeXRef;
47 typedef struct _GIrNodeUnion GIrNodeUnion;
49 struct _GIrTypelibBuild {
54 GList *offset_ordered_nodes;
61 G_IR_NODE_INVALID = 0,
62 G_IR_NODE_FUNCTION = 1,
63 G_IR_NODE_CALLBACK = 2,
69 G_IR_NODE_INTERFACE = 8,
70 G_IR_NODE_CONSTANT = 9,
71 G_IR_NODE_ERROR_DOMAIN = 10,
75 G_IR_NODE_PROPERTY = 14,
76 G_IR_NODE_SIGNAL = 15,
88 guint32 offset; /* Assigned as we build the typelib */
90 GHashTable *attributes;
100 struct _GIrNodeFunction
105 gboolean is_varargs; /* Not in typelib yet */
110 gboolean is_constructor;
111 gboolean wraps_vfunc;
116 GIrNodeParam *result;
129 gboolean is_ghashtable;
130 gboolean is_interface;
136 gboolean zero_terminated;
142 GIrNodeType *parameter_type1;
143 GIrNodeType *parameter_type2;
160 gboolean shallow_transfer;
169 struct _GIrNodeProperty
179 gboolean construct_only;
184 struct _GIrNodeSignal
192 gboolean run_cleanup;
198 gboolean has_class_closure;
199 gboolean true_stops_emit;
204 GIrNodeParam *result;
211 gboolean is_varargs; /* Not in typelib yet */
212 gboolean must_chain_up;
213 gboolean must_be_implemented;
214 gboolean must_not_be_implemented;
215 gboolean is_class_closure;
220 GIrNodeParam *result;
233 GIrNodeFunction *callback;
238 struct _GIrNodeInterface
249 gchar *glib_type_struct;
252 GList *prerequisites;
269 struct _GIrNodeConstant
308 struct _GIrNodeStruct
314 gboolean is_gtype_struct;
332 GList *discriminators;
340 gint discriminator_offset;
341 GIrNodeType *discriminator_type;
345 struct _GIrNodeErrorDomain
357 GIrNode * g_ir_node_new (GIrNodeTypeId type);
358 void g_ir_node_free (GIrNode *node);
359 guint32 g_ir_node_get_size (GIrNode *node);
360 guint32 g_ir_node_get_full_size (GIrNode *node);
361 guint32 g_ir_node_get_attribute_size (GIrNode *node);
362 void g_ir_node_build_typelib (GIrNode *node,
364 GIrTypelibBuild *build,
367 int g_ir_node_cmp (GIrNode *node,
369 gboolean g_ir_node_can_have_member (GIrNode *node);
370 void g_ir_node_add_member (GIrNode *node,
371 GIrNodeFunction *member);
372 guint32 write_string (const gchar *str,
377 const gchar * g_ir_node_param_direction_string (GIrNodeParam * node);
378 const gchar * g_ir_node_type_to_string (GIrNodeTypeId type);
380 gboolean g_ir_find_node (GIrModule *module,
384 GIrModule **module_out);
386 /* In giroffsets.c */
388 void g_ir_node_compute_offsets (GIrNode *node,
395 #endif /* __G_IR_NODE_H__ */