Commit Graph

673 Commits (60cce801b522de8ca705fd49f3bc8eea90e30902)

Author SHA1 Message Date
igo95862 5e60e84fdf Under ISO C the empty initializer is {0} not { } 4 years ago
nick black dcde23e74c apply htole() where needed #1130 4 years ago
nick black 4d524f92bc apply htole() in ncpixel_*() #1130 4 years ago
nick black dd8423dff3 embiggen notcurses_metric(3), add unit test #1107 4 years ago
Marek Habersack c5c9432ac0 [Misc] A hodgepodge of tiny changes
CMake:
  Simplify cmake target+version config generation and make it actually
  work.  With the changes it is now possible to detect and use
  `Notcurses` in the following way:

     find_package(Notcurses REQUIRED)
     ...
     target_link_libraries(myapp PRIVATE notcurses::notcurses)

  Also, added the same CMake configuration for `Notcurses++`, to be used
  in the following way:

     find_package(Notcurses REQUIRED
     find_package(Notcurses++ REQUIRED)
     ...
     target_link_libraries(myapp PRIVATE notcurses++::notcurses++)

Docs:
  `notcurses_cell(3)`: `cell_styles_{on,off} -> cell_{on,off}_styles`
  and `cell_load_simple` -> `cell_load_char`

C++ API:
  * Plane: added constructors taking `ncplane_options const&` instead of
    the multitude of individual parameters
  * Plane: drop `struct` when `ncplane_options` is used.
  * Plane: added `strdup` (`cell_strdup`)
  * Plane: added `extract` (`cell_extract`)
4 years ago
Marek Habersack c063ce4e36 [C++] API sync
Added:

  * Pile: new class derived from Plane, which implements all the
    `ncpile_*` calls
  * Plane: `get_parent` (`ncplane_parent`)
  * Plane: protected constructor for use by `Pile` (or other derived
    classes which cannot provide a valid `ncplane*` when invoking parent
    constructor.
  * Plane: `set_plane` for use by the derived classes above.

Changed:

  * Plane: `to_ncplane` is a `const` method now.
4 years ago
nick black b7ea4e2359
run sgr-full and sgr-direct in test suite #1138 4 years ago
nick black ebc80915a3 c++/rust struck #1138 4 years ago
nick black fe164b6210 add NCSTYLE_STRUCK #1138 4 years ago
nick black fd97aa844c implement ncpile_{render, rasterize}() 🦀🦀 #1135 4 years ago
nick black 8f7fa9da44 move postpaint() out of render step #1135 4 years ago
nick black b2516d8534 Declare ncpile_render() and ncpile_rasterize() #1135 4 years ago
nick black 0485c6f35d
fix tiny memory leak in ncplane_at_cursor_cell() 4 years ago
nick black b6e5b60374 ncpile_create() not NCPLANE_OPTION_NEWPILE #1078 4 years ago
nick black 3ad9a40426 hook up piles #1078 4 years ago
nick black b747af2ae8 drop NCPLANE_OPTION_NEWPILE #1078 4 years ago
nick black ee83b63107 c++: add Plane::reparent_family() #1078 4 years ago
nick black 0da6a8c44b add NCPLANE_OPTION_NEWPILE #1078 4 years ago
Marek Habersack c8eb3875ff [C++] API sync
Added:
 * NotCurses: `stats_alloc` (`notcurses_stats_alloc`)
 * Plane: `set_resizecb` (`ncplane_set_resizecb`)
4 years ago
nick black 65ed8c0d86
undeprecate ncplane_new(); why break running code? 4 years ago
nick black dd1e7f3b7e
document ncplane_reparent() more completely 4 years ago
nick black 8dd8937ff3
notcurses.h: purge tildes 4 years ago
nick black c0cb5c7ff9
add ncplane_resizecb() #1124 4 years ago
nick black 6084105c68
add ncplane_set_resizecb() #1124 4 years ago
nick black eef6df8c0a death to horiz #1115 4 years ago
nick black b8dc9544cf deprecate ncplane_new() 4 years ago
nick black 886835a8b4 c++: deprecate ncplane_new() #1115 4 years ago
nick black 51d01b22c8
who knows how this happened 4 years ago
nick black 259b2b6012
make it clear that sixel is not yet supported 4 years ago
nick black 65a0059b38
plots: fix NCBLIT_3x2 for plotting #1104 4 years ago
nick black 47b62ce822
make some unsigneds explicit uint32_ts 4 years ago
nick black 4b2edf0019
ncplot: add comment regarding d vs u 4 years ago
nick black f3cd1fb755
ncinput_equal_p(): return bool, not int #1059 4 years ago
joseLuís 03d2ffffaf fix typo 4 years ago
nick black 5c8781ffbd
ncvisual: quadblitter by default for stretch, for now 4 years ago
nick black 78e5ac670d
default to NCBLIT_3x2, unify NCBLIT_DEFAULT selection #1088 4 years ago
nick black e12cfe947b
ncpixel_set_g/ncpixel_set_b: correct #1080 4 years ago
nick black 515aa881cc
ncpixel_b/ncpixel_g: fix for RGBA 4 years ago
nick black 210991991f blitters: drop bgr switch-hitting, rely on input swap 4 years ago
nick black 5647864745 update USAGE for new-skool blitter defs 4 years ago
nick black 8d66938a0e sexblitter: purge NCBLIT_1x1x4, add NCBLIT_3x2 #1071 4 years ago
nick black 0c0404ec51
clarify DFSG for notcurses-demo.1 4 years ago
nick black 1609b00b77 C++ decode_loop() #1066 4 years ago
nick black b35c680f48 add LoopVideo unit test #1066 4 years ago
nick black 8919d6fe70 ncvisual_rewind 4 years ago
nick black 19efd2c10a declare ncdirect_printf_aligned() in man page + python #1074 4 years ago
nick black 0b825c619e
add notcurses_stddim_yx_const() 4 years ago
nick black e6bc09084c
notcurses_align: return error on negative column count 4 years ago
nick black f4b051f6ed
add NCKEY_SPACE 4 years ago
nick black e885d87d1a introduce NCKEY_ESC, use it everywhere 4 years ago
nick black 3229fa53b3
add ncinput_equal_p() predicate #1059 4 years ago
nick black 6623fc92a0
ncmenu_item_set_status: man page, NEWS, python, c++ #1057 4 years ago
nick black be2bba7be2 implement ncmenu_item_set_status #1057 4 years ago
nick black a44090a7f7
s/notcurses/Notcurses/g 4 years ago
nick black be0136874f rename Plane::putwc -> Plane::putwch to not conflict with stdlib macro #1046 4 years ago
nick black d101d2d2d9 add ncdirect_init() inhibit cbreak flag #1049 4 years ago
nick black fa92e0ffe8
purge stray #undef #1046 4 years ago
nick black c6c157a5ad
notcurses_stats_alloc() everywhere 4 years ago
nick black 0a3f697bc7
c++ ncplane: braces around initializer 4 years ago
nick black f9e2c7863b
add notcurses_stats_alloc #1043 4 years ago
nick black 270b1b20ee implement notcurses_render_to_buffer() #214 4 years ago
nick black b4f1065f69 declare notcurses_render_to_buffer() #214 4 years ago
nick black 29c7f960cc add writeout_ stats, document stats #1039 4 years ago
Marek Habersack a29bfe9c42 [C++] Deal with widgets grabbing full ownership of Panel
Fixes: https://github.com/dankamongmen/notcurses/issues/1009

Whenever a widget is created with its `*_create` function it currently
claims full ownership of the passed panel, including its destruction.
However, the C++ wrapper around the panel is not aware of this and will
attempt to destroy the native panel in the destructor, leading to
segfaults.

Fix this by introduction of a `Widget` class which contains the logic to
properly modify the `Panel` instance to not double-destroy the native
panel.  The solution is a bit fragile since the `Panel` instance is left
intact (we can't free it for the user) in a state that's safe for the
C++ wrapper, but calling any C function via the wrapper **will** pass a
`NULL` pointer in the panel argument - therefore the C functions MUST be
proofed against this.  The proofing belongs in the C backend code since
this protects also C and other language binding users from such abuse.

The Widget class will first verify that the passed `Plane` instance
hasn't already been "disowned" and will throw an exception to the effect
if it was.  Next, it will proceed to take over ownership of the native
panel instance and mark the passed `Panel` as "invalid" (i.e. not owning
any native panel instance anymore)

The above changes require modification of `Panel` instances and so all
the widget constructors taking `const*` or `const&` have been removed
from widget classes.
4 years ago
nick black 683217ef07 normalize style setters #1034 4 years ago
nick black 174a00b56c
add deprecated nctablet_ncplane() for old binaries 4 years ago
nick black 6ddf105746
uninline ncplane_new() so older binaries continue to link 4 years ago
nick black c236b65266 name standard plane 'std' 4 years ago
nick black a591e11c96 retain nctablet_ncplane() as deprecated alias 4 years ago
nick black afd444cea3
kill stray decl ncdirect_getc_nonblocking() #1028 4 years ago
nick black 20bf1ae2d4
nctablet_ncplane() -> nctablet_plane() 4 years ago
nick black ec85dd1c3b
ncreel_destroy: return void 4 years ago
Marek Habersack 943e23535f [C++] API sync
Fixes: https://github.com/dankamongmen/notcurses/issues/1025

Added:
  * Direct: flush (`ncdirect_flush`)
  * Direct: getc (`ncdirect_getc_blocking` and `ncdirect_getc_nblock`)
  * Direct: getc (`ncdirect_getc`)
  * Direct: get_inputready_fd (`ncdirect_inputready_fd`)
  * NotCurses: align (`notcurses_align`)
  * NotCurses: ucs32_to_utf8 (`notcurses_ucs32_to_utf8`)
  * NotCurses: get_bottom (`notcurses_bottom`)
  * Plane: resize_realign (`ncplane_resize_realign`)
  * Plane: get_x (`ncplane_x`)
  * Plane: get_y (`ncplane_y`)
  * Plane: mergedown (`ncplane_mergedown`)
  * Plane: putwc_stained (`ncplane_putwc_stained`)
  * Plane: putstr_stained (`ncplane_putstr_stained`)
  * Plane: set_fchannel (`ncplane_set_fchannel`)
  * Plane: set_bchannel (`ncplane_set_bchannel`)
  * Plane: get_styles (`ncplane_styles`)
  * Plane: get_above (`ncplane_above`)
  * Reader: move_left (`ncreader_move_left`)
  * Reader: move_right (`ncreader_move_right`)
  * Reader: move_up (`ncreader_move_up`)
  * Reader: move_down (`ncreader_move_down`)
  * Reader: write_egc (`ncreader_write_egc`)
  * Visual: get_default_blitter (`ncvisual_default_blitter`)

Fixed:
  * NotCurses: `cursor_{enable,disable}` must use `NOEXCEPT_MAYBE`
  * Plane: renamed `putcw` to `putwc`
4 years ago
nick black 2f26f06386
alignment: add NCALIGN_UNALIGNED, preserve align type #364 4 years ago
nick black 2d9598b913
introduce ncplane_resize_realign #364 4 years ago
nick black 7b51bab79a add resizecb to ncplane_options struct #869 4 years ago
nick black 73f9973a2c Plane.hh: fix up indentation #1020 4 years ago
nick black 36aed3c521 add ncplane_create() + ncplane_options #1020 4 years ago
nick black 607c03edc4
rename _rgb_clipped functions rgb8_clipped 4 years ago
nick black a4367fcfb5 rip out ncplane_ creation functions #985 4 years ago
nick black e42dbdfd60 _stainable() -> _stained() #985 4 years ago
nick black c5c608b22e add ncplane_putwc_stainable, ncplane_putwstr_stainable #985 4 years ago
nick black b7a57eaab7 convert all channel rgb calls #985 4 years ago
nick black 0e34bec3fb start converting rgb->rgb8 #985 4 years ago
nick black 4bb1f3fc85 mbswidth -> ncstrwidth() #985 4 years ago
nick black dab7247cdd
mbswidth: use utf8_egc_len() for segmentation #1014 4 years ago
nick black dca9db9687
ncreel: conform to the New Way #627 4 years ago
nick black c3e5e47a2a
ncreader: conform to the New Way #627 4 years ago
nick black 4f04f1bc31 remove bgchannels field from selector_options #627 4 years ago
nick black 306948507f ncmultiselect: normalize per new widget API #627 #1006 4 years ago
nick black 8839d44454 selector: transfer ownership of ncplane #1006 #627 4 years ago
nick black a801f975a6
all widget creators get attribute ((nonnull)) #627 4 years ago
nick black 3f726edd4c
all widgets check flags and warn on undefined #627 4 years ago
nick black 89a4b6f726
all widget options structs end in flagword #627 4 years ago
nick black af05ae7a92 man pages: document NCREADER_OPTION_CURSOR 4 years ago
nick black f88c8ae79c
expose ncvisual_default_blitter(), name blitter in notcurses-view #995 4 years ago
nick black 3afcfc97d6
ncreader: define NCREADER_OPTIONS_EMACSKEYS 4 years ago
nick black 2f28420034 rename ncplane_putsimple() -> ncplane_putchar() #912 4 years ago
nick black 4c7a1d0427 ncdirect_init: add flags parameter #976 4 years ago
nick black 5fc6705ce3
add notcurses_ucs32_to_utf8() 4 years ago