compose/remote/Documentation/RemoteComposeWireFormat.md.html
**RemoteCompose Wire Format v1.1.0** February 09, 2026 *Current number of operations: 141 (0 not fully documented)* !!! ERROR This is work in progress and subject to modifications. RemoteCompose is a standalone content format for Android. It consists of a list of operations providing rendering, layout, animation, expression evaluation and bindings. Wire Format overview ====== The RemoteCompose wire format is a simple flat list of Operations, serialized in a binary format (see next sections for a detailed description of each operation). !!! WARNING This wire format is intended to be used for fast generation and transport. For display purposes, a more runtime-appropriate representation (i.e. a tree of operations and containers) should be created and used instead. Each list of operations contains as first element a Header (see section [Header]). |Operations| |:----:| | **Header** | | *Operation 1* | | *Operation 2* | | *Operation 3* | | ... | | *Operation n* | Encoding -------- Operations are encoded in binary, using the following types: | Type | Size (in bytes) | |:----:|:----:| | BYTE | 1 | | BOOLEAN | 1 | | SHORT | 2 | | INT | 4 | | FLOAT | 4 | | LONG | 8 | | DOUBLE | 8 | | BUFFER | 4 + Size | | UTF8 | BUFFER | A Buffer is simply encoded as the size of the buffer in bytes (encoded as an INT, so 4 bytes) followed by the byte buffer itself. UTF8 payload is simply encoded as a byte Buffer using encodeToByteArray(). Components & Layout ------------------- Operations can further be grouped in components, surrounded by ComponentStart (section [ComponentStart]) and ComponentEnd (section [ComponentEnd]). |Operations| |:----:| | ... | | **ComponentStart** | | *Operation 1* | | *Operation 2* | | *Operation 3* | | ... | | *Operation n* | | **ComponentEnd** | | ... | More specialized components can be created by using alternative layout operations instead of ComponentStart: - RootLayoutComponent - BoxLayout - RowLayout - ColumnLayout Layout managers such as BoxLayout, RowLayout, ColumnLayout provide a way to layout Components. Such layoutable/resizable components are structured slightly differently: |Operations| | | |:----: |:----:| :----: | | **Header** | || | ... | ... | ... | | **RootLayoutComponent** | | | | | **RowLayout** | | | ... | ... | ... | | | **RowLayout** | | | | *Modifier 1* | | | | *Modifier 2* | | | ... | ... | ... | | | *Modifier n* | | | | | **LayoutComponentContent** | | | | *Component 1* | | | | *Component 2* | | | | ... | | | | *Component n* | | | | **ComponentEnd** | | | **ComponentEnd** | | | **ComponentEnd** | | | In the example above, you can see that RowLayout is comprised of two sections -- a list of Modifier operations followed by a LayoutComponentContent component, containing the components to be laid out. # Layout overview ## Overview The layout system work with **LayoutManager** that can layout **LayoutComponent** and **Component**. LayoutComponents are able to be laid out as well as resized, while Components can only be laid out. The following diagram shows the runtime class hiearchy:
--- config: class: hideEmptyMembersBox: true --- classDiagram Component \<|-- RootLayoutComponent Component \<|-- LayoutComponent LayoutComponent \<|-- LayoutManager LayoutManager \<|-- BoxLayout LayoutManager \<|-- ColumnLayout LayoutManager \<|-- RowLayout LayoutManager \<|-- FitBoxLayout LayoutManager \<|-- CoreText BoxLayout \<|-- CanvasLayout ColumnLayout \<|-- CollapsibleColumnLayout RowLayout \<|-- CollapsibleRowLayout RowLayout \<|-- FlowLayout LayoutManager \<|-- ImageLayout LayoutManager \<|-- StateLayout
graph LR operations["`ComponentStart Operation 1 ... Operation n ComponentEnd 3`"] operations --\> Result Result subgraph Result [Runtime Component] Component --\> OP1[Operation 1] Component --\> OP2[...] Component --\> OP3[Operation n] end
graph TD LC[LayoutComponent] LC --\> Mods[Modifiers] Mods --\> M1[modifier 1] Mods --\> M2[modifier 2] Mods --\> M3[...] Mods --\> MN[modifier n] LC --\> Children[children] Children --\> C1[component 1] Children --\> C2[component 2] Children --\> C3[...] Children --\> CN[component n]
graph LR P1[Padding 4] --\> BG[Background] BG --\> P2[Padding 8] P2 --\> Content[/Content/]
Which would result in a "margin" of 4 followed by painting the background, with a "padding" of 8 for the actual content. #### Sizing If a component is set to compute its own size (WRAP), Padding will be added to the computed size. But to note, if a component uses a modifier for indicating a fixed dimension, such as:
graph LR P1[Padding 4] --\> S[Size 10x10] S --\> P2[Padding 2]
The computed size of the component for its parent layout manager will be 14x14. #### Borders Borders are always applied on top of the content, so putting the border before a background or after would result in the same visuals:
graph LR B1[Border] --\> BG1[Background] BG1 == "visual equivalent" ==\> BG2[Background] BG2 --\> B2[Border]
Borders are purely a visual decoration, they do not impact sizing/padding, but they are impacted by them, so have to be evaluated in order. ## Layout Managers The actual layout managers are implemented as subclass of LayoutManager: | Layout Manager | Role | |-------------------------|---------------------------------------------------| | BoxLayout | Layout elements in the same place | | RowLayout | Layout elements in a row | | ColumnLayout | Layout elements in a column | | CollapsibleRowLayout | as RowLayout, but skip elements that don't fit | | CollapsibleColumnLayout | as ColumnLayout, but skip elements that don't fit | | FitBoxLayout | pick the first child that fits | | FlowLayout | as RowLayout, but wrap elements if they don't fit | ### Scroll areas Scroll areas are handled as subclasses of LayoutContent:
graph TD SCH[ScrollContentHost] SCH --\> SC[ScrollContent] SCH --\> LC[LayoutContent]
graph TD RLC[RootLayoutComponent] RLC --\> LM1[LayoutManager] LM1 --\> LM2[LayoutManager] LM2 --\> C1[Component] LM2 --\> C2[Component] LM1 --\> C3[Component]
The general layout / measure cycle works as follow: - for each LayoutComponent, measure their children recursively - capture that measure in a MeasurePass object - then recursively layout the components by using the MeasurePass information.
graph TD M[Measure] M -- "ideally single pass, using intrinsic sizes (multi-measure is discouraged, but allowed)" --\> M M --\> MP[MeasurePass] MP -- "contains position+size of all the components" --\> L[Layout] L -- "we can animate upon receiving a new layout(measurePass) request " --\> A[Animate]
invalidateMeasure() -- this will mark themselves as needing both a repaint and a remeasure, and will walk the tree up until the root component, invalidating them as the tree is traversed. The root component then uses this to trigger a measure pass. # Scrolling Architecture in RemoteCompose RemoteCompose provides a physics-based, hierarchical scrolling system that supports orthogonal nesting (e.g., horizontal rows inside vertical columns) and dynamic state synchronization. ## Core Concepts ### 1. Coordinate Spaces To handle deep nesting and scrolling reliably, the interaction engine uses three distinct coordinate spaces: | Space | Reference | Usage | | :--- | :--- | :--- | | **Root-Relative** | Document origin (0,0) | Used for top-level hit testing (contains(x, y)). | | **Viewport-Relative** (lx, ly) | Component top-left on screen | Used by Modifiers (ripples, scroll logic). | | **Content-Relative** (cx, cy) | Component's scrollable origin | Passed to children so they can ignore parent scroll. | ### 2. The Scroll Delegate Scrolling is not hardcoded into layouts. Instead, LayoutComponent uses a ScrollDelegate interface. If a component has a ScrollModifierOperation in its modifier list, it registers itself as the delegate for horizontal or vertical axes. - **Measure Phase**: The layout manager queries the delegate for the "content dimension" (total scrollable area). - **Layout Phase**: The delegate updates the component's internal scroll offsets based on user interaction or bound variables. - **Paint Phase**: LayoutComponent applies a translation transformation (getScrollX(), getScrollY()) before painting its children. ## The Interaction Pipeline ### 1. Event Entry (CoreDocument) Touch events enter via CoreDocument.touchDown/Drag/Up. The document tracks "applied touch operations"—components currently being interacted with—to bypass hit-testing during a drag. ### 2. Recursive Dispatch (Component) Events propagate down the tree in **reverse drawing order** (top-most component first). - A component first performs a **Root-Relative** hit test. - If it contains the point, it calculates the **Viewport** and **Content** offsets. - It dispatches to children using the **Content** space. - It then dispatches to its own modifiers using the **Viewport** space. ### 3. Event Consumption Interaction handlers return a boolean. - If a child component consumes an event (e.g., a button click), sibling components are ignored. - **Crucially**, parent modifiers (like a ScrollModifier) are still notified even if a child consumed the event. This allows a nested list to scroll even if the user started the drag on a button. ## Physics and State (TouchExpression) The ScrollModifierOperation typically hosts a TouchExpression. This engine handles: - **Velocity Tracking**: Calculates pixels-per-second during a drag. - **Fling/Easing**: When the user releases, it uses a VelocityEasing curve to continue the scroll. - **Notches**: Supports snapping to specific positions (even spacing, absolute points, or percentages). ## Nested Scrolling Logic RemoteCompose handles nested scrolls by utilizing the "Orthogonal Capture" rule: 1. A vertical scroll only consumes the **Y** component of a drag. 2. A horizontal scroll only consumes the **X** component. 3. Because propagation continues up the parent chain for modifiers, a vertical swipe inside a horizontal row will be ignored by the row's scroll logic but captured by the parent column's scroll logic. ## Layout Integration Layout managers like ColumnLayout and RowLayout are "scroll-aware": - During internalLayoutMeasure, they check mComponentModifiers.hasVerticalScroll(). - If true, they allow the content to exceed the host's viewport height. - They then call setVerticalScrollDimension() to inform the modifier of the total scrollable range, which the TouchExpression uses for boundary clamping. # Click Handling and Actions in RemoteCompose RemoteCompose provides a flexible click system based on modifiers that can trigger both internal state changes and host-side callbacks. ## Click Propagation Process Click events follow a similar propagation path to touch events but are specifically triggered on the "up" phase of a gesture if the movement threshold hasn't been exceeded. ### 1. Root Dispatch (CoreDocument) When a user clicks, CoreDocument.onClick(x, y) is called with root-relative coordinates. ### 2. Backward Search (Component) The document iterates through its component tree in **reverse drawing order** (top-to-bottom). For each component: - It checks if the point (x, y) is within the component's bounds via contains(x, y). - If contained, it recursively calls onClick on its children. - If no child handles the click, it dispatches to its own onClick handlers (usually via ComponentModifiers). ### 3. Local Transformation Before reaching a ClickModifierOperation, the coordinates are transformed: - **Root Space**: Used for initial hit detection. - **Content Space**: Passed to children and modifiers, accounting for parent scrolling and padding. ## Click Modifiers (ClickModifierOperation) The primary way to make a component interactive is by adding a click modifier. ### Interaction Features - **Ripple Animation**: Triggers a visual feedback ripple at the exact touch location. The ripple uses Easing.CUBIC_STANDARD and animates both color and radius over 1000ms. - **Haptic Feedback**: Automatically triggers a host haptic effect (type 3) upon a successful click. - **Role & Semantics**: Identifies the component as a Role.BUTTON for accessibility services (e.g., TalkBack). ## Actions A ClickModifierOperation acts as a container for one or more ActionOperations. | Action Type | Description | | :--- | :--- | | **ValueChange** | Updates a RemoteCompose variable (Float, String, or Boolean). Useful for toggling states like isExpanded or clickCount. | | **HostAction** | Sends a metadata string back to the host application (Android/iOS). This is used for navigation or triggering native logic. | | **Custom Actions** | Can be implemented to perform complex sequences, such as multiple variable updates or conditional logic. | ## Interaction with Scrolling The system ensures that clicks and scrolls don't conflict: 1. **Threshold**: If a touch move exceeds a small distance threshold (e.g., 5-10 pixels), the gesture is "captured" by a scroll parent. 2. **Cancellation**: Once captured by a scroll, any pending click animations or actions on child components are cancelled. 3. **Consumption**: If a click is handled by a child, the event returns true, stopping further propagation to parent click handlers. # Document Protocol Operations Core document metadata, versioning, themes, and high-level behaviors. Operations in this category: | ID | Name | Version | Size (bytes) | ---- | ---- | ---- | ---- | | 0 | Header | v6 | 29 | 63 | Theme | v6 | 5 | 185 | Rem | v7 | 1 | 214 | ContainerEnd | v6 | 1 ## Header Document metadata, containing the version, original size & density, capabilities mask 6 Fields, total size 29 bytes| Type | Name | Description |
|---|---|---|
| BYTE | Header | Value: 0 |
| INT | majorVersion | Major version |
| INT | minorVersion | Minor version |
| INT | patchVersion | Patch version |
| INT | width | Document width in pixels |
| INT | height | Document height in pixels |
| LONG | capabilities | Capabilities mask |
| Type | Name | Description |
|---|---|---|
| BYTE | Theme | Value: 63 |
| INT | THEME | theme id |
Theme operation allows the document to adapt its visual appearance (colors, styles) based on the active theme (e.g., Light or Dark mode).| Type | Name | Description |
|---|---|---|
| BYTE | Rem | Value: 185 |
| UTF8 | text | The comment string |
| Type | Name | Description |
|---|---|---|
| BYTE | ContainerEnd | Value: 214 |
| Type | Name | Description |
|---|---|---|
| BYTE | FloatConstant | Value: 80 |
| INT | id | id of the Float constant |
| FLOAT | value | 32-bit float value |
| Type | Name | Description |
|---|---|---|
| BYTE | BitmapData | Value: 101 |
| INT | imageId | The ID of the bitmap |
| INT | widthAndType | Encoded width and image type |
| INT | heightAndEncoding | Encoded height and data encoding |
| BYTE[] | bitmap | The raw or encoded bitmap data |
| Type | Name | Description |
|---|---|---|
| BYTE | NamedVariable | Value: 137 |
| INT | varId | id to label |
| INT | varType | The type of variable |
| UTF8 | name | String |
| Type | Name | Description |
|---|---|---|
| BYTE | IntegerConstant | Value: 140 |
| INT | id | id of the Int constant |
| INT | value | 32-bit int value |
| Type | Name | Description |
|---|---|---|
| BYTE | BooleanConstant | Value: 143 |
| INT | id | id of Int |
| BYTE | value | 8-bit 0 or 1 |
| Type | Name | Description |
|---|---|---|
| BYTE | DataMapIds | Value: 145 |
| INT | id | The ID of the map |
| INT | length | Number of entries |
| REPEATED DATA |
| Type | Name | Description |
|---|---|---|
| UTF8 | name | The name of the entry |
| INT | type | The type of the entry |
| INT | id | The ID of the variable |
|
| Type | Name | Description |
|---|---|---|
| BYTE | IdListData | Value: 146 |
| INT | id | The ID of the list |
| INT | length | Number of IDs |
| INT[] | ids | The array of IDs |
| Type | Name | Description |
|---|---|---|
| BYTE | IdListData | Value: 147 |
| INT | id | The ID of the list |
| INT | length | Number of floats |
| FLOAT[] | values | The array of floats |
| Type | Name | Description |
|---|---|---|
| BYTE | LongConstant | Value: 148 |
| INT | id | id of the Long constant |
| LONG | value | The long Value |
| Type | Name | Description |
|---|---|---|
| BYTE | DataMapLookup | Value: 154 |
| INT | id | The ID of the output value |
| INT | dataMapId | The ID of the data map |
| INT | stringId | The ID of the string to look up |
| Type | Name | Description |
|---|---|---|
| BYTE | FontData | Value: 189 |
| INT | fontId | The ID of the font |
| INT | type | The type of the font (unused) |
| BYTE[] | fontData | The raw font file data |
| Type | Name | Description |
|---|---|---|
| BYTE | DataDynamicListFloat | Value: 197 |
| INT | id | The ID of the list |
| FLOAT | length | The length of the list |
| Type | Name | Description |
|---|---|---|
| BYTE | UpdateDynamicFloatList | Value: 198 |
| INT | arrayId | The ID of the array |
| FLOAT | index | The index to update |
| FLOAT | value | The new value |
| Type | Name | Description |
|---|---|---|
| BYTE | PaintData | Value: 40 |
| INT[] | paintBundle | The encoded paint properties |
PaintData operation encodes properties like style (Fill/Stroke), color, and stroke width. #### Fill vs Stroke| Type | Name | Description |
|---|---|---|
| BYTE | ShaderData | Value: 45 |
| INT | shaderID | The ID of the shader |
| INT | shaderTextId | The ID of the shader source text |
| INT | sizes | Encoded sizes of uniform maps (float, int, bitmap) |
| UTF8 | floatUniformName[0..n] | Name of float uniform |
| INT | floatUniformLength[0..n] | Length of float uniform |
| FLOAT[] | floatUniformValues[0..n] | Values of float uniform |
| UTF8 | intUniformName[0..n] | Name of int uniform |
| INT | intUniformLength[0..n] | Length of int uniform |
| INT[] | intUniformValues[0..n] | Values of int uniform |
| UTF8 | bitmapUniformName[0..n] | Name of bitmap uniform |
| INT | bitmapUniformValue[0..n] | ID of bitmap uniform |
ShaderData operation defines complex color effects like gradients or image-based patterns. #### Linear Gradient Example| Type | Name | Description |
|---|---|---|
| BYTE | ColorExpression | Value: 134 |
| INT | id | The ID of the resulting color |
| INT | mode | The color calculation mode |
| INT | param1 | First parameter (color1, hue, or alpha depending on mode) |
| INT | param2 | Second parameter (color2, saturation, or red depending on mode) |
| INT | param3 | Third parameter (tween, value, or green depending on mode) |
| INT | param4 | Fourth parameter (blue, only used in ARGB modes) |
| Type | Name | Description |
|---|---|---|
| BYTE | ColorConstant | Value: 138 |
| INT | colorId | The ID of the color |
| INT | color | 32-bit ARGB color value |
| Type | Name | Description |
|---|---|---|
| BYTE | ColorAttribute | Value: 180 |
| INT | id | The ID to output the result to |
| INT | colorId | The ID of the source color |
| SHORT | type | The component to extract |
| Type | Name | Description |
|---|---|---|
| BYTE | ColorTheme | Value: 196 |
| INT | id | The ID of the color |
| INT | groupId | The ID of the color group name string |
| SHORT | lightModeIndex | The ID of the color in the light group |
| SHORT | darkModeIndex | The ID of the color in the dark group |
| INT | lightModeFallback | 32-bit ARGB fallback color for light mode |
| INT | darkModeFallback | 32-bit ARGB fallback color for dark mode |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawRect | Value: 42 |
| FLOAT | left | The left side of the rectangle |
| FLOAT | top | The top of the rectangle |
| FLOAT | right | The right side of the rectangle |
| FLOAT | bottom | The bottom of the rectangle |
DrawRect operation renders a rectangle defined by its left, top, right, and bottom coordinates.| Type | Name | Description |
|---|---|---|
| BYTE | DrawBitmap | Value: 44 |
| INT | imageId | The ID of the bitmap |
| FLOAT | left | The left side of the image |
| FLOAT | top | The top of the image |
| FLOAT | right | The right side of the image |
| FLOAT | bottom | The bottom of the image |
| INT | descriptionId | The ID of the content description string |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawCircle | Value: 46 |
| FLOAT | centerX | The x-coordinate of the center of the circle to be drawn |
| FLOAT | centerY | The y-coordinate of the center of the circle to be drawn |
| FLOAT | radius | The radius of the circle to be drawn |
DrawCircle operation renders a circle centered at (centerX, centerY) with a given radius.| Type | Name | Description |
|---|---|---|
| BYTE | DrawLine | Value: 47 |
| FLOAT | startX | The x-coordinate of the start point of the line |
| FLOAT | startY | The y-coordinate of the start point of the line |
| FLOAT | endX | The x-coordinate of the end point of the line |
| FLOAT | endY | The y-coordinate of the end point of the line |
DrawLine operation renders a single straight line segment between (startX, startY) and (endX, endY).| Type | Name | Description |
|---|---|---|
| BYTE | DrawRoundRect | Value: 51 |
| FLOAT | left | The left side of the rect |
| FLOAT | top | The top of the rect |
| FLOAT | right | The right side of the rect |
| FLOAT | bottom | The bottom of the rect |
| FLOAT | rx | The x-radius of the oval used to round the corners |
| FLOAT | ry | The y-radius of the oval used to round the corners |
DrawRoundRect operation renders a rectangle with rounded corners, defined by its bounds and the radii rx and ry.| Type | Name | Description |
|---|---|---|
| BYTE | DrawSector | Value: 52 |
| FLOAT | left | The left side of the Oval |
| FLOAT | top | The top of the Oval |
| FLOAT | right | The right side of the Oval |
| FLOAT | bottom | The bottom of the Oval |
| FLOAT | startAngle | Starting angle (in degrees) where the arc begins |
| FLOAT | sweepAngle | Sweep angle (in degrees) measured clockwise |
DrawSector operation renders a "pie" shape within a specified oval bounding box, starting from startAngle and sweeping through sweepAngle.| Type | Name | Description |
|---|---|---|
| BYTE | DrawOval | Value: 56 |
| FLOAT | left | The left side of the oval |
| FLOAT | top | The top of the oval |
| FLOAT | right | The right side of the oval |
| FLOAT | bottom | The bottom of the oval |
DrawOval operation renders an oval that fits within the specified bounding box.| Type | Name | Description |
|---|---|---|
| BYTE | DrawBitmapInt | Value: 66 |
| INT | imageId | The ID of the bitmap |
| INT | srcLeft | The left side of the source image |
| INT | srcTop | The top of the source image |
| INT | srcRight | The right side of the source image |
| INT | srcBottom | The bottom of the source image |
| INT | dstLeft | The left side of the destination |
| INT | dstTop | The top of the destination |
| INT | dstRight | The right side of the destination |
| INT | dstBottom | The bottom of the destination |
| INT | cdId | The ID of the content description string |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawPath | Value: 124 |
| INT | id | The ID of the path to draw |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawTweenPath | Value: 125 |
| INT | path1Id | The ID of the first path |
| INT | path2Id | The ID of the second path |
| FLOAT | tween | Interpolation value [0..1] |
| FLOAT | start | Trim the start of the path [0..1] |
| FLOAT | stop | Trim the end of the path [0..1] |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawContent | Value: 139 |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawBitmapScaled | Value: 149 |
| INT | imageId | The ID of the bitmap |
| FLOAT | srcLeft | The left side of the source image |
| FLOAT | srcTop | The top of the source image |
| FLOAT | srcRight | The right side of the source image |
| FLOAT | srcBottom | The bottom of the source image |
| FLOAT | dstLeft | The left side of the destination |
| FLOAT | dstTop | The top of the destination |
| FLOAT | dstRight | The right side of the destination |
| FLOAT | dstBottom | The bottom of the destination |
| INT | scaleType | Type of scaling to apply |
| FLOAT | scaleFactor | Factor for fixed scale |
| INT | cdId | The ID of the content description string |
DrawBitmapScaled operation handles rendering images within a destination area using different scaling algorithms. To illustrate this, a "House" image with a 1:2 aspect ratio (tall) is used.| Type | Name | Description |
|---|---|---|
| BYTE | DrawArc | Value: 152 |
| FLOAT | left | The left side of the Oval |
| FLOAT | top | The top of the Oval |
| FLOAT | right | The right side of the Oval |
| FLOAT | bottom | The bottom of the Oval |
| FLOAT | startAngle | Starting angle (in degrees) where the arc begins |
| FLOAT | sweepAngle | Sweep angle (in degrees) measured clockwise |
DrawArc operation renders an arc within a specified oval bounding box, starting from startAngle and sweeping through sweepAngle (degrees).| Type | Name | Description |
|---|---|---|
| BYTE | PathTween | Value: 158 |
| INT | outId | The ID of the resulting interpolated path |
| INT | pathId1 | The ID of the first source path |
| INT | pathId2 | The ID of the second source path |
| FLOAT | tween | The interpolation factor [0..1] |
PathTween operation interpolates between two source paths (Path 1 and Path 2) based on a tween factor (0.0 to 1.0).| Type | Name | Description |
|---|---|---|
| BYTE | PathCreate | Value: 159 |
| INT | id | The ID of the path to create |
| FLOAT | startX | The X coordinate of the starting point |
| FLOAT | startY | The Y coordinate of the starting point |
PathCreate operation begins the definition of a path, followed by PathAppend operations to add segments like lines or curves.| Type | Name | Description |
|---|---|---|
| BYTE | PathAppend | Value: 160 |
| INT | id | The ID of the path to append to |
| INT | length | The number of elements in the path data |
| FLOAT[] | pathData | The sequence of commands and coordinates |
PathAppend operation adds segments to an existing path. #### LineTo Simple straight line segment.| Type | Name | Description |
|---|---|---|
| BYTE | CanvasOperations | Value: 173 |
| Type | Name | Description |
|---|---|---|
| BYTE | PathCombine | Value: 175 |
| INT | outId | The ID of the resulting path |
| INT | pathId1 | The ID of the first source path |
| INT | pathId2 | The ID of the second source path |
| BYTE | operation | The boolean operation to perform |
PathCombine operation performs boolean logic between two paths to create a new complex shape.| Type | Name | Description |
|---|---|---|
| BYTE | DrawToBitmap | Value: 190 |
| INT | bitmapId | The bitmap to draw to or 0 to draw to the canvas |
| INT | mode | Flags to support configuration of bitmap |
| INT | color | set the initial of the bitmap |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawText | Value: 43 |
| INT | textId | The ID of the text to render |
| INT | start | The start index of the text to render |
| INT | end | The end index of the text to render |
| INT | contextStart | The index of the start of the shaping context |
| INT | contextEnd | The index of the end of the shaping context |
| FLOAT | x | The x position at which to draw the text |
| FLOAT | y | The y position at which to draw the text |
| BOOLEAN | rtl | Whether the run is in RTL direction |
DrawText operation renders a run of text at a specific (x, y) coordinate.| Type | Name | Description |
|---|---|---|
| BYTE | DrawBitmapFontText | Value: 48 |
| INT | textId | The ID of the text to render |
| INT | bitmapFontId | The ID of the bitmap font |
| INT | start | The start index of the text to render |
| INT | end | The end index of the text to render |
| FLOAT | x | The x position at which to draw the text |
| FLOAT | y | The y position at which to draw the text |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawBitmapFontTextOnPath | Value: 49 |
| INT | textId | The ID of the text to render |
| INT | bitmapFontId | The ID of the bitmap font |
| INT | pathId | The ID of the path to follow |
| INT | start | The start index of the text to render |
| INT | end | The end index of the text to render |
| FLOAT | yAdj | Vertical adjustment relative to the path |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawTextOnPath | Value: 53 |
| INT | textId | The ID of the text |
| INT | pathId | The ID of the path |
| FLOAT | hOffset | Horizontal offset along the path |
| FLOAT | vOffset | Vertical offset relative to the path |
DrawTextOnPath operation renders text along a specified path. The text follows the curve, maintaining its orientation relative to the path's tangent.| Type | Name | Description |
|---|---|---|
| BYTE | DrawTextOnCircle | Value: 57 |
| INT | textId | The ID of the text |
| FLOAT | centerX | The x coordinate of the center |
| FLOAT | centerY | The y coordinate of the center |
| FLOAT | radius | The radius of the circle |
| FLOAT | startAngle | The start angle in degrees |
| FLOAT | warpRadiusOffset | The warp radius offset |
| INT | alignment | The alignment of the text |
| INT | placement | The placement of the text |
DrawTextOnCircle operation renders curved text along the circumference of a circle.| Type | Name | Description |
|---|---|---|
| BYTE | TextData | Value: 102 |
| INT | textId | The ID of the text |
| UTF8 | text | The string value |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawTextAnchored | Value: 133 |
| INT | textId | The ID of the text to render |
| FLOAT | x | The x-position of the anchor point |
| FLOAT | y | The y-position of the anchor point |
| FLOAT | panX | The horizontal pan from left(-1) to right(1), 0 being centered |
| FLOAT | panY | The vertical pan from top(-1) to bottom(1), 0 being centered |
| INT | flags | Behavior flags |
DrawTextAnchored operation renders text relative to an anchor point (x, y) using horizontal (panX) and vertical (panY) values ranging from -1.0 to 1.0. #### Center Aligned (panX: 0, panY: 0)panX: -1, panY: -1)panX: 1, panY: 1)| Type | Name | Description |
|---|---|---|
| BYTE | TextFromFloat | Value: 135 |
| INT | textId | The ID of the resulting text |
| FLOAT | value | The float value to convert |
| SHORT | digitsBefore | Number of digits before the decimal point |
| SHORT | digitsAfter | Number of digits after the decimal point |
| INT | flags | Formatting and padding flags |
| Type | Name | Description |
|---|---|---|
| BYTE | TextMerge | Value: 136 |
| INT | textId | The ID of the resulting text |
| INT | srcId1 | The ID of the first source string |
| INT | srcId2 | The ID of the second source string |
| Type | Name | Description |
|---|---|---|
| BYTE | TextFromFloat | Value: 151 |
| INT | textId | The ID of the resulting text |
| INT | dataSetId | The ID of the string collection |
| FLOAT | index | The index of the string to retrieve |
| Type | Name | Description |
|---|---|---|
| BYTE | TextLookupInt | Value: 153 |
| INT | textId | The ID of the resulting text |
| INT | dataSetId | The ID of the string collection |
| INT | indexId | The ID of the integer index variable |
| Type | Name | Description |
|---|---|---|
| BYTE | TextMeasure | Value: 155 |
| INT | id | The ID of the float variable to store the result |
| INT | textId | The ID of the text to measure |
| INT | type | The type of measurement (WIDTH, HEIGHT, etc.) |
TextMeasure operation calculates dimensions of a text string, such as its width, height, or relative positions like the baseline.| Type | Name | Description |
|---|---|---|
| BYTE | TextLength | Value: 156 |
| INT | lengthId | The ID of the float variable to store the length |
| INT | textId | The ID of the text to measure |
| Type | Name | Description |
|---|---|---|
| BYTE | BitmapFontData | Value: 167 |
| INT | id | The ID of the bitmap font |
| INT | versionAndNumGlyphs | Encoded version and number of glyphs |
| UTF8 | chars[0..n] | The characters for each glyph |
| INT | bitmapId[0..n] | The bitmap ID for each glyph |
| SHORT | marginLeft[0..n] | Left margin for each glyph |
| SHORT | marginTop[0..n] | Top margin for each glyph |
| SHORT | marginRight[0..n] | Right margin for each glyph |
| SHORT | marginBottom[0..n] | Bottom margin for each glyph |
| SHORT | width[0..n] | Width for each glyph |
| SHORT | height[0..n] | Height for each glyph |
| SHORT | kerningSize | Number of entries in the kerning table |
| UTF8 | glyphPair[0..n] | Glyph pair for kerning |
| SHORT | adjustment[0..n] | Horizontal adjustment for kerning pair |
| Type | Name | Description |
|---|---|---|
| BYTE | TextMeasure | Value: 170 |
| INT | id | The ID of the float variable to store the result |
| INT | textId | The ID of the text variable to measure |
| SHORT | type | The type of property to extract |
| SHORT | unused | unused field |
| Type | Name | Description |
|---|---|---|
| BYTE | TextSubtext | Value: 182 |
| INT | textId | The ID of the resulting substring |
| INT | srcId1 | The ID of the source string |
| FLOAT | start | The start index of the substring |
| FLOAT | len | The length of the substring (or -1 for remainder) |
| Type | Name | Description |
|---|---|---|
| BYTE | BitmapTextMeasure | Value: 183 |
| INT | id | The ID of the float variable to store the result |
| INT | textId | The ID of the text to measure |
| INT | bitmapFontId | The ID of the bitmap font |
| INT | type | The type of measurement (WIDTH, HEIGHT, etc.) |
| FLOAT | glyphSpacing | Horizontal spacing adjustment between glyphs in pixels |
| Type | Name | Description |
|---|---|---|
| BYTE | DrawBitmapTextAnchored | Value: 184 |
| INT | textId | The ID of the text to render |
| INT | bitmapFontId | The ID of the bitmap font |
| FLOAT | start | The start index of the text to render |
| FLOAT | end | The end index of the text to render |
| FLOAT | x | The x-position of the anchor point |
| FLOAT | y | The y-position of the anchor point |
| FLOAT | panX | The horizontal pan from left(-1) to right(1), 0 being centered |
| FLOAT | panY | The vertical pan from top(-1) to bottom(1), 0 being centered |
| Type | Name | Description |
|---|---|---|
| BYTE | TextTransform | Value: 199 |
| INT | textId | The ID of the resulting transformed text |
| INT | srcId1 | The ID of the source string |
| FLOAT | start | The start index of the transformation range |
| FLOAT | len | The length of the transformation range |
| INT | operation | The type of transformation to apply |
| Type | Name | Description |
|---|---|---|
| BYTE | TextLayout | Value: 208 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID used to match components for animation purposes |
| INT | textId | The ID of the text to display |
| INT | color | The text color (ARGB) |
| FLOAT | fontSize | The font size in pixels |
| INT | fontStyle | The font style (0=normal, 1=italic) |
| FLOAT | fontWeight | The font weight [1..1000] |
| INT | fontFamilyId | The ID of the font family name string |
| INT | textAlign | The text alignment and flags |
| INT | overflow | The overflow strategy |
| INT | maxLines | The maximum number of lines |
| Type | Name | Description |
|---|---|---|
| BYTE | ComponentStart | Value: 2 |
| INT | type | Type of component |
| INT | componentId | Unique ID for this component |
| FLOAT | width | Width of the component |
| FLOAT | height | Height of the component |
| Type | Name | Description |
|---|---|---|
| BYTE | RootLayout | Value: 200 |
| INT | componentId | Unique ID for this component |
| Type | Name | Description |
|---|---|---|
| BYTE | LayoutContent | Value: 201 |
| INT | componentId | Unique ID for this component |
| Type | Name | Description |
|---|---|---|
| BYTE | HostAction | Value: 209 |
| INT | ACTION_ID | Host Action ID |
| Type | Name | Description |
|---|---|---|
| BYTE | HostNamedAction | Value: 210 |
| INT | TEXT_ID | Named Host Action Text ID |
| INT | VALUE_ID | Named Host Action Value ID |
| Type | Name | Description |
|---|---|---|
| BYTE | HostActionMetadata | Value: 216 |
| INT | ACTION_ID | Host Action ID |
| INT | METADATA | Host Action Text Metadata ID |
| Type | Name | Description |
|---|---|---|
| BYTE | StateLayout | Value: 217 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID for animation purposes |
| INT | horizontalPositioning | Horizontal positioning value |
| INT | verticalPositioning | Vertical positioning value |
| INT | indexId | The ID of the variable providing the current state index |
| Type | Name | Description |
|---|---|---|
| BYTE | FitBoxLayout | Value: 176 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID used to match components for animation purposes |
| INT | horizontalPositioning | Horizontal positioning value |
| INT | verticalPositioning | Vertical positioning value |
WidthIn or HeightIn modifiers). - The first child whose minimum width and height are less than or equal to the FitBox's available constraints is selected. 2. **Visibility Control**: - The selected child is marked as VISIBLE. - All other children are marked as GONE. - If no child fits, the FitBox itself may become GONE. 3. **Sizing**: - The FitBox takes the measured size of the single selected child. ## BoxLayout Box layout implementation. Child components are laid out independently from one another, and painted in their hierarchy order (first children drawnbefore the latter). Horizontal and Vertical positioningare supported. 4 Fields, total size 17 bytes| Type | Name | Description |
|---|---|---|
| BYTE | BoxLayout | Value: 202 |
| INT | COMPONENT_ID | unique id for this component |
| INT | ANIMATION_ID | id used to match components, for animation purposes |
| INT | HORIZONTAL_POSITIONING | horizontal positioning value |
| INT | VERTICAL_POSITIONING | vertical positioning value |
computeWrapSize and computeSize. 1. **Independent Measurement**: - Each child component is measured independently with the available width and height of the Box. - If a child has a dynamic LayoutCompute modifier, its size is calculated based on the provided expressions before final measurement. 2. **Intrinsic Size (Wrap Content)**: - If the Box is set to wrap its content, its width will be the maximum width among all its visible children. - Similarly, its height will be the maximum height among all its visible children. #### Layout Phase In the internalLayoutMeasure method, children are positioned based on the Box's alignment rules. 1. **Alignment**: - **Horizontal Positioning**: Children can be aligned to the START, CENTER, or END of the Box. - **Vertical Positioning**: Children can be aligned to the TOP, CENTER, or BOTTOM of the Box. - Each child is positioned using these global rules relative to the Box's internal area (after padding). 2. **Stacking**: - Components are painted in their hierarchy order. The first child in the list is drawn first, and subsequent children are drawn on top if they overlap. ### Examples| | | | Top | | | Center | | | Bottom | |
| Type | Name | Description |
|---|---|---|
| BYTE | RowLayout | Value: 203 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID used to match components for animation purposes |
| INT | horizontalPositioning | Horizontal positioning value |
| INT | verticalPositioning | Vertical positioning value |
| FLOAT | spacedBy | Horizontal spacing between components |
computeWrapSize and computeSize. 1. **Weight Distribution**: - The layout first identifies children with horizontal weights (WidthModifier.weight). - Children **without** weights are measured first with the available width. The accumulated width of these children is subtracted from the total available space. - The remaining space is then distributed among the weighted children proportional to their weight value. - Each weighted child is measured with its calculated fixed width. 2. **Intrinsic Size**: - The width of the Row is the sum of all children's measured widths plus the spacedBy gaps between them. - The height of the Row is the maximum height among all measured children. #### Layout Phase Once children are measured, the internalLayoutMeasure method determines their final (x, y) coordinates. 1. **Horizontal Positioning**: - **START**: Children are packed at the beginning of the row. - **CENTER**: The entire block of children is centered horizontally. - **END**: Children are packed at the end of the row. - **SPACE_BETWEEN**: The first child is at the start, the last at the end, and the remaining space is distributed evenly between children. - **SPACE_EVENLY**: Space is distributed such that the gap between any two items and the edges is equal. - **SPACE_AROUND**: Space is distributed such that the gap between items is equal, and the gap at the ends is half of the internal gap. 2. **Vertical Positioning**: - Applied individually to each child within the calculated Row height. - **TOP**: Child is at the top. - **CENTER**: Child is vertically centered. - **BOTTOM**: Child is at the bottom. - **Baseline Alignment**: If children have AlignBy modifiers, they are aligned based on their specified baseline or anchor. 3. **Spacing**: - The spacedBy value is added between each child in all positioning modes. ### Examples| | | | Start | | | Center | | | End | | | SpaceEvenly | | | SpaceAround | | | SpaceBetween | |
| Type | Name | Description |
|---|---|---|
| BYTE | ColumnLayout | Value: 204 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID used to match components for animation purposes |
| INT | horizontalPositioning | Horizontal positioning value |
| INT | verticalPositioning | Vertical positioning value |
| FLOAT | spacedBy | Horizontal spacing between components |
HeightModifier.weight). - Children **without** weights are measured first. Their combined height is subtracted from the total available height. - The remaining vertical space is distributed among weighted children proportional to their weights. 2. **Intrinsic Size**: - The height of the Column is the sum of all children's measured heights plus the spacedBy vertical gaps. - The width of the Column is the maximum width among all measured children. #### Layout Phase 1. **Vertical Positioning**: - **TOP**: Children are packed at the top. - **CENTER**: The block of children is centered vertically. - **BOTTOM**: Children are packed at the bottom. - **SPACE_BETWEEN**, **SPACE_EVENLY**, **SPACE_AROUND**: Similar to Row Layout, but applied vertically to distribute children across the available height. 2. **Horizontal Positioning**: - Applied individually to each child within the Column's width. - **START**, **CENTER**, **END**: Aligns children horizontally within the column. 3. **Spacing**: - The spacedBy value is added between each child vertically. ### Examples|
| | | Top |
|
| | | Center |
|
| | | Bottom |
|
| | | SpaceEvenly |
|
| | | SpaceAround |
|
| | | SpaceBetween |
|
| Type | Name | Description |
|---|---|---|
| BYTE | CanvasLayout | Value: 205 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID used to match components for animation purposes |
Draw operations (DrawRect, DrawCircle, etc.). - All drawing instructions contained within the Canvas are executed relative to the Canvas's top-left corner. 2. **Child Positioning**: - Children of a CanvasLayout are by default positioned at (0, 0) and sized to fill the entire Canvas area if standard LayoutComponentContent is used. - However, if LayoutCompute modifiers are used, children can be positioned anywhere on top of the custom drawing. ## CollapsibleRow A row layout that can hide children if space is insufficient 5 Fields, total size 21 bytes| Type | Name | Description |
|---|---|---|
| BYTE | CollapsibleRow | Value: 230 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID for animation purposes |
| INT | horizontalPositioning | Horizontal positioning value |
| INT | verticalPositioning | Vertical positioning value |
| FLOAT | spacedBy | Horizontal spacing between components |
CollapsiblePriority modifiers, they are sorted by priority (lowest values are kept first). - If priorities are equal, the original hierarchy order is used. 2. **Overflow Detection**: - Children are measured one by one. - The layout keeps track of the accumulated width. - As soon as a child's width would cause the total to exceed the available width, that child and all subsequent children (in priority order) are marked as GONE. #### Layout Phase - The remaining VISIBLE children are laid out exactly like a standard Row Layout, using the specified horizontal and vertical positioning. ## CollapsibleColumn A column layout that can hide children if space is insufficient 5 Fields, total size 21 bytes| Type | Name | Description |
|---|---|---|
| BYTE | CollapsibleColumn | Value: 233 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID for animation purposes |
| INT | horizontalPositioning | Horizontal positioning value |
| INT | verticalPositioning | Vertical positioning value |
| FLOAT | spacedBy | Vertical spacing between components |
CollapsiblePriority modifier. 2. **Overflow Detection**: - The layout measures children and accumulates their heights. - Any child that would cause the total height to exceed the Column's maximum height is marked as GONE. #### Layout Phase - Visible children are positioned vertically according to standard Column Layout rules (Top, Center, Bottom, etc.). ## ImageLayout Image layout implementation 5 Fields, total size 21 bytes| Type | Name | Description |
|---|---|---|
| BYTE | ImageLayout | Value: 234 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID used to match components for animation purposes |
| INT | bitmapId | The ID of the bitmap to display |
| INT | scaleType | The scale type to apply |
| FLOAT | alpha | The alpha transparency [0..1] |
scaleType. - Supports typical scaling modes like Fit, CenterCrop, and Fill. #### Rendering - Applies alpha transparency. - Clips the bitmap to the component's bounds if the scaled image exceeds them. ## CoreText [EXPERIMENTAL] (added in v7) !!! WARNING Experimental operation Core text layout implementation with advanced styling 26 Fields, total size 85 + null x 4 + null x 4 bytes| Type | Name | Description |
|---|---|---|
| BYTE | CoreText | Value: 239 |
| INT | textId | The ID of the text to display |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID for animation purposes |
| INT | color | The text color (ARGB) |
| INT | colorId | The ID of the color variable |
| FLOAT | fontSize | The font size |
| FLOAT | minFontSize | Minimum font size for autosize |
| FLOAT | maxFontSize | Maximum font size for autosize |
| INT | fontStyle | The font style |
| FLOAT | fontWeight | The font weight |
| INT | fontFamily | The ID of the font family |
| INT | textAlign | Text alignment |
| INT | overflow | Overflow behavior |
| INT | maxLines | Maximum number of lines |
| FLOAT | letterSpacing | Letter spacing |
| FLOAT | lineHeightAdd | Line height addition |
| FLOAT | lineHeightMultiplier | Line height multiplier |
| INT | lineBreakStrategy | Line break strategy |
| INT | hyphenationFrequency | Hyphenation frequency |
| INT | justificationMode | Justification mode |
| BOOLEAN | underline | Whether to underline |
| BOOLEAN | strikethrough | Whether to strikethrough |
| INT[] | fontAxis | Font axis tags |
| FLOAT[] | fontAxisValues | Font axis values |
| BOOLEAN | autosize | Whether to enable autosize |
| INT | flags | Behavior flags |
autosize is enabled, the layout performs a binary search between minFontSize and maxFontSize. - It finds the largest font size that allows the text to fit within the provided maxWidth and maxHeight without causing unexpected hyphenation or overflow. 3. **Intrinsic Size**: - The measured size is the bounding box of the rendered text glyphs. #### Styling and Alignment - Supports ARGB colors (static or dynamic via ID). - Supports font weights, styles (italic), and variable font axes. - Horizontal alignment (Left, Center, Right, Justify) is applied during the text layout process. ## FlowLayout [EXPERIMENTAL] (added in v7) !!! WARNING Experimental operation Flow layout implementation. Positions components one after the other horizontally and wraps to the next line if space is exhausted. 5 Fields, total size 21 bytes| Type | Name | Description |
|---|---|---|
| BYTE | FlowLayout | Value: 240 |
| INT | componentId | Unique ID for this component |
| INT | animationId | ID for animation purposes |
| INT | horizontalPositioning | Horizontal positioning value |
| INT | verticalPositioning | Vertical positioning value |
| FLOAT | spacedBy | Horizontal spacing between components |
width is the maximum width of any individual row. - The total height is the sum of the heights of all rows. #### Layout Phase 1. **Row Processing**: - Each segment (row) identified in the measurement phase is treated like an individual Row Layout. - Horizontal alignment (START, CENTER, END, etc.) is applied to components within each row. - Vertical alignment (TOP, CENTER, BOTTOM) determines how the entire block of rows is positioned within the Flow Layout's total height. 2. **Spacing**: - Horizontal spacing between components in a row is controlled by spacedBy. # Modifier Operations Augmentations applied to components to change their dimensions, appearance, or behavior. Operations in this category: | ID | Name | Version | Size (bytes) | ---- | ---- | ---- | ---- | | 16 | WidthModifierOperation | v6 | 9 | 54 | RoundedClipRectModifierOperation | v6 | 17 | 55 | BackgroundModifierOperation | v6 | 37 | 58 | PaddingModifierOperation | v6 | 17 | 59 | ClickModifier | v6 | 1 | 67 | HeightModifierOperation | v6 | 9 | 107 | BorderModifierOperation | v6 | 45 | 108 | ClipRectModifierOperation | v6 | 1 | 174 | DrawContentOperation | v6 | 1 | 211 | ComponentVisibilityOperation | v6 | 5 | 219 | TouchModifier | v6 | 1 | 220 | TouchUpModifier | v6 | 1 | 221 | OffsetModifierOperation | v6 | 9 | 223 | ZIndexModifierOperation | v6 | 5 | 224 | GraphicsLayerModifierOperation | v6 | 5 | 225 | TouchCancelModifier | v6 | 1 | 226 | ScrollModifierOperation | v6 | 17 | 228 | MarqueeModifierOperation | v6 | 25 | 229 | RippleModifier | v6 | 1 | 231 | WidthInModifierOperation | v6 | 9 | 232 | HeightInModifierOperation | v6 | 9 | 235 | CollapsiblePriorityModifierOperation | v6 | 9 | 237 | AlignByModifierOperation | v7 | 9 | 238 | LayoutCompute | v7 | 9 ## WidthModifierOperation Set the width dimension on a component 2 Fields, total size 9 bytes| Type | Name | Description |
|---|---|---|
| BYTE | WidthModifierOperation | Value: 16 |
| INT | type | The type of dimension rule (0=FIXED, 1=WRAP, etc.) |
| FLOAT | value | The width value |
| Type | Name | Description |
|---|---|---|
| BYTE | RoundedClipRectModifierOperation | Value: 54 |
| FLOAT | topStart | The topStart radius of the rectangle |
| FLOAT | topEnd | The topEnd radius of the rectangle |
| FLOAT | bottomStart | The bottomStart radius of the rectangle |
| FLOAT | bottomEnd | The bottomEnd radius of the rectangle |
RoundedClipRect modifier restricts the drawing area of a component to its own bounds with rounded corners.| Type | Name | Description |
|---|---|---|
| BYTE | BackgroundModifierOperation | Value: 55 |
| INT | flags | Behavior flags |
| INT | colorId | The ID of the color if flags include COLOR_REF |
| INT | reserve1 | Reserved for future use |
| INT | reserve2 | Reserved for future use |
| FLOAT | r | Red component [0..1] |
| FLOAT | g | Green component [0..1] |
| FLOAT | b | Blue component [0..1] |
| FLOAT | a | Alpha component [0..1] |
| INT | shapeType | The shape type (0=RECTANGLE, 1=CIRCLE) |
Background modifier applies a color and shape behind a component. #### Rectangle Shape| Type | Name | Description |
|---|---|---|
| BYTE | PaddingModifierOperation | Value: 58 |
| FLOAT | left | Left padding |
| FLOAT | top | Top padding |
| FLOAT | right | Right padding |
| FLOAT | bottom | Bottom padding |
Padding modifier adds space around a component's content.| Type | Name | Description |
|---|---|---|
| BYTE | ClickModifier | Value: 59 |
| Type | Name | Description |
|---|---|---|
| BYTE | HeightModifierOperation | Value: 67 |
| INT | type | The type of dimension rule (0=FIXED, 1=WRAP, etc.) |
| FLOAT | value | The height value |
| Type | Name | Description |
|---|---|---|
| BYTE | BorderModifierOperation | Value: 107 |
| INT | flags | Behavior flags |
| INT | colorId | The ID of the color if flags include COLOR_REF |
| INT | reserve1 | Reserved for future use |
| INT | reserve2 | Reserved for future use |
| FLOAT | borderWidth | Width of the border |
| FLOAT | roundedCorner | Radius for rounded corners |
| FLOAT | r | Red component [0..1] |
| FLOAT | g | Green component [0..1] |
| FLOAT | b | Blue component [0..1] |
| FLOAT | a | Alpha component [0..1] |
| INT | shapeType | The shape type (0=RECTANGLE, 1=CIRCLE) |
Border modifier draws a stroke around the component's edge with a specific width and corner radius.| Type | Name | Description |
|---|---|---|
| BYTE | ClipRectModifierOperation | Value: 108 |
ClipRect modifier restricts the drawing area of a component to its own rectangular bounds.| Type | Name | Description |
|---|---|---|
| BYTE | DrawContentOperation | Value: 174 |
| Type | Name | Description |
|---|---|---|
| BYTE | ComponentVisibilityOperation | Value: 211 |
| INT | visibilityId | The ID of the integer variable representing visibility |
ComponentVisibility modifier controls whether a component is visible, hidden but still taking up space, or completely removed from the layout.| Type | Name | Description |
|---|---|---|
| BYTE | TouchModifier | Value: 219 |
| Type | Name | Description |
|---|---|---|
| BYTE | TouchUpModifier | Value: 220 |
| Type | Name | Description |
|---|---|---|
| BYTE | OffsetModifierOperation | Value: 221 |
| FLOAT | x | X offset |
| FLOAT | y | Y offset |
Offset modifier shifts the position of a component by a specific amount in X and Y without affecting its layout in the parent.| Type | Name | Description |
|---|---|---|
| BYTE | ZIndexModifierOperation | Value: 223 |
| FLOAT | value | The Z-Index value |
ZIndex modifier determines the stacking order of overlapping components. Components with a higher Z-Index are drawn on top of those with a lower value.| Type | Name | Description |
|---|---|---|
| BYTE | GraphicsLayerModifierOperation | Value: 224 |
| INT | length | Number of attributes |
| REPEATED DATA |
| Type | Name | Description |
|---|---|---|
| INT | attributeId | The ID and type of the attribute |
| FLOAT | attributeValue | The value of the attribute |
| | REPEATED DATA |
| Type | Name | Description |
|---|---|---|
| INT | attributeId | The ID and type of the attribute |
| INT | attributeValue | The value of the attribute |
|
GraphicsLayer modifier applies advanced transformations and effects like rotation, scaling, and transparency to a component.| Type | Name | Description |
|---|---|---|
| BYTE | TouchCancelModifier | Value: 225 |
| Type | Name | Description |
|---|---|---|
| BYTE | ScrollModifierOperation | Value: 226 |
| INT | direction | Direction of the scroll (0=VERTICAL, 1=HORIZONTAL) |
| FLOAT | position | The current scroll position (expression) |
| FLOAT | max | The maximum scroll position |
| FLOAT | notchMax | The maximum notch position |
Scroll modifier allows a component to have a larger internal content area than its physical viewport bounds.| Type | Name | Description |
|---|---|---|
| BYTE | MarqueeModifierOperation | Value: 228 |
| INT | iterations | Number of iterations |
| INT | animationMode | Animation mode |
| FLOAT | repeatDelayMillis | Repeat delay in ms |
| FLOAT | initialDelayMillis | Initial delay in ms |
| FLOAT | spacing | Spacing between marquee iterations |
| FLOAT | velocity | Velocity of the marquee animation |
Marquee modifier creates a scrolling animation for text that is too long to fit within its container.| Type | Name | Description |
|---|---|---|
| BYTE | RippleModifier | Value: 229 |
| Type | Name | Description |
|---|---|---|
| BYTE | WidthInModifierOperation | Value: 231 |
| FLOAT | min | The minimum width, -1 if not applied |
| FLOAT | max | The maximum width, -1 if not applied |
| Type | Name | Description |
|---|---|---|
| BYTE | HeightInModifierOperation | Value: 232 |
| FLOAT | min | The minimum height, -1 if not applied |
| FLOAT | max | The maximum height, -1 if not applied |
| Type | Name | Description |
|---|---|---|
| BYTE | CollapsiblePriorityModifierOperation | Value: 235 |
| INT | orientation | Horizontal(0) or Vertical (1) |
| FLOAT | priority | The associated priority |
| Type | Name | Description |
|---|---|---|
| BYTE | AlignByModifierOperation | Value: 237 |
| FLOAT | line | The ID of the float variable or baseline ID to align by |
| INT | flags | Alignment flags |
| Type | Name | Description |
|---|---|---|
| BYTE | LayoutCompute | Value: 238 |
| INT | type | Type of computation (0=MEASURE, 1=POSITION) |
| INT | boundsId | The ID of the float list variable to store the bounds |
| BOOLEAN | animateChanges | Whether to animate layout changes |
| Type | Name | Description |
|---|---|---|
| BYTE | ValueIntegerChangeActionOperation | Value: 212 |
| INT | targetValueId | The ID of the integer variable to update |
| INT | value | The new integer value to assign |
| Type | Name | Description |
|---|---|---|
| BYTE | ValueStringChangeActionOperation | Value: 213 |
| INT | targetValueId | The ID of the string variable to update |
| INT | valueId | The ID of the new string value to assign |
| Type | Name | Description |
|---|---|---|
| BYTE | ValueIntegerExpressionChangeActionOperation | Value: 218 |
| LONG | targetValueId | The ID of the integer variable to update |
| LONG | valueExpressionId | The ID of the expression to evaluate |
| Type | Name | Description |
|---|---|---|
| BYTE | ValueFloatChangeActionOperation | Value: 222 |
| INT | targetValueId | The ID of the float variable to update |
| FLOAT | value | The new float value to assign |
| Type | Name | Description |
|---|---|---|
| BYTE | ValueFloatExpressionChangeActionOperation | Value: 227 |
| INT | targetValueId | The ID of the float variable to update |
| INT | valueExpressionId | The ID of the expression to evaluate |
| Type | Name | Description |
|---|---|---|
| BYTE | AnimationSpec | Value: 14 |
| INT | animationId | The ID of the animation |
| FLOAT | motionDuration | Duration of the motion animation in ms |
| INT | motionEasingType | The type of easing for motion |
| FLOAT | visibilityDuration | Duration of visibility animation in ms |
| INT | visibilityEasingType | The type of easing for visibility |
| INT | enterAnimation | The entry animation type |
| INT | exitAnimation | The exit animation type |
AnimationSpec defines easing curves and durations for motion and visibility transitions. #### Easing Curves (Cubic Bezier)| Type | Name | Description |
|---|---|---|
| BYTE | ParticlesCreate | Value: 161 |
| INT | id | The ID of the particle system |
| INT | particleCount | Number of particles to create |
| INT | varCount | Number of variables associated with each particle |
| INT | varId[0..n] | The ID of each associated variable |
| INT | equLen[0..n] | The length of the initialization equation for each variable |
| FLOAT[] | equations[0..n] | The initialization equations (RPN) |
ParticlesCreate operation defines a particle emitter that generates short-lived visual elements with dynamic velocity, spread, and life.| Type | Name | Description |
|---|---|---|
| BYTE | ParticlesLoop | Value: 163 |
| INT | id | The ID of the particle system |
| INT | restartLen | The length of the restart equation (recycles particle if > 0) |
| FLOAT[] | restartEquation | The restart equation (RPN) |
| INT | varCount | The number of update equations |
| INT | equLen[0..n] | The length of each update equation |
| FLOAT[] | equations[0..n] | The update equations (RPN) |
| Type | Name | Description |
|---|---|---|
| BYTE | ImpulseOperation | Value: 164 |
| FLOAT | duration | Duration of the impulse |
| FLOAT | startAt | The start time of the impulse |
| Type | Name | Description |
|---|---|---|
| BYTE | ImpulseProcess | Value: 165 |
| Type | Name | Description |
|---|---|---|
| BYTE | ParticlesCompare | Value: 194 |
| INT | id | The ID of the particle system |
| SHORT | flags | Configuration flags |
| FLOAT | min | The minimum index to process |
| FLOAT | max | The maximum index to process |
| INT | expLen | The length of the comparison expression |
| FLOAT[] | expression | The comparison expression (RPN) |
| INT | res1Count | The number of equations in the first result block |
| FLOAT[] | res1Equations | The equations for the first result block |
| INT | res2Count | The number of equations in the second result block |
| FLOAT[] | res2Equations | The equations for the second result block |
| Type | Name | Description |
|---|---|---|
| BYTE | FloatExpression | Value: 81 |
| INT | id | The ID of the resulting float |
| SHORT | expression_length | The length of the expression |
| SHORT | animation_length | The length of the animation spec |
| REPEATED FLOAT | expression | Sequence of floats representing an expression (RPN) |
| REPEATED FLOAT | animationSpec | Sequence of floats representing an animation curve |
| Type | Name | Description |
|---|---|---|
| FLOAT | duration | Time in sec |
| INT | bits | WRAP |
| REPEATED FLOAT | spec | SPEC PARAMETERS |
| FLOAT | initialValue | Initial value |
| FLOAT | wrapValue | Wrap value |
|
| Type | Name | Description |
|---|---|---|
| BYTE | IntegerExpression | Value: 144 |
| INT | id | The ID of the resulting integer |
| INT | mask | Bitmask representing whether each value is a constant or an ID |
| INT | length | The number of elements in the expression |
| INT[] | values | The array of constants, IDs, and operators (RPN) |
| Type | Name | Description |
|---|---|---|
| BYTE | ComponentValue | Value: 150 |
| INT | type | The type of value to expose |
| INT | componentId | The ID of the component to reference |
| INT | valueId | The ID of the variable to store the value in |
| Type | Name | Description |
|---|---|---|
| BYTE | TouchExpression | Value: 157 |
| INT | id | The ID of the resulting float variable |
| FLOAT | value | The initial value |
| FLOAT | min | The minimum allowed value |
| FLOAT | max | The maximum allowed value |
| FLOAT | velocityId | Reserved for velocity ID |
| INT | touchEffects | Haptic feedback and touch behavior flags |
| INT | expression_length | The length of the touch mapping expression |
| REPEATED FLOAT | expression | Sequence of floats representing touch mapping (RPN) |
| INT | stopModeAndLen | Encoded stop mode and length of stop spec |
| REPEATED FLOAT | stopSpec | Parameters for stop behavior (e.g., notches) |
| INT | easingLen | The length of the easing spec |
| REPEATED FLOAT | easingSpec | Parameters for deceleration easing |
| Type | Name | Description |
|---|---|---|
| BYTE | ImageAttribute | Value: 171 |
| INT | id | The ID of the float variable to store the result |
| INT | imageId | The ID of the image variable to extract from |
| SHORT | type | The type of property to extract (0=WIDTH, 1=HEIGHT) |
| SHORT | argsLength | The number of additional arguments |
| REPEATED INT | args | The additional arguments |
| Type | Name | Description |
|---|---|---|
| BYTE | TimeAttribute | Value: 172 |
| INT | id | The ID of the float variable to store the result |
| INT | timeId | The ID of the time variable to extract from |
| SHORT | type | The type of time information to extract |
| SHORT | argsLength | The number of additional arguments |
| REPEATED INT | args | The additional arguments |
| Type | Name | Description |
|---|---|---|
| BYTE | ConditionalOperations | Value: 178 |
| BYTE | type | The type of comparison (EQ, NEQ, LT, etc.) |
| FLOAT | varA | The first value to compare |
| FLOAT | varB | The second value to compare |
| Type | Name | Description |
|---|---|---|
| BYTE | IdLookup | Value: 192 |
| INT | textId | The ID of the integer variable to store the result |
| FLOAT | dataSet | The ID of the collection |
| FLOAT | index | The index of the ID to retrieve |
| Type | Name | Description |
|---|---|---|
| BYTE | Loop | Value: 215 |
| INT | indexId | The ID of the variable to store the loop index |
| FLOAT | from | Starting value |
| FLOAT | step | Increment value |
| FLOAT | until | Stop value (exclusive) |
| Type | Name | Description |
|---|---|---|
| BYTE | MatrixScale | Value: 126 |
| FLOAT | scaleX | The amount to scale in X |
| FLOAT | scaleY | The amount to scale in Y |
| FLOAT | pivotX | The x-coordinate for the pivot point |
| FLOAT | pivotY | The y-coordinate for the pivot point |
MatrixScale operation scales the coordinate system by scaleX and scaleY relative to a pivot point (pivotX, pivotY).| Type | Name | Description |
|---|---|---|
| BYTE | MatrixTranslate | Value: 127 |
| FLOAT | dx | The distance to translate in X |
| FLOAT | dy | The distance to translate in Y |
MatrixTranslate operation moves the coordinate system by dx and dy.| Type | Name | Description |
|---|---|---|
| BYTE | MatrixSkew | Value: 128 |
| FLOAT | skewX | The amount to skew in X |
| FLOAT | skewY | The amount to skew in Y |
MatrixSkew operation applies a skew (shear) transformation to the coordinate system.| Type | Name | Description |
|---|---|---|
| BYTE | MatrixRotate | Value: 129 |
| FLOAT | rotate | Angle to rotate |
| FLOAT | pivotX | X Pivot point |
| FLOAT | pivotY | Y Pivot point |
MatrixRotate operation rotates the coordinate system by rotate degrees relative to a pivot point (pivotX, pivotY).| Type | Name | Description |
|---|---|---|
| BYTE | MatrixSave | Value: 130 |
MatrixSave pushes the current transformation and clip state onto a stack. MatrixRestore pops the state, returning the coordinate system to its previous configuration.| Type | Name | Description |
|---|---|---|
| BYTE | MatrixRestore | Value: 131 |
| Type | Name | Description |
|---|---|---|
| BYTE | MatrixFromPath | Value: 181 |
| INT | pathId | The ID of the path |
| FLOAT | percent | The position on the path [0..1] |
| FLOAT | vOffset | Vertical offset from the path |
| INT | flags | Flags for position/tangent |
MatrixFromPath operation calculates a matrix that aligns an object to a specific point and tangent along a path.| Type | Name | Description |
|---|---|---|
| BYTE | MatrixConstant | Value: 186 |
| INT | matrixId | The ID of the matrix |
| INT | type | The type of matrix |
| FLOAT[] | values | The matrix values |
MatrixConstant operation defines a static transformation matrix. In RemoteCompose, matrices are typically 3x3 (9 values) for 2D transformations, following the standard row-major indexing: | | | | |:---:|:---:|:---:| | **MSCALE_X** (0) | **MSKEW_X** (1) | **MTRANS_X** (2) | | **MSKEW_Y** (3) | **MSCALE_Y** (4) | **MTRANS_Y** (5) | | **MPERSP_0** (6) | **MPERSP_1** (7) | **MPERSP_2** (8) || Type | Name | Description |
|---|---|---|
| BYTE | MatrixExpression | Value: 187 |
| INT | matrixId | The ID of the matrix |
| INT | type | The type of matrix |
| FLOAT[] | expression | The matrix expression |
| Type | Name | Description |
|---|---|---|
| BYTE | MatrixVectorMath | Value: 188 |
| INT | matrixId | The ID of the matrix |
| SHORT | opType | The type of operation (0=multiply) |
| INT | outLength | The length of the output vector |
| INT[] | outputs | The IDs to write the output vector |
| INT | inLength | The length of the input vector |
| FLOAT[] | inputs | The input vector values |
| Type | Name | Description |
|---|---|---|
| BYTE | CoreSemantics | Value: 250 |
| INT | contentDescriptionId | ID of the content description string |
| BYTE | role | The accessibility role (BUTTON, CHECKBOX, etc.) |
| INT | textId | ID of the text string |
| INT | stateDescriptionId | ID of the state description string |
| BYTE | mode | Semantics merge mode (SET, MERGE) |
| BOOLEAN | enabled | Whether the component is enabled |
| BOOLEAN | clickable | Whether the component is clickable |
| Type | Name | Description |
|---|---|---|
| BYTE | HapticFeedback | Value: 177 |
| INT | hapticFeedbackType | Type of haptic feedback |