24#ifndef ENGINE_SLOTS_MAX
25#ifdef ENGINE_MAX_SLOTS
26#define ENGINE_SLOTS_MAX ENGINE_MAX_SLOTS
28#define ENGINE_SLOTS_MAX 10
33#ifndef ENGINE_MAX_SLOTS
34#define ENGINE_MAX_SLOTS ENGINE_SLOTS_MAX
39#if ENGINE_MAX_SLOTS != ENGINE_SLOTS_MAX
40#error "ENGINE_SLOTS_MAX and the old ENGINE_MAX_SLOTS are set to different values"
46#if ENGINE_SLOTS_MAX < 1 || ENGINE_SLOTS_MAX > 254
47#error "ENGINE_SLOTS_MAX, or the old ENGINE_MAX_SLOTS, has to be 1 to 254"
58 void (*
draw)(GContext *ctx, GRect bounds,
const void *
data);
62 void (*
text)(
char *out,
size_t n);
void engine_deinit(void)
Tear down the slot layers.
Definition engine.c:106
void engine_init(Window *window, EngineBuild build_cb)
Build the slot layers for a face and paint them once.
Definition engine.c:99
void engine_rebuild(void)
Rebuild the slot layers (after a layout or theme change).
Definition engine.c:111
void engine_mark_dirty_tags(uint32_t changed)
Repaint only the slots whose tags intersect changed (plus any slot with no tags). Lets a face route a...
Definition engine.c:154
void engine_mark_dirty(void)
Repaint every slot: text-slots re-pull + fit, draw-slots mark dirty.
Definition engine.c:148
uint8_t(*) EngineBuild(EngineSlot *out, uint8_t max, GRect bounds)
Fills the caller's slots and returns the count. A static face returns a fixed list....
Definition engine.h:78
One slot of a face. Set zone (+ text) for a text-slot, or frame (+ draw) for a draw-slot....
Definition engine.h:56
GRect frame
Draw slot layer frame.
Definition engine.h:57
void(*) draw(GContext *ctx, GRect bounds, const void *data)
Draw slot paint.
Definition engine.h:58
const void * data
Draw slot data.
Definition engine.h:59
uint32_t tags
Which stores this slot reads from, for engine_mark_dirty_tags (0 means repaint on any change).
Definition engine.h:64
const Zone * zone
Text slot area and font tiers.
Definition engine.h:61
void(*) text(char *out, size_t n)
Text slot, pulls and formats from a store.
Definition engine.h:62
Everything needed to present one text slot. Where it sits, and which registered font,...
Definition zone.h:26
Layout primitives. Defines paintable areas and their text alignments.