Commit Graph

19 Commits

Author SHA1 Message Date
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 8700a8ffc3 ui/key,ui/pointer: rename HandlerOp to InputOp
"Input" is more specific and reads better than "handler".

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-26 18:07:48 +01:00
Elias Naur 340fff9814 ui/key: rename ChordEvent to just Event
Event is like pointer.Event and we don't want the stuttering of
key.KeyEvent.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-11 12:50:40 +02:00
Elias Naur 6e26c92c75 all: remove exported Decode methods on operations
Add decode functions to the packages that need them instead. For
TransformOp that is used in multiple packages, add the decode
function to the internal ops package.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-07 17:21:34 +02:00
Elias Naur b3517a365e ui,internal/ops,internal/opconst: move OpsReader to internal ops package
To avoid import cycles, move the op constants to its own package,
internal/opconst.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-07 17:21:26 +02:00
Elias Naur fe20cde393 ui: rename TransformOp.Mul to Multiply and split InvTransform
Multiply is a bit longer but more clear. InvTransform was really
two operations: Invert and Transform.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-07 14:47:14 +02:00
Elias Naur 73b1e64209 ui/input: change Queue to return Events one at a time
By returning all events, widgets that might return early from its
event loop might throw away subsequent events. Instead of requiring
those widgets to store the event list, convert input.Queue to step
through the available events one at a time.

Functional revert of 1735d5ced8.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-01 18:56:49 +02:00
Elias Naur bfece0beba ui: change area ops to use rectangles, not sizes
And then use the more general rectangles to add a buffer around
text.Editor click and scroll area.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-01 10:06:19 +02:00
Elias Naur 5e1f078b12 ui: merge Transform into TransformOp
The separate Transform type is not worth its weight.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-29 02:50:55 -07:00
Elias Naur 9e0e4af8c6 ui/app,ui/key: move TextInputState from key to internal package
Clients have no need for the TextInputState type.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-21 13:12:24 +02:00
Elias Naur 3f7735ccdf ui/app/internal/input: redraw if focus events was added
The key queue might generate focus events. Schedule a redraw if so.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-21 12:50:53 +02:00
Elias Naur c94315119b ui/app/internal/input: only drop handlers completely when inactive
Delete a redundant loop; dropHandlers already does the required work.

Fixes pointer event issues found after pointer events with no side
effects no longer trigger redraws.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-18 21:06:06 +02:00
Elias Naur d9d8df989d ui/app: rename Window.Redraw to Invalidate to match ui.InvalidateOp
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-18 18:45:46 +02:00
Elias Naur 46cee54dd6 io/app/internal/input: go fmt
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-12 20:47:29 +02:00
Elias Naur 2296393471 ui/system: move package ui/input/system
Just like the pointer and key packages.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-12 15:54:41 +02:00
Elias Naur 86533ae683 ui/input/system: introduce package for system events
And add ProfileOp and ProfileEvent for registering and receiving
profile data.

Remove the Profiling field and Timings method from app.Window.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-12 15:31:29 +02:00
Elias Naur 032e9a380e ui/app,ui/internal/input: move InvalidateOp summary to Router
In preparation for extracting more op types in Router.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-12 15:11:20 +02:00
Elias Naur ba18817400 ui/app/internal/input: add tracking up updates to handlerEvents
In preparation for only redrawing when new events are available.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-12 14:34:24 +02:00
Elias Naur cbdda4e9c5 ui/input: move Router and input queues to internal package
Now that only app.Window needs the Router, make it unavailable for
clients.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-12 13:51:00 +02:00