Commit Graph

6 Commits

Author SHA1 Message Date
Elias Naur 22cd88df9f all: rename the gioui.org/ui module to gioui.org
The "ui" is redundant and stutters.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-30 12:37:06 +02:00
Elias Naur dc6fedc163 ui: change Queue to return all events at once
The Queue interface was changed from

	type Queue interface {
		Events(k Key) []Event
	}

to the more complex single-step protocol

	type Queue interface {
		Next(k Key) (Event, bool)
	}

to cater for a particular use case: Editor's SubmitEvent. When a
SubmitEvent is passed to a caller of Editor.Next, the Editor state,
in particular the current text, must not have changed by edits
later in the command stream. For example, pressing the keys <E>,
<Enter>, <E> should result in a SubmitEvent where the Editor has
a single 'e' in Text(), not two.

However, there is no reason to push the more complex Queue to every user.
Rather, store remaining input events inside Editor and process them as
Editor.Event (or Layout) is called.

Finally, revert the Queue interface to the simpler Events method.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-26 18:41:03 +02:00
Elias Naur 3944ef4b2e ui: merge package input
Event handling is as fundamental as operations, so move the input
package declarations to package ui.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-24 22:24:10 +02:00
Elias Naur 9cc6757da9 ui/pointer: expand documentation
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-11 16:46:03 +02:00
Elias Naur a2baffdbfd ui: expand package documentation
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-09 20:35:04 +02:00
Elias Naur 8b2f6dbf13 ui: add doc.go
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 14:45:26 +02:00