gi-gtk-3.0.32: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.CellAreaContext

Description

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

Exported types

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

Instances details
(GObject o, IsDescendantOf CellAreaContext o) => IsCellAreaContext o Source # 
Instance details

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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> Int32

width: the allocated width for all TreeModel rows rendered with context, or -1.

-> Int32

height: the allocated height for all TreeModel rows rendered with context, or -1.

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> m CellArea

Returns: the CellArea this context was created by.

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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> Int32

width: a proposed width for allocation

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> Int32

height: a proposed height for allocation

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> Int32

minimumHeight: the proposed new minimum height for context

-> Int32

naturalHeight: the proposed new natural height for context

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> Int32

minimumWidth: the proposed new minimum width for context

-> Int32

naturalWidth: the proposed new natural width for context

-> 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

cellAreaContextReset Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellAreaContext a) 
=> a

context: a CellAreaContext

-> 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, IsCellArea a) => a -> IO (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