public final class Layout
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Layout.LayoutItem |
| Modifier and Type | Field and Description |
|---|---|
static int |
LAY_ANY
a special mask passed to lay_find_item() (currently does not exist, was
not ported from oui)
|
static int |
LAY_INVALID_ID |
static int |
LAY_ITEM_BOX_MASK
bit 0-4
|
static int |
LAY_ITEM_BOX_MODEL_MASK
bit 0-2
|
static int |
LAY_ITEM_COMPARE_MASK
which flag bits will be compared
|
static int |
LAY_ITEM_FIXED_MASK
bit 11-12
|
static int |
LAY_ITEM_HFIXED
horizontal size has been explicitly set (bit 11)
|
static int |
LAY_ITEM_INSERTED
item has been inserted (bit 10)
|
static int |
LAY_ITEM_LAYOUT_MASK
bit 5-9
|
static int |
LAY_ITEM_VFIXED
vertical size has been explicitly set (bit 12)
|
static int |
LAY_USERMASK
these bits, starting at bit 16, can be safely assigned by the
application, e.g.
|
| Constructor and Description |
|---|
Layout() |
| Modifier and Type | Method and Description |
|---|---|
static void |
layAppend(@NotNull LayoutContext ctx,
int earlier,
int later)
lay_append inserts an item as a sibling after another item.
|
static void |
layArrange(@NotNull LayoutContext ctx,
int item,
int dim) |
static void |
layCalcSize(@NotNull LayoutContext ctx,
int item,
int dim) |
static void |
layClearItemBreak(@NotNull LayoutContext ctx,
int item)
Performing a layout on items where wrapping is enabled in the parent
container can cause flags to be modified during the calculations.
|
static int |
layFirstChild(@NotNull LayoutContext ctx,
int id)
Get the id of first child of an item, if any.
|
static float |
layGetGrow(@NotNull LayoutContext ctx,
int item)
Gets the grow factor of an item which was set with setGrow
|
static float[] |
layGetMarginsLTRB(@NotNull LayoutContext ctx,
int item,
float[] dst)
Get the margins that were set by setMargins.
|
static float[] |
layGetRect(@NotNull LayoutContext ctx,
int id,
float[] dst)
Returns the calculated rectangle of an item.
|
static float |
layGetRectHeight(@NotNull LayoutContext ctx,
int id) |
static float |
layGetRectWidth(@NotNull LayoutContext ctx,
int id) |
static float |
layGetRectX(@NotNull LayoutContext ctx,
int id) |
static float |
layGetRectY(@NotNull LayoutContext ctx,
int id) |
static float |
layGetSizeX(@NotNull LayoutContext ctx,
int item)
Gets the horizontal size of an item that was set with setSize
|
static float[] |
layGetSizeXY(@NotNull LayoutContext ctx,
int item,
float[] dst)
Gets the size of an item that was set with setSize.
|
static float |
layGetSizeY(@NotNull LayoutContext ctx,
int item)
Gets the vertical size of an item that was set with setSize
|
static void |
layInsert(@NotNull LayoutContext ctx,
int parent,
int child)
Inserts an item into another item, forming a parent - child relationship.
|
static int |
layItem(@NotNull LayoutContext ctx)
Create a new item, which can just be thought of as a rectangle.
|
static int |
layItemsCapacity(@NotNull LayoutContext ctx)
Returns the number of items the context can hold without performing a
reallocation.
|
static int |
layItemsCount(@NotNull LayoutContext ctx)
Returns the number of items that have been created in a context.
|
static int |
layLastChild(@NotNull LayoutContext ctx,
int parent) |
static int |
layNextSibling(@NotNull LayoutContext ctx,
int id)
Get the id of the next sibling of an item, if any.
|
static void |
layPush(@NotNull LayoutContext ctx,
int parent,
int newChild)
Like lay_insert, but puts the new item as the first child in a parent instead
of as the last.
|
static void |
layReserveItemsCapacity(@NotNull LayoutContext ctx,
int count)
Reserve enough heap memory to contain `count` items without needing to
reallocate.
|
static void |
layResetContext(@NotNull LayoutContext ctx)
Clears all of the items in a context, setting its count to 0.
|
static void |
layRunContext(@NotNull LayoutContext ctx)
Performs the layout calculations, starting at the root item (id 0).
|
static void |
layRunItem(@NotNull LayoutContext ctx,
int item)
Like lay_run_context(), this procedure will run layout calculations --
however, it lets you specify which item you want to start from.
|
static void |
laySetBehave(@NotNull LayoutContext ctx,
int item,
int flags)
Set the flags on an item which determines how it behaves as a child inside of
a parent item.
|
static void |
laySetContain(@NotNull LayoutContext ctx,
int item,
int flags)
Set the flags on an item which determines how it behaves as a parent.
|
static void |
laySetGrow(@NotNull LayoutContext ctx,
int item,
float grow)
Set flex grow factor of an item.
|
static void |
laySetMargins(@NotNull LayoutContext ctx,
int item,
float left,
float top,
float right,
float bottom)
Get the margins that were set by lay_set_margins.
|
static void |
laySetSize(@NotNull LayoutContext ctx,
int item,
float width,
float height)
Sets the size of an item
|
public static final int LAY_INVALID_ID
public static final int LAY_USERMASK
public static final int LAY_ANY
public static final int LAY_ITEM_BOX_MODEL_MASK
public static final int LAY_ITEM_BOX_MASK
public static final int LAY_ITEM_LAYOUT_MASK
public static final int LAY_ITEM_INSERTED
public static final int LAY_ITEM_HFIXED
public static final int LAY_ITEM_VFIXED
public static final int LAY_ITEM_FIXED_MASK
public static final int LAY_ITEM_COMPARE_MASK
public static void layReserveItemsCapacity(@NotNull
@NotNull LayoutContext ctx,
int count)
public static void layResetContext(@NotNull
@NotNull LayoutContext ctx)
public static void layRunContext(@NotNull
@NotNull LayoutContext ctx)
public static void layRunItem(@NotNull
@NotNull LayoutContext ctx,
int item)
public static void layClearItemBreak(@NotNull
@NotNull LayoutContext ctx,
int item)
public static int layItemsCount(@NotNull
@NotNull LayoutContext ctx)
public static int layItemsCapacity(@NotNull
@NotNull LayoutContext ctx)
public static int layItem(@NotNull
@NotNull LayoutContext ctx)
public static int layLastChild(@NotNull
@NotNull LayoutContext ctx,
int parent)
public static void layInsert(@NotNull
@NotNull LayoutContext ctx,
int parent,
int child)
public static void layAppend(@NotNull
@NotNull LayoutContext ctx,
int earlier,
int later)
public static void layPush(@NotNull
@NotNull LayoutContext ctx,
int parent,
int newChild)
public static void laySetGrow(@NotNull
@NotNull LayoutContext ctx,
int item,
float grow)
public static float layGetGrow(@NotNull
@NotNull LayoutContext ctx,
int item)
public static void laySetSize(@NotNull
@NotNull LayoutContext ctx,
int item,
float width,
float height)
public static float layGetSizeX(@NotNull
@NotNull LayoutContext ctx,
int item)
public static float layGetSizeY(@NotNull
@NotNull LayoutContext ctx,
int item)
public static float[] layGetSizeXY(@NotNull
@NotNull LayoutContext ctx,
int item,
float[] dst)
public static void laySetBehave(@NotNull
@NotNull LayoutContext ctx,
int item,
int flags)
public static void laySetContain(@NotNull
@NotNull LayoutContext ctx,
int item,
int flags)
public static void laySetMargins(@NotNull
@NotNull LayoutContext ctx,
int item,
float left,
float top,
float right,
float bottom)
public static float[] layGetMarginsLTRB(@NotNull
@NotNull LayoutContext ctx,
int item,
float[] dst)
public static int layFirstChild(@NotNull
@NotNull LayoutContext ctx,
int id)
public static int layNextSibling(@NotNull
@NotNull LayoutContext ctx,
int id)
public static float layGetRectX(@NotNull
@NotNull LayoutContext ctx,
int id)
public static float layGetRectY(@NotNull
@NotNull LayoutContext ctx,
int id)
public static float layGetRectWidth(@NotNull
@NotNull LayoutContext ctx,
int id)
public static float layGetRectHeight(@NotNull
@NotNull LayoutContext ctx,
int id)
public static float[] layGetRect(@NotNull
@NotNull LayoutContext ctx,
int id,
float[] dst)
public static void layCalcSize(@NotNull
@NotNull LayoutContext ctx,
int item,
int dim)
public static void layArrange(@NotNull
@NotNull LayoutContext ctx,
int item,
int dim)