2008-03-10 18:47:20 +01:00
|
|
|
/* GObject introspection: Repository implementation
|
2008-02-08 16:31:03 +01:00
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Matthias Clasen
|
2009-02-20 03:48:51 +01:00
|
|
|
* Copyright (C) 2008,2009 Red Hat, Inc.
|
2008-02-08 16:31:03 +01:00
|
|
|
*
|
|
|
|
* 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 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., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
Bug 556543 – reduce compiler warnings
2008-10-16 Tommi Komulainen <tommi.komulainen@iki.fi>
Bug 556543 – reduce compiler warnings
* girepository/ginfo.c:
* girepository/girepository.c (register_internal,
count_interfaces, find_interface, find_namespace_version,
parse_version, g_irepository_require):
* girepository/girmodule.c (g_ir_module_build_typelib):
* girepository/girnode.c (init_stats, dump_stats,
_g_irnode_init_stats, _g_irnode_dump_stats,
g_ir_node_can_have_member):
* girepository/girparser.c (firstpass_end_element_handler,
locate_gir, parse_basic, parse_type_internal, resolve_aliases,
start_alias, start_type, end_type_top, parse_include, cleanup,
post_filter):
* girepository/gtypelib.c (validate_function_blob, validate_enum_blob):
* giscanner/giscannermodule.c (directive_get_options,
type_get_child_list):
* giscanner/scannerlexer.l (parse_gtkdoc):
* giscanner/scannerparser.y (ctype_free):
* giscanner/sourcescanner.c:
* giscanner/sourcescanner.h (gi_source_scanner_parse_macros):
* tests/types/gitesttypes.c:
* tools/compiler.c (main):
* tools/generate.c (write_repository): Remove unused variables
and code, add missing includes, declarations and case
statements.
svn path=/trunk/; revision=730
2008-10-16 19:07:05 +02:00
|
|
|
#include <string.h>
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
2010-05-31 22:44:46 +02:00
|
|
|
#include "gitypelib-internal.h"
|
2010-05-31 22:41:45 +02:00
|
|
|
#include "girepository-private.h"
|
2009-11-20 10:38:36 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
/* GIArgInfo function */
|
2010-05-21 23:30:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:giarginfo
|
|
|
|
* @Short_description: Struct representing an argument
|
|
|
|
* @Title: GIArgInfo
|
|
|
|
*
|
|
|
|
* GIArgInfo represents an argument. An argument is always
|
|
|
|
* part of a #GICallableInfo.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_arg_info_get_direction:
|
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
|
|
|
* Obtain the direction of the argument. Check #GIDirection for possible
|
|
|
|
* direction values.
|
|
|
|
*
|
|
|
|
* Returns: the direction
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
GIDirection
|
|
|
|
g_arg_info_get_direction (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, -1);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), -1);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
if (blob->in && blob->out)
|
|
|
|
return GI_DIRECTION_INOUT;
|
|
|
|
else if (blob->out)
|
|
|
|
return GI_DIRECTION_OUT;
|
|
|
|
else
|
|
|
|
return GI_DIRECTION_IN;
|
|
|
|
}
|
|
|
|
|
2010-05-21 23:30:58 +02:00
|
|
|
/**
|
|
|
|
* g_arg_info_is_return_value:
|
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
|
|
|
* Obtain if the argument is a return value. It can either be a
|
|
|
|
* parameter or a return value.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if it is a return value
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
gboolean
|
|
|
|
g_arg_info_is_return_value (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), FALSE);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->return_value;
|
|
|
|
}
|
|
|
|
|
2010-05-21 23:30:58 +02:00
|
|
|
/**
|
2009-12-16 17:47:19 +01:00
|
|
|
* g_arg_info_is_caller_allocates:
|
2010-05-21 23:30:58 +02:00
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
|
|
|
* Obtain if the argument is a pointer to a struct or object that will
|
2009-12-16 17:47:19 +01:00
|
|
|
* receive an output of a function. The default assumption for
|
|
|
|
* %GI_DIRECTION_OUT arguments which have allocation is that the
|
|
|
|
* callee allocates; if this is %TRUE, then the caller must allocate.
|
2010-05-21 23:30:58 +02:00
|
|
|
*
|
2009-12-16 17:47:19 +01:00
|
|
|
* Returns: %TRUE if caller is required to have allocated the argument
|
2010-05-21 23:30:58 +02:00
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
gboolean
|
2009-12-16 17:47:19 +01:00
|
|
|
g_arg_info_is_caller_allocates (GIArgInfo *info)
|
2008-02-08 16:31:03 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), FALSE);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-16 17:47:19 +01:00
|
|
|
return blob->caller_allocates;
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2010-05-21 23:30:58 +02:00
|
|
|
/**
|
|
|
|
* g_arg_info_is_optional:
|
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
|
|
|
* Obtain if the argument is optional.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if it is an optional argument
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
gboolean
|
|
|
|
g_arg_info_is_optional (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), FALSE);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->optional;
|
|
|
|
}
|
|
|
|
|
2010-05-21 23:30:58 +02:00
|
|
|
/**
|
|
|
|
* g_arg_info_may_be_null:
|
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
|
|
|
* Obtain if the argument accepts %NULL.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if it accepts %NULL
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
gboolean
|
|
|
|
g_arg_info_may_be_null (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), FALSE);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-10-22 16:02:02 +02:00
|
|
|
return blob->allow_none;
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2010-05-21 23:30:58 +02:00
|
|
|
/**
|
|
|
|
* g_arg_info_get_ownership_transfer:
|
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
|
|
|
* Obtain the ownership transfer for this argument.
|
|
|
|
* #GITransfer contains a list of possible values.
|
|
|
|
*
|
|
|
|
* Returns: the transfer
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
GITransfer
|
|
|
|
g_arg_info_get_ownership_transfer (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, -1);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), -1);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
if (blob->transfer_ownership)
|
|
|
|
return GI_TRANSFER_EVERYTHING;
|
|
|
|
else if (blob->transfer_container_ownership)
|
|
|
|
return GI_TRANSFER_CONTAINER;
|
|
|
|
else
|
|
|
|
return GI_TRANSFER_NOTHING;
|
|
|
|
}
|
|
|
|
|
2010-05-21 23:30:58 +02:00
|
|
|
/**
|
|
|
|
* g_arg_info_get_scope:
|
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
|
|
|
* Obtain the scope type for this argument. The scope type explains
|
|
|
|
* how a callback is going to be invoked, most importantly when
|
|
|
|
* the resources required to invoke it can be freed.
|
|
|
|
* #GIScopeType contains a list of possible values.
|
|
|
|
*
|
|
|
|
* Returns: the scope type
|
|
|
|
*/
|
Bug 556489 – callback annotations
2008-01-03 Andreas Rottmann <a.rottmann@gmx.at>
Bug 556489 – callback annotations
* giscanner/transformer.py
* tools/generate.c (write_callable_info): Write out the new scope,
closure and destroy attributes.
* giscanner/transformer.py (Transformer._type_is_callback): New
method, checking if a given type is a callback.
(Transformer._augment_callback_params): New method; adds
information (closure, destroy) to callback parameters.
(Transformer._handle_closure, Transformer._handle_destroy): New methods,
auxiliary to _augment_callback_params.
(Transformer._create_function): Call _augment_callback_params().
(Transformer._create_parameter): Handle scope option.
(Transformer._create_typedef_callback): New method, creates a
callback, and registers it in the typedef namespace
(Transformer._create_typedef): Use _create_typedef_callback()
instead of the plain _create_callback().
* giscanner/ast.py (Parameter): Added callback-related fields.
* giscanner/girwriter.py: Write out new Parameter fields.
* girepository/girnode.h (GIrNodeParam): Added fields scope,
closure and destroy.
* girepository/gtypelib.h (ArgBlob): Ditto.
* girepository/girparser.c (start_parameter): Handle new fields.
* girepository/girmodule.c (g_ir_module_build_typelib): Adjust
arg_blob_size, bump major version due to this change.
* girepository/girnode.c (g_ir_node_get_full_size_internal)
(g_ir_node_build_typelib)
* girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size
adjustments.
(g_ir_node_build_typelib): Fill in new ArgBlob flags from param.
* girepository/girepository.h (GIScope): New enumeration, listing
the different possible scopes for callbacks.
* girepository/ginfo.c (g_arg_info_get_scope)
(g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for
callback-related argument indices (callback scope, closure for a
callback, destroy notification for a callback).
* tests/scanner/: Added testcases for new features.
svn path=/trunk/; revision=998
2009-01-03 14:44:42 +01:00
|
|
|
GIScopeType
|
|
|
|
g_arg_info_get_scope (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, -1);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), -1);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
Bug 556489 – callback annotations
2008-01-03 Andreas Rottmann <a.rottmann@gmx.at>
Bug 556489 – callback annotations
* giscanner/transformer.py
* tools/generate.c (write_callable_info): Write out the new scope,
closure and destroy attributes.
* giscanner/transformer.py (Transformer._type_is_callback): New
method, checking if a given type is a callback.
(Transformer._augment_callback_params): New method; adds
information (closure, destroy) to callback parameters.
(Transformer._handle_closure, Transformer._handle_destroy): New methods,
auxiliary to _augment_callback_params.
(Transformer._create_function): Call _augment_callback_params().
(Transformer._create_parameter): Handle scope option.
(Transformer._create_typedef_callback): New method, creates a
callback, and registers it in the typedef namespace
(Transformer._create_typedef): Use _create_typedef_callback()
instead of the plain _create_callback().
* giscanner/ast.py (Parameter): Added callback-related fields.
* giscanner/girwriter.py: Write out new Parameter fields.
* girepository/girnode.h (GIrNodeParam): Added fields scope,
closure and destroy.
* girepository/gtypelib.h (ArgBlob): Ditto.
* girepository/girparser.c (start_parameter): Handle new fields.
* girepository/girmodule.c (g_ir_module_build_typelib): Adjust
arg_blob_size, bump major version due to this change.
* girepository/girnode.c (g_ir_node_get_full_size_internal)
(g_ir_node_build_typelib)
* girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size
adjustments.
(g_ir_node_build_typelib): Fill in new ArgBlob flags from param.
* girepository/girepository.h (GIScope): New enumeration, listing
the different possible scopes for callbacks.
* girepository/ginfo.c (g_arg_info_get_scope)
(g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for
callback-related argument indices (callback scope, closure for a
callback, destroy notification for a callback).
* tests/scanner/: Added testcases for new features.
svn path=/trunk/; revision=998
2009-01-03 14:44:42 +01:00
|
|
|
|
|
|
|
return blob->scope;
|
|
|
|
}
|
|
|
|
|
2010-05-21 23:30:58 +02:00
|
|
|
/**
|
|
|
|
* g_arg_info_get_closure:
|
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
2010-05-28 18:47:48 +02:00
|
|
|
* Obtain the index of the user data argument. This is only valid
|
2010-05-21 23:30:58 +02:00
|
|
|
* for arguments which are callbacks.
|
|
|
|
*
|
|
|
|
* Returns: index of the user data argument or -1 if there is none
|
|
|
|
*/
|
Bug 556489 – callback annotations
2008-01-03 Andreas Rottmann <a.rottmann@gmx.at>
Bug 556489 – callback annotations
* giscanner/transformer.py
* tools/generate.c (write_callable_info): Write out the new scope,
closure and destroy attributes.
* giscanner/transformer.py (Transformer._type_is_callback): New
method, checking if a given type is a callback.
(Transformer._augment_callback_params): New method; adds
information (closure, destroy) to callback parameters.
(Transformer._handle_closure, Transformer._handle_destroy): New methods,
auxiliary to _augment_callback_params.
(Transformer._create_function): Call _augment_callback_params().
(Transformer._create_parameter): Handle scope option.
(Transformer._create_typedef_callback): New method, creates a
callback, and registers it in the typedef namespace
(Transformer._create_typedef): Use _create_typedef_callback()
instead of the plain _create_callback().
* giscanner/ast.py (Parameter): Added callback-related fields.
* giscanner/girwriter.py: Write out new Parameter fields.
* girepository/girnode.h (GIrNodeParam): Added fields scope,
closure and destroy.
* girepository/gtypelib.h (ArgBlob): Ditto.
* girepository/girparser.c (start_parameter): Handle new fields.
* girepository/girmodule.c (g_ir_module_build_typelib): Adjust
arg_blob_size, bump major version due to this change.
* girepository/girnode.c (g_ir_node_get_full_size_internal)
(g_ir_node_build_typelib)
* girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size
adjustments.
(g_ir_node_build_typelib): Fill in new ArgBlob flags from param.
* girepository/girepository.h (GIScope): New enumeration, listing
the different possible scopes for callbacks.
* girepository/ginfo.c (g_arg_info_get_scope)
(g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for
callback-related argument indices (callback scope, closure for a
callback, destroy notification for a callback).
* tests/scanner/: Added testcases for new features.
svn path=/trunk/; revision=998
2009-01-03 14:44:42 +01:00
|
|
|
gint
|
|
|
|
g_arg_info_get_closure (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, -1);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), -1);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
Bug 556489 – callback annotations
2008-01-03 Andreas Rottmann <a.rottmann@gmx.at>
Bug 556489 – callback annotations
* giscanner/transformer.py
* tools/generate.c (write_callable_info): Write out the new scope,
closure and destroy attributes.
* giscanner/transformer.py (Transformer._type_is_callback): New
method, checking if a given type is a callback.
(Transformer._augment_callback_params): New method; adds
information (closure, destroy) to callback parameters.
(Transformer._handle_closure, Transformer._handle_destroy): New methods,
auxiliary to _augment_callback_params.
(Transformer._create_function): Call _augment_callback_params().
(Transformer._create_parameter): Handle scope option.
(Transformer._create_typedef_callback): New method, creates a
callback, and registers it in the typedef namespace
(Transformer._create_typedef): Use _create_typedef_callback()
instead of the plain _create_callback().
* giscanner/ast.py (Parameter): Added callback-related fields.
* giscanner/girwriter.py: Write out new Parameter fields.
* girepository/girnode.h (GIrNodeParam): Added fields scope,
closure and destroy.
* girepository/gtypelib.h (ArgBlob): Ditto.
* girepository/girparser.c (start_parameter): Handle new fields.
* girepository/girmodule.c (g_ir_module_build_typelib): Adjust
arg_blob_size, bump major version due to this change.
* girepository/girnode.c (g_ir_node_get_full_size_internal)
(g_ir_node_build_typelib)
* girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size
adjustments.
(g_ir_node_build_typelib): Fill in new ArgBlob flags from param.
* girepository/girepository.h (GIScope): New enumeration, listing
the different possible scopes for callbacks.
* girepository/ginfo.c (g_arg_info_get_scope)
(g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for
callback-related argument indices (callback scope, closure for a
callback, destroy notification for a callback).
* tests/scanner/: Added testcases for new features.
svn path=/trunk/; revision=998
2009-01-03 14:44:42 +01:00
|
|
|
|
|
|
|
return blob->closure;
|
|
|
|
}
|
|
|
|
|
2010-05-21 23:30:58 +02:00
|
|
|
/**
|
|
|
|
* g_arg_info_get_destroy:
|
|
|
|
* @info: a #GIArgInfo
|
|
|
|
*
|
|
|
|
* Obtains the index of the #GDestroyNotify argument. This is only valid
|
|
|
|
* for arguments which are callbacks.
|
|
|
|
*
|
|
|
|
* Returns: index of the #GDestroyNotify argument or -1 if there is none
|
|
|
|
*/
|
Bug 556489 – callback annotations
2008-01-03 Andreas Rottmann <a.rottmann@gmx.at>
Bug 556489 – callback annotations
* giscanner/transformer.py
* tools/generate.c (write_callable_info): Write out the new scope,
closure and destroy attributes.
* giscanner/transformer.py (Transformer._type_is_callback): New
method, checking if a given type is a callback.
(Transformer._augment_callback_params): New method; adds
information (closure, destroy) to callback parameters.
(Transformer._handle_closure, Transformer._handle_destroy): New methods,
auxiliary to _augment_callback_params.
(Transformer._create_function): Call _augment_callback_params().
(Transformer._create_parameter): Handle scope option.
(Transformer._create_typedef_callback): New method, creates a
callback, and registers it in the typedef namespace
(Transformer._create_typedef): Use _create_typedef_callback()
instead of the plain _create_callback().
* giscanner/ast.py (Parameter): Added callback-related fields.
* giscanner/girwriter.py: Write out new Parameter fields.
* girepository/girnode.h (GIrNodeParam): Added fields scope,
closure and destroy.
* girepository/gtypelib.h (ArgBlob): Ditto.
* girepository/girparser.c (start_parameter): Handle new fields.
* girepository/girmodule.c (g_ir_module_build_typelib): Adjust
arg_blob_size, bump major version due to this change.
* girepository/girnode.c (g_ir_node_get_full_size_internal)
(g_ir_node_build_typelib)
* girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size
adjustments.
(g_ir_node_build_typelib): Fill in new ArgBlob flags from param.
* girepository/girepository.h (GIScope): New enumeration, listing
the different possible scopes for callbacks.
* girepository/ginfo.c (g_arg_info_get_scope)
(g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for
callback-related argument indices (callback scope, closure for a
callback, destroy notification for a callback).
* tests/scanner/: Added testcases for new features.
svn path=/trunk/; revision=998
2009-01-03 14:44:42 +01:00
|
|
|
gint
|
|
|
|
g_arg_info_get_destroy (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 04:24:42 +02:00
|
|
|
ArgBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, -1);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), -1);
|
|
|
|
|
|
|
|
blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
|
Bug 556489 – callback annotations
2008-01-03 Andreas Rottmann <a.rottmann@gmx.at>
Bug 556489 – callback annotations
* giscanner/transformer.py
* tools/generate.c (write_callable_info): Write out the new scope,
closure and destroy attributes.
* giscanner/transformer.py (Transformer._type_is_callback): New
method, checking if a given type is a callback.
(Transformer._augment_callback_params): New method; adds
information (closure, destroy) to callback parameters.
(Transformer._handle_closure, Transformer._handle_destroy): New methods,
auxiliary to _augment_callback_params.
(Transformer._create_function): Call _augment_callback_params().
(Transformer._create_parameter): Handle scope option.
(Transformer._create_typedef_callback): New method, creates a
callback, and registers it in the typedef namespace
(Transformer._create_typedef): Use _create_typedef_callback()
instead of the plain _create_callback().
* giscanner/ast.py (Parameter): Added callback-related fields.
* giscanner/girwriter.py: Write out new Parameter fields.
* girepository/girnode.h (GIrNodeParam): Added fields scope,
closure and destroy.
* girepository/gtypelib.h (ArgBlob): Ditto.
* girepository/girparser.c (start_parameter): Handle new fields.
* girepository/girmodule.c (g_ir_module_build_typelib): Adjust
arg_blob_size, bump major version due to this change.
* girepository/girnode.c (g_ir_node_get_full_size_internal)
(g_ir_node_build_typelib)
* girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size
adjustments.
(g_ir_node_build_typelib): Fill in new ArgBlob flags from param.
* girepository/girepository.h (GIScope): New enumeration, listing
the different possible scopes for callbacks.
* girepository/ginfo.c (g_arg_info_get_scope)
(g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for
callback-related argument indices (callback scope, closure for a
callback, destroy notification for a callback).
* tests/scanner/: Added testcases for new features.
svn path=/trunk/; revision=998
2009-01-03 14:44:42 +01:00
|
|
|
|
|
|
|
return blob->destroy;
|
|
|
|
}
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
/**
|
|
|
|
* g_arg_info_get_type:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GIArgInfo
|
2009-12-08 00:35:06 +01:00
|
|
|
*
|
2010-05-21 23:30:58 +02:00
|
|
|
* Obtain the type information for @info.
|
2010-05-20 01:57:19 +02:00
|
|
|
*
|
|
|
|
* Returns: (transfer full): the #GIArgInfo, free it with
|
|
|
|
* g_base_info_unref() when done.
|
2009-12-08 00:35:06 +01:00
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
GITypeInfo *
|
|
|
|
g_arg_info_get_type (GIArgInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2010-05-28 04:24:42 +02:00
|
|
|
g_return_val_if_fail (info != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GI_IS_ARG_INFO (info), NULL);
|
|
|
|
|
2010-06-05 17:11:58 +02:00
|
|
|
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type));
|
2009-12-08 00:35:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_arg_info_load_type:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GIArgInfo
|
2009-12-08 00:35:06 +01:00
|
|
|
* @type: (out caller-allocates): Initialized with information about type of @info
|
|
|
|
*
|
2010-05-28 18:47:48 +02:00
|
|
|
* Obtain information about a the type of given argument @info; this
|
2009-12-08 00:35:06 +01:00
|
|
|
* function is a variant of g_arg_info_get_type() designed for stack
|
|
|
|
* allocation.
|
|
|
|
*
|
|
|
|
* The initialized @type must not be referenced after @info is deallocated.
|
|
|
|
*/
|
|
|
|
void
|
2010-05-31 02:55:45 +02:00
|
|
|
g_arg_info_load_type (GIArgInfo *info,
|
2009-12-08 00:35:06 +01:00
|
|
|
GITypeInfo *type)
|
|
|
|
{
|
|
|
|
GIRealInfo *rinfo = (GIRealInfo*) info;
|
2010-05-28 04:24:42 +02:00
|
|
|
|
|
|
|
g_return_if_fail (info != NULL);
|
|
|
|
g_return_if_fail (GI_IS_ARG_INFO (info));
|
|
|
|
|
2010-06-05 17:11:58 +02:00
|
|
|
_g_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type));
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* GITypeInfo functions */
|
2010-05-28 18:47:48 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gitypeinfo
|
|
|
|
* @Short_description: Struct representing a type
|
|
|
|
* @Title: GITypeInfo
|
|
|
|
*
|
|
|
|
* GITypeInfo represents a type. You can retrieve a type info from
|
|
|
|
* an argument (see #GIArgInfo), a functions return value (see #GIFunctionInfo),
|
|
|
|
* a field (see #GIFieldInfo), a property (see #GIPropertyInfo), a constant
|
|
|
|
* (see #GIConstantInfo) or for a union discriminator (see #GIUnionInfo).
|
|
|
|
*
|
|
|
|
* A type can either be a of a basic type which is a standard C primitive
|
|
|
|
* type or an interface type. For interface types you need to call
|
|
|
|
* g_type_info_get_interface() to get a reference to the base info for that
|
|
|
|
* interface.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_type_info_is_pointer:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
*
|
|
|
|
* Obtain if the type is passed as a reference.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if it is a pointer
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
gboolean
|
|
|
|
g_type_info_is_pointer (GITypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), FALSE);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-06-24 23:52:05 +02:00
|
|
|
if (type->flags.reserved == 0 && type->flags.reserved2 == 0)
|
|
|
|
return type->flags.pointer;
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
else
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
InterfaceTypeBlob *iface = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
return iface->pointer;
|
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
/**
|
|
|
|
* g_type_info_get_tag:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
*
|
|
|
|
* Obtain the type tag for the type. See #GITypeTag for a list
|
|
|
|
* of type tags.
|
|
|
|
*
|
|
|
|
* Returns: the type tag
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
GITypeTag
|
|
|
|
g_type_info_get_tag (GITypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, GI_TYPE_TAG_BOOLEAN);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), GI_TYPE_TAG_BOOLEAN);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
if (rinfo->type_is_embedded)
|
2009-11-09 19:17:23 +01:00
|
|
|
return GI_TYPE_TAG_INTERFACE;
|
|
|
|
else if (type->flags.reserved == 0 && type->flags.reserved2 == 0)
|
2009-06-24 23:52:05 +02:00
|
|
|
return type->flags.tag;
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
else
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
InterfaceTypeBlob *iface = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
return iface->tag;
|
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
/**
|
|
|
|
* g_type_info_get_param_type:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
* @n: index of the parameter
|
|
|
|
*
|
|
|
|
* Obtain the parameter type @n.
|
|
|
|
*
|
|
|
|
* Returns: the param type info
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
GITypeInfo *
|
|
|
|
g_type_info_get_param_type (GITypeInfo *info,
|
2010-05-31 02:55:45 +02:00
|
|
|
gint n)
|
2008-02-08 16:31:03 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), NULL);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-06-24 23:52:05 +02:00
|
|
|
if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0))
|
2008-03-10 18:46:58 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
ParamTypeBlob *param = (ParamTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-03-10 18:46:58 +01:00
|
|
|
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
switch (param->tag)
|
2009-12-08 00:35:06 +01:00
|
|
|
{
|
2010-03-24 19:00:06 +01:00
|
|
|
case GI_TYPE_TAG_ARRAY:
|
2009-12-08 00:35:06 +01:00
|
|
|
case GI_TYPE_TAG_GLIST:
|
|
|
|
case GI_TYPE_TAG_GSLIST:
|
|
|
|
case GI_TYPE_TAG_GHASH:
|
2010-06-05 17:11:58 +02:00
|
|
|
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib,
|
2009-12-08 00:35:06 +01:00
|
|
|
rinfo->offset + sizeof (ParamTypeBlob)
|
|
|
|
+ sizeof (SimpleTypeBlob) * n);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
}
|
2009-12-08 00:35:06 +01:00
|
|
|
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
return NULL;
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
/**
|
|
|
|
* g_type_info_get_interface:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GITypeInfo
|
2009-12-08 00:35:06 +01:00
|
|
|
*
|
|
|
|
* For types which have #GI_TYPE_TAG_INTERFACE such as GObjects and boxed values,
|
|
|
|
* this function returns full information about the referenced type. You can then
|
|
|
|
* inspect the type of the returned #GIBaseInfo to further query whether it is
|
|
|
|
* a concrete GObject, a GInterface, a structure, etc. using g_base_info_get_type().
|
2010-05-18 18:37:51 +02:00
|
|
|
*
|
2010-05-20 01:57:19 +02:00
|
|
|
* Returns: (transfer full): the #GIBaseInfo, or %NULL. Free it with
|
|
|
|
* g_base_info_unref() when done.
|
2009-12-08 00:35:06 +01:00
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
GIBaseInfo *
|
|
|
|
g_type_info_get_interface (GITypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2009-11-09 19:17:23 +01:00
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
g_return_val_if_fail (info != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), NULL);
|
|
|
|
|
2010-01-07 22:12:15 +01:00
|
|
|
/* For embedded types, the given offset is a pointer to the actual blob,
|
|
|
|
* after the end of the field. In that case we know it's a "subclass" of
|
|
|
|
* CommonBlob, so use that to determine the info type.
|
|
|
|
*/
|
2009-12-08 00:35:06 +01:00
|
|
|
if (rinfo->type_is_embedded)
|
2010-01-07 22:12:15 +01:00
|
|
|
{
|
|
|
|
CommonBlob *common = (CommonBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
GIInfoType info_type;
|
2009-11-09 19:17:23 +01:00
|
|
|
|
2010-01-07 22:12:15 +01:00
|
|
|
switch (common->blob_type)
|
|
|
|
{
|
|
|
|
case BLOB_TYPE_CALLBACK:
|
|
|
|
info_type = GI_INFO_TYPE_CALLBACK;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return (GIBaseInfo *) g_info_new (info_type, (GIBaseInfo*)info, rinfo->typelib,
|
|
|
|
rinfo->offset);
|
|
|
|
}
|
|
|
|
else
|
2008-02-08 16:31:03 +01:00
|
|
|
{
|
2010-01-07 22:12:15 +01:00
|
|
|
SimpleTypeBlob *type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0))
|
|
|
|
{
|
|
|
|
InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
|
|
|
|
if (blob->tag == GI_TYPE_TAG_INTERFACE)
|
2010-05-31 22:41:45 +02:00
|
|
|
return _g_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface);
|
2010-01-07 22:12:15 +01:00
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
/**
|
|
|
|
* g_type_info_get_array_length:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
*
|
|
|
|
* Obtain the array length of the type. The type tag must be a
|
|
|
|
* #GI_TYPE_TAG_ARRAY or -1 will returned.
|
|
|
|
*
|
|
|
|
* Returns: the array length, or -1 if the type is not an array
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
gint
|
|
|
|
g_type_info_get_array_length (GITypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, -1);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), -1);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-06-24 23:52:05 +02:00
|
|
|
if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0))
|
2008-03-10 18:46:58 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
ArrayTypeBlob *blob = (ArrayTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
|
|
|
if (blob->tag == GI_TYPE_TAG_ARRAY)
|
|
|
|
{
|
|
|
|
if (blob->has_length)
|
2009-06-24 23:52:05 +02:00
|
|
|
return blob->dimensions.length;
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
/**
|
|
|
|
* g_type_info_get_array_fixed_size:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
*
|
|
|
|
* Obtain the fixed array size of the type. The type tag must be a
|
|
|
|
* #GI_TYPE_TAG_ARRAY or -1 will returned.
|
|
|
|
*
|
|
|
|
* Returns: the size or -1 if it's not an array
|
|
|
|
*/
|
2008-10-25 17:20:54 +02:00
|
|
|
gint
|
|
|
|
g_type_info_get_array_fixed_size (GITypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, 0);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), 0);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-06-24 23:52:05 +02:00
|
|
|
if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0))
|
2008-10-25 17:20:54 +02:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
ArrayTypeBlob *blob = (ArrayTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-10-25 17:20:54 +02:00
|
|
|
|
|
|
|
if (blob->tag == GI_TYPE_TAG_ARRAY)
|
|
|
|
{
|
|
|
|
if (blob->has_size)
|
2009-06-24 23:52:05 +02:00
|
|
|
return blob->dimensions.size;
|
2008-10-25 17:20:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
/**
|
|
|
|
* g_type_info_is_zero_terminated:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
*
|
|
|
|
* Obtain if the last element of the array is %NULL. The type tag must be a
|
|
|
|
* #GI_TYPE_TAG_ARRAY or %FALSE will returned.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if zero terminated
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
gboolean
|
|
|
|
g_type_info_is_zero_terminated (GITypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), FALSE);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-06-24 23:52:05 +02:00
|
|
|
if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0))
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
ArrayTypeBlob *blob = (ArrayTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
if (blob->tag == GI_TYPE_TAG_ARRAY)
|
|
|
|
return blob->zero_terminated;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
/**
|
|
|
|
* g_type_info_get_array_type:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
*
|
|
|
|
* Obtain the array type for this type. See #GIArrayType for a list of
|
|
|
|
* possible values. If the type tag of this type is not array, -1 will be
|
|
|
|
* returned.
|
|
|
|
*
|
|
|
|
* Returns: the array type or -1
|
|
|
|
*/
|
2010-05-04 16:57:51 +02:00
|
|
|
GIArrayType
|
|
|
|
g_type_info_get_array_type (GITypeInfo *info)
|
|
|
|
{
|
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, -1);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), -1);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-05-04 16:57:51 +02:00
|
|
|
|
|
|
|
if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0))
|
|
|
|
{
|
|
|
|
ArrayTypeBlob *blob = (ArrayTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
g_return_val_if_fail (blob->tag == GI_TYPE_TAG_ARRAY, -1);
|
|
|
|
|
|
|
|
return blob->array_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
/**
|
|
|
|
* g_type_info_get_n_error_domains:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
*
|
|
|
|
* Obtain the number of error domains for this type. The type tag
|
|
|
|
* must be a #GI_TYPE_TAG_ERROR or -1 will be returned.
|
|
|
|
*
|
|
|
|
* Returns: number of error domains or -1
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
gint
|
|
|
|
g_type_info_get_n_error_domains (GITypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, 0);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), 0);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-06-24 23:52:05 +02:00
|
|
|
if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0))
|
2008-03-10 18:46:58 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
ErrorTypeBlob *blob = (ErrorTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
|
|
|
if (blob->tag == GI_TYPE_TAG_ERROR)
|
|
|
|
return blob->n_domains;
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-05-28 18:47:48 +02:00
|
|
|
/**
|
|
|
|
* g_type_info_get_error_domain:
|
|
|
|
* @info: a #GITypeInfo
|
|
|
|
* @n: index of error domain
|
|
|
|
*
|
|
|
|
* Obtain the error domains at index @n for this type. The type tag
|
|
|
|
* must be a #GI_TYPE_TAG_ERROR or -1 will be returned.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the error domain or %NULL if type tag is wrong,
|
2010-05-29 01:49:39 +02:00
|
|
|
* free the struct with g_base_info_unref() when done.
|
2010-05-28 18:47:48 +02:00
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
GIErrorDomainInfo *
|
|
|
|
g_type_info_get_error_domain (GITypeInfo *info,
|
2009-12-08 00:35:06 +01:00
|
|
|
gint n)
|
2008-02-08 16:31:03 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-28 18:47:48 +02:00
|
|
|
SimpleTypeBlob *type;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GI_IS_TYPE_INFO (info), NULL);
|
|
|
|
|
|
|
|
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-06-24 23:52:05 +02:00
|
|
|
if (!(type->flags.reserved == 0 && type->flags.reserved2 == 0))
|
2008-03-10 18:46:58 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
ErrorTypeBlob *blob = (ErrorTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
|
|
|
if (blob->tag == GI_TYPE_TAG_ERROR)
|
2010-05-31 22:41:45 +02:00
|
|
|
return (GIErrorDomainInfo *) _g_info_from_entry (rinfo->repository,
|
|
|
|
rinfo->typelib,
|
|
|
|
blob->domains[n]);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* GIErrorDomainInfo functions */
|
2010-05-29 01:49:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gierrordomaininfo
|
|
|
|
* @Short_description: Struct representing an error domain
|
|
|
|
* @Title: GIErrorDomainInfo
|
|
|
|
*
|
|
|
|
* A GIErrorDomainInfo struct represents a domain of a #GError.
|
|
|
|
* An error domain is associated with a #GQuark and contains a pointer
|
|
|
|
* to an enum with all the error codes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_error_domain_info_get_quark:
|
|
|
|
* @info: a #GIErrorDomainInfo
|
|
|
|
*
|
|
|
|
* Obtain a string representing the quark for this error domain.
|
|
|
|
* %NULL will be returned if the type tag is wrong or if a quark is
|
|
|
|
* missing in the typelib.
|
|
|
|
*
|
|
|
|
* Returns: the quark represented as a string or %NULL
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
const gchar *
|
|
|
|
g_error_domain_info_get_quark (GIErrorDomainInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-29 01:49:39 +02:00
|
|
|
ErrorDomainBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GI_IS_ERROR_DOMAIN_INFO (info), NULL);
|
|
|
|
|
|
|
|
blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return g_typelib_get_string (rinfo->typelib, blob->get_quark);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2010-05-29 01:49:39 +02:00
|
|
|
/**
|
|
|
|
* g_error_domain_info_get_codes:
|
|
|
|
* @info: a #GIErrorDomainInfo
|
|
|
|
*
|
|
|
|
* Obtain the enum containing all the error codes for this error domain.
|
|
|
|
* The return value will have a #GIInfoType of %GI_INFO_TYPE_ERROR_DOMAIN
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the error domain or %NULL if type tag is wrong,
|
|
|
|
* free the struct with g_base_info_unref() when done.
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
GIInterfaceInfo *
|
|
|
|
g_error_domain_info_get_codes (GIErrorDomainInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-29 01:49:39 +02:00
|
|
|
ErrorDomainBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GI_IS_ERROR_DOMAIN_INFO (info), NULL);
|
|
|
|
|
|
|
|
blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2010-05-31 22:41:45 +02:00
|
|
|
return (GIInterfaceInfo *) _g_info_from_entry (rinfo->repository,
|
|
|
|
rinfo->typelib, blob->error_codes);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-05-31 02:55:55 +02:00
|
|
|
/* GIEnumInfo and GIValueInfo functions */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gienuminfo
|
|
|
|
* @Short_description: Structs representing an enumeration and its values
|
|
|
|
* @Title: GIEnumInfo
|
|
|
|
*
|
|
|
|
* A GIEnumInfo represents an enumeration and a GIValueInfo struct represents a value
|
|
|
|
* of an enumeration. The GIEnumInfo contains a set of values and a type
|
|
|
|
* The GIValueInfo is fetched by calling g_enum_info_get_value() on a #GIEnumInfo.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_enum_info_get_n_values:
|
|
|
|
* @info: a #GIEnumInfo
|
|
|
|
*
|
|
|
|
* Obtain the number of values this enumeration contains.
|
|
|
|
*
|
|
|
|
* Returns: the number of enumeration values
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
g_enum_info_get_n_values (GIEnumInfo *info)
|
|
|
|
{
|
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
EnumBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, 0);
|
|
|
|
g_return_val_if_fail (GI_IS_ENUM_INFO (info), 0);
|
|
|
|
|
|
|
|
blob = (EnumBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
|
|
|
|
return blob->n_values;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_enum_info_get_value:
|
|
|
|
* @info: a #GIEnumInfo
|
|
|
|
* @n: index of value to fetch
|
|
|
|
*
|
|
|
|
* Obtain a value for this enumeration.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the enumeration value or %NULL if type tag is wrong,
|
|
|
|
* free the struct with g_base_info_unref() when done.
|
|
|
|
*/
|
|
|
|
GIValueInfo *
|
|
|
|
g_enum_info_get_value (GIEnumInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
Header *header;
|
|
|
|
gint offset;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GI_IS_ENUM_INFO (info), NULL);
|
|
|
|
|
|
|
|
header = (Header *)rinfo->typelib->data;
|
|
|
|
offset = rinfo->offset + header->enum_blob_size
|
|
|
|
+ n * header->value_blob_size;
|
|
|
|
|
|
|
|
return (GIValueInfo *) g_info_new (GI_INFO_TYPE_VALUE, (GIBaseInfo*)info, rinfo->typelib, offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_enum_info_get_storage_type:
|
|
|
|
* @info: a #GIEnumInfo
|
|
|
|
*
|
|
|
|
* Obtain the tag of the type used for the enum in the C ABI. This will
|
|
|
|
* will be a signed or unsigned integral type.
|
|
|
|
|
|
|
|
* Note that in the current implementation the width of the type is
|
|
|
|
* computed correctly, but the signed or unsigned nature of the type
|
|
|
|
* may not match the sign of the type used by the C compiler.
|
|
|
|
*
|
|
|
|
* Return Value: the storage type for the enumeration
|
|
|
|
*/
|
|
|
|
GITypeTag
|
|
|
|
g_enum_info_get_storage_type (GIEnumInfo *info)
|
|
|
|
{
|
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
EnumBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, GI_TYPE_TAG_BOOLEAN);
|
|
|
|
g_return_val_if_fail (GI_IS_ENUM_INFO (info), GI_TYPE_TAG_BOOLEAN);
|
|
|
|
|
|
|
|
blob = (EnumBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
|
|
|
|
return blob->storage_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_value_info_get_value:
|
|
|
|
* @info: a #GIValueInfo
|
|
|
|
*
|
|
|
|
* Obtain the enumeration value of the #GIValueInfo.
|
|
|
|
*
|
|
|
|
* Returns: the enumeration value
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
glong
|
|
|
|
g_value_info_get_value (GIValueInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-05-31 02:55:55 +02:00
|
|
|
ValueBlob *blob;
|
|
|
|
|
|
|
|
g_return_val_if_fail (info != NULL, -1);
|
|
|
|
g_return_val_if_fail (GI_IS_VALUE_INFO (info), -1);
|
|
|
|
|
|
|
|
blob = (ValueBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return (glong)blob->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GIFieldInfo functions */
|
2010-05-31 02:55:55 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gifieldinfo
|
|
|
|
* @Short_description: Struct representing a struct or union field
|
|
|
|
* @Title: GIFieldInfo
|
|
|
|
*
|
|
|
|
* A GIFieldInfo struct represents a field of a struct (see #GIStructInfo),
|
|
|
|
* union (see #GIUnionInfo) or an object (see #GIObjectInfo). The GIFieldInfo
|
|
|
|
* is fetched by calling g_struct_info_get_field(), g_union_info_get_field()
|
|
|
|
* or g_object_info_get_value().
|
|
|
|
* A field has a size, type and a struct offset asssociated and a set of flags,
|
|
|
|
* which is currently #GI_FIELD_IS_READABLE or #GI_FIELD_IS_WRITABLE.
|
|
|
|
*/
|
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
GIFieldInfoFlags
|
|
|
|
g_field_info_get_flags (GIFieldInfo *info)
|
|
|
|
{
|
|
|
|
GIFieldInfoFlags flags;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
FieldBlob *blob = (FieldBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
flags = 0;
|
|
|
|
|
|
|
|
if (blob->readable)
|
|
|
|
flags = flags | GI_FIELD_IS_READABLE;
|
|
|
|
|
|
|
|
if (blob->writable)
|
|
|
|
flags = flags | GI_FIELD_IS_WRITABLE;
|
|
|
|
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_field_info_get_size (GIFieldInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
FieldBlob *blob = (FieldBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->bits;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_field_info_get_offset (GIFieldInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
FieldBlob *blob = (FieldBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->struct_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
GITypeInfo *
|
|
|
|
g_field_info_get_type (GIFieldInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
|
|
|
FieldBlob *blob = (FieldBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
GIRealInfo *type_info;
|
2009-11-09 19:17:23 +01:00
|
|
|
|
|
|
|
if (blob->has_embedded_type)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
type_info = (GIRealInfo *) g_info_new (GI_INFO_TYPE_TYPE,
|
|
|
|
(GIBaseInfo*)info, rinfo->typelib,
|
|
|
|
rinfo->offset + header->field_blob_size);
|
|
|
|
type_info->type_is_embedded = TRUE;
|
2009-11-09 19:17:23 +01:00
|
|
|
}
|
|
|
|
else
|
2010-06-05 17:11:58 +02:00
|
|
|
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (FieldBlob, type));
|
2009-11-09 19:17:23 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return (GIBaseInfo*)type_info;
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* GIRegisteredTypeInfo functions */
|
|
|
|
const gchar *
|
|
|
|
g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
if (blob->gtype_name)
|
2009-12-08 00:35:06 +01:00
|
|
|
return g_typelib_get_string (rinfo->typelib, blob->gtype_name);
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
const gchar *
|
|
|
|
g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
if (blob->gtype_init)
|
2009-12-08 00:35:06 +01:00
|
|
|
return g_typelib_get_string (rinfo->typelib, blob->gtype_init);
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-04-23 02:57:48 +02:00
|
|
|
GType
|
|
|
|
g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info)
|
|
|
|
{
|
|
|
|
const char *type_init;
|
|
|
|
GType (* get_type_func) (void);
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo*)info;
|
2008-04-23 02:57:48 +02:00
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
type_init = g_registered_type_info_get_type_init (info);
|
|
|
|
|
2008-04-23 02:57:48 +02:00
|
|
|
if (type_init == NULL)
|
|
|
|
return G_TYPE_NONE;
|
2009-02-02 21:41:30 +01:00
|
|
|
else if (!strcmp (type_init, "intern"))
|
|
|
|
return G_TYPE_OBJECT;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-04-23 02:57:48 +02:00
|
|
|
get_type_func = NULL;
|
2009-12-08 00:35:06 +01:00
|
|
|
if (!g_typelib_symbol (rinfo->typelib,
|
2008-10-07 23:25:01 +02:00
|
|
|
type_init,
|
|
|
|
(void**) &get_type_func))
|
2008-04-23 02:57:48 +02:00
|
|
|
return G_TYPE_NONE;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-04-23 02:57:48 +02:00
|
|
|
return (* get_type_func) ();
|
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
/* GIStructInfo functions */
|
|
|
|
gint
|
|
|
|
g_struct_info_get_n_fields (GIStructInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->n_fields;
|
|
|
|
}
|
|
|
|
|
2009-11-09 19:17:23 +01:00
|
|
|
static gint32
|
|
|
|
g_struct_get_field_offset (GIStructInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
|
|
|
guint32 offset = rinfo->offset + header->struct_blob_size;
|
2009-11-09 19:17:23 +01:00
|
|
|
gint i;
|
|
|
|
FieldBlob *field_blob;
|
|
|
|
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
field_blob = (FieldBlob *)&rinfo->typelib->data[offset];
|
2009-11-09 19:17:23 +01:00
|
|
|
offset += header->field_blob_size;
|
|
|
|
if (field_blob->has_embedded_type)
|
|
|
|
offset += header->callback_blob_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
GIFieldInfo *
|
|
|
|
g_struct_info_get_field (GIStructInfo *info,
|
2009-12-08 00:35:06 +01:00
|
|
|
gint n)
|
2008-02-08 16:31:03 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
|
|
|
return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib,
|
2009-12-08 00:35:06 +01:00
|
|
|
g_struct_get_field_offset (info, n));
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_struct_info_get_n_methods (GIStructInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->n_methods;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_struct_info_get_method (GIStructInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2008-02-08 16:31:03 +01:00
|
|
|
gint offset;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = g_struct_get_field_offset (info, blob->n_fields) + n * header->function_blob_size;
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
|
2009-12-08 00:35:06 +01:00
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static GIFunctionInfo *
|
|
|
|
find_method (GIBaseInfo *base,
|
2009-12-08 00:35:06 +01:00
|
|
|
guint32 offset,
|
|
|
|
gint n_methods,
|
|
|
|
const gchar *name)
|
2008-02-08 16:31:03 +01:00
|
|
|
{
|
|
|
|
/* FIXME hash */
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo*)base;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2008-02-08 16:31:03 +01:00
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < n_methods; i++)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
FunctionBlob *fblob = (FunctionBlob *)&rinfo->typelib->data[offset];
|
|
|
|
const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
if (strcmp (name, fname) == 0)
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, base,
|
2010-03-24 19:20:14 +01:00
|
|
|
rinfo->typelib, offset);
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
offset += header->function_blob_size;
|
|
|
|
}
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_struct_info_find_method (GIStructInfo *info,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->struct_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ blob->n_fields * header->field_blob_size;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return find_method ((GIBaseInfo*)info, offset, blob->n_methods, name);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2008-11-16 22:15:54 +01:00
|
|
|
gsize
|
|
|
|
g_struct_info_get_size (GIStructInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-11-16 22:15:54 +01:00
|
|
|
|
|
|
|
return blob->size;
|
|
|
|
}
|
|
|
|
|
|
|
|
gsize
|
|
|
|
g_struct_info_get_alignment (GIStructInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-11-16 22:15:54 +01:00
|
|
|
|
|
|
|
return blob->alignment;
|
|
|
|
}
|
|
|
|
|
2010-03-26 03:12:12 +01:00
|
|
|
gboolean
|
|
|
|
g_struct_info_is_foreign (GIStructInfo *info)
|
|
|
|
{
|
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
|
|
|
|
return blob->foreign;
|
|
|
|
}
|
|
|
|
|
2009-02-06 19:37:13 +01:00
|
|
|
/**
|
2009-02-20 23:34:20 +01:00
|
|
|
* g_struct_info_is_gtype_struct:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GIStructInfo
|
2010-03-24 19:00:06 +01:00
|
|
|
*
|
2009-02-06 19:37:13 +01:00
|
|
|
* Return true if this structure represents the "class structure" for some
|
2009-02-20 23:34:20 +01:00
|
|
|
* #GObject or #GInterface. This function is mainly useful to hide this kind of structure
|
|
|
|
* from generated public APIs.
|
2009-02-06 19:37:13 +01:00
|
|
|
*
|
2009-02-20 23:34:20 +01:00
|
|
|
* Returns: %TRUE if this is a class struct, %FALSE otherwise
|
2009-02-06 19:37:13 +01:00
|
|
|
*/
|
|
|
|
gboolean
|
2009-02-20 23:34:20 +01:00
|
|
|
g_struct_info_is_gtype_struct (GIStructInfo *info)
|
2009-02-06 19:37:13 +01:00
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
2009-02-06 19:37:13 +01:00
|
|
|
|
2009-02-20 23:34:20 +01:00
|
|
|
return blob->is_gtype_struct;
|
2009-02-06 19:37:13 +01:00
|
|
|
}
|
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
/* GIObjectInfo functions */
|
|
|
|
GIObjectInfo *
|
|
|
|
g_object_info_get_parent (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
if (blob->parent)
|
2010-05-31 22:41:45 +02:00
|
|
|
return (GIObjectInfo *) _g_info_from_entry (rinfo->repository,
|
|
|
|
rinfo->typelib, blob->parent);
|
2008-02-08 16:31:03 +01:00
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-10-20 19:04:17 +02:00
|
|
|
gboolean
|
|
|
|
g_object_info_get_abstract (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-10-20 19:04:17 +02:00
|
|
|
return blob->abstract != 0;
|
|
|
|
}
|
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
const gchar *
|
|
|
|
g_object_info_get_type_name (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return g_typelib_get_string (rinfo->typelib, blob->gtype_name);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const gchar *
|
|
|
|
g_object_info_get_type_init (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return g_typelib_get_string (rinfo->typelib, blob->gtype_init);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_object_info_get_n_interfaces (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->n_interfaces;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIInterfaceInfo *
|
|
|
|
g_object_info_get_interface (GIObjectInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2010-05-31 22:41:45 +02:00
|
|
|
return (GIInterfaceInfo *) _g_info_from_entry (rinfo->repository,
|
|
|
|
rinfo->typelib, blob->interfaces[n]);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_object_info_get_n_fields (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->n_fields;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIFieldInfo *
|
|
|
|
g_object_info_get_field (GIObjectInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->object_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2
|
|
|
|
+ n * header->field_blob_size;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_object_info_get_n_properties (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return blob->n_properties;
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
GIPropertyInfo *
|
|
|
|
g_object_info_get_property (GIObjectInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->object_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2
|
|
|
|
+ blob->n_fields * header->field_blob_size
|
|
|
|
+ n * header->property_blob_size;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info,
|
2009-12-08 00:35:06 +01:00
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_object_info_get_n_methods (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->n_methods;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_object_info_get_method (GIObjectInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->object_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2
|
|
|
|
+ blob->n_fields * header->field_blob_size
|
|
|
|
+ blob->n_properties * header->property_blob_size
|
|
|
|
+ n * header->function_blob_size;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_object_info_find_method (GIObjectInfo *info,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->object_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2
|
|
|
|
+ blob->n_fields * header->field_blob_size +
|
|
|
|
+ blob->n_properties * header->property_blob_size;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return find_method ((GIBaseInfo*)info, offset, blob->n_methods, name);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_object_info_get_n_signals (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->n_signals;
|
|
|
|
}
|
|
|
|
|
|
|
|
GISignalInfo *
|
|
|
|
g_object_info_get_signal (GIObjectInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->object_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2
|
|
|
|
+ blob->n_fields * header->field_blob_size
|
|
|
|
+ blob->n_properties * header->property_blob_size
|
2010-03-24 19:00:06 +01:00
|
|
|
+ blob->n_methods * header->function_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ n * header->signal_blob_size;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_object_info_get_n_vfuncs (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->n_vfuncs;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIVFuncInfo *
|
|
|
|
g_object_info_get_vfunc (GIObjectInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->object_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2
|
|
|
|
+ blob->n_fields * header->field_blob_size
|
|
|
|
+ blob->n_properties * header->property_blob_size
|
2010-03-24 19:00:06 +01:00
|
|
|
+ blob->n_methods * header->function_blob_size
|
|
|
|
+ blob->n_signals * header->signal_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ n * header->vfunc_blob_size;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2009-02-28 01:02:48 +01:00
|
|
|
static GIVFuncInfo *
|
2009-12-08 00:35:06 +01:00
|
|
|
find_vfunc (GIRealInfo *rinfo,
|
2009-02-28 01:02:48 +01:00
|
|
|
guint32 offset,
|
|
|
|
gint n_vfuncs,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
/* FIXME hash */
|
2009-12-08 00:35:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-02-28 01:02:48 +01:00
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < n_vfuncs; i++)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
VFuncBlob *fblob = (VFuncBlob *)&rinfo->typelib->data[offset];
|
|
|
|
const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name];
|
2009-02-28 01:02:48 +01:00
|
|
|
|
|
|
|
if (strcmp (name, fname) == 0)
|
2009-12-08 00:35:06 +01:00
|
|
|
return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*) rinfo,
|
|
|
|
rinfo->typelib, offset);
|
2009-02-28 01:02:48 +01:00
|
|
|
|
|
|
|
offset += header->vfunc_blob_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_object_info_find_vfunc:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GIObjectInfo
|
2009-02-28 01:02:48 +01:00
|
|
|
* @name: The name of a virtual function to find.
|
|
|
|
*
|
2010-05-20 01:57:19 +02:00
|
|
|
* Locate a virtual function slot with name @name. Note that the namespace
|
2009-02-28 01:02:48 +01:00
|
|
|
* for virtuals is distinct from that of methods; there may or may not be
|
2010-05-20 01:57:19 +02:00
|
|
|
* a concrete method associated for a virtual. If there is one, it may
|
|
|
|
* be retrieved using g_vfunc_info_get_invoker(), otherwise %NULL will be
|
|
|
|
* returned.
|
|
|
|
* See the documentation for g_vfunc_info_get_invoker() for more
|
|
|
|
* information on invoking virtuals.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the #GIVFuncInfo, or %NULL. Free it with
|
|
|
|
* g_base_info_unref() when done.
|
2009-02-28 01:02:48 +01:00
|
|
|
*/
|
|
|
|
GIVFuncInfo *
|
|
|
|
g_object_info_find_vfunc (GIObjectInfo *info,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2009-02-28 01:02:48 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->object_blob_size
|
2009-02-28 01:02:48 +01:00
|
|
|
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2
|
|
|
|
+ blob->n_fields * header->field_blob_size
|
|
|
|
+ blob->n_properties * header->property_blob_size
|
|
|
|
+ blob->n_methods * header->function_blob_size
|
|
|
|
+ blob->n_signals * header->signal_blob_size;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return find_vfunc (rinfo, offset, blob->n_vfuncs, name);
|
2009-02-28 01:02:48 +01:00
|
|
|
}
|
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
gint
|
|
|
|
g_object_info_get_n_constants (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->n_constants;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIConstantInfo *
|
|
|
|
g_object_info_get_constant (GIObjectInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->object_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2
|
|
|
|
+ blob->n_fields * header->field_blob_size
|
|
|
|
+ blob->n_properties * header->property_blob_size
|
2010-03-24 19:00:06 +01:00
|
|
|
+ blob->n_methods * header->function_blob_size
|
|
|
|
+ blob->n_signals * header->signal_blob_size
|
|
|
|
+ blob->n_vfuncs * header->vfunc_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ n * header->constant_blob_size;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2009-02-06 19:37:13 +01:00
|
|
|
/**
|
|
|
|
* g_object_info_get_class_struct:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GIObjectInfo
|
2010-03-24 19:00:06 +01:00
|
|
|
*
|
2009-02-20 23:34:20 +01:00
|
|
|
* Every #GObject has two structures; an instance structure and a class
|
2009-02-06 19:37:13 +01:00
|
|
|
* structure. This function returns the metadata for the class structure.
|
2009-02-12 04:32:25 +01:00
|
|
|
*
|
2010-05-20 01:57:19 +02:00
|
|
|
* Returns: (transfer full): the #GIStructInfo or %NULL. Free with
|
|
|
|
* g_base_info_unref() when done.
|
2009-02-06 19:37:13 +01:00
|
|
|
*/
|
|
|
|
GIStructInfo *
|
|
|
|
g_object_info_get_class_struct (GIObjectInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
2009-02-06 19:37:13 +01:00
|
|
|
|
2009-02-20 23:34:20 +01:00
|
|
|
if (blob->gtype_struct)
|
2010-05-31 22:41:45 +02:00
|
|
|
return (GIStructInfo *) _g_info_from_entry (rinfo->repository,
|
|
|
|
rinfo->typelib, blob->gtype_struct);
|
2009-02-06 19:37:13 +01:00
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
/* GIInterfaceInfo functions */
|
|
|
|
gint
|
|
|
|
g_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->n_prerequisites;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIBaseInfo *
|
|
|
|
g_interface_info_get_prerequisite (GIInterfaceInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2010-05-31 22:41:45 +02:00
|
|
|
return _g_info_from_entry (rinfo->repository,
|
|
|
|
rinfo->typelib, blob->prerequisites[n]);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_interface_info_get_n_properties (GIInterfaceInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return blob->n_properties;
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
GIPropertyInfo *
|
|
|
|
g_interface_info_get_property (GIInterfaceInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->interface_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
|
|
|
|
+ n * header->property_blob_size;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info,
|
2009-12-08 00:35:06 +01:00
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_interface_info_get_n_methods (GIInterfaceInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->n_methods;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_interface_info_get_method (GIInterfaceInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->interface_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
|
2010-03-24 19:00:06 +01:00
|
|
|
+ blob->n_properties * header->property_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ n * header->function_blob_size;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
|
|
|
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_interface_info_find_method (GIInterfaceInfo *info,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->interface_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
|
|
|
|
+ blob->n_properties * header->property_blob_size;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return find_method ((GIBaseInfo*)info, offset, blob->n_methods, name);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_interface_info_get_n_signals (GIInterfaceInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->n_signals;
|
|
|
|
}
|
|
|
|
|
|
|
|
GISignalInfo *
|
|
|
|
g_interface_info_get_signal (GIInterfaceInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
|
|
|
offset = rinfo->offset + header->interface_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
|
2010-03-24 19:00:06 +01:00
|
|
|
+ blob->n_properties * header->property_blob_size
|
|
|
|
+ blob->n_methods * header->function_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ n * header->signal_blob_size;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
|
|
|
return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->n_vfuncs;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIVFuncInfo *
|
|
|
|
g_interface_info_get_vfunc (GIInterfaceInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
|
|
|
offset = rinfo->offset + header->interface_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
|
2010-03-24 19:00:06 +01:00
|
|
|
+ blob->n_properties * header->property_blob_size
|
|
|
|
+ blob->n_methods * header->function_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ blob->n_signals * header->signal_blob_size
|
|
|
|
+ n * header->vfunc_blob_size;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
|
|
|
return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2009-02-28 01:02:48 +01:00
|
|
|
/**
|
|
|
|
* g_interface_info_find_vfunc:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GIObjectInfo
|
2009-02-28 01:02:48 +01:00
|
|
|
* @name: The name of a virtual function to find.
|
|
|
|
*
|
2010-05-20 01:57:19 +02:00
|
|
|
* Locate a virtual function slot with name @name. See the documentation
|
|
|
|
* for g_object_info_find_vfunc() for more information on virtuals.
|
2009-02-28 01:02:48 +01:00
|
|
|
*
|
2010-05-20 01:57:19 +02:00
|
|
|
* Returns: (transfer full): the #GIVFuncInfo, or %NULL. Free it with
|
|
|
|
* g_base_info_unref() when done.
|
2009-02-28 01:02:48 +01:00
|
|
|
*/
|
|
|
|
GIVFuncInfo *
|
|
|
|
g_interface_info_find_vfunc (GIInterfaceInfo *info,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2009-02-28 01:02:48 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->interface_blob_size
|
2009-02-28 01:02:48 +01:00
|
|
|
+ (blob->n_prerequisites + blob->n_prerequisites % 2) * 2
|
|
|
|
+ blob->n_properties * header->property_blob_size
|
|
|
|
+ blob->n_methods * header->function_blob_size
|
|
|
|
+ blob->n_signals * header->signal_blob_size;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return find_vfunc (rinfo, offset, blob->n_vfuncs, name);
|
2009-02-28 01:02:48 +01:00
|
|
|
}
|
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
gint
|
|
|
|
g_interface_info_get_n_constants (GIInterfaceInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->n_constants;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIConstantInfo *
|
|
|
|
g_interface_info_get_constant (GIInterfaceInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2009-12-08 00:35:06 +01:00
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->interface_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
|
|
|
|
+ blob->n_properties * header->property_blob_size
|
2010-03-24 19:00:06 +01:00
|
|
|
+ blob->n_methods * header->function_blob_size
|
|
|
|
+ blob->n_signals * header->signal_blob_size
|
|
|
|
+ blob->n_vfuncs * header->vfunc_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ n * header->constant_blob_size;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
2009-02-20 23:34:20 +01:00
|
|
|
/**
|
|
|
|
* g_interface_info_get_iface_struct:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GIInterfaceInfo
|
2009-02-20 23:34:20 +01:00
|
|
|
*
|
|
|
|
* Returns the layout C structure associated with this #GInterface.
|
|
|
|
*
|
2010-05-20 01:57:19 +02:00
|
|
|
* Returns: (transfer full): the #GIStructInfo or %NULL. Free it with
|
|
|
|
* g_base_info_unref() when done.
|
2009-02-20 23:34:20 +01:00
|
|
|
*/
|
|
|
|
GIStructInfo *
|
|
|
|
g_interface_info_get_iface_struct (GIInterfaceInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
InterfaceBlob *blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2009-02-20 23:34:20 +01:00
|
|
|
if (blob->gtype_struct)
|
2010-05-31 22:41:45 +02:00
|
|
|
return (GIStructInfo *) _g_info_from_entry (rinfo->repository,
|
|
|
|
rinfo->typelib, blob->gtype_struct);
|
2009-02-20 23:34:20 +01:00
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
/* GIPropertyInfo functions */
|
|
|
|
GParamFlags
|
|
|
|
g_property_info_get_flags (GIPropertyInfo *info)
|
|
|
|
{
|
|
|
|
GParamFlags flags;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
PropertyBlob *blob = (PropertyBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
flags = 0;
|
|
|
|
|
|
|
|
if (blob->readable)
|
|
|
|
flags = flags | G_PARAM_READABLE;
|
|
|
|
|
|
|
|
if (blob->writable)
|
|
|
|
flags = flags | G_PARAM_WRITABLE;
|
|
|
|
|
|
|
|
if (blob->construct)
|
|
|
|
flags = flags | G_PARAM_CONSTRUCT;
|
|
|
|
|
|
|
|
if (blob->construct_only)
|
|
|
|
flags = flags | G_PARAM_CONSTRUCT_ONLY;
|
|
|
|
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
GITypeInfo *
|
|
|
|
g_property_info_get_type (GIPropertyInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2010-06-05 17:11:58 +02:00
|
|
|
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type));
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* GISignalInfo functions */
|
|
|
|
GSignalFlags
|
|
|
|
g_signal_info_get_flags (GISignalInfo *info)
|
|
|
|
{
|
|
|
|
GSignalFlags flags;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
SignalBlob *blob = (SignalBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
flags = 0;
|
|
|
|
|
|
|
|
if (blob->run_first)
|
|
|
|
flags = flags | G_SIGNAL_RUN_FIRST;
|
|
|
|
|
|
|
|
if (blob->run_last)
|
|
|
|
flags = flags | G_SIGNAL_RUN_LAST;
|
|
|
|
|
|
|
|
if (blob->run_cleanup)
|
|
|
|
flags = flags | G_SIGNAL_RUN_CLEANUP;
|
|
|
|
|
|
|
|
if (blob->no_recurse)
|
|
|
|
flags = flags | G_SIGNAL_NO_RECURSE;
|
|
|
|
|
|
|
|
if (blob->detailed)
|
|
|
|
flags = flags | G_SIGNAL_DETAILED;
|
|
|
|
|
|
|
|
if (blob->action)
|
|
|
|
flags = flags | G_SIGNAL_ACTION;
|
|
|
|
|
|
|
|
if (blob->no_hooks)
|
|
|
|
flags = flags | G_SIGNAL_NO_HOOKS;
|
|
|
|
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIVFuncInfo *
|
|
|
|
g_signal_info_get_class_closure (GISignalInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
SignalBlob *blob = (SignalBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
if (blob->has_class_closure)
|
2009-12-08 00:35:06 +01:00
|
|
|
return g_interface_info_get_vfunc ((GIInterfaceInfo *)rinfo->container, blob->class_closure);
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
g_signal_info_true_stops_emit (GISignalInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
SignalBlob *blob = (SignalBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
return blob->true_stops_emit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GIVFuncInfo functions */
|
|
|
|
GIVFuncInfoFlags
|
|
|
|
g_vfunc_info_get_flags (GIVFuncInfo *info)
|
|
|
|
{
|
|
|
|
GIVFuncInfoFlags flags;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
VFuncBlob *blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
flags = 0;
|
|
|
|
|
|
|
|
if (blob->must_chain_up)
|
|
|
|
flags = flags | GI_VFUNC_MUST_CHAIN_UP;
|
|
|
|
|
|
|
|
if (blob->must_be_implemented)
|
|
|
|
flags = flags | GI_VFUNC_MUST_OVERRIDE;
|
|
|
|
|
|
|
|
if (blob->must_not_be_implemented)
|
|
|
|
flags = flags | GI_VFUNC_MUST_NOT_OVERRIDE;
|
|
|
|
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_vfunc_info_get_offset (GIVFuncInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
VFuncBlob *blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->struct_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
GISignalInfo *
|
|
|
|
g_vfunc_info_get_signal (GIVFuncInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
VFuncBlob *blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
if (blob->class_closure)
|
2009-12-08 00:35:06 +01:00
|
|
|
return g_interface_info_get_signal ((GIInterfaceInfo *)rinfo->container, blob->signal);
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-02-28 01:02:48 +01:00
|
|
|
/**
|
|
|
|
* g_vfunc_info_get_invoker:
|
2010-05-20 01:57:19 +02:00
|
|
|
* @info: a #GIVFuncInfo
|
2009-02-28 01:02:48 +01:00
|
|
|
*
|
|
|
|
* If this virtual function has an associated invoker method, this
|
|
|
|
* method will return it. An invoker method is a C entry point.
|
|
|
|
*
|
|
|
|
* Not all virtuals will have invokers.
|
|
|
|
*
|
2010-05-20 01:57:19 +02:00
|
|
|
* Returns: (transfer full): the #GIVFuncInfo or %NULL. Free it with
|
|
|
|
* g_base_info_unref() when done.
|
2009-02-28 01:02:48 +01:00
|
|
|
*/
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_vfunc_info_get_invoker (GIVFuncInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
VFuncBlob *blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset];
|
|
|
|
GIBaseInfo *container = rinfo->container;
|
2009-02-28 01:02:48 +01:00
|
|
|
GIInfoType parent_type;
|
|
|
|
|
|
|
|
/* 1023 = 0x3ff is the maximum of the 10 bits for invoker index */
|
|
|
|
if (blob->invoker == 1023)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
parent_type = g_base_info_get_type (container);
|
|
|
|
if (parent_type == GI_INFO_TYPE_OBJECT)
|
|
|
|
return g_object_info_get_method ((GIObjectInfo*)container, blob->invoker);
|
|
|
|
else if (parent_type == GI_INFO_TYPE_INTERFACE)
|
|
|
|
return g_interface_info_get_method ((GIInterfaceInfo*)container, blob->invoker);
|
|
|
|
else
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
/* GIConstantInfo functions */
|
|
|
|
GITypeInfo *
|
|
|
|
g_constant_info_get_type (GIConstantInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2010-06-05 17:11:58 +02:00
|
|
|
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
2010-03-24 19:00:06 +01:00
|
|
|
g_constant_info_get_value (GIConstantInfo *info,
|
2008-02-08 16:31:03 +01:00
|
|
|
GArgument *value)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
ConstantBlob *blob = (ConstantBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-02-08 16:31:03 +01:00
|
|
|
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
/* FIXME non-basic types ? */
|
2009-06-24 23:52:05 +02:00
|
|
|
if (blob->type.flags.reserved == 0 && blob->type.flags.reserved2 == 0)
|
2008-03-10 18:47:24 +01:00
|
|
|
{
|
2009-06-24 23:52:05 +02:00
|
|
|
if (blob->type.flags.pointer)
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_pointer = g_memdup (&rinfo->typelib->data[blob->offset], blob->size);
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
else
|
|
|
|
{
|
2009-06-24 23:52:05 +02:00
|
|
|
switch (blob->type.flags.tag)
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
{
|
|
|
|
case GI_TYPE_TAG_BOOLEAN:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_boolean = *(gboolean*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT8:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_int8 = *(gint8*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT8:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_uint8 = *(guint8*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT16:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_int16 = *(gint16*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT16:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_uint16 = *(guint16*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT32:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_int32 = *(gint32*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT32:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_uint32 = *(guint32*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT64:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_int64 = *(gint64*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT64:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_uint64 = *(guint64*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_FLOAT:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_float = *(gfloat*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_DOUBLE:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_double = *(gdouble*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
2008-09-23 20:20:25 +02:00
|
|
|
case GI_TYPE_TAG_TIME_T:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_long = *(long*)&rinfo->typelib->data[blob->offset];
|
2008-09-23 20:20:25 +02:00
|
|
|
break;
|
2009-06-20 01:53:03 +02:00
|
|
|
case GI_TYPE_TAG_SHORT:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_short = *(gshort*)&rinfo->typelib->data[blob->offset];
|
2009-06-20 01:53:03 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_USHORT:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_ushort = *(gushort*)&rinfo->typelib->data[blob->offset];
|
2009-06-20 01:53:03 +02:00
|
|
|
break;
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
case GI_TYPE_TAG_INT:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_int = *(gint*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_uint = *(guint*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_LONG:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_long = *(glong*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_ULONG:
|
2009-12-08 00:35:06 +01:00
|
|
|
value->v_ulong = *(gulong*)&rinfo->typelib->data[blob->offset];
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return blob->size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GIUnionInfo functions */
|
|
|
|
gint
|
|
|
|
g_union_info_get_n_fields (GIUnionInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->n_fields;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIFieldInfo *
|
|
|
|
g_union_info_get_field (GIUnionInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
|
|
|
|
|
|
|
return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib,
|
|
|
|
rinfo->offset + header->union_blob_size +
|
2008-02-08 16:31:03 +01:00
|
|
|
n * header->field_blob_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_union_info_get_n_methods (GIUnionInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->n_functions;
|
|
|
|
}
|
|
|
|
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_union_info_get_method (GIUnionInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2008-02-08 16:31:03 +01:00
|
|
|
gint offset;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
offset = rinfo->offset + header->union_blob_size
|
|
|
|
+ blob->n_fields * header->field_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ n * header->function_blob_size;
|
2010-03-24 19:00:06 +01:00
|
|
|
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
|
2009-12-08 00:35:06 +01:00
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
g_union_info_is_discriminated (GIUnionInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->discriminated;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
g_union_info_get_discriminator_offset (GIUnionInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
return blob->discriminator_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
GITypeInfo *
|
|
|
|
g_union_info_get_discriminator_type (GIUnionInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2010-06-05 17:11:58 +02:00
|
|
|
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 24);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
GIConstantInfo *
|
|
|
|
g_union_info_get_discriminator (GIUnionInfo *info,
|
|
|
|
gint n)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
if (blob->discriminated)
|
|
|
|
{
|
2010-03-24 19:00:06 +01:00
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
2008-02-08 16:31:03 +01:00
|
|
|
gint offset;
|
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
offset = rinfo->offset + header->union_blob_size
|
|
|
|
+ blob->n_fields * header->field_blob_size
|
2008-02-08 16:31:03 +01:00
|
|
|
+ blob->n_functions * header->function_blob_size
|
|
|
|
+ n * header->constant_blob_size;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
|
|
|
return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info,
|
|
|
|
rinfo->typelib, offset);
|
2008-02-08 16:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
}
|
2008-10-15 00:25:13 +02:00
|
|
|
|
|
|
|
GIFunctionInfo *
|
|
|
|
g_union_info_find_method (GIUnionInfo *info,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
gint offset;
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
Header *header = (Header *)rinfo->typelib->data;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-10-15 00:25:13 +02:00
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
offset = rinfo->offset + header->union_blob_size
|
2008-10-15 00:25:13 +02:00
|
|
|
+ blob->n_fields * header->field_blob_size;
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
return find_method ((GIBaseInfo*)info, offset, blob->n_functions, name);
|
2008-10-15 00:25:13 +02:00
|
|
|
}
|
|
|
|
|
2008-11-16 22:15:54 +01:00
|
|
|
gsize
|
|
|
|
g_union_info_get_size (GIUnionInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-11-16 22:15:54 +01:00
|
|
|
|
|
|
|
return blob->size;
|
|
|
|
}
|
|
|
|
|
|
|
|
gsize
|
|
|
|
g_union_info_get_alignment (GIUnionInfo *info)
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
|
|
|
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
2008-11-16 22:15:54 +01:00
|
|
|
|
|
|
|
return blob->alignment;
|
|
|
|
}
|