gi-gobject-2.0.31: GObject bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.GObject.Structs.TypeInterface

Contents

- Exported types
- Methods
  - addPrerequisite
  - getPlugin
  - instantiatablePrerequisite
  - peek
  - peekParent
  - prerequisites

Description

An opaque structure used as the base of all interface types.

Synopsis

- newtype TypeInterface = TypeInterface (ManagedPtr TypeInterface)
- newZeroTypeInterface :: MonadIO m => m TypeInterface
- typeInterfaceAddPrerequisite :: (HasCallStack, MonadIO m) => GType -> GType -> m ()
- typeInterfaceGetPlugin :: (HasCallStack, MonadIO m) => GType -> GType -> m TypePlugin
- typeInterfaceInstantiatablePrerequisite :: (HasCallStack, MonadIO m) => GType -> m GType
- typeInterfacePeek :: (HasCallStack, MonadIO m) => TypeClass -> GType -> m (Maybe TypeInterface)
- typeInterfacePeekParent :: (HasCallStack, MonadIO m) => TypeInterface -> m (Maybe TypeInterface)
- typeInterfacePrerequisites :: (HasCallStack, MonadIO m) => GType -> m [GType]

# Exported types

newtype TypeInterface Source #

Memory-managed wrapper type.

Constructors

TypeInterface (ManagedPtr TypeInterface) |

#### Instances

Instances details

Eq TypeInterface Source # |
Instance details Defined in GI.GObject.Structs.TypeInterface Methods (==) :: TypeInterface -> TypeInterface -> Bool Source # (/=) :: TypeInterface -> TypeInterface -> Bool Source #
BoxedPtr TypeInterface Source # |
Instance details Defined in GI.GObject.Structs.TypeInterface Methods boxedPtrCopy :: TypeInterface -> IO TypeInterface Source # boxedPtrFree :: TypeInterface -> IO () Source #
CallocPtr TypeInterface Source # |
Instance details Defined in GI.GObject.Structs.TypeInterface Methods boxedPtrCalloc :: IO (Ptr TypeInterface) Source #
ManagedPtrNewtype TypeInterface Source # |
Instance details Defined in GI.GObject.Structs.TypeInterface Methods toManagedPtr :: TypeInterface -> ManagedPtr TypeInterface Source #
tag ~ 'AttrSet => Constructible TypeInterface tag Source # |
Instance details Defined in GI.GObject.Structs.TypeInterface Methods new :: MonadIO m => (ManagedPtr TypeInterface -> TypeInterface) -> [AttrOp TypeInterface tag] -> m TypeInterface Source #

newZeroTypeInterface :: MonadIO m => m TypeInterface Source #

Construct a `TypeInterface` struct initialized to zero.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

peekParent.

#### Getters

None.

#### Setters

None.

## addPrerequisite

typeInterfaceAddPrerequisite Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GType | `interfaceType`: `GType` value of an interface type
-> GType | `prerequisiteType`: `GType` value of an interface or instantiatable type
-> m () |

Adds `prerequisiteType` to the list of prerequisites of `interfaceType`. This means that any type implementing `interfaceType` must also implement `prerequisiteType`. Prerequisites can be thought of as an alternative to interface derivation (which GType doesn't support). An interface can have at most one instantiatable prerequisite type.

## getPlugin

typeInterfaceGetPlugin Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GType | `instanceType`: `GType` of an instantiatable type
-> GType | `interfaceType`: `GType` of an interface type
-> m TypePlugin | Returns: the `TypePlugin` for the dynamic interface `interfaceType` of `instanceType`

Returns the `TypePlugin` structure for the dynamic interface `interfaceType` which has been added to `instanceType`, or `Nothing` if `interfaceType` has not been added to `instanceType` or does not have a `TypePlugin` structure. See `typeAddInterfaceDynamic`.

## instantiatablePrerequisite

typeInterfaceInstantiatablePrerequisite Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GType | `interfaceType`: an interface type
-> m GType | Returns: the instantiatable prerequisite type or `G_TYPE_INVALID` if none

Returns the most specific instantiatable prerequisite of an interface type. If the interface type has no instantiatable prerequisite, `G_TYPE_INVALID` is returned.

See `typeInterfaceAddPrerequisite` for more information about prerequisites.

Since: 2.68

## peek

typeInterfacePeek Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TypeClass | `instanceClass`: a `TypeClass` structure
-> GType | `ifaceType`: an interface ID which this class conforms to
-> m (Maybe TypeInterface) | Returns: the `TypeInterface` structure of `ifaceType` if implemented by `instanceClass`, `Nothing` otherwise

Returns the `TypeInterface` structure of an interface to which the passed in class conforms.

## peekParent

typeInterfacePeekParent Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TypeInterface | `gIface`: a `TypeInterface` structure
-> m (Maybe TypeInterface) | Returns: the corresponding `TypeInterface` structure of the parent type of the instance type to which `gIface` belongs, or `Nothing` if the parent type doesn't conform to the interface

Returns the corresponding `TypeInterface` structure of the parent type of the instance type to which `gIface` belongs.

This is useful when deriving the implementation of an interface from the parent type and then possibly overriding some methods.

## prerequisites

typeInterfacePrerequisites Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GType | `interfaceType`: an interface type
-> m [GType] | Returns: a newly-allocated zero-terminated array of `GType` containing the prerequisites of `interfaceType`

Returns the prerequisites of an interfaces type.

Since: 2.2