Systems that only support ES 2 are unlikely to have the required
extensions available. But we'll get a better exit error in that case.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
With public ImageOp fields there was no way to mark an image.Image as modified.
Replace them with NewImageOp that always make a copy, and use the opportunity
to ensure the copy is ready to upload to a GPU texture.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Package app is the only package that depends on native libraries and
Cgo. Minimize its API, thereby minimizing Gio clients' dependency on
it. In the future, a headless, testing or remote "Window" should be
very easy to replace app.Window.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
It wasn't used, and it's not clear that it is useful at all in its current
form. For example, a single control with multiple handler keys (say, one for
scrolling and one for clicking) will only receive priority Foremost for one of
them.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
While "DrawEvent" was too specific (op.Ops contains non-draw events),
"Update" is too vague: it's a common word, and could be misunderstood
to mean update parts of a window, not replace it.
"FrameEvent" is more specific, and is the usual way to refer to immediate
mode drawing.
While we're here, unexport Window.Update and add a Frame function to
FrameEvent, to emphasize that updating the window frame is only
appropriate during the handling of a FrameEvent.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
First, let the handlers know they're dropping with a cancel event.
Second, reset the grab flag of dropped handlers.
Fixes issues when drag-scrolling and then clicking and another with two nested
drag gestures where the grab flag is kept for the second handler even after it
is pushed out by the first handler grabbing.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
While we're here, replace Height and Width options with just a Size; the value
of separate width and height options is not clear to me.
Finally, leave out the wrapping struct from the Option type, the
function is enough.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Only the Wayland backend needs an wl_egl_window between the wl_surface
and EGL. Move code dealing with the indirection to Wayland specific
code.
Then, introduce the eglDriver interface instead of referencing the
native window type directly. This will help when multiple backends are
supported at runtime (e.g. Wayland+X11).
Finally, move the eglDriver implementation methods from GOOS-specific
code to separate EGL-specific files, allowing EGL types to be used
directly instead of unsafe.Pointer and uinptr.
The result is simpler generic EGL code, and easier path towards X11
support.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Package ui is now only about units except for the Config.Now method.
Remove Now and rename Config to Converter. Add layout.Config to
replace the old ui.Config.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
We're about the split up and finally delete package ui. Move the
instructions link to the second most "top-level" package in Gio,
package app.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Packages that provide support for external events such as pointer, key and
system are only the beginning. Future packages are expected for clipboard
access, drag and drop, gps positions and so on.
To keep the number of top-level packages under control, move such I/O packages
to the new `io` directory.
The `system` package name was the previous solution to keeping the number of
top-level packages under control: I named it `system` instead of the narrower
`profile` because I expected to put all the less common events into it, turning
`system` into a "package util" smell.
With `io`, package system can be renamed to `profile`.
Signed-off-by: Elias Naur <mail@eliasnaur.com>