Commit Graph

2143 Commits

Author SHA1 Message Date
Marek Habersack
b5d8549bb3 [C++] Allow multiple instances of NotCurses
This is to make it possible, in the future, to create multiple instances
of `NotCurses` for multiple terminals.  The first instance of
`NotCurses` becomes the default one, so that any instances of other
classes that aren't explicitly created with a pointer to another
`NotCurses` instance still work as expected.

Note that currently trying to call `notcurses_init` twice results in the
following error for me:

    0x55555559bfc0 is already registered for signals
    Couldn't drop signals: 0x55555559bfc0 != 0x5555555b6720
    terminate called after throwing an instance of 'ncpp::init_error*'

    Program received signal SIGABRT, Aborted.

The error is signalled by `setup_signals` and the pointer shown in the
message points to the first `struct notcurses` instance created.
2020-05-26 04:34:31 -04:00
nick black
dbc20bd5c0
add man page for ncmetric(3) #631 2020-05-24 04:48:17 -04:00
Marek Habersack
e0462ed53a
[C++] Sync API changes (#633)
Added:

  * NotCurses: can_utf8 (`notcurses_canutf8`)
  * NotCurses: debug (`notcurses_debug`)
  * Plane: center_abs (`ncplane_center_abs`)
  * Plane: set_channels (`ncplane_set_channels`)
  * Plane: set_attr (`ncplane_set_attr`)
  * Reader: clear (`ncreader_clear`)

Changed:

  * USAGE.md: clarfied when C++ throws exceptions
2020-05-24 04:07:12 -04:00
nick black
e097723a63
subproc: on older linux, fall back to fork() 2020-05-24 04:00:22 -04:00
nick black
8971bda0c2 ncpp: stop() resets _instance, add unit test #538 2020-05-24 03:34:46 -04:00
nick black
8e649ebe46 ncpp: test NotCurses construction/stop 2020-05-24 03:34:46 -04:00
nick black
4347cd956a merge in master changes 2020-05-24 03:34:46 -04:00
nick black
9675ed251e
eagle demo: work with ascii mode #634 2020-05-23 22:43:08 -04:00
Marek Habersack
9ca8d9c9c6 Correctly cast ncpp::Plane to ncplane*
Fixes: https://github.com/dankamongmen/notcurses/issues/616

SIGSEGV was caused by an invalid cast.

Short explanation: PEBKAC

Long explanation: `Selector.hh`, `Plot.hh` and `MultiSelector.hh` did
not include `Plane.hh`, they merely declared `class Plane;` because
inclusion of `Plane.hh` would cause circular dependencies to appear and
the compiler would be unhappy.  On top of that, yours truly wrenched the
compiler's hands and caused it to believe that a pointer to `Plane` is
really a pointer to `ncplane*` which was quite a silly thing to do as
the compiler, not having included `Plane.hh` and thus not knowing full
definition of the type, wasn't able to look up the type cast operator in
`Plane`.

Don't abuse `reinterpret_cast`, kids!
2020-05-23 20:26:13 -04:00
nick black
698f664bd8
drone: update to new builders 2020-05-23 18:49:41 -04:00
nick black
c08c9b7f7f
v1.4.3 2020-05-22 09:18:39 -04:00
nick black
ba8d80d444
procroller: don't recurse on argv[0], whoops 2020-05-22 09:16:41 -04:00
nick black
24dae2cf15
ncmetric: tighten up PREFIXFWIDTH macros 2020-05-22 09:14:21 -04:00
nick black
bec9691999
NEWS: document *PREFIXFMT macros #630 2020-05-22 06:53:47 -04:00
nick black
cce9384ab8
ncmetric: adapt PREFIXFMT to multibyte #630 2020-05-22 06:46:23 -04:00
nick black
4e9f46e063
Correct scaling in qrcode_rows() 2020-05-22 05:50:41 -04:00
nick black
e682b4fae8
qrcode: only render sufficiently small codes #629 2020-05-22 05:46:49 -04:00
nick black
f425944bba
FreeBSD: move back to getrandom(); read_random() is kernelspace 2020-05-22 05:32:47 -04:00
nick black
2b5546fc4c
plot: make 8x1 the default glyph geometry 2020-05-22 01:47:23 -04:00
nick black
fc998510a0
CMake: only install static libs if built #625 2020-05-21 23:51:10 -04:00
nick black
00d63c0b69
add USE_STATIC option to CMake #625 2020-05-21 23:46:25 -04:00
nick black
7215bf92ad
throw somed attributes on a few functions 2020-05-21 21:10:04 -04:00
nick black
7e12436196
reader poc: fix Plane memory leak #624 2020-05-21 18:08:19 -04:00
nick black
57fb7fc96a
sgr poc: don't put critical logic in assert() #624 2020-05-21 18:03:36 -04:00
nick black
f9f76046d5
sgr poc: don't put critical logic in assert() #624 2020-05-21 18:02:53 -04:00
nick black
4ab0e67155
tetris: rely on c++ exceptions #621 2020-05-21 17:37:39 -04:00
nick black
7af027b895
ncpp unit tests: check get_instance exception #538 2020-05-20 18:36:25 -04:00
nick black
f120ab883f
tests: collapse RGB conversions into one TEST_CASE 2020-05-20 18:35:47 -04:00
nick black
07e894c40c
v1.4.2.4 2020-05-20 15:38:23 -04:00
nick black
37a4114f42
O(1) z-axis moves #623
Replace the singly-linked z-axis with a doubly-linked list,
and reimplement all z-axis moves as O(1) functions.
Eliminate ncplane_move_{above/below}_unsafe(), as there are no
longer unsafe moves.
2020-05-20 15:32:27 -04:00
nick black
a288c2e654
document all build options 2020-05-20 13:22:43 -04:00
nick black
0d696be0cc
ncpp: normalize Notcurses capitalization 2020-05-20 00:15:38 -04:00
nick black
297263b39b
Add a new C++ section to USAGE.md 2020-05-19 23:25:10 -04:00
nick black
c3bc4bb7f2
CMake: first stab at llvm-cov #620 2020-05-19 23:12:27 -04:00
nick black
2edb7fe690
handle clang11 -Wc99-designator 2020-05-19 23:01:48 -04:00
nick black
3119a87801 init_banner(): need use stdio directly for styling 2020-05-19 22:53:06 -04:00
nick black
99bd3fd597
recenter post-rotation in normal demo #617 2020-05-19 19:39:16 -04:00
nick black
bcdf513e31
direct poc: exit out on bad ncdirect_cursor_up() 2020-05-19 09:08:10 -04:00
nick black
e5b1c2cdea
view/demo/tetris: NCOPTION_INHIBIT_SETLOCALE 2020-05-19 08:52:36 -04:00
nick black
818ec25778
notcurses_stop: call del_curterm, plug memory leak 2020-05-19 08:51:09 -04:00
nick black
7f2888269f
all PoCs: use NCOPTION_INHIBIT_SETLOCALE 2020-05-19 08:44:39 -04:00
nick black
381263e9fe
Unify interrogate_terminfo() #614 2020-05-19 07:32:26 -04:00
nick black
30412d54ce
ncreel: fix up rendering, reel display #618 2020-05-19 07:02:25 -04:00
nick black
8ff3402166
move terminfo cache into its own shared struct #614 2020-05-19 05:49:49 -04:00
nick black
bd4d4ef321 import init_banner() outfactoring 2020-05-19 04:02:34 -04:00
nick black
390dc208ba freebsd: use read_random() 2020-05-19 03:37:26 -04:00
nick black
8f78a8fdc0 fade tests: don't use CLOCK_MONOTONIC_RAW 2020-05-19 03:32:09 -04:00
nick black
08190060e8 notcurses.3: update link to unicode chart 2020-05-19 02:02:02 -04:00
nick black
321908d824
ncplane_vprintf_prep(): remove dumb comment #612 2020-05-18 14:57:20 -04:00
nick black
5537692bd1
cells_rounded_box() is now exported 2020-05-17 10:36:20 -04:00