gi-atk-2.0.18: Atk bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com)
Safe Haskell | None
Language | Haskell2010

GI.Atk.Objects.Registry

Contents

- Exported types
- Methods
  - getFactory
  - getFactoryType
  - setFactoryType

Description

The AtkRegistry is normally used to create appropriate ATK "peers" for user interface components. Application developers usually need only interact with the AtkRegistry by associating appropriate ATK implementation classes with GObject classes via the atk_registry_set_factory_type call, passing the appropriate GType for application custom widget classes.

Synopsis

- newtype Registry = Registry (ManagedPtr Registry)
- class GObject o => IsRegistry o
- toRegistry :: (MonadIO m, IsRegistry o) => o -> m Registry
- noRegistry :: Maybe Registry
- registryGetFactory :: (HasCallStack, MonadIO m, IsRegistry a) => a -> GType -> m ObjectFactory
- registryGetFactoryType :: (HasCallStack, MonadIO m, IsRegistry a) => a -> GType -> m GType
- registrySetFactoryType :: (HasCallStack, MonadIO m, IsRegistry a) => a -> GType -> GType -> m ()

# Exported types

newtype Registry Source #

Memory-managed wrapper type.

Constructors

Registry (ManagedPtr Registry) |

Instances

GObject Registry Source # |
Instance details Defined in GI.Atk.Objects.Registry Methods gobjectType :: Registry -> IO GType Source #
IsObject Registry Source # |
Instance details Defined in GI.Atk.Objects.Registry
IsRegistry Registry Source # |
Instance details Defined in GI.Atk.Objects.Registry

class GObject o => IsRegistry o Source #

Type class for types which can be safely cast to `Registry`, for instance with `toRegistry`.

Instances

(GObject a, (UnknownAncestorError Registry a :: Constraint)) => IsRegistry a Source # |
Instance details Defined in GI.Atk.Objects.Registry
IsRegistry Registry Source # |
Instance details Defined in GI.Atk.Objects.Registry

toRegistry :: (MonadIO m, IsRegistry o) => o -> m Registry Source #

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

noRegistry :: Maybe Registry Source #

A convenience alias for `Nothing` :: `Maybe` `Registry`.

# Methods

## getFactory

registryGetFactory Source #

Arguments

:: (HasCallStack, MonadIO m, IsRegistry a) |
=> a | `registry`: an `Registry`
-> GType | `type`: a `GType` with which to look up the associated `ObjectFactory`
-> m ObjectFactory | Returns: an `ObjectFactory` appropriate for creating `AtkObjects` appropriate for `type`.

Gets an `ObjectFactory` appropriate for creating `AtkObjects` appropriate for `type`.

## getFactoryType

registryGetFactoryType Source #

Arguments

:: (HasCallStack, MonadIO m, IsRegistry a) |
=> a | `registry`: an `Registry`
-> GType | `type`: a `GType` with which to look up the associated `ObjectFactory` subclass
-> m GType | Returns: a `GType` associated with type `type`

Provides a `GType` indicating the `ObjectFactory` subclass associated with `type`.

## setFactoryType

registrySetFactoryType Source #

Arguments

:: (HasCallStack, MonadIO m, IsRegistry a) |
=> a | `registry`: the `Registry` in which to register the type association
-> GType | `type`: an `Object` type
-> GType | `factoryType`: an `ObjectFactory` type to associate with `type`. Must implement AtkObject appropriate for `type`.
-> m () |

Associate an `ObjectFactory` subclass with a `GType`. Note: The associated `factoryType` will thereafter be responsible for the creation of new `Object` implementations for instances appropriate for `type`.