patternscomposite
Composite Pattern pattern for C development
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
Composite Pattern
Compose objects into tree structures. Individual objects and compositions treated uniformly through common interface.
ikigai Application
Layer system: Layers (scrollback, separator, input, spinner) compose into layer stack. Each implements same render interface:
typedef struct {
void (*render)(void *layer, ik_render_ctx_t *render);
void (*resize)(void *layer, int width, int height);
} ik_layer_vtable_t;
Rendering: REPL iterates layers, calls render on each. Doesn't care if layer is simple or composite.
Future uses:
- Nested UI components
- Tool result trees
- Message threading/nesting
Benefit: Add new layer types without changing render loop.
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!