diff options
| author | eunhhu <[email protected]> | 2026-09-26 10:54:12 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-26 10:54:12 +0100 |
| commit | b230b70252f09cf3425a8b4b959b3dfd72075b31 (patch) | |
| tree | 6ddae95ead87fa1905e133dbabf0f2d6a595efde /prototypes/connections/module.h | |
| parent | d58e1d29cc3cbd5f1c9b271c0b7e25b9962fad4f (diff) | |
| download | pure-b230b70252f09cf3425a8b4b959b3dfd72075b31.tar.gz pure-b230b70252f09cf3425a8b4b959b3dfd72075b31.zip | |
Let a host point an index at an item
pure_app_point moves an index state to an item, as a user pointing at a
row would: an event with no handler, saved like a key event, joining the
burst when saving is deferred; past the last item it is not_found. A host
learns which index to move from the view that shows it:
pure_module_position gives the state behind a number view that is just
`at.position`. An interface can so turn a click on a list row into its
focus without any code in the app.
Diffstat (limited to 'prototypes/connections/module.h')
| -rw-r--r-- | prototypes/connections/module.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/prototypes/connections/module.h b/prototypes/connections/module.h index c9fb606..16b755c 100644 --- a/prototypes/connections/module.h +++ b/prototypes/connections/module.h @@ -106,6 +106,9 @@ int pure_module_state(const PureModule *, const char *name); int pure_module_input(const PureModule *, const char *name); int pure_module_view(const PureModule *, const char *name); int pure_module_column(const PureModule *, uint32_t table, const char *name); +/* The index state a number view shows as its position (a view that is just + * `at.position`), or -1: what a host moves with pure_app_point. */ +int pure_module_position(const PureModule *, uint32_t view); /* Keyed collections live in a data host (for example the tree store). One * event opens at most one document, the message's key, at its current @@ -189,6 +192,10 @@ bool pure_app_defer(PureApp *, bool deferred); void pure_app_stop(PureApp *); PureResult pure_app_frame(PureApp *); PureResult pure_app_input(PureApp *, uint32_t input, PureEdge); +/* Point an index state at the item at position (0 first), as a user pointing + * at a row: an event with no handler, saved like a key event. NOT_FOUND past + * the last item, INVALID for a state that is not an index. */ +PureResult pure_app_point(PureApp *, uint32_t state, size_t position); /* Deliver committed text (for example from an input method). Not UTF-8: invalid. */ PureResult pure_app_text(PureApp *, uint32_t input, PureSpan text); /* Deliver a message. base is the revision the sender edited, or -1 for none; |
