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 |
GtkBuildable allows objects to extend and customize their deserialization from [GtkBuilder UI descriptions][BUILDER-UI]. The interface includes methods for setting names and properties of objects, parsing custom tags and constructing child objects.
The GtkBuildable interface is implemented by all widgets and
many of the non-widget objects that are provided by GTK+. The
main user of this interface is Builder
. There should be
very little need for applications to call any of these functions directly.
An object only needs to implement this interface if it needs to extend the
Builder
format or run any extra routines at deserialization time.
- newtype Buildable = Buildable (ManagedPtr Buildable)
- noBuildable :: Maybe Buildable
- class GObject o => IsBuildable o
- toBuildable :: IsBuildable o => o -> IO Buildable
- data BuildableAddChildMethodInfo
- buildableAddChild :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => a -> b -> c -> Maybe Text -> m ()
- data BuildableConstructChildMethodInfo
- buildableConstructChild :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) => a -> b -> Text -> m Object
- data BuildableCustomFinishedMethodInfo
- buildableCustomFinished :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => a -> b -> Maybe c -> Text -> Ptr () -> m ()
- data BuildableCustomTagEndMethodInfo
- buildableCustomTagEnd :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => a -> b -> Maybe c -> Text -> Ptr () -> m ()
- data BuildableCustomTagStartMethodInfo
- buildableCustomTagStart :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => a -> b -> Maybe c -> Text -> m (Bool, MarkupParser, Ptr ())
- data BuildableGetInternalChildMethodInfo
- buildableGetInternalChild :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) => a -> b -> Text -> m Object
- data BuildableGetNameMethodInfo
- buildableGetName :: (HasCallStack, MonadIO m, IsBuildable a) => a -> m Text
- data BuildableParserFinishedMethodInfo
- buildableParserFinished :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) => a -> b -> m ()
- data BuildableSetBuildablePropertyMethodInfo
- buildableSetBuildableProperty :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) => a -> b -> Text -> GValue -> m ()
- data BuildableSetNameMethodInfo
- buildableSetName :: (HasCallStack, MonadIO m, IsBuildable a) => a -> Text -> m ()
Exported types
GObject Buildable Source # | |
IsObject Buildable Source # | |
IsBuildable Buildable Source # | |
((~) * info (ResolveBuildableMethod t Buildable), MethodInfo * info Buildable p) => IsLabel t (Buildable -> p) Source # | |
((~) * info (ResolveBuildableMethod t Buildable), MethodInfo * info Buildable p) => IsLabelProxy t (Buildable -> p) Source # | |
HasAttributeList * Buildable Source # | |
type AttributeList Buildable Source # | |
type SignalList Buildable Source # | |
class GObject o => IsBuildable o Source #
toBuildable :: IsBuildable o => o -> IO Buildable Source #
Methods
addChild
data BuildableAddChildMethodInfo Source #
((~) * signature (b -> c -> Maybe Text -> m ()), MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => MethodInfo * BuildableAddChildMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) | |
=> a |
|
-> b |
|
-> c |
|
-> Maybe Text |
|
-> m () |
Adds a child to buildable
. type
is an optional string
describing how the child should be added.
Since: 2.12
constructChild
data BuildableConstructChildMethodInfo Source #
((~) * signature (b -> Text -> m Object), MonadIO m, IsBuildable a, IsBuilder b) => MethodInfo * BuildableConstructChildMethodInfo a signature Source # | |
buildableConstructChild Source #
:: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) | |
=> a |
|
-> b |
|
-> Text |
|
-> m Object | Returns: the constructed child |
Constructs a child of buildable
with the name name
.
Builder
calls this function if a “constructor” has been
specified in the UI definition.
Since: 2.12
customFinished
data BuildableCustomFinishedMethodInfo Source #
((~) * signature (b -> Maybe c -> Text -> Ptr () -> m ()), MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => MethodInfo * BuildableCustomFinishedMethodInfo a signature Source # | |
buildableCustomFinished Source #
:: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) | |
=> a |
|
-> b |
|
-> Maybe c |
|
-> Text |
|
-> Ptr () |
|
-> m () |
This is similar to buildableParserFinished
but is
called once for each custom tag handled by the buildable
.
Since: 2.12
customTagEnd
data BuildableCustomTagEndMethodInfo Source #
((~) * signature (b -> Maybe c -> Text -> Ptr () -> m ()), MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => MethodInfo * BuildableCustomTagEndMethodInfo a signature Source # | |
buildableCustomTagEnd Source #
:: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) | |
=> a |
|
-> b |
|
-> Maybe c |
|
-> Text |
|
-> Ptr () |
|
-> m () |
This is called at the end of each custom element handled by the buildable.
Since: 2.12
customTagStart
data BuildableCustomTagStartMethodInfo Source #
((~) * signature (b -> Maybe c -> Text -> m (Bool, MarkupParser, Ptr ())), MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => MethodInfo * BuildableCustomTagStartMethodInfo a signature Source # | |
buildableCustomTagStart Source #
:: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) | |
=> a |
|
-> b |
|
-> Maybe c |
|
-> Text |
|
-> m (Bool, MarkupParser, Ptr ()) | Returns: |
This is called for each unknown element under <child>.
Since: 2.12
getInternalChild
data BuildableGetInternalChildMethodInfo Source #
((~) * signature (b -> Text -> m Object), MonadIO m, IsBuildable a, IsBuilder b) => MethodInfo * BuildableGetInternalChildMethodInfo a signature Source # | |
buildableGetInternalChild Source #
:: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) | |
=> a |
|
-> b |
|
-> Text |
|
-> m Object | Returns: the internal child of the buildable object |
Get the internal child called childname
of the buildable
object.
Since: 2.12
getName
data BuildableGetNameMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsBuildable a) => MethodInfo * BuildableGetNameMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBuildable a) | |
=> a |
|
-> m Text | Returns: the name set with |
Gets the name of the buildable
object.
Builder
sets the name based on the
[GtkBuilder UI definition][BUILDER-UI]
used to construct the buildable
.
Since: 2.12
parserFinished
data BuildableParserFinishedMethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsBuildable a, IsBuilder b) => MethodInfo * BuildableParserFinishedMethodInfo a signature Source # | |
buildableParserFinished Source #
:: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) | |
=> a |
|
-> b |
|
-> m () |
Called when the builder finishes the parsing of a
[GtkBuilder UI definition][BUILDER-UI].
Note that this will be called once for each time
builderAddFromFile
or builderAddFromString
is called on a builder.
Since: 2.12
setBuildableProperty
data BuildableSetBuildablePropertyMethodInfo Source #
((~) * signature (b -> Text -> GValue -> m ()), MonadIO m, IsBuildable a, IsBuilder b) => MethodInfo * BuildableSetBuildablePropertyMethodInfo a signature Source # | |
buildableSetBuildableProperty Source #
:: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) | |
=> a |
|
-> b |
|
-> Text |
|
-> GValue |
|
-> m () |
Sets the property name name
to value
on the buildable
object.
Since: 2.12
setName
data BuildableSetNameMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsBuildable a) => MethodInfo * BuildableSetNameMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBuildable a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the name of the buildable
object.
Since: 2.12