|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
The showcase demonstrates RMGui's controls, layout engine, styling, skins, motion tracks, effects, and inline 3D meshes through three hosts built on the same core (showcase/):
The showcase's BUTTON / SHAPES view has rounded, elliptical, hexagonal and concave star BUTTON nodes. Its hit maps query the layout kernel; shape hits / rect hits switches their borrowed masks on and off without changing the painted silhouettes. Counters record completed clicks, while transparent corner presses and captured releases outside a shape do not activate. Disable shapes demonstrates disabled faces and input refusal.
BACKDROPS / TEXTURES pairs live zellige cell, grout and palette choices with shaped zellige and hatch swatches. Glass's premultiplied translucency shows the gradient beneath it. EFFECTS / RELIEF lights embossed/debossed hexagons and concave stars; BUTTON / RELIEF presents labelled Apply plates. Both relief views expose compass, relief and depth controls; Turn cycles all eight light directions. Tiles and panel stages are cached until their parameters or scale change; these topics are idle at rest. The CLI's PATTERNS receipt exposes the tile period, render counts and panel/plate pixel samples. Smaller sheets wrap the swatches and scroll.
The top bar groups pages by purpose, independently of their implementation:
Related demonstrations share page-local view controls:
| Page | Views, in selector order |
|---|---|
| BUTTON | STYLE, SHAPES, IMAGE, RELIEF |
| DRAW | BASICS, GRADIENTS, STROKES, SKIN FILLS, PATHS |
| TEXT | METRICS, DOCUMENT |
| EFFECTS | PARTICLES, RELIEF, TARGET |
| BACKDROPS | SCENES, TEXTURES |
Only the selected topic is mounted. Switching views releases its transient input and resources; resizing preserves the view, while entering another top-level page starts that page's default view. BUTTON retains its live Submit control in every view. Narrow sheets scroll topic content and reveal top-level pages through the strip arrows.
CLI --receipt lists global page indices. --click page-view:N selects the zero-based local view through the same input path as the browser and window: build/native/rmgui-showcase --page 0 --click page-view:1 --receipt.
ABOUT opens with a clickable guide to the laboratories, including INPUT, Image formats, Layout storage / damage, Style config, Accessibility and Motion tracks. DRAW > PATHS contains the curve handles, stroke and winding controls, conic gradients, independent rounded corners, borders and filtered image fills. MOTION and Motion tracks expose rounded shadow, glow and drag demonstrations.
Image formats displays caller-decoded SVG RGBA pixels by default. Its SVG vector on / off control (svg-target) enables direct geometry painting for CPU and RECORD targets; the native GPU refuses those path commands. SVG document, strict/permissive parsing, size and diagnostic controls remain available with direct vector painting off.
For a screenshot, --sheet writes raw RGBA8, not PPM; the suffix does not select a format. Match ImageMagick's dimensions to the device-pixel --size (double both dimensions for the same logical viewport at 200%):
Script --click, --drag, --press and --advance before --sheet to capture the resulting interaction state. Use --receipt to discover control hotspot names and --help for the complete CLI contract.
Modified character shortcuts use rmgui_showcase_character(codepoint, mods), not text insertion. CLI --key alt+f opens Controls' File menu without first focusing it; Alt+E and Alt+V select the other menus. Native window hosts and both browser presenters forward the same character-key events (Option is Alt on macOS). Named --key navigation and UTF-8 --text retain their separate contracts. Browser exports derive from the showcase header.
Desktop Environment is a desktop with draggable Volume, Notifications, Bug report and Settings windows. Its globe, volume, bell, bug and gear use the CPU mesh painter on the CPU host and the GPU mesh renderer on the GPU host; hover or keyboard focus animates the globe, bell, bug and gear. Choose a 48/56/64 px taskbar height. The globe is 1.5 times that height, protrudes above the band, and remains above overlapping windows; its circular hit area includes the protrusion. Other icons begin to its right. Taskbar icons raise, minimize or restore their windows; the globe reopens closed windows. Click the count inside Notifications to dismiss one; the −/+ controls adjust its 0–99 count. Static poses and icon bitmaps are cached while animation time and DPI scale remain unchanged.
Settings > INTERFACE pairs Colour scheme with Skin (none, bevel-classic, flat-hairline, pixel-retro, experience, lion); the scripted host also accepts --skin NAME. Skins supply structurally distinct neutral, scheme-tinted artwork; Experience's close/progress identities and Lion's traffic-light captions retain their semantic colours, except that the captions of an INACTIVE window are Lion's plain light gray (the DISABLED face; hover and press still shade it). Changing a scheme retains the skin; changing a skin retains edited colours and layout metrics. RESET restores the loaded style with skin none. Every Settings tab lists its rows in titled sections painted by rmgui_section_paint: a schema tab groups Metrics, Colours and Motion, each a two-column grid whose label column fits its widest name, and section titles follow window.title-alignment. Each section face carries a faint one-ink rmgui_pattern_zellige over its whole background, its title painted over it by rmgui_section_paint_title. A backdrop over a box belongs to the box's background, not its content box: rmgui_paint_box_ground gives that background as a nine-slice shape (up to the border on every side, inside rounded corners, clear of the border art) and rmgui_backdrop_tile_nine lays a tile through it. SCROLLBAR's grip-length, grip-gap and grip rows are disabled while grip-count is 0. On WINDOW and Desktop Environment, the LEGACY arrangement follows an Experience or Lion skin's caption arrangement; an explicit non-LEGACY demo selector overrides that pairing without changing the exported layout declaration. Export includes skin declarations; importing built-in sheet names regenerates and binds their artwork. Other sheet names remain declared but unbound until their owner registers them.
Skin KDL also accepts tint ramp LOW_ROLE HIGH_ROLE. Black artwork samples select the low scheme role and white samples select the high role; intermediate source luminance interpolates straight RGBA, then multiplies source alpha. In C, RMGUI_SKIN_TINT_ROLE_RAMP stores the low role in tint.r and the high role in tint_role, with tint.g = tint.b = 0 and tint.a = 255. This adds no fields to rmgui_skin_t; existing tint kinds retain their multiply behavior.
tint bevel EDGE_A FACE EDGE_B adds a face stop at source luminance 128. The two edge roles are ordered by active-scheme luminance, so white artwork always selects the lighter edge even when a light scheme reverses TEXT and BACKGROUND. In C, use RMGUI_SKIN_TINT_ROLE_BEVEL, tint.r = EDGE_A, tint.g = EDGE_B, tint_role = FACE, tint.b = 0, tint.a = 255.
Three kinds of host drive the same showcase core (showcase/):
make check-window runs the X11 window under Xvfb (display :57) against the scripted host: pixels of every page, input, clipboard, idle CPU, animation timing, resize and the file dialogs through stub tools. It needs /usr/bin/Xvfb and runs locally only, not in CI.