Notcurses 3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
Plane.hh
Go to the documentation of this file.
1#ifndef __NCPP_PLANE_HH
2#define __NCPP_PLANE_HH
3
4#include <exception>
5#include <cstdarg>
6#include <ctime>
7#include <map>
8#include <mutex>
10
11#include "Root.hh"
12#include "Cell.hh"
13#include "CellStyle.hh"
14#include "NCAlign.hh"
15#include "NCBox.hh"
16
17namespace ncpp
18{
19 class NcReel;
20
21 class NCPP_API_EXPORT Plane : public Root
22 {
23 public:
24 Plane (Plane&& other)
25 : Root (nullptr)
26 {
27 unmap_plane (&other);
28
29 plane = other.plane;
30 is_stdplane = other.is_stdplane;
31
32 map_plane (plane, this);
33
34 other.plane = nullptr;
35 other.is_stdplane = false;
36 }
37
38 Plane (Plane const& other)
39 : Root (nullptr)
40 {
41 plane = duplicate_plane (other, nullptr);
42 }
43
44 explicit Plane (Plane const& other, void *opaque)
45 : Root (nullptr)
46 {
47 plane = duplicate_plane (other, opaque);
48 }
49
50 explicit Plane (Plane *n, int rows, int cols, int yoff, int xoff, void *opaque = nullptr)
51 : Plane (static_cast<const Plane*>(n), rows, cols, yoff, xoff, opaque)
52 {}
53
54 explicit Plane (const Plane *n, int rows, int cols, int yoff, int xoff, void *opaque = nullptr)
55 : Root (nullptr)
56 {
57 if (n == nullptr)
58 throw invalid_argument ("'n' must be a valid pointer");
59
60 plane = create_plane (*n, rows, cols, yoff, xoff, opaque);
61 }
62
63 explicit Plane (Plane *n, ncplane_options const& nopts, NotCurses *ncinst = nullptr)
64 : Plane (static_cast<const Plane*>(n), nopts, ncinst)
65 {}
66
67 explicit Plane (const Plane *n, ncplane_options const& nopts, NotCurses *ncinst = nullptr)
68 : Root (ncinst)
69 {
70 if (n == nullptr) {
71 throw invalid_argument ("'n' must be a valid pointer");
72 }
73
74 plane = create_plane (*n, nopts);
75 }
76
77 explicit Plane (const Plane &n, int rows, int cols, int yoff, int xoff, void *opaque = nullptr)
78 : Root (nullptr)
79 {
80 plane = create_plane (n, rows, cols, yoff, xoff, opaque);
81 }
82
83 explicit Plane (unsigned rows, unsigned cols, int yoff, int xoff, void *opaque = nullptr, NotCurses *ncinst = nullptr)
84 : Root (ncinst)
85 {
86 ncplane_options nopts = {
87 .y = yoff,
88 .x = xoff,
89 .rows = rows,
90 .cols = cols,
91 .userptr = opaque,
92 .name = nullptr,
93 .resizecb = nullptr,
94 .flags = 0,
95 .margin_b = 0,
96 .margin_r = 0,
97 };
98 plane = ncplane_create (
99 notcurses_stdplane(get_notcurses ()),
100 &nopts
101 );
102
103 if (plane == nullptr)
104 throw init_error ("Notcurses failed to create a new plane");
105
106 map_plane (plane, this);
107 }
108
109 explicit Plane (Plane &n, int rows, int cols, int yoff, NCAlign align, void *opaque = nullptr)
110 : Root (nullptr)
111 {
112 plane = create_plane (n, rows, cols, yoff, align, opaque);
113 }
114
115 explicit Plane (Plane const& n, int rows, int cols, int yoff, NCAlign align, void *opaque = nullptr)
116 : Root (nullptr)
117 {
118 plane = create_plane (const_cast<Plane&>(n), rows, cols, yoff, align, opaque);
119 }
120
121 explicit Plane (Plane &n, ncplane_options const& nopts, NotCurses *ncinst = nullptr)
122 : Plane (static_cast<Plane const&>(n), nopts, ncinst)
123 {}
124
125 explicit Plane (Plane const& n, ncplane_options const& nopts, NotCurses *ncinst = nullptr)
126 : Root (ncinst)
127 {
128 plane = create_plane (n, nopts);
129 }
130
131 explicit Plane (Plane *n, int rows, int cols, int yoff, NCAlign align, void *opaque = nullptr)
132 : Root (nullptr)
133 {
134 if (n == nullptr)
135 throw invalid_argument ("'n' must be a valid pointer");
136
137 plane = create_plane (*n, rows, cols, yoff, align, opaque);
138 }
139
140 explicit Plane (Plane const* n, int rows, int cols, int yoff, NCAlign align, void *opaque = nullptr)
141 : Root (nullptr)
142 {
143 if (n == nullptr)
144 throw invalid_argument ("'n' must be a valid pointer");
145
146 plane = create_plane (const_cast<Plane&>(*n), rows, cols, yoff, align, opaque);
147 }
148
149 explicit Plane (ncplane *_plane) noexcept
150 : Root (nullptr),
151 plane (_plane)
152 {}
153
154 ~Plane () noexcept
155 {
156 if (is_stdplane || plane == nullptr)
157 return;
158
159 if (!is_notcurses_stopped ())
160 ncplane_destroy (plane);
161 unmap_plane (this);
162 }
163
164 operator ncplane* () noexcept
165 {
166 return plane;
167 }
168
169 operator ncplane const* () const noexcept
170 {
171 return plane;
172 }
173
174 void center_abs (int *y, int *x) const noexcept
175 {
176 ncplane_center_abs (plane, y, x);
177 }
178
179 ncplane* to_ncplane () const noexcept
180 {
181 return plane;
182 }
183
185 {
186 return error_guard (ncplane_resize_maximize (plane), -1);
187 }
188
190 {
191 return error_guard (ncplane_resize_realign (plane), -1);
192 }
193
194 bool resize (int keepy, int keepx, int keepleny, int keeplenx, int yoff, int xoff, int ylen, int xlen) const NOEXCEPT_MAYBE
195 {
196 int ret = ncplane_resize (
197 plane,
198 keepy,
199 keepx,
200 keepleny,
201 keeplenx,
202 yoff,
203 xoff,
204 ylen,
205 xlen
206 );
207
208 return error_guard (ret, -1);
209 }
210
211 bool pulse (const timespec* ts, fadecb fader, void* curry) const NOEXCEPT_MAYBE
212 {
213 return error_guard (ncplane_pulse (plane, ts, fader, curry), -1);
214 }
215
216 int gradient (int y, int x, unsigned ylen, unsigned xlen, const char* egc, uint16_t stylemask, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr) const NOEXCEPT_MAYBE
217 {
218 return error_guard<int> (ncplane_gradient (plane, y, x, ylen, xlen, egc, stylemask, ul, ur, ll, lr), -1);
219 }
220
221 int gradient2x1 (int y, int x, unsigned ylen, unsigned xlen, uint32_t ul, uint32_t ur, uint32_t ll, uint32_t lr) const NOEXCEPT_MAYBE
222 {
223 return error_guard<int> (ncplane_gradient2x1 (plane, y, x, ylen, xlen, ul, ur, ll, lr), -1);
224 }
225
226 void greyscale () const noexcept
227 {
228 ncplane_greyscale (plane);
229 }
230
231 bool resize (int ylen, int xlen) const NOEXCEPT_MAYBE
232 {
233 return error_guard (ncplane_resize_simple (plane, ylen, xlen), -1);
234 }
235
236 bool fadeout (timespec *ts, fadecb fader = nullptr, void *curry = nullptr) const NOEXCEPT_MAYBE
237 {
238 return fadeout (static_cast<const timespec*>(ts), fader, curry);
239 }
240
241 bool fadeout (timespec &ts, fadecb fader = nullptr, void *curry = nullptr) const NOEXCEPT_MAYBE
242 {
243 return fadeout (&ts, fader, curry);
244 }
245
246 bool fadeout (timespec const& ts, fadecb fader = nullptr, void *curry = nullptr) const NOEXCEPT_MAYBE
247 {
248 return fadeout (&ts, fader, curry);
249 }
250
251 bool fadeout (const timespec *ts, fadecb fader = nullptr, void *curry = nullptr) const NOEXCEPT_MAYBE
252 {
253 return error_guard (ncplane_fadeout (plane, ts, fader, curry), -1);
254 }
255
256 bool fadein (timespec *ts, fadecb fader = nullptr) const NOEXCEPT_MAYBE
257 {
258 return fadein (static_cast<const timespec*>(ts), fader);
259 }
260
261 bool fadein (timespec &ts, fadecb fader = nullptr) const NOEXCEPT_MAYBE
262 {
263 return fadein (&ts, fader);
264 }
265
266 bool fadein (timespec const& ts, fadecb fader = nullptr) const NOEXCEPT_MAYBE
267 {
268 return fadein (&ts, fader);
269 }
270
271 bool fadein (const timespec *ts, fadecb fader = nullptr, void *curry = nullptr) const NOEXCEPT_MAYBE
272 {
273 return error_guard (ncplane_fadein (plane, ts, fader, curry), -1);
274 }
275
276 void erase () const noexcept
277 {
278 ncplane_erase (plane);
279 }
280
281 int get_abs_x () const noexcept
282 {
283 return ncplane_abs_x (plane);
284 }
285
286 int get_abs_y () const noexcept
287 {
288 return ncplane_abs_y (plane);
289 }
290
291 int get_x () const noexcept
292 {
293 return ncplane_x (plane);
294 }
295
296 int get_y () const noexcept
297 {
298 return ncplane_y (plane);
299 }
300
301 int get_align (NCAlign align, int c) const NOEXCEPT_MAYBE
302 {
303 return error_guard<int> (ncplane_halign (plane, static_cast<ncalign_e>(align), c), INT_MAX);
304 }
305
306 int get_halign (NCAlign align, int c) const NOEXCEPT_MAYBE
307 {
308 return error_guard<int> (ncplane_halign (plane, static_cast<ncalign_e>(align), c), INT_MAX);
309 }
310
311 int get_valign (NCAlign align, int r) const NOEXCEPT_MAYBE
312 {
313 return error_guard<int> (ncplane_valign (plane, static_cast<ncalign_e>(align), r), INT_MAX);
314 }
315
316 void get_dim (unsigned *rows, unsigned *cols) const noexcept
317 {
318 ncplane_dim_yx (plane, rows, cols);
319 }
320
321 void get_dim (unsigned &rows, unsigned &cols) const noexcept
322 {
323 get_dim (&rows, &cols);
324 }
325
326 unsigned get_dim_x () const noexcept
327 {
328 return ncplane_dim_x (plane);
329 }
330
331 unsigned get_dim_y () const noexcept
332 {
333 return ncplane_dim_y (plane);
334 }
335
336 void get_abs_yx (int* y, int* x) const noexcept
337 {
338 ncplane_abs_yx (plane, y, x);
339 }
340
341 void get_yx (int *y, int *x) const noexcept
342 {
343 ncplane_yx (plane, y, x);
344 }
345
346 void get_yx (int &y, int &x) const noexcept
347 {
348 get_yx (&y, &x);
349 }
350
351 Plane* get_parent () const noexcept
352 {
353 ncplane *ret = ncplane_parent (plane);
354 if (ret == nullptr) {
355 return nullptr;
356 }
357
358 return map_plane (ret);
359 }
360
361 Plane* reparent (Plane *newparent = nullptr) const noexcept
362 {
363 ncplane *ret = ncplane_reparent (plane, newparent == nullptr ? plane : newparent->plane);
364 if (ret == nullptr)
365 return nullptr;
366
367 return map_plane (ret);
368 }
369
370 Plane* reparent (const Plane *newparent) const noexcept
371 {
372 return reparent (const_cast<Plane*>(newparent));
373 }
374
375 Plane* reparent (const Plane &newparent) const noexcept
376 {
377 return reparent (const_cast<Plane*>(&newparent));
378 }
379
380 Plane* reparent_family (Plane *newparent = nullptr) const noexcept
381 {
382 ncplane *ret = ncplane_reparent_family (plane, newparent == nullptr ? plane : newparent->plane);
383 if (ret == nullptr)
384 return nullptr;
385
386 return map_plane (ret);
387 }
388
389 Plane* reparent_family (const Plane *newparent) const noexcept
390 {
391 return reparent_family (const_cast<Plane*>(newparent));
392 }
393
394 Plane* reparent_family (const Plane &newparent) const noexcept
395 {
396 return reparent_family (const_cast<Plane*>(&newparent));
397 }
398
399 void home () const noexcept
400 {
401 ncplane_home (plane);
402 }
403
404 bool move (int y, int x) const NOEXCEPT_MAYBE
405 {
406 return error_guard (ncplane_move_yx (plane, y, x), -1);
407 }
408
409 void move_top () noexcept
410 {
411 ncplane_move_top (plane);
412 }
413
414 void move_bottom () noexcept
415 {
416 ncplane_move_bottom (plane);
417 }
418
419 bool move_below (Plane &below) const NOEXCEPT_MAYBE
420 {
421 return error_guard (ncplane_move_below (plane, below.plane), -1);
422 }
423
424 bool move_below (Plane *below) const
425 {
426 if (below == nullptr)
427 throw invalid_argument ("'below' must be a valid pointer");
428
429 return move_below (*below);
430 }
431
432 bool move_above (Plane &above) const NOEXCEPT_MAYBE
433 {
434 return error_guard (ncplane_move_above (plane, above.plane), -1);
435 }
436
437 bool move_above (Plane *above) const
438 {
439 if (above == nullptr)
440 throw invalid_argument ("'above' must be a valid pointer");
441
442 return move_above (*above);
443 }
444
445 bool mergedown (Plane &dst, unsigned begsrcy, unsigned begsrcx, unsigned leny, unsigned lenx, unsigned dsty, unsigned dstx) const
446 {
447 return mergedown (&dst, begsrcy, begsrcx, leny, lenx, dsty, dstx);
448 }
449
450 bool mergedown (Plane *dst, int begsrcy, int begsrcx, unsigned leny, unsigned lenx, int dsty, int dstx) const
451 {
452 if (plane == dst->plane)
453 throw invalid_argument ("'dst' must refer to a different plane than the one this method is called on");
454
455 return error_guard (ncplane_mergedown (plane, dst->plane, begsrcy, begsrcx, leny, lenx, dsty, dstx), -1);
456 }
457
458 bool mergedown_simple (Plane &dst) const
459 {
460 return mergedown_simple (&dst);
461 }
462
463 bool mergedown_simple (Plane *dst) const
464 {
465 if (plane == dst->plane)
466 throw invalid_argument ("'dst' must refer to a different plane than the one this method is called on");
467
468 return error_guard (ncplane_mergedown_simple (plane, dst->plane), -1);
469 }
470
471 bool cursor_move (int y, int x) const NOEXCEPT_MAYBE
472 {
473 return error_guard (ncplane_cursor_move_yx (plane, y, x), -1);
474 }
475
476 void get_cursor_yx (unsigned *y, unsigned *x) const noexcept
477 {
478 ncplane_cursor_yx (plane, y, x);
479 }
480
481 void get_cursor_yx (unsigned &y, unsigned &x) const noexcept
482 {
483 get_cursor_yx (&y, &x);
484 }
485
486 unsigned cursor_y() const noexcept
487 {
488 return ncplane_cursor_y(plane);
489 }
490
491 unsigned cursor_x() const noexcept
492 {
493 return ncplane_cursor_x(plane);
494 }
495
496 int putc (const Cell &c) const NOEXCEPT_MAYBE
497 {
498 return error_guard<int> (ncplane_putc (plane, c), -1);
499 }
500
501 int putc (const Cell *c) const
502 {
503 if (c == nullptr)
504 throw invalid_argument ("'c' must be a valid pointer");
505
506 return putc (*c);
507 }
508
509 int putc (int y, int x, Cell const& c) const NOEXCEPT_MAYBE
510 {
511 return error_guard<int> (ncplane_putc_yx (plane, y, x, c), -1);
512 }
513
514 int putc (int y, int x, Cell const* c) const NOEXCEPT_MAYBE
515 {
516 if (c == nullptr)
517 return -1;
518
519 return putc (y, x, *c);
520 }
521
522 int putc (char c, bool retain_styling = false) const NOEXCEPT_MAYBE
523 {
524 int ret;
525 if (retain_styling) {
526 ret = ncplane_putchar_stained (plane, c);
527 } else {
528 ret = ncplane_putchar (plane, c);
529 }
530
531 return error_guard<int> (ret, -1);
532 }
533
534 int putc (int y, int x, char c) const NOEXCEPT_MAYBE
535 {
536 return error_guard<int> (ncplane_putchar_yx (plane, y, x, c), -1);
537 }
538
539 int putc (const char *gclust, size_t *sbytes = nullptr, bool retain_styling = false) const NOEXCEPT_MAYBE
540 {
541 int ret;
542 if (retain_styling) {
543 ret = ncplane_putegc_stained (plane, gclust, sbytes);
544 } else {
545 ret = ncplane_putegc (plane, gclust, sbytes);
546 }
547
548 return error_guard<int> (ret, -1);
549 }
550
551 int putc (int y, int x, const char *gclust, size_t *sbytes = nullptr) const NOEXCEPT_MAYBE
552 {
553 return error_guard<int> (ncplane_putegc_yx (plane, y, x, gclust, sbytes), -1);
554 }
555
556 int putc (const wchar_t *gclust, size_t *sbytes = nullptr, bool retain_styling = false) const NOEXCEPT_MAYBE
557 {
558 int ret;
559 if (retain_styling) {
560 ret = ncplane_putwegc_stained (plane, gclust, sbytes);
561 } else {
562 ret = ncplane_putwegc (plane, gclust, sbytes);
563 }
564
565 return error_guard<int> (ret, -1);
566 }
567
568 int putc (int y, int x, const wchar_t *gclust, size_t *sbytes = nullptr) const NOEXCEPT_MAYBE
569 {
570 return error_guard<int> (ncplane_putwegc_yx (plane, y, x, gclust, sbytes), -1);
571 }
572
573 // OK, this is ugly, but we need to rename this overload or calls similar to n->putc (0, 0, '0') will be
574 // considered ambiguous with the above `putc (int, int, char)` overload.
575 int putwch (int y, int x, wchar_t w) const NOEXCEPT_MAYBE
576 {
577 return error_guard<int> (ncplane_putwc_yx (plane, y, x, w), -1);
578 }
579
580 // Ditto
581 int putwch (wchar_t w) const NOEXCEPT_MAYBE
582 {
583 return error_guard<int> (ncplane_putwc (plane, w), -1);
584 }
585
586 int putwc_stained (wchar_t w) const NOEXCEPT_MAYBE
587 {
588 return error_guard<int> (ncplane_putwc_stained (plane, w), -1);
589 }
590
591 int putstr (const char *gclustarr) const NOEXCEPT_MAYBE
592 {
593 int ret = ncplane_putstr (plane, gclustarr);
594 return error_guard_cond<int> (ret, ret < 0);
595 }
596
597 int putstr (int y, int x, const char *gclustarr) const NOEXCEPT_MAYBE
598 {
599 int ret = ncplane_putstr_yx (plane, y, x, gclustarr);
600 return error_guard_cond<int> (ret, ret < 0);
601 }
602
603 int putstr (int y, NCAlign atype, const char *s) const NOEXCEPT_MAYBE
604 {
605 return error_guard<int> (ncplane_putstr_aligned (plane, y, static_cast<ncalign_e>(atype), s), -1);
606 }
607
608 int putstr (const wchar_t *gclustarr) const NOEXCEPT_MAYBE
609 {
610 return error_guard<int> (ncplane_putwstr (plane, gclustarr), -1);
611 }
612
613 int putstr (int y, int x, const wchar_t *gclustarr) const NOEXCEPT_MAYBE
614 {
615 return error_guard<int> (ncplane_putwstr_yx (plane, y, x, gclustarr), -1);
616 }
617
618 int putstr (int y, NCAlign atype, const wchar_t *gcluststyles) const NOEXCEPT_MAYBE
619 {
620 return error_guard<int> (ncplane_putwstr_aligned (plane, y, static_cast<ncalign_e>(atype), gcluststyles), -1);
621 }
622
623 int putstr_stained (const wchar_t* gclustarr) const NOEXCEPT_MAYBE
624 {
625 return error_guard<int> (ncplane_putwstr_stained (plane, gclustarr), -1);
626 }
627
628 int putstr_stained (const char* s) const NOEXCEPT_MAYBE
629 {
630 int ret = ncplane_putstr_stained (plane, s);
631 return error_guard_cond<int> (ret, ret < 0);
632 }
633
634 int printf_stained (const char* format, ...) const NOEXCEPT_MAYBE
635 __attribute__ ((format (printf, 2, 3)))
636 {
637 va_list va;
638
639 va_start (va, format);
640 int ret = ncplane_vprintf_stained (plane, format, va);
641 va_end (va);
642
643 return error_guard<int> (ret, -1);
644 }
645
646 int printf (const char* format, ...) const NOEXCEPT_MAYBE
647 __attribute__ ((format (printf, 2, 3)))
648 {
649 va_list va;
650
651 va_start (va, format);
652 int ret = ncplane_vprintf (plane, format, va);
653 va_end (va);
654
655 return error_guard<int> (ret, -1);
656 }
657
658 int printf (int y, int x, const char *format, ...) const NOEXCEPT_MAYBE
659 __attribute__ ((format (printf, 4, 5)))
660 {
661 va_list va;
662
663 va_start (va, format);
664 int ret = ncplane_vprintf_yx (plane, y, x, format, va);
665 va_end (va);
666
667 return error_guard<int> (ret, -1);
668 }
669
670 int printf (int y, NCAlign align, const char *format, ...) const NOEXCEPT_MAYBE
671 __attribute__ ((format (printf, 4, 5)))
672 {
673 va_list va;
674
675 va_start (va, format);
676 int ret = vprintf (y, align, format, va);
677 va_end (va);
678
679 return error_guard<int> (ret, -1);
680 }
681
682 int vprintf_stained (const char* format, va_list ap) const NOEXCEPT_MAYBE
683 {
684 return error_guard<int> (ncplane_vprintf_stained (plane, format, ap), -1);
685 }
686
687 int vprintf (const char* format, va_list ap) const NOEXCEPT_MAYBE
688 {
689 return error_guard<int> (ncplane_vprintf (plane, format, ap), -1);
690 }
691
692 int vprintf (int y, int x, const char* format, va_list ap) const NOEXCEPT_MAYBE
693 {
694 return error_guard<int> (ncplane_vprintf_yx (plane, y, x, format, ap), -1);
695 }
696
697 int vprintf (int y, NCAlign align, const char *format, va_list ap) const NOEXCEPT_MAYBE
698 {
699 return error_guard<int> (ncplane_vprintf_aligned (plane, y, static_cast<ncalign_e>(align), format, ap), -1);
700 }
701
702 int hline (const Cell &c, unsigned len) const NOEXCEPT_MAYBE
703 {
704 return error_guard<int> (ncplane_hline (plane, c, len), -1);
705 }
706
707 int hline (const Cell &c, unsigned len, uint64_t c1, uint64_t c2) const NOEXCEPT_MAYBE
708 {
709 return error_guard<int> (ncplane_hline_interp (plane, c, len, c1, c2), -1);
710 }
711
712 int vline (const Cell &c, unsigned len) const NOEXCEPT_MAYBE
713 {
714 return error_guard<int> (ncplane_vline (plane, c, len), -1);
715 }
716
717 int vline (const Cell &c, unsigned len, uint64_t c1, uint64_t c2) const NOEXCEPT_MAYBE
718 {
719 return error_guard<int> (ncplane_vline_interp (plane, c, len, c1, c2), -1);
720 }
721
722 bool load_box (uint16_t styles, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl, const char *gclusters) const NOEXCEPT_MAYBE
723 {
724 return error_guard (nccells_load_box (plane, styles, channels, ul, ur, ll, lr, hl, vl, gclusters), -1);
725 }
726
727 bool load_box (CellStyle style, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl, const char *gclusters) const NOEXCEPT_MAYBE
728 {
729 return load_box (static_cast<uint16_t>(style), channels, ul, ur, ll, lr, hl, vl, gclusters);
730 }
731
732 bool load_rounded_box (uint16_t styles, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl) const NOEXCEPT_MAYBE
733 {
734 return error_guard (nccells_rounded_box (plane, styles, channels, ul, ur, ll, lr, hl, vl), -1);
735 }
736
737 bool load_rounded_box (CellStyle style, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl) const NOEXCEPT_MAYBE
738 {
739 return load_rounded_box (static_cast<uint16_t>(style), channels, ul, ur, ll, lr, hl, vl);
740 }
741
742 bool load_double_box (uint16_t styles, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl) const NOEXCEPT_MAYBE
743 {
744 return error_guard (nccells_double_box (plane, styles, channels, ul, ur, ll, lr, hl, vl), -1);
745 }
746
747 bool load_double_box (CellStyle style, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl) const NOEXCEPT_MAYBE
748 {
749 return load_double_box (static_cast<uint16_t>(style), channels, ul, ur, ll, lr, hl, vl);
750 }
751
752 bool box (const Cell &ul, const Cell &ur, const Cell &ll, const Cell &lr,
753 const Cell &hline, const Cell &vline, int ystop, int xstop,
754 unsigned ctlword) const NOEXCEPT_MAYBE
755 {
756 return error_guard (ncplane_box (plane, ul, ur, ll, lr, hline, vline, ystop, xstop, ctlword), -1);
757 }
758
759 bool box_sized (const Cell &ul, const Cell &ur, const Cell &ll, const Cell &lr,
760 const Cell &hline, const Cell &vline, int ylen, int xlen,
761 unsigned ctlword) const NOEXCEPT_MAYBE
762 {
763 return error_guard (ncplane_box_sized (plane, ul, ur, ll, lr, hline, vline, ylen, xlen, ctlword), -1);
764 }
765
766 bool rounded_box (uint16_t styles, uint64_t channels, int ystop, int xstop, unsigned ctlword) const NOEXCEPT_MAYBE
767 {
768 return error_guard (ncplane_rounded_box (plane, styles, channels, ystop, xstop, ctlword), -1);
769 }
770
771 bool rounded_box_sized (uint16_t styles, uint64_t channels, int ylen, int xlen, unsigned ctlword) const NOEXCEPT_MAYBE
772 {
773 return error_guard (ncplane_rounded_box_sized (plane, styles, channels, ylen, xlen, ctlword), -1);
774 }
775
776 bool double_box (uint16_t styles, uint64_t channels, int ystop, int xstop, unsigned ctlword) const NOEXCEPT_MAYBE
777 {
778 return error_guard (ncplane_double_box (plane, styles, channels, ystop, xstop, ctlword), -1);
779 }
780
781 bool double_box_sized (uint16_t styles, uint64_t channels, int ylen, int xlen, unsigned ctlword) const NOEXCEPT_MAYBE
782 {
783 return error_guard (ncplane_double_box_sized (plane, styles, channels, ylen, xlen, ctlword), -1);
784 }
785
786 bool perimeter (const Cell &ul, const Cell &ur, const Cell &ll, const Cell &lr, const Cell &hline, const Cell &vline, unsigned ctlword) const NOEXCEPT_MAYBE
787 {
788 return error_guard (ncplane_perimeter (plane, ul, ur, ll, lr, hline, vline, ctlword), -1);
789 }
790
791 bool perimeter_rounded (uint16_t stylemask, uint64_t channels, unsigned ctlword) const NOEXCEPT_MAYBE
792 {
793 return error_guard (ncplane_perimeter_rounded (plane, stylemask, channels, ctlword), -1);
794 }
795
796 bool perimeter_double (uint16_t stylemask, uint64_t channels, unsigned ctlword) const NOEXCEPT_MAYBE
797 {
798 return error_guard (ncplane_perimeter_double (plane, stylemask, channels, ctlword), -1);
799 }
800
801 int polyfill (int y, int x, const Cell& c) const NOEXCEPT_MAYBE
802 {
803 return error_guard<int> (ncplane_polyfill_yx (plane, y, x, c), -1);
804 }
805
806 uint32_t* rgba(ncblitter_e blit, unsigned begy, unsigned begx, unsigned leny, unsigned lenx) const noexcept
807 {
808 return ncplane_as_rgba (plane, blit, begy, begx, leny, lenx, nullptr, nullptr);
809 }
810
811 char* content(unsigned begy, unsigned begx, unsigned leny, unsigned lenx) const noexcept
812 {
813 return ncplane_contents (plane, begy, begx, leny, lenx);
814 }
815
816 uint64_t get_channels () const noexcept
817 {
818 return ncplane_channels (plane);
819 }
820
821 unsigned get_bchannel () const noexcept
822 {
823 return ncplane_bchannel (plane);
824 }
825
826 unsigned get_fchannel () const noexcept
827 {
828 return ncplane_fchannel (plane);
829 }
830
831 unsigned get_fg_rgb () const noexcept
832 {
833 return ncplane_fg_rgb (plane);
834 }
835
836 unsigned get_bg_rgb () const noexcept
837 {
838 return ncplane_bg_rgb (plane);
839 }
840
841 unsigned get_fg_alpha () const noexcept
842 {
843 return ncplane_fg_alpha (plane);
844 }
845
846 void set_channels (uint64_t channels) const noexcept
847 {
848 ncplane_set_channels (plane, channels);
849 }
850
851 bool set_fg_alpha (unsigned alpha) const NOEXCEPT_MAYBE
852 {
853 return error_guard (ncplane_set_fg_alpha (plane, alpha), -1);
854 }
855
856 unsigned get_bg_alpha () const noexcept
857 {
858 return ncplane_bg_alpha (plane);
859 }
860
861 bool set_bg_alpha (unsigned alpha) const NOEXCEPT_MAYBE
862 {
863 return error_guard (ncplane_set_bg_alpha (plane, alpha), -1);
864 }
865
866 unsigned get_fg_rgb8 (unsigned *r, unsigned *g, unsigned *b) const noexcept
867 {
868 return ncplane_fg_rgb8 (plane, r, g, b);
869 }
870
871 bool set_fg_rgb8 (int r, int g, int b, bool clipped = false) const NOEXCEPT_MAYBE
872 {
873 if (clipped) {
874 ncplane_set_fg_rgb8_clipped (plane, r, g, b);
875 return true;
876 }
877
878 return error_guard (ncplane_set_fg_rgb8 (plane, r, g, b), -1);
879 }
880
882 {
883 return error_guard (ncplane_set_fg_palindex (plane, idx), -1);
884 }
885
886 bool set_fg_rgb (uint32_t channel) const NOEXCEPT_MAYBE
887 {
888 return error_guard (ncplane_set_fg_rgb (plane, channel), -1);
889 }
890
891 void set_fg_default () const noexcept
892 {
894 }
895
896 unsigned get_bg_rgb8 (unsigned *r, unsigned *g, unsigned *b) const noexcept
897 {
898 return ncplane_bg_rgb8 (plane, r, g, b);
899 }
900
901 bool set_bg_rgb8 (int r, int g, int b, bool clipped = false) const NOEXCEPT_MAYBE
902 {
903 if (clipped) {
904 ncplane_set_bg_rgb8_clipped (plane, r, g, b);
905 return true;
906 }
907
908 return error_guard (ncplane_set_bg_rgb8 (plane, r, g, b), -1);
909 }
910
912 {
913 return error_guard (ncplane_set_bg_alpha (plane, idx), -1);
914 }
915
916 bool set_bg_rgb (uint32_t channel) const NOEXCEPT_MAYBE
917 {
918 return error_guard (ncplane_set_bg_rgb (plane, channel), -1);
919 }
920
921 void set_bg_default () const noexcept
922 {
924 }
925
926 bool set_scrolling (bool scrollp) const noexcept
927 {
928 return ncplane_set_scrolling (plane, scrollp);
929 }
930
931 unsigned get_styles () const noexcept
932 {
933 return ncplane_styles (plane);
934 }
935
936 void styles_set (CellStyle styles) const noexcept
937 {
938 ncplane_set_styles (plane, static_cast<unsigned>(styles));
939 }
940
941 void styles_on (CellStyle styles) const noexcept
942 {
943 ncplane_on_styles (plane, static_cast<unsigned>(styles));
944 }
945
946 void styles_off (CellStyle styles) const noexcept
947 {
948 ncplane_off_styles (plane, static_cast<unsigned>(styles));
949 }
950
951 int format (int y, int x, unsigned ylen, unsigned xlen, uint16_t stylemask) const NOEXCEPT_MAYBE
952 {
953 return error_guard<int> (ncplane_format (plane, y, x, ylen, xlen, stylemask), -1);
954 }
955
956 int stain (int y, int x, unsigned ylen, unsigned xlen, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr) const NOEXCEPT_MAYBE
957 {
958 return error_guard<int> (ncplane_stain (plane, y, x, ylen, xlen, ul, ur, ll, lr), -1);
959 }
960
961 Plane* get_below () const noexcept
962 {
963 return map_plane (ncplane_below (plane));
964 }
965
966 Plane* get_above () const noexcept
967 {
968 return map_plane (ncplane_above (plane));
969 }
970
972 {
973 bool ret = ncplane_set_base_cell (plane, c) < 0;
974 return error_guard_cond<bool, bool> (ret, ret);
975 }
976
977 bool set_base (const char* egc, uint16_t stylemask, uint64_t channels) const NOEXCEPT_MAYBE
978 {
979 bool ret = ncplane_set_base (plane, egc, stylemask, channels) < 0;
980 return error_guard_cond<bool, bool> (ret, ret);
981 }
982
984 {
985 bool ret = ncplane_base (plane, c) < 0;
986 return error_guard_cond<bool, bool> (ret, ret);
987 }
988
990 {
991 return error_guard<int>(ncplane_at_cursor_cell (plane, c), -1);
992 }
993
994 int at_cursor (Cell *c) const noexcept
995 {
996 if (c == nullptr)
997 return false;
998
999 return at_cursor (*c);
1000 }
1001
1002 char* at_cursor (uint16_t* stylemask, uint64_t* channels) const
1003 {
1004 if (stylemask == nullptr || channels == nullptr)
1005 return nullptr;
1006
1007 return ncplane_at_cursor (plane, stylemask, channels);
1008 }
1009
1010 int get_at (int y, int x, Cell &c) const NOEXCEPT_MAYBE
1011 {
1012 return error_guard<int> (ncplane_at_yx_cell (plane, y, x, c), -1);
1013 }
1014
1015 int get_at (int y, int x, Cell *c) const
1016 {
1017 if (c == nullptr)
1018 return -1;
1019
1020 return get_at (y, x, *c);
1021 }
1022
1023 char* get_at (int y, int x, uint16_t* stylemask, uint64_t* channels) const
1024 {
1025 if (stylemask == nullptr || channels == nullptr)
1026 return nullptr;
1027
1028 return ncplane_at_yx (plane, y, x, stylemask, channels);
1029 }
1030
1031 void* set_userptr (void *opaque) const noexcept
1032 {
1033 return ncplane_set_userptr (plane, opaque);
1034 }
1035
1036 template<typename T>
1037 T* set_userptr (T *opaque) const noexcept
1038 {
1039 return static_cast<T*>(set_userptr (static_cast<void*>(opaque)));
1040 }
1041
1042 void* get_userptr () const noexcept
1043 {
1044 return ncplane_userptr (plane);
1045 }
1046
1047 template<typename T>
1048 T* get_userptr () const noexcept
1049 {
1050 return static_cast<T*>(get_userptr ());
1051 }
1052
1053 NcReel* ncreel_create (const ncreel_options *popts = nullptr);
1054
1055 // Some Cell APIs go here since they act on individual panels even though it may seem weird at points (e.g.
1056 // release)
1057
1058 int load_egc32 (Cell &cell, uint32_t egc) const NOEXCEPT_MAYBE
1059 {
1060 int ret = nccell_load_egc32 (plane, cell, egc);
1061 return error_guard_cond<int> (ret, ret != 1);
1062 }
1063
1064 int load (Cell &cell, const char *gcluster) const NOEXCEPT_MAYBE
1065 {
1066 return error_guard<int> (nccell_load (plane, cell, gcluster), -1);
1067 }
1068
1069 bool load (Cell &cell, char ch) const NOEXCEPT_MAYBE
1070 {
1071 return error_guard (nccell_load_char (plane, cell, ch), -1);
1072 }
1073
1074 int prime (Cell &cell, const char *gcluster, uint16_t styles, uint64_t channels) const NOEXCEPT_MAYBE
1075 {
1076 return error_guard<int> (nccell_prime (plane, cell, gcluster, styles, channels), -1);
1077 }
1078
1079 void release (Cell &cell) const noexcept
1080 {
1081 nccell_release (plane, cell);
1082 }
1083
1084 int duplicate (Cell &target, Cell &source) const NOEXCEPT_MAYBE
1085 {
1086 return error_guard<int> (nccell_duplicate (plane, target, source), -1);
1087 }
1088
1089 int duplicate (Cell &target, Cell const& source) const NOEXCEPT_MAYBE
1090 {
1091 return error_guard<int> (nccell_duplicate (plane, target, source), -1);
1092 }
1093
1094 int duplicate (Cell &target, Cell *source) const
1095 {
1096 if (source == nullptr)
1097 throw invalid_argument ("'source' must be a valid pointer");
1098
1099 return duplicate (target, *source);
1100 }
1101
1102 int duplicate (Cell &target, Cell const* source) const
1103 {
1104 if (source == nullptr)
1105 throw invalid_argument ("'source' must be a valid pointer");
1106
1107 return duplicate (target, *source);
1108 }
1109
1110 int duplicate (Cell *target, Cell *source) const
1111 {
1112 if (target == nullptr)
1113 throw invalid_argument ("'target' must be a valid pointer");
1114 if (source == nullptr)
1115 throw invalid_argument ("'source' must be a valid pointer");
1116
1117 return duplicate (*target, *source);
1118 }
1119
1120 int duplicate (Cell *target, Cell const* source) const
1121 {
1122 if (target == nullptr)
1123 throw invalid_argument ("'target' must be a valid pointer");
1124 if (source == nullptr)
1125 throw invalid_argument ("'source' must be a valid pointer");
1126
1127 return duplicate (*target, *source);
1128 }
1129
1130 int duplicate (Cell *target, Cell &source) const
1131 {
1132 if (target == nullptr)
1133 throw invalid_argument ("'target' must be a valid pointer");
1134
1135 return duplicate (*target, source);
1136 }
1137
1138 int duplicate (Cell *target, Cell const& source) const
1139 {
1140 if (target == nullptr)
1141 throw invalid_argument ("'target' must be a valid pointer");
1142
1143 return duplicate (*target, source);
1144 }
1145
1146 void translate (const Plane *dst, int *y = nullptr, int *x = nullptr) const noexcept
1147 {
1148 ncplane_translate (*this, dst ? dst->plane: nullptr, y, x);
1149 }
1150
1151 void translate (const Plane &dst, int *y = nullptr, int *x = nullptr) const noexcept
1152 {
1153 translate (*this, dst, y, x);
1154 }
1155
1156 static void translate (const Plane *src, const Plane *dst, int *y = nullptr, int *x = nullptr)
1157 {
1158 if (src == nullptr)
1159 throw invalid_argument ("'src' must be a valid pointer");
1160
1161 ncplane_translate (*src, dst ? dst->plane : nullptr, y, x);
1162 }
1163
1164 static void translate (const Plane &src, const Plane &dst, int *y = nullptr, int *x = nullptr) noexcept
1165 {
1166 ncplane_translate (src.plane, dst.plane, y, x);
1167 }
1168
1169 bool translate_abs (int *y = nullptr, int *x = nullptr) const NOEXCEPT_MAYBE
1170 {
1171 return error_guard<bool, bool> (ncplane_translate_abs (plane, y, x), false);
1172 }
1173
1175 {
1176 return error_guard (ncplane_rotate_cw (plane), -1);
1177 }
1178
1179 bool rotate_ccw () const noexcept
1180 {
1181 return error_guard (ncplane_rotate_ccw (plane), -1);
1182 }
1183
1184 char* strdup (Cell const& cell) const noexcept
1185 {
1186 return nccell_strdup (plane, cell);
1187 }
1188
1189 char* extract (Cell const& cell, uint16_t *stylemask = nullptr, uint64_t *channels = nullptr)
1190 {
1191 return nccell_extract (plane, cell, stylemask, channels);
1192 }
1193
1194 const char* get_extended_gcluster (Cell &cell) const noexcept
1195 {
1196 return nccell_extended_gcluster (plane, cell);
1197 }
1198
1199 const char* get_extended_gcluster (Cell const& cell) const noexcept
1200 {
1201 return nccell_extended_gcluster (plane, cell);
1202 }
1203
1204 static Plane* map_plane (ncplane *ncp, Plane *associated_plane = nullptr) noexcept;
1205
1206 bool blit_bgrx (const void* data, int linesize, const struct ncvisual_options *vopts) const NOEXCEPT_MAYBE
1207 {
1208 bool ret = ncblit_bgrx (data, linesize, vopts) < 0;
1209 return error_guard_cond<bool, bool> (ret, ret);
1210 }
1211
1212 bool blit_rgba (const void* data, int linesize, const struct ncvisual_options *vopts) const NOEXCEPT_MAYBE
1213 {
1214 bool ret = ncblit_rgba (data, linesize, vopts) < 0;
1215 return error_guard_cond<bool, bool> (ret, ret);
1216 }
1217
1218 int qrcode (unsigned* ymax, unsigned* xmax, const void *data, size_t len) const NOEXCEPT_MAYBE
1219 {
1220 int ret = ncplane_qrcode (plane, ymax, xmax, data, len);
1221 return error_guard_cond<int> (ret, ret < 0);
1222 }
1223
1224 bool is_descendant_of (const Plane& ancestor) const noexcept
1225 {
1226 return ncplane_descendant_p (plane, ancestor) != 0;
1227 }
1228
1229 bool is_fg_default () const noexcept
1230 {
1231 return ncplane_fg_default_p (plane);
1232 }
1233
1234 bool is_bg_default () const noexcept
1235 {
1236 return ncplane_bg_default_p (plane);
1237 }
1238
1239 bool is_valid () const noexcept
1240 {
1241 return plane != nullptr;
1242 }
1243
1244 void set_resizecb (int(*resizecb)(struct ncplane*)) const noexcept
1245 {
1246 ncplane_set_resizecb (plane, resizecb);
1247 }
1248
1249 protected:
1250 explicit Plane (ncplane *_plane, bool _is_stdplane)
1251 : Root (nullptr),
1252 plane (_plane),
1253 is_stdplane (_is_stdplane)
1254 {
1255 if (_plane == nullptr)
1256 throw invalid_argument ("_plane must be a valid pointer");
1257 }
1258
1259 // This is used by child classes which cannot provide a valid ncplane* in their constructor when initializing
1260 // the parent class (e.g. Pile)
1261 Plane (NotCurses *ncinst = nullptr)
1262 : Root (ncinst),
1263 plane (nullptr)
1264 {}
1265
1266 // Can be used only once and only if plane == nullptr. Meant to be used by child classes which cannot provide a
1267 // valid ncplane* in their constructor when initializing the parent class (e.g. Pile)
1268 void set_plane (ncplane *_plane)
1269 {
1270 if (_plane == nullptr) {
1271 throw invalid_argument ("_plane must be a valid pointer");
1272 }
1273
1274 if (plane != nullptr) {
1275 throw invalid_state_error ("Plane::set_plane can be called only once");
1276 }
1277
1278 plane = _plane;
1279 map_plane (plane, this);
1280 }
1281
1282 void release_native_plane () noexcept
1283 {
1284 if (plane == nullptr)
1285 return;
1286
1287 unmap_plane (this);
1288 plane = nullptr;
1289 }
1290
1291 static void unmap_plane (Plane *p) noexcept;
1292
1293 private:
1294 ncplane* create_plane (const Plane &n, unsigned rows, unsigned cols, int yoff, int xoff, void *opaque)
1295 {
1296 ncplane_options nopts = {
1297 .y = yoff,
1298 .x = xoff,
1299 .rows = rows,
1300 .cols = cols,
1301 .userptr = opaque,
1302 .name = nullptr,
1303 .resizecb = nullptr,
1304 .flags = 0,
1305 .margin_b = 0,
1306 .margin_r = 0,
1307 };
1308 return create_plane (n, nopts);
1309 }
1310
1311 ncplane* create_plane (Plane &n, unsigned rows, unsigned cols, int yoff, NCAlign align, void *opaque)
1312 {
1313 ncplane_options nopts = {
1314 yoff,
1315 static_cast<ncalign_e>(align),
1316 rows,
1317 cols,
1318 opaque,
1319 nullptr,
1320 nullptr,
1321 0,
1322 0,
1323 0,
1324 };
1325 return create_plane (n, nopts);
1326 }
1327
1328 ncplane* create_plane (const Plane &n, ncplane_options const& nopts)
1329 {
1330 ncplane *ret = ncplane_create (
1331 n.plane,
1332 &nopts
1333 );
1334
1335 if (ret == nullptr) {
1336 throw init_error ("Notcurses failed to create an aligned plane");
1337 }
1338
1339 map_plane (plane, this);
1340 return ret;
1341 }
1342
1343 ncplane* duplicate_plane (const Plane &other, void *opaque)
1344 {
1345 ncplane *ret = ncplane_dup (other.plane, opaque);
1346 if (ret == nullptr)
1347 throw init_error ("Notcurses failed to duplicate plane");
1348
1349 return ret;
1350 }
1351
1352 private:
1353 ncplane *plane = nullptr;
1354 bool is_stdplane = false;
1355 static std::map<ncplane*,Plane*> *plane_map;
1356 static std::mutex plane_map_mutex;
1357
1358 friend class NotCurses;
1359 friend class NcReel;
1360 friend class Tablet;
1361 friend class Widget;
1362 template<typename TPlot, typename TCoord> friend class PlotBase;
1363 };
1364}
1365#endif
#define NCPP_API_EXPORT
Definition _helpers.hh:9
#define NOEXCEPT_MAYBE
Definition Root.hh:15
int ncblit_rgba(const void *data, int linesize, const struct ncvisual_options *vopts)
Definition blit.c:1454
int ncblit_bgrx(const void *data, int linesize, const struct ncvisual_options *vopts)
Definition blit.c:1408
int get_abs_y() const noexcept
Definition Plane.hh:286
int putstr(int y, NCAlign atype, const char *s) const NOEXCEPT_MAYBE
Definition Plane.hh:603
Plane(NotCurses *ncinst=nullptr)
Definition Plane.hh:1261
static Plane * map_plane(ncplane *ncp, Plane *associated_plane=nullptr) noexcept
bool perimeter_rounded(uint16_t stylemask, uint64_t channels, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:791
bool resize_maximize() const NOEXCEPT_MAYBE
Definition Plane.hh:184
unsigned get_bchannel() const noexcept
Definition Plane.hh:821
int at_cursor(Cell &c) const NOEXCEPT_MAYBE
Definition Plane.hh:989
int putc(const wchar_t *gclust, size_t *sbytes=nullptr, bool retain_styling=false) const NOEXCEPT_MAYBE
Definition Plane.hh:556
bool double_box(uint16_t styles, uint64_t channels, int ystop, int xstop, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:776
bool fadein(timespec const &ts, fadecb fader=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:266
int gradient2x1(int y, int x, unsigned ylen, unsigned xlen, uint32_t ul, uint32_t ur, uint32_t ll, uint32_t lr) const NOEXCEPT_MAYBE
Definition Plane.hh:221
const char * get_extended_gcluster(Cell const &cell) const noexcept
Definition Plane.hh:1199
Plane(ncplane *_plane, bool _is_stdplane)
Definition Plane.hh:1250
bool resize(int ylen, int xlen) const NOEXCEPT_MAYBE
Definition Plane.hh:231
unsigned cursor_x() const noexcept
Definition Plane.hh:491
int load_egc32(Cell &cell, uint32_t egc) const NOEXCEPT_MAYBE
Definition Plane.hh:1058
int putwch(int y, int x, wchar_t w) const NOEXCEPT_MAYBE
Definition Plane.hh:575
unsigned get_styles() const noexcept
Definition Plane.hh:931
bool resize_realign() const NOEXCEPT_MAYBE
Definition Plane.hh:189
void * set_userptr(void *opaque) const noexcept
Definition Plane.hh:1031
bool load_box(CellStyle style, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl, const char *gclusters) const NOEXCEPT_MAYBE
Definition Plane.hh:727
void styles_on(CellStyle styles) const noexcept
Definition Plane.hh:941
Plane(unsigned rows, unsigned cols, int yoff, int xoff, void *opaque=nullptr, NotCurses *ncinst=nullptr)
Definition Plane.hh:83
int duplicate(Cell *target, Cell const *source) const
Definition Plane.hh:1120
int putstr(const wchar_t *gclustarr) const NOEXCEPT_MAYBE
Definition Plane.hh:608
const char * get_extended_gcluster(Cell &cell) const noexcept
Definition Plane.hh:1194
void move_top() noexcept
Definition Plane.hh:409
bool fadeout(timespec &ts, fadecb fader=nullptr, void *curry=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:241
bool fadeout(timespec const &ts, fadecb fader=nullptr, void *curry=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:246
bool perimeter_double(uint16_t stylemask, uint64_t channels, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:796
bool perimeter(const Cell &ul, const Cell &ur, const Cell &ll, const Cell &lr, const Cell &hline, const Cell &vline, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:786
int vprintf(const char *format, va_list ap) const NOEXCEPT_MAYBE
Definition Plane.hh:687
Plane(Plane &n, ncplane_options const &nopts, NotCurses *ncinst=nullptr)
Definition Plane.hh:121
bool load_double_box(CellStyle style, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl) const NOEXCEPT_MAYBE
Definition Plane.hh:747
int putstr(int y, NCAlign atype, const wchar_t *gcluststyles) const NOEXCEPT_MAYBE
Definition Plane.hh:618
Plane * reparent_family(const Plane *newparent) const noexcept
Definition Plane.hh:389
int hline(const Cell &c, unsigned len, uint64_t c1, uint64_t c2) const NOEXCEPT_MAYBE
Definition Plane.hh:707
Plane(Plane &&other)
Definition Plane.hh:24
unsigned get_dim_x() const noexcept
Definition Plane.hh:326
bool move_above(Plane *above) const
Definition Plane.hh:437
bool load_box(uint16_t styles, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl, const char *gclusters) const NOEXCEPT_MAYBE
Definition Plane.hh:722
uint32_t * rgba(ncblitter_e blit, unsigned begy, unsigned begx, unsigned leny, unsigned lenx) const noexcept
Definition Plane.hh:806
int duplicate(Cell &target, Cell const *source) const
Definition Plane.hh:1102
bool fadein(const timespec *ts, fadecb fader=nullptr, void *curry=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:271
Plane(Plane const *n, int rows, int cols, int yoff, NCAlign align, void *opaque=nullptr)
Definition Plane.hh:140
bool fadein(timespec *ts, fadecb fader=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:256
int vprintf_stained(const char *format, va_list ap) const NOEXCEPT_MAYBE
Definition Plane.hh:682
Plane * get_above() const noexcept
Definition Plane.hh:966
int putc(const char *gclust, size_t *sbytes=nullptr, bool retain_styling=false) const NOEXCEPT_MAYBE
Definition Plane.hh:539
unsigned get_fg_rgb() const noexcept
Definition Plane.hh:831
int vline(const Cell &c, unsigned len) const NOEXCEPT_MAYBE
Definition Plane.hh:712
bool rotate_cw() const NOEXCEPT_MAYBE
Definition Plane.hh:1174
int va_start(va, format)
void set_channels(uint64_t channels) const noexcept
Definition Plane.hh:846
int duplicate(Cell &target, Cell const &source) const NOEXCEPT_MAYBE
Definition Plane.hh:1089
~Plane() noexcept
Definition Plane.hh:154
bool set_base_cell(Cell &c) const NOEXCEPT_MAYBE
Definition Plane.hh:971
void get_yx(int &y, int &x) const noexcept
Definition Plane.hh:346
Plane * reparent(const Plane *newparent) const noexcept
Definition Plane.hh:370
unsigned get_bg_alpha() const noexcept
Definition Plane.hh:856
bool rounded_box_sized(uint16_t styles, uint64_t channels, int ylen, int xlen, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:771
int printf(const char *format,...) const NOEXCEPT_MAYBE __attribute__((format(printf
bool set_fg_rgb8(int r, int g, int b, bool clipped=false) const NOEXCEPT_MAYBE
Definition Plane.hh:871
int putstr(int y, int x, const wchar_t *gclustarr) const NOEXCEPT_MAYBE
Definition Plane.hh:613
T * get_userptr() const noexcept
Definition Plane.hh:1048
bool is_fg_default() const noexcept
Definition Plane.hh:1229
void get_abs_yx(int *y, int *x) const noexcept
Definition Plane.hh:336
int prime(Cell &cell, const char *gcluster, uint16_t styles, uint64_t channels) const NOEXCEPT_MAYBE
Definition Plane.hh:1074
Plane * get_below() const noexcept
Definition Plane.hh:961
int vprintf(int y, NCAlign align, const char *format, va_list ap) const NOEXCEPT_MAYBE
Definition Plane.hh:697
bool mergedown(Plane *dst, int begsrcy, int begsrcx, unsigned leny, unsigned lenx, int dsty, int dstx) const
Definition Plane.hh:450
bool set_fg_alpha(unsigned alpha) const NOEXCEPT_MAYBE
Definition Plane.hh:851
bool get_base(Cell &c) const NOEXCEPT_MAYBE
Definition Plane.hh:983
unsigned get_fchannel() const noexcept
Definition Plane.hh:826
unsigned get_dim_y() const noexcept
Definition Plane.hh:331
bool load(Cell &cell, char ch) const NOEXCEPT_MAYBE
Definition Plane.hh:1069
int duplicate(Cell *target, Cell &source) const
Definition Plane.hh:1130
void set_fg_default() const noexcept
Definition Plane.hh:891
bool box(const Cell &ul, const Cell &ur, const Cell &ll, const Cell &lr, const Cell &hline, const Cell &vline, int ystop, int xstop, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:752
int putc(int y, int x, const wchar_t *gclust, size_t *sbytes=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:568
bool fadeout(timespec *ts, fadecb fader=nullptr, void *curry=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:236
unsigned get_fg_alpha() const noexcept
Definition Plane.hh:841
int printf_stained(const char *format,...) const NOEXCEPT_MAYBE __attribute__((format(printf
int duplicate(Cell *target, Cell *source) const
Definition Plane.hh:1110
void center_abs(int *y, int *x) const noexcept
Definition Plane.hh:174
Plane * reparent(Plane *newparent=nullptr) const noexcept
Definition Plane.hh:361
int hline(const Cell &c, unsigned len) const NOEXCEPT_MAYBE
Definition Plane.hh:702
void get_dim(unsigned *rows, unsigned *cols) const noexcept
Definition Plane.hh:316
int get_valign(NCAlign align, int r) const NOEXCEPT_MAYBE
Definition Plane.hh:311
int stain(int y, int x, unsigned ylen, unsigned xlen, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr) const NOEXCEPT_MAYBE
Definition Plane.hh:956
Plane(Plane &n, int rows, int cols, int yoff, NCAlign align, void *opaque=nullptr)
Definition Plane.hh:109
int duplicate(Cell *target, Cell const &source) const
Definition Plane.hh:1138
bool rounded_box(uint16_t styles, uint64_t channels, int ystop, int xstop, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:766
bool set_fg_palindex(int idx) const NOEXCEPT_MAYBE
Definition Plane.hh:881
int get_at(int y, int x, Cell &c) const NOEXCEPT_MAYBE
Definition Plane.hh:1010
bool is_bg_default() const noexcept
Definition Plane.hh:1234
char * content(unsigned begy, unsigned begx, unsigned leny, unsigned lenx) const noexcept
Definition Plane.hh:811
int putc(char c, bool retain_styling=false) const NOEXCEPT_MAYBE
Definition Plane.hh:522
bool mergedown_simple(Plane &dst) const
Definition Plane.hh:458
void styles_off(CellStyle styles) const noexcept
Definition Plane.hh:946
int putstr(const char *gclustarr) const NOEXCEPT_MAYBE
Definition Plane.hh:591
int putwch(wchar_t w) const NOEXCEPT_MAYBE
Definition Plane.hh:581
int putc(int y, int x, char c) const NOEXCEPT_MAYBE
Definition Plane.hh:534
void set_resizecb(int(*resizecb)(struct ncplane *)) const noexcept
Definition Plane.hh:1244
int get_x() const noexcept
Definition Plane.hh:291
Plane * reparent(const Plane &newparent) const noexcept
Definition Plane.hh:375
bool load_rounded_box(CellStyle style, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl) const NOEXCEPT_MAYBE
Definition Plane.hh:737
void set_bg_default() const noexcept
Definition Plane.hh:921
int duplicate(Cell &target, Cell *source) const
Definition Plane.hh:1094
int vline(const Cell &c, unsigned len, uint64_t c1, uint64_t c2) const NOEXCEPT_MAYBE
Definition Plane.hh:717
void release_native_plane() noexcept
Definition Plane.hh:1282
static void unmap_plane(Plane *p) noexcept
bool double_box_sized(uint16_t styles, uint64_t channels, int ylen, int xlen, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:781
unsigned cursor_y() const noexcept
Definition Plane.hh:486
int get_at(int y, int x, Cell *c) const
Definition Plane.hh:1015
bool is_valid() const noexcept
Definition Plane.hh:1239
bool translate_abs(int *y=nullptr, int *x=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:1169
bool move_below(Plane *below) const
Definition Plane.hh:424
bool set_fg_rgb(uint32_t channel) const NOEXCEPT_MAYBE
Definition Plane.hh:886
Plane(const Plane *n, int rows, int cols, int yoff, int xoff, void *opaque=nullptr)
Definition Plane.hh:54
int duplicate(Cell &target, Cell &source) const NOEXCEPT_MAYBE
Definition Plane.hh:1084
void get_dim(unsigned &rows, unsigned &cols) const noexcept
Definition Plane.hh:321
bool fadein(timespec &ts, fadecb fader=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:261
Plane * get_parent() const noexcept
Definition Plane.hh:351
void translate(const Plane &dst, int *y=nullptr, int *x=nullptr) const noexcept
Definition Plane.hh:1151
char * extract(Cell const &cell, uint16_t *stylemask=nullptr, uint64_t *channels=nullptr)
Definition Plane.hh:1189
bool set_bg_rgb8(int r, int g, int b, bool clipped=false) const NOEXCEPT_MAYBE
Definition Plane.hh:901
bool set_bg_palindex(int idx) const NOEXCEPT_MAYBE
Definition Plane.hh:911
int polyfill(int y, int x, const Cell &c) const NOEXCEPT_MAYBE
Definition Plane.hh:801
Plane(Plane *n, ncplane_options const &nopts, NotCurses *ncinst=nullptr)
Definition Plane.hh:63
unsigned get_bg_rgb() const noexcept
Definition Plane.hh:836
void release(Cell &cell) const noexcept
Definition Plane.hh:1079
bool move_above(Plane &above) const NOEXCEPT_MAYBE
Definition Plane.hh:432
bool set_base(const char *egc, uint16_t stylemask, uint64_t channels) const NOEXCEPT_MAYBE
Definition Plane.hh:977
int get_y() const noexcept
Definition Plane.hh:296
bool set_bg_rgb(uint32_t channel) const NOEXCEPT_MAYBE
Definition Plane.hh:916
bool blit_rgba(const void *data, int linesize, const struct ncvisual_options *vopts) const NOEXCEPT_MAYBE
Definition Plane.hh:1212
int putstr(int y, int x, const char *gclustarr) const NOEXCEPT_MAYBE
Definition Plane.hh:597
int format(int y, int x, unsigned ylen, unsigned xlen, uint16_t stylemask) const NOEXCEPT_MAYBE
Definition Plane.hh:951
Plane * reparent_family(const Plane &newparent) const noexcept
Definition Plane.hh:394
Plane(Plane *n, int rows, int cols, int yoff, int xoff, void *opaque=nullptr)
Definition Plane.hh:50
ncplane * to_ncplane() const noexcept
Definition Plane.hh:179
void styles_set(CellStyle styles) const noexcept
Definition Plane.hh:936
bool set_bg_alpha(unsigned alpha) const NOEXCEPT_MAYBE
Definition Plane.hh:861
Plane(Plane const &n, ncplane_options const &nopts, NotCurses *ncinst=nullptr)
Definition Plane.hh:125
bool mergedown_simple(Plane *dst) const
Definition Plane.hh:463
bool load_double_box(uint16_t styles, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl) const NOEXCEPT_MAYBE
Definition Plane.hh:742
unsigned get_fg_rgb8(unsigned *r, unsigned *g, unsigned *b) const noexcept
Definition Plane.hh:866
int at_cursor(Cell *c) const noexcept
Definition Plane.hh:994
Plane(Plane const &other, void *opaque)
Definition Plane.hh:44
void greyscale() const noexcept
Definition Plane.hh:226
int vprintf(int y, int x, const char *format, va_list ap) const NOEXCEPT_MAYBE
Definition Plane.hh:692
bool cursor_move(int y, int x) const NOEXCEPT_MAYBE
Definition Plane.hh:471
Plane * reparent_family(Plane *newparent=nullptr) const noexcept
Definition Plane.hh:380
int putc(const Cell &c) const NOEXCEPT_MAYBE
Definition Plane.hh:496
void erase() const noexcept
Definition Plane.hh:276
bool resize(int keepy, int keepx, int keepleny, int keeplenx, int yoff, int xoff, int ylen, int xlen) const NOEXCEPT_MAYBE
Definition Plane.hh:194
static void translate(const Plane &src, const Plane &dst, int *y=nullptr, int *x=nullptr) noexcept
Definition Plane.hh:1164
NcReel * ncreel_create(const ncreel_options *popts=nullptr)
unsigned get_bg_rgb8(unsigned *r, unsigned *g, unsigned *b) const noexcept
Definition Plane.hh:896
bool is_descendant_of(const Plane &ancestor) const noexcept
Definition Plane.hh:1224
int putc(const Cell *c) const
Definition Plane.hh:501
int get_align(NCAlign align, int c) const NOEXCEPT_MAYBE
Definition Plane.hh:301
bool fadeout(const timespec *ts, fadecb fader=nullptr, void *curry=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:251
bool move(int y, int x) const NOEXCEPT_MAYBE
Definition Plane.hh:404
int qrcode(unsigned *ymax, unsigned *xmax, const void *data, size_t len) const NOEXCEPT_MAYBE
Definition Plane.hh:1218
int gradient(int y, int x, unsigned ylen, unsigned xlen, const char *egc, uint16_t stylemask, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr) const NOEXCEPT_MAYBE
Definition Plane.hh:216
int putstr_stained(const wchar_t *gclustarr) const NOEXCEPT_MAYBE
Definition Plane.hh:623
void set_plane(ncplane *_plane)
Definition Plane.hh:1268
Plane(const Plane &n, int rows, int cols, int yoff, int xoff, void *opaque=nullptr)
Definition Plane.hh:77
bool box_sized(const Cell &ul, const Cell &ur, const Cell &ll, const Cell &lr, const Cell &hline, const Cell &vline, int ylen, int xlen, unsigned ctlword) const NOEXCEPT_MAYBE
Definition Plane.hh:759
int putc(int y, int x, Cell const *c) const NOEXCEPT_MAYBE
Definition Plane.hh:514
bool pulse(const timespec *ts, fadecb fader, void *curry) const NOEXCEPT_MAYBE
Definition Plane.hh:211
static void translate(const Plane *src, const Plane *dst, int *y=nullptr, int *x=nullptr)
Definition Plane.hh:1156
void * get_userptr() const noexcept
Definition Plane.hh:1042
void get_yx(int *y, int *x) const noexcept
Definition Plane.hh:341
int putc(int y, int x, Cell const &c) const NOEXCEPT_MAYBE
Definition Plane.hh:509
int get_abs_x() const noexcept
Definition Plane.hh:281
Plane(Plane const &other)
Definition Plane.hh:38
Plane(Plane const &n, int rows, int cols, int yoff, NCAlign align, void *opaque=nullptr)
Definition Plane.hh:115
void get_cursor_yx(unsigned &y, unsigned &x) const noexcept
Definition Plane.hh:481
char * at_cursor(uint16_t *stylemask, uint64_t *channels) const
Definition Plane.hh:1002
bool rotate_ccw() const noexcept
Definition Plane.hh:1179
bool mergedown(Plane &dst, unsigned begsrcy, unsigned begsrcx, unsigned leny, unsigned lenx, unsigned dsty, unsigned dstx) const
Definition Plane.hh:445
int load(Cell &cell, const char *gcluster) const NOEXCEPT_MAYBE
Definition Plane.hh:1064
int printf(int y, int x, const char *format,...) const NOEXCEPT_MAYBE __attribute__((format(printf
void move_bottom() noexcept
Definition Plane.hh:414
bool load_rounded_box(uint16_t styles, uint64_t channels, Cell &ul, Cell &ur, Cell &ll, Cell &lr, Cell &hl, Cell &vl) const NOEXCEPT_MAYBE
Definition Plane.hh:732
Plane(ncplane *_plane) noexcept
Definition Plane.hh:149
int printf(int y, NCAlign align, const char *format,...) const NOEXCEPT_MAYBE __attribute__((format(printf
void translate(const Plane *dst, int *y=nullptr, int *x=nullptr) const noexcept
Definition Plane.hh:1146
Plane(Plane *n, int rows, int cols, int yoff, NCAlign align, void *opaque=nullptr)
Definition Plane.hh:131
int putstr_stained(const char *s) const NOEXCEPT_MAYBE
Definition Plane.hh:628
int putwc_stained(wchar_t w) const NOEXCEPT_MAYBE
Definition Plane.hh:586
void get_cursor_yx(unsigned *y, unsigned *x) const noexcept
Definition Plane.hh:476
int get_halign(NCAlign align, int c) const NOEXCEPT_MAYBE
Definition Plane.hh:306
int putc(int y, int x, const char *gclust, size_t *sbytes=nullptr) const NOEXCEPT_MAYBE
Definition Plane.hh:551
char * get_at(int y, int x, uint16_t *stylemask, uint64_t *channels) const
Definition Plane.hh:1023
bool move_below(Plane &below) const NOEXCEPT_MAYBE
Definition Plane.hh:419
void home() const noexcept
Definition Plane.hh:399
Plane(const Plane *n, ncplane_options const &nopts, NotCurses *ncinst=nullptr)
Definition Plane.hh:67
bool set_scrolling(bool scrollp) const noexcept
Definition Plane.hh:926
T * set_userptr(T *opaque) const noexcept
Definition Plane.hh:1037
uint64_t get_channels() const noexcept
Definition Plane.hh:816
char * strdup(Cell const &cell) const noexcept
Definition Plane.hh:1184
API int API int API int uint64_t uint64_t uint64_t uint64_t lr
Definition direct.h:216
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned unsigned unsigned ctlword
Definition direct.h:217
API int API int API int uint64_t uint64_t uint64_t ll
Definition direct.h:216
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned unsigned xlen
Definition direct.h:217
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned ylen
Definition direct.h:217
API int API int API int uint64_t ul
Definition direct.h:215
API int API int API int uint64_t uint64_t ur
Definition direct.h:215
const char * egc
Definition egcpool.h:173
const nccell * c
Definition egcpool.h:296
uint32_t idx
Definition egcpool.h:298
__attribute__((nonnull(1, 2))) static inline int egcpool_stash(egcpool *pool
int ncplane_pulse(ncplane *n, const struct timespec *ts, fadecb fader, void *curry)
Definition fade.c:301
int ncplane_fadeout(ncplane *n, const struct timespec *ts, fadecb fader, void *curry)
Definition fade.c:260
int ncplane_fadein(ncplane *n, const struct timespec *ts, fadecb fader, void *curry)
Definition fade.c:284
int r
Definition fbuf.h:226
int ncplane_gradient2x1(ncplane *n, int y, int x, unsigned ylen, unsigned xlen, uint32_t ul, uint32_t ur, uint32_t ll, uint32_t lr)
Definition fill.c:179
void ncplane_greyscale(ncplane *n)
Definition fill.c:3
int ncplane_rotate_ccw(ncplane *n)
Definition fill.c:515
int ncplane_polyfill_yx(ncplane *n, int ystart, int xstart, const nccell *c)
Definition fill.c:80
int ncplane_gradient(ncplane *n, int y, int x, unsigned ylen, unsigned xlen, const char *egc, uint16_t stylemask, uint64_t ul, uint64_t ur, uint64_t bl, uint64_t br)
Definition fill.c:227
int ncplane_format(ncplane *n, int y, int x, unsigned ylen, unsigned xlen, uint16_t stylemask)
Definition fill.c:296
int ncplane_qrcode(ncplane *n, unsigned *ymax, unsigned *xmax, const void *data, size_t len)
Definition fill.c:651
int ncplane_stain(ncplane *n, int y, int x, unsigned ylen, unsigned xlen, uint64_t tl, uint64_t tr, uint64_t bl, uint64_t br)
Definition fill.c:272
int ncplane_rotate_cw(ncplane *n)
Definition fill.c:484
CellStyle
Definition CellStyle.hh:13
NCAlign
Definition NCAlign.hh:9
int ncplane_abs_x(const ncplane *n)
Definition notcurses.c:2638
int ncplane_putwstr_stained(ncplane *n, const wchar_t *gclustarr)
Definition notcurses.c:3278
void ncplane_on_styles(ncplane *n, unsigned stylebits)
Definition notcurses.c:2076
void ncplane_set_fg_default(ncplane *n)
Definition notcurses.c:1502
int ncplane_set_fg_rgb(ncplane *n, unsigned channel)
Definition notcurses.c:1526
int ncplane_cursor_move_yx(ncplane *n, int y, int x)
Definition notcurses.c:720
void ncplane_set_fg_rgb8_clipped(ncplane *n, int r, int g, int b)
Definition notcurses.c:1518
void ncplane_home(ncplane *n)
Definition notcurses.c:715
int ncplane_x(const ncplane *n)
Definition notcurses.c:2441
void * ncplane_userptr(ncplane *n)
Definition notcurses.c:192
int ncplane_y(const ncplane *n)
Definition notcurses.c:2434
char * ncplane_contents(ncplane *nc, int begy, int begx, unsigned leny, unsigned lenx)
Definition notcurses.c:3228
void ncplane_cursor_yx(const ncplane *n, unsigned *y, unsigned *x)
Definition notcurses.c:1741
ncplane * notcurses_stdplane(notcurses *nc)
Definition notcurses.c:699
void ncplane_set_channels(ncplane *n, uint64_t channels)
Definition notcurses.c:1494
void ncplane_abs_yx(const ncplane *n, int *RESTRICT y, int *RESTRICT x)
Definition notcurses.c:2642
ncplane * ncplane_dup(const ncplane *n, void *opaque)
Definition notcurses.c:760
void ncplane_set_bg_rgb8_clipped(ncplane *n, int r, int g, int b)
Definition notcurses.c:1510
int ncplane_putchar_stained(ncplane *n, char c)
Definition notcurses.c:2008
int ncplane_vprintf_aligned(ncplane *n, int y, ncalign_e align, const char *format, va_list ap)
Definition notcurses.c:2125
int ncplane_set_bg_alpha(ncplane *n, int alpha)
Definition notcurses.c:1546
void ncplane_set_styles(ncplane *n, unsigned stylebits)
Definition notcurses.c:2071
int ncplane_destroy(ncplane *ncp)
Definition notcurses.c:1018
const char * nccell_extended_gcluster(const ncplane *n, const nccell *c)
Definition notcurses.c:1573
void ncplane_off_styles(ncplane *n, unsigned stylebits)
Definition notcurses.c:2081
void * ncplane_set_userptr(ncplane *n, void *opaque)
Definition notcurses.c:186
char * ncplane_at_yx(const ncplane *n, int y, int x, uint16_t *stylemask, uint64_t *channels)
Definition notcurses.c:214
int ncplane_set_fg_palindex(ncplane *n, unsigned idx)
Definition notcurses.c:1550
int ncplane_putegc_stained(ncplane *n, const char *gclust, size_t *sbytes)
Definition notcurses.c:2032
int ncplane_abs_y(const ncplane *n)
Definition notcurses.c:2634
uint16_t ncplane_styles(const ncplane *n)
Definition notcurses.c:1498
int ncplane_set_fg_alpha(ncplane *n, int alpha)
Definition notcurses.c:1542
int ncplane_set_bg_rgb(ncplane *n, unsigned channel)
Definition notcurses.c:1538
ncplane * ncplane_reparent_family(ncplane *n, ncplane *newparent)
Definition notcurses.c:2913
int ncplane_move_yx(ncplane *n, int y, int x)
Definition notcurses.c:2411
int ncplane_base(ncplane *ncp, nccell *c)
Definition notcurses.c:1569
int ncplane_resize_maximize(ncplane *n)
Definition notcurses.c:2753
int nccell_load(ncplane *n, nccell *c, const char *gcluster)
Definition notcurses.c:1833
int ncplane_putwegc_stained(ncplane *n, const wchar_t *gclust, size_t *sbytes)
Definition notcurses.c:2020
void ncplane_translate(const ncplane *src, const ncplane *dst, int *restrict y, int *restrict x)
Definition notcurses.c:2613
int ncplane_putegc_yx(ncplane *n, int y, int x, const char *gclust, size_t *sbytes)
Definition notcurses.c:1995
int ncplane_set_base(ncplane *ncp, const char *egc, uint16_t stylemask, uint64_t channels)
Definition notcurses.c:1565
int ncplane_set_bg_rgb8(ncplane *n, unsigned r, unsigned g, unsigned b)
Definition notcurses.c:1514
int ncplane_vprintf_stained(struct ncplane *n, const char *format, va_list ap)
Definition notcurses.c:2136
int ncplane_vprintf_yx(ncplane *n, int y, int x, const char *format, va_list ap)
Definition notcurses.c:2115
ncplane * ncplane_above(ncplane *n)
Definition notcurses.c:2552
void ncplane_set_resizecb(ncplane *n, int(*resizecb)(ncplane *))
Definition notcurses.c:2673
bool ncplane_set_scrolling(ncplane *n, unsigned scrollp)
Definition notcurses.c:2993
ncplane * ncplane_below(ncplane *n)
Definition notcurses.c:2548
uint32_t * ncplane_as_rgba(const ncplane *nc, ncblitter_e blit, int begy, int begx, unsigned leny, unsigned lenx, unsigned *pxdimy, unsigned *pxdimx)
Definition notcurses.c:3214
char * ncplane_at_cursor(const ncplane *n, uint16_t *stylemask, uint64_t *channels)
Definition notcurses.c:210
void ncplane_set_bg_default(ncplane *n)
Definition notcurses.c:1506
void ncplane_yx(const ncplane *n, int *y, int *x)
Definition notcurses.c:2448
int ncplane_hline_interp(ncplane *n, const nccell *c, unsigned len, uint64_t c1, uint64_t c2)
Definition notcurses.c:2153
ncplane * ncplane_reparent(ncplane *n, ncplane *newparent)
Definition notcurses.c:2791
int ncplane_at_cursor_cell(ncplane *n, nccell *c)
Definition notcurses.c:266
int ncplane_resize_realign(ncplane *n)
Definition notcurses.c:2764
int ncplane_move_below(ncplane *restrict n, ncplane *restrict below)
Definition notcurses.c:1628
int ncplane_at_yx_cell(ncplane *n, int y, int x, nccell *c)
Definition notcurses.c:270
int ncplane_set_fg_rgb8(ncplane *n, unsigned r, unsigned g, unsigned b)
Definition notcurses.c:1522
int ncplane_resize(ncplane *n, int keepy, int keepx, unsigned keepleny, unsigned keeplenx, int yoff, int xoff, unsigned ylen, unsigned xlen)
Definition notcurses.c:1006
bool ncplane_translate_abs(const ncplane *n, int *restrict y, int *restrict x)
Definition notcurses.c:2590
int ncplane_vline_interp(ncplane *n, const nccell *c, unsigned len, uint64_t c1, uint64_t c2)
Definition notcurses.c:2209
uint64_t ncplane_channels(const ncplane *n)
Definition notcurses.c:1490
ncplane * ncplane_create(ncplane *n, const ncplane_options *nopts)
Definition notcurses.c:707
void ncplane_erase(ncplane *n)
Definition notcurses.c:2458
ncplane * ncplane_parent(ncplane *n)
Definition notcurses.c:2651
int ncplane_move_above(ncplane *restrict n, ncplane *restrict above)
Definition notcurses.c:1581
int ncplane_box(ncplane *n, const nccell *ul, const nccell *ur, const nccell *ll, const nccell *lr, const nccell *hl, const nccell *vl, unsigned ystop, unsigned xstop, unsigned ctlword)
Definition notcurses.c:2271
int ncplane_putc_yx(ncplane *n, int y, int x, const nccell *c)
Definition notcurses.c:1980
void ncplane_center_abs(const ncplane *n, int *RESTRICT y, int *RESTRICT x)
Definition notcurses.c:3268
int ncplane_set_base_cell(ncplane *ncp, const nccell *c)
Definition notcurses.c:1558
void ncplane_dim_yx(const ncplane *n, unsigned *rows, unsigned *cols)
Definition notcurses.c:301
int y
Definition notcurses.h:1905
int(* fadecb)(struct notcurses *nc, struct ncplane *n, const struct timespec *, void *curry)
Definition notcurses.h:3029
const struct ncplane_options struct ncvisual struct ncvisual_options * vopts
Definition notcurses.h:3484
ncalign_e
Definition notcurses.h:80
ncblitter_e
Definition notcurses.h:65
vopts n
Definition notcurses.h:3502
int int x
Definition notcurses.h:1905
API int API int const nccell unsigned len
Definition notcurses.h:2588
void nccell_release(ncplane *n, nccell *c)
Definition render.c:128
int ncplane_mergedown(ncplane *restrict src, ncplane *restrict dst, int begsrcy, int begsrcx, unsigned leny, unsigned lenx, int dsty, int dstx)
Definition render.c:514
int nccell_duplicate(ncplane *n, nccell *targ, const nccell *c)
Definition render.c:133
int ncplane_mergedown_simple(ncplane *restrict src, ncplane *restrict dst)
Definition render.c:608