The MouseHandler used to only consume the mouse events if there was a
last_handler widget defined AND whoever is using the API set
ctx.consume_event to true.
This change makes it so the event is consumed when ctx.consume_event is
set to true, even if there is no last_handler widget defined.
Don't require that surfaces explicitly declare mouse handling. We either
pass an event to the eventHandler or we don't. Along with this, we
remove all native widget passthrough events (IE we never pass an event
to a child). Native widgets which don't handle events also set
eventHandler to null, which prevents any null pointer issues also
Move capture handling of events to a different method on Widget. Having
capturing phase in the same method makes it very easy to accidentally
capture an event, producing confusing results. Browsers and GTK both
require handlers to explicitly listen to capturing phase events, so
there is precedence for having this as a separate method. For
applications that want to handle it all within the same function, the
signature is the same so they can use the same function for both methods
and achieve the same result.
Check if the target mods have shift or caps lock, and uppercase our
codepoint if they do. Someday we will need to allocate zg.case_data to
handle all of unicode casing, but for now we handle ascii until we
figure out a nice way to plumb in case_data.
RichText is a general purpose text layout widget which can have more
than one style. This comes with a small performance penalty compared to
`Text` due to not being able to do the same index operations, however it
does support all of the same features
Text widget is a general purpose text layout widget. Includes support
for soft wrapping, ellipsis truncation, and text alignment. A single
style is applied to the entire widget area.
This was previously being developed at github.com/rockorager/vtk. I
really liked how it came together, and am moving it into the vaxis repo
piece by piece.
Create USAGE.md to serve as a friendly guide for usage.
Move the libxev and zig-aio event loops to serve as an example of how to
implement a custom event loop in USAGE.md. Remove dependency on these
libraries and all associated examples and source code.
The motivation for this change is to provide a simpler library. The
power to create a custom event loop will always be kept, however the
support burden of maintaining three event loops is not where I want to
focus my energy. The code is small enough that it's easy enough to be
copy/pasted into a project or provided as a third-party library.