Commit Graph

962 Commits

Author SHA1 Message Date
Elias Naur bbdedfa4a7 layout: move Context to its own file
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-02 12:43:42 +01:00
Elias Naur 75d4eaff0e layout: fix typo
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-02 12:41:52 +01:00
Elias Naur 2aa6071e33 io/system: fix typo
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-02 12:38:48 +01:00
Daniel Martí 5bddf66db7 cmd: update the chromedp version
It's a bugfix release, and we want some of the stability fixes in it.
Starting Chrome processes is more reliable now, for example.

See https://github.com/chromedp/chromedp/releases/tag/v0.5.2.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-12-02 11:01:17 +01:00
Elias Naur 41116b5cb8 app/headless: add package docs
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-02 00:05:30 +01:00
Elias Naur 0b84137f40 app/headless: implement headless windows
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:40:02 +01:00
Elias Naur 9df3c76aa2 app/internal/egl: don't exit if EGL dlls fails to load
We want a useful error instead of a hard exit for headless windows.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:40:02 +01:00
Elias Naur 06a2228798 app/internal/windows: split out Windows syscalls from package window
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 9b4176c475 app/internal/egl,app/internal/window: move Lock/Unlock methods
EGL contexts don't need locking, so their Lock and Unlock methods
are empty. Remove them and add them where necessary instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 15a1261cfc app/internal/egl: only create a compatibility FBO if there is a surface
While here, only refresh the FBO if needed to make MakeCurrent faster.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur f25f647a66 app/internal/window,app/internal/gl: move gl.Context to package window
Package gl now only defines opengl types and functions.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 5fa3dbc70d app,app/internal/gpu: split render loop from GPU
The policy of rendering on a separate goroutine is separate from
the actual rendering. Reflect that by introducing the RenderLoop
type for driving a GPU from a separate goroutine.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 8cec7d1a40 app/internal/window: move context refresh to window
Instead of calling from the low level context into the window
for its surface and dimensions, add a Context.MakeCurrent method
that does it directly.

The result is simpler and clearer logic. For example, synchronization
is obviously no longer needed. It wasn't necessary before, but the
reason was unclear.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 3199ae7600 app/internal/window: fix typo
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 14dad238f3 app/internal/gl: lazy load blitting program and quad in SRGBFBO
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur f9f6f2d3ea app/internal/gl: delete buffer and program in SRGBFBO.Release
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 809b4a2cf9 app/internal/gpu: don't release the context when New fails
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur c49f214f4a app/internal/egl: support surfaceless contexts
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 5016c98739 app/internal/egl: split surface creation from making context current
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 99b6ad09e5 app/internal/egl: move EGL interface to its own package
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 23:25:04 +01:00
Elias Naur 9528a6e0d4 app/internal/gpu: rename NewGPU to New
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 22:38:39 +01:00
Elias Naur eb8745eb32 app/internal/window: remove redundant return
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 22:38:38 +01:00
Elias Naur 77d21ddf38 app/internal/gl: fix ReadPixels on Windows
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-01 20:16:32 +01:00
Larry Clapp 0ddcee4ec6 app/internal/windows: modifiers & punctuation hotkeys
For Windows:
- Add shift/ctrl/etc modifiers to mouse events, so you can recognize the
  difference between "click" and "shift-click".
- Add several allowed punctuation characters as single key events, so
  you can (for example) use "." as a hotkey.

Signed-off-by: Larry Clapp <larry@theclapp.org>
2019-11-30 10:31:04 +01:00
Elias Naur b4f73b3ef7 .builds: add missing xkbcommon-x11 dependency
The dependency was added when merging the X11 and Wayland keyboard
handling.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-28 12:09:29 +01:00
Greg Pomerantz 2ca2e5462f app: add RegisterFragment method on *Window for Android
RegisterFragment creates an instance of a Java class and registers
it as a Fragment in the window's Context.

Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
2019-11-26 18:52:43 +01:00
Larry Clapp ce76c2e996 layout: make list scroll position settable
Put List.{first|offset|beforeEnd} into a new exported Position slot, and
also export each individually.

Have to put BeforeEnd into the Position slot to support ScrollToEnd
lists.

Signed-off-by: Larry Clapp <larry@theclapp.org>
2019-11-26 17:53:29 +01:00
Greg Pomerantz 8321745de9 app/permission: add documentation and storage permissions
Storage permissions enables the Android permissions
READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE.
2019-11-26 12:29:00 +01:00
Daniel Martí 99d97d2ef5 cmd/gogio: remove an unnecessary wait in the js e2e test
We already wait for the app to render itself via the "frame ready"
stdout prints. Waiting for the canvas to be ready isn't really necessary
anymore. It helped us while we had to rely on sleeps, but that's no
longer the case.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-11-25 10:24:49 +01:00
Daniel Martí 726270ab2d cmd: remove js runtime workaround
The js/wasm bug meant that printing to stdout in the e2e app would crash
the runtime, so we couldn't synchronize with the app like in the other
drivers.

Now that the bug is fixed, we can do the same as the other drivers just
fine.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-11-24 20:01:38 +01:00
Werner Laurensse 4bcb4ec8b6 text: add Metrics method to Face interface. font/opentype: implement Metrics method for Font struct.
Signed-off-by: Werner Laurensse <werner@alman.ax>
2019-11-24 20:01:33 +01:00
Elias Naur aca511f849 app/internal/window: (wasm) generate key.Events for all printable characters
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-24 19:41:11 +01:00
Larry Clapp 65bc7be256 app/internal/window: allow punctuation as keycode events
Allows things like "ctrl-{" and ".".

All punctuation is returned as-is, e.g. "!" is "!", not "shift-1", and
"{" is "{", not "shift-[".

Also add the Enter key as a known key (fn-return on my Mac).

Signed-off-by: Larry Clapp <larry@theclapp.org>
2019-11-24 19:41:11 +01:00
Elias Naur d5424ef7fc app/internal/window: replace X11 input handling with xkb
Unifies Wayland and X11 keyboard handling.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-24 19:41:11 +01:00
Elias Naur 5a34b6f2c3 app/internal/xkb: send key.Events for shifted keysyms
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-22 16:13:38 +01:00
Elias Naur 968669d39e app/internal/xkb: fix cleanup check
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-22 14:52:33 +01:00
Elias Naur 4072361fd5 app/internal/gpu: fix Pathfinder URL
Noticed by Daniel Martí.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-22 14:50:04 +01:00
Elias Naur 6a2b5a8d3b example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 20:28:06 +01:00
Elias Naur f3f079df32 font/opentype: treat invalid characters less specially
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 20:15:31 +01:00
Elias Naur c072a7eb87 font/opentype: fix kerning
Fixes gio#69

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 19:57:38 +01:00
Elias Naur 76c209b594 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 18:36:34 +01:00
Elias Naur b39e4227c2 gesture,internal/fling: fix rounding
The code tried to extract a rounded whole number of pixels while preserving the
fraction. However, it failed to converge for the value 0.5, rounded to 1,
leaving -0.5, rounded to -1, leaving 0.5 and so on.

Drop the cleverness and truncate the values instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 18:30:01 +01:00
Elias Naur 72840d7b88 app/internal/window: delete redundant draw on WM_MAXIMIZE, WM_RESTORED
There's always a WM_PAINT after a restore or maximize message.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 15:19:26 +00:00
Larry Clapp f8de7545f4 several: add modifiers to mouse events and clicks
macOS only, for the os-specific bits.

Signed-off-by: Larry Clapp <larry@theclapp.org>
2019-11-18 15:38:09 +01:00
Elias Naur 26f34a3331 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-18 15:05:12 +01:00
Elias Naur 16cc51ee8a io/pointer: unify area ops into a single AreaOp
Make Rect and Ellipse constructors of AreaOp.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-18 15:03:11 +01:00
Elias Naur 3edd9dd8be example/gophers: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-18 14:37:14 +01:00
Elias Naur 7299d1c875 op/clip: replace Rect and RoundRect with Rect type
Remembering the order of the corners in the RoundRect is difficult,
which suggest that RoundRect should be a struct with named fields.

Do that, and make Rect the special case where corner radii are all
zero.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-18 14:33:28 +01:00
Konstantin Kulikov 101b65f4e5 app/internal/window: map window after defining WM protocols
ICCCM 4.1.2 says WMs will examine client properties every time
window is mapped. Because SetWMProtocols is called before MapWindow
some WMs (specifically taowm) never see them.

In other WMs this works because they check for WM_DELETE_WINDOW
when user tries to close window, not when window is mapped.

Signed-off-by: Konstantin Kulikov <k.kulikov2@gmail.com>
2019-11-14 10:56:49 +01:00
Denis Bernard 1bf2c7ef29 app/internal/window: (X11) Add support for UTF-8 window title.
Signed-off-by: Denis Bernard <db047h@gmail.com>
2019-11-13 00:56:26 +01:00