~eliasnaur/gio

app/internal/window: [macOS] remove useless retain/release

The window and its view is guaranteed to outlast the display link.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/window: [macOS] use regular map for view-to-window lookups

All accesses to the view map now happens on the main thread, so
there is no need for a sync.Map anymore.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
io/pointer: add Drag event type

This eliminates needless redraws for handlers that care about drag events and not move events, like gesture.Scroll.

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
app/internal/window: [macOS] remove frivolous cascadeTopLeftFromPoint call

Signed-off-by: Elias Naur <mail@eliasnaur.com>
io/router: deliver scroll events only to the foremost scroll handler

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
io/pointer: add InputOp.Types to specify which types of events to receive

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
layout: don't run alloc tests with -race

The race runtime allocates where the non-race runtime doesn't.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
io/pointer,gesture,app/internal/window: add pointer.Scroll event type

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
io/router: remove countPointerEvents

assertEventSequence is shorter and clearer and more precise.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
io/pointer: update documentation examples

Signed-off-by: Elias Naur <mail@eliasnaur.com>
example,cmd: bump gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/window: [macOS] always draw synchronously

Asynchronous draws introduces flickering on resizes.

Fixes #123

Signed-off-by: Elias Naur <mail@eliasnaur.com>
io/router: fix typo

Signed-off-by: Elias Naur <mail@eliasnaur.com>
cmd,example: bump gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
op: change CallOp to be a return value from MacroOp.Stop

Converting

	macro := op.Record(ops)
	...
	macro.Stop()

	macro.Add()

to

	macro := op.Record(ops)
	...
	call := macro.Stop()

	call.Add(ops)

Which is more general (call.Add can take a different ops than the op.Record
that started it), and enforced the order between Stop and the subsequent Add.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
layout: add test that Flex doesn't allocate

Signed-off-by: Elias Naur <mail@eliasnaur.com>
layout: add test that Stack doesn't allocate

Signed-off-by: Elias Naur <mail@eliasnaur.com>
op: make MacroOp methods take value receivers

The only mutable field is "recording", which is used for a sanity
check. THat check is performed (less generally) by Ops.macroStack.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
op: return value StackOp from Push and make Pop use a value receiver

To match Record, we'd like Push to return a value. To do that and
support the one-line

	defer op.Push(ops).Pop()

Pop needs to use a value receiver as well. Drop the active field
and make it so. The field was only a sanity check, a check which is
already done by Ops.stackStack, albeit with a less specific panic.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
op: add op.Push and op.Record funcs

The funcs replace stack.Push and macro.Record, which become private.
This makes stack and macro faster to write, in particular for stacks
where you can just write the following line to save and restore the
state :

  defer op.Push(ops).Pop()

This usage requires Push to return a pointer (since Pop has a pointer
receiver), or else the code doesn't compile.

For consistancy, I tried to do the same for op.Record, but this implied
to turn all the MacroOp fields into pointers, and this caused some
panics. As a result, op.Record doesn't return a pointer.

An other side effect pointed by Larry Clapp: StackOp and MacroOp are not
re-usable any more, you have to allocate a new one for each usage, using
the described funcs above.

Signed-off-by: Thomas Bruyelle <thomas.bruyelle@gmail.com>
Next