gi-girepository-1.0.21: GIRepository (gobject-introspection) bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.GIRepository.Objects.Repository

Contents

Description

Repository is used to manage repositories of namespaces. Namespaces are represented on disk by type libraries (.typelib files).

Discovery of type libraries

Repository will typically look for a girepository-1.0 directory under the library directory used when compiling gobject-introspection.

It is possible to control the search paths programmatically, using repositoryPrependSearchPath. It is also possible to modify the search paths by using the GI_TYPELIB_PATH environment variable. The environment variable takes precedence over the default search path and the repositoryPrependSearchPath calls.

Synopsis

Exported types

newtype Repository Source #

Memory-managed wrapper type.

class (GObject o, IsDescendantOf Repository o) => IsRepository o Source #

Type class for types which can be safely cast to Repository, for instance with toRepository.

Instances
(GObject o, IsDescendantOf Repository o) => IsRepository o Source # 
Instance details

Defined in GI.GIRepository.Objects.Repository

toRepository :: (MonadIO m, IsRepository o) => o -> m Repository Source #

Cast to Repository, for types for which this is known to be safe. For general casts, use castTo.

Methods

dump

repositoryDump Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text 
-> m ()

(Can throw GError)

No description available in the introspection data.

enumerateVersions

repositoryEnumerateVersions Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: GI namespace, e.g. "Gtk"

-> m [Text]

Returns: the array of versions.

Obtain an unordered list of versions (either currently loaded or available) for namespace_ in this repository.

errorQuark

repositoryErrorQuark :: (HasCallStack, MonadIO m) => m Word32 Source #

No description available in the introspection data.

findByErrorDomain

repositoryFindByErrorDomain Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Word32

domain: a GError domain

-> m BaseInfo

Returns: GIEnumInfo representing metadata about domain's enum type, or Nothing

Searches for the enum type corresponding to the given GError domain. Before calling this function for a particular namespace, you must call repositoryRequire once to load the namespace, or otherwise ensure the namespace has already been loaded.

Since: 1.30

findByGtype

repositoryFindByGtype Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> GType

gtype: GType to search for

-> m BaseInfo

Returns: BaseInfo representing metadata about type, or Nothing

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.

findByName

repositoryFindByName Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace which will be searched

-> Text

name: Entry name to find

-> m BaseInfo

Returns: BaseInfo representing metadata about name, or Nothing

Searches for a particular entry in a namespace. Before calling this function for a particular namespace, you must call repositoryRequire once to load the namespace, or otherwise ensure the namespace has already been loaded.

getCPrefix

repositoryGetCPrefix Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace to inspect

-> m Text

Returns: C namespace prefix, or Nothing if none associated

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 repositoryRequire before calling this function.

getDefault

repositoryGetDefault Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Repository

Returns: The global singleton Repository

Returns the singleton process-global default Repository. 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 Repository also accept Nothing as an instance parameter to mean this default repository, which is usually more convenient for C.

getDependencies

repositoryGetDependencies Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace of interest

-> m [Text]

Returns: Zero-terminated string array of all versioned dependencies

Return an array of all (transitive) versioned dependencies for namespace_. Returned strings are of the form <code>namespace-version</code>.

Note: namespace_ must have already been loaded using a function such as repositoryRequire before calling this function.

To get only the immediate dependencies for namespace_, use repositoryGetImmediateDependencies.

getImmediateDependencies

repositoryGetImmediateDependencies Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace of interest

-> m [Text]

Returns: Zero-terminated string array of immediate versioned dependencies

Return an array of the immediate versioned dependencies for namespace_. Returned strings are of the form <code>namespace-version</code>.

Note: namespace_ must have already been loaded using a function such as repositoryRequire before calling this function.

To get the transitive closure of dependencies for namespace_, use repositoryGetDependencies.

Since: 1.44

getInfo

repositoryGetInfo Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace to inspect

-> Int32

index: 0-based offset into namespace metadata for entry

-> m BaseInfo

Returns: BaseInfo containing metadata

This function returns a particular metadata entry in the given namespace namespace_. The namespace must have already been loaded before calling this function. See repositoryGetNInfos to find the maximum number of entries.

getLoadedNamespaces

repositoryGetLoadedNamespaces Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> m [Text]

Returns: List of namespaces

Return the list of currently loaded namespaces.

getNInfos

repositoryGetNInfos Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace to inspect

-> m Int32

Returns: number of metadata entries

This function returns the number of metadata entries in given namespace namespace_. The namespace must have already been loaded before calling this function.

getObjectGtypeInterfaces

repositoryGetObjectGtypeInterfaces Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: a Repository, or Nothing for the default repository

-> GType

gtype: a GType whose fundamental type is G_TYPE_OBJECT

-> m [BaseInfo] 

Look up the implemented interfaces for gtype. This function cannot fail per se; but for a totally "unknown" GType, it may return 0 implemented interfaces.

The semantics of this function are designed for a dynamic binding, where in certain cases (such as a function which returns an interface which may have "hidden" implementation classes), not all data may be statically known, and will have to be determined from the GType of the object. An example is g_file_new_for_path() returning a concrete class of GLocalFile, which is a GType we see at runtime, but not statically.

Since: 1.60

getOptionGroup

repositoryGetOptionGroup Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m OptionGroup

Returns: the option group

Obtain the option group for girepository, it's used by the dumper and for programs that wants to provide introspection information

getSearchPath

repositoryGetSearchPath Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m [[Char]]

Returns: SList of strings

Returns the current search path Repository will use when loading typelib files. The list is internal to Repository and should not be freed, nor should its string elements.

getSharedLibrary

repositoryGetSharedLibrary Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace to inspect

-> m Text

Returns: Comma-separated list of paths to shared libraries, or Nothing if none are associated

This function returns a comma-separated list of paths to the shared C libraries associated with the given namespace namespace_. There may be no shared library path associated, in which case this function will return Nothing.

Note: The namespace must have already been loaded using a function such as repositoryRequire before calling this function.

getTypelibPath

repositoryGetTypelibPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

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

-> m Text

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

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

getVersion

repositoryGetVersion Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace to inspect

-> m Text

Returns: Loaded version

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 repositoryRequire before calling this function.

isRegistered

repositoryIsRegistered Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

namespace_: Namespace of interest

-> Maybe Text

version: Required version, may be Nothing for latest

-> m Bool

Returns: True if namespace-version is loaded, False otherwise

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 repositoryRequire instead which will ensure the namespace is loaded, and return as quickly as this function will if it has already been loaded.

loadTypelib

repositoryLoadTypelib Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Typelib

typelib: TODO

-> [RepositoryLoadFlags]

flags: TODO

-> m Text

(Can throw GError)

TODO

prependLibraryPath

repositoryPrependLibraryPath :: (HasCallStack, MonadIO m) => Text -> m () Source #

No description available in the introspection data.

prependSearchPath

repositoryPrependSearchPath Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [Char]

directory: directory name to prepend to the typelib search path

-> m () 

Prepends directory to the typelib search path.

See also: repositoryGetSearchPath.

require

repositoryRequire Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

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

-> Maybe Text

version: Version of namespace, may be Nothing for latest

-> [RepositoryLoadFlags]

flags: Set of GIRepositoryLoadFlags, may be 0

-> m Typelib

Returns: a pointer to the Typelib if successful, Nothing otherwise (Can throw GError)

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.

requirePrivate

repositoryRequirePrivate Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a) 
=> a

repository: A Repository or Nothing for the singleton process-global default Repository

-> Text

typelibDir: Private directory where to find the requested typelib

-> Text

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

-> Maybe Text

version: Version of namespace, may be Nothing for latest

-> [RepositoryLoadFlags]

flags: Set of GIRepositoryLoadFlags, may be 0

-> m Typelib

Returns: a pointer to the Typelib if successful, Nothing otherwise (Can throw GError)

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.