File syn_imgui.h¶
FileList > src > syntropic > ui > syn_imgui.h
Go to the source code of this file
Lightweight, zero-allocation Immediate Mode GUI (IMGUI) for embedded systems. More...
#include "../common/syn_defs.h"#include "../display/syn_gfx.h"#include <stdbool.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_IMGUI_Context Immediate-mode GUI context — inputs, navigation, style, layout. |
| struct | SYN_IMGUI_Layout Auto-layout state. Managed by syn_imgui_layout_begin/end. |
| struct | SYN_IMGUI_Scroll Scroll region state for scrollable IMGUI panels. |
| struct | SYN_IMGUI_Style Visual style parameters for IMGUI widgets. |
Public Functions¶
| Type | Name |
|---|---|
| void | syn_imgui_bar_chart (SYN_IMGUI_Context * ctx, const char * title, const int32_t * data, size_t count, int32_t min_val, int32_t max_val, int16_t x, int16_t y, int16_t w, int16_t h) Vertical bar chart. |
| void | syn_imgui_begin (SYN_IMGUI_Context * ctx, SYN_GfxContext gfx, bool select, bool back, int32_t enc_delta, bool touch_down, int16_t touch_x, int16_t touch_y) Begin a new IMGUI frame. |
| void | syn_imgui_begin_disabled (SYN_IMGUI_Context * ctx) Begin a disabled region. Widgets draw dimmed and skip input. |
| bool | syn_imgui_button (SYN_IMGUI_Context * ctx, const char * label, int16_t x, int16_t y, int16_t w, int16_t h) Draw and handle a button. |
| bool | syn_imgui_checkbox (SYN_IMGUI_Context * ctx, const char * label, bool * checked, int16_t x, int16_t y, int16_t w, int16_t h) Draw and handle a checkbox. |
| bool | syn_imgui_checkbox_flags (SYN_IMGUI_Context * ctx, const char * label, uint32_t * flags, uint32_t mask, int16_t x, int16_t y, int16_t w, int16_t h) Checkbox that toggles a bitmask in a flags word. |
| bool | syn_imgui_collapsing_header (SYN_IMGUI_Context * ctx, const char * label, bool * expanded, int16_t x, int16_t y, int16_t w, int16_t h) Collapsible section header. |
| bool | syn_imgui_combo (SYN_IMGUI_Context * ctx, const char * label, const char ** options, size_t count, int32_t * selected, int16_t x, int16_t y, int16_t w, int16_t h) Renders and handles an inline option selection dropdown/selector. |
| SYN_IMGUI_Style | syn_imgui_default_style (void) Return the default monochrome style (white-on-black). |
| bool | syn_imgui_dialog (SYN_IMGUI_Context * ctx, const char * message, bool * ok_clicked, int16_t x, int16_t y, int16_t w, int16_t h) Renders a modal confirmation dialog overlay. |
| void | syn_imgui_end (SYN_IMGUI_Context * ctx) End the IMGUI frame. |
| void | syn_imgui_end_disabled (SYN_IMGUI_Context * ctx) End a disabled region. |
| void | syn_imgui_gauge (SYN_IMGUI_Context * ctx, const char * label, int32_t value, int32_t min, int32_t max, int16_t cx, int16_t cy, int16_t radius) Renders an analog meter gauge with a needle indicator. |
| void | syn_imgui_graph (SYN_IMGUI_Context * ctx, const char * title, const int32_t * data, size_t count, int32_t min_val, int32_t max_val, int16_t x, int16_t y, int16_t w, int16_t h) Renders a line telemetry chart. |
| void | syn_imgui_group_begin (SYN_IMGUI_Context * ctx, const char * title, int16_t x, int16_t y, int16_t w, int16_t h) Begin a visual group box with an optional title. |
| void | syn_imgui_group_end (SYN_IMGUI_Context * ctx) End the group box. |
| bool | syn_imgui_icon_button (SYN_IMGUI_Context * ctx, const uint8_t * icon, int16_t icon_w, int16_t icon_h, int16_t x, int16_t y, int16_t w, int16_t h) Button that displays a monochrome icon bitmap. |
| void | syn_imgui_init (SYN_IMGUI_Context * ctx) Initialize the IMGUI context. |
| void | syn_imgui_label (SYN_IMGUI_Context * ctx, const char * text, int16_t x, int16_t y) Draw a static text label (no navigation ID, no interaction). |
| void | syn_imgui_label_centered (SYN_IMGUI_Context * ctx, const char * text, int16_t x, int16_t y, int16_t w) Draw a centered label within a given width. |
| void | syn_imgui_label_colored (SYN_IMGUI_Context * ctx, const char * text, uint16_t color, int16_t x, int16_t y) Draw a label in an arbitrary color. |
| void | syn_imgui_label_right (SYN_IMGUI_Context * ctx, const char * text, int16_t x, int16_t y, int16_t w) Draw a right-aligned label within a given width. |
| void | syn_imgui_layout_begin (SYN_IMGUI_Context * ctx, int16_t x, int16_t y, int16_t w) Begin an auto-layout region. |
| void | syn_imgui_layout_end (SYN_IMGUI_Context * ctx) End the auto-layout region. |
| void | syn_imgui_layout_row (SYN_IMGUI_Context * ctx, int items, const int16_t * widths, int16_t height) Define a multi-column layout row. |
| void | syn_imgui_progress_bar (SYN_IMGUI_Context * ctx, int32_t value, int32_t min, int32_t max, int16_t x, int16_t y, int16_t w, int16_t h) Renders a non-interactive progress bar. |
| void | syn_imgui_progress_bar_ex (SYN_IMGUI_Context * ctx, int32_t value, int32_t min, int32_t max, const char * overlay, int16_t x, int16_t y, int16_t w, int16_t h) Enhanced progress bar with overlay text and indeterminate mode. |
| bool | syn_imgui_radio (SYN_IMGUI_Context * ctx, const char * label, int32_t * selection, int32_t button_val, int16_t x, int16_t y, int16_t w, int16_t h) Draw and handle a radio button option. |
| void | syn_imgui_same_line (SYN_IMGUI_Context * ctx) Place the next widget on the same row as the previous one. |
| void | syn_imgui_scroll_begin (SYN_IMGUI_Context * ctx, int16_t x, int16_t y, int16_t w, int16_t h, int16_t * scroll) Begin a scrollable region. |
| void | syn_imgui_scroll_end (SYN_IMGUI_Context * ctx) End the scrollable region and draw scroll indicator. |
| bool | syn_imgui_selectable (SYN_IMGUI_Context * ctx, const char * label, bool * selected, int16_t x, int16_t y, int16_t w, int16_t h) Full-width clickable row (like a borderless toggleable button). |
| void | syn_imgui_separator (SYN_IMGUI_Context * ctx, int16_t x, int16_t y, int16_t w) Draw a horizontal separator line. |
| void | syn_imgui_separator_text (SYN_IMGUI_Context * ctx, const char * text, int16_t x, int16_t y, int16_t w) Draw a labeled separator: ── Title ────────── |
| void | syn_imgui_set_style (SYN_IMGUI_Context * ctx, const SYN_IMGUI_Style * style) Override the active style. |
| bool | syn_imgui_slider (SYN_IMGUI_Context * ctx, const char * label, int32_t * value, int32_t min, int32_t max, int16_t x, int16_t y, int16_t w, int16_t h) Draw and handle an integer value slider. |
| void | syn_imgui_spacing (SYN_IMGUI_Context * ctx, int16_t pixels) Insert vertical spacing (moves the layout cursor down). |
| bool | syn_imgui_spinner (SYN_IMGUI_Context * ctx, const char * label, int32_t * value, int32_t min, int32_t max, int32_t step, int16_t x, int16_t y, int16_t w, int16_t h) Integer numeric spinner widget. |
| void | syn_imgui_status_bar (SYN_IMGUI_Context * ctx, const char * text, int16_t x, int16_t y, int16_t w) Draw a single-line status bar with a separator above it. |
| bool | syn_imgui_tabs (SYN_IMGUI_Context * ctx, const char ** labels, size_t count, int32_t * active, int16_t x, int16_t y, int16_t w) Horizontal tab selector. |
| void | syn_imgui_text_clipped (SYN_IMGUI_Context * ctx, const char * text, int16_t x, int16_t y, int16_t clip_x, int16_t clip_y, int16_t clip_w, int16_t clip_h) Draw text clipped to a bounding rectangle. |
| void | syn_imgui_text_marquee (SYN_IMGUI_Context * ctx, const char * text, int16_t * offset, int16_t x, int16_t y, int16_t w, int16_t speed) Scrolling text label with pause at each end. |
| void | syn_imgui_text_wrapped (SYN_IMGUI_Context * ctx, const char * text, int16_t x, int16_t y, int16_t w) Render word-wrapped text within a width. |
| bool | syn_imgui_toggle (SYN_IMGUI_Context * ctx, const char * label, bool * state, int16_t x, int16_t y, int16_t w, int16_t h) ON/OFF toggle switch. |
| void | syn_imgui_value_int (SYN_IMGUI_Context * ctx, const char * label, int32_t value, int16_t x, int16_t y) Draw a non-interactive "label: value" pair. |
| bool | syn_imgui_widget_visible (const SYN_IMGUI_Context * ctx, int16_t y, int16_t h) Check if a widget at (y, h) is visible in the scroll viewport. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_IMGUI_MAX_ROW_COLS 8Maximum number of columns in a layout_row call. |
Detailed Description¶
Supports both button/encoder physical inputs and touch-screen inputs.
Public Functions Documentation¶
function syn_imgui_bar_chart¶
Vertical bar chart.
void syn_imgui_bar_chart (
SYN_IMGUI_Context * ctx,
const char * title,
const int32_t * data,
size_t count,
int32_t min_val,
int32_t max_val,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.titleChart title (drawn top-left).dataData values.countNumber of values.min_valMinimum axis value.max_valMaximum axis value.xBounds.
function syn_imgui_begin¶
Begin a new IMGUI frame.
void syn_imgui_begin (
SYN_IMGUI_Context * ctx,
SYN_GfxContext gfx,
bool select,
bool back,
int32_t enc_delta,
bool touch_down,
int16_t touch_x,
int16_t touch_y
)
Resets the transient ID counter, processes physical navigation inputs, and resets active states.
Parameters:
ctxContext.gfxGraphics context to draw on.selectTrue if select button was pressed this frame.backTrue if back button was pressed this frame.enc_deltaEncoder rotation value for this frame.touch_downTrue if touch screen is active.touch_xTouch X coordinate.touch_yTouch Y coordinate.
function syn_imgui_begin_disabled¶
Begin a disabled region. Widgets draw dimmed and skip input.
Calls may be nested; the region is re-enabled only when every begin_disabled has a matching end_disabled.
Parameters:
ctxContext.
function syn_imgui_button¶
Draw and handle a button.
bool syn_imgui_button (
SYN_IMGUI_Context * ctx,
const char * label,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.labelButton text.xX coordinate.yY coordinate.wWidth.hHeight.
Returns:
true if the button was selected/clicked this frame.
function syn_imgui_checkbox¶
Draw and handle a checkbox.
bool syn_imgui_checkbox (
SYN_IMGUI_Context * ctx,
const char * label,
bool * checked,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.labelCheckbox label.checkedPointer to boolean state.xX coordinate.yY coordinate.wWidth.hHeight.
Returns:
true if the checkbox state was toggled this frame.
function syn_imgui_checkbox_flags¶
Checkbox that toggles a bitmask in a flags word.
bool syn_imgui_checkbox_flags (
SYN_IMGUI_Context * ctx,
const char * label,
uint32_t * flags,
uint32_t mask,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.labelDisplay label.flagsPointer to the flags word (modified in place).maskBitmask to toggle.xBounds (0 = auto-layout).
Returns:
true if the value changed this frame.
function syn_imgui_collapsing_header¶
Collapsible section header.
bool syn_imgui_collapsing_header (
SYN_IMGUI_Context * ctx,
const char * label,
bool * expanded,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Renders "+ Label" (collapsed) or "- Label" (expanded). Toggles *expanded on click.
Parameters:
ctxContext.labelSection title.expandedPointer to expansion state (toggled on click).xBounds (0 = auto-layout).
Returns:
true if the expanded state changed this frame.
function syn_imgui_combo¶
Renders and handles an inline option selection dropdown/selector.
bool syn_imgui_combo (
SYN_IMGUI_Context * ctx,
const char * label,
const char ** options,
size_t count,
int32_t * selected,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.labelSelector label.optionsArray of option string labels.countNumber of option strings in the array.selectedPointer to active selected index.xX coordinate.yY coordinate.wWidth.hHeight.
Returns:
true if selection changed this frame.
function syn_imgui_default_style¶
Return the default monochrome style (white-on-black).
The returned struct may be modified and passed to syn_imgui_set_style().
Returns:
Default style struct.
function syn_imgui_dialog¶
Renders a modal confirmation dialog overlay.
bool syn_imgui_dialog (
SYN_IMGUI_Context * ctx,
const char * message,
bool * ok_clicked,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Captures all navigation and touch focus until dismissed.
Parameters:
ctxContext.messageDisplay text.ok_clickedPointer to check trigger results (updated when OK is clicked).xX coordinate.yY coordinate.wWidth.hHeight.
Returns:
true if the modal dialog has been dismissed (OK or CANCEL selected).
function syn_imgui_end¶
End the IMGUI frame.
Finalizes widget count tracking.
Parameters:
ctxContext.
function syn_imgui_end_disabled¶
End a disabled region.
Parameters:
ctxContext.
function syn_imgui_gauge¶
Renders an analog meter gauge with a needle indicator.
void syn_imgui_gauge (
SYN_IMGUI_Context * ctx,
const char * label,
int32_t value,
int32_t min,
int32_t max,
int16_t cx,
int16_t cy,
int16_t radius
)
Uses lightweight fixed-point integer mathematics for vector coordinates.
Parameters:
ctxContext.labelGauge label.valueCurrent value to point needle at.minMinimum bounds.maxMaximum bounds.cxCenter X coordinate.cyCenter Y coordinate.radiusRadius of gauge boundary.
function syn_imgui_graph¶
Renders a line telemetry chart.
void syn_imgui_graph (
SYN_IMGUI_Context * ctx,
const char * title,
const int32_t * data,
size_t count,
int32_t min_val,
int32_t max_val,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.titleChart title label.dataPointer to array of data points.countNumber of data points.min_valMinimum scale limit.max_valMaximum scale limit.xX coordinate.yY coordinate.wWidth.hHeight.
function syn_imgui_group_begin¶
Begin a visual group box with an optional title.
void syn_imgui_group_begin (
SYN_IMGUI_Context * ctx,
const char * title,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.titleTitle text (NULL for no title).xBounds.
function syn_imgui_group_end¶
End the group box.
Parameters:
ctxContext.
function syn_imgui_icon_button¶
Button that displays a monochrome icon bitmap.
bool syn_imgui_icon_button (
SYN_IMGUI_Context * ctx,
const uint8_t * icon,
int16_t icon_w,
int16_t icon_h,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.iconBitmap data (1bpp, row-major, MSB first).icon_wIcon dimensions in pixels.xButton bounds (0 = auto-layout).
Returns:
true if clicked this frame.
function syn_imgui_init¶
Initialize the IMGUI context.
Parameters:
ctxContext to initialize.
function syn_imgui_label¶
Draw a static text label (no navigation ID, no interaction).
Uses style.fg for color. When inside a layout region with x=0, y=0, the label is drawn at the current cursor and the cursor advances.
Parameters:
ctxContext.textNull-terminated string.xX coordinate (0 = use layout cursor).yY coordinate (0 = use layout cursor).
function syn_imgui_label_centered¶
Draw a centered label within a given width.
void syn_imgui_label_centered (
SYN_IMGUI_Context * ctx,
const char * text,
int16_t x,
int16_t y,
int16_t w
)
Parameters:
ctxContext.textNull-terminated string.xLeft edge and vertical position.wWidth to center within.
function syn_imgui_label_colored¶
Draw a label in an arbitrary color.
void syn_imgui_label_colored (
SYN_IMGUI_Context * ctx,
const char * text,
uint16_t color,
int16_t x,
int16_t y
)
Parameters:
ctxContext.textNull-terminated string.color16-bit color value.xPosition.
function syn_imgui_label_right¶
Draw a right-aligned label within a given width.
void syn_imgui_label_right (
SYN_IMGUI_Context * ctx,
const char * text,
int16_t x,
int16_t y,
int16_t w
)
Parameters:
ctxContext.textNull-terminated string.xLeft edge and vertical position.wWidth to right-align within.
function syn_imgui_layout_begin¶
Begin an auto-layout region.
Widgets within this region may pass x=0, y=0, w=0, h=0 to use the layout cursor. Widgets that use the cursor advance it down by (widget_height + style.spacing) after each call.
Parameters:
ctxContext.xLeft edge of the layout region.yTop edge.wDefault widget width (used when widget's w parameter is 0).
function syn_imgui_layout_end¶
End the auto-layout region.
Parameters:
ctxContext.
function syn_imgui_layout_row¶
Define a multi-column layout row.
void syn_imgui_layout_row (
SYN_IMGUI_Context * ctx,
int items,
const int16_t * widths,
int16_t height
)
Subsequent auto-layout widgets fill columns left-to-right. Positive width = fixed pixels. Negative width = fill remainder.
Parameters:
ctxContext (must be inside a layout region).itemsNumber of columns (max SYN_IMGUI_MAX_ROW_COLS).widthsArray of column widths (NULL for equal split).heightRow height (0 = auto).
function syn_imgui_progress_bar¶
Renders a non-interactive progress bar.
void syn_imgui_progress_bar (
SYN_IMGUI_Context * ctx,
int32_t value,
int32_t min,
int32_t max,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.valueCurrent status value.minMinimum possible value.maxMaximum possible value.xX coordinate.yY coordinate.wWidth.hHeight.
function syn_imgui_progress_bar_ex¶
Enhanced progress bar with overlay text and indeterminate mode.
void syn_imgui_progress_bar_ex (
SYN_IMGUI_Context * ctx,
int32_t value,
int32_t min,
int32_t max,
const char * overlay,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.valueCurrent value. If value < min, renders indeterminate animation.minValue range.overlayOverlay text (NULL = auto "XX%", "" = no text).xBounds.
function syn_imgui_radio¶
Draw and handle a radio button option.
bool syn_imgui_radio (
SYN_IMGUI_Context * ctx,
const char * label,
int32_t * selection,
int32_t button_val,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Sets the selection variable to the target button value if clicked or touched.
Parameters:
ctxContext.labelRadio button label.selectionPointer to active selection variable.button_valSpecific option value this button represents.xX coordinate.yY coordinate.wWidth.hHeight.
Returns:
true if the selection changed to this button's value this frame.
function syn_imgui_same_line¶
Place the next widget on the same row as the previous one.
Call immediately before the next widget. The next widget's x is set to (previous widget right edge + style.spacing).
Parameters:
ctxContext.
function syn_imgui_scroll_begin¶
Begin a scrollable region.
void syn_imgui_scroll_begin (
SYN_IMGUI_Context * ctx,
int16_t x,
int16_t y,
int16_t w,
int16_t h,
int16_t * scroll
)
Widgets between scroll_begin and scroll_end are clipped to the viewport and offset by the scroll position. The scroll offset is auto-adjusted to keep the focused widget visible.
Parameters:
ctxContext.xViewport left edge.yViewport top edge.wViewport width.hViewport height.scrollPointer to user-owned scroll offset (persists between frames).
function syn_imgui_scroll_end¶
End the scrollable region and draw scroll indicator.
Parameters:
ctxContext.
function syn_imgui_selectable¶
Full-width clickable row (like a borderless toggleable button).
bool syn_imgui_selectable (
SYN_IMGUI_Context * ctx,
const char * label,
bool * selected,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.labelDisplay text.selectedPointer to selection state (toggled on click).xBounds (0 = auto-layout).
Returns:
true if clicked this frame.
function syn_imgui_separator¶
Draw a horizontal separator line.
When inside a layout region, the line spans the full layout width and the cursor advances by 1 + style.spacing.
Parameters:
ctxContext.xX start (0 = use layout cursor).yY position (0 = use layout cursor).wWidth in pixels (0 = use layout width).
function syn_imgui_separator_text¶
Draw a labeled separator: ── Title ──────────
void syn_imgui_separator_text (
SYN_IMGUI_Context * ctx,
const char * text,
int16_t x,
int16_t y,
int16_t w
)
Parameters:
ctxContext.textSection title text.xX coordinate.yY coordinate.wTotal width.
function syn_imgui_set_style¶
Override the active style.
Parameters:
ctxContext.styleStyle to copy into the context.
function syn_imgui_slider¶
Draw and handle an integer value slider.
bool syn_imgui_slider (
SYN_IMGUI_Context * ctx,
const char * label,
int32_t * value,
int32_t min,
int32_t max,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
When clicked or touched, this widget goes into "edit mode". While in edit mode, encoder rotation or direct touch drags change the value.
Parameters:
ctxContext.labelSlider label.valuePointer to integer value.minMinimum allowed value.maxMaximum allowed value.xX coordinate.yY coordinate.wWidth.hHeight.
Returns:
true if the value was modified this frame.
function syn_imgui_spacing¶
Insert vertical spacing (moves the layout cursor down).
Parameters:
ctxContext.pixelsNumber of pixels to advance downward.
function syn_imgui_spinner¶
Integer numeric spinner widget.
bool syn_imgui_spinner (
SYN_IMGUI_Context * ctx,
const char * label,
int32_t * value,
int32_t min,
int32_t max,
int32_t step,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Renders Label [< value >]. When focused, encoder delta increments the value by step. Returns true on the frame the value changes.
Parameters:
ctxContext.labelDisplay label.valuePointer to the current value (modified in place).minMinimum value (clamped, wraps to max).maxMaximum value (clamped, wraps to min).stepIncrement / decrement amount per encoder tick.xX coordinate (0 = use layout cursor).yY coordinate (0 = use layout cursor).wWidth (0 = use layout width).hHeight (0 = font height + 2*padding).
Returns:
true if the value changed this frame.
function syn_imgui_status_bar¶
Draw a single-line status bar with a separator above it.
void syn_imgui_status_bar (
SYN_IMGUI_Context * ctx,
const char * text,
int16_t x,
int16_t y,
int16_t w
)
Parameters:
ctxIMGUI context.textStatus text to display.xX position.yY position.wWidth in pixels.
function syn_imgui_tabs¶
Horizontal tab selector.
bool syn_imgui_tabs (
SYN_IMGUI_Context * ctx,
const char ** labels,
size_t count,
int32_t * active,
int16_t x,
int16_t y,
int16_t w
)
Renders a row of labeled tabs. Consumes one navigation ID. When focused, encoder cycles through tabs.
Parameters:
ctxContext.labelsArray of tab label strings.countNumber of tabs.activePointer to active tab index.xPosition and total width.
Returns:
true if the active tab changed.
function syn_imgui_text_clipped¶
Draw text clipped to a bounding rectangle.
void syn_imgui_text_clipped (
SYN_IMGUI_Context * ctx,
const char * text,
int16_t x,
int16_t y,
int16_t clip_x,
int16_t clip_y,
int16_t clip_w,
int16_t clip_h
)
Uses the canvas clip rect to prevent text overflow.
Parameters:
ctxContext.textNull-terminated string.xText draw position.clip_xClipping rectangle.
function syn_imgui_text_marquee¶
Scrolling text label with pause at each end.
void syn_imgui_text_marquee (
SYN_IMGUI_Context * ctx,
const char * text,
int16_t * offset,
int16_t x,
int16_t y,
int16_t w,
int16_t speed
)
If the text fits within w, it's drawn statically. Otherwise it scrolls left, pauses, scrolls right, pauses, and repeats. The caller owns the scroll state (just declare static int16_t off = 0;).
Parameters:
ctxContext.textNull-terminated string.offsetPointer to caller-owned scroll offset (auto-advanced).xTop-left corner.wAvailable width (clips text beyond this).speedPixels per frame (1–2 typical).
function syn_imgui_text_wrapped¶
Render word-wrapped text within a width.
void syn_imgui_text_wrapped (
SYN_IMGUI_Context * ctx,
const char * text,
int16_t x,
int16_t y,
int16_t w
)
Parameters:
ctxContext.textNull-terminated string.xTop-left corner.wMaximum width (wraps at word boundaries).
function syn_imgui_toggle¶
ON/OFF toggle switch.
bool syn_imgui_toggle (
SYN_IMGUI_Context * ctx,
const char * label,
bool * state,
int16_t x,
int16_t y,
int16_t w,
int16_t h
)
Parameters:
ctxContext.labelLabel text.statePointer to boolean state.xBounds (0 = auto-layout).
Returns:
true if state was toggled this frame.
function syn_imgui_value_int¶
Draw a non-interactive "label: value" pair.
void syn_imgui_value_int (
SYN_IMGUI_Context * ctx,
const char * label,
int32_t value,
int16_t x,
int16_t y
)
Parameters:
ctxContext.labelKey text.valueInteger value.xPosition.
function syn_imgui_widget_visible¶
Check if a widget at (y, h) is visible in the scroll viewport.
Returns true if not in a scroll region or if any part is visible. Widgets that return false should still call next_id++ for focus.
Parameters:
ctxContext.yWidget top edge.hWidget height.
Returns:
true if any part of the widget is visible (or no scroll active).
Macro Definition Documentation¶
define SYN_IMGUI_MAX_ROW_COLS¶
Maximum number of columns in a layout_row call.
The documentation for this class was generated from the following file src/syntropic/ui/syn_imgui.h