Package ch.bailu.gtk.pango
Class TabArray
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.pango.TabArray
- All Implemented Interfaces:
PointerInterface
A `PangoTabArray` contains an array of tab stops.
`PangoTabArray` can be used to set tab stops in a `PangoLayout`.
Each tab stop has an alignment, a position, and optionally
a character to use as decimal point.
`PangoTabArray` can be used to set tab stops in a `PangoLayout`.
Each tab stop has an alignment, a position, and optionally
a character to use as decimal point.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTabArray
(int initial_size, boolean positions_in_pixels) Creates an array of @initial_size tab stops.TabArray
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copies a `PangoTabArray`.void
free()
Frees a tab array and associated resources.static TabArray
fromString
(Str text) Deserializes a `PangoTabArray` from a string.static ClassHandler
byte
getDecimalPoint
(int tab_index) Gets the Unicode character to use as decimal point.static int
static long
static TypeSystem.TypeSize
boolean
Returns %TRUE if the tab positions are in pixels,
%FALSE if they are in Pango units.int
getSize()
Gets the number of tab stops in @tab_array.void
Gets the alignment and position of a tab stop.static long
static TypeSystem.TypeSize
static TabArray
newWithPositionsTabArray
(int size, boolean positions_in_pixels, int first_alignment, int first_position, Object... _elipse) Creates a `PangoTabArray` and allows you to specify the alignment
and position of each tab stop.void
resize
(int new_size) Resizes a tab array.void
setDecimalPoint
(int tab_index, byte decimal_point) Sets the Unicode character to use as decimal point.void
setPositionsInPixels
(boolean positions_in_pixels) Sets whether positions in this array are specified in
pixels.void
setTab
(int tab_index, int alignment, int location) Sets the alignment and location of a tab stop.void
sort()
Utility function to ensure that the tab stops are in increasing order.toStr()
Serializes a `PangoTabArray` to a string.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
-
TabArray
-
TabArray
public TabArray(int initial_size, boolean positions_in_pixels) Creates an array of @initial_size tab stops.
Tab stops are specified in pixel units if @positions_in_pixels is %TRUE,
otherwise in Pango units. All stops are initially at position 0.- Parameters:
initial_size
- Initial number of tab stops to allocate, can be 0positions_in_pixels
- whether positions are in pixel units
-
-
Method Details
-
getClassHandler
-
newWithPositionsTabArray
public static TabArray newWithPositionsTabArray(int size, boolean positions_in_pixels, int first_alignment, int first_position, Object... _elipse) Creates a `PangoTabArray` and allows you to specify the alignment
and position of each tab stop.
You **must** provide an alignment and position for @size tab stops.- Parameters:
size
- number of tab stops in the arraypositions_in_pixels
- whether positions are in pixel unitsfirst_alignment
- alignment of first tab stopfirst_position
- position of first tab stop_elipse
- additional alignment/position pairs- Returns:
- the newly allocated `PangoTabArray`, which should be freed with [method@Pango.TabArray.free].
-
copy
Copies a `PangoTabArray`.- Returns:
- the newly allocated `PangoTabArray`, which should be freed with [method@Pango.TabArray.free].
-
free
public void free()Frees a tab array and associated resources. -
getDecimalPoint
public byte getDecimalPoint(int tab_index) Gets the Unicode character to use as decimal point.
This is only relevant for tabs with %PANGO_TAB_DECIMAL alignment,
which align content at the first occurrence of the decimal point
character.
The default value of 0 means that Pango will use the
decimal point according to the current locale.- Parameters:
tab_index
- the index of a tab stop- Returns:
-
getPositionsInPixels
public boolean getPositionsInPixels()Returns %TRUE if the tab positions are in pixels,
%FALSE if they are in Pango units.- Returns:
- whether positions are in pixels.
-
getSize
public int getSize()Gets the number of tab stops in @tab_array.- Returns:
- the number of tab stops in the array.
-
getTab
Gets the alignment and position of a tab stop.- Parameters:
tab_index
- tab stop indexalignment
- location to store alignmentlocation
- location to store tab position
-
resize
public void resize(int new_size) Resizes a tab array.
You must subsequently initialize any tabs
that were added as a result of growing the array.- Parameters:
new_size
- new size of the array
-
setDecimalPoint
public void setDecimalPoint(int tab_index, byte decimal_point) Sets the Unicode character to use as decimal point.
This is only relevant for tabs with %PANGO_TAB_DECIMAL alignment,
which align content at the first occurrence of the decimal point
character.
By default, Pango uses the decimal point according
to the current locale.- Parameters:
tab_index
- the index of a tab stopdecimal_point
- the decimal point to use
-
setPositionsInPixels
public void setPositionsInPixels(boolean positions_in_pixels) Sets whether positions in this array are specified in
pixels.- Parameters:
positions_in_pixels
- whether positions are in pixels
-
setTab
public void setTab(int tab_index, int alignment, int location) Sets the alignment and location of a tab stop.- Parameters:
tab_index
- the index of a tab stopalignment
- tab alignmentlocation
- tab location in Pango units
-
sort
public void sort()Utility function to ensure that the tab stops are in increasing order. -
toStr
Serializes a `PangoTabArray` to a string.
No guarantees are made about the format of the string,
it may change between Pango versions.
The intended use of this function is testing and
debugging. The format is not meant as a permanent
storage format.- Returns:
- a newly allocated string
-
fromString
Deserializes a `PangoTabArray` from a string.
This is the counterpart to [method@Pango.TabArray.to_string].
See that functions for details about the format.- Parameters:
text
- a string- Returns:
- a new `PangoTabArray`
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-