![]() |
![]() |
![]() |
GObject Introspection Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
typedef GICallbackInfo; struct GIRepository; enum GIRepositoryError; enum GIRepositoryLoadFlags; GITypelib; GIRepository * g_irepository_get_default (void
); void g_irepository_prepend_search_path (const char *directory
); GSList * g_irepository_get_search_path (void
); const char * g_irepository_load_typelib (GIRepository *repository
,GITypelib *typelib
,GIRepositoryLoadFlags flags
,GError **error
); gboolean g_irepository_is_registered (GIRepository *repository
,const gchar *namespace_
,const gchar *version
); GIBaseInfo * g_irepository_find_by_name (GIRepository *repository
,const gchar *namespace_
,const gchar *name
); GITypelib * g_irepository_require (GIRepository *repository
,const gchar *namespace_
,const gchar *version
,GIRepositoryLoadFlags flags
,GError **error
); GITypelib * g_irepository_require_private (GIRepository *repository
,const gchar *typelib_dir
,const gchar *namespace_
,const gchar *version
,GIRepositoryLoadFlags flags
,GError **error
); gchar ** g_irepository_get_dependencies (GIRepository *repository
,const gchar *namespace_
); gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository
); GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository
,GType gtype
); gint g_irepository_get_n_infos (GIRepository *repository
,const gchar *namespace_
); GIBaseInfo * g_irepository_get_info (GIRepository *repository
,const gchar *namespace_
,gint index
); const gchar * g_irepository_get_typelib_path (GIRepository *repository
,const gchar *namespace_
); const gchar * g_irepository_get_shared_library (GIRepository *repository
,const gchar *namespace_
); const gchar * g_irepository_get_version (GIRepository *repository
,const gchar *namespace_
); GOptionGroup * g_irepository_get_option_group (void
); const gchar * g_irepository_get_c_prefix (GIRepository *repository
,const gchar *namespace_
); gboolean g_irepository_dump (const char *arg
,GError **error
); GList * g_irepository_enumerate_versions (GIRepository *repository
,const gchar *namespace_
); #define G_IREPOSITORY_ERROR GITypelib * g_typelib_new_from_memory (guint8 *memory
,gsize len
,GError **error
); GITypelib * g_typelib_new_from_const_memory (const guint8 *memory
,gsize len
,GError **error
); GITypelib * g_typelib_new_from_mapped_file (GMappedFile *mfile
,GError **error
); void g_typelib_free (GITypelib *typelib
); gboolean g_typelib_symbol (GITypelib *typelib
,const gchar *symbol_name
,gpointer *symbol
); const gchar * g_typelib_get_namespace (GITypelib *typelib
);
typedef GIBaseInfo GICallbackInfo;
Represents a callback, eg arguments and return value.
typedef enum { G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH, G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND } GIRepositoryError;
the typelib could not be found. | |
the namespace does not match the requested namespace. | |
the version of the typelib does not match the requested version. | |
the library used by the typelib could not be found. |
typedef enum { G_IREPOSITORY_LOAD_FLAG_LAZY = 1 << 0 } GIRepositoryLoadFlags;
Flags that controlls how a typelib is loaded by
GIRepositry, used by g_irepository_load_typelib()
.
GIRepository * g_irepository_get_default (void
);
Returns the singleton process-global default GIRepository. It is not currently supported to have multiple repositories in a particular process, but this function is provided in the unlikely eventuality that it would become possible, and as a convenience for higher level language bindings to conform to the GObject method call conventions.
All methods on GIRepository also accept NULL
as an instance
parameter to mean this default repository, which is usually more
convenient for C.
Returns : |
The global singleton GIRepository. [transfer none] |
void g_irepository_prepend_search_path (const char *directory
);
GSList * g_irepository_get_search_path (void
);
Returns the search path the GIRepository will use when looking for typelibs. The string is internal to GIRespository and should not be freed, nor should the elements.
Returns : |
list of strings. [element-type filename][transfer none] |
const char * g_irepository_load_typelib (GIRepository *repository
,GITypelib *typelib
,GIRepositoryLoadFlags flags
,GError **error
);
gboolean g_irepository_is_registered (GIRepository *repository
,const gchar *namespace_
,const gchar *version
);
Check whether a particular namespace (and optionally, a specific
version thereof) is currently loaded. This function is likely to
only be useful in unusual circumstances; in order to act upon
metadata in the namespace, you should call g_irepository_require()
instead which will ensure the namespace is loaded, and return as
quickly as this function will if it has already been loaded.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
Namespace of interest |
|
Required version, may be NULL for latest. [allow-none]
|
Returns : |
TRUE if namespace-version is loaded, FALSE otherwise |
GIBaseInfo * g_irepository_find_by_name (GIRepository *repository
,const gchar *namespace_
,const gchar *name
);
Searches for a particular entry in a namespace. Before calling
this function for a particular namespace, you must call
g_irepository_require()
once to load the namespace, or otherwise
ensure the namespace has already been loaded.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
Namespace which will be searched |
|
Entry name to find |
Returns : |
GIBaseInfo representing metadata about name , or NULL . [transfer full]
|
GITypelib * g_irepository_require (GIRepository *repository
,const gchar *namespace_
,const gchar *version
,GIRepositoryLoadFlags flags
,GError **error
);
Force the namespace namespace_
to be loaded if it isn't already.
If namespace_
is not loaded, this function will search for a
".typelib" file using the repository search path. In addition, a
version version
of namespace may be specified. If version
is
not specified, the latest will be used.
|
Repository, may be NULL for the default. [allow-none]
|
|
GI namespace to use, e.g. "Gtk" |
|
Version of namespace, may be NULL for latest. [allow-none]
|
|
Set of GIRepositoryLoadFlags , may be 0 |
|
a GError. |
Returns : |
a pointer to the GITypelib if successful, NULL otherwise. [transfer none]
|
GITypelib * g_irepository_require_private (GIRepository *repository
,const gchar *typelib_dir
,const gchar *namespace_
,const gchar *version
,GIRepositoryLoadFlags flags
,GError **error
);
Force the namespace namespace_
to be loaded if it isn't already.
If namespace_
is not loaded, this function will search for a
".typelib" file within the private directory only. In addition, a
version version
of namespace should be specified. If version
is
not specified, the latest will be used.
|
Repository, may be NULL for the default. [allow-none]
|
|
Private directory where to find the requested typelib |
|
GI namespace to use, e.g. "Gtk" |
|
Version of namespace, may be NULL for latest. [allow-none]
|
|
Set of GIRepositoryLoadFlags , may be 0 |
|
a GError. |
Returns : |
a pointer to the GITypelib if successful, NULL otherwise. [transfer none]
|
gchar ** g_irepository_get_dependencies (GIRepository *repository
,const gchar *namespace_
);
Return an array of all (transitive) dependencies for namespace
namespace_
, including version. The returned strings are of the
form namespace-version
.
Note: The namespace must have already been loaded using a function
such as g_irepository_require()
before calling this function.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
Namespace of interest |
Returns : |
Zero-terminated string array of versioned dependencies. [transfer full] |
gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository
);
Return the list of currently loaded namespaces.
|
A GIRepository, may be NULL for the default. [allow-none]
|
Returns : |
List of namespaces. [utf8][transfer full] |
GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository
,GType gtype
);
Searches all loaded namespaces for a particular GType. Note that in order to locate the metadata, the namespace corresponding to the type must first have been loaded. There is currently no mechanism for determining the namespace which corresponds to an arbitrary GType - thus, this function will operate most reliably when you know the GType to originate from be from a loaded namespace.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
GType to search for |
Returns : |
GIBaseInfo representing metadata about type , or NULL . [transfer full]
|
gint g_irepository_get_n_infos (GIRepository *repository
,const gchar *namespace_
);
This function returns the number of metadata entries in
given namespace namespace_
. The namespace must have
already been loaded before calling this function.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
Namespace to inspect |
Returns : |
number of metadata entries |
GIBaseInfo * g_irepository_get_info (GIRepository *repository
,const gchar *namespace_
,gint index
);
This function returns a particular metadata entry in the
given namespace namespace_
. The namespace must have
already been loaded before calling this function.
See g_irepository_get_n_infos()
to find the maximum number of
entries.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
Namespace to inspect |
|
0-based offset into namespace metadata for entry |
Returns : |
GIBaseInfo containing metadata. [transfer full] |
const gchar * g_irepository_get_typelib_path (GIRepository *repository
,const gchar *namespace_
);
If namespace namespace_
is loaded, return the full path to the
.typelib file it was loaded from. If the typelib for
namespace namespace_
was included in a shared library, return
the special string "$lt;builtin$gt;".
const gchar * g_irepository_get_shared_library (GIRepository *repository
,const gchar *namespace_
);
This function returns the full path to the shared C library
associated with the given namespace namespace_
. There may be no
shared library path associated, in which case this function will
return NULL
.
Note: The namespace must have already been loaded using a function
such as g_irepository_require()
before calling this function.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
Namespace to inspect |
Returns : |
Full path to shared library, or NULL if none associated |
const gchar * g_irepository_get_version (GIRepository *repository
,const gchar *namespace_
);
This function returns the loaded version associated with the given
namespace namespace_
.
Note: The namespace must have already been loaded using a function
such as g_irepository_require()
before calling this function.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
Namespace to inspect |
Returns : |
Loaded version |
GOptionGroup * g_irepository_get_option_group (void
);
Obtain the option group for girepository, it's used by the dumper and for programs that wants to provide introspection information
Returns : |
the option group. [transfer full] |
const gchar * g_irepository_get_c_prefix (GIRepository *repository
,const gchar *namespace_
);
This function returns the "C prefix", or the C level namespace associated with the given introspection namespace. Each C symbol starts with this prefix, as well each GType in the library.
Note: The namespace must have already been loaded using a function
such as g_irepository_require()
before calling this function.
|
A GIRepository, may be NULL for the default. [allow-none]
|
|
Namespace to inspect |
Returns : |
C namespace prefix, or NULL if none associated |
gboolean g_irepository_dump (const char *arg
,GError **error
);
Argument specified is a comma-separated pair of filenames; i.e. of the form "input.txt,output.xml". The input file should be a UTF-8 Unix-line-ending text file, with each line containing the name of a GType _get_type function.
The output file should already exist, but be empty. This function will overwrite its contents.
|
Comma-separated pair of input and output filenames |
|
a GError
|
Returns : |
TRUE on success, FALSE on error |
GList * g_irepository_enumerate_versions (GIRepository *repository
,const gchar *namespace_
);
Obtain an unordered list of versions (either currently loaded or
available) for namespace_
in this repository
.
|
the repository. [allow-none] |
|
GI namespace, e.g. "Gtk" |
Returns : |
the array of versions. [element-type utf8][transfer full] |
GITypelib * g_typelib_new_from_memory (guint8 *memory
,gsize len
,GError **error
);
Creates a new GITypelib from a memory location. The memory block
pointed to by typelib
will be automatically g_free()
d when the
repository is destroyed.
|
address of memory chunk containing the typelib |
|
length of memory chunk containing the typelib |
|
a GError |
Returns : |
the new GITypelib |
GITypelib * g_typelib_new_from_const_memory (const guint8 *memory
,gsize len
,GError **error
);
Creates a new GITypelib from a memory location.
|
address of memory chunk containing the typelib |
|
length of memory chunk containing the typelib |
|
A GError |
Returns : |
the new GITypelib |
GITypelib * g_typelib_new_from_mapped_file (GMappedFile *mfile
,GError **error
);
Creates a new GITypelib from a GMappedFile.
|
a GMappedFile, that will be free'd when the repository is destroyed |
|
a GError |
Returns : |
the new GITypelib |
gboolean g_typelib_symbol (GITypelib *typelib
,const gchar *symbol_name
,gpointer *symbol
);
Loads a symbol from GITypelib.
|
the typelib |
|
name of symbol to be loaded |
|
returns a pointer to the symbol value |
Returns : |
TRUE on success |