mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 22:46:15 +01:00
Merge branch '3155-girepository-api-cleanups' into 'main'
girepository: Various API cleanups See merge request GNOME/glib!3760
This commit is contained in:
commit
7688965491
@ -521,33 +521,41 @@ dump_error_quark (GQuark quark, const char *symbol, GOutputStream *out)
|
||||
|
||||
/**
|
||||
* gi_repository_dump:
|
||||
* @arg: Comma-separated pair of input and output filenames
|
||||
* @input_filename: (type filename): Input filename (for example `input.txt`)
|
||||
* @output_filename: (type filename): Output filename (for example `output.xml`)
|
||||
* @error: a %GError
|
||||
*
|
||||
* Argument specified is a comma-separated pair of filenames; i.e. of
|
||||
* the form "input.txt,output.xml". The input file should be a
|
||||
* Dump the introspection data from the types specified in @input_filename to
|
||||
* @output_filename.
|
||||
*
|
||||
* The input file should be a
|
||||
* UTF-8 Unix-line-ending text file, with each line containing either
|
||||
* "get-type:" followed by the name of a GType _get_type function, or
|
||||
* "error-quark:" followed by the name of an error quark function. No
|
||||
* extra whitespace is allowed.
|
||||
* `get-type:` followed by the name of a [type@GObject.Type] `_get_type`
|
||||
* function, or `error-quark:` followed by the name of an error quark function.
|
||||
* No extra whitespace is allowed.
|
||||
*
|
||||
* The output file should already exist, but be empty. This function will
|
||||
* overwrite its contents.
|
||||
* This function will overwrite the contents of the output file.
|
||||
*
|
||||
* Returns: %TRUE on success, %FALSE on error
|
||||
* Returns: true on success, false on error
|
||||
* Since: 2.80
|
||||
*/
|
||||
#ifndef GI_COMPILATION
|
||||
static gboolean
|
||||
dump_irepository (const char *arg, GError **error) G_GNUC_UNUSED;
|
||||
dump_irepository (const char *input_filename,
|
||||
const char *output_filename,
|
||||
GError **error) G_GNUC_UNUSED;
|
||||
static gboolean
|
||||
dump_irepository (const char *arg, GError **error)
|
||||
dump_irepository (const char *input_filename,
|
||||
const char *output_filename,
|
||||
GError **error)
|
||||
#else
|
||||
gboolean
|
||||
gi_repository_dump (const char *arg, GError **error)
|
||||
gi_repository_dump (const char *input_filename,
|
||||
const char *output_filename,
|
||||
GError **error)
|
||||
#endif
|
||||
{
|
||||
GHashTable *output_types;
|
||||
char **args;
|
||||
GFile *input_file;
|
||||
GFile *output_file;
|
||||
GFileInputStream *input;
|
||||
@ -567,12 +575,8 @@ gi_repository_dump (const char *arg, GError **error)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
args = g_strsplit (arg, ",", 2);
|
||||
|
||||
input_file = g_file_new_for_path (args[0]);
|
||||
output_file = g_file_new_for_path (args[1]);
|
||||
|
||||
g_strfreev (args);
|
||||
input_file = g_file_new_for_path (input_filename);
|
||||
output_file = g_file_new_for_path (output_filename);
|
||||
|
||||
input = g_file_read (input_file, NULL, error);
|
||||
g_object_unref (input_file);
|
||||
|
@ -246,7 +246,7 @@ gi_arg_info_get_scope (GIArgInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_arg_info_get_closure:
|
||||
* gi_arg_info_get_closure_index:
|
||||
* @info: a #GIArgInfo
|
||||
*
|
||||
* Obtain the index of the user data argument. This is only valid
|
||||
@ -255,7 +255,7 @@ gi_arg_info_get_scope (GIArgInfo *info)
|
||||
* Returns: index of the user data argument or -1 if there is none
|
||||
*/
|
||||
gint
|
||||
gi_arg_info_get_closure (GIArgInfo *info)
|
||||
gi_arg_info_get_closure_index (GIArgInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ArgBlob *blob;
|
||||
@ -269,7 +269,7 @@ gi_arg_info_get_closure (GIArgInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_arg_info_get_destroy:
|
||||
* gi_arg_info_get_destroy_index:
|
||||
* @info: a #GIArgInfo
|
||||
*
|
||||
* Obtains the index of the #GDestroyNotify argument. This is only valid
|
||||
@ -278,7 +278,7 @@ gi_arg_info_get_closure (GIArgInfo *info)
|
||||
* Returns: index of the #GDestroyNotify argument or -1 if there is none
|
||||
*/
|
||||
gint
|
||||
gi_arg_info_get_destroy (GIArgInfo *info)
|
||||
gi_arg_info_get_destroy_index (GIArgInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ArgBlob *blob;
|
||||
|
@ -67,10 +67,10 @@ GI_AVAILABLE_IN_ALL
|
||||
GIScopeType gi_arg_info_get_scope (GIArgInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_arg_info_get_closure (GIArgInfo *info);
|
||||
gint gi_arg_info_get_closure_index (GIArgInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_arg_info_get_destroy (GIArgInfo *info);
|
||||
gint gi_arg_info_get_destroy_index (GIArgInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GITypeInfo * gi_arg_info_get_type_info (GIArgInfo *info);
|
||||
|
@ -747,7 +747,7 @@ gi_base_info_get_attribute (GIBaseInfo *info,
|
||||
const gchar *name)
|
||||
{
|
||||
GIAttributeIter iter = { 0, };
|
||||
gchar *curname, *curvalue;
|
||||
const char *curname, *curvalue;
|
||||
while (gi_base_info_iterate_attributes (info, &iter, &curname, &curvalue))
|
||||
{
|
||||
if (strcmp (name, curname) == 0)
|
||||
@ -832,8 +832,8 @@ _attribute_blob_find_first (GIBaseInfo *info,
|
||||
* print_attributes (GIBaseInfo *info)
|
||||
* {
|
||||
* GIAttributeIter iter = { 0, };
|
||||
* char *name;
|
||||
* char *value;
|
||||
* const char *name;
|
||||
* const char *value;
|
||||
* while (gi_base_info_iterate_attributes (info, &iter, &name, &value))
|
||||
* {
|
||||
* g_print ("attribute name: %s value: %s", name, value);
|
||||
@ -846,8 +846,8 @@ _attribute_blob_find_first (GIBaseInfo *info,
|
||||
gboolean
|
||||
gi_base_info_iterate_attributes (GIBaseInfo *info,
|
||||
GIAttributeIter *iterator,
|
||||
gchar **name,
|
||||
gchar **value)
|
||||
const gchar **name,
|
||||
const gchar **value)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
@ -864,8 +864,8 @@ gi_base_info_iterate_attributes (GIBaseInfo *info,
|
||||
if (next == NULL || next->offset != rinfo->offset || next >= after)
|
||||
return FALSE;
|
||||
|
||||
*name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name);
|
||||
*value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value);
|
||||
*name = gi_typelib_get_string (rinfo->typelib, next->name);
|
||||
*value = gi_typelib_get_string (rinfo->typelib, next->value);
|
||||
iterator->data = next + 1;
|
||||
|
||||
return TRUE;
|
||||
|
@ -79,8 +79,8 @@ const gchar * gi_base_info_get_attribute (GIBaseInfo *info,
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_base_info_iterate_attributes (GIBaseInfo *info,
|
||||
GIAttributeIter *iterator,
|
||||
char **name,
|
||||
char **value);
|
||||
const char **name,
|
||||
const char **value);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIBaseInfo * gi_base_info_get_container (GIBaseInfo *info);
|
||||
|
@ -322,7 +322,7 @@ gi_callable_info_get_instance_ownership_transfer (GICallableInfo *info)
|
||||
*
|
||||
* Returns: The number of arguments this callable expects.
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_callable_info_get_n_args (GICallableInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -350,7 +350,7 @@ gi_callable_info_get_n_args (GICallableInfo *info)
|
||||
*/
|
||||
GIArgInfo *
|
||||
gi_callable_info_get_arg (GICallableInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
Header *header;
|
||||
@ -380,7 +380,7 @@ gi_callable_info_get_arg (GICallableInfo *info,
|
||||
*/
|
||||
void
|
||||
gi_callable_info_load_arg (GICallableInfo *info,
|
||||
gint n,
|
||||
guint n,
|
||||
GIArgInfo *arg)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -411,7 +411,7 @@ gi_callable_info_get_return_attribute (GICallableInfo *info,
|
||||
const gchar *name)
|
||||
{
|
||||
GIAttributeIter iter = { 0, };
|
||||
gchar *curname, *curvalue;
|
||||
const char *curname, *curvalue;
|
||||
while (gi_callable_info_iterate_return_attributes (info, &iter, &curname, &curvalue))
|
||||
{
|
||||
if (g_strcmp0 (name, curname) == 0)
|
||||
@ -443,8 +443,8 @@ gi_callable_info_get_return_attribute (GICallableInfo *info,
|
||||
gboolean
|
||||
gi_callable_info_iterate_return_attributes (GICallableInfo *info,
|
||||
GIAttributeIter *iterator,
|
||||
char **name,
|
||||
char **value)
|
||||
const char **name,
|
||||
const char **value)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
@ -464,8 +464,8 @@ gi_callable_info_iterate_return_attributes (GICallableInfo *info,
|
||||
if (next == NULL || next->offset != blob_offset || next >= after)
|
||||
return FALSE;
|
||||
|
||||
*name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name);
|
||||
*value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value);
|
||||
*name = gi_typelib_get_string (rinfo->typelib, next->name);
|
||||
*value = gi_typelib_get_string (rinfo->typelib, next->value);
|
||||
iterator->data = next + 1;
|
||||
|
||||
return TRUE;
|
||||
@ -601,9 +601,9 @@ gboolean
|
||||
gi_callable_info_invoke (GICallableInfo *info,
|
||||
gpointer function,
|
||||
const GIArgument *in_args,
|
||||
int n_in_args,
|
||||
gsize n_in_args,
|
||||
const GIArgument *out_args,
|
||||
int n_out_args,
|
||||
gsize n_out_args,
|
||||
GIArgument *return_value,
|
||||
gboolean is_method,
|
||||
gboolean throws,
|
||||
@ -616,7 +616,7 @@ gi_callable_info_invoke (GICallableInfo *info,
|
||||
GITypeInfo *rinfo;
|
||||
GITypeTag rtag;
|
||||
GIArgInfo *ainfo;
|
||||
gint n_args, n_invoke_args, in_pos, out_pos, i;
|
||||
gsize n_args, n_invoke_args, in_pos, out_pos, i;
|
||||
gpointer *args;
|
||||
gboolean success = FALSE;
|
||||
GError *local_error = NULL;
|
||||
|
@ -65,8 +65,8 @@ const gchar * gi_callable_info_get_return_attribute (GICallableInfo *in
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_callable_info_iterate_return_attributes (GICallableInfo *info,
|
||||
GIAttributeIter *iterator,
|
||||
char **name,
|
||||
char **value);
|
||||
const char **name,
|
||||
const char **value);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GITransfer gi_callable_info_get_caller_owns (GICallableInfo *info);
|
||||
@ -78,24 +78,24 @@ GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_callable_info_skip_return (GICallableInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_callable_info_get_n_args (GICallableInfo *info);
|
||||
guint gi_callable_info_get_n_args (GICallableInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIArgInfo * gi_callable_info_get_arg (GICallableInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
void gi_callable_info_load_arg (GICallableInfo *info,
|
||||
gint n,
|
||||
guint n,
|
||||
GIArgInfo *arg);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_callable_info_invoke (GICallableInfo *info,
|
||||
gpointer function,
|
||||
const GIArgument *in_args,
|
||||
int n_in_args,
|
||||
gsize n_in_args,
|
||||
const GIArgument *out_args,
|
||||
int n_out_args,
|
||||
gsize n_out_args,
|
||||
GIArgument *return_value,
|
||||
gboolean is_method,
|
||||
gboolean throws,
|
||||
|
@ -108,9 +108,9 @@ gi_constant_info_free_value (GIConstantInfo *info,
|
||||
* The size of the constant value stored in @argument will be returned.
|
||||
* Free the value with gi_constant_info_free_value().
|
||||
*
|
||||
* Returns: size of the constant
|
||||
* Returns: size of the constant, in bytes
|
||||
*/
|
||||
gint
|
||||
gsize
|
||||
gi_constant_info_get_value (GIConstantInfo *info,
|
||||
GIArgument *value)
|
||||
{
|
||||
|
@ -50,6 +50,6 @@ void gi_constant_info_free_value (GIConstantInfo *info,
|
||||
GIArgument *value);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_constant_info_get_value (GIConstantInfo *info,
|
||||
gsize gi_constant_info_get_value (GIConstantInfo *info,
|
||||
GIArgument *value);
|
||||
G_END_DECLS
|
||||
|
@ -54,7 +54,7 @@
|
||||
*
|
||||
* Returns: the number of enumeration values
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_enum_info_get_n_values (GIEnumInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -108,7 +108,7 @@ gi_enum_info_get_error_domain (GIEnumInfo *info)
|
||||
*/
|
||||
GIValueInfo *
|
||||
gi_enum_info_get_value (GIEnumInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
Header *header;
|
||||
@ -133,7 +133,7 @@ gi_enum_info_get_value (GIEnumInfo *info,
|
||||
* Returns: number of methods
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_enum_info_get_n_methods (GIEnumInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -160,7 +160,7 @@ gi_enum_info_get_n_methods (GIEnumInfo *info)
|
||||
*/
|
||||
GIFunctionInfo *
|
||||
gi_enum_info_get_method (GIEnumInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
|
@ -53,18 +53,18 @@ G_BEGIN_DECLS
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_enum_info_get_n_values (GIEnumInfo *info);
|
||||
guint gi_enum_info_get_n_values (GIEnumInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIValueInfo * gi_enum_info_get_value (GIEnumInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_enum_info_get_n_methods (GIEnumInfo *info);
|
||||
guint gi_enum_info_get_n_methods (GIEnumInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_enum_info_get_method (GIEnumInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GITypeTag gi_enum_info_get_storage_type (GIEnumInfo *info);
|
||||
|
@ -95,7 +95,7 @@ gi_field_info_get_flags (GIFieldInfo *info)
|
||||
* Returns: the field size, in bits
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
gsize
|
||||
gi_field_info_get_size (GIFieldInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -119,7 +119,7 @@ gi_field_info_get_size (GIFieldInfo *info)
|
||||
* Returns: the field offset, in bytes
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
gsize
|
||||
gi_field_info_get_offset (GIFieldInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
|
@ -48,10 +48,10 @@ GI_AVAILABLE_IN_ALL
|
||||
GIFieldInfoFlags gi_field_info_get_flags (GIFieldInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_field_info_get_size (GIFieldInfo *info);
|
||||
gsize gi_field_info_get_size (GIFieldInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_field_info_get_offset (GIFieldInfo *info);
|
||||
gsize gi_field_info_get_offset (GIFieldInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GITypeInfo * gi_field_info_get_type_info (GIFieldInfo *info);
|
||||
|
@ -51,15 +51,14 @@
|
||||
GIFunctionInfo *
|
||||
gi_base_info_find_method (GIBaseInfo *base,
|
||||
guint32 offset,
|
||||
gint n_methods,
|
||||
guint n_methods,
|
||||
const gchar *name)
|
||||
{
|
||||
/* FIXME hash */
|
||||
GIRealInfo *rinfo = (GIRealInfo*)base;
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < n_methods; i++)
|
||||
for (guint i = 0; i < n_methods; i++)
|
||||
{
|
||||
FunctionBlob *fblob = (FunctionBlob *)&rinfo->typelib->data[offset];
|
||||
const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name];
|
||||
@ -256,9 +255,9 @@ gi_invoke_error_quark (void)
|
||||
gboolean
|
||||
gi_function_info_invoke (GIFunctionInfo *info,
|
||||
const GIArgument *in_args,
|
||||
int n_in_args,
|
||||
gsize n_in_args,
|
||||
const GIArgument *out_args,
|
||||
int n_out_args,
|
||||
gsize n_out_args,
|
||||
GIArgument *return_value,
|
||||
GError **error)
|
||||
{
|
||||
|
@ -87,9 +87,9 @@ typedef enum
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_function_info_invoke (GIFunctionInfo *info,
|
||||
const GIArgument *in_args,
|
||||
int n_in_args,
|
||||
gsize n_in_args,
|
||||
const GIArgument *out_args,
|
||||
int n_out_args,
|
||||
gsize n_out_args,
|
||||
GIArgument *return_value,
|
||||
GError **error);
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
||||
*
|
||||
* Returns: number of prerequisites
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -79,7 +79,7 @@ gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
|
||||
*/
|
||||
GIBaseInfo *
|
||||
gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
InterfaceBlob *blob;
|
||||
@ -102,7 +102,7 @@ gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
|
||||
*
|
||||
* Returns: number of properties
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_interface_info_get_n_properties (GIInterfaceInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -128,7 +128,7 @@ gi_interface_info_get_n_properties (GIInterfaceInfo *info)
|
||||
*/
|
||||
GIPropertyInfo *
|
||||
gi_interface_info_get_property (GIInterfaceInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -157,7 +157,7 @@ gi_interface_info_get_property (GIInterfaceInfo *info,
|
||||
*
|
||||
* Returns: number of methods
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_interface_info_get_n_methods (GIInterfaceInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -183,7 +183,7 @@ gi_interface_info_get_n_methods (GIInterfaceInfo *info)
|
||||
*/
|
||||
GIFunctionInfo *
|
||||
gi_interface_info_get_method (GIInterfaceInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -240,7 +240,7 @@ gi_interface_info_find_method (GIInterfaceInfo *info,
|
||||
*
|
||||
* Returns: number of signals
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_interface_info_get_n_signals (GIInterfaceInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -266,7 +266,7 @@ gi_interface_info_get_n_signals (GIInterfaceInfo *info)
|
||||
*/
|
||||
GISignalInfo *
|
||||
gi_interface_info_get_signal (GIInterfaceInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -304,11 +304,10 @@ GISignalInfo *
|
||||
gi_interface_info_find_signal (GIInterfaceInfo *info,
|
||||
const gchar *name)
|
||||
{
|
||||
gint n_signals;
|
||||
gint i;
|
||||
guint n_signals;
|
||||
|
||||
n_signals = gi_interface_info_get_n_signals (info);
|
||||
for (i = 0; i < n_signals; i++)
|
||||
for (guint i = 0; i < n_signals; i++)
|
||||
{
|
||||
GISignalInfo *siginfo = gi_interface_info_get_signal (info, i);
|
||||
|
||||
@ -331,7 +330,7 @@ gi_interface_info_find_signal (GIInterfaceInfo *info,
|
||||
*
|
||||
* Returns: number of virtual functions
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -357,7 +356,7 @@ gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
|
||||
*/
|
||||
GIVFuncInfo *
|
||||
gi_interface_info_get_vfunc (GIInterfaceInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -424,7 +423,7 @@ gi_interface_info_find_vfunc (GIInterfaceInfo *info,
|
||||
*
|
||||
* Returns: number of constants
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_interface_info_get_n_constants (GIInterfaceInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -450,7 +449,7 @@ gi_interface_info_get_n_constants (GIInterfaceInfo *info)
|
||||
*/
|
||||
GIConstantInfo *
|
||||
gi_interface_info_get_constant (GIInterfaceInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
|
@ -43,58 +43,58 @@ G_BEGIN_DECLS
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info);
|
||||
guint gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIBaseInfo * gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_interface_info_get_n_properties (GIInterfaceInfo *info);
|
||||
guint gi_interface_info_get_n_properties (GIInterfaceInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIPropertyInfo * gi_interface_info_get_property (GIInterfaceInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_interface_info_get_n_methods (GIInterfaceInfo *info);
|
||||
guint gi_interface_info_get_n_methods (GIInterfaceInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_interface_info_get_method (GIInterfaceInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_interface_info_find_method (GIInterfaceInfo *info,
|
||||
const gchar *name);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_interface_info_get_n_signals (GIInterfaceInfo *info);
|
||||
guint gi_interface_info_get_n_signals (GIInterfaceInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GISignalInfo * gi_interface_info_get_signal (GIInterfaceInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GISignalInfo * gi_interface_info_find_signal (GIInterfaceInfo *info,
|
||||
const gchar *name);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info);
|
||||
guint gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIVFuncInfo * gi_interface_info_get_vfunc (GIInterfaceInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIVFuncInfo * gi_interface_info_find_vfunc (GIInterfaceInfo *info,
|
||||
const gchar *name);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_interface_info_get_n_constants (GIInterfaceInfo *info);
|
||||
guint gi_interface_info_get_n_constants (GIInterfaceInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIConstantInfo * gi_interface_info_get_constant (GIInterfaceInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
|
@ -60,19 +60,18 @@
|
||||
*/
|
||||
static gint32
|
||||
gi_object_info_get_field_offset (GIObjectInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
guint32 offset;
|
||||
gint i;
|
||||
FieldBlob *field_blob;
|
||||
|
||||
offset = rinfo->offset + header->object_blob_size
|
||||
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
for (guint i = 0; i < n; i++)
|
||||
{
|
||||
field_blob = (FieldBlob *)&rinfo->typelib->data[offset];
|
||||
offset += header->field_blob_size;
|
||||
@ -204,7 +203,7 @@ gi_object_info_get_type_name (GIObjectInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_object_info_get_type_init:
|
||||
* gi_object_info_get_type_init_function_name:
|
||||
* @info: a #GIObjectInfo
|
||||
*
|
||||
* Obtain the function which when called will return the GType
|
||||
@ -213,7 +212,7 @@ gi_object_info_get_type_name (GIObjectInfo *info)
|
||||
* Returns: the type init function
|
||||
*/
|
||||
const gchar *
|
||||
gi_object_info_get_type_init (GIObjectInfo *info)
|
||||
gi_object_info_get_type_init_function_name (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ObjectBlob *blob;
|
||||
@ -234,7 +233,7 @@ gi_object_info_get_type_init (GIObjectInfo *info)
|
||||
*
|
||||
* Returns: number of interfaces
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_object_info_get_n_interfaces (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -260,7 +259,7 @@ gi_object_info_get_n_interfaces (GIObjectInfo *info)
|
||||
*/
|
||||
GIInterfaceInfo *
|
||||
gi_object_info_get_interface (GIObjectInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ObjectBlob *blob;
|
||||
@ -282,7 +281,7 @@ gi_object_info_get_interface (GIObjectInfo *info,
|
||||
*
|
||||
* Returns: number of fields
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_object_info_get_n_fields (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -308,7 +307,7 @@ gi_object_info_get_n_fields (GIObjectInfo *info)
|
||||
*/
|
||||
GIFieldInfo *
|
||||
gi_object_info_get_field (GIObjectInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -329,7 +328,7 @@ gi_object_info_get_field (GIObjectInfo *info,
|
||||
*
|
||||
* Returns: number of properties
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_object_info_get_n_properties (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -354,7 +353,7 @@ gi_object_info_get_n_properties (GIObjectInfo *info)
|
||||
*/
|
||||
GIPropertyInfo *
|
||||
gi_object_info_get_property (GIObjectInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -385,7 +384,7 @@ gi_object_info_get_property (GIObjectInfo *info,
|
||||
*
|
||||
* Returns: number of methods
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_object_info_get_n_methods (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -411,7 +410,7 @@ gi_object_info_get_n_methods (GIObjectInfo *info)
|
||||
*/
|
||||
GIFunctionInfo *
|
||||
gi_object_info_get_method (GIObjectInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -536,7 +535,7 @@ gi_object_info_find_method_using_interfaces (GIObjectInfo *info,
|
||||
*
|
||||
* Returns: number of signals
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_object_info_get_n_signals (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -562,7 +561,7 @@ gi_object_info_get_n_signals (GIObjectInfo *info)
|
||||
*/
|
||||
GISignalInfo *
|
||||
gi_object_info_get_signal (GIObjectInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -600,11 +599,10 @@ GISignalInfo *
|
||||
gi_object_info_find_signal (GIObjectInfo *info,
|
||||
const gchar *name)
|
||||
{
|
||||
gint n_signals;
|
||||
gint i;
|
||||
guint n_signals;
|
||||
|
||||
n_signals = gi_object_info_get_n_signals (info);
|
||||
for (i = 0; i < n_signals; i++)
|
||||
for (guint i = 0; i < n_signals; i++)
|
||||
{
|
||||
GISignalInfo *siginfo = gi_object_info_get_signal (info, i);
|
||||
|
||||
@ -628,7 +626,7 @@ gi_object_info_find_signal (GIObjectInfo *info,
|
||||
*
|
||||
* Returns: number of virtual functions
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_object_info_get_n_vfuncs (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -654,7 +652,7 @@ gi_object_info_get_n_vfuncs (GIObjectInfo *info)
|
||||
*/
|
||||
GIVFuncInfo *
|
||||
gi_object_info_get_vfunc (GIObjectInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -790,7 +788,7 @@ gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
|
||||
*
|
||||
* Returns: number of constants
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_object_info_get_n_constants (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -816,7 +814,7 @@ gi_object_info_get_n_constants (GIObjectInfo *info)
|
||||
*/
|
||||
GIConstantInfo *
|
||||
gi_object_info_get_constant (GIObjectInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -906,18 +904,18 @@ _get_func(GIObjectInfo *info,
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_object_info_get_ref_function:
|
||||
* gi_object_info_get_ref_function_name:
|
||||
* @info: a #GIObjectInfo
|
||||
*
|
||||
* Obtain the symbol name of the function that should be called to ref this
|
||||
* object type. It's mainly used fundamental types. The type signature for
|
||||
* the symbol is %GIObjectInfoRefFunction, to fetch the function pointer
|
||||
* see gi_object_info_get_ref_function().
|
||||
* see gi_object_info_get_ref_function_name().
|
||||
*
|
||||
* Returns: (nullable): the symbol or %NULL
|
||||
*/
|
||||
const char *
|
||||
gi_object_info_get_ref_function (GIObjectInfo *info)
|
||||
gi_object_info_get_ref_function_name (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ObjectBlob *blob;
|
||||
@ -950,22 +948,22 @@ gi_object_info_get_ref_function_pointer (GIObjectInfo *info)
|
||||
g_return_val_if_fail (info != NULL, NULL);
|
||||
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
|
||||
|
||||
return (GIObjectInfoRefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_ref_function);
|
||||
return (GIObjectInfoRefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_ref_function_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_object_info_get_unref_function:
|
||||
* gi_object_info_get_unref_function_name:
|
||||
* @info: a #GIObjectInfo
|
||||
*
|
||||
* Obtain the symbol name of the function that should be called to unref this
|
||||
* object type. It's mainly used fundamental types. The type signature for
|
||||
* the symbol is %GIObjectInfoUnrefFunction, to fetch the function pointer
|
||||
* see gi_object_info_get_unref_function().
|
||||
* see gi_object_info_get_unref_function_name().
|
||||
*
|
||||
* Returns: (nullable): the symbol or %NULL
|
||||
*/
|
||||
const char *
|
||||
gi_object_info_get_unref_function (GIObjectInfo *info)
|
||||
gi_object_info_get_unref_function_name (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ObjectBlob *blob;
|
||||
@ -998,23 +996,23 @@ gi_object_info_get_unref_function_pointer (GIObjectInfo *info)
|
||||
g_return_val_if_fail (info != NULL, NULL);
|
||||
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
|
||||
|
||||
return (GIObjectInfoUnrefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_unref_function);
|
||||
return (GIObjectInfoUnrefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_unref_function_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_object_info_get_set_value_function:
|
||||
* gi_object_info_get_set_value_function_name:
|
||||
* @info: a #GIObjectInfo
|
||||
*
|
||||
* Obtain the symbol name of the function that should be called to convert
|
||||
* set a GValue giving an object instance pointer of this object type.
|
||||
* I's mainly used fundamental types. The type signature for the symbol
|
||||
* is %GIObjectInfoSetValueFunction, to fetch the function pointer
|
||||
* see gi_object_info_get_set_value_function().
|
||||
* see gi_object_info_get_set_value_function_name().
|
||||
*
|
||||
* Returns: (nullable): the symbol or %NULL
|
||||
*/
|
||||
const char *
|
||||
gi_object_info_get_set_value_function (GIObjectInfo *info)
|
||||
gi_object_info_get_set_value_function_name (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ObjectBlob *blob;
|
||||
@ -1047,23 +1045,23 @@ gi_object_info_get_set_value_function_pointer (GIObjectInfo *info)
|
||||
g_return_val_if_fail (info != NULL, NULL);
|
||||
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
|
||||
|
||||
return (GIObjectInfoSetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_set_value_function);
|
||||
return (GIObjectInfoSetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_set_value_function_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_object_info_get_get_value_function:
|
||||
* gi_object_info_get_get_value_function_name:
|
||||
* @info: a #GIObjectInfo
|
||||
*
|
||||
* Obtain the symbol name of the function that should be called to convert
|
||||
* an object instance pointer of this object type to a GValue.
|
||||
* I's mainly used fundamental types. The type signature for the symbol
|
||||
* is %GIObjectInfoGetValueFunction, to fetch the function pointer
|
||||
* see gi_object_info_get_get_value_function().
|
||||
* see gi_object_info_get_get_value_function_name().
|
||||
*
|
||||
* Returns: (nullable): the symbol or %NULL
|
||||
*/
|
||||
const char *
|
||||
gi_object_info_get_get_value_function (GIObjectInfo *info)
|
||||
gi_object_info_get_get_value_function_name (GIObjectInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
ObjectBlob *blob;
|
||||
@ -1096,7 +1094,7 @@ gi_object_info_get_get_value_function_pointer (GIObjectInfo *info)
|
||||
g_return_val_if_fail (info != NULL, NULL);
|
||||
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
|
||||
|
||||
return (GIObjectInfoGetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_get_value_function);
|
||||
return (GIObjectInfoGetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_get_value_function_name);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -83,7 +83,7 @@ GI_AVAILABLE_IN_ALL
|
||||
const gchar * gi_object_info_get_type_name (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const gchar * gi_object_info_get_type_init (GIObjectInfo *info);
|
||||
const gchar * gi_object_info_get_type_init_function_name (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_object_info_get_abstract (GIObjectInfo *info);
|
||||
@ -98,32 +98,32 @@ GI_AVAILABLE_IN_ALL
|
||||
GIObjectInfo * gi_object_info_get_parent (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_object_info_get_n_interfaces (GIObjectInfo *info);
|
||||
guint gi_object_info_get_n_interfaces (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIInterfaceInfo * gi_object_info_get_interface (GIObjectInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_object_info_get_n_fields (GIObjectInfo *info);
|
||||
guint gi_object_info_get_n_fields (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFieldInfo * gi_object_info_get_field (GIObjectInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_object_info_get_n_properties (GIObjectInfo *info);
|
||||
guint gi_object_info_get_n_properties (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIPropertyInfo * gi_object_info_get_property (GIObjectInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_object_info_get_n_methods (GIObjectInfo *info);
|
||||
guint gi_object_info_get_n_methods (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_object_info_get_method (GIObjectInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_object_info_find_method (GIObjectInfo *info,
|
||||
@ -137,11 +137,11 @@ GIFunctionInfo * gi_object_info_find_method_using_interfaces (GIObjectInfo *in
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_object_info_get_n_signals (GIObjectInfo *info);
|
||||
guint gi_object_info_get_n_signals (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GISignalInfo * gi_object_info_get_signal (GIObjectInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
@ -150,11 +150,11 @@ GISignalInfo * gi_object_info_find_signal (GIObjectInfo *info,
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_object_info_get_n_vfuncs (GIObjectInfo *info);
|
||||
guint gi_object_info_get_n_vfuncs (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIVFuncInfo * gi_object_info_get_vfunc (GIObjectInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIVFuncInfo * gi_object_info_find_vfunc (GIObjectInfo *info,
|
||||
@ -166,39 +166,39 @@ GIVFuncInfo * gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *inf
|
||||
GIObjectInfo **implementor);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_object_info_get_n_constants (GIObjectInfo *info);
|
||||
guint gi_object_info_get_n_constants (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIConstantInfo * gi_object_info_get_constant (GIObjectInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIStructInfo * gi_object_info_get_class_struct (GIObjectInfo *info);
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const char * gi_object_info_get_ref_function (GIObjectInfo *info);
|
||||
const char * gi_object_info_get_ref_function_name (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIObjectInfoRefFunction gi_object_info_get_ref_function_pointer (GIObjectInfo *info);
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const char * gi_object_info_get_unref_function (GIObjectInfo *info);
|
||||
const char * gi_object_info_get_unref_function_name (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIObjectInfoUnrefFunction gi_object_info_get_unref_function_pointer (GIObjectInfo *info);
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const char * gi_object_info_get_set_value_function (GIObjectInfo *info);
|
||||
const char * gi_object_info_get_set_value_function_name (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIObjectInfoSetValueFunction gi_object_info_get_set_value_function_pointer (GIObjectInfo *info);
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const char * gi_object_info_get_get_value_function (GIObjectInfo *info);
|
||||
const char * gi_object_info_get_get_value_function_name (GIObjectInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIObjectInfoGetValueFunction gi_object_info_get_get_value_function_pointer (GIObjectInfo *info);
|
||||
|
@ -78,7 +78,7 @@ gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_registered_type_info_get_type_init:
|
||||
* gi_registered_type_info_get_type_init_function_name:
|
||||
* @info: a #GIRegisteredTypeInfo
|
||||
*
|
||||
* Obtain the type init function for @info. The type init function is the
|
||||
@ -90,7 +90,7 @@ gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
|
||||
* passing into g_module_symbol().
|
||||
*/
|
||||
const gchar *
|
||||
gi_registered_type_info_get_type_init (GIRegisteredTypeInfo *info)
|
||||
gi_registered_type_info_get_type_init_function_name (GIRegisteredTypeInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
RegisteredTypeBlob *blob;
|
||||
@ -127,7 +127,7 @@ gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info)
|
||||
g_return_val_if_fail (info != NULL, G_TYPE_INVALID);
|
||||
g_return_val_if_fail (GI_IS_REGISTERED_TYPE_INFO (info), G_TYPE_INVALID);
|
||||
|
||||
type_init = gi_registered_type_info_get_type_init (info);
|
||||
type_init = gi_registered_type_info_get_type_init_function_name (info);
|
||||
|
||||
if (type_init == NULL)
|
||||
return G_TYPE_NONE;
|
||||
|
@ -53,7 +53,7 @@ GI_AVAILABLE_IN_ALL
|
||||
const gchar * gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const gchar * gi_registered_type_info_get_type_init (GIRegisteredTypeInfo *info);
|
||||
const gchar * gi_registered_type_info_get_type_init_function_name (GIRegisteredTypeInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GType gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info);
|
||||
|
@ -238,10 +238,10 @@ void gi_type_info_init (GIBaseInfo *info,
|
||||
|
||||
GIFunctionInfo * gi_base_info_find_method (GIBaseInfo *base,
|
||||
guint32 offset,
|
||||
gint n_methods,
|
||||
guint n_methods,
|
||||
const gchar *name);
|
||||
|
||||
GIVFuncInfo * gi_base_info_find_vfunc (GIRealInfo *rinfo,
|
||||
guint32 offset,
|
||||
gint n_vfuncs,
|
||||
guint n_vfuncs,
|
||||
const gchar *name);
|
||||
|
@ -719,12 +719,12 @@ gi_repository_new (void)
|
||||
*
|
||||
* Returns: number of metadata entries
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_repository_get_n_infos (GIRepository *repository,
|
||||
const gchar *namespace)
|
||||
{
|
||||
GITypelib *typelib;
|
||||
gint n_interfaces = 0;
|
||||
guint n_interfaces = 0;
|
||||
|
||||
g_return_val_if_fail (namespace != NULL, -1);
|
||||
|
||||
@ -744,7 +744,7 @@ gi_repository_get_n_infos (GIRepository *repository,
|
||||
* @repository: (allow-none): A #GIRepository or %NULL for the singleton
|
||||
* process-global default #GIRepository
|
||||
* @namespace_: Namespace to inspect
|
||||
* @index: 0-based offset into namespace metadata for entry
|
||||
* @idx: 0-based offset into namespace metadata for entry
|
||||
*
|
||||
* This function returns a particular metadata entry in the
|
||||
* given namespace @namespace_. The namespace must have
|
||||
@ -757,7 +757,7 @@ gi_repository_get_n_infos (GIRepository *repository,
|
||||
GIBaseInfo *
|
||||
gi_repository_get_info (GIRepository *repository,
|
||||
const gchar *namespace,
|
||||
gint index)
|
||||
guint idx)
|
||||
{
|
||||
GITypelib *typelib;
|
||||
DirEntry *entry;
|
||||
@ -770,7 +770,7 @@ gi_repository_get_info (GIRepository *repository,
|
||||
|
||||
g_return_val_if_fail (typelib != NULL, NULL);
|
||||
|
||||
entry = gi_typelib_get_dir_entry (typelib, index + 1);
|
||||
entry = gi_typelib_get_dir_entry (typelib, idx + 1);
|
||||
if (entry == NULL)
|
||||
return NULL;
|
||||
return gi_info_new_full (entry->blob_type,
|
||||
@ -1026,7 +1026,7 @@ gi_repository_find_by_error_domain (GIRepository *repository,
|
||||
void
|
||||
gi_repository_get_object_gtype_interfaces (GIRepository *repository,
|
||||
GType gtype,
|
||||
guint *n_interfaces_out,
|
||||
gsize *n_interfaces_out,
|
||||
GIInterfaceInfo ***interfaces_out)
|
||||
{
|
||||
GTypeInterfaceCache *cache;
|
||||
@ -1740,8 +1740,11 @@ gi_repository_introspect_cb (const char *option_name,
|
||||
GError **error)
|
||||
{
|
||||
GError *tmp_error = NULL;
|
||||
gboolean ret = gi_repository_dump (value, &tmp_error);
|
||||
if (!ret)
|
||||
char **args;
|
||||
|
||||
args = g_strsplit (value, ",", 2);
|
||||
|
||||
if (!gi_repository_dump (args[0], args[1], &tmp_error))
|
||||
{
|
||||
g_error ("Failed to extract GType data: %s",
|
||||
tmp_error->message);
|
||||
|
@ -168,17 +168,17 @@ GIBaseInfo * gi_repository_find_by_gtype (GIRepository *repository,
|
||||
GI_AVAILABLE_IN_ALL
|
||||
void gi_repository_get_object_gtype_interfaces (GIRepository *repository,
|
||||
GType gtype,
|
||||
guint *n_interfaces_out,
|
||||
gsize *n_interfaces_out,
|
||||
GIInterfaceInfo ***interfaces_out);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_repository_get_n_infos (GIRepository *repository,
|
||||
guint gi_repository_get_n_infos (GIRepository *repository,
|
||||
const gchar *namespace_);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIBaseInfo * gi_repository_get_info (GIRepository *repository,
|
||||
const gchar *namespace_,
|
||||
gint index);
|
||||
guint idx);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIEnumInfo * gi_repository_find_by_error_domain (GIRepository *repository,
|
||||
@ -203,7 +203,9 @@ GOptionGroup * gi_repository_get_option_group (void);
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_repository_dump (const char *arg, GError **error);
|
||||
gboolean gi_repository_dump (const char *input_filename,
|
||||
const char *output_filename,
|
||||
GError **error);
|
||||
|
||||
/**
|
||||
* GIRepositoryError:
|
||||
|
@ -244,7 +244,8 @@ write_type_info (const gchar *ns,
|
||||
}
|
||||
else if (tag == GI_TYPE_TAG_ARRAY)
|
||||
{
|
||||
gint length, size;
|
||||
gint length;
|
||||
gssize size;
|
||||
const char *name = NULL;
|
||||
|
||||
xml_start_element (file, "array");
|
||||
@ -270,13 +271,13 @@ write_type_info (const gchar *ns,
|
||||
|
||||
type = gi_type_info_get_param_type (info, 0);
|
||||
|
||||
length = gi_type_info_get_array_length (info);
|
||||
length = gi_type_info_get_array_length_index (info);
|
||||
if (length >= 0)
|
||||
xml_printf (file, " length=\"%d\"", length);
|
||||
|
||||
size = gi_type_info_get_array_fixed_size (info);
|
||||
if (size >= 0)
|
||||
xml_printf (file, " fixed-size=\"%d\"", size);
|
||||
xml_printf (file, " fixed-size=\"%" G_GSSIZE_FORMAT "\"", size);
|
||||
|
||||
if (gi_type_info_is_zero_terminated (info))
|
||||
xml_printf (file, " zero-terminated=\"1\"");
|
||||
@ -352,7 +353,7 @@ write_attributes (Xml *file,
|
||||
GIBaseInfo *info)
|
||||
{
|
||||
GIAttributeIter iter = { 0, };
|
||||
char *name, *value;
|
||||
const char *name, *value;
|
||||
|
||||
while (gi_base_info_iterate_attributes (info, &iter, &name, &value))
|
||||
{
|
||||
@ -367,7 +368,7 @@ write_return_value_attributes (Xml *file,
|
||||
GICallableInfo *info)
|
||||
{
|
||||
GIAttributeIter iter = { 0, };
|
||||
char *name, *value;
|
||||
const char *name, *value;
|
||||
|
||||
while (gi_callable_info_iterate_return_attributes (info, &iter, &name, &value))
|
||||
{
|
||||
@ -461,7 +462,6 @@ write_callable_info (const gchar *ns,
|
||||
Xml *file)
|
||||
{
|
||||
GITypeInfo *type;
|
||||
gint i;
|
||||
|
||||
if (gi_callable_info_can_throw_gerror (info))
|
||||
xml_printf (file, " throws=\"1\"");
|
||||
@ -490,7 +490,7 @@ write_callable_info (const gchar *ns,
|
||||
return;
|
||||
|
||||
xml_start_element (file, "parameters");
|
||||
for (i = 0; i < gi_callable_info_get_n_args (info); i++)
|
||||
for (guint i = 0; i < gi_callable_info_get_n_args (info); i++)
|
||||
{
|
||||
GIArgInfo *arg = gi_callable_info_get_arg (info, i);
|
||||
|
||||
@ -544,11 +544,11 @@ write_callable_info (const gchar *ns,
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
if (gi_arg_info_get_closure (arg) >= 0)
|
||||
xml_printf (file, " closure=\"%d\"", gi_arg_info_get_closure (arg));
|
||||
if (gi_arg_info_get_closure_index (arg) >= 0)
|
||||
xml_printf (file, " closure=\"%d\"", gi_arg_info_get_closure_index (arg));
|
||||
|
||||
if (gi_arg_info_get_destroy (arg) >= 0)
|
||||
xml_printf (file, " destroy=\"%d\"", gi_arg_info_get_destroy (arg));
|
||||
if (gi_arg_info_get_destroy_index (arg) >= 0)
|
||||
xml_printf (file, " destroy=\"%d\"", gi_arg_info_get_destroy_index (arg));
|
||||
|
||||
if (gi_arg_info_is_skip (arg))
|
||||
xml_printf (file, " skip=\"1\"");
|
||||
@ -651,15 +651,14 @@ write_struct_info (const gchar *ns,
|
||||
gboolean deprecated;
|
||||
gboolean is_gtype_struct;
|
||||
gboolean foreign;
|
||||
gint i;
|
||||
gint size;
|
||||
int n_elts;
|
||||
guint n_elts;
|
||||
|
||||
name = gi_base_info_get_name ((GIBaseInfo *)info);
|
||||
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
|
||||
|
||||
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
|
||||
|
||||
if (gi_base_info_get_info_type ((GIBaseInfo *) info) == GI_INFO_TYPE_BOXED)
|
||||
{
|
||||
@ -682,11 +681,11 @@ write_struct_info (const gchar *ns,
|
||||
if (is_gtype_struct)
|
||||
xml_printf (file, " glib:is-gtype-struct=\"1\"");
|
||||
|
||||
func = gi_struct_info_get_copy_function (info);
|
||||
func = gi_struct_info_get_copy_function_name (info);
|
||||
if (func)
|
||||
xml_printf (file, " copy-function=\"%s\"", func);
|
||||
|
||||
func = gi_struct_info_get_free_function (info);
|
||||
func = gi_struct_info_get_free_function_name (info);
|
||||
if (func)
|
||||
xml_printf (file, " free-function=\"%s\"", func);
|
||||
|
||||
@ -703,14 +702,14 @@ write_struct_info (const gchar *ns,
|
||||
n_elts = gi_struct_info_get_n_fields (info) + gi_struct_info_get_n_methods (info);
|
||||
if (n_elts > 0)
|
||||
{
|
||||
for (i = 0; i < gi_struct_info_get_n_fields (info); i++)
|
||||
for (guint i = 0; i < gi_struct_info_get_n_fields (info); i++)
|
||||
{
|
||||
GIFieldInfo *field = gi_struct_info_get_field (info, i);
|
||||
write_field_info (ns, field, NULL, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)field);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_struct_info_get_n_methods (info); i++)
|
||||
for (guint i = 0; i < gi_struct_info_get_n_methods (info); i++)
|
||||
{
|
||||
GIFunctionInfo *function = gi_struct_info_get_method (info, i);
|
||||
write_function_info (ns, function, file);
|
||||
@ -840,13 +839,12 @@ write_enum_info (const gchar *ns,
|
||||
const gchar *type_init;
|
||||
const gchar *error_domain;
|
||||
gboolean deprecated;
|
||||
gint i;
|
||||
|
||||
name = gi_base_info_get_name ((GIBaseInfo *)info);
|
||||
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
|
||||
|
||||
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
|
||||
error_domain = gi_enum_info_get_error_domain (info);
|
||||
|
||||
if (gi_base_info_get_info_type ((GIBaseInfo *) info) == GI_INFO_TYPE_ENUM)
|
||||
@ -865,7 +863,7 @@ write_enum_info (const gchar *ns,
|
||||
|
||||
write_attributes (file, (GIBaseInfo*) info);
|
||||
|
||||
for (i = 0; i < gi_enum_info_get_n_values (info); i++)
|
||||
for (guint i = 0; i < gi_enum_info_get_n_values (info); i++)
|
||||
{
|
||||
GIValueInfo *value = gi_enum_info_get_value (info, i);
|
||||
write_value_info (ns, value, file);
|
||||
@ -1042,7 +1040,6 @@ write_object_info (const gchar *ns,
|
||||
gboolean is_final;
|
||||
GIObjectInfo *pnode;
|
||||
GIStructInfo *class_struct;
|
||||
gint i;
|
||||
|
||||
name = gi_base_info_get_name ((GIBaseInfo *)info);
|
||||
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
|
||||
@ -1051,7 +1048,7 @@ write_object_info (const gchar *ns,
|
||||
is_final = gi_object_info_get_final (info);
|
||||
|
||||
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
|
||||
xml_start_element (file, "class");
|
||||
xml_printf (file, " name=\"%s\"", name);
|
||||
|
||||
@ -1080,19 +1077,19 @@ write_object_info (const gchar *ns,
|
||||
if (is_fundamental)
|
||||
xml_printf (file, " glib:fundamental=\"1\"");
|
||||
|
||||
func = gi_object_info_get_unref_function (info);
|
||||
func = gi_object_info_get_unref_function_name (info);
|
||||
if (func)
|
||||
xml_printf (file, " glib:unref-function=\"%s\"", func);
|
||||
|
||||
func = gi_object_info_get_ref_function (info);
|
||||
func = gi_object_info_get_ref_function_name (info);
|
||||
if (func)
|
||||
xml_printf (file, " glib:ref-function=\"%s\"", func);
|
||||
|
||||
func = gi_object_info_get_set_value_function (info);
|
||||
func = gi_object_info_get_set_value_function_name (info);
|
||||
if (func)
|
||||
xml_printf (file, " glib:set-value-function=\"%s\"", func);
|
||||
|
||||
func = gi_object_info_get_get_value_function (info);
|
||||
func = gi_object_info_get_get_value_function_name (info);
|
||||
if (func)
|
||||
xml_printf (file, " glib:get-value-function=\"%s\"", func);
|
||||
|
||||
@ -1103,7 +1100,7 @@ write_object_info (const gchar *ns,
|
||||
|
||||
if (gi_object_info_get_n_interfaces (info) > 0)
|
||||
{
|
||||
for (i = 0; i < gi_object_info_get_n_interfaces (info); i++)
|
||||
for (guint i = 0; i < gi_object_info_get_n_interfaces (info); i++)
|
||||
{
|
||||
GIInterfaceInfo *imp = gi_object_info_get_interface (info, i);
|
||||
xml_start_element (file, "implements");
|
||||
@ -1113,42 +1110,42 @@ write_object_info (const gchar *ns,
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_object_info_get_n_fields (info); i++)
|
||||
for (guint i = 0; i < gi_object_info_get_n_fields (info); i++)
|
||||
{
|
||||
GIFieldInfo *field = gi_object_info_get_field (info, i);
|
||||
write_field_info (ns, field, NULL, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)field);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_object_info_get_n_methods (info); i++)
|
||||
for (guint i = 0; i < gi_object_info_get_n_methods (info); i++)
|
||||
{
|
||||
GIFunctionInfo *function = gi_object_info_get_method (info, i);
|
||||
write_function_info (ns, function, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)function);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_object_info_get_n_properties (info); i++)
|
||||
for (guint i = 0; i < gi_object_info_get_n_properties (info); i++)
|
||||
{
|
||||
GIPropertyInfo *prop = gi_object_info_get_property (info, i);
|
||||
write_property_info (ns, prop, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)prop);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_object_info_get_n_signals (info); i++)
|
||||
for (guint i = 0; i < gi_object_info_get_n_signals (info); i++)
|
||||
{
|
||||
GISignalInfo *signal = gi_object_info_get_signal (info, i);
|
||||
write_signal_info (ns, signal, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)signal);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_object_info_get_n_vfuncs (info); i++)
|
||||
for (guint i = 0; i < gi_object_info_get_n_vfuncs (info); i++)
|
||||
{
|
||||
GIVFuncInfo *vfunc = gi_object_info_get_vfunc (info, i);
|
||||
write_vfunc_info (ns, vfunc, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)vfunc);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_object_info_get_n_constants (info); i++)
|
||||
for (guint i = 0; i < gi_object_info_get_n_constants (info); i++)
|
||||
{
|
||||
GIConstantInfo *constant = gi_object_info_get_constant (info, i);
|
||||
write_constant_info (ns, constant, file);
|
||||
@ -1168,13 +1165,12 @@ write_interface_info (const gchar *ns,
|
||||
const gchar *type_init;
|
||||
GIStructInfo *class_struct;
|
||||
gboolean deprecated;
|
||||
gint i;
|
||||
|
||||
name = gi_base_info_get_name ((GIBaseInfo *)info);
|
||||
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
|
||||
|
||||
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
|
||||
xml_start_element (file, "interface");
|
||||
xml_printf (file, " name=\"%s\" glib:type-name=\"%s\" glib:get-type=\"%s\"",
|
||||
name, type_name, type_init);
|
||||
@ -1193,7 +1189,7 @@ write_interface_info (const gchar *ns,
|
||||
|
||||
if (gi_interface_info_get_n_prerequisites (info) > 0)
|
||||
{
|
||||
for (i = 0; i < gi_interface_info_get_n_prerequisites (info); i++)
|
||||
for (guint i = 0; i < gi_interface_info_get_n_prerequisites (info); i++)
|
||||
{
|
||||
GIBaseInfo *req = gi_interface_info_get_prerequisite (info, i);
|
||||
|
||||
@ -1205,35 +1201,35 @@ write_interface_info (const gchar *ns,
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_interface_info_get_n_methods (info); i++)
|
||||
for (guint i = 0; i < gi_interface_info_get_n_methods (info); i++)
|
||||
{
|
||||
GIFunctionInfo *function = gi_interface_info_get_method (info, i);
|
||||
write_function_info (ns, function, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)function);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_interface_info_get_n_properties (info); i++)
|
||||
for (guint i = 0; i < gi_interface_info_get_n_properties (info); i++)
|
||||
{
|
||||
GIPropertyInfo *prop = gi_interface_info_get_property (info, i);
|
||||
write_property_info (ns, prop, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)prop);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_interface_info_get_n_signals (info); i++)
|
||||
for (guint i = 0; i < gi_interface_info_get_n_signals (info); i++)
|
||||
{
|
||||
GISignalInfo *signal = gi_interface_info_get_signal (info, i);
|
||||
write_signal_info (ns, signal, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)signal);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_interface_info_get_n_vfuncs (info); i++)
|
||||
for (guint i = 0; i < gi_interface_info_get_n_vfuncs (info); i++)
|
||||
{
|
||||
GIVFuncInfo *vfunc = gi_interface_info_get_vfunc (info, i);
|
||||
write_vfunc_info (ns, vfunc, file);
|
||||
gi_base_info_unref ((GIBaseInfo *)vfunc);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_interface_info_get_n_constants (info); i++)
|
||||
for (guint i = 0; i < gi_interface_info_get_n_constants (info); i++)
|
||||
{
|
||||
GIConstantInfo *constant = gi_interface_info_get_constant (info, i);
|
||||
write_constant_info (ns, constant, file);
|
||||
@ -1253,14 +1249,13 @@ write_union_info (const gchar *ns,
|
||||
const gchar *type_init;
|
||||
const gchar *func;
|
||||
gboolean deprecated;
|
||||
gint i;
|
||||
gint size;
|
||||
gsize size;
|
||||
|
||||
name = gi_base_info_get_name ((GIBaseInfo *)info);
|
||||
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
|
||||
|
||||
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
||||
type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
|
||||
|
||||
xml_start_element (file, "union");
|
||||
xml_printf (file, " name=\"%s\"", name);
|
||||
@ -1272,14 +1267,14 @@ write_union_info (const gchar *ns,
|
||||
xml_printf (file, " deprecated=\"1\"");
|
||||
|
||||
size = gi_union_info_get_size (info);
|
||||
if (file->show_all && size >= 0)
|
||||
xml_printf (file, " size=\"%d\"", size);
|
||||
if (file->show_all)
|
||||
xml_printf (file, " size=\"%" G_GSIZE_FORMAT "\"", size);
|
||||
|
||||
func = gi_union_info_get_copy_function (info);
|
||||
func = gi_union_info_get_copy_function_name (info);
|
||||
if (func)
|
||||
xml_printf (file, " copy-function=\"%s\"", func);
|
||||
|
||||
func = gi_union_info_get_free_function (info);
|
||||
func = gi_union_info_get_free_function_name (info);
|
||||
if (func)
|
||||
xml_printf (file, " free-function=\"%s\"", func);
|
||||
|
||||
@ -1287,7 +1282,7 @@ write_union_info (const gchar *ns,
|
||||
|
||||
if (gi_union_info_is_discriminated (info))
|
||||
{
|
||||
gint offset;
|
||||
guint offset;
|
||||
GITypeInfo *type;
|
||||
|
||||
offset = gi_union_info_get_discriminator_offset (info);
|
||||
@ -1300,7 +1295,7 @@ write_union_info (const gchar *ns,
|
||||
gi_base_info_unref ((GIBaseInfo *)type);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_union_info_get_n_fields (info); i++)
|
||||
for (guint i = 0; i < gi_union_info_get_n_fields (info); i++)
|
||||
{
|
||||
GIFieldInfo *field = gi_union_info_get_field (info, i);
|
||||
GIConstantInfo *constant = gi_union_info_get_discriminator (info, i);
|
||||
@ -1310,7 +1305,7 @@ write_union_info (const gchar *ns,
|
||||
gi_base_info_unref ((GIBaseInfo *)constant);
|
||||
}
|
||||
|
||||
for (i = 0; i < gi_union_info_get_n_methods (info); i++)
|
||||
for (guint i = 0; i < gi_union_info_get_n_methods (info); i++)
|
||||
{
|
||||
GIFunctionInfo *function = gi_union_info_get_method (info, i);
|
||||
write_function_info (ns, function, file);
|
||||
|
@ -52,7 +52,7 @@
|
||||
*
|
||||
* Returns: number of fields
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_struct_info_get_n_fields (GIStructInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -72,15 +72,14 @@ gi_struct_info_get_n_fields (GIStructInfo *info)
|
||||
*/
|
||||
static gint32
|
||||
gi_struct_get_field_offset (GIStructInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
guint32 offset = rinfo->offset + header->struct_blob_size;
|
||||
gint i;
|
||||
FieldBlob *field_blob;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
for (guint i = 0; i < n; i++)
|
||||
{
|
||||
field_blob = (FieldBlob *)&rinfo->typelib->data[offset];
|
||||
offset += header->field_blob_size;
|
||||
@ -103,7 +102,7 @@ gi_struct_get_field_offset (GIStructInfo *info,
|
||||
*/
|
||||
GIFieldInfo *
|
||||
gi_struct_info_get_field (GIStructInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
|
||||
@ -161,7 +160,7 @@ gi_struct_info_find_field (GIStructInfo *info,
|
||||
*
|
||||
* Returns: number of methods
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_struct_info_get_n_methods (GIStructInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -182,7 +181,7 @@ gi_struct_info_get_n_methods (GIStructInfo *info)
|
||||
*/
|
||||
GIFunctionInfo *
|
||||
gi_struct_info_get_method (GIStructInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
@ -287,7 +286,7 @@ gi_struct_info_is_gtype_struct (GIStructInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_struct_info_get_copy_function:
|
||||
* gi_struct_info_get_copy_function_name:
|
||||
* @info: a struct information blob
|
||||
*
|
||||
* Retrieves the name of the copy function for @info, if any is set.
|
||||
@ -297,7 +296,7 @@ gi_struct_info_is_gtype_struct (GIStructInfo *info)
|
||||
* Since: 2.80
|
||||
*/
|
||||
const char *
|
||||
gi_struct_info_get_copy_function (GIStructInfo *info)
|
||||
gi_struct_info_get_copy_function_name (GIStructInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
StructBlob *blob;
|
||||
@ -314,7 +313,7 @@ gi_struct_info_get_copy_function (GIStructInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_struct_info_get_free_function:
|
||||
* gi_struct_info_get_free_function_name:
|
||||
* @info: a struct information blob
|
||||
*
|
||||
* Retrieves the name of the free function for @info, if any is set.
|
||||
@ -324,7 +323,7 @@ gi_struct_info_get_copy_function (GIStructInfo *info)
|
||||
* Since: 2.80
|
||||
*/
|
||||
const char *
|
||||
gi_struct_info_get_free_function (GIStructInfo *info)
|
||||
gi_struct_info_get_free_function_name (GIStructInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
StructBlob *blob;
|
||||
|
@ -43,22 +43,22 @@ G_BEGIN_DECLS
|
||||
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_struct_info_get_n_fields (GIStructInfo *info);
|
||||
guint gi_struct_info_get_n_fields (GIStructInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFieldInfo * gi_struct_info_get_field (GIStructInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFieldInfo * gi_struct_info_find_field (GIStructInfo *info,
|
||||
const gchar *name);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_struct_info_get_n_methods (GIStructInfo *info);
|
||||
guint gi_struct_info_get_n_methods (GIStructInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_struct_info_get_method (GIStructInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_struct_info_find_method (GIStructInfo *info,
|
||||
@ -77,9 +77,9 @@ GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_struct_info_is_foreign (GIStructInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const char * gi_struct_info_get_copy_function (GIStructInfo *info);
|
||||
const char * gi_struct_info_get_copy_function_name (GIStructInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const char * gi_struct_info_get_free_function (GIStructInfo *info);
|
||||
const char * gi_struct_info_get_free_function_name (GIStructInfo *info);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -135,7 +135,7 @@ gi_type_info_get_tag (GITypeInfo *info)
|
||||
*/
|
||||
GITypeInfo *
|
||||
gi_type_info_get_param_type (GITypeInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
SimpleTypeBlob *type;
|
||||
@ -226,17 +226,17 @@ gi_type_info_get_interface (GITypeInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_type_info_get_array_length:
|
||||
* gi_type_info_get_array_length_index:
|
||||
* @info: a #GITypeInfo
|
||||
*
|
||||
* Obtain the position of the argument which gives the array length of the type.
|
||||
* The type tag must be a `GI_TYPE_TAG_ARRAY` or `-1` will be returned.
|
||||
*
|
||||
* Returns: the array length, or `-1` if the type is not an array
|
||||
* Returns: the array length argument index, or `-1` if the type is not an array
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
gi_type_info_get_array_length (GITypeInfo *info)
|
||||
gi_type_info_get_array_length_index (GITypeInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
SimpleTypeBlob *type;
|
||||
@ -270,14 +270,14 @@ gi_type_info_get_array_length (GITypeInfo *info)
|
||||
* Returns: the size or `-1` if the type is not an array
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
gssize
|
||||
gi_type_info_get_array_fixed_size (GITypeInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
SimpleTypeBlob *type;
|
||||
|
||||
g_return_val_if_fail (info != NULL, 0);
|
||||
g_return_val_if_fail (GI_IS_TYPE_INFO (info), 0);
|
||||
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];
|
||||
|
||||
|
@ -90,16 +90,16 @@ GITypeTag gi_type_info_get_tag (GITypeInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GITypeInfo * gi_type_info_get_param_type (GITypeInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_type_info_get_array_length (GITypeInfo *info);
|
||||
gint gi_type_info_get_array_length_index (GITypeInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_type_info_get_array_fixed_size(GITypeInfo *info);
|
||||
gssize gi_type_info_get_array_fixed_size (GITypeInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_type_info_is_zero_terminated (GITypeInfo *info);
|
||||
|
@ -53,7 +53,7 @@
|
||||
* Returns: number of fields
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_union_info_get_n_fields (GIUnionInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -75,7 +75,7 @@ gi_union_info_get_n_fields (GIUnionInfo *info)
|
||||
*/
|
||||
GIFieldInfo *
|
||||
gi_union_info_get_field (GIUnionInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
@ -94,7 +94,7 @@ gi_union_info_get_field (GIUnionInfo *info,
|
||||
* Returns: number of methods
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_union_info_get_n_methods (GIUnionInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -116,7 +116,7 @@ gi_union_info_get_n_methods (GIUnionInfo *info)
|
||||
*/
|
||||
GIFunctionInfo *
|
||||
gi_union_info_get_method (GIUnionInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
@ -157,7 +157,7 @@ gi_union_info_is_discriminated (GIUnionInfo *info)
|
||||
* Returns: offset, in bytes, of the discriminator
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_union_info_get_discriminator_offset (GIUnionInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -201,7 +201,7 @@ gi_union_info_get_discriminator_type (GIUnionInfo *info)
|
||||
*/
|
||||
GIConstantInfo *
|
||||
gi_union_info_get_discriminator (GIUnionInfo *info,
|
||||
gint n)
|
||||
guint n)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
@ -286,7 +286,7 @@ gi_union_info_get_alignment (GIUnionInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_union_info_get_copy_function:
|
||||
* gi_union_info_get_copy_function_name:
|
||||
* @info: a union information blob
|
||||
*
|
||||
* Retrieves the name of the copy function for @info, if any is set.
|
||||
@ -296,7 +296,7 @@ gi_union_info_get_alignment (GIUnionInfo *info)
|
||||
* Since: 2.80
|
||||
*/
|
||||
const char *
|
||||
gi_union_info_get_copy_function (GIUnionInfo *info)
|
||||
gi_union_info_get_copy_function_name (GIUnionInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
UnionBlob *blob;
|
||||
@ -313,7 +313,7 @@ gi_union_info_get_copy_function (GIUnionInfo *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* gi_union_info_get_free_function:
|
||||
* gi_union_info_get_free_function_name:
|
||||
* @info: a union information blob
|
||||
*
|
||||
* Retrieves the name of the free function for @info, if any is set.
|
||||
@ -323,7 +323,7 @@ gi_union_info_get_copy_function (GIUnionInfo *info)
|
||||
* Since: 2.80
|
||||
*/
|
||||
const char *
|
||||
gi_union_info_get_free_function (GIUnionInfo *info)
|
||||
gi_union_info_get_free_function_name (GIUnionInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
UnionBlob *blob;
|
||||
|
@ -44,31 +44,31 @@ G_BEGIN_DECLS
|
||||
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_UNION)
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_union_info_get_n_fields (GIUnionInfo *info);
|
||||
guint gi_union_info_get_n_fields (GIUnionInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFieldInfo * gi_union_info_get_field (GIUnionInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_union_info_get_n_methods (GIUnionInfo *info);
|
||||
guint gi_union_info_get_n_methods (GIUnionInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_union_info_get_method (GIUnionInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_union_info_is_discriminated (GIUnionInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_union_info_get_discriminator_offset (GIUnionInfo *info);
|
||||
guint gi_union_info_get_discriminator_offset (GIUnionInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GITypeInfo * gi_union_info_get_discriminator_type (GIUnionInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIConstantInfo * gi_union_info_get_discriminator (GIUnionInfo *info,
|
||||
gint n);
|
||||
guint n);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GIFunctionInfo * gi_union_info_find_method (GIUnionInfo *info,
|
||||
@ -81,9 +81,9 @@ GI_AVAILABLE_IN_ALL
|
||||
gsize gi_union_info_get_alignment (GIUnionInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const char * gi_union_info_get_copy_function (GIUnionInfo *info);
|
||||
const char * gi_union_info_get_copy_function_name (GIUnionInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
const char * gi_union_info_get_free_function (GIUnionInfo *info);
|
||||
const char * gi_union_info_get_free_function_name (GIUnionInfo *info);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -48,14 +48,13 @@
|
||||
GIVFuncInfo *
|
||||
gi_base_info_find_vfunc (GIRealInfo *rinfo,
|
||||
guint32 offset,
|
||||
gint n_vfuncs,
|
||||
guint n_vfuncs,
|
||||
const gchar *name)
|
||||
{
|
||||
/* FIXME hash */
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < n_vfuncs; i++)
|
||||
for (guint i = 0; i < n_vfuncs; i++)
|
||||
{
|
||||
VFuncBlob *fblob = (VFuncBlob *)&rinfo->typelib->data[offset];
|
||||
const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name];
|
||||
@ -121,7 +120,7 @@ gi_vfunc_info_get_flags (GIVFuncInfo *info)
|
||||
* Returns: the struct offset or `0xFFFF` if it’s unknown
|
||||
* Since: 2.80
|
||||
*/
|
||||
gint
|
||||
guint
|
||||
gi_vfunc_info_get_offset (GIVFuncInfo *info)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
@ -337,9 +336,9 @@ gboolean
|
||||
gi_vfunc_info_invoke (GIVFuncInfo *info,
|
||||
GType implementor,
|
||||
const GIArgument *in_args,
|
||||
int n_in_args,
|
||||
gsize n_in_args,
|
||||
const GIArgument *out_args,
|
||||
int n_out_args,
|
||||
gsize n_out_args,
|
||||
GIArgument *return_value,
|
||||
GError **error)
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ GI_AVAILABLE_IN_ALL
|
||||
GIVFuncInfoFlags gi_vfunc_info_get_flags (GIVFuncInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
gint gi_vfunc_info_get_offset (GIVFuncInfo *info);
|
||||
guint gi_vfunc_info_get_offset (GIVFuncInfo *info);
|
||||
|
||||
GI_AVAILABLE_IN_ALL
|
||||
GISignalInfo * gi_vfunc_info_get_signal (GIVFuncInfo *info);
|
||||
@ -64,9 +64,9 @@ GI_AVAILABLE_IN_ALL
|
||||
gboolean gi_vfunc_info_invoke (GIVFuncInfo *info,
|
||||
GType implementor,
|
||||
const GIArgument *in_args,
|
||||
int n_in_args,
|
||||
gsize n_in_args,
|
||||
const GIArgument *out_args,
|
||||
int n_out_args,
|
||||
gsize n_out_args,
|
||||
GIArgument *return_value,
|
||||
GError **error);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user