Loading...
Searching...
No Matches
engine.h File Reference

The skin-neutral slot engine: builds one layer per slot from a face's slot list and repaints them all when a store changes. A slot is either a text-slot (a TextLayer built from a Zone, so the font-fit tiers still apply) or a draw-slot (a custom layer whose update_proc paints a gauge, icon, or panel). A face supplies a build callback. A dynamic face (the grid) re-runs it on a layout change. This is the shared core a face's own engine sits on. More...

#include <pebble.h>
#include "ui/zone.h"

Go to the source code of this file.

Data Structures

struct  EngineSlot
 One slot of a face. Set zone (+ text) for a text-slot, or frame (+ draw) for a draw-slot. Never both. A text-slot with no text stays empty, and so does a draw-slot with no draw. More...

Macros

#define ENGINE_SLOTS_MAX   10
#define ENGINE_MAX_SLOTS   ENGINE_SLOTS_MAX
 The old name for ENGINE_SLOTS_MAX, deprecated. A face that sets it or reads it gets the same cap.

Typedefs

typedef 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. A dynamic face works it out from settings.

Functions

void engine_init (Window *window, EngineBuild build)
 Build the slot layers for a face and paint them once.
void engine_deinit (void)
 Tear down the slot layers.
void engine_rebuild (void)
 Rebuild the slot layers (after a layout or theme change).
void engine_mark_dirty (void)
 Repaint every slot: text-slots re-pull + fit, draw-slots mark dirty.
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 store change to just the slots that read from it.

Detailed Description

The skin-neutral slot engine: builds one layer per slot from a face's slot list and repaints them all when a store changes. A slot is either a text-slot (a TextLayer built from a Zone, so the font-fit tiers still apply) or a draw-slot (a custom layer whose update_proc paints a gauge, icon, or panel). A face supplies a build callback. A dynamic face (the grid) re-runs it on a layout change. This is the shared core a face's own engine sits on.