Functions¶
Details¶
- GIRepository.arg_info_get_closure(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
index of the user data argument or -1 if there is none
- Return type:
Obtain the index of the user data argument. This is only valid for arguments which are callbacks.
- GIRepository.arg_info_get_destroy(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
index of the
GLib.DestroyNotify
argument or -1 if there is none- Return type:
Obtains the index of the
GLib.DestroyNotify
argument. This is only valid for arguments which are callbacks.
- GIRepository.arg_info_get_direction(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
the direction
- Return type:
Obtain the direction of the argument. Check
GIRepository.Direction
for possible direction values.
- GIRepository.arg_info_get_ownership_transfer(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
the transfer
- Return type:
Obtain the ownership transfer for this argument.
GIRepository.Transfer
contains a list of possible values.
- GIRepository.arg_info_get_scope(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
the scope type
- Return type:
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.
GIRepository.ScopeType
contains a list of possible values.
- GIRepository.arg_info_get_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
the #GITypeInfo holding the type information for info, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information for info.
- GIRepository.arg_info_is_caller_allocates(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
True
if caller is required to have allocated the argument- Return type:
Obtain if the argument is a pointer to a struct or object that will receive an output of a function. The default assumption for
GIRepository.Direction.OUT
arguments which have allocation is that the callee allocates; if this isTrue
, then the caller must allocate.
- GIRepository.arg_info_is_optional(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
True
if it is an optional argument- Return type:
Obtain if the argument is optional. For ‘out’ arguments this means that you can pass
None
in order to ignore the result.
- GIRepository.arg_info_is_return_value(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
True
if it is a return value- Return type:
Obtain if the argument is a return value. It can either be a parameter or a return value.
- GIRepository.arg_info_is_skip(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
True
if argument is only useful in C.- Return type:
Obtain if an argument is only useful in C.
New in version 1.30.
- GIRepository.arg_info_load_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
Initialized with information about type of info
- Return type:
type:
GIRepository.BaseInfo
Obtain information about a the type of given argument info; this function is a variant of
GIRepository.arg_info_get_type
() designed for stack allocation.The initialized type must not be referenced after info is deallocated.
- GIRepository.arg_info_may_be_null(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIArgInfo- Returns:
- Return type:
Obtain if the type of the argument includes the possibility of
None
. For ‘in’ values this means thatNone
is a valid value. For ‘out’ values, this means thatNone
may be returned.See also
GIRepository.arg_info_is_optional
().
- GIRepository.callable_info_can_throw_gerror(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
True
if this #GICallableInfo can throw aGLib.Error
- Return type:
TODO
New in version 1.34.
- GIRepository.callable_info_get_arg(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfon (
int
) – the argument index to fetch
- Returns:
the #GIArgInfo. Free it with g_base_info_unref() when done.
- Return type:
Obtain information about a particular argument of this callable.
- GIRepository.callable_info_get_caller_owns(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
the transfer mode for the return value of the callable
- Return type:
See whether the caller owns the return value of this callable.
GIRepository.Transfer
contains a list of possible transfer values.
- GIRepository.callable_info_get_instance_ownership_transfer(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
the transfer mode of the instance argument
- Return type:
Obtains the ownership transfer for the instance argument.
GIRepository.Transfer
contains a list of possible transfer values.New in version 1.42.
- GIRepository.callable_info_get_n_args(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
The number of arguments this callable expects.
- Return type:
Obtain the number of arguments (both IN and OUT) for this callable.
- GIRepository.callable_info_get_return_attribute(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfoname (
str
) – a freeform string naming an attribute
- Returns:
The value of the attribute, or
None
if no such attribute exists- Return type:
Retrieve an arbitrary attribute associated with the return value.
- GIRepository.callable_info_get_return_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
the #GITypeInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain the return type of a callable item as a #GITypeInfo.
- GIRepository.callable_info_invoke(info, function, in_args, out_args, return_value, is_method, throws)¶
- Parameters:
info (
GIRepository.BaseInfo
) – TODOin_args ([
GIRepository.Argument
]) – TODOout_args ([
GIRepository.Argument
]) – TODOreturn_value (
GIRepository.Argument
) – TODOis_method (
bool
) – TODOthrows (
bool
) – TODO
- Raises:
- Return type:
TODO
- GIRepository.callable_info_is_method(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
- Return type:
Determines if the callable info is a method. For #GIVFuncInfo s, #GICallbackInfo s, and #GISignalInfo s, this is always true. Otherwise, this looks at the
GIRepository.FunctionInfoFlags.IS_METHOD
flag on the #GIFunctionInfo.Concretely, this function returns whether
GIRepository.callable_info_get_n_args
() matches the number of arguments in the raw C method. For methods, there is one more C argument than is exposed by introspection: the “self” or “this” object.New in version 1.34.
- GIRepository.callable_info_iterate_return_attributes(info, iterator)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfoiterator (
GIRepository.AttributeIter
) – aGIRepository.AttributeIter
structure, must be initialized; see below
- Returns:
True
if there are more attributes- iterator:
a
GIRepository.AttributeIter
structure, must be initialized; see below- name:
Returned name, must not be freed
- value:
Returned name, must not be freed
- Return type:
(
bool
, iterator:GIRepository.AttributeIter
, name:str
, value:str
)
Iterate over all attributes associated with the return value. The iterator structure is typically stack allocated, and must have its first member initialized to
None
.Both the name and value should be treated as constants and must not be freed.
See
GIRepository.BaseInfo.iterate_attributes
() for an example of how to use a similar API.
- GIRepository.callable_info_load_arg(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfon (
int
) – the argument index to fetch
- Returns:
Initialize with argument number n
- Return type:
Obtain information about a particular argument of this callable; this function is a variant of
GIRepository.callable_info_get_arg
() designed for stack allocation.The initialized arg must not be referenced after info is deallocated.
- GIRepository.callable_info_load_return_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
Initialized with return type of info
- Return type:
type:
GIRepository.BaseInfo
Obtain information about a return value of callable; this function is a variant of
GIRepository.callable_info_get_return_type
() designed for stack allocation.The initialized type must not be referenced after info is deallocated.
- GIRepository.callable_info_may_return_null(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
- Return type:
See if a callable could return
None
.
- GIRepository.callable_info_skip_return(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GICallableInfo- Returns:
True
if return value is only useful in C.- Return type:
See if a callable’s return value is only useful in C.
- GIRepository.cclosure_marshal_generic(closure, return_gvalue, n_param_values, param_values, invocation_hint, marshal_data)¶
- Parameters:
closure (
GObject.Closure
) –return_gvalue (
GObject.Value
) –n_param_values (
int
) –param_values (
GObject.Value
) –
- GIRepository.constant_info_get_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIConstantInfo- Returns:
the #GITypeInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain the type of the constant as a #GITypeInfo.
- GIRepository.enum_info_get_error_domain(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIEnumInfo- Returns:
the string form of the error domain associated with this enum, or
None
.- Return type:
Obtain the string form of the quark for the error domain associated with this enum, if any.
New in version 1.30.
- GIRepository.enum_info_get_method(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIEnumInfon (
int
) – index of method to get
- Returns:
the #GIFunctionInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an enum type method at index n.
New in version 1.30.
- GIRepository.enum_info_get_n_methods(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIEnumInfo- Returns:
number of methods
- Return type:
Obtain the number of methods that this enum type has.
New in version 1.30.
- GIRepository.enum_info_get_n_values(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIEnumInfo- Returns:
the number of enumeration values
- Return type:
Obtain the number of values this enumeration contains.
- GIRepository.enum_info_get_storage_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIEnumInfo- Returns:
the storage type for the enumeration
- Return type:
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.
- GIRepository.enum_info_get_value(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIEnumInfon (
int
) – index of value to fetch
- Returns:
the enumeration value or
None
if type tag is wrong, free the struct with g_base_info_unref() when done.- Return type:
Obtain a value for this enumeration.
- GIRepository.field_info_get_flags(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIFieldInfo- Returns:
the flags
- Return type:
Obtain the flags for this #GIFieldInfo. See
GIRepository.FieldInfoFlags
for possible flag values.
- GIRepository.field_info_get_offset(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIFieldInfo- Returns:
the field offset
- Return type:
Obtain the offset in bytes of the field member, this is relative to the beginning of the struct or union.
- GIRepository.field_info_get_size(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIFieldInfo- Returns:
the field size
- Return type:
Obtain the size in bits of the field member, this is how much space you need to allocate to store the field.
- GIRepository.field_info_get_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIFieldInfo- Returns:
the #GITypeInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain the type of a field as a #GITypeInfo.
- GIRepository.function_info_get_flags(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIFunctionInfo- Returns:
the flags
- Return type:
Obtain the
GIRepository.FunctionInfoFlags
for the info.
- GIRepository.function_info_get_property(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIFunctionInfo- Returns:
the property or
None
if not set. Free it with g_base_info_unref() when done.- Return type:
Obtain the property associated with this #GIFunctionInfo. Only #GIFunctionInfo with the flag
GIRepository.FunctionInfoFlags.IS_GETTER
orGIRepository.FunctionInfoFlags.IS_SETTER
have a property set. For other cases,None
will be returned.
- GIRepository.function_info_get_symbol(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIFunctionInfo- Returns:
the symbol
- Return type:
Obtain the symbol of the function. The symbol is the name of the exported function, suitable to be used as an argument to g_module_symbol().
- GIRepository.function_info_get_vfunc(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIFunctionInfo- Returns:
the virtual function or
None
if not set. Free it by calling g_base_info_unref() when done.- Return type:
Obtain the virtual function associated with this #GIFunctionInfo. Only #GIFunctionInfo with the flag
GIRepository.FunctionInfoFlags.WRAPS_VFUNC
has a virtual function set. For other cases,None
will be returned.
- GIRepository.get_major_version()¶
- Returns:
the major version number of the girepository library
- Return type:
Returns the major version number of the girepository library. (e.g. in version 1.58.2 this is 1.)
New in version 1.60.
- GIRepository.get_micro_version()¶
- Returns:
the micro version number of the girepository library
- Return type:
Returns the micro version number of the girepository library. (e.g. in version 1.58.2 this is 2.)
New in version 1.60.
- GIRepository.get_minor_version()¶
- Returns:
the minor version number of the girepository library
- Return type:
Returns the minor version number of the girepository library. (e.g. in version 1.58.2 this is 58.)
New in version 1.60.
- GIRepository.info_new(type, container, typelib, offset)¶
- Parameters:
type (
GIRepository.InfoType
) – TODOcontainer (
GIRepository.BaseInfo
) – TODOtypelib (
GIRepository.Typelib
) – TODOoffset (
int
) – TODO
- Returns:
TODO
- Return type:
TODO
- GIRepository.info_type_to_string(type)¶
- Parameters:
type (
GIRepository.InfoType
) – the info type- Returns:
the string
- Return type:
Obtain a string representation of type
- GIRepository.interface_info_find_method(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfoname (
str
) – name of method to obtain
- Returns:
the #GIFunctionInfo or
None
if none found. Free the struct by calling g_base_info_unref() when done.- Return type:
Obtain a method of the interface type given a name.
None
will be returned if there’s no method available with that name.
- GIRepository.interface_info_find_signal(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfoname (
str
) – Name of signal
- Returns:
Info for the signal with name name in info, or
None
on failure.- Return type:
TODO
New in version 1.34.
- GIRepository.interface_info_find_vfunc(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfoname (
str
) – The name of a virtual function to find.
- Returns:
the #GIVFuncInfo, or
None
. Free it with g_base_info_unref() when done.- Return type:
Locate a virtual function slot with name name. See the documentation for
GIRepository.object_info_find_vfunc
() for more information on virtuals.
- GIRepository.interface_info_get_constant(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfon (
int
) – index of constant to get
- Returns:
the #GIConstantInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an interface type constant at index n.
- GIRepository.interface_info_get_iface_struct(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfo- Returns:
the #GIStructInfo or
None
. Free it with g_base_info_unref() when done.- Return type:
Returns the layout C structure associated with this #GInterface.
- GIRepository.interface_info_get_method(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfon (
int
) – index of method to get
- Returns:
the #GIFunctionInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an interface type method at index n.
- GIRepository.interface_info_get_n_constants(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfo- Returns:
number of constants
- Return type:
Obtain the number of constants that this interface type has.
- GIRepository.interface_info_get_n_methods(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfo- Returns:
number of methods
- Return type:
Obtain the number of methods that this interface type has.
- GIRepository.interface_info_get_n_prerequisites(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfo- Returns:
number of prerequisites
- Return type:
Obtain the number of prerequisites for this interface type. A prerequisites is another interface that needs to be implemented for interface, similar to an base class for GObjects.
- GIRepository.interface_info_get_n_properties(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfo- Returns:
number of properties
- Return type:
Obtain the number of properties that this interface type has.
- GIRepository.interface_info_get_n_signals(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfo- Returns:
number of signals
- Return type:
Obtain the number of signals that this interface type has.
- GIRepository.interface_info_get_n_vfuncs(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfo- Returns:
number of virtual functions
- Return type:
Obtain the number of virtual functions that this interface type has.
- GIRepository.interface_info_get_prerequisite(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfon (
int
) – index of prerequisites to get
- Returns:
the prerequisites as a
GIRepository.BaseInfo
. Free the struct by calling g_base_info_unref() when done.- Return type:
Obtain an interface type prerequisites index n.
- GIRepository.interface_info_get_property(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfon (
int
) – index of property to get
- Returns:
the #GIPropertyInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an interface type property at index n.
- GIRepository.interface_info_get_signal(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfon (
int
) – index of signal to get
- Returns:
the #GISignalInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an interface type signal at index n.
- GIRepository.interface_info_get_vfunc(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIInterfaceInfon (
int
) – index of virtual function to get
- Returns:
the #GIVFuncInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an interface type virtual function at index n.
- GIRepository.object_info_find_method(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfoname (
str
) – name of method to obtain
- Returns:
the #GIFunctionInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain a method of the object type given a name.
None
will be returned if there’s no method available with that name.
- GIRepository.object_info_find_method_using_interfaces(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfoname (
str
) – name of method to obtain
- Returns:
the #GIFunctionInfo. Free the struct by calling g_base_info_unref() when done.
- implementor:
The implementor of the interface
- Return type:
(
GIRepository.BaseInfo
orNone
, implementor:GIRepository.BaseInfo
)
Obtain a method of the object given a name, searching both the object info and any interfaces it implements.
None
will be returned if there’s no method available with that name.Note that this function does *not* search parent classes; you will have to chain up if that’s desired.
- GIRepository.object_info_find_signal(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfoname (
str
) – Name of signal
- Returns:
Info for the signal with name name in info, or
None
on failure.- Return type:
TODO
- GIRepository.object_info_find_vfunc(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfoname (
str
) – The name of a virtual function to find.
- Returns:
the #GIVFuncInfo, or
None
. Free it with g_base_info_unref() when done.- Return type:
Locate a virtual function slot with name name. Note that the namespace for virtuals is distinct from that of methods; there may or may not be a concrete method associated for a virtual. If there is one, it may be retrieved using
GIRepository.vfunc_info_get_invoker
(), otherwiseNone
will be returned. See the documentation forGIRepository.vfunc_info_get_invoker
() for more information on invoking virtuals.
- GIRepository.object_info_find_vfunc_using_interfaces(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfoname (
str
) – name of vfunc to obtain
- Returns:
the #GIVFuncInfo. Free the struct by calling g_base_info_unref() when done.
- implementor:
The implementor of the interface
- Return type:
(
GIRepository.BaseInfo
orNone
, implementor:GIRepository.BaseInfo
)
Locate a virtual function slot with name name, searching both the object info and any interfaces it implements. Note that the namespace for virtuals is distinct from that of methods; there may or may not be a concrete method associated for a virtual. If there is one, it may be retrieved using
GIRepository.vfunc_info_get_invoker
(), otherwiseNone
will be returned.Note that this function does *not* search parent classes; you will have to chain up if that’s desired.
- GIRepository.object_info_get_abstract(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
True
if the object type is abstract- Return type:
Obtain if the object type is an abstract type, eg if it cannot be instantiated
- GIRepository.object_info_get_class_struct(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
the #GIStructInfo or
None
. Free with g_base_info_unref() when done.- Return type:
Every
GObject.Object
has two structures; an instance structure and a class structure. This function returns the metadata for the class structure.
- GIRepository.object_info_get_constant(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfon (
int
) – index of constant to get
- Returns:
the #GIConstantInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an object type constant at index n.
- GIRepository.object_info_get_field(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfon (
int
) – index of field to get
- Returns:
the #GIFieldInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an object type field at index n.
- GIRepository.object_info_get_final(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
True
if the object type is final- Return type:
Checks whether the object type is a final type, i.e. if it cannot be derived
New in version 1.70.
- GIRepository.object_info_get_fundamental(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
True
if the object type is a fundamental type- Return type:
Obtain if the object type is of a fundamental type which is not
GObject.TYPE_OBJECT
. This is mostly for supporting GstMiniObject.
- GIRepository.object_info_get_get_value_function(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
the symbol or
None
- Return type:
Obtain the symbol name of the function that should be called to convert an object instance pointer of this object type to a
GObject.Value
. I’s mainly used fundamental types. The type signature for the symbol is %GIObjectInfoGetValueFunction, to fetch the function pointer seeGIRepository.object_info_get_get_value_function
().
- GIRepository.object_info_get_interface(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfon (
int
) – index of interface to get
- Returns:
the #GIInterfaceInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an object type interface at index n.
- GIRepository.object_info_get_method(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfon (
int
) – index of method to get
- Returns:
the #GIFunctionInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an object type method at index n.
- GIRepository.object_info_get_n_constants(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
number of constants
- Return type:
Obtain the number of constants that this object type has.
- GIRepository.object_info_get_n_fields(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
number of fields
- Return type:
Obtain the number of fields that this object type has.
- GIRepository.object_info_get_n_interfaces(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
number of interfaces
- Return type:
Obtain the number of interfaces that this object type has.
- GIRepository.object_info_get_n_methods(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
number of methods
- Return type:
Obtain the number of methods that this object type has.
- GIRepository.object_info_get_n_properties(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
number of properties
- Return type:
Obtain the number of properties that this object type has.
- GIRepository.object_info_get_n_signals(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
number of signals
- Return type:
Obtain the number of signals that this object type has.
- GIRepository.object_info_get_n_vfuncs(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
number of virtual functions
- Return type:
Obtain the number of virtual functions that this object type has.
- GIRepository.object_info_get_parent(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
the #GIObjectInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain the parent of the object type.
- GIRepository.object_info_get_property(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfon (
int
) – index of property to get
- Returns:
the #GIPropertyInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an object type property at index n.
- GIRepository.object_info_get_ref_function(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
the symbol or
None
- Return type:
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
GIRepository.object_info_get_ref_function
().
- GIRepository.object_info_get_set_value_function(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
the symbol or
None
- Return type:
Obtain the symbol name of the function that should be called to convert set a
GObject.Value
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 seeGIRepository.object_info_get_set_value_function
().
- GIRepository.object_info_get_signal(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfon (
int
) – index of signal to get
- Returns:
the #GISignalInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an object type signal at index n.
- GIRepository.object_info_get_type_init(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
the type init function
- Return type:
Obtain the function which when called will return the
GObject.GType
function for which this object type is registered.
- GIRepository.object_info_get_type_name(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
name of the objects type
- Return type:
Obtain the name of the objects class/type.
- GIRepository.object_info_get_unref_function(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfo- Returns:
the symbol or
None
- Return type:
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
GIRepository.object_info_get_unref_function
().
- GIRepository.object_info_get_vfunc(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIObjectInfon (
int
) – index of virtual function to get
- Returns:
the #GIVFuncInfo. Free the struct by calling g_base_info_unref() when done.
- Return type:
Obtain an object type virtual function at index n.
- GIRepository.property_info_get_flags(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIPropertyInfo- Returns:
the flags
- Return type:
Obtain the flags for this property info. See
GObject.ParamFlags
for more information about possible flag values.
- GIRepository.property_info_get_getter(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIPropertyInfo- Returns:
the function info or
None
if not set. Free it with g_base_info_unref() when done.- Return type:
Obtains the getter function associated with this #GIPropertyInfo.
The setter is only available for
GObject.ParamFlags.READABLE
properties.
- GIRepository.property_info_get_ownership_transfer(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIPropertyInfo- Returns:
the transfer
- Return type:
Obtain the ownership transfer for this property. See
GIRepository.Transfer
for more information about transfer values.
- GIRepository.property_info_get_setter(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIPropertyInfo- Returns:
the function info or
None
if not set. Free it with g_base_info_unref() when done.- Return type:
Obtains the setter function associated with this #GIPropertyInfo.
The setter is only available for
GObject.ParamFlags.WRITABLE
properties that are also notGObject.ParamFlags.CONSTRUCT_ONLY
.
- GIRepository.property_info_get_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIPropertyInfo- Returns:
the #GITypeInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information for the property info.
- GIRepository.registered_type_info_get_g_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIRegisteredTypeInfo- Returns:
the
GObject.GType
.- Return type:
Obtain the
GObject.GType
for this registered type orGObject.TYPE_NONE
which a special meaning. It means that either there is no type information associated with this info or that the shared library which provides the type_init function for this info cannot be called.
- GIRepository.registered_type_info_get_type_init(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIRegisteredTypeInfo- Returns:
the symbol name of the type init function, suitable for passing into g_module_symbol().
- Return type:
Obtain the type init function for info. The type init function is the function which will register the
GObject.GType
within theGObject.Object
type system. Usually this is not called by langauge bindings or applications, useGIRepository.registered_type_info_get_g_type
() directly instead.
- GIRepository.registered_type_info_get_type_name(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIRegisteredTypeInfo- Returns:
the type name
- Return type:
Obtain the type name of the struct within the
GObject.Object
type system. This type can be passed toGObject.type_name
() to get aGObject.GType
.
- GIRepository.signal_info_get_class_closure(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GISignalInfo- Returns:
the class closure or
None
- Return type:
Obtain the class closure for this signal if one is set. The class closure is a virtual function on the type that the signal belongs to. If the signal lacks a closure
None
will be returned.
- GIRepository.signal_info_get_flags(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GISignalInfo- Returns:
the flags
- Return type:
Obtain the flags for this signal info. See
GObject.SignalFlags
for more information about possible flag values.
- GIRepository.signal_info_true_stops_emit(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GISignalInfo- Returns:
True
if returning true stops the signal emission- Return type:
Obtain if the returning true in the signal handler will stop the emission of the signal.
- GIRepository.struct_info_find_field(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfoname (
str
) – a field name
- Returns:
the #GIFieldInfo or
None
if not found, free it with g_base_info_unref() when done.- Return type:
Obtain the type information for field named name.
New in version 1.46.
- GIRepository.struct_info_find_method(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfoname (
str
) – a method name
- Returns:
the #GIFunctionInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information for method named name.
- GIRepository.struct_info_get_alignment(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfo- Returns:
required alignment in bytes
- Return type:
Obtain the required alignment of the structure.
- GIRepository.struct_info_get_copy_function(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a struct information blob- Returns:
the name of the copy function
- Return type:
Retrieves the name of the copy function for info, if any is set.
New in version 1.76.
- GIRepository.struct_info_get_field(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfon (
int
) – a field index
- Returns:
the #GIFieldInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information for field with specified index.
- GIRepository.struct_info_get_free_function(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a struct information blob- Returns:
the name of the free function
- Return type:
Retrieves the name of the free function for info, if any is set.
New in version 1.76.
- GIRepository.struct_info_get_method(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfon (
int
) – a method index
- Returns:
the #GIFunctionInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information for method with specified index.
- GIRepository.struct_info_get_n_fields(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfo- Returns:
number of fields
- Return type:
Obtain the number of fields this structure has.
- GIRepository.struct_info_get_n_methods(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfo- Returns:
number of methods
- Return type:
Obtain the number of methods this structure has.
- GIRepository.struct_info_get_size(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfo- Returns:
size of the structure in bytes
- Return type:
Obtain the total size of the structure.
- GIRepository.struct_info_is_foreign(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – TODO- Returns:
TODO
- Return type:
TODO
- GIRepository.struct_info_is_gtype_struct(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIStructInfo- Returns:
- Return type:
Return true if this structure represents the “class structure” for some
GObject.Object
or #GInterface. This function is mainly useful to hide this kind of structure from generated public APIs.
- GIRepository.type_info_argument_from_hash_pointer(info, hash_pointer, arg)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfohash_pointer (
object
orNone
) – A pointer, such as aGLib.HashTable
data pointerarg (
GIRepository.Argument
) – AGIRepository.Argument
to fill in
GLib data structures, such as
GLib.List
,GLib.SList
, andGLib.HashTable
, all store data pointers. In the case where the list or hash table is storing single types rather than structs, these data pointers may have values stuffed into them via macros such as %GPOINTER_TO_INT.Use this function to ensure that all values are correctly extracted from stuffed pointers, regardless of the machine’s architecture or endianness.
This function fills in the appropriate field of arg with the value extracted from hash_pointer, depending on the storage type of info.
New in version 1.66.
- GIRepository.type_info_get_array_fixed_size(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfo- Returns:
the size or -1 if it’s not an array
- Return type:
Obtain the fixed array size of the type. The type tag must be a
GIRepository.TypeTag.ARRAY
or -1 will be returned.
- GIRepository.type_info_get_array_length(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfo- Returns:
the array length, or -1 if the type is not an array
- Return type:
Obtain the position of the argument which gives the array length of the type. The type tag must be a
GIRepository.TypeTag.ARRAY
or -1 will be returned.
- GIRepository.type_info_get_array_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfo- Returns:
the array type or -1
- Return type:
Obtain the array type for this type. See
GIRepository.ArrayType
for a list of possible values. If the type tag of this type is not array, -1 will be returned.
- GIRepository.type_info_get_interface(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfo- Returns:
the
GIRepository.BaseInfo
, orNone
. Free it with g_base_info_unref() when done.- Return type:
For types which have
GIRepository.TypeTag.INTERFACE
such as GObjects and boxed values, this function returns full information about the referenced type. You can then inspect the type of the returnedGIRepository.BaseInfo
to further query whether it is a concreteGObject.Object
, a GInterface, a structure, etc. usingGIRepository.BaseInfo.get_type
().
- GIRepository.type_info_get_param_type(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfon (
int
) – index of the parameter
- Returns:
the param type info
- Return type:
Obtain the parameter type n.
- GIRepository.type_info_get_storage_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfo- Returns:
the type tag
- Return type:
Obtain the type tag corresponding to the underlying storage type in C for the type. See
GIRepository.TypeTag
for a list of type tags.New in version 1.66.
- GIRepository.type_info_get_tag(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfo- Returns:
the type tag
- Return type:
Obtain the type tag for the type. See
GIRepository.TypeTag
for a list of type tags.
- GIRepository.type_info_hash_pointer_from_argument(info, arg)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfoarg (
GIRepository.Argument
) – AGIRepository.Argument
with the value to stuff into a pointer
- Returns:
A stuffed pointer, that can be stored in a
GLib.HashTable
, for example- Return type:
GLib data structures, such as
GLib.List
,GLib.SList
, andGLib.HashTable
, all store data pointers. In the case where the list or hash table is storing single types rather than structs, these data pointers may have values stuffed into them via macros such as %GPOINTER_TO_INT.Use this function to ensure that all values are correctly stuffed into pointers, regardless of the machine’s architecture or endianness.
This function returns a pointer stuffed with the appropriate field of arg, depending on the storage type of info.
New in version 1.66.
- GIRepository.type_info_is_pointer(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfo- Returns:
True
if it is a pointer- Return type:
Obtain if the type is passed as a reference.
Note that the types of
GIRepository.Direction.OUT
andGIRepository.Direction.INOUT
parameters will only be pointers if the underlying type being transferred is a pointer (i.e. only if the type of the C function’s formal parameter is a pointer to a pointer).
- GIRepository.type_info_is_zero_terminated(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GITypeInfo- Returns:
True
if zero terminated- Return type:
Obtain if the last element of the array is
None
. The type tag must be aGIRepository.TypeTag.ARRAY
orFalse
will be returned.
- GIRepository.type_tag_argument_from_hash_pointer(storage_type, hash_pointer, arg)¶
- Parameters:
storage_type (
GIRepository.TypeTag
) – aGIRepository.TypeTag
obtained fromGIRepository.type_info_get_storage_type
()hash_pointer (
object
orNone
) – A pointer, such as aGLib.HashTable
data pointerarg (
GIRepository.Argument
) – AGIRepository.Argument
to fill in
GLib data structures, such as
GLib.List
,GLib.SList
, andGLib.HashTable
, all store data pointers. In the case where the list or hash table is storing single types rather than structs, these data pointers may have values stuffed into them via macros such as %GPOINTER_TO_INT.Use this function to ensure that all values are correctly extracted from stuffed pointers, regardless of the machine’s architecture or endianness.
This function fills in the appropriate field of arg with the value extracted from hash_pointer, depending on storage_type.
New in version 1.72.
- GIRepository.type_tag_hash_pointer_from_argument(storage_type, arg)¶
- Parameters:
storage_type (
GIRepository.TypeTag
) – aGIRepository.TypeTag
obtained fromGIRepository.type_info_get_storage_type
()arg (
GIRepository.Argument
) – AGIRepository.Argument
with the value to stuff into a pointer
- Returns:
A stuffed pointer, that can be stored in a
GLib.HashTable
, for example- Return type:
GLib data structures, such as
GLib.List
,GLib.SList
, andGLib.HashTable
, all store data pointers. In the case where the list or hash table is storing single types rather than structs, these data pointers may have values stuffed into them via macros such as %GPOINTER_TO_INT.Use this function to ensure that all values are correctly stuffed into pointers, regardless of the machine’s architecture or endianness.
This function returns a pointer stuffed with the appropriate field of arg, depending on storage_type.
New in version 1.72.
- GIRepository.type_tag_to_string(type)¶
- Parameters:
type (
GIRepository.TypeTag
) – the type_tag- Returns:
the string
- Return type:
Obtain a string representation of type
- GIRepository.union_info_find_method(info, name)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfoname (
str
) – a method name
- Returns:
the #GIFunctionInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information for method named name.
- GIRepository.union_info_get_alignment(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfo- Returns:
required alignment in bytes
- Return type:
Obtain the required alignment of the union.
- GIRepository.union_info_get_copy_function(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a union information blob- Returns:
the name of the copy function
- Return type:
Retrieves the name of the copy function for info, if any is set.
New in version 1.76.
- GIRepository.union_info_get_discriminator(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfon (
int
) – a union field index
- Returns:
the #GIConstantInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain discriminator value assigned for n-th union field, i.e. n-th union field is the active one if discriminator contains this constant.
- GIRepository.union_info_get_discriminator_offset(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfo- Returns:
offset in bytes of the discriminator
- Return type:
Returns offset of the discriminator field in the structure.
- GIRepository.union_info_get_discriminator_type(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfo- Returns:
the #GITypeInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information of the union discriminator.
- GIRepository.union_info_get_field(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfon (
int
) – a field index
- Returns:
the #GIFieldInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information for field with specified index.
- GIRepository.union_info_get_free_function(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a union information blob- Returns:
the name of the free function
- Return type:
Retrieves the name of the free function for info, if any is set.
New in version 1.76.
- GIRepository.union_info_get_method(info, n)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfon (
int
) – a method index
- Returns:
the #GIFunctionInfo, free it with g_base_info_unref() when done.
- Return type:
Obtain the type information for method with specified index.
- GIRepository.union_info_get_n_fields(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfo- Returns:
number of fields
- Return type:
Obtain the number of fields this union has.
- GIRepository.union_info_get_n_methods(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfo- Returns:
number of methods
- Return type:
Obtain the number of methods this union has.
- GIRepository.union_info_get_size(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfo- Returns:
size of the union in bytes
- Return type:
Obtain the total size of the union.
- GIRepository.union_info_is_discriminated(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIUnionInfo- Returns:
- Return type:
Return true if this union contains discriminator field.
- GIRepository.value_info_get_value(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIValueInfo- Returns:
the enumeration value. This will always be representable as a 32-bit signed or unsigned value. The use of gint64 as the return type is to allow both.
- Return type:
Obtain the enumeration value of the #GIValueInfo.
- GIRepository.vfunc_info_get_address(info, implementor_gtype)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIVFuncInfoimplementor_gtype (
GObject.GType
) –GObject.GType
implementing this virtual function
- Raises:
- Returns:
address to a function or
None
if an error happened- Return type:
This method will look up where inside the type struct of implementor_gtype is the implementation for info.
- GIRepository.vfunc_info_get_flags(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIVFuncInfo- Returns:
the flags
- Return type:
Obtain the flags for this virtual function info. See
GIRepository.VFuncInfoFlags
for more information about possible flag values.
- GIRepository.vfunc_info_get_invoker(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIVFuncInfo- Returns:
the #GIVFuncInfo or
None
. Free it with g_base_info_unref() when done.- Return type:
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.
- GIRepository.vfunc_info_get_offset(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIVFuncInfo- Returns:
the struct offset or 0xFFFF if it’s unknown
- Return type:
Obtain the offset of the function pointer in the class struct. The value 0xFFFF indicates that the struct offset is unknown.
- GIRepository.vfunc_info_get_signal(info)¶
- Parameters:
info (
GIRepository.BaseInfo
) – a #GIVFuncInfo- Returns:
the signal or
None
if none set- Return type:
Obtain the signal for the virtual function if one is set. The signal comes from the object or interface to which this virtual function belongs.