Maintainer | gtk2hs-devel@lists.sourceforge.net |
---|---|
Stability | alpha |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
Base class for elements that can contain other elements.
- data Bin
- class ElementClass o => BinClass o
- castToBin :: GObjectClass obj => obj -> Bin
- gTypeBin :: GType
- binNew :: String -> IO Bin
- binAdd :: (BinClass bin, ElementClass element) => bin -> element -> IO Bool
- binRemove :: (BinClass bin, ElementClass element) => bin -> element -> IO Bool
- binGetByName :: BinClass bin => bin -> String -> IO (Maybe Element)
- binGetByNameRecurseUp :: BinClass bin => bin -> String -> IO (Maybe Element)
- binGetByInterface :: BinClass bin => bin -> GType -> IO (Maybe Element)
- binIterateElements :: BinClass bin => bin -> IO (Maybe (Iterator Element))
- binIterateRecurse :: BinClass bin => bin -> IO (Maybe (Iterator Element))
- binIterateSinks :: BinClass bin => bin -> IO (Maybe (Iterator Element))
- binIterateSorted :: BinClass bin => bin -> IO (Maybe (Iterator Element))
- binIterateSources :: BinClass bin => bin -> IO (Maybe (Iterator Element))
- binIterateAllByInterface :: BinClass bin => bin -> GType -> IO (Maybe (Iterator Element))
- binFindUnconnectedPad :: BinClass bin => bin -> PadDirection -> IO (Maybe Pad)
- binElementAdded :: BinClass bin => Signal bin (Element -> IO ())
- binElementRemoved :: BinClass bin => Signal bin (Element -> IO ())
Detail
Bin
is an element that can contain other Element
s, allowing
them to be managed as a group. Pad
s from the child elements
can be ghosted to the bin; see GhostPad
. This makes the bin
look like any other element, and enables creation of
higher-level abstractions.
A new Bin
is created with binNew
. Use a Pipeline
instead
if you want to create a toplevel bin, because a normal bin
doesn't have a bus or handle clock distribution of its own.
After the bin has been created you will typically add elements
to it with binAdd
. You can remove elements with binRemove
.
An element can be retrieved from a bin with binGetByName
,
using the element's name. binGetByNameRecurseUp
is mainly
used for internal purposes and will query the parent bins when
the element is not found in the current bin.
An iterator of elements in a bin can be retrieved with
binIterateElements
. Various other iterators exist to retrieve
the elements in a bin.
The binElementAdded
signal is fired whenever a new element is
added to the bin. Likewise the binElementRemoved
signal is
fired whenever an element is removed from the bin.
Types
castToBin :: GObjectClass obj => obj -> Bin Source #
Bin Operations
Create a new Bin
with the given name.
:: (BinClass bin, ElementClass element) | |
=> bin |
|
-> element |
|
-> IO Bool |
Remove element
from bin
, unparenting it as well.
If any element
's pads are linked to other pads, they will be
unlinked before element
is added to bin
.
:: BinClass bin | |
=> bin |
|
-> GType |
|
-> IO (Maybe Element) |
Find an Element
inside bin
that implements the interface
given by iface
. The returned Element
can be casted to
iface
's type. If you want all the Element
s that implement an
interface, use binIterateAllByInterface
.
This function recurses into child bins.
Get an iterator over the Element
s in bin
that have the
ElementIsSink
flag set.
Gets an iterator for the elements in this bin in topologically sorted order. This means that the elements are returned from the most downstream elements (sinks) to the sources.
This function is used internally to perform state changes of the bin elements.
Gets an iterator for all elements in the bin that have no sink
pads and have the ElementIsSink
flag unset.
binIterateAllByInterface Source #
:: BinClass bin | |
=> bin |
|
-> GType |
|
-> IO (Maybe (Iterator Element)) |
Looks for all elements inside the bin that implement the given interface. You can safely case all elements to the given interface. The function recurses inside child bins.
binFindUnconnectedPad Source #
:: BinClass bin | |
=> bin |
|
-> PadDirection |
|
-> IO (Maybe Pad) |
Recursively looks for elements with an unconnected pad of the
given direction within the specified bin. Returns an unconnected
pad if one is found, otherwise Nothing
.
Since 0.10.3.