Structure. Onlay and simple.css become submodules; the vendored copy of Onlay
under onlay/ goes. The samples split into samples/showcase, samples/notepad and
samples/simple, sharing runtime/ and core/ through a reaktor_runtime static
library, and sample.h grows a window spec so an application says how big it
wants to be instead of inheriting the showcase's 1100x680. branding/ moves into
assets/icons and assets/rest.
Prose. Every comment is gone from the tree's own sources, and put back only
where a reader would otherwise be misled: the one-frame lag, the settling
bound, the Nuklear behaviours, the menu row spacing MENU_H counts on. About
4,850 lines of narration removed. third_party/ is untouched, and the vendored
nk_sdl3_renderer.h keeps its licence header and its REAKTOR markers, which are
the only record of how it differs from upstream.
Six bugs found on the way, each verified against the running application
rather than against a reading of the source:
* REAKTOR_SCALE never worked. The panel was laid out from SDL_GetWindowSize,
which is already divided on a real HiDPI display but not under a forced
scale; and draw.c set the font's logical height before nk_sdl_font_stash_end,
which bakes and puts the device height back. At 2x every label measured and
drew twice its size and the tab strip fell off the window.
* rss_mark() wrote runtime/app.c's copy of g_rss and the Diagnostics page read
core/ui/widgets.c's, because both were statics in a header included by ten
translation units. Every row of "What startup costs" reported 0.0 MB.
* The WASM preload and the macOS bundle work out which icons to ship by
grepping the sources, and both were still looking where the sources used to
be. They shipped 3 of 43 glyphs.
* The Styling page's progress bar shared a value with the Inputs page's but
never got .modifiable, so it alone ignored the pointer.
* REAKTOR_STATS wrote build/stats.log relative to the process's cwd - the one
path in the tree that skipped reaktor_path().
* UIA re-announced the same focused element on every frame the diff was
non-empty; the AT-SPI and web bridges already guarded it.
Simplification. No unused variable, unreachable branch or uncalled static
survives /W4 across our sources. Eleven copies of the box-default rule collapse
into box_default/row_height; the menu chrome, row height and item become
reaktor_menu_* so the two samples cannot drift apart again; twenty hand-inlined
token lookups become reaktor_token; three private copies of read-whole-file
become reaktor_read_file. reaktor_path resolves the asset root once instead of
walking the tree on every call, the notepad stops re-hashing its document every
frame, and Diagnostics samples process memory twice a second instead of per
frame - it was inflating the timings it prints.
The accessibility dump is unchanged through all of it except where a change was
intended, which is what made the whole pass reviewable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
19 lines
524 B
C
19 lines
524 B
C
#ifndef REAKTOR_CSSFLAT_H
|
|
#define REAKTOR_CSSFLAT_H
|
|
|
|
#include <stddef.h>
|
|
|
|
typedef struct reaktor_cssvars reaktor_cssvars;
|
|
|
|
char *reaktor_css_flatten(const char *const *paths, int count,
|
|
const char *theme, reaktor_cssvars **out_vars);
|
|
|
|
const char *reaktor_cssvars_get(const reaktor_cssvars *vars, const char *name);
|
|
|
|
int reaktor_cssvars_color(const reaktor_cssvars *vars, const char *name,
|
|
unsigned char rgba[4]);
|
|
|
|
void reaktor_cssvars_free(reaktor_cssvars *vars);
|
|
|
|
#endif
|