Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 23 Sep 06:51
· 34 commits to main since this release

titrmlib v0.2.0

A rework of rendering and input, plus scenes, overlays, new widgets and color.

New

  • Faster screen updates: each panel keeps what was printed into it, and only cells that changed are redrawn. A typical update takes under 50 ms.
  • No lost key presses: keys are queued, and the keypad is read even while a slow frame is drawing.
  • Scenes: several full-screen layouts, one shown at a time, each with its own event handler (term_scene_new, term_scene_switch).
  • Overlays: dialogs drawn on top of a scene, which give focus back when they close (term_overlay_open, term_overlay_open_centered).
  • Widgets: new button and checkbox widgets. The text widget now scrolls and can follow new output, so it also works as a log.
  • Custom widgets: give any panel your own key handling (term_panel_set_keys) and send your own events (term_panel_send). Panels also get alignment, a focus style and an [enter]-to-submit option.
  • Color: foreground and background colors per panel (term_panel_set_colors, TERM_COLOR_*). Panels split from a colored panel start with its colors.
  • Events: new TERM_EV_CHANGE, TERM_EV_FOCUS_LOST, TERM_EV_SCENE_ENTER and TERM_EV_SCENE_LEAVE.

Breaking changes

  • Focus is now controlled by the app. term_focus_next is removed, and [vars] arrives as TERM_KEY_VARS; call term_focus yourself.
  • The log widget is removed; use a text widget with term_text_append and term_text_autoscroll.
  • term_panel_set_draw is removed. Output stays until you change it, so print when your state changes.
  • The event handler now returns bool: true if it handled the event.
  • The keypad is read with keypadc, so the CE C libraries must be on the calculator.

Using titrmlib

  1. Unzip titrmlib-v0.2.0.zip into your CEdev project's lib/ folder, giving lib/titrmlib/.

  2. Add its sources to your project's makefile:

    CFLAGS = -Wall -Wextra -Oz -Ilib/titrmlib/src
    EXTRA_C_SOURCES = $(wildcard lib/titrmlib/src/*.c)
  3. #include "titrm.h" and build with make.

Keep the library inside your project directory: on Windows, CEdev can't build sources reached through ... The calculator needs the CE C libraries.

API reference: https://gavinhsmith.github.io/titrmlib/