github dankamongmen/notcurses v1.4.0
v1.4.0–the saga continues! wu-tang! wu-tang!

latest releases: v3.0.9, v3.0.8, v3.0.7...
3 years ago

Almost exactly one month in development, and three weeks ahead of schedule.

release video

348 commits since 1.3.0, resolving 96 issues.

Important news (see NEWS.md):

  • ncreader and its associated functions were added. It allows free-form string input, using libreadline semantics.
  • ncplane_content() was added. It allows all non-null glyphs of a plane to be returned as a nul-terminated, heap-allocated string.
  • ncreader was added. This widget allows freeform input to be edited in a block, and collected into a string.
  • selector_options has been renamed to ncselector_options, and multiselector_options has been renamed to ncmultiselector_options. This matches the other widget option struct's nomenclature.
  • ncplane_set_channels() and ncplane_set_attr() have been added to allow ncplane attributes to be set directly and in toto.
  • NULL can now be passed as the FILE* argument to notcurses_init() and ncdirect_init(). In this case, a new FILE* will be created using /dev/tty. If the FILE* cannot be created, an error will be returned.
  • A flags field has been added to notcurses_options. This will allow new boolean options to be added in the future without resizing the structure. Define NCOPTION_INHIBIT_SETLOCALE bit. If it's not set, and the "C" or "POSIX" locale is in use, notcurses_init() will invoke setlocale(LC_ALL, "").
  • All widgets now take an ncplane* as their first argument (some took notcurses* before). All widgets' options structs now have an unsigned flags bitfield. This future-proofs the widget API, to a degree.
  • notcurses_lex_margins() has been added to lex margins expressed in either of two canonical formats. Hopefully this will lead to more programs supporting margins.
  • ncvisual_open_plane() has been renamed ncvisual_from_file(). The former has been retained as a deprecated alias. It will be removed by 1.6/2.0.
  • ncvisual_from_rgba() and ncvisual_from_bgra() have been added to support creation of ncvisuals from memory, requiring no file.
  • ncvisual_rotate() has been added, supporting rotations of arbitrary radians on ncvisual objects.
  • ncvisual_from_plane() has been added to support "promotion" of an ncplane to an ncvisual. The source plane may contain only spaces, half blocks, and full blocks. This builds atop the new function ncplane_rgba(), which makes an RGBA flat array from an ncplane.
  • The ncplane argument to ncplane_at_yx() is now const.
  • The ncdplot type has been added for plots based on doubles rather than uint64_ts. The ncplot type and all ncplot_* functions were renamed ncuplot for symmetry.
  • FFMpeg types are no longer leaked through the Notcurses API. AVERROR is no longer applicable, and ncvisual_decode() no longer returns a struct AVframe*. Instead, the nc_err_e enumeration has been introduced. Functions which once accepted a value-result AVERROR now accept a value-result nc_err_e. The relevant constants can be found in notcurses/ncerrs.h.
  • OpenImageIO 2.1+ is now supported as an experimental multimedia backend. FFmpeg remains recommended. Video support with OIIO is spotty thus far.
  • CMake no longer uses the USE_FFMPEG option. Instead, the USE_MULTIMEDIA option can be defined as ffmpeg, oiio, or none. In cmake-gui, this item will now appear as an option selector. oiio selects OpenImageIO.
  • ncdirect_cursor_push(), notcurses_cursor_pop(), and ncdirect_cursor_yx() have been added. These are not supported on all terminals. ncdirect_cursor_yx() ought be considered experimental; it must read a response from the terminal, and this can interact poorly with other uses of standard input.
  • ncplane_at_yx() and ncplane_at_cursor() have been changed to return a heap-allocated EGC, and write the attributes and channels to value-result uint32_t* and uint64_t* parameters, instead of to a cell*. This matches notcurses_at_yx(), and means they're no longer invalidated if the plane in question is destroyed. The previous functionality is available as new functions ncplane_at_yx_cell() and ncplane_at_cursor_cell().
  • ncplane_set_base() inverted its uint32_t attrword and uint64_t channels parameters, thus matching every other function with these two parameters. It moved const char* egc before either, to force a type error, as the change would otherwise be likely to go overlooked.
  • Scrolling is now completely implemented. When a plane has scrolling enabled through use of ncplane_set_scrolling(true), output past the end of the last line will now result in the top line of the plane being lost, all other lines moved up one, and the bottom line cleared.

Don't miss a new notcurses release

NewReleases is sending notifications on new releases.