GIRepository

GIRepository

Synopsis

#define             G_TYPE_IREPOSITORY
#define             G_IREPOSITORY                       (object)
                    GIRepositoryPrivate;
typedef             GICallbackInfo;
                    GIUnresolvedInfo;
                    GTypelib;
enum                GIArrayType;
                    GIAttributeIter;
#define             G_IREPOSITORY_CLASS                 (klass)
#define             G_IREPOSITORY_GET_CLASS             (obj)
#define             G_IS_IREPOSITORY                    (object)
#define             G_IS_IREPOSITORY_CLASS              (klass)
                    GIRepository;
enum                GIRepositoryLoadFlags;
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,
                                                         GTypelib *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);
GTypelib *          g_irepository_require               (GIRepository *repository,
                                                         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);
GTypelib *          g_typelib_new_from_memory           (guchar *memory,
                                                         gsize len);
GTypelib *          g_typelib_new_from_const_memory     (const guchar *memory,
                                                         gsize len);
GTypelib *          g_typelib_new_from_mapped_file      (GMappedFile *mfile);
void                g_typelib_free                      (GTypelib *typelib);
gboolean            g_typelib_symbol                    (GTypelib *typelib,
                                                         const gchar *symbol_name,
                                                         gpointer *symbol);
const gchar *       g_typelib_get_namespace             (GTypelib *typelib);
enum                GIRepositoryError;
#define             G_IREPOSITORY_ERROR
GQuark              g_irepository_error_quark           (void);
void                gi_cclosure_marshal_generic         (GClosure *closure,
                                                         GValue *return_gvalue,
                                                         guint n_param_values,
                                                         const GValue *param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
enum                GIInfoType;
GIBaseInfo *        g_info_new                          (GIInfoType type,
                                                         GIBaseInfo *container,
                                                         GTypelib *typelib,
                                                         guint32 offset);
#define             G_INVOKE_ERROR
GQuark              g_invoke_error_quark                (void);
enum                GITransfer;
enum                GIDirection;
enum                GIScopeType;

Object Hierarchy

  GObject
   +----GIRepository

Description

Details

G_TYPE_IREPOSITORY

#define G_TYPE_IREPOSITORY              (g_irepository_get_type ())


G_IREPOSITORY()

#define G_IREPOSITORY(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_IREPOSITORY, GIRepository))

object :


GIRepositoryPrivate

typedef struct _GIRepositoryPrivate GIRepositoryPrivate;


GICallbackInfo

typedef GIBaseInfo GICallbackInfo;

Represents a callback, eg arguments and return value.


GIUnresolvedInfo

typedef struct _GIUnresolvedInfo GIUnresolvedInfo;

Represents a unresolved type in a typelib.


GTypelib

typedef struct {
} GTypelib;

enum GIArrayType

typedef enum {
  GI_ARRAY_TYPE_C,
  GI_ARRAY_TYPE_ARRAY,
  GI_ARRAY_TYPE_PTR_ARRAY,
  GI_ARRAY_TYPE_BYTE_ARRAY
} GIArrayType;

The type of array in a GITypeInfo.

GI_ARRAY_TYPE_C

a C array, char[] for instance

GI_ARRAY_TYPE_ARRAY

a GArray array

GI_ARRAY_TYPE_PTR_ARRAY

a GPtrArray array

GI_ARRAY_TYPE_BYTE_ARRAY

a GByteArray array

GIAttributeIter

typedef struct {
} GIAttributeIter;

An opaque structure used to iterate over attributes in a GIBaseInfo struct.


G_IREPOSITORY_CLASS()

#define G_IREPOSITORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_IREPOSITORY, GIRepositoryClass))

klass :


G_IREPOSITORY_GET_CLASS()

#define G_IREPOSITORY_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_IREPOSITORY, GIRepositoryClass))

obj :


G_IS_IREPOSITORY()

#define G_IS_IREPOSITORY(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_IREPOSITORY))

object :


G_IS_IREPOSITORY_CLASS()

#define G_IS_IREPOSITORY_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_IREPOSITORY))

klass :


GIRepository

typedef struct _GIRepository GIRepository;


enum GIRepositoryLoadFlags

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().

G_IREPOSITORY_LOAD_FLAG_LAZY

Load the types lazily.

g_irepository_get_default ()

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]

g_irepository_prepend_search_path ()

void                g_irepository_prepend_search_path   (const char *directory);

directory :


g_irepository_get_search_path ()

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 filename]

g_irepository_load_typelib ()

const char *        g_irepository_load_typelib          (GIRepository *repository,
                                                         GTypelib *typelib,
                                                         GIRepositoryLoadFlags flags,
                                                         GError **error);

repository :

typelib :

flags :

error :

Returns :


g_irepository_is_registered ()

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.

repository :

A GIRepository, may be NULL for the default

namespace_ :

Namespace of interest

version :

Required version, may be NULL for latest. [allow-none]

Returns :

TRUE if namespace-version is loaded, FALSE otherwise

g_irepository_find_by_name ()

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.

repository :

A GIRepository, may be NULL for the default

namespace_ :

Namespace which will be searched

name :

Entry name to find

Returns :

GIBaseInfo representing metadata about name, or NULL

g_irepository_require ()

GTypelib *          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 :

Repository, may be NULL for the default. [allow-none]

namespace_ :

GI namespace to use, e.g. "Gtk"

version :

Version of namespace, may be NULL for latest. [allow-none]

flags :

Set of GIRepositoryLoadFlags, may be 0

error :

a GError.

Returns :

a pointer to the GTypelib if successful, NULL otherwise

g_irepository_get_dependencies ()

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.

repository :

A GIRepository, may be NULL for the default

namespace_ :

Namespace of interest

Returns :

Zero-terminated string array of versioned dependencies

g_irepository_get_loaded_namespaces ()

gchar **            g_irepository_get_loaded_namespaces (GIRepository *repository);

repository :

Returns :


g_irepository_find_by_gtype ()

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.

repository :

A GIRepository, may be NULL for the default

gtype :

GType to search for

Returns :

GIBaseInfo representing metadata about type, or NULL

g_irepository_get_n_infos ()

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.

repository :

A GIRepository, may be NULL for the default

namespace_ :

Namespace to inspect

Returns :

number of metadata entries

g_irepository_get_info ()

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.

repository :

A GIRepository, may be NULL for the default

namespace_ :

Namespace to inspect

index :

Offset into namespace metadata for entry

Returns :

GIBaseInfo containing metadata

g_irepository_get_typelib_path ()

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;".

repository :

Repository, may be NULL for the default

namespace_ :

GI namespace to use, e.g. "Gtk"

Returns :

Filesystem path (or $lt;builtin$gt;) if successful, NULL if namespace is not loaded

g_irepository_get_shared_library ()

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.

repository :

A GIRepository, may be NULL for the default

namespace_ :

Namespace to inspect

Returns :

Full path to shared library, or NULL if none associated

g_irepository_get_version ()

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.

repository :

A GIRepository, may be NULL for the default

namespace_ :

Namespace to inspect

Returns :

Loaded version

g_irepository_get_option_group ()

GOptionGroup *      g_irepository_get_option_group      (void);

Returns :


g_irepository_get_c_prefix ()

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.

repository :

A GIRepository, may be NULL for the default

namespace_ :

Namespace to inspect

Returns :

C namespace prefix, or NULL if none associated

g_irepository_dump ()

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.

arg :

Comma-separated pair of input and output filenames

error :

a GError

Returns :

TRUE on success, FALSE on error

g_typelib_new_from_memory ()

GTypelib *          g_typelib_new_from_memory           (guchar *memory,
                                                         gsize len);

Creates a new GTypelib from a memory location. The memory block pointed to by typelib will be automatically g_free()d when the repository is destroyed.

memory :

address of memory chunk containing the typelib

len :

length of memory chunk containing the typelib

Returns :

the new GTypelib

g_typelib_new_from_const_memory ()

GTypelib *          g_typelib_new_from_const_memory     (const guchar *memory,
                                                         gsize len);

Creates a new GTypelib from a memory location.

memory :

address of memory chunk containing the typelib

len :

length of memory chunk containing the typelib

Returns :

the new GTypelib

g_typelib_new_from_mapped_file ()

GTypelib *          g_typelib_new_from_mapped_file      (GMappedFile *mfile);

Creates a new GTypelib from a GMappedFile.

mfile :

a GMappedFile, that will be free'd when the repository is destroyed

Returns :

the new GTypelib

g_typelib_free ()

void                g_typelib_free                      (GTypelib *typelib);

Free a GTypelib.

typelib :

a GTypelib

g_typelib_symbol ()

gboolean            g_typelib_symbol                    (GTypelib *typelib,
                                                         const gchar *symbol_name,
                                                         gpointer *symbol);

Loads a symbol from GTypelib.

typelib :

the typelib

symbol_name :

name of symbol to be loaded

symbol :

returns a pointer to the symbol value

Returns :

TRUE on success

g_typelib_get_namespace ()

const gchar *       g_typelib_get_namespace             (GTypelib *typelib);

typelib :

Returns :


enum GIRepositoryError

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;

G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND

the typelib could not be found.

G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH

the namespace does not match the requested namespace.

G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT

the version of the typelib does not match the requested version.

G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND

the library used by the typelib could not be found.

G_IREPOSITORY_ERROR

#define G_IREPOSITORY_ERROR (g_irepository_error_quark ())


g_irepository_error_quark ()

GQuark              g_irepository_error_quark           (void);

Returns :


gi_cclosure_marshal_generic ()

void                gi_cclosure_marshal_generic         (GClosure *closure,
                                                         GValue *return_gvalue,
                                                         guint n_param_values,
                                                         const GValue *param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);

closure :

return_gvalue :

n_param_values :

param_values :

invocation_hint :

marshal_data :


enum GIInfoType

typedef enum
{
  GI_INFO_TYPE_INVALID,
  GI_INFO_TYPE_FUNCTION,
  GI_INFO_TYPE_CALLBACK,
  GI_INFO_TYPE_STRUCT,
  GI_INFO_TYPE_BOXED,
  GI_INFO_TYPE_ENUM,         /*  5 */
  GI_INFO_TYPE_FLAGS,
  GI_INFO_TYPE_OBJECT,
  GI_INFO_TYPE_INTERFACE,
  GI_INFO_TYPE_CONSTANT,
  GI_INFO_TYPE_ERROR_DOMAIN, /* 10 */
  GI_INFO_TYPE_UNION,
  GI_INFO_TYPE_VALUE,
  GI_INFO_TYPE_SIGNAL,
  GI_INFO_TYPE_VFUNC,
  GI_INFO_TYPE_PROPERTY,     /* 15 */
  GI_INFO_TYPE_FIELD,
  GI_INFO_TYPE_ARG,
  GI_INFO_TYPE_TYPE,
  GI_INFO_TYPE_UNRESOLVED
} GIInfoType;

The type of a GIBaseInfo struct.

GI_INFO_TYPE_INVALID

invalid type

GI_INFO_TYPE_FUNCTION

function, see GIFunctionInfo

GI_INFO_TYPE_CALLBACK

callback, see GICallbackInfo

GI_INFO_TYPE_STRUCT

struct, see GIStructInfo

GI_INFO_TYPE_BOXED

boxed, see GIBoxedInfo

GI_INFO_TYPE_ENUM

enum, see GIEnumInfo

GI_INFO_TYPE_FLAGS

flags, see GIEnumInfo

GI_INFO_TYPE_OBJECT

object, see GIObjectInfo

GI_INFO_TYPE_INTERFACE

interface, see GIInterfaceInfo

GI_INFO_TYPE_CONSTANT

contant, see GIConstantInfo

GI_INFO_TYPE_ERROR_DOMAIN

error domain for a GError, see GIErrorDomainInfo

GI_INFO_TYPE_UNION

union, see GIUnionInfo

GI_INFO_TYPE_VALUE

enum value, see GIValueInfo

GI_INFO_TYPE_SIGNAL

signal, see GISignalInfo

GI_INFO_TYPE_VFUNC

virtual function, see GIVFuncInfo

GI_INFO_TYPE_PROPERTY

GObject property, see GIPropertyInfo

GI_INFO_TYPE_FIELD

struct or union field, see GIFieldInfo

GI_INFO_TYPE_ARG

argument of a function or callback, see GIArgInfo

GI_INFO_TYPE_TYPE

type information, see GITypeInfo

GI_INFO_TYPE_UNRESOLVED

unresolved type, a type which is not present in the typelib, or any of its dependencies.

g_info_new ()

GIBaseInfo *        g_info_new                          (GIInfoType type,
                                                         GIBaseInfo *container,
                                                         GTypelib *typelib,
                                                         guint32 offset);

type :

container :

typelib :

offset :

Returns :


G_INVOKE_ERROR

#define G_INVOKE_ERROR (g_invoke_error_quark ())


g_invoke_error_quark ()

GQuark              g_invoke_error_quark                (void);

Returns :


enum GITransfer

typedef enum {
  GI_TRANSFER_NOTHING,
  GI_TRANSFER_CONTAINER,
  GI_TRANSFER_EVERYTHING
} GITransfer;

Represent the transfer ownership information of a GICallableInfo or a GIArgInfo.

GI_TRANSFER_NOTHING

transfer nothing to the caller

GI_TRANSFER_CONTAINER

transfer the container (eg list, array, hashtable), but no the contents to the caller.

GI_TRANSFER_EVERYTHING

transfer everything to the caller.

enum GIDirection

typedef enum  {
  GI_DIRECTION_IN,
  GI_DIRECTION_OUT,
  GI_DIRECTION_INOUT
} GIDirection;

The direction of a GIArgInfo.

GI_DIRECTION_IN

in argument.

GI_DIRECTION_OUT

out argument.

GI_DIRECTION_INOUT

in and out argument.

enum GIScopeType

typedef enum {
  GI_SCOPE_TYPE_INVALID,
  GI_SCOPE_TYPE_CALL,
  GI_SCOPE_TYPE_ASYNC,
  GI_SCOPE_TYPE_NOTIFIED
} GIScopeType;

Scope type of a GIArgInfo representing callback, determines how the callback is invoked and is used to decided when the invoke structs can be freed.

GI_SCOPE_TYPE_INVALID

The argument is not of callback type.

GI_SCOPE_TYPE_CALL

The callback and associated user_data is only used during the call to this function.

GI_SCOPE_TYPE_ASYNC

The callback and associated user_data is only used until the callback is invoked, and the callback. is invoked always exactly once.

GI_SCOPE_TYPE_NOTIFIED

The callback and and associated user_data is used until the caller is notfied via the destroy_notify.