Skip to content

API index

The authoritative symbol list for application code is src/flashbang.odin in the FlashBang library repo. The flashbang package aggregates re-exports so callers import one package.

Below is a topic map aligned with the sections in that file. Names match the exported identifiers (PascalCase aliases point at widgets / style / rendering definitions).

Types and drawing

  • Core / drawing: NodeId, DrawList, draw_list_init, draw_list_deinit, draw_list_clear
  • Backends / errors: PlatformBackend, ErrorCode
  • Style surface: Color, Theme, WidgetVisualState, ResolvedSurface, default_theme, basic_theme, resolve_surface, apply_color_override
  • Theme hooks (types): SurfaceGeometryProc, WindowChromeProc, WindowDecoration, WindowChromeButton
  • Emit helpers: emit_surface, emit_separator

Immediate context

  • ImmediateContext, set_immediate_context, get_imm_ctx
  • Backends: set_platform_backend, set_layout_backend, set_image_backend
  • Theme stack: set_theme, push_theme, pop_theme, active_theme
  • Input: push_text_input, push_key_event, push_scroll_event, set_shift_held, set_middle_mouse, set_click_count, set_focus
  • Z order: push_z_layer, pop_z_layer, get_z_layer

Layout integration

  • Measurement: MeasureSize, measure_text, measure_label, measure_checkbox, measure_icon
  • run_layout_backend
  • Contract types: LayoutRect, LayoutContext, LayoutTextMeasureRequest, LayoutCheckboxMeasureRequest, make_layout_context, layout_measure_text, layout_measure_checkbox
  • IM cache: layout_get_rect, layout_emit_rect_to_cache

Dimensions and IDs

  • GetWidth, GetHeight, GetContentWidth, GetContentHeight
  • WidgetDims, LookupWidgetDims, hash_id

Widgets (immediate mode)

Button, ButtonTextured, Label, Checkbox, ToggleButton, RadioButton, Separator, Panel / EndPanel, Slider, ProgressBar, TextBox, TabBar, ListView, AppWindow / EndAppWindow, plus tooltip, group box, status bar, spinner, scrollbar, dropdown, tree, menu, dialog, split pane, table, color swatch/wheel, file browser, image, icon, stack/overlay/scroll view, text area, password box, numeric input, toast, popup, property editor, docking container, focus shelf — each paired *Config / *State types as exported in flashbang.odin.

How to read a widget

  1. Find the Foo proc and FooConfig / FooState in flashbang.odin.
  2. Open src/widgets/<file>.odin for behavior, comments, and edge cases.
  3. For drawing/theming, trace calls to resolve_surface, emit_surface, and theme hooks.