~eliasnaur/gio

ref: 7aa7bb3be40858efe2a98f866fcc7db2026b02fd gio/ui/input/key.go -rw-r--r-- 2.5 KiB
ui: rename ops to have Op suffixed, not prefixed

Match Go's FooError name pattern.

While we're here, rename RedrawOp to InvalidateOp.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: add package input for merged input

To avoid passing a queue type for each kind of input (pointer, key),
introduce package input for mapping a handler key to all input events.

Future input sources can be added without changes to programs, and
as an added bonus, event ordering is preserved across input sources.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/key: make the computed text input state available as a method

When merging the key and pointers input sources, we can't return
the text input state as a side effect of the Frame method.

Expose it as a method in the key event queue instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/key: don't drop handlers that haven't had their events read

Similar to the previous change for pointers, only determine the
activeness of a handler from its presence in the ops list.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: build paths as ops

Instead of allocating and constructing a clip path, store path data
directly in op lists. Use separate op lists for cached text layout
paths.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: let OpsReader keep track of references

Instead of exposing the entire reference slice, return the relevant
references from Next.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: move ops reader to ui package

To prepare support for cached OpBlock to refer to other Ops lists.

The exposure of OpsReader is alleviated by the removal of the Refs
and Data accessors for Ops.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: serialize ops

Pros:
- Much less per-frame garbage
- Allow future preprocessing of ops while building it
- Much fewer interface calls and pointer chasing
- Allow future serialization of ops for remote rendering

Cons:
- Slightly clumsier API

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: initial import

Signed-off-by: Elias Naur <mail@eliasnaur.com>