haskell-gi-base-0.26.9: Foundation for libraries generated by haskell-gi

Safe Haskell | None
Language | Haskell2010

Data.GI.Base

Description

## Convenience header for basic GObject-Introspection modules

See the documentation for each individual module for a description and usage help.

Synopsis

- get :: forall info (attr :: Symbol) obj result m. (AttrGetC info obj attr result, MonadIO m) => obj -> AttrLabelProxy attr -> m result
- set :: forall o m. MonadIO m => o -> [AttrOp o 'AttrSet] -> m ()
- data AttrOp obj (tag :: AttrOpTag) where
  - (:=) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy attr -> b -> AttrOp obj tag
  - (:=>) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy attr -> IO b -> AttrOp obj tag
  - (:~) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~ 'AttrSet, AttrOpAllowed 'AttrSet info obj, AttrOpAllowed 'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy attr -> (a -> b) -> AttrOp obj tag
  - (:~>) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~ 'AttrSet, AttrOpAllowed 'AttrSet info obj, AttrOpAllowed 'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy attr -> (a -> IO b) -> AttrOp obj tag
  - (:&=) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrTransferTypeConstraint info b, AttrSetTypeConstraint info (AttrTransferType info)) => AttrLabelProxy attr -> b -> AttrOp obj tag
  - (:!<~) :: forall obj info (attr :: Symbol) (tag1 :: AttrOpTag) b model (tag :: AttrOpTag). (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag1 info obj, AttrSetTypeConstraint info b, ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag
  - (:<~) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b model. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b, AttrOpAllowed 'AttrGet info obj, EqMaybe b (AttrGetType info), ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag
  - Bind :: forall obj info (propName :: Symbol) (tag :: AttrOpTag) model outType (components :: [Symbol]) (fieldName :: Symbol). (HasAttributeList obj, GObject obj, info ~ ResolveAttribute propName obj, AttrInfo info, KnownSymbol (AttrLabel info), AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrOpAllowed 'AttrPut info obj, ?_haskell_gi_modelProxy :: ModelProxy model, outType ~ AttrGetType info, AttrSetTypeConstraint info outType, components ~ Components fieldName, PathFieldAccess components model outType, KnownSymbol fieldName, Eq outType) => AttrLabelProxy propName -> AttrLabelProxy fieldName -> AttrOp obj tag
  - On :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag
  - After :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag
- module Data.GI.Base.BasicConversions
- module Data.GI.Base.BasicTypes
- data GClosure a
- new :: (Constructible a tag, MonadIO m) => (ManagedPtr a -> a) -> [AttrOp a tag] -> m a
- module Data.GI.Base.GError
- module Data.GI.Base.GHashTable
- newtype GValue = GValue (ManagedPtr GValue)
- fromGValue :: (IsGValue a, MonadIO m) => GValue -> m a
- toGValue :: (IsGValue a, MonadIO m) => a -> m GValue
- class IsGValue a where
  - gvalueGType_ :: IO GType
  - gvalueSet_ :: Ptr GValue -> a -> IO ()
  - gvalueGet_ :: Ptr GValue -> IO a
- module Data.GI.Base.GVariant
- module Data.GI.Base.ManagedPtr
- on :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> ((?self :: object) => HaskellCallbackType info) -> m SignalHandlerId
- after :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> ((?self :: object) => HaskellCallbackType info) -> m SignalHandlerId
- data SignalProxy object info where
  - (:::) :: forall object info. SignalProxy object info -> Text -> SignalProxy object info
  - PropertyNotify :: forall info1 (propName :: Symbol) object (pl :: Symbol). (info1 ~ ResolveAttribute propName object, AttrInfo info1, pl ~ AttrLabel info1, KnownSymbol pl) => AttrLabelProxy propName -> SignalProxy object GObjectNotifySignalInfo
  - PropertySet :: forall info1 (propName :: Symbol) object b (pl :: Symbol). (info1 ~ ResolveAttribute propName object, AttrInfo info1, AttrBaseTypeConstraint info1 object, b ~ AttrGetType info1, pl ~ AttrLabel info1, KnownSymbol pl) => AttrLabelProxy propName -> SignalProxy object (GObjectPropertySetSignalInfo b)
- asA :: (ManagedPtrNewtype a, ManagedPtrNewtype b, HasParentTypes b, IsDescendantOf a b) => b -> (ManagedPtr a -> a) -> a

# Documentation

get :: forall info (attr :: Symbol) obj result m. (AttrGetC info obj attr result, MonadIO m) => obj -> AttrLabelProxy attr -> m result Source #

Get the value of an attribute for an object.

set :: forall o m. MonadIO m => o -> [AttrOp o 'AttrSet] -> m () Source #

Set a number of properties for some object.

data AttrOp obj (tag :: AttrOpTag) where Source #

Constructors for the different operations allowed on an attribute.

Constructors

(:=) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy attr -> b -> AttrOp obj tag infixr 0 | Assign a value to an attribute
(:=>) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy attr -> IO b -> AttrOp obj tag infixr 0 | Assign the result of an IO action to an attribute

(:~) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~ 'AttrSet, AttrOpAllowed 'AttrSet info obj, AttrOpAllowed 'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy attr -> (a -> b) -> AttrOp obj tag infixr 0

Apply an update function to an attribute

(:~>) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~ 'AttrSet, AttrOpAllowed 'AttrSet info obj, AttrOpAllowed 'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy attr -> (a -> IO b) -> AttrOp obj tag infixr 0

Apply an IO update function to an attribute

(:&=) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrTransferTypeConstraint info b, AttrSetTypeConstraint info (AttrTransferType info)) => AttrLabelProxy attr -> b -> AttrOp obj tag

Assign a value to an attribute, allocating any necessary memory for representing the Haskell value as a C value. Note that it is the responsibility of the caller to make sure that the memory is freed when no longer used, otherwise there will be a memory leak. In the majority of cases you probably want to use `:=` instead, which has no potential memory leaks (at the cost of sometimes requiring some explicit Haskell -> C marshalling).

(:!<~) :: forall obj info (attr :: Symbol) (tag1 :: AttrOpTag) b model (tag :: AttrOpTag). (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag1 info obj, AttrSetTypeConstraint info b, ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag infixr 0

Bind a property to the given `DynVal`, so that the property is changed whenever the `DynVal` is. This requires the implicit param `?_haskell_gi_modelProxy`, of type ``ModelProxy` model` to be set.

(:<~) :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b model. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b, AttrOpAllowed 'AttrGet info obj, EqMaybe b (AttrGetType info), ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag infixr 0

Bind a property to the given `DynVal`, so that the property is changed whenever the `DynVal` is. This requires the implicit param `?_haskell_gi_modelProxy`, of type ``ModelProxy` model` to be set. This will only actually set the property whenever the `DynVal` changes if the new value of the `DynVal` is different from the actual value of the property. If you want to set the property without checking equality you can use `:!<~` instead.

Bind :: forall obj info (propName :: Symbol) (tag :: AttrOpTag) model outType (components :: [Symbol]) (fieldName :: Symbol). (HasAttributeList obj, GObject obj, info ~ ResolveAttribute propName obj, AttrInfo info, KnownSymbol (AttrLabel info), AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrOpAllowed 'AttrPut info obj, ?_haskell_gi_modelProxy :: ModelProxy model, outType ~ AttrGetType info, AttrSetTypeConstraint info outType, components ~ Components fieldName, PathFieldAccess components model outType, KnownSymbol fieldName, Eq outType) => AttrLabelProxy propName -> AttrLabelProxy fieldName -> AttrOp obj tag

Given an AttrLabelProxy, bind the given attribute to the corresponding field in the model proxy (if there's one), so that changes in the attribute are reflected back into changes of the model.

On :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag | Connect the given signal to a signal handler.
After :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag | Like `On`, but connect after the default signal.

module Data.GI.Base.BasicConversions

module Data.GI.Base.BasicTypes

data GClosure a Source #

The basic type. This corresponds to a wrapped `GClosure` on the C side, which is a boxed object.

#### Instances

Instances details

GBoxed (GClosure a) Source # | `GClosure`s are registered as boxed in the GLib type system.
Instance details Defined in Data.GI.Base.GClosure
TypedObject (GClosure a) Source # | Find the associated `GType` for the given closure.
Instance details Defined in Data.GI.Base.GClosure Methods glibType :: IO GType Source #
HasParentTypes (GClosure a) Source # |
Instance details Defined in Data.GI.Base.GClosure
type ParentTypes (GClosure a) Source # | There are no types in the bindings that a closure can be safely cast to.
Instance details Defined in Data.GI.Base.GClosure type ParentTypes (GClosure a) = '[] :: [Type]

new :: (Constructible a tag, MonadIO m) => (ManagedPtr a -> a) -> [AttrOp a tag] -> m a Source #

Allocate a new instance of the given type, with the given attributes.

module Data.GI.Base.GError

module Data.GI.Base.GHashTable

newtype GValue Source #

Haskell-side representation of a `GValue`.

Constructors

GValue (ManagedPtr GValue) |

#### Instances

Instances details

GBoxed GValue Source # | `GValue`s are registered as boxed in the GLib type system.
Instance details Defined in Data.GI.Base.GValue
TypedObject GValue Source # | Find the associated `GType` for `GValue`.
Instance details Defined in Data.GI.Base.GValue Methods glibType :: IO GType Source #
HasParentTypes GValue Source # |
Instance details Defined in Data.GI.Base.GValue
type ParentTypes GValue Source # | There are no types in the bindings that a `GValue` can be safely cast to.
Instance details Defined in Data.GI.Base.GValue type ParentTypes GValue = '[] :: [Type]

fromGValue :: (IsGValue a, MonadIO m) => GValue -> m a Source #

Create a Haskell object out of the given `GValue`.

toGValue :: (IsGValue a, MonadIO m) => a -> m GValue Source #

Create a `GValue` from the given Haskell value.

class IsGValue a where Source #

Class for types that can be marshaled back and forth between Haskell values and `GValue`s. These are low-level methods, you might want to use `toGValue` and `fromGValue` instead for a higher level interface.

Methods

gvalueGType_ Source #

Arguments

:: IO GType | `GType` for the `GValue` containing values of this type.

gvalueSet_ Source #

Arguments

:: Ptr GValue |
-> a |
-> IO () | Set the `GValue` to the given Haskell value.

gvalueGet_ Source #

Arguments

:: Ptr GValue |
-> IO a | Get the Haskel value inside the `GValue`.

#### Instances

Instances details

IsGValue CInt Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> CInt -> IO () Source # gvalueGet_ :: Ptr GValue -> IO CInt Source #
IsGValue CLong Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> CLong -> IO () Source # gvalueGet_ :: Ptr GValue -> IO CLong Source #
IsGValue CUInt Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> CUInt -> IO () Source # gvalueGet_ :: Ptr GValue -> IO CUInt Source #
IsGValue CULong Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> CULong -> IO () Source # gvalueGet_ :: Ptr GValue -> IO CULong Source #
IsGValue Int32 Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Int32 -> IO () Source # gvalueGet_ :: Ptr GValue -> IO Int32 Source #
IsGValue Int64 Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Int64 -> IO () Source # gvalueGet_ :: Ptr GValue -> IO Int64 Source #
IsGValue Word32 Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Word32 -> IO () Source # gvalueGet_ :: Ptr GValue -> IO Word32 Source #
IsGValue Word64 Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Word64 -> IO () Source # gvalueGet_ :: Ptr GValue -> IO Word64 Source #
IsGValue GType Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> GType -> IO () Source # gvalueGet_ :: Ptr GValue -> IO GType Source #
IsGValue Bool Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Bool -> IO () Source # gvalueGet_ :: Ptr GValue -> IO Bool Source #
IsGValue Double Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Double -> IO () Source # gvalueGet_ :: Ptr GValue -> IO Double Source #
IsGValue Float Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Float -> IO () Source # gvalueGet_ :: Ptr GValue -> IO Float Source #
IsGValue (Ptr a) Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Ptr a -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Ptr a) Source #
IsGValue (StablePtr a) Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> StablePtr a -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (StablePtr a) Source #
Typeable a => IsGValue (HValue a) Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> HValue a -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (HValue a) Source #
IsGValue (Maybe GParamSpec) Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe GParamSpec -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe GParamSpec) Source #
IsGValue (Maybe Text) Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Text -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Text) Source #
IsGValue (Maybe String) Source # |
Instance details Defined in Data.GI.Base.GValue Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe String -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe String) Source #

module Data.GI.Base.GVariant

module Data.GI.Base.ManagedPtr

on :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> ((?self :: object) => HaskellCallbackType info) -> m SignalHandlerId Source #

Connect a signal to a signal handler.

after :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> ((?self :: object) => HaskellCallbackType info) -> m SignalHandlerId Source #

Connect a signal to a handler, running the handler after the default one.

data SignalProxy object info where Source #

Support for overloaded signal connectors.

Constructors

(:::) :: forall object info. SignalProxy object info -> Text -> SignalProxy object info | A signal connector annotated with a detail.
PropertyNotify :: forall info1 (propName :: Symbol) object (pl :: Symbol). (info1 ~ ResolveAttribute propName object, AttrInfo info1, pl ~ AttrLabel info1, KnownSymbol pl) => AttrLabelProxy propName -> SignalProxy object GObjectNotifySignalInfo | A signal connector for the `notify` signal on the given property.

PropertySet :: forall info1 (propName :: Symbol) object b (pl :: Symbol). (info1 ~ ResolveAttribute propName object, AttrInfo info1, AttrBaseTypeConstraint info1 object, b ~ AttrGetType info1, pl ~ AttrLabel info1, KnownSymbol pl) => AttrLabelProxy propName -> SignalProxy object (GObjectPropertySetSignalInfo b)

A signal connector for the `notify` signal on the given property, similar to `PropertyNotify`, but it passes the new value of the property to the callback for convenience.

#### Instances

Instances details

info ~ ResolveSignal slot object => IsLabel slot (SignalProxy object info) Source # | Support for overloaded labels.
Instance details Defined in Data.GI.Base.Signals Methods fromLabel :: SignalProxy object info Source #

asA :: (ManagedPtrNewtype a, ManagedPtrNewtype b, HasParentTypes b, IsDescendantOf a b) => b -> (ManagedPtr a -> a) -> a Source #

Safe coercions to a parent class. For instance:

    #show $ label `asA` Gtk.Widget