Commit Graph

5 Commits

Author SHA1 Message Date
Elias Naur c080a54038 ui/app: call main from Android and iOS
Android can only run c-shared libraries which means that every
Gio program must create its window and event loop from an init
function.

The same applies to iOS but for a more benign reason: the gio tool
builds programs in c-archive mode for iOS and links the binary with
a Objective-C driver.

Allow Gio programs to run off its main function by linking to and
invoking main even from Android libraries and iOS ditto.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-22 11:33:09 +02:00
Elias Naur 4e0d820a5b ui/app: (android) block until DataDir is ready
The app data dir is not set until after Go's init functions have
run, which means that DataDir is inherently racy. Avoid that race
by blocking in DataDir until it is set from Java.
In other words, trade a race condition with a deadlock.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-22 09:37:48 +02:00
Elias Naur f7ea448256 ui/app: (android) fix length of C string copy
The data dir string is returned to Go as a byte array of the UTF-8
encoded string, but it is not NUL terminated.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-08 16:15:45 +02:00
Elias Naur c884b7d4f0 ui/app: introduce DrawEvent.Insets and add Android implementation
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-07 23:30:38 +02:00
Elias Naur f56e082cc7 ui/app: introduce DataDir for application-specific data files
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-07-07 00:39:13 +02:00