~eliasnaur/gio

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/input: support single stepping through events

Change input.Events interface to return one event at a time until
the queue is empty.

Change text.Editor and gestures to match.

Re-add Editor.Submit while we're here; we don't want to enable
submit mode always.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
cmd/gophers,cmd/hello: update to latest API

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/layout: unexport List.Update and move its parameters to state

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/text: replace Editor.Update with Next for stepping through events

Before this change, the Editor cleared its content after each
Submission event. If it didn't multiple submits for a frame would
not result in the cleared text for clients that wants to clear the
Editor between submits.

However, for clients that do not want to clear the content or that
wants to validate the text before accepting it were not supported.

Instead, switch to a event stepping model, where the client can
call Next to receive each EditorEvent (that is, Submit event) in
turn.

We can then delete the Submit flag on Editor and always report Submit
events.

We can also make Layout flush the pending events now that Editor
always has access to its Config and input queue.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/text: move input.Events parameter from Update to Editor state

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/text: move Config parameter from Editor.Update to Editor state

Assume the user will set a Config pointer once at init.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/measure: rename Faces.Cfg to Config

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: make Draw.Config a value, not a pointer

We are going to encourage a model where pointers to a central
(program global) Configs are passed to widgets at setup time, and
not pass Configs at every frame.

That way, the global Gonfig can change, but the pointers won't need
updating.

This change only switches the Draw event's Config pointer to a value
to avoid tempting programs to use the event Config instead of
updating their own central Configs.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: update comment and fix typo

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (ios) relay system focus events

Signed-off-by: Elias Naur <mail@eliasnaur.com>
uis/app: (macos) relay system focus events

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (android) relay system focus events

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (js) relay system focus events

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (windows) relay system focus events

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (wayland) relay system focus events

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/layout: implement List.Invert for end aligned lists

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (wayland) avoid excessive key repeats

Wayland requires its clients to handle key repeating themselves.
Our strategy is simple: start a timer on key down and fire key
events at regular intervals until another key event arrives.

However, if the program blocks the event loop while processing a
synchronous event, key repeats might pile up before the stopping
key event is processed.

This change use the timestamp of the stopping key event to only
dispatch the repeats queued up before the stop time.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/gophers: update to latest gio version and use Modifiers.Contain

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/text: add submit events to Editor

Add Editor.Text() and fix a reset while here.

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