Commit Graph

251 Commits

Author SHA1 Message Date
Peter Sanford 2aa1cc8112 Add new permission: networkstate
For android this provides ACCESS_NETWORK_STATE

Signed-off-by: Peter Sanford <psanford@sanford.io>
2021-03-08 08:19:22 +01:00
Elias Naur 7059b6284a app/internal/wm: rename confusing app/internal/window
Package wm (for "window manager") is a better fit for the package, and
distinguishes it from the low-level package windows for the Windows API.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-03-06 14:28:57 +01:00
Elias Naur 8ff6546285 gpu,gpu/backend: implement generic backend.NewDevice
NewDevice creates a Device given an API, which is the necessary GPU
resources for a backend.

Convert gpu.New to take an API instead of a backend.Device directly.

In turn, this frees us to later unexport the backend package along with
the backend implementations (for now just gioui.org/gpu/gl for OpenGL).
It also allows programs that embed Gio (such as gioui.org/example/glfw)
to freely choose a backend, not just OpenGL.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-03-06 14:24:09 +01:00
Elias Naur 57dee8e61a cmd/gogio: bump Wine timeout for window movement
The Windows tests on builds.sr.ht are still flaky:

    TestEndToEnd/Windows: e2e_test.go:130: retrying after 400ms
    TestEndToEnd/Windows: e2e_test.go:130: retrying after 800ms
    TestEndToEnd/Windows: e2e_test.go:130: retrying after 1.6s
    TestEndToEnd/Windows: e2e_test.go:130: retrying after 2s
    TestEndToEnd/Windows: e2e_test.go:130: last error: encountered 6 color mismatches:
	5,5   got 0xffffffffffff, want 0xffff00000000
	395,5   got 0xffffffffffff, want 0xffff00000000
	5,305 got 0xffff00000000, want 0x000000000000
	395,305 got 0xffff00000000, want 0x000000000000
	405,305 got 0xffffffffffff, want 0xffff00000000
	795,305 got 0xffffffffffff, want 0xffff00000000
    TestEndToEnd/Windows: e2e_test.go:130: hit timeout of 4s after 6 tries

Bump the window movement delay in the hope that it helps.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-03-03 11:15:13 +01:00
Egon Elbre 60db802951 cmd/gogio: fix test work group handling
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
2021-02-28 10:18:37 +01:00
Egon Elbre 2e15c3d5b9 cmd: fix hash to gioui.org
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
2021-02-28 10:18:37 +01:00
Inkeliz 8227f7ab04 cmd/gogio: [android] update target sdk version
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2021-02-25 12:44:28 +01:00
Elias Naur 53763a3410 cmd/gogio: raise end-to-end test timeout
Windows tests often flake:

TestEndToEnd/Windows: e2e_test.go:113: last error: encountered 6 color mismatches:
          5,5   got 0xffffffffffff, want 0xdedeadadbebe
        395,5   got 0xffffffffffff, want 0xdedeadadbebe
          5,305 got 0xdedeadadbebe, want 0x000000000000
        395,305 got 0xdedeadadbebe, want 0x000000000000
        405,305 got 0xffffffffffff, want 0xbbbbbbbbbbbb
        795,305 got 0xffffffffffff, want 0xbbbbbbbbbbbb

Bump the timeout as a quick workaround.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-02-24 12:52:12 +01:00
Inkeliz 212f7809cb cmd/gogio: [android] allow custom signature-key
That change makes possible to provide custom PKCS#12 (JKS/PFX) using `-signkey` and the password with `-signpass`.

By default the gogio will use the `debug.keystore`, if no key is provided.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2021-02-24 12:34:43 +01:00
Inkeliz 2a7295750d cmd/gogio: fix icon/resources for Android
Previously that patch, gogio unzip the `link.apk` (generated by AAPT2) to an temporary folder and then compress it again to a new `app.ap_` file.

For some unknown reason, that unzip-then-zip doesn't work. The resources are included but is corrupted in somehow. That PR aims to fix that by avoid the extraction to an temporary folder.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2021-02-22 12:10:36 +01:00
Elias Naur ffb56f42b9 cmd/gogio/testdata: always clear background to white
The webassembly port changed to use transparent black to allow content
below Gio to show through. However, the end-to-end tests expect a white
background.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-02-18 09:06:24 +01:00
Elias Naur b420fdf096 cmd/gogio: remove obsolete headless chrome workaround
The two listed issues are fixed, and the builders pass with the
workaround removed.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-02-18 08:46:03 +01:00
Elias Naur d420654dbc cmd/gogio: fix argv passing from URL search fragment to Go program
Fixes the examples on gioui.org/doc/architecture.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-02-01 16:51:31 +01:00
Elias Naur 5dd3ce9923 cmd/gogio: [iOS] identify certificates by their SHA-1 fingerprint
Unlike the common name, the fingerprint is almost certainly unique.
Xcode uses the fingerprint as well.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-02-01 13:18:22 +01:00
Inkeliz 07715a8125 cmd/gogio: remove windres dependency
Now, it's possible to compile to Windows (`-target windows`) without
having `windres`. The PNG icon, manifest and version info will be
generated and include using `gogio`.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2021-01-07 09:49:26 +01:00
Walter Werner SCHNEIDER fd2d96adfc all: fix spelling errors
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-12-17 08:55:23 +01:00
Robin Eklind 9cc90d9695 cmd/gogio: sort and group imports using goimports
find gio/ -type f -name '*.go' | xargs -I '{}' goimports -w '{}'

Signed-off-by: Robin Eklind
2020-12-16 02:09:44 +01:00
Inkeliz fe844cc489 cmd/gogio: fix support for older browsers
That change removes the "??" operator, it isn't supported
by old browsers [0].

[0]: https://caniuse.com/mdn-javascript_operators_nullish_coalescing

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2020-12-14 16:33:56 +01:00
Inkeliz 745bb949bb cmd/gogio: [wasm] embed .js files
Similar to the Android, which includes all .jar files into the .apk.
Now, the `gogio -target js` will include all `*_js.js` files
into the resulting `wasm.js`.

That change make possible to adds custom wasm-imports, which might
be used in future versions of Gio.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2020-12-11 20:24:34 +01:00
Inkeliz fa96e12b6d cmd/gogio: add support for Windows
Now, gogio can build the program for Windows, using the `-target
windows`.

It will build with `-H=windowsgui`, by default. Also, it can compile for
multiple platforms if specified using `-target` (e.g. `-target arm, 386,
amd64`), the executable will have the respective suffix (i.e.
`_386.exe`).

gogio will also attach (any) appicon.png as executable icon resource and
include some information about the file and supported operating system.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2020-12-11 17:00:21 +01:00
Chris Waldon acc3f704e4 example/{kitchen,tabs,gophers}: update to use material.Palette
Update gioui.org/cmd while here.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
2020-12-06 23:04:52 +01:00
Elias Naur 47ba975899 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-12-06 22:59:51 +01:00
Elias Naur 9b8e847a05 example,cmd: update gio version
Remove copy/paste from kitchen now that Editor supports it natively.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-12-06 22:31:43 +01:00
Elias Naur 2230accd34 cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-12-05 10:22:59 +01:00
Elias Naur e9a75cc22a example/glfw: delete GLFW => Gio OpenGL bridge
It's no longer needed.

Update gophers to latest gio while here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-12-04 20:52:33 +01:00
Walter Werner SCHNEIDER 4f8150cd59 cmd/gogio: add gogio test for go import path
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
2020-11-27 09:16:56 +01:00
Elias Naur 9b54892cc4 cmd/gogio: restore package path handling
A previous change converted the package argument to gogio to an absolute path.
However, gogio supports all package paths that may appear in Go import statements.
For example, the path "gioui.org/cmd/example/kitchen" should not be converted.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-11-26 11:17:40 +01:00
Inkeliz eaaffa1f3e cmd/gogio: force GOARM=7 to avoid softfloat on Android
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2020-11-24 19:53:04 +01:00
Egon Elbre 2affb6eaa4 cmd,example: fix uses of color.NRGBA
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
2020-11-19 11:35:26 +01:00
Walter Werner SCHNEIDER 3c739323cb cmd/gogio: group buildInfo related code
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
2020-11-12 15:52:35 +01:00
Elias Naur dbc0796d02 cmd/gogio,cmd/gogio/testdata: update Gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-11-06 20:56:54 +01:00
Elias Naur d5bdf0756a cmd/gogio: use GOOS=ios to target iOS with Go 1.16 and newer
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-10-20 11:46:34 +02:00
Elias Naur e690c14ddc cmd/gogio: lower minimum OpenGL ES to 2.0 on Android
The Fairphone 2 only supports OpenGL ES 2.0, but otherwise seems
capable of running Gio. By lowering the minimum requirement, Gio apps
will be available in the Play Store for Fairphone 2 devices.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-10-12 15:16:56 +02:00
Sebastien Binet 2f67feafc0 app/permission/camera,cmd/gogio: add support for camera permission
Signed-off-by: Sebastien Binet <s@sbinet.org>
2020-09-12 17:32:11 +02:00
Elias Naur 956bb10a0f cmd/gogio: document -minsdk
Tweak documentation a bit while here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-09-12 11:53:07 +02:00
Elias Naur 3dea674390 gogio: skip Android tests when no adb is found
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-08-29 18:10:31 +02:00
axel paulander edef73f580 cmd/gogio: add -icon flag for specifying the app icon file
Before users were limited to only use a appicon.png in the root directory.
Now the user is free to use any png anywhere on the system with the help of the -icon flag.

Signed-off-by: Axel Paulander <axel.paulander@gmail.com>
2020-08-16 10:52:42 +02:00
Elias Naur a063febed9 cmd: use ANDROID_SDK_ROOT instead of ANDROID_HOME
ANDROID_HOME is deprecated and slowly being removed from Android
tools.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-08-09 18:17:02 +02:00
Elias Naur 83673ecb20 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-07-26 11:03:39 +02:00
Elias Naur f958f9512e cmd,example: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-07-15 12:11:02 +02:00
Elias Naur 5a6ad65b85 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-07-09 18:33:56 +02:00
Elias Naur 659849bb82 example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-07-08 16:18:40 +02:00
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