1 /* GObject introspection: Repository
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_IREPOSITORY_H__
22 #define __G_IREPOSITORY_H__
24 #include <glib-object.h>
29 #define G_TYPE_IREPOSITORY (g_irepository_get_type ())
30 #define G_IREPOSITORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_IREPOSITORY, GIRepository))
32 typedef struct _GIRepository GIRepository
;
33 typedef struct _GIRepositoryClass GIRepositoryClass
;
34 typedef struct _GIRepositoryPrivate GIRepositoryPrivate
;
35 typedef struct _GIBaseInfo GIBaseInfo
;
36 typedef struct _GICallableInfo GICallableInfo
;
37 typedef struct _GIFunctionInfo GIFunctionInfo
;
38 typedef struct _GICallbackInfo GICallbackInfo
;
39 typedef struct _GIRegisteredTypeInfo GIRegisteredTypeInfo
;
40 typedef struct _GIStructInfo GIStructInfo
;
41 typedef struct _GIUnionInfo GIUnionInfo
;
42 typedef struct _GIEnumInfo GIEnumInfo
;
43 typedef struct _GIObjectInfo GIObjectInfo
;
44 typedef struct _GIInterfaceInfo GIInterfaceInfo
;
45 typedef struct _GIConstantInfo GIConstantInfo
;
46 typedef struct _GIValueInfo GIValueInfo
;
47 typedef struct _GISignalInfo GISignalInfo
;
48 typedef struct _GIVFuncInfo GIVFuncInfo
;
49 typedef struct _GIPropertyInfo GIPropertyInfo
;
50 typedef struct _GIFieldInfo GIFieldInfo
;
51 typedef struct _GIArgInfo GIArgInfo
;
52 typedef struct _GITypeInfo GITypeInfo
;
53 typedef struct _GIErrorDomainInfo GIErrorDomainInfo
;
54 typedef struct _GIUnresolvedInfo GIUnresolvedInfo
;
55 typedef struct _GMetadata GMetadata
;
62 GIRepositoryPrivate
*priv
;
65 struct _GIRepositoryClass
73 GType
g_irepository_get_type (void) G_GNUC_CONST
;
74 GIRepository
*g_irepository_get_default (void);
75 const gchar
* g_irepository_register (GIRepository
*repository
,
77 void g_irepository_unregister (GIRepository
*repository
,
78 const gchar
*namespace);
79 const gchar
* g_irepository_register_file (GIRepository
*repository
,
80 const gchar
*filename
,
82 gboolean
g_irepository_is_registered (GIRepository
*repository
,
83 const gchar
*namespace);
84 GIBaseInfo
* g_irepository_find_by_name (GIRepository
*repository
,
85 const gchar
*namespace,
87 gchar
** g_irepository_get_namespaces (GIRepository
*repository
);
88 GIBaseInfo
* g_irepository_find_by_gtype (GIRepository
*repository
,
90 gint
g_irepository_get_n_infos (GIRepository
*repository
,
91 const gchar
*namespace);
92 GIBaseInfo
* g_irepository_get_info (GIRepository
*repository
,
93 const gchar
*namespace,
95 const gchar
* g_irepository_get_shared_library (GIRepository
*repository
,
96 const gchar
*namespace);
99 GMetadata
* g_metadata_new_from_memory (guchar
*memory
,
101 GMetadata
* g_metadata_new_from_const_memory (const guchar
*memory
,
103 GMetadata
* g_metadata_new_from_mapped_file (GMappedFile
*mfile
);
104 void g_metadata_free (GMetadata
*metadata
);
105 void g_metadata_set_module (GMetadata
*metadata
,
107 const gchar
* g_metadata_get_namespace (GMetadata
*metadata
);
111 G_IREPOSITORY_ERROR_METADATA_NOT_FOUND
,
112 G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH
,
113 G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND
116 #define G_IREPOSITORY_ERROR (g_irepository_error_quark ())
118 GQuark
g_irepository_error_quark (void);
121 /* Types of objects registered in the repository */
125 GI_INFO_TYPE_INVALID
,
126 GI_INFO_TYPE_FUNCTION
,
127 GI_INFO_TYPE_CALLBACK
,
133 GI_INFO_TYPE_INTERFACE
,
134 GI_INFO_TYPE_CONSTANT
,
135 GI_INFO_TYPE_ERROR_DOMAIN
,
140 GI_INFO_TYPE_PROPERTY
,
144 GI_INFO_TYPE_UNRESOLVED
150 GIBaseInfo
* g_base_info_ref (GIBaseInfo
*info
);
151 void g_base_info_unref (GIBaseInfo
*info
);
152 GIInfoType
g_base_info_get_type (GIBaseInfo
*info
);
153 const gchar
* g_base_info_get_name (GIBaseInfo
*info
);
154 const gchar
* g_base_info_get_namespace (GIBaseInfo
*info
);
155 gboolean
g_base_info_is_deprecated (GIBaseInfo
*info
);
156 const gchar
* g_base_info_get_annotation (GIBaseInfo
*info
,
158 GIBaseInfo
* g_base_info_get_container (GIBaseInfo
*info
);
159 GMetadata
* g_base_info_get_metadata (GIBaseInfo
*info
);
161 GIBaseInfo
* g_info_new (GIInfoType type
,
162 GIBaseInfo
*container
,
171 GI_FUNCTION_IS_METHOD
= 1 << 0,
172 GI_FUNCTION_IS_CONSTRUCTOR
= 1 << 1,
173 GI_FUNCTION_IS_GETTER
= 1 << 2,
174 GI_FUNCTION_IS_SETTER
= 1 << 3,
175 GI_FUNCTION_WRAPS_VFUNC
= 1 << 4
176 } GIFunctionInfoFlags
;
178 const gchar
* g_function_info_get_symbol (GIFunctionInfo
*info
);
179 GIFunctionInfoFlags
g_function_info_get_flags (GIFunctionInfo
*info
);
180 GIPropertyInfo
* g_function_info_get_property (GIFunctionInfo
*info
);
181 GIVFuncInfo
* g_function_info_get_vfunc (GIFunctionInfo
*info
);
206 #define G_INVOKE_ERROR (g_invoke_error_quark ())
207 GQuark
g_invoke_error_quark (void);
211 G_INVOKE_ERROR_FAILED
,
212 G_INVOKE_ERROR_SYMBOL_NOT_FOUND
,
213 G_INVOKE_ERROR_ARGUMENT_MISMATCH
216 gboolean
g_function_info_invoke (GIFunctionInfo
*info
,
217 const GArgument
*in_args
,
219 const GArgument
*out_args
,
221 GArgument
*return_value
,
229 GI_TRANSFER_CONTAINER
,
230 GI_TRANSFER_EVERYTHING
233 GITypeInfo
* g_callable_info_get_return_type (GICallableInfo
*info
);
234 GITransfer
g_callable_info_get_caller_owns (GICallableInfo
*info
);
235 gboolean
g_callable_info_may_return_null (GICallableInfo
*info
);
236 gint
g_callable_info_get_n_args (GICallableInfo
*info
);
237 GIArgInfo
* g_callable_info_get_arg (GICallableInfo
*info
,
248 GIDirection
g_arg_info_get_direction (GIArgInfo
*info
);
249 gboolean
g_arg_info_is_dipper (GIArgInfo
*info
);
250 gboolean
g_arg_info_is_return_value (GIArgInfo
*info
);
251 gboolean
g_arg_info_is_optional (GIArgInfo
*info
);
252 gboolean
g_arg_info_may_be_null (GIArgInfo
*info
);
253 GITransfer
g_arg_info_get_ownership_transfer (GIArgInfo
*info
);
254 GITypeInfo
* g_arg_info_get_type (GIArgInfo
*info
);
260 GI_TYPE_TAG_VOID
= 0,
261 GI_TYPE_TAG_BOOLEAN
= 1,
262 GI_TYPE_TAG_INT8
= 2,
263 GI_TYPE_TAG_UINT8
= 3,
264 GI_TYPE_TAG_INT16
= 4,
265 GI_TYPE_TAG_UINT16
= 5,
266 GI_TYPE_TAG_INT32
= 6,
267 GI_TYPE_TAG_UINT32
= 7,
268 GI_TYPE_TAG_INT64
= 8,
269 GI_TYPE_TAG_UINT64
= 9,
270 GI_TYPE_TAG_INT
= 10,
271 GI_TYPE_TAG_UINT
= 11,
272 GI_TYPE_TAG_LONG
= 12,
273 GI_TYPE_TAG_ULONG
= 13,
274 GI_TYPE_TAG_SSIZE
= 14,
275 GI_TYPE_TAG_SIZE
= 15,
276 GI_TYPE_TAG_FLOAT
= 16,
277 GI_TYPE_TAG_DOUBLE
= 17,
278 GI_TYPE_TAG_UTF8
= 18,
279 GI_TYPE_TAG_FILENAME
= 19,
280 GI_TYPE_TAG_ARRAY
= 20,
281 GI_TYPE_TAG_INTERFACE
= 21,
282 GI_TYPE_TAG_GLIST
= 22,
283 GI_TYPE_TAG_GSLIST
= 23,
284 GI_TYPE_TAG_GHASH
= 24,
285 GI_TYPE_TAG_ERROR
= 25
288 gboolean
g_type_info_is_pointer (GITypeInfo
*info
);
289 GITypeTag
g_type_info_get_tag (GITypeInfo
*info
);
290 GITypeInfo
* g_type_info_get_param_type (GITypeInfo
*info
,
292 GIBaseInfo
* g_type_info_get_interface (GITypeInfo
*info
);
293 gint
g_type_info_get_array_length (GITypeInfo
*info
);
294 gboolean
g_type_info_is_zero_terminated (GITypeInfo
*info
);
296 gint
g_type_info_get_n_error_domains (GITypeInfo
*info
);
297 GIErrorDomainInfo
*g_type_info_get_error_domain (GITypeInfo
*info
,
300 /* GIErrorDomainInfo */
302 const gchar
* g_error_domain_info_get_quark (GIErrorDomainInfo
*info
);
303 GIInterfaceInfo
* g_error_domain_info_get_codes (GIErrorDomainInfo
*info
);
308 glong
g_value_info_get_value (GIValueInfo
*info
);
315 GI_FIELD_IS_READABLE
= 1 << 0,
316 GI_FIELD_IS_WRITABLE
= 1 << 1
319 GIFieldInfoFlags
g_field_info_get_flags (GIFieldInfo
*info
);
320 gint
g_field_info_get_size (GIFieldInfo
*info
);
321 gint
g_field_info_get_offset (GIFieldInfo
*info
);
322 GITypeInfo
* g_field_info_get_type (GIFieldInfo
*info
);
326 gint
g_union_info_get_n_fields (GIUnionInfo
*info
);
327 GIFieldInfo
* g_union_info_get_field (GIUnionInfo
*info
,
329 gint
g_union_info_get_n_methods (GIUnionInfo
*info
);
330 GIFunctionInfo
* g_union_info_get_method (GIUnionInfo
*info
,
332 gboolean
g_union_info_is_discriminated (GIUnionInfo
*info
);
333 gint
g_union_info_get_discriminator_offset (GIUnionInfo
*info
);
334 GITypeInfo
* g_union_info_get_discriminator_type (GIUnionInfo
*info
);
335 GIConstantInfo
* g_union_info_get_discriminator (GIUnionInfo
*info
,
340 gint
g_struct_info_get_n_fields (GIStructInfo
*info
);
341 GIFieldInfo
* g_struct_info_get_field (GIStructInfo
*info
,
343 gint
g_struct_info_get_n_methods (GIStructInfo
*info
);
344 GIFunctionInfo
* g_struct_info_get_method (GIStructInfo
*info
,
346 GIFunctionInfo
* g_struct_info_find_method (GIStructInfo
*info
,
349 /* GIRegisteredTypeInfo */
351 const gchar
* g_registered_type_info_get_type_name (GIRegisteredTypeInfo
*info
);
352 const gchar
* g_registered_type_info_get_type_init (GIRegisteredTypeInfo
*info
);
357 gint
g_enum_info_get_n_values (GIEnumInfo
*info
);
358 GIValueInfo
* g_enum_info_get_value (GIEnumInfo
*info
,
363 const gchar
* g_object_info_get_type_name (GIObjectInfo
*info
);
364 const gchar
* g_object_info_get_type_init (GIObjectInfo
*info
);
365 GIObjectInfo
* g_object_info_get_parent (GIObjectInfo
*info
);
366 gint
g_object_info_get_n_interfaces (GIObjectInfo
*info
);
367 GIInterfaceInfo
* g_object_info_get_interface (GIObjectInfo
*info
,
369 gint
g_object_info_get_n_fields (GIObjectInfo
*info
);
370 GIFieldInfo
* g_object_info_get_field (GIObjectInfo
*info
,
372 gint
g_object_info_get_n_properties (GIObjectInfo
*info
);
373 GIPropertyInfo
* g_object_info_get_property (GIObjectInfo
*info
,
375 gint
g_object_info_get_n_methods (GIObjectInfo
*info
);
376 GIFunctionInfo
* g_object_info_get_method (GIObjectInfo
*info
,
378 GIFunctionInfo
* g_object_info_find_method (GIObjectInfo
*info
,
380 gint
g_object_info_get_n_signals (GIObjectInfo
*info
);
381 GISignalInfo
* g_object_info_get_signal (GIObjectInfo
*info
,
383 gint
g_object_info_get_n_vfuncs (GIObjectInfo
*info
);
384 GIVFuncInfo
* g_object_info_get_vfunc (GIObjectInfo
*info
,
386 gint
g_object_info_get_n_constants (GIObjectInfo
*info
);
387 GIConstantInfo
* g_object_info_get_constant (GIObjectInfo
*info
,
391 /* GIInterfaceInfo */
393 gint
g_interface_info_get_n_prerequisites (GIInterfaceInfo
*info
);
394 GIBaseInfo
* g_interface_info_get_prerequisite (GIInterfaceInfo
*info
,
396 gint
g_interface_info_get_n_properties (GIInterfaceInfo
*info
);
397 GIPropertyInfo
* g_interface_info_get_property (GIInterfaceInfo
*info
,
399 gint
g_interface_info_get_n_methods (GIInterfaceInfo
*info
);
400 GIFunctionInfo
* g_interface_info_get_method (GIInterfaceInfo
*info
,
402 GIFunctionInfo
* g_interface_info_find_method (GIInterfaceInfo
*info
,
404 gint
g_interface_info_get_n_signals (GIInterfaceInfo
*info
);
405 GISignalInfo
* g_interface_info_get_signal (GIInterfaceInfo
*info
,
407 gint
g_interface_info_get_n_vfuncs (GIInterfaceInfo
*info
);
408 GIVFuncInfo
* g_interface_info_get_vfunc (GIInterfaceInfo
*info
,
410 gint
g_interface_info_get_n_constants (GIInterfaceInfo
*info
);
411 GIConstantInfo
* g_interface_info_get_constant (GIInterfaceInfo
*info
,
417 GParamFlags
g_property_info_get_flags (GIPropertyInfo
*info
);
418 GITypeInfo
* g_property_info_get_type (GIPropertyInfo
*info
);
423 GSignalFlags
g_signal_info_get_flags (GISignalInfo
*info
);
424 GIVFuncInfo
* g_signal_info_get_class_closure (GISignalInfo
*info
);
425 gboolean
g_signal_info_true_stops_emit (GISignalInfo
*info
);
432 GI_VFUNC_MUST_CHAIN_UP
= 1 << 0,
433 GI_VFUNC_MUST_OVERRIDE
= 1 << 1,
434 GI_VFUNC_MUST_NOT_OVERRIDE
= 1 << 2
437 GIVFuncInfoFlags
g_vfunc_info_get_flags (GIVFuncInfo
*info
);
438 gint
g_vfunc_info_get_offset (GIVFuncInfo
*info
);
439 GISignalInfo
* g_vfunc_info_get_signal (GIVFuncInfo
*info
);
444 GITypeInfo
* g_constant_info_get_type (GIConstantInfo
*info
);
445 gint
g_constant_info_get_value (GIConstantInfo
*info
,
451 #endif /* __G_IREPOSITORY_H__ */