Commit Graph

209 Commits

Author SHA1 Message Date
Elias Naur f5985b5e7d cmd,example: bump gio version
Add os.Exit to examples now that app.Main never returns.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-26 16:30:34 +02:00
Elias Naur facf5cbb9d cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-26 16:16:15 +02:00
Elias Naur acc0424dd7 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-26 15:57:54 +02:00
Elias Naur d97f7f9093 app/internal/window,cmd/gogio: [iOS] export GioViewController
The Gio GioAppDelegate created the GioViewController programmatically.
When using gogio's -buildmode=archive users may want to use a different
method (for example storyboards) but there can only be one app delegate.

Move the GioAppDelegate to gogio's exe buildmode, and export the
GioViewController for embedding use.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-26 15:47:00 +02:00
Elias Naur 5bd0ecea5e cmd/gogio: add -tags flag for supplying extra tags to the build
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-22 20:57:35 +02:00
Elias Naur 342c0da320 cmd/gogio: add ldflags flag for extra flags
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-22 20:50:28 +02:00
Elias Naur 2f984673a2 cmd/gogio: [Android] use correct android.hardware.type.pc feature
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-22 20:49:49 +02:00
Greg Pomerantz 3a542cc80c cmd/gogio: [Android] check $ANDROID_NDK_ROOT
If the Android NDK is not found in a standard location (e.g. you are
on an F-Droid build server), check the $ANDROID_NDK_ROOT environment
variable.

Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
2020-06-22 18:26:32 +02:00
Gordon Klaus 20cf570709 example/kitchen: add Float/Slider
Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
2020-06-22 12:19:07 +02:00
Elias Naur 817e0fa9c3 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-21 22:43:46 +02:00
Viktor 1a9ae1af69 example/kitchen: include example of affine transforms
Include an example of transforming the entire UI in the example.

Signed-off-by: Viktor <viktor.ogeman@gmail.com>
2020-06-21 11:38:27 +02:00
Elias Naur e2f3bbdfc3 cmd/gogio: [Android] disable ChromeOS input emulation
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-19 20:07:44 +02:00
Egon Elbre 7c98e679ef example,cmd: bump gio version
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
2020-06-19 14:15:55 +02:00
Elias Naur c35d81e828 cmd/gogio: mention that Android builds include jar class files
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-19 11:17:24 +02:00
Elias Naur dd225d5d07 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-17 12:08:08 +02:00
Elias Naur 1eedd19231 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-15 18:16:35 +02:00
Elias Naur d045f492b4 cmd/gogio: [Android] mark GioActivity ready for multi-window configuration changes
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-13 17:47:50 +02:00
Elias Naur 8a5f3f3dd5 cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-13 11:49:55 +02:00
Elias Naur bb8bb504d8 cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-10 11:29:23 +02:00
Elias Naur b1df2a61a9 cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-09 23:24:12 +02:00
Elias Naur 81a84d874b example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-09 23:03:36 +02:00
Elias Naur 566132b4f5 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-09 22:32:24 +02:00
Elias Naur 1ace1392d6 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-08 17:55:40 +02:00
Elias Naur 06f6f54b2d example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-08 16:35:35 +02:00
Chris Waldon bda315e687 example/kitchen: add a button that is {dis,en}abled by the switch
This adds a simple button that defaults to being disabled, but can
be enabled by toggling the state of the existing Switch widget.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
2020-06-08 10:19:31 +02:00
Elias Naur 352856fc24 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-07 16:33:39 +02:00
Elias Naur 78565c9232 cmd,example: bump gio version
Updates gio#128

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-07 08:44:41 +02:00
Elias Naur 0749afc13c example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-06 19:31:12 +02:00
Elias Naur a4e572d0e3 cmd,example: gump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-05 10:57:08 +02:00
Gordon Klaus 9d2a6c48d8 io/pointer: add InputOp.Types to specify which types of events to receive
Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
2020-06-03 15:29:12 +02:00
Elias Naur fc290f3457 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-02 15:49:16 +02:00
Elias Naur 9196ce0369 cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-02 12:20:20 +02:00
Elias Naur eafe09967f cmd,example: bump gio
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-06-01 00:05:45 +02:00
Elias Naur 2487842aae cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-31 12:00:10 +02:00
Elias Naur e9500f5f4c cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-30 14:44:02 +02:00
Elias Naur 6a0da04598 cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-27 16:41:26 +02:00
Elias Naur 7b6eafcb59 cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-27 16:17:22 +02:00
Elias Naur 3164a3fee7 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-24 13:24:13 +02:00
Elias Naur d8000880c3 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-23 23:14:46 +02:00
Elias Naur 60bed57cd7 cmd/gogio: use URL query for passing arguments to wasm programs
The location.hash method doesn't work correctly with multiple
iframes and Safari.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-22 16:22:08 +02:00
Elias Naur fc2a2ae615 cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-22 11:35:50 +02:00
Elias Naur 67382bec39 cmd/gogio: [wasm] pass location.hash (if set) to os.Args
Allow for specifying command line arguments to webassembly programs
through the URI hash (https://example.com/wasm/index.html#args)

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-21 20:34:11 +02:00
Elias Naur a96b208582 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-21 10:56:44 +02:00
Elias Naur 99080023e4 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-19 10:16:25 +02:00
Elias Naur dc7a8fd9ea example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-17 19:52:17 +02:00
Daniel Martí 669e4cc96a cmd/gogio: speed up the wine e2e test
First, use wineboot instead of winecfg to set up the WINEPREFIX. It's
the right tool for it.

Second, when initialising WINEPREFIX, use output pipes instead of
CombinedOutput. The latter will wait for *all* output to be copied to a
buffer, including the output from grandchildren processes. Since wine
starts wineserver automatically, and wineserver lingers for three
seconds by default, this is bad. We would waste three seconds waiting
for wineserver doing nothing, and then the next wine call (to start the
app) would need to start wineserver all over.

Instead, with pipes we can get cmd.Run to only wait for the parent
process to finish. wineserver stays running but we don't care. And, when
we start the gio app, we very likely reuse the same wineserver process.

Third, disable wine-gecko and wine-mono. This ensures we don't get stuck
if they're not installed, and speeds up wineboot by avoiding work we
don't need.

The time to set up WINEPREFIX goes down form ~6s to ~1s, and the overall
subtest run-time goes down from ~10s to ~3s.

Finally, copiously document all of the precious data I've gathered above
after hours of debugging.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-05-10 21:51:30 +02:00
Daniel Martí 023e022255 cmd/gogio: make e2e test output consistent
Fix a long-standing TODO: instead of each sub-test handling its own
output separately, just make each expose its output via an io.Reader.
Then, the shared driverBase code can tell if any of the lines contain
the magic "gio frame ready" string.

Reduces the amount of code a bit, but most importantly, it keeps the "is
a frame ready?" logic in a single place.

In the future, this also enables us to do more with all the e2e test app
output consistently. For example, we might want to add a -debug flag to
always log output lines as they happen.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-05-10 20:32:57 +02:00
Daniel Martí 9ad412ea0b cmd: bump gioui.org dependency, use -modfile properly on CI
A simple 'go test -modfile=<path>' won't work properly for the
end-to-end tests, since they run 'go build' under the hood as well.

To properly propagate the flag, we need to use GOFLAGS. Since -modfile
is always relative to the current directory, we can't use it to test
many packages at once, nor can we use it via 'go test ./gogio'.

While at it, document this distinction in go.local.mod to prevent others
getting confused like I did.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-05-10 20:32:53 +02:00
Daniel Martí c2cbcee78d cmd/gogio: use a standalone WINEPREFIX for the wine e2e test
This way, if the user has a custom winecfg, it can't possibly affect the
tests. I was encountering this as DXVK does not work on virtual Xorg
servers (which we use), and Gio thus failed to render on such a
combination.

>From the numbers below, it can be seen that setting up a new WINEPREFIX
takes roughly five seconds:

	$ rm -rf ~/.cache/gio-e2e-wine
	$ go test -run EndToEnd/Windows
	PASS
	ok  	gioui.org/cmd/gogio	16.369s
	$ go test -run EndToEnd/Windows
	PASS
	ok  	gioui.org/cmd/gogio	11.810s

A repeated run still has a slow "wine winecfg /?", for some reason. Add
a TODO since I can see it taking a third of the time on my terminal. I
haven't been able to properly investigate why, unfortunately. As far as
I can tell, winecfg is just faster when run with a terminal instead of
an output buffer. They might use isatty on stdout/stderr.

The overall time to run the wine sub-test is increased from ~5s to ~11s,
but it's worth it to make it run everywhere. It looks like there is
plenty of room as per the TODO above, as winecfg seems to mostly do
nothing. We're also not too worried, as all e2e subtests run in
parallel.

Fixes #106.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-05-10 08:40:36 +02:00
Elias Naur 0ad8f85c05 cmd/gogio: add -linkmode flags
For experimenting with https://github.com/golang/go/issues/38918.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-08 08:31:26 +02:00