Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
The CellAreaContext
object is created by a given CellArea
implementation via its CellAreaClass
.create_context
() virtual
method and is used to store cell sizes and alignments for a series of
TreeModel
rows that are requested and rendered in the same context.
CellLayout
widgets can create any number of contexts in which to
request and render groups of data rows. However, it’s important that the
same context which was used to request sizes for a given TreeModel
row also be used for the same row when calling other CellArea
APIs
such as cellAreaRender
and cellAreaEvent
.
Synopsis
- newtype CellAreaContext = CellAreaContext (ManagedPtr CellAreaContext)
- class (GObject o, IsDescendantOf CellAreaContext o) => IsCellAreaContext o
- toCellAreaContext :: (MonadIO m, IsCellAreaContext o) => o -> m CellAreaContext
- cellAreaContextAllocate :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> Int32 -> Int32 -> m ()
- cellAreaContextGetAllocation :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> m (Int32, Int32)
- cellAreaContextGetArea :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> m CellArea
- cellAreaContextGetPreferredHeight :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> m (Int32, Int32)
- cellAreaContextGetPreferredHeightForWidth :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> Int32 -> m (Int32, Int32)
- cellAreaContextGetPreferredWidth :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> m (Int32, Int32)
- cellAreaContextGetPreferredWidthForHeight :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> Int32 -> m (Int32, Int32)
- cellAreaContextPushPreferredHeight :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> Int32 -> Int32 -> m ()
- cellAreaContextPushPreferredWidth :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> Int32 -> Int32 -> m ()
- cellAreaContextReset :: (HasCallStack, MonadIO m, IsCellAreaContext a) => a -> m ()
- constructCellAreaContextArea :: (IsCellAreaContext o, MonadIO m, IsCellArea a) => a -> m (GValueConstruct o)
- getCellAreaContextArea :: (MonadIO m, IsCellAreaContext o) => o -> m CellArea
- getCellAreaContextMinimumHeight :: (MonadIO m, IsCellAreaContext o) => o -> m Int32
- getCellAreaContextMinimumWidth :: (MonadIO m, IsCellAreaContext o) => o -> m Int32
- getCellAreaContextNaturalHeight :: (MonadIO m, IsCellAreaContext o) => o -> m Int32
- getCellAreaContextNaturalWidth :: (MonadIO m, IsCellAreaContext o) => o -> m Int32
Exported types
newtype CellAreaContext Source #
Memory-managed wrapper type.
Instances
Eq CellAreaContext Source # | |
Defined in GI.Gtk.Objects.CellAreaContext (==) :: CellAreaContext -> CellAreaContext -> Bool # (/=) :: CellAreaContext -> CellAreaContext -> Bool # | |
IsGValue CellAreaContext Source # | Convert |
Defined in GI.Gtk.Objects.CellAreaContext toGValue :: CellAreaContext -> IO GValue # fromGValue :: GValue -> IO CellAreaContext # | |
ManagedPtrNewtype CellAreaContext Source # | |
Defined in GI.Gtk.Objects.CellAreaContext | |
TypedObject CellAreaContext Source # | |
Defined in GI.Gtk.Objects.CellAreaContext | |
GObject CellAreaContext Source # | |
Defined in GI.Gtk.Objects.CellAreaContext | |
HasParentTypes CellAreaContext Source # | |
Defined in GI.Gtk.Objects.CellAreaContext | |
type ParentTypes CellAreaContext Source # | |
Defined in GI.Gtk.Objects.CellAreaContext |
class (GObject o, IsDescendantOf CellAreaContext o) => IsCellAreaContext o Source #
Type class for types which can be safely cast to CellAreaContext
, for instance with toCellAreaContext
.
Instances
(GObject o, IsDescendantOf CellAreaContext o) => IsCellAreaContext o Source # | |
Defined in GI.Gtk.Objects.CellAreaContext |
toCellAreaContext :: (MonadIO m, IsCellAreaContext o) => o -> m CellAreaContext Source #
Cast to CellAreaContext
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
allocate
cellAreaContextAllocate Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Allocates a width and/or a height for all rows which are to be
rendered with context
.
Usually allocation is performed only horizontally or sometimes
vertically since a group of rows are usually rendered side by
side vertically or horizontally and share either the same width
or the same height. Sometimes they are allocated in both horizontal
and vertical orientations producing a homogeneous effect of the
rows. This is generally the case for TreeView
when
TreeView
:fixed-height-mode
is enabled.
Since 3.0
getAllocation
cellAreaContextGetAllocation Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> m (Int32, Int32) |
Fetches the current allocation size for context
.
If the context was not allocated in width or height, or if the
context was recently reset with cellAreaContextReset
,
the returned value will be -1.
Since: 3.0
getArea
cellAreaContextGetArea Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> m CellArea | Returns: the |
Fetches the CellArea
this context
was created by.
This is generally unneeded by layouting widgets; however, it is important for the context implementation itself to fetch information about the area it is being used for.
For instance at CellAreaContextClass
.allocate
() time
it’s important to know details about any cell spacing
that the CellArea
is configured with in order to
compute a proper allocation.
Since: 3.0
getPreferredHeight
cellAreaContextGetPreferredHeight Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> m (Int32, Int32) |
Gets the accumulative preferred height for all rows which have been requested with this context.
After cellAreaContextReset
is called and/or before ever
requesting the size of a CellArea
, the returned values are 0.
Since: 3.0
getPreferredHeightForWidth
cellAreaContextGetPreferredHeightForWidth Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> Int32 |
|
-> m (Int32, Int32) |
Gets the accumulative preferred height for width
for all rows
which have been requested for the same said width
with this context.
After cellAreaContextReset
is called and/or before ever
requesting the size of a CellArea
, the returned values are -1.
Since: 3.0
getPreferredWidth
cellAreaContextGetPreferredWidth Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> m (Int32, Int32) |
Gets the accumulative preferred width for all rows which have been requested with this context.
After cellAreaContextReset
is called and/or before ever
requesting the size of a CellArea
, the returned values are 0.
Since: 3.0
getPreferredWidthForHeight
cellAreaContextGetPreferredWidthForHeight Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> Int32 |
|
-> m (Int32, Int32) |
Gets the accumulative preferred width for height
for all rows which
have been requested for the same said height
with this context.
After cellAreaContextReset
is called and/or before ever
requesting the size of a CellArea
, the returned values are -1.
Since: 3.0
pushPreferredHeight
cellAreaContextPushPreferredHeight Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Causes the minimum and/or natural height to grow if the new proposed sizes exceed the current minimum and natural height.
This is used by CellAreaContext
implementations during
the request process over a series of TreeModel
rows to
progressively push the requested height over a series of
cellAreaGetPreferredHeight
requests.
Since: 3.0
pushPreferredWidth
cellAreaContextPushPreferredWidth Source #
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Causes the minimum and/or natural width to grow if the new proposed sizes exceed the current minimum and natural width.
This is used by CellAreaContext
implementations during
the request process over a series of TreeModel
rows to
progressively push the requested width over a series of
cellAreaGetPreferredWidth
requests.
Since: 3.0
reset
:: (HasCallStack, MonadIO m, IsCellAreaContext a) | |
=> a |
|
-> m () |
Resets any previously cached request and allocation data.
When underlying TreeModel
data changes its
important to reset the context if the content
size is allowed to shrink. If the content size
is only allowed to grow (this is usually an option
for views rendering large data stores as a measure
of optimization), then only the row that changed
or was inserted needs to be (re)requested with
cellAreaGetPreferredWidth
.
When the new overall size of the context requires that the allocated size changes (or whenever this allocation changes at all), the variable row sizes need to be re-requested for every row.
For instance, if the rows are displayed all with
the same width from top to bottom then a change
in the allocated width necessitates a recalculation
of all the displayed row heights using
cellAreaGetPreferredHeightForWidth
.
Since 3.0
Properties
area
The CellArea
this context was created by
Since: 3.0
constructCellAreaContextArea :: (IsCellAreaContext o, MonadIO m, IsCellArea a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “area
” property. This is rarely needed directly, but it is used by new
.
getCellAreaContextArea :: (MonadIO m, IsCellAreaContext o) => o -> m CellArea Source #
Get the value of the “area
” property.
When overloading is enabled, this is equivalent to
get
cellAreaContext #area
minimumHeight
The minimum height for the CellArea
in this context
for all TreeModel
rows that this context was requested
for using cellAreaGetPreferredHeight
.
Since: 3.0
getCellAreaContextMinimumHeight :: (MonadIO m, IsCellAreaContext o) => o -> m Int32 Source #
Get the value of the “minimum-height
” property.
When overloading is enabled, this is equivalent to
get
cellAreaContext #minimumHeight
minimumWidth
The minimum width for the CellArea
in this context
for all TreeModel
rows that this context was requested
for using cellAreaGetPreferredWidth
.
Since: 3.0
getCellAreaContextMinimumWidth :: (MonadIO m, IsCellAreaContext o) => o -> m Int32 Source #
Get the value of the “minimum-width
” property.
When overloading is enabled, this is equivalent to
get
cellAreaContext #minimumWidth
naturalHeight
The natural height for the CellArea
in this context
for all TreeModel
rows that this context was requested
for using cellAreaGetPreferredHeight
.
Since: 3.0
getCellAreaContextNaturalHeight :: (MonadIO m, IsCellAreaContext o) => o -> m Int32 Source #
Get the value of the “natural-height
” property.
When overloading is enabled, this is equivalent to
get
cellAreaContext #naturalHeight
naturalWidth
The natural width for the CellArea
in this context
for all TreeModel
rows that this context was requested
for using cellAreaGetPreferredWidth
.
Since: 3.0
getCellAreaContextNaturalWidth :: (MonadIO m, IsCellAreaContext o) => o -> m Int32 Source #
Get the value of the “natural-width
” property.
When overloading is enabled, this is equivalent to
get
cellAreaContext #naturalWidth