Rename MainAxisAlignment to Spacing and CrossAxisAlignment to just
Alignment.
Drop the untyped Start, End, Center values and add them as Spacing
and Direction values. Center is both a Direction and Alignment, so
use the synonym "Middle" for the alignment.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Window.Draw is not the right name for a method that does more than
just drawing. Rename to Update instead, and rename the DrawEvent
accordingly for symmetry.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Add decode functions to the packages that need them instead. For
TransformOp that is used in multiple packages, add the decode
function to the internal ops package.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
showTextInput is called from the window loop in window.go, but
could result in an immediate event which then deadlocks waiting for
the window loop to handle it.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
By returning all events, widgets that might return early from its
event loop might throw away subsequent events. Instead of requiring
those widgets to store the event list, convert input.Queue to step
through the available events one at a time.
Functional revert of 1735d5ced8.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
input.Event is enough if we stretch "input" to mean both input
devices and other events such as profiling events and system
commands.
The pointer and key packages are separate already, so I don't
expanding the meaning is unreasonable.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
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>
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>
It is never a good idea not to draw in response to a DrawEvent, but
let's not hang the program if it doesn't call Window.Draw.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Instead of querying the backing store scale for every pointer event,
use the scale from the last window draw. It might not make any visible
difference because we redraw on scale changes, but it is more correct.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
When moving a window to another monitor, update is called when the
opengl backing store updates its internal size.
Signed-off-by: Elias Naur <mail@eliasnaur.com>