diff --git a/USAGE.md b/USAGE.md index 5dd6a2166..aa6e2c05f 100644 --- a/USAGE.md +++ b/USAGE.md @@ -712,12 +712,14 @@ ncplane_resize_simple(struct ncplane* n, int ylen, int xlen){ return ncplane_resize(n, 0, 0, keepleny, keeplenx, 0, 0, ylen, xlen); } -// Move this plane relative to the standard plane. It is an error to attempt to -// move the standard plane. +// Move this plane relative to the standard plane, or the plane to which it is +// bound (if it is bound to a plane). It is an error to attempt to move the +// standard plane. int ncplane_move_yx(struct ncplane* n, int y, int x); -// Get the origin of this ncplane relative to the standard plane. -void ncplane_yx(struct ncplane* n, int* restrict y, int* restrict x); +// Get the origin of this plane relative to the standard plane, or the plane to +// which it is bound (if it is bound to a plane). +void ncplane_yx(const struct ncplane* n, int* restrict y, int* restrict x); // Return the dimensions of this ncplane. void ncplane_dim_yx(struct ncplane* n, int* restrict rows, int* restrict cols); diff --git a/doc/man/man3/notcurses_plane.3.md b/doc/man/man3/notcurses_plane.3.md index 084607bfd..5a25fc1d0 100644 --- a/doc/man/man3/notcurses_plane.3.md +++ b/doc/man/man3/notcurses_plane.3.md @@ -159,7 +159,10 @@ anywhere. In addition to its framebuffer--a rectilinear matrix of cells * a current style, foreground channel, and background channel, * its geometry, * a configured user pointer, -* its position relative to the visible plane, and +* position relative to the standard plane, +* the plane, if any, to which it is bound, +* the next plane bound by the plane to which it is bound, +* the head of the list of its bound planes, and * its z-index. New planes can be created with **ncplane_new**, **ncplane_bound**, and diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index a790f555a..d77a4846d 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -1212,11 +1212,13 @@ API int ncplane_set_base(struct ncplane* ncp, const char* egc, // 'ncp' is destroyed. API int ncplane_base(struct ncplane* ncp, cell* c); -// Move this plane relative to the standard plane. It is an error to attempt to -// move the standard plane. +// Move this plane relative to the standard plane, or the plane to which it is +// bound (if it is bound to a plane). It is an error to attempt to move the +// standard plane. API int ncplane_move_yx(struct ncplane* n, int y, int x); -// Get the origin of this plane relative to the standard plane. +// Get the origin of this plane relative to the standard plane, or the plane to +// which it is bound (if it is bound to a plane). API void ncplane_yx(const struct ncplane* n, int* RESTRICT y, int* RESTRICT x); // Splice ncplane 'n' out of the z-buffer, and reinsert it at the top or bottom. diff --git a/src/demo/mojibake.c b/src/demo/mojibake.c index 1034e417e..8b13a5c10 100644 --- a/src/demo/mojibake.c +++ b/src/demo/mojibake.c @@ -3465,34 +3465,35 @@ unicode52(struct ncplane* title, int y){ static struct ncplane* unicode60(struct ncplane* title, int y){ const char SUMMARY[] = "[Unicode 6.0 (2010), 722 codepoints]"; - const int ROWS = 25; + const int ROWS = 26; struct ncplane* n = mojiplane(title, y, ROWS, SUMMARY); if(n == NULL){ return NULL; } - ncplane_putstr_yx(n, 1, 1, "๐Ÿ˜ƒ๐Ÿ˜„๐Ÿ˜๐Ÿ˜†๐Ÿ˜…๐Ÿ˜‚๐Ÿ˜‰๐Ÿ˜Š๐Ÿ˜‡๐Ÿ˜๐Ÿ˜˜๐Ÿ˜š๐Ÿ˜‹๐Ÿ˜œ๐Ÿ˜๐Ÿ˜๐Ÿ˜ถ๐Ÿ˜๐Ÿ˜’๐Ÿ˜Œ๐Ÿ˜”๐Ÿ˜ช๐Ÿ˜ท๐Ÿ˜ต๐Ÿ˜Ž๐Ÿ˜ฒ๐Ÿ˜ณ๐Ÿ˜จ๐Ÿ˜ฐ๐Ÿ˜ฅ๐Ÿ˜ข๐Ÿ˜ญ"); - ncplane_putstr_yx(n, 2, 1, "๐Ÿ˜ฑ๐Ÿ˜–๐Ÿ˜ฃ๐Ÿ˜ž๐Ÿ˜“๐Ÿ˜ฉ๐Ÿ˜ซ๐Ÿ˜ค๐Ÿ˜ก๐Ÿ˜ ๐Ÿ˜ˆ๐Ÿ‘ฟ๐Ÿ’€๐Ÿ’ฉ๐Ÿ‘น๐Ÿ‘บ๐Ÿ‘ป๐Ÿ‘ฝ๐Ÿ‘พ๐Ÿ˜บ๐Ÿ˜ธ๐Ÿ˜น๐Ÿ˜ป๐Ÿ˜ผ๐Ÿ˜ฝ๐Ÿ™€๐Ÿ˜ฟ๐Ÿ˜พ๐Ÿ™ˆ๐Ÿ™‰๐Ÿ™Š๐Ÿ’‹"); - ncplane_putstr_yx(n, 3, 1, "๐Ÿ’Œ๐Ÿ’˜๐Ÿ’๐Ÿ’–๐Ÿ’—๐Ÿ’“๐Ÿ’ž๐Ÿ’•๐Ÿ’Ÿ๐Ÿ’”๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ๐Ÿ’ฏ๐Ÿ’ข๐Ÿ’ฅ๐Ÿ’ซ๐Ÿ’ฆ๐Ÿ’จ๐Ÿ’ฃ๐Ÿ’ฌ๐Ÿ’ญ๐Ÿ’ค๐Ÿ‘‹โœ‹๐Ÿ‘Œ๐Ÿ‘ˆ๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘‡๐Ÿ‘"); - ncplane_putstr_yx(n, 4, 1, "๐Ÿ‘ŽโœŠ๐Ÿ‘Š๐Ÿ‘๐Ÿ™Œ๐Ÿ‘๐Ÿ™๐Ÿ’…๐Ÿ’ช๐Ÿ‘‚๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘…๐Ÿ‘„๐Ÿ‘ถ๐Ÿ‘ฆ๐Ÿ‘ง๐Ÿ‘ฑ๐Ÿ‘จ๐Ÿ‘ฉ๐Ÿ‘ด๐Ÿ‘ต๐Ÿ™๐Ÿ™Ž๐Ÿ™…๐Ÿ™†๐Ÿ’๐Ÿ™‹๐Ÿ™‡๐Ÿ‘ฎ๐Ÿ’‚๐Ÿ‘ท"); - ncplane_putstr_yx(n, 5, 1, "๐Ÿ‘ธ๐Ÿ‘ณ๐Ÿ‘ฒ๐Ÿ‘ฐ๐Ÿ‘ผ๐ŸŽ…๐Ÿ’†๐Ÿ’‡๐Ÿšถ๐Ÿƒ๐Ÿ’ƒ๐Ÿ‘ฏ๐Ÿ‡๐Ÿ‚๐Ÿ„๐Ÿšฃ๐ŸŠ๐Ÿšด๐Ÿšต๐Ÿ›€๐Ÿ‘ญ๐Ÿ‘ซ๐Ÿ‘ฌ๐Ÿ’๐Ÿ’‘๐Ÿ‘ช๐Ÿ‘ค๐Ÿ‘ฅ๐Ÿ‘ฃ๐Ÿต๐Ÿ’๐Ÿถ"); - ncplane_putstr_yx(n, 6, 1, "๐Ÿ•๐Ÿฉ๐Ÿบ๐Ÿฑ๐Ÿˆ๐Ÿฏ๐Ÿ…๐Ÿ†๐Ÿด๐ŸŽ๐Ÿฎ๐Ÿ‚๐Ÿƒ๐Ÿ„๐Ÿท๐Ÿ–๐Ÿ—๐Ÿฝ๐Ÿ๐Ÿ‘๐Ÿ๐Ÿช๐Ÿซ๐Ÿ˜๐Ÿญ๐Ÿ๐Ÿ€๐Ÿน๐Ÿฐ๐Ÿ‡๐Ÿป๐Ÿจ"); - ncplane_putstr_yx(n, 7, 1, "๐Ÿผ๐Ÿพ๐Ÿ”๐Ÿ“๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿง๐Ÿธ๐ŸŠ๐Ÿข๐Ÿ๐Ÿฒ๐Ÿ‰๐Ÿณ๐Ÿ‹๐Ÿฌ๐ŸŸ๐Ÿ ๐Ÿก๐Ÿ™๐Ÿš๐ŸŒ๐Ÿ›๐Ÿœ๐Ÿ๐Ÿž๐Ÿ’๐ŸŒธ๐Ÿ’ฎ๐ŸŒน"); - ncplane_putstr_yx(n, 8, 1, "๐ŸŒบ๐ŸŒป๐ŸŒผ๐ŸŒท๐ŸŒฑ๐ŸŒฒ๐ŸŒณ๐ŸŒด๐ŸŒต๐ŸŒพ๐ŸŒฟ๐Ÿ€๐Ÿ๐Ÿ‚๐Ÿƒ๐Ÿ‡๐Ÿˆ๐Ÿ‰๐ŸŠ๐Ÿ‹๐ŸŒ๐Ÿ๐ŸŽ๐Ÿ๐Ÿ๐Ÿ‘๐Ÿ’๐Ÿ“๐Ÿ…๐Ÿ†๐ŸŒฝ๐Ÿ„"); - ncplane_putstr_yx(n, 9, 1, "๐ŸŒฐ๐Ÿž๐Ÿ–๐Ÿ—๐Ÿ”๐ŸŸ๐Ÿ•๐Ÿณ๐Ÿฒ๐Ÿฑ๐Ÿ˜๐Ÿ™๐Ÿš๐Ÿ›๐Ÿœ๐Ÿ๐Ÿ ๐Ÿข๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿก๐Ÿฆ๐Ÿง๐Ÿจ๐Ÿฉ๐Ÿช๐ŸŽ‚๐Ÿฐ๐Ÿซ๐Ÿฌ๐Ÿญ"); - ncplane_putstr_yx(n, 10, 1, "๐Ÿฎ๐Ÿฏ๐Ÿผ๐Ÿต๐Ÿถ๐Ÿท๐Ÿธ๐Ÿน๐Ÿบ๐Ÿป๐Ÿด๐Ÿ”ช๐ŸŒ๐ŸŒŽ๐ŸŒ๐ŸŒ๐Ÿ—พ๐ŸŒ‹๐Ÿ—ป๐Ÿ ๐Ÿก๐Ÿข๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿจ๐Ÿฉ๐Ÿช๐Ÿซ๐Ÿฌ๐Ÿญ"); - ncplane_putstr_yx(n, 11, 1, "๐Ÿฏ๐Ÿฐ๐Ÿ’’๐Ÿ—ผ๐Ÿ—ฝ๐ŸŒ๐ŸŒƒ๐ŸŒ„๐ŸŒ…๐ŸŒ†๐ŸŒ‡๐ŸŒ‰๐ŸŽ ๐ŸŽก๐ŸŽข๐Ÿ’ˆ๐ŸŽช๐Ÿš‚๐Ÿšƒ๐Ÿš„๐Ÿš…๐Ÿš†๐Ÿš‡๐Ÿšˆ๐Ÿš‰๐ŸšŠ๐Ÿš๐Ÿšž๐Ÿš‹๐ŸšŒ๐Ÿš๐ŸšŽ"); - ncplane_putstr_yx(n, 12, 1, "๐Ÿš๐Ÿš‘๐Ÿš’๐Ÿš“๐Ÿš”๐Ÿš•๐Ÿš–๐Ÿš—๐Ÿš˜๐Ÿš™๐Ÿšš๐Ÿš›๐Ÿšœ๐Ÿšฒ๐Ÿš๐Ÿšจ๐Ÿšฅ๐Ÿšฆ๐Ÿšง๐Ÿšค๐Ÿšข๐Ÿ’บ๐Ÿš๐ŸšŸ๐Ÿš ๐Ÿšก๐Ÿš€โณโฐโฑโฒ๐Ÿ•›๐Ÿ•ง"); - ncplane_putstr_yx(n, 13, 1, "๐Ÿ•๐Ÿ•œ๐Ÿ•‘๐Ÿ•๐Ÿ•’๐Ÿ•ž๐Ÿ•“๐Ÿ•Ÿ๐Ÿ•”๐Ÿ• ๐Ÿ••๐Ÿ•ก๐Ÿ•–๐Ÿ•ข๐Ÿ•—๐Ÿ•ฃ๐Ÿ•˜๐Ÿ•ค๐Ÿ•™๐Ÿ•ฅ๐Ÿ•š๐Ÿ•ฆ๐ŸŒ‘๐ŸŒ’๐ŸŒ“๐ŸŒ”๐ŸŒ•๐ŸŒ–๐ŸŒ—๐ŸŒ˜๐ŸŒ™๐ŸŒš"); - ncplane_putstr_yx(n, 14, 1, "๐ŸŒ›๐ŸŒœ๐ŸŒ๐ŸŒž๐ŸŒŸ๐ŸŒ ๐ŸŒŒ๐ŸŒ€๐ŸŒˆ๐ŸŒ‚๐Ÿ”ฅ๐Ÿ’ง๐ŸŒŠ๐ŸŽƒ๐ŸŽ„๐ŸŽ†๐ŸŽ‡โœจ๐ŸŽˆ๐ŸŽ‰๐ŸŽŠ๐ŸŽ‹๐ŸŽ๐ŸŽŽ๐ŸŽ๐ŸŽ๐ŸŽ‘๐ŸŽ€๐ŸŽ๐ŸŽซ๐Ÿ†๐Ÿ€"); - ncplane_putstr_yx(n, 15, 1, "๐Ÿˆ๐Ÿ‰๐ŸŽพ๐ŸŽณ๐ŸŽฃ๐ŸŽฝ๐ŸŽฟ๐ŸŽฏ๐ŸŽฑ๐Ÿ”ฎ๐ŸŽฎ๐ŸŽฐ๐ŸŽฒ๐Ÿƒ๐ŸŽด๐ŸŽญ๐ŸŽจ๐Ÿ‘“๐Ÿ‘”๐Ÿ‘•๐Ÿ‘–๐Ÿ‘—๐Ÿ‘˜๐Ÿ‘™๐Ÿ‘š๐Ÿ‘›๐Ÿ‘œ๐Ÿ‘๐ŸŽ’๐Ÿ‘ž๐Ÿ‘Ÿ๐Ÿ‘ "); - ncplane_putstr_yx(n, 16, 1, "๐Ÿ‘ก๐Ÿ‘ข๐Ÿ‘‘๐Ÿ‘’๐ŸŽฉ๐ŸŽ“๐Ÿ’„๐Ÿ’๐Ÿ’Ž๐Ÿ”‡๐Ÿ”ˆ๐Ÿ”‰๐Ÿ”Š๐Ÿ“ข๐Ÿ“ฃ๐Ÿ“ฏ๐Ÿ””๐Ÿ”•๐ŸŽผ๐ŸŽต๐ŸŽถ๐ŸŽค๐ŸŽง๐Ÿ“ป๐ŸŽท๐ŸŽธ๐ŸŽน๐ŸŽบ๐ŸŽป๐Ÿ“ฑ๐Ÿ“ฒ๐Ÿ“ž"); - ncplane_putstr_yx(n, 17, 1, "๐Ÿ“Ÿ๐Ÿ“ ๐Ÿ”‹๐Ÿ”Œ๐Ÿ’ป๐Ÿ’ฝ๐Ÿ’พ๐Ÿ’ฟ๐Ÿ“€๐ŸŽฅ๐ŸŽฌ๐Ÿ“บ๐Ÿ“ท๐Ÿ“น๐Ÿ“ผ๐Ÿ”๐Ÿ”Ž๐Ÿ’ก๐Ÿ”ฆ๐Ÿฎ๐Ÿ“”๐Ÿ“•๐Ÿ“–๐Ÿ“—๐Ÿ“˜๐Ÿ“™๐Ÿ“š๐Ÿ““๐Ÿ“’๐Ÿ“ƒ๐Ÿ“œ๐Ÿ“„"); - ncplane_putstr_yx(n, 18, 1, "๐Ÿ“ฐ๐Ÿ“‘๐Ÿ”–๐Ÿ’ฐ๐Ÿ’ด๐Ÿ’ต๐Ÿ’ถ๐Ÿ’ท๐Ÿ’ธ๐Ÿ’ณ๐Ÿ’น๐Ÿ“ง๐Ÿ“จ๐Ÿ“ฉ๐Ÿ“ค๐Ÿ“ฅ๐Ÿ“ฆ๐Ÿ“ซ๐Ÿ“ช๐Ÿ“ฌ๐Ÿ“ญ๐Ÿ“ฎ๐Ÿ“๐Ÿ’ผ๐Ÿ“๐Ÿ“‚๐Ÿ“…๐Ÿ“†๐Ÿ“‡๐Ÿ“ˆ๐Ÿ“‰๐Ÿ“Š"); - ncplane_putstr_yx(n, 19, 1, "๐Ÿ“‹๐Ÿ“Œ๐Ÿ“๐Ÿ“Ž๐Ÿ“๐Ÿ“๐Ÿ”’๐Ÿ”“๐Ÿ”๐Ÿ”๐Ÿ”‘๐Ÿ”จ๐Ÿ”ซ๐Ÿ”ง๐Ÿ”ฉ๐Ÿ”—๐Ÿ”ฌ๐Ÿ”ญ๐Ÿ“ก๐Ÿ’‰๐Ÿ’Š๐Ÿšช๐Ÿšฝ๐Ÿšฟ๐Ÿ›๐Ÿšฌ๐Ÿ—ฟ๐Ÿง๐Ÿšฎ๐Ÿšฐ๐Ÿšน๐Ÿšบ"); - ncplane_putstr_yx(n, 20, 1, "๐Ÿšป๐Ÿšผ๐Ÿšพ๐Ÿ›‚๐Ÿ›ƒ๐Ÿ›„๐Ÿ›…๐Ÿšธ๐Ÿšซ๐Ÿšณ๐Ÿšญ๐Ÿšฏ๐Ÿšฑ๐Ÿšท๐Ÿ“ต๐Ÿ”ž๐Ÿ”ƒ๐Ÿ”„๐Ÿ”™๐Ÿ”š๐Ÿ”›๐Ÿ”œ๐Ÿ”๐Ÿ”ฏโ›Ž๐Ÿ”€๐Ÿ”๐Ÿ”‚โฉ๐Ÿ”ผโช"); - ncplane_putstr_yx(n, 21, 1, "โญ\ufe0fโฎ\ufe0fโซ๐Ÿ”ฝโฌ๐ŸŽฆ๐Ÿ”…๐Ÿ”†๐Ÿ“ถ๐Ÿ“ณ๐Ÿ“ดโž•โž–โž—โ“โ”โ•๐Ÿ’ฑ๐Ÿ’ฒ๐Ÿ”ฑ๐Ÿ“›๐Ÿ”ฐโœ…โŒโŽโžฐโžฟ๐Ÿ”Ÿ๐Ÿ” ๐Ÿ”ก๐Ÿ”ข"); - ncplane_putstr_yx(n, 22, 1, "โฏ\ufe0f๐Ÿ”ฃ๐Ÿ”ค๐Ÿ…ฐ๐Ÿ†Ž๐Ÿ…ฑ๐Ÿ†‘๐Ÿ†’๐Ÿ†“๐Ÿ†”๐Ÿ†•๐Ÿ†–๐Ÿ…พ๐Ÿ†—๐Ÿ†˜๐Ÿ†™๐Ÿ†š๐Ÿˆ๐Ÿˆ‚๐Ÿˆท๐Ÿˆถ๐Ÿ‰๐Ÿˆน๐Ÿˆฒ๐Ÿ‰‘๐Ÿˆธ๐Ÿˆด๐Ÿˆณ๐Ÿˆบ๐Ÿˆต๐Ÿ”ด๐Ÿ”ต๐Ÿ”ถ๐Ÿ”ท"); - ncplane_putstr_yx(n, 23, 1, "๐Ÿ”ธ๐Ÿ”น๐Ÿ”บ๐Ÿ”ป๐Ÿ’ ๐Ÿ”˜๐Ÿ”ณ๐Ÿ”ฒ๐Ÿ๐Ÿšฉ๐ŸŽŒโ›งโ›คโ›ขโ›ฆโ›ฅ"); + ncplane_putstr_yx(n, 1, 1, "๐Ÿ˜ƒ๐Ÿ˜„๐Ÿ˜๐Ÿ˜†๐Ÿ˜…๐Ÿ˜‚๐Ÿ˜‰๐Ÿ˜Š๐Ÿ˜‡๐Ÿ˜๐Ÿ˜˜๐Ÿ˜š๐Ÿ˜‹๐Ÿ˜œ๐Ÿ˜๐Ÿ˜๐Ÿ˜ถ๐Ÿ˜๐Ÿ˜’๐Ÿ˜Œ๐Ÿ˜”๐Ÿ˜ช๐Ÿ˜ท๐Ÿ˜ต๐Ÿ˜Ž๐Ÿ˜ฒ๐Ÿ˜ณ๐Ÿ˜จ๐Ÿ˜ฐ๐Ÿ˜ฅ๐Ÿ˜ข"); + ncplane_putstr_yx(n, 2, 1, "๐Ÿ˜ญ๐Ÿ˜ฑ๐Ÿ˜–๐Ÿ˜ฃ๐Ÿ˜ž๐Ÿ˜“๐Ÿ˜ฉ๐Ÿ˜ซ๐Ÿ˜ค๐Ÿ˜ก๐Ÿ˜ ๐Ÿ˜ˆ๐Ÿ‘ฟ๐Ÿ’€๐Ÿ’ฉ๐Ÿ‘น๐Ÿ‘บ๐Ÿ‘ป๐Ÿ‘ฝ๐Ÿ‘พ๐Ÿ˜บ๐Ÿ˜ธ๐Ÿ˜น๐Ÿ˜ป๐Ÿ˜ผ๐Ÿ˜ฝ๐Ÿ™€๐Ÿ˜ฟ๐Ÿ˜พ๐Ÿ™ˆ๐Ÿ™‰"); + ncplane_putstr_yx(n, 3, 1, "๐Ÿ™Š๐Ÿ’‹๐Ÿ’Œ๐Ÿ’˜๐Ÿ’๐Ÿ’–๐Ÿ’—๐Ÿ’“๐Ÿ’ž๐Ÿ’•๐Ÿ’Ÿ๐Ÿ’”๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ๐Ÿ’ฏ๐Ÿ’ข๐Ÿ’ฅ๐Ÿ’ซ๐Ÿ’ฆ๐Ÿ’จ๐Ÿ’ฃ๐Ÿ’ฌ๐Ÿ’ญ๐Ÿ’ค๐Ÿ‘‹โœ‹๐Ÿ‘Œ๐Ÿ‘ˆ๐Ÿ‘‰"); + ncplane_putstr_yx(n, 4, 1, "๐Ÿ‘†๐Ÿ‘‡๐Ÿ‘๐Ÿ‘ŽโœŠ๐Ÿ‘Š๐Ÿ‘๐Ÿ™Œ๐Ÿ‘๐Ÿ™๐Ÿ’…๐Ÿ’ช๐Ÿ‘‚๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘…๐Ÿ‘„๐Ÿ‘ถ๐Ÿ‘ฆ๐Ÿ‘ง๐Ÿ‘ฑ๐Ÿ‘จ๐Ÿ‘ฉ๐Ÿ‘ด๐Ÿ‘ต๐Ÿ™๐Ÿ™Ž๐Ÿ™…๐Ÿ™†๐Ÿ’๐Ÿ™‹"); + ncplane_putstr_yx(n, 5, 1, "๐Ÿ™‡๐Ÿ‘ฎ๐Ÿ’‚๐Ÿ‘ท๐Ÿ‘ธ๐Ÿ‘ณ๐Ÿ‘ฒ๐Ÿ‘ฐ๐Ÿ‘ผ๐ŸŽ…๐Ÿ’†๐Ÿ’‡๐Ÿšถ๐Ÿƒ๐Ÿ’ƒ๐Ÿ‘ฏ๐Ÿ‡๐Ÿ‚๐Ÿ„๐Ÿšฃ๐ŸŠ๐Ÿšด๐Ÿšต๐Ÿ›€๐Ÿ‘ญ๐Ÿ‘ซ๐Ÿ‘ฌ๐Ÿ’๐Ÿ’‘๐Ÿ‘ช๐Ÿ‘ค"); + ncplane_putstr_yx(n, 6, 1, "๐Ÿ‘ฅ๐Ÿ‘ฃ๐Ÿต๐Ÿ’๐Ÿถ๐Ÿ•๐Ÿฉ๐Ÿบ๐Ÿฑ๐Ÿˆ๐Ÿฏ๐Ÿ…๐Ÿ†๐Ÿด๐ŸŽ๐Ÿฎ๐Ÿ‚๐Ÿƒ๐Ÿ„๐Ÿท๐Ÿ–๐Ÿ—๐Ÿฝ๐Ÿ๐Ÿ‘๐Ÿ๐Ÿช๐Ÿซ๐Ÿ˜๐Ÿญ๐Ÿ"); + ncplane_putstr_yx(n, 7, 1, "๐Ÿ€๐Ÿน๐Ÿฐ๐Ÿ‡๐Ÿป๐Ÿจ๐Ÿผ๐Ÿพ๐Ÿ”๐Ÿ“๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿง๐Ÿธ๐ŸŠ๐Ÿข๐Ÿ๐Ÿฒ๐Ÿ‰๐Ÿณ๐Ÿ‹๐Ÿฌ๐ŸŸ๐Ÿ ๐Ÿก๐Ÿ™๐Ÿš๐ŸŒ๐Ÿ›"); + ncplane_putstr_yx(n, 8, 1, "๐Ÿœ๐Ÿ๐Ÿž๐Ÿ’๐ŸŒธ๐Ÿ’ฎ๐ŸŒน๐ŸŒบ๐ŸŒป๐ŸŒผ๐ŸŒท๐ŸŒฑ๐ŸŒฒ๐ŸŒณ๐ŸŒด๐ŸŒต๐ŸŒพ๐ŸŒฟ๐Ÿ€๐Ÿ๐Ÿ‚๐Ÿƒ๐Ÿ‡๐Ÿˆ๐Ÿ‰๐ŸŠ๐Ÿ‹๐ŸŒ๐Ÿ๐ŸŽ๐Ÿ"); + ncplane_putstr_yx(n, 9, 1, "๐Ÿ๐Ÿ‘๐Ÿ’๐Ÿ“๐Ÿ…๐Ÿ†๐ŸŒฝ๐Ÿ„๐ŸŒฐ๐Ÿž๐Ÿ–๐Ÿ—๐Ÿ”๐ŸŸ๐Ÿ•๐Ÿณ๐Ÿฒ๐Ÿฑ๐Ÿ˜๐Ÿ™๐Ÿš๐Ÿ›๐Ÿœ๐Ÿ๐Ÿ ๐Ÿข๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿก๐Ÿฆ"); + ncplane_putstr_yx(n, 10, 1, "๐Ÿง๐Ÿจ๐Ÿฉ๐Ÿช๐ŸŽ‚๐Ÿฐ๐Ÿซ๐Ÿฌ๐Ÿญ๐Ÿฎ๐Ÿฏ๐Ÿผ๐Ÿต๐Ÿถ๐Ÿท๐Ÿธ๐Ÿน๐Ÿบ๐Ÿป๐Ÿด๐Ÿ”ช๐ŸŒ๐ŸŒŽ๐ŸŒ๐ŸŒ๐Ÿ—พ๐ŸŒ‹๐Ÿ—ป๐Ÿ ๐Ÿก๐Ÿข"); + ncplane_putstr_yx(n, 11, 1, "๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿจ๐Ÿฉ๐Ÿช๐Ÿซ๐Ÿฌ๐Ÿญ๐Ÿฏ๐Ÿฐ๐Ÿ’’๐Ÿ—ผ๐Ÿ—ฝ๐ŸŒ๐ŸŒƒ๐ŸŒ„๐ŸŒ…๐ŸŒ†๐ŸŒ‡๐ŸŒ‰๐ŸŽ ๐ŸŽก๐ŸŽข๐Ÿ’ˆ๐ŸŽช๐Ÿš‚๐Ÿšƒ๐Ÿš„๐Ÿš…"); + ncplane_putstr_yx(n, 12, 1, "๐Ÿš†๐Ÿš‡๐Ÿšˆ๐Ÿš‰๐ŸšŠ๐Ÿš๐Ÿšž๐Ÿš‹๐ŸšŒ๐Ÿš๐ŸšŽ๐Ÿš๐Ÿš‘๐Ÿš’๐Ÿš“๐Ÿš”๐Ÿš•๐Ÿš–๐Ÿš—๐Ÿš˜๐Ÿš™๐Ÿšš๐Ÿš›๐Ÿšœ๐Ÿšฒ๐Ÿš๐Ÿšจ๐Ÿšฅ๐Ÿšฆ๐Ÿšง๐Ÿšค"); + ncplane_putstr_yx(n, 13, 1, "๐Ÿšข๐Ÿ’บ๐Ÿš๐ŸšŸ๐Ÿš ๐Ÿšก๐Ÿš€โณโฐโฑโฒ๐Ÿ•›๐Ÿ•ง๐Ÿ•๐Ÿ•œ๐Ÿ•‘๐Ÿ•๐Ÿ•’๐Ÿ•ž๐Ÿ•“๐Ÿ•Ÿ๐Ÿ•”๐Ÿ• ๐Ÿ••๐Ÿ•ก๐Ÿ•–๐Ÿ•ข๐Ÿ•—๐Ÿ•ฃ๐Ÿ•˜๐Ÿ•ค๐Ÿ•™"); + ncplane_putstr_yx(n, 14, 1, "๐Ÿ•ฅ๐Ÿ•š๐Ÿ•ฆ๐ŸŒ‘๐ŸŒ’๐ŸŒ“๐ŸŒ”๐ŸŒ•๐ŸŒ–๐ŸŒ—๐ŸŒ˜๐ŸŒ™๐ŸŒš๐ŸŒ›๐ŸŒœ๐ŸŒ๐ŸŒž๐ŸŒŸ๐ŸŒ ๐ŸŒŒ๐ŸŒ€๐ŸŒˆ๐ŸŒ‚๐Ÿ”ฅ๐Ÿ’ง๐ŸŒŠ๐ŸŽƒ๐ŸŽ„๐ŸŽ†๐ŸŽ‡โœจ"); + ncplane_putstr_yx(n, 15, 1, "๐ŸŽˆ๐ŸŽ‰๐ŸŽŠ๐ŸŽ‹๐ŸŽ๐ŸŽŽ๐ŸŽ๐ŸŽ๐ŸŽ‘๐ŸŽ€๐ŸŽ๐ŸŽซ๐Ÿ†๐Ÿ€๐Ÿˆ๐Ÿ‰๐ŸŽพ๐ŸŽณ๐ŸŽฃ๐ŸŽฝ๐ŸŽฟ๐ŸŽฏ๐ŸŽฑ๐Ÿ”ฎ๐ŸŽฎ๐ŸŽฐ๐ŸŽฒ๐Ÿƒ๐ŸŽด๐ŸŽญ๐ŸŽจ"); + ncplane_putstr_yx(n, 16, 1, "๐Ÿ‘“๐Ÿ‘”๐Ÿ‘•๐Ÿ‘–๐Ÿ‘—๐Ÿ‘˜๐Ÿ‘™๐Ÿ‘š๐Ÿ‘›๐Ÿ‘œ๐Ÿ‘๐ŸŽ’๐Ÿ‘ž๐Ÿ‘Ÿ๐Ÿ‘ ๐Ÿ‘ก๐Ÿ‘ข๐Ÿ‘‘๐Ÿ‘’๐ŸŽฉ๐ŸŽ“๐Ÿ’„๐Ÿ’๐Ÿ’Ž๐Ÿ”‡๐Ÿ”ˆ๐Ÿ”‰๐Ÿ”Š๐Ÿ“ข๐Ÿ“ฃ๐Ÿ“ฏ"); + ncplane_putstr_yx(n, 17, 1, "๐Ÿ””๐Ÿ”•๐ŸŽผ๐ŸŽต๐ŸŽถ๐ŸŽค๐ŸŽง๐Ÿ“ป๐ŸŽท๐ŸŽธ๐ŸŽน๐ŸŽบ๐ŸŽป๐Ÿ“ฑ๐Ÿ“ฒ๐Ÿ“ž๐Ÿ“Ÿ๐Ÿ“ ๐Ÿ”‹๐Ÿ”Œ๐Ÿ’ป๐Ÿ’ฝ๐Ÿ’พ๐Ÿ’ฟ๐Ÿ“€๐ŸŽฅ๐ŸŽฌ๐Ÿ“บ๐Ÿ“ท๐Ÿ“น๐Ÿ“ผ"); + ncplane_putstr_yx(n, 18, 1, "๐Ÿ”๐Ÿ”Ž๐Ÿ’ก๐Ÿ”ฆ๐Ÿฎ๐Ÿ“”๐Ÿ“•๐Ÿ“–๐Ÿ“—๐Ÿ“˜๐Ÿ“™๐Ÿ“š๐Ÿ““๐Ÿ“’๐Ÿ“ƒ๐Ÿ“œ๐Ÿ“„๐Ÿ“ฐ๐Ÿ“‘๐Ÿ”–๐Ÿ’ฐ๐Ÿ’ด๐Ÿ’ต๐Ÿ’ถ๐Ÿ’ท๐Ÿ’ธ๐Ÿ’ณ๐Ÿ’น๐Ÿ“ง๐Ÿ“จ๐Ÿ“ฉ"); + ncplane_putstr_yx(n, 19, 1, "๐Ÿ“ค๐Ÿ“ฅ๐Ÿ“ฆ๐Ÿ“ซ๐Ÿ“ช๐Ÿ“ฌ๐Ÿ“ญ๐Ÿ“ฎ๐Ÿ“๐Ÿ’ผ๐Ÿ“๐Ÿ“‚๐Ÿ“…๐Ÿ“†๐Ÿ“‡๐Ÿ“ˆ๐Ÿ“‰๐Ÿ“Š๐Ÿ“‹๐Ÿ“Œ๐Ÿ“๐Ÿ“Ž๐Ÿ“๐Ÿ“๐Ÿ”’๐Ÿ”“๐Ÿ”๐Ÿ”๐Ÿ”‘๐Ÿ”จ๐Ÿ”ซ"); + ncplane_putstr_yx(n, 20, 1, "๐Ÿ”ง๐Ÿ”ฉ๐Ÿ”—๐Ÿ”ฌ๐Ÿ”ญ๐Ÿ“ก๐Ÿ’‰๐Ÿ’Š๐Ÿšช๐Ÿšฝ๐Ÿšฟ๐Ÿ›๐Ÿšฌ๐Ÿ—ฟ๐Ÿง๐Ÿšฎ๐Ÿšฐ๐Ÿšน๐Ÿšบ๐Ÿšป๐Ÿšผ๐Ÿšพ๐Ÿ›‚๐Ÿ›ƒ๐Ÿ›„๐Ÿ›…๐Ÿšธ๐Ÿšซ๐Ÿšณ๐Ÿšญ๐Ÿšฏ"); + ncplane_putstr_yx(n, 21, 1, "๐Ÿšฑ๐Ÿšท๐Ÿ“ต๐Ÿ”ž๐Ÿ”ƒ๐Ÿ”„๐Ÿ”™๐Ÿ”š๐Ÿ”›๐Ÿ”œ๐Ÿ”๐Ÿ”ฏโ›Ž๐Ÿ”€๐Ÿ”๐Ÿ”‚โฉ๐Ÿ”ผโชโญ\ufe0fโฎ\ufe0fโซ๐Ÿ”ฝโฌ๐ŸŽฆ๐Ÿ”…๐Ÿ”†๐Ÿ“ถ๐Ÿ“ณ๐Ÿ“ดโž•โž–"); + ncplane_putstr_yx(n, 22, 1, "โž—โ“โ”โ•๐Ÿ’ฑ๐Ÿ’ฒ๐Ÿ”ฑ๐Ÿ“›๐Ÿ”ฐโœ…โŒโŽโžฐโžฟ๐Ÿ”Ÿ๐Ÿ” ๐Ÿ”ก๐Ÿ”ขโฏ\ufe0f๐Ÿ”ฃ๐Ÿ”ค๐Ÿ…ฐ๐Ÿ†Ž๐Ÿ…ฑ๐Ÿ†‘๐Ÿ†’๐Ÿ†“๐Ÿ†”๐Ÿ†•๐Ÿ†–๐Ÿ…พ๐Ÿ†—๐Ÿ†˜"); + ncplane_putstr_yx(n, 23, 1, "๐Ÿ†™๐Ÿ†š๐Ÿˆ๐Ÿˆ‚๐Ÿˆท๐Ÿˆถ๐Ÿ‰๐Ÿˆน๐Ÿˆฒ๐Ÿ‰‘๐Ÿˆธ๐Ÿˆด๐Ÿˆณ๐Ÿˆบ๐Ÿˆต๐Ÿ”ด๐Ÿ”ต๐Ÿ”ถ๐Ÿ”ท๐Ÿ”ธ๐Ÿ”น๐Ÿ”บ๐Ÿ”ป๐Ÿ’ ๐Ÿ”˜๐Ÿ”ณ๐Ÿ”ฒ๐Ÿ๐Ÿšฉ๐ŸŽŒ"); + ncplane_putstr_yx(n, 24, 1, "โ›งโ›คโ›ขโ›ฆโ›ฅ"); return n; } @@ -3511,10 +3512,10 @@ unicode7emoji2(struct ncplane* title, int y){ struct ncplane* makegroup(struct ncplane* title, int y, const char* emoji, const char* name){ int cols = mbswidth(emoji); - if(cols < 0){ // take a wild guess on mbswidth() error. + if(cols < 0){ // take a wild guess on mbswidth() error from old libcs, sigh. cols = strlen(emoji) * 3 / 5; // best by test } - struct ncplane* n = mojiplane(title, y, 2 + (cols + (planewidth - 3)) / (planewidth - 2), name); + struct ncplane* n = mojiplane(title, y, 3 + cols / (planewidth - 12), name); if(n == NULL){ return NULL; } @@ -3705,9 +3706,12 @@ int mojibake_demo(struct notcurses* nc){ break; } ncplane_dim_yx(planes[u], &leny, &lenx); - if(y == 1){ + if(y == 2){ if(leny > 1){ - if(ncplane_resize(planes[u], 1, 0, leny - 1, lenx, -1, 0, leny - 1, lenx)){ + if(ncplane_resize(planes[u], 1, 0, leny - 1, lenx, 0, 0, leny - 1, lenx)){ + goto err; + } + if(ncplane_move_yx(planes[u], y, x)){ goto err; } }else{ diff --git a/src/demo/zoo.c b/src/demo/zoo.c index 1d6d92727..44262bef8 100644 --- a/src/demo/zoo.c +++ b/src/demo/zoo.c @@ -137,6 +137,7 @@ draw_background(struct notcurses* nc){ ncvisual_destroy(ncv); return -1; } + ncplane_greyscale(n); } return 0; } diff --git a/src/lib/internal.h b/src/lib/internal.h index c38ef87d6..c26fed105 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -381,12 +381,14 @@ int ncvisual_init(int loglevel); static inline int fbcellidx(int row, int rowlen, int col){ +//fprintf(stderr, "row: %d rowlen: %d col: %d\n", row, rowlen, col); return row * rowlen + col; } // take a logical 'y' and convert it to the virtual 'y'. see HACKING.md. static inline int logical_to_virtual(const ncplane* n, int y){ +//fprintf(stderr, "y: %d n->logrow: %d n->leny: %d\n", y, n->logrow, n->leny); return (y + n->logrow) % n->leny; } diff --git a/src/poc/firstline.c b/src/poc/firstline.c deleted file mode 100644 index a231e1864..000000000 --- a/src/poc/firstline.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include "notcurses/notcurses.h" - -int main(void){ - struct notcurses_options nopts = { - .flags = NCOPTION_NO_ALTERNATE_SCREEN, - }; - struct notcurses* nc = notcurses_init(&nopts, NULL); - if(nc == NULL){ - return EXIT_FAILURE; - } - if(ncplane_putstr_aligned(notcurses_stdplane(nc), 0, NCALIGN_CENTER, - "Heute Die Welt, Morgens Das Sonnensystem!") <= 0){ - notcurses_stop(nc); - return EXIT_FAILURE; - } - if(ncplane_putstr_aligned(notcurses_stdplane(nc), 2, NCALIGN_CENTER, - "Heute Die Welt, Morgens Das Sonnensystem!") <= 0){ - notcurses_stop(nc); - return EXIT_FAILURE; - } - notcurses_render(nc); - sleep(5); - notcurses_stop(nc); - return EXIT_SUCCESS; -}