Commit Graph

34 Commits

Author SHA1 Message Date
Elias Naur 45da52cee7 app: merge app/internal/wm into package app
The app and app/internal/wm packages are tightly coupled, requiring
quite a bit of forwarding types, values and constants from the internal
package to export it. Further, no other package imports package wm.

This change merges the two packages.

While here, drop the pre-Go 1.14 SIGPIPE workaround.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-08-29 22:00:16 +02:00
Elias Naur 152a30f468 cmd/gogio: bump minimum Android SDK version to 17 (Android 4.2)
The CPU fallback renderer relies on posix_memalign, which was exposed in
Android 4.2. Support for Android 4.1 could be restored by writing
posix_memalign outselves, but this change is easier.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-07-26 16:43:29 +02:00
Inkeliz b7dc407dbe cmd/gogio: [android] add support for AAB
That patch makes possible to generate Android App Bundle (`.aab`) instead
of APK. In order to generate AAB use `-o outputfile.aab`.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2021-03-25 08:19:41 +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
Inkeliz 8227f7ab04 cmd/gogio: [android] update target sdk version
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
2021-02-25 12:44:28 +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
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
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
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
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 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 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
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
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 681bafce08 cmd/gogio: use filepath for Windows compatibility
Fixes gio#112

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-07 15:52:13 +02:00
Elias Naur 84d4800a16 cmd/gogio: match Android window background with default Gio color
While launching an app on Android, the hard-coded theme is used for
the color. That color is by default black, and results in a jarring
transition to the actual app background.

The default Gio color is white, so use that for the theme background
as well.

This change will break for "dark mode" programs and similar.  A future
improvement would be to reflect the actual app background in the theme.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-04-24 15:59:30 +02:00
Elias Naur 2b1935d657 cmd/gogio: include Android themes in .aar outputs
Not strictly necessary, but makes embedding a Gio Android Activity
easier; adding

	<activity android:name="org.gioui.GioActivity"
		android:theme="@style/Theme.GioApp"
		android:configChanges="orientation|keyboardHidden"
		android:windowSoftInputMode="adjustResize">
		<intent-filter>
			<action android:name="android.intent.action.MAIN" />
			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>
	</activity>

should be enough.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-04-18 20:24:42 +02:00
Elias Naur 761ab68868 cmd/gogio: support newer NDKs
Newer Windows NDKs add the "x86_64" platform suffix like other
OS'es. Remove the special case.

Newer NDKs are also installed in "ndk/x.y.z" versioned directories
instead of in "ndk-bundle". Support that.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-01-27 17:34:43 +00:00
Daniel Martí ec0c2498a1 cmd/gogio: fix a couple of staticcheck positives
Spotted the javac one by chance when reading the code, so I ran the tool
and fixed another small bug while at it.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-11-04 00:09:40 +01:00
Greg Pomerantz af353822fa cmd/gogio: add permissions system for Android
Search for imports of the form gioui.org/app/permission/* and add
required permissions to AndroidManifest.xml.

Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
2019-11-01 18:58:13 +01:00
Greg Pomerantz 3cd633ee44 cmd/gogio: Android: include jar files from dependencies
On Android, in addition to adding jar files found in the source
directory of the program being compiled, cmd/gogio also searches
every dependency for jar files to include in the output APK.

Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
2019-11-01 17:59:49 +01:00
Elias Naur 439d3e652c app/internal: consolidate CFLAGS and move -Werror to #cgo directives
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-28 13:30:51 +01:00
Greg Pomerantz 175144fa99 cmd/gogio: Android: include jar files from package directory
Look for *.jar files in package directory for inclusion in
Android .apk file.

Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
2019-10-18 16:45:43 +02:00
Elias Naur fc521ec1ff cmd/gogio: update gio version
The path of the supporting Android Java files and iOS header file
moved.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-14 16:43:21 +02:00
Elias Naur e4b1a46dd2 cmd/gogio: create a temporary signing key if debug.keystore isn't found
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-09 19:08:28 +02:00
Elias Naur 468731538e cmd/gogio: look for javac in JAVA_HOME if it is not in PATH
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-09 18:38:05 +02:00
Elias Naur b749c5dd28 cmd/gogio: fix Android toolchain path for Windows 64-bit
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-09 18:27:09 +02:00
Greg Pomerantz 81814e6fa4 cmd/gogio: add -minversion flag to specify minimum Android platform
Allow the user to specify a minimum supported Android platform
version.

Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
2019-10-07 17:00:24 +02:00
Elias Naur 962bc36dac apps,cmd: update to renamed gioui.org module
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-30 12:41:29 +02:00
Elias Naur a12912c944 cmd/gogio: rename the gio too to gogio
The `gio` name clashes with a widely deployed GNOME tool.
Rename our tool to `gogio`, "the go tool for gio programs".

Fixes gio#20

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-18 22:46:47 +02:00