Commit Graph

22 Commits

Author SHA1 Message Date
Elias Naur 20f55a4ad7 all: delete the ui.Op type
It's no longer used.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-27 22:27:50 +02:00
Elias Naur 56133632c6 ui/layout: rename simple.go to layout.go
A more appropriate name.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-27 22:24:20 +02:00
Elias Naur 252e058766 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>
2019-04-27 22:19:34 +02:00
Elias Naur 7b6e1ce35a ui/pointer: simplify hit testing
Serialize the implied tree of layers and handlers into a list
that can be traversed from the end to collect handlers.

This change will make it easier to switch op representation in
a follow-up change.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-26 19:26:59 +02:00
Elias Naur a8bb3c2f14 all: make pointer.Area an interface
With an interface instead of anonymous functions, amending an
area's parameters can be done even after adding it to an OpHandler.

This will be useful when we switch to serialized op lists.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-25 10:02:14 +02:00
Elias Naur 3ad94ed20e ui/app: don't draw when not animating (Wayland)
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-25 10:02:14 +02:00
Elias Naur e0d586893d ui/app/internal/gpu: flush before drawing
And delete an unnecessary error check from Flush to make sure pending
draws are always finalized.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-25 10:01:58 +02:00
Elias Naur 8b47e2b4bf ui/app: don't use wl_touch interface v6
It's not tested, we don't need v6 capabilities and using them result
in build errors on older wayland clients:

https://www.reddit.com/r/golang/comments/b7rujg/gio_by_elias_naur_et_al_portable_immediate_mode/ejv804z/

Finally, since we request v5 of the parent wl_seat, the wl_touch instances
returned to us is capped at v5 anyway.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-17 12:42:18 +02:00
Elias Naur b15ec53a03 ui/app: fix display link on iOS 10
For some reason, the CADisplayLink.paused property didn't work on
iOS 10 but does on iOS 12. Use addToRunLoop and removeFromRunLoop
instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-03 13:13:53 +02:00
Elias Naur 1096ac1938 apps/gophers: update commits page config every frame
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 21:46:41 +02:00
Elias Naur fc55c6ee5c ui/app: implement Command for system events
And add CommandBack for the Android back button.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 21:04:48 +02:00
Elias Naur ed2590e30e ui/app,apps/gophers,apps/hello: revert NewWindow to CreateWindow
It turns out we already support multiple windows on Android: when
the activity is recreated.

This reverts commit f21b5eb1df.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 19:54:37 +02:00
Elias Naur e7725a4fa1 apps,ui/app: delete ui/app.Window.Ack
Replace it with a dummy event send on the synchronous event channel;
a bit of cleverness for a simpler API.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 18:51:43 +02:00
Elias Naur abb9d291e9 ui/app: don't buffer the app event channel
We used to buffer input events to allow for batch processing
multiple events before redrawing. Now that redraws are scheduled to
run after the native event queue is empty, buffering is no longer
necessary.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 17:22:58 +02:00
Elias Naur 48b6a73753 all: run goimports
gioui.org/ui was renamed from gioui.org/ui/ui before the release,
but the import order wasn't changed accordingly.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 17:09:06 +02:00
Elias Naur 0c6f874379 ui/app: request unbuffered touch events on Android
Flutter and Chromium wants it, so I assume its good for us.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-01 17:35:12 +02:00
Egon Elbre f863260514 app: replace COREVIDEO_TRUE with kCVReturnSuccess
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-01 12:03:32 +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
Elias Naur 1d67fad0c3 ui/app,apps/gophers,apps/hello: accept nil WindowOptions in NewWindow
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 13:59:06 +02:00
Elias Naur f21b5eb1df ui/app,apps/gophers,apps/hello: replace CreateWindow with NewWindow
Gio doesn't support multiple windows anyway, so get rid of the
app.Windows channel and use NewWindow call for the mobile platforms
as well.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 13:52:14 +02:00
Elias Naur ca5204fcb8 ui: fix macOS build
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 11:00:26 +02:00
Elias Naur 0f05231c35 all: initial import
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 10:47:22 +02:00