Commit Graph

1063 Commits

Author SHA1 Message Date
nick black
4297bbb3dc
notcurses-input: hook up ^L #493 2020-04-16 06:34:16 -04:00
nick black
1a4c8bbf85
notcurses-input: flip for ncpp::render inversion 2020-04-16 05:55:31 -04:00
nick black
8f6d5cacf5 notcurses-view: match Notcurses::render inversion #489 2020-04-16 05:19:55 -04:00
nick black
5c22351652 ncreel: update for ncpp render inversion 2020-04-16 05:19:49 -04:00
nick black
e27895ef2e Optimized general cursor moves #483 2020-04-16 00:35:47 -04:00
nick black
355ea6d3d7
Allow EGCpools up to 1GB #425 2020-04-15 23:49:10 -04:00
nick black
c6aa99afba eliminate infinite loop in mathtext PoC 2020-04-15 16:53:56 -04:00
nick black
f356af418b
Scrolling: cell_release() cleared rows #482 2020-04-15 16:46:15 -04:00
nick black
a4e1d68786
Add ExhaustPool unit test #482 2020-04-15 16:36:17 -04:00
nick black
3ddb1d3166
EGCPool: early realloc failure is not a hard fail
We do proactive reallocations of the EGCPool once we get
to 90% capacity, to avoid expensive exhaustive searches. When
we're over half the maximum size, though, this will fail. We
shouldn't treat that as a hard failure, but instead proceed on
to the search. This lets us hit the full 32MB EGCPool size #486.
2020-04-15 16:33:22 -04:00
nick black
08e769f989
rasterize: don't emit 0-byte write()s #482 2020-04-15 13:27:15 -04:00
nick black
ffdee735cb
Tetris: update to reflect ncpp render() return value inversion #484 2020-04-15 12:49:37 -04:00
Marek Habersack
64eeb95f1e [C++] Optionally enable throwing exceptions on errors
Nick prefers error handling based on exceptions in all cases, while I
prefer to save exception handling for truly exceptional situations -
function parameter validation and class constructor. However, there's no
need to not support both approaches, to be chosen at the discretion of
the developer.

NCPP follows RAII and all classes throw exceptions from their
constructors in case they cannot initialize properly. Likewise,
functions taking pointers that are required validate them and throw
exceptions whenever the requirement isn't met.

This commit goes one step further in that it enables optional validation
of notcurses function return values and throwing an
exception (`ncpp::call_error`) should the function signal an error. This
is disabled by default but it can be enabled by defining the
`NCPP_EXCEPTIONS_PLEASE` macro (preferably on the command line or
before *each* inclusion of any NCPP headers).

Out of necessity, this breaks the ABI (plus I found a handful of minor
issues in the code), but I think it's worth having this support in
place.
2020-04-15 12:10:14 -04:00
nick black
a5a2b5646a add PoC scroller #443 2020-04-15 11:37:57 -04:00
nick black
327c9cba78 Scrolling! all unit tests work #443 2020-04-15 11:37:57 -04:00
nick black
b385feef8f zero out newly-scrolled lines #443 2020-04-15 11:37:57 -04:00
nick black
646bcf3db2 finish out ScrollingOffBottom test #443 2020-04-15 11:37:57 -04:00
nick black
40067c0ccd interpret logical plane line via scrolled_row() #443 2020-04-15 11:37:57 -04:00
nick black
a7d9220f21 cell_load(): recycle when possible #473 2020-04-14 10:07:33 -04:00
nick black
45b821645a Only left sides of wide glyphs are 2 columns
At various places in rendering and rasterizing, we advance two
columns upon encountering a wide glyph. When dealing with a
single plane, this is always correct, because we're always
hitting the first column of the multicolumn glyph. Once multiple
planes are brought into play, though, we can very much hit the
second column of said glyph, in which case we mustn't advance
two columns, but only one. Resolves #474 by way of #475. w00t!
2020-04-14 05:17:16 -04:00
nick black
c934c7be49
colons in output 2020-04-13 20:43:09 -04:00
nick black
bd08712a0e
highcon: hoist out loop for great speedup #468 2020-04-13 18:39:25 -04:00
nick black
14184e8dbb
summary: use colons rather than slashes for emit:elide 2020-04-13 18:30:20 -04:00
nick black
b0fc654444 Check that cell is not wide right in render #362 2020-04-12 07:07:02 -04:00
nick black
b0aa6b9a7f simplify wide handling in putc_yx #362 2020-04-12 07:07:02 -04:00
Marek Habersack
28976dfef2 [C++] Sync API changes
Been a while, but here goes, sync to the latest API changes.

Added:

  * Direct:   cursor_{up,left,right,down} (`ncdirect_cursor_{up,left,right,down}`)
  * Plane: constructors to use `ncplane_bound`
  * Plane: reparent (`ncplane_reparent`)
  * Plot: definition of `default_options`

Changed:

  * Plane (breaking): the `*gradient*` functions now return `int`
  * Plane (breaking): `polyfill` returns `int`
  * Plane (breaking): `stain` returns `int`
  * Plane (breaking): `blit_bgrx` takes `const void*` for `data`
  * Plane (breaking): `blit_rgba` takes `const void*` for `data`
  * Plot: `plot_optons` -> `ncplot_options`
  * Plot (breaking): `{add,set}_sample` now return `bool`
2020-04-11 20:44:25 -04:00
nick black
33e4341a67 tetris: use background from installed path #466 2020-04-10 18:05:19 -04:00
nick black
f9c85442cd
poc sgr: purge unused variable 2020-04-10 13:00:53 -04:00
nick black
1d0e2d6fd6
pocs (selector/multiselec) kill unused label 2020-04-10 13:00:12 -04:00
nick black
1ccfd9b962
menu poc: remove unused variable 2020-04-10 12:58:48 -04:00
nick black
7d80e81a27
geom: remove unused variables 2020-04-10 12:58:04 -04:00
nick black
be2be9442a
better colors on notcurses-input plot 2020-04-08 21:32:41 -04:00
nick black
f08bbf83a7
notcurses-input: join ticker thread on exit 2020-04-08 21:29:24 -04:00
nick black
b04a37c433
plots: always start from the right #457 2020-04-08 21:26:15 -04:00
nick black
cfdd8c4c5c
plot: remove unused windowbase field 2020-04-08 18:32:36 -04:00
nick black
bdfcdf4086
get pydemo working again #459 2020-04-08 14:37:10 -04:00
nick black
cb7e844db1 unify notcurses-input+notcurses-keyplot #455 2020-04-08 09:39:10 -04:00
nick black
2c2da61c72
ncdirect: add relative move functions #419 2020-04-08 09:07:49 -04:00
nick black
3649cd1a92
notcurses_resize(): fix bug, reclaim 10% perf loss 2020-04-08 08:14:15 -04:00
nick black
a7e6e83711
notcurses_resize(): purge from public API #367 2020-04-08 07:38:42 -04:00
nick black
78142bcddc Tetris: import version.h for USE_FFMPEG 2020-04-08 05:54:03 -04:00
nick black
a54cc6c85f fix rgbbg PoC for scrolling era 2020-04-08 05:48:51 -04:00
Nick Black
c2a645e9af
Rust wrapper work (#454)
* packaging: s/libtinfo/Terminfo/g
* rust: add stddim_yx()
* rust: check for valid init in unit tests
* rust: serialize up tests
* constify notcurses_term_dim_yx()
* rust: add dim wrappers
* remove notcurses_resize() from public API #367
* call notcurses_resize() from notcurses_refresh() #367
2020-04-08 05:39:41 -04:00
Nick Black
d66549d362
Prep for Fedora packaging (#452)
* jungle demo should be available outside of DFSG builds
* libav: blitters don't need FFMpeg
* CMake: threads independent of ffmpeg
* CMake: add USE_TESTS option to disable tests #450
* tetris: work without ffmpeg
* fedora: flesh out specfile #328
* menu poc: don't use ffmpeg at all
* compile PoCs with binary/include
* multiselect PoC: work without ffmpeg
2020-04-08 02:12:46 -04:00
nick black
fffc1ee850
Extract colloquy; it's gone to its new home #320 2020-04-08 00:12:35 -04:00
nick black
312d15d0f9
mathtext poc: enable scrolling 2020-04-07 16:20:08 -04:00
nick black
2852ff736c
tetris: factor out MoveLateral() 2020-04-07 16:00:32 -04:00
nick black
c38981ee59
ncplot work #445 #448
Tighten up interval arithmetic. Render the plot immediately upon
creation so that the labels are visible. Properly perform domain
detection on miny by initializing it to 2^64-1. Handle plotting
when miny > maxy, as it now will be upon creation when using
domain detection (#448). Add spaces as the first element of each
glyph cycle (#445).
2020-04-06 03:32:40 -04:00
nick black
0a8e5ef70d
notcurses_keyplot: error out on null ncplot 2020-04-06 02:59:35 -04:00
nick black
77dd998b05
ncplot uses exclusively non-negative samples #447 2020-04-06 02:39:56 -04:00
nick black
85c568b3a4
ncplot: redraw upon creation so axis labels are visible 2020-04-06 02:20:21 -04:00
nick black
5c44416426
export ncplane_putstr_yx() as static inline 2020-04-06 01:15:20 -04:00
nick black
4a6ab358ba inline ncplane_putsimple_yx() 2020-04-05 23:54:38 -04:00
nick black
37b4d96794 whiteout: update for scrolling semantics #323 2020-04-05 23:54:38 -04:00
nick black
dc14483878 implement scrolling #323 2020-04-05 23:54:38 -04:00
nick black
6138ff2832 xray: fix up for scrolling 2020-04-05 23:54:38 -04:00
nick black
0ee1779e82 ncplane_putstr_yx(): kill useless cell prep and FIXME 2020-04-05 23:54:38 -04:00
nick black
b3710bd87e drop _locked() from ncplane_cursor_move_yx() 2020-04-05 23:54:38 -04:00
nick black
0ddb3c0002 implement ncplane_set_scrolling() #323 2020-04-05 23:54:38 -04:00
nick black
df3dc6b5bc
prep for 1.2.5 2020-04-04 18:49:16 -04:00
nick black
4917603478
ncplot: swap NCPLOT_2x1 and NCPLOT_1x1x4 2020-04-04 13:00:27 -04:00
nick black
3e202d6fa6 label dependent axis when requested #438 2020-04-04 12:32:19 -04:00
nick black
dfd54f540a keyplot: ticker thead so we needn't provide input 2020-04-04 12:32:19 -04:00
nick black
d30858e60d tetris: factor out MAX_LEVEL 2020-04-04 12:32:19 -04:00
nick black
8214665b7e keyplot: only show yaxis labels on one plot #438 2020-04-04 12:32:19 -04:00
nick black
c022800295 plot: fix up slotcount vis-a-vis rangex #438 2020-04-04 12:32:19 -04:00
nick black
c6cfafc2fc hrmmm 2020-04-04 12:32:19 -04:00
nick black
2a7ccffec6 ncplot: add labelaxisd, use it in keyplot #438 2020-04-04 12:32:19 -04:00
nick black
c0f8d9b444
eliminate detectdomain, infer it from maxy==miny #439 2020-04-04 08:56:31 -04:00
nick black
d2365b9f18 notcurses-keyplot: use full length of plane #436 2020-04-04 08:30:49 -04:00
nick black
119795dc0e
colloquy: use proper ident name in rust 2020-04-04 04:36:44 -04:00
nick black
5994eee711
colloquy: block on input before exiting #320 2020-04-04 04:35:34 -04:00
David Cantrell
299a39def6 demo.c needs errno.h 2020-04-03 23:51:29 -04:00
nick black
1c75ac5bd3 plot: implement minchannel with ncplane_stain() #136 2020-04-03 08:27:08 -04:00
nick black
8f65958a53 plot: use at least maxchannel #136 2020-04-03 08:27:08 -04:00
nick black
68b4ba1706 plots: implement remaining vertical grid types #136 2020-04-03 08:27:08 -04:00
nick black
5f3eb3dc24 keyplot: add third plot, this one with half blocks #433 2020-04-03 08:27:08 -04:00
nick black
42eb18893e plots: multiple rows #136 2020-04-03 08:27:08 -04:00
nick black
6b74ea7718 plot: fix off-by-one on wide window shift, asdd unit test 2020-04-03 08:27:08 -04:00
nick black
8a23124c4a plots: implement basic redraw_plot() #136 2020-04-03 05:51:02 -04:00
nick black
f1f94deda8 keyplot: input loop #430 2020-04-03 05:51:02 -04:00
nick black
a3f7dd486b plot: AugmentSample5 test case 2020-04-03 05:51:02 -04:00
nick black
e8a4badf8b plots: implement update_sample() 2020-04-03 05:51:02 -04:00
nick black
5bccf6b446 ncplot: implement x windowing #430 2020-04-03 05:51:02 -04:00
nick black
b3cda0d09f notcurses-keyplot: throw a perimeter around base plane 2020-04-03 05:51:02 -04:00
nick black
d2fe768c30 plot unit tests #430 2020-04-03 05:51:02 -04:00
nick black
359303ed83 notcurses-keyplot: read input 2020-04-03 05:51:02 -04:00
nick black
4926186b5a ncplot: check input parameters for validity #430 2020-04-03 05:51:02 -04:00
nick black
a2170a4291 ncplot: add_sample(), set_sample() #430 2020-04-03 05:51:02 -04:00
nick black
b3e874a179 ncplot: fold minx, maxx into rangex 2020-04-03 05:51:02 -04:00
nick black
09d8912d4e notcurses-keyplot #430 2020-04-03 05:51:02 -04:00
nick black
5239900ac8 notcurses-input: upgrade shared_ptr to unique_ptr 2020-04-03 05:51:02 -04:00
nick black
5e27499194 add notcurses-keyplot #430 2020-04-03 05:51:02 -04:00
nick black
5aedb3491d ncplot_plane(), ncplot_destroy() 2020-04-03 05:51:02 -04:00
nick black
d1724d6183
tetris: kill unnecessary return in MoveRight() 2020-04-02 12:40:38 -04:00
nick black
ac31bf3a12
awww fuck me in the ass #429 2020-03-29 06:52:13 -04:00
nick black
a45d888601
All fill-type functions return cells changed
Fill-type functions used to return 0 for success, and -1
on failure. They now return the number of cells written
on success, similarly to ncvisual_render(). Resolves #427.
2020-03-29 05:26:56 -04:00
nick black
a3323fb22c
Enforce UTF8 where necessary in unit tests #428
Certain unit tests required UTF8 encoding on the output
terminal to work (#428). This includes anything which does
any kind of fill. Add enforce_utf8() checks to all such
tests that were missing them. Unit tests once again pass in
a pure ASCII environment.
2020-03-29 04:46:30 -04:00
nick black
bd7bf65c62
colloquy: spin up a rust notcurses instance 2020-03-28 00:11:00 -04:00
nick black
8651486ad7
Don't say DirectColor when TrueColor is meant 2020-03-27 12:58:30 -04:00