Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
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.
Synopsis
- newtype Buildable = Buildable (ManagedPtr Buildable)
- class (GObject o, IsDescendantOf Buildable o) => IsBuildable o
- toBuildable :: (MonadIO m, IsBuildable o) => o -> m Buildable
- buildableAddChild :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => a -> b -> c -> Maybe Text -> m ()
- buildableConstructChild :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) => a -> b -> Text -> m Object
- buildableCustomFinished :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => a -> b -> Maybe c -> Text -> Ptr () -> m ()
- buildableCustomTagEnd :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => a -> b -> Maybe c -> Text -> Ptr () -> m ()
- buildableCustomTagStart :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b, IsObject c) => a -> b -> Maybe c -> Text -> m (Bool, MarkupParser, Ptr ())
- buildableGetInternalChild :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) => a -> b -> Text -> m Object
- buildableGetName :: (HasCallStack, MonadIO m, IsBuildable a) => a -> m Text
- buildableParserFinished :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) => a -> b -> m ()
- buildableSetBuildableProperty :: (HasCallStack, MonadIO m, IsBuildable a, IsBuilder b) => a -> b -> Text -> GValue -> m ()
- buildableSetName :: (HasCallStack, MonadIO m, IsBuildable a) => a -> Text -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Buildable Source # | |
GObject Buildable Source # | |
Defined in GI.Gtk.Interfaces.Buildable | |
ManagedPtrNewtype Buildable Source # | |
Defined in GI.Gtk.Interfaces.Buildable toManagedPtr :: Buildable -> ManagedPtr Buildable | |
TypedObject Buildable Source # | |
Defined in GI.Gtk.Interfaces.Buildable | |
HasParentTypes Buildable Source # | |
Defined in GI.Gtk.Interfaces.Buildable | |
IsGValue (Maybe Buildable) Source # | Convert |
Defined in GI.Gtk.Interfaces.Buildable gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Buildable -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Buildable) | |
type ParentTypes Buildable Source # | |
Defined in GI.Gtk.Interfaces.Buildable |
class (GObject o, IsDescendantOf Buildable o) => IsBuildable o Source #
Type class for types which can be safely cast to Buildable
, for instance with toBuildable
.
Instances
(GObject o, IsDescendantOf Buildable o) => IsBuildable o Source # | |
Defined in GI.Gtk.Interfaces.Buildable |
toBuildable :: (MonadIO m, IsBuildable o) => o -> m Buildable Source #
Methods
Click to display all available methods, including inherited ones
Methods
addChild, bindProperty, bindPropertyFull, constructChild, customFinished, customTagEnd, customTagStart, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, parserFinished, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getInternalChild, getName, getProperty, getQdata.
Setters
setBuildableProperty, setData, setDataFull, setName, setProperty.
addChild
:: (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
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
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
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
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
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
:: (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
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
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
:: (HasCallStack, MonadIO m, IsBuildable a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the name of the buildable
object.
Since: 2.12