All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Compilation errors with 1.0.1 tar (reverted) due to bad file permissions.
- Updated dependencies (elixir_make, credo).
The release includes small breaking changes to the termbox bindings API in order to make working with the NIFs safer.
Specifically, the termbox bindings have been updated to guard against undefined behavior (e.g., double initialization, trying to shut it down when it hasn't been initialized, getting the terminal height when it's not running, etc.). New errors have been introduced in order to achieve this, and tagged tuples are now returned in some cases where previously only a raw value returned.
The bindings now prevent polling for events in parallel (i.e., in multiple NIF
threads), which may have caused a segfault before. One way this might have
happened before is when an EventManager
server crashed and was restarted. The
new API manages a single long-lived polling thread.
- All
Bindings
functions (exceptinit/0
) can now return{:error, :not_running}
. - Changed return types for several
Bindings
functions to accomodate new errors:Bindings.width/1
now returns{:ok, width}
instead ofwidth
.Bindings.height/1
now returns{:ok, height}
instead ofheight
.Bindings.select_input_mode/1
now returns{:ok, mode}
instead ofmode
.Bindings.select_output_mode/1
now returns{:ok, mode}
instead ofmode
.
- Replaces
Bindings.poll_event/1
withBindings.start_polling/1
. The new function polls continuously and sends each event to the subscriber. (See alsoBindings.stop_polling/0
below.) - The
EventManager
server, which manages the polling, can now crash if some other process is trying to simultaneously manage polling. It will attempt to cancel and restart polling once in order to account for the gen_server being restarted.
Bindings.stop_polling/0
provides a way to stop and later restart polling (for example if the original subscriber process passed tostart_polling/1
has died.)
- Event manager's default server
name
, which makes it possible to use the client API to call the default server without passing a pid.
- Support for sending the event manager
%Event{}
structs in addition to the tuple form that the NIF sends. This provides a convenient way to trigger events manually when testing an ex_termbox application.
- Allows passing alternate termobx bindings to
EventManager.start_link/1
, which makes it possible to test the event manager's behavior without actually calling the NIFs.
- Adds
ExTermbox.EventManager.start_link/1
which supports passing through gen_server options.
- Added
:esc_with_mouse
and:alt_with_mouse
input mode constants. - Updated documentation and tests for constants.
- Click handling in event viewer demo.
- Updated package paths for c_src.
- Updated termbox to v1.1.2.
char
field on%Cell{}
struct was renamed toch
for consistency.
- ExTermbox no longer includes a renderer or rendering DSL. Extracted to https://github.com/ndreynolds/ratatouille