Package ch.bailu.gtk.gtk
Class CellAreaContext
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.CellAreaContext
- All Implemented Interfaces:
PointerInterface
Stores geometrical information for a series of rows in a GtkCellArea
The `GtkCellAreaContext` object is created by a given `GtkCellArea`
implementation via its `GtkCellAreaClass.create_context()` virtual
method and is used to store cell sizes and alignments for a series of
`GtkTreeModel` rows that are requested and rendered in the same context.
`GtkCellLayout` 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 `GtkTreeModel`
row also be used for the same row when calling other `GtkCellArea` APIs
such as gtk_cell_area_render() and gtk_cell_area_event().
The `GtkCellAreaContext` object is created by a given `GtkCellArea`
implementation via its `GtkCellAreaClass.create_context()` virtual
method and is used to store cell sizes and alignments for a series of
`GtkTreeModel` rows that are requested and rendered in the same context.
`GtkCellLayout` 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 `GtkTreeModel`
row also be used for the same row when calling other `GtkCellArea` APIs
such as gtk_cell_area_render() and gtk_cell_area_event().
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
allocate
(int width, int height) Allocates a width and/or a height for all rows which are to be
rendered with @context.void
getAllocation
(Int width, Int height) Fetches the current allocation size for @context.getArea()
Fetches the `GtkCellArea` this @context was created by.static ClassHandler
static int
static long
static TypeSystem.TypeSize
void
getPreferredHeight
(Int minimum_height, Int natural_height) Gets the accumulative preferred height for all rows which have been
requested with this context.void
getPreferredHeightForWidth
(int width, Int minimum_height, Int natural_height) Gets the accumulative preferred height for @width for all rows
which have been requested for the same said @width with this context.void
getPreferredWidth
(Int minimum_width, Int natural_width) Gets the accumulative preferred width for all rows which have been
requested with this context.void
getPreferredWidthForHeight
(int height, Int minimum_width, Int natural_width) Gets the accumulative preferred width for @height for all rows which
have been requested for the same said @height with this context.static long
static TypeSystem.TypeSize
void
pushPreferredHeight
(int minimum_height, int natural_height) Causes the minimum and/or natural height to grow if the new
proposed sizes exceed the current minimum and natural height.void
pushPreferredWidth
(int minimum_width, int natural_width) Causes the minimum and/or natural width to grow if the new
proposed sizes exceed the current minimum and natural width.void
reset()
Resets any previously cached request and allocation
data.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
CellAreaContext
-
-
Method Details
-
getClassHandler
-
allocate
public void allocate(int width, int height) 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 `GtkTreeView` when
`GtkTreeView:fixed-height-mode` is enabled.- Parameters:
width
- the allocated width for all `GtkTreeModel` rows rendered with @context, or -1height
- the allocated height for all `GtkTreeModel` rows rendered with @context, or -1
-
getAllocation
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 gtk_cell_area_context_reset(),
the returned value will be -1.- Parameters:
width
- location to store the allocated widthheight
- location to store the allocated height
-
getArea
Fetches the `GtkCellArea` 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 `GtkCellAreaContextClass.allocate()` time
it’s important to know details about any cell spacing
that the `GtkCellArea` is configured with in order to
compute a proper allocation.- Returns:
- the `GtkCellArea` this context was created by.
-
getPreferredHeight
Gets the accumulative preferred height for all rows which have been
requested with this context.
After gtk_cell_area_context_reset() is called and/or before ever
requesting the size of a `GtkCellArea`, the returned values are 0.- Parameters:
minimum_height
- location to store the minimum heightnatural_height
- location to store the natural height
-
getPreferredHeightForWidth
public void getPreferredHeightForWidth(int width, @Nullable Int minimum_height, @Nullable Int natural_height) Gets the accumulative preferred height for @width for all rows
which have been requested for the same said @width with this context.
After gtk_cell_area_context_reset() is called and/or before ever
requesting the size of a `GtkCellArea`, the returned values are -1.- Parameters:
width
- a proposed width for allocationminimum_height
- location to store the minimum heightnatural_height
- location to store the natural height
-
getPreferredWidth
Gets the accumulative preferred width for all rows which have been
requested with this context.
After gtk_cell_area_context_reset() is called and/or before ever
requesting the size of a `GtkCellArea`, the returned values are 0.- Parameters:
minimum_width
- location to store the minimum widthnatural_width
- location to store the natural width
-
getPreferredWidthForHeight
public void getPreferredWidthForHeight(int height, @Nullable Int minimum_width, @Nullable Int natural_width) Gets the accumulative preferred width for @height for all rows which
have been requested for the same said @height with this context.
After gtk_cell_area_context_reset() is called and/or before ever
requesting the size of a `GtkCellArea`, the returned values are -1.- Parameters:
height
- a proposed height for allocationminimum_width
- location to store the minimum widthnatural_width
- location to store the natural width
-
pushPreferredHeight
public void pushPreferredHeight(int minimum_height, int natural_height) 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 `GtkCellAreaContext` implementations during
the request process over a series of `GtkTreeModel` rows to
progressively push the requested height over a series of
gtk_cell_area_get_preferred_height() requests.- Parameters:
minimum_height
- the proposed new minimum height for @contextnatural_height
- the proposed new natural height for @context
-
pushPreferredWidth
public void pushPreferredWidth(int minimum_width, int natural_width) 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 `GtkCellAreaContext` implementations during
the request process over a series of `GtkTreeModel` rows to
progressively push the requested width over a series of
gtk_cell_area_get_preferred_width() requests.- Parameters:
minimum_width
- the proposed new minimum width for @contextnatural_width
- the proposed new natural width for @context
-
reset
public void reset()Resets any previously cached request and allocation
data.
When underlying `GtkTreeModel` 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
gtk_cell_area_get_preferred_width().
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
gtk_cell_area_get_preferred_height_for_width(). -
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-