aboutsummaryrefslogtreecommitdiffstats
path: root/src/jsonval.h
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-19 13:46:57 +0200
committeruser <user@clank>2026-08-19 13:46:57 +0200
commit42b3c10995eb67778d9dd3aa2fd80624896acd5f (patch)
tree751bcb8604967dc8687cf23fbeb1033aa26ca427 /src/jsonval.h
parentslosh: a website that is a page, not a mock session (diff)
downloadslosh-42b3c10995eb67778d9dd3aa2fd80624896acd5f.tar.gz
slosh-42b3c10995eb67778d9dd3aa2fd80624896acd5f.tar.xz
slosh-42b3c10995eb67778d9dd3aa2fd80624896acd5f.zip
slosh: defaults most people can live in, said by shaders
The out-of-the-box look, rethought as one piece: - the compiled-in palette calms down: muted blue #7aa2f7 on the same neutral darks, with the colours that mean something kept semantic -- amber bell, red-orange dead. sl0p stays one include away as the house style, and contrib/themes/default.kdl is the starting point written down (theme-tour shows it). - derived state defaults now actually follow the theme: the scrolled wash is rebuilt from scroll_bg after the theme block (it used to bake the compiled accent), and declaring a state -- in any file of an include chain -- still wins. The dump writes derived states as comments so C-a e cannot pin what is meant to keep following. - a bell you can see: the frame blinks three times in theme's bell colour then breathes until answered, and a soft diagonal shimmer -- the bell colour halved towards default_fg, width breathing on a sine -- crosses the body for the same 900ms. bell_indicator false silences all of it; states { bell { } } replaces it like any state. since carries the clock dependency, so an idle session pays nothing. - scrollback says where it continues: while scrolled, the viewport's top and bottom rows melt towards an edge with content past it and turn solid at the buffer's end. New expression variables above/below (lines hidden past each edge, own dependency bit, cached per scroll position), carried in shade_ctx_t -- SLOSH_SHADER_ABI 3 -> 4. - expressions survive the dump: a program keeps its source and cb_chain writes it back, so amount="(y % 2) * 40" no longer dumps as a number. - headers move to include/, -Iinclude everywhere; the plugin Makefile's SLOSH var becomes SLOSH_DIR because slosh exports SLOSH=1 into every pane it runs, and building from inside a session read that as a path. - comment drift culled where features outran the prose, and the derivation boilerplate folded into derived_pass()/ctx_scroll().
Diffstat (limited to 'src/jsonval.h')
-rw-r--r--src/jsonval.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/jsonval.h b/src/jsonval.h
deleted file mode 100644
index 1eedb4c..0000000
--- a/src/jsonval.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* A small JSON reader, for the control API (D3). We already emit JSON; this
- * is the other half. Deliberately minimal: no streaming, no comments, no
- * duplicate-key policy beyond "last wins". */
-#ifndef SLOSH_JSONVAL_H
-#define SLOSH_JSONVAL_H
-
-#include <stdbool.h>
-#include <stddef.h>
-
-typedef enum {
- JV_NULL,
- JV_BOOL,
- JV_NUM,
- JV_STR,
- JV_ARR,
- JV_OBJ,
-} jv_kind_t;
-
-typedef struct jv jv_t;
-
-struct jv {
- jv_kind_t kind;
- bool b;
- double num;
- char *str; /* JV_STR: NUL-terminated, UTF-8 */
- size_t len; /* JV_STR bytes; JV_ARR/JV_OBJ element count */
- jv_t **kids; /* JV_ARR/JV_OBJ values */
- char **keys; /* JV_OBJ keys */
-};
-
-/* NULL on malformed input. */
-jv_t *jv_parse(const char *text);
-void jv_free(jv_t *v);
-
-const jv_t *jv_get(const jv_t *obj, const char *key);
-const char *jv_str(const jv_t *v, const char *fallback);
-long jv_int(const jv_t *v, long fallback);
-bool jv_bool(const jv_t *v, bool fallback);
-
-/* Convenience: obj.key as a string/int/bool, with a fallback. */
-const char *jv_gets(const jv_t *obj, const char *key, const char *fallback);
-long jv_geti(const jv_t *obj, const char *key, long fallback);
-bool jv_getb(const jv_t *obj, const char *key, bool fallback);
-
-#endif /* SLOSH_JSONVAL_H */