app: [API] refactor app.ViewEvent to support wayland

This commit changes the definition of app.ViewEvent on Unix systems
to be an interface implemented by two different concrete types:
X11ViewEvent and WaylandViewEvent. Each provides the necessary fields
for custom rendering on its display protocol.

This is a breaking change for all users of app.ViewEvent on
Linux/BSD, as it now is an interface instead of a concrete type.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2022-01-31 12:53:56 -05:00
committed by Elias Naur
parent 74acc90789
commit 7204632c39
3 changed files with 33 additions and 9 deletions
+2 -2
View File
@@ -813,10 +813,10 @@ func newX11Window(gioWin *callbacks, options []Option) error {
// make the window visible on the screen
C.XMapWindow(dpy, win)
w.Configure(options)
w.w.Event(ViewEvent{Display: unsafe.Pointer(dpy), Window: uintptr(win)})
w.w.Event(X11ViewEvent{Display: unsafe.Pointer(dpy), Window: uintptr(win)})
w.setStage(system.StageRunning)
w.loop()
w.w.Event(ViewEvent{})
w.w.Event(X11ViewEvent{})
w.destroy()
}()
return nil