1# SPDX-License-Identifier: Apache-2.0 2 3# Copyright 2020, 2021 igo95862 4 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8 9# http://www.apache.org/licenses/LICENSE-2.0 10 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16from __future__ import annotations 17 18from typing import Optional, Tuple 19 20# Stub file for typing and docs 21 22# region misc 23 24 25def notcurses_version() -> str: 26 """Get human readable string of running Notcurses version.""" 27 raise NotImplementedError('Stub') 28 29 30def notcurses_version_components() -> Tuple[int, int, int, int]: 31 """Get a tuple of major, minor, patch, tweak integer 32 of the running Notcurses version""" 33 raise NotImplementedError('Stub') 34 35 36def ncstrwidth(text: str, /) -> int: 37 """Returns the number of columns occupied by a string, 38 or -1 if a non-printable/illegal character is encountered.""" 39 raise NotImplementedError('Stub') 40 41 42# endregion misc 43 44# region ncchannel 45 46 47def ncchannels_rgb_initializer( 48 fr: int, fg: int, fb: int, 49 br: int, bg: int, bb: int, 50 /) -> int: 51 """Initialize a 64-bit ncchannel pair with specified RGB fg/bg.""" 52 raise NotImplementedError('Stub') 53 54 55def ncchannel_rgb_initializer( 56 r: int, g: int, b: int, 57 /) -> int: 58 """Initialize a 32-bit single ncchannel with specified RGB.""" 59 raise NotImplementedError('Stub') 60 61 62def ncchannel_r(channel: int, /) -> int: 63 """Extract the 8-bit red component from a 32-bit ncchannel.""" 64 raise NotImplementedError('Stub') 65 66 67def ncchannel_g(channel: int, /) -> int: 68 """Extract the 8-bit green component from a 32-bit ncchannel.""" 69 raise NotImplementedError('Stub') 70 71 72def ncchannel_b(channel: int, /) -> int: 73 """Extract the 8-bit blue component from a 32-bit ncchannel.""" 74 raise NotImplementedError('Stub') 75 76 77def ncchannel_rgb8(channel: int, /) -> Tuple[int, int, int]: 78 """Extract the three 8-bit R/G/B components from a 32-bit ncchannel.""" 79 raise NotImplementedError('Stub') 80 81 82def ncchannel_set_rgb8(channel: int, r: int, g: int, b: int, /) -> int: 83 """Set the three 8-bit components of a 32-bit ncchannel. 84 85 Mark it as not using the default color. 86 Retain the other bits unchanged. 87 """ 88 raise NotImplementedError('Stub') 89 90 91def ncchannel_set_rgb8_clipped(channel: int, r: int, g: int, b: int, /) -> int: 92 """Set the three 8-bit components of a 32-bit ncchannel. 93 94 Mark it as not using the default color. 95 Retain the other bits unchanged. r, g, and b will be clipped to 96 the range [0..255]. 97 """ 98 raise NotImplementedError('Stub') 99 100 101def ncchannel_set(channel: int, rdb: int, /) -> int: 102 """Set the three 8-bit components of a 32-bit ncchannel 103 from a provide an assembled, packed 24 bits of rgb. 104 """ 105 raise NotImplementedError('Stub') 106 107 108def ncchannel_alpha(channel: int, /) -> int: 109 """Extract 2 bits of foreground alpha from channel""" 110 raise NotImplementedError('Stub') 111 112 113def ncchannel_palindex(channel: int, /) -> int: 114 """Extract 2 bits of palindex from channel""" 115 raise NotImplementedError('Stub') 116 117 118def ncchannel_set_alpha(channel: int, alpha: int, /) -> int: 119 """Set the 2-bit alpha component of the 32-bit channel.""" 120 raise NotImplementedError('Stub') 121 122 123def ncchannel_set_palindex(channel: int, palindex: int, /) ->int: 124 """Set the 2-bit palindex of the 32-bit channel.""" 125 raise NotImplementedError('Stub') 126 127 128def ncchannel_default_p(channel: int, /) -> bool: 129 """Is this ncchannel using the \"default color\" rather 130 than RGB/palette-indexed? 131 """ 132 raise NotImplementedError('Stub') 133 134 135def ncchannel_palindex_p(channel: int, /) -> bool: 136 """Is this ncchannel using palette-indexed color rather than RGB?""" 137 raise NotImplementedError('Stub') 138 139 140def ncchannel_set_default(channel: int, /) ->int: 141 """Mark the ncchannel as using its default color, which also 142 marks it opaque.""" 143 raise NotImplementedError('Stub') 144 145 146def ncchannels_bchannel(channel: int, /) -> int: 147 """Extract the 32-bit background ncchannel from a channel pair.""" 148 raise NotImplementedError('Stub') 149 150 151def ncchannels_fchannel(channel: int, /) -> int: 152 """Extract the 32-bit foreground ncchannel from a channel pair.""" 153 raise NotImplementedError('Stub') 154 155 156def ncchannels_set_bchannel(channels: int, channel: int, /) -> int: 157 """Set the 32-bit background ncchannel of a channels pair.""" 158 raise NotImplementedError('Stub') 159 160 161def ncchannels_set_fchannel(channels: int, channel: int, /) -> int: 162 """Set the 32-bit foreground ncchannel of a channels pair.""" 163 raise NotImplementedError('Stub') 164 165 166def ncchannels_combine(fchan: int, bchan: int, /) ->int: 167 """Combine foreground and background channels in to channels pair.""" 168 raise NotImplementedError('Stub') 169 170 171def ncchannels_fg_palindex(channels: int, /) -> int: 172 """Extract the 2-bit palindex from foreground channel of channels pair.""" 173 raise NotImplementedError('Stub') 174 175 176def ncchannels_bg_palindex(channels: int, /) -> int: 177 """Extract the 2-bit palindex from background channel of channels pair.""" 178 raise NotImplementedError('Stub') 179 180 181def ncchannels_fg_rgb(channels: int, /) -> int: 182 """Extract 24 bits of foreground RGB from channels pair.""" 183 raise NotImplementedError('Stub') 184 185 186def ncchannels_bg_rgb(channels: int, /) -> int: 187 """Extract 24 bits of background RGB from channels pair.""" 188 raise NotImplementedError('Stub') 189 190 191def ncchannels_fg_alpha(channels: int, /) -> int: 192 """Extract the 2-bit alpha from foreground channel of channels pair.""" 193 raise NotImplementedError('Stub') 194 195 196def ncchannels_bg_alpha(channels: int, /) -> int: 197 """Extract the 2-bit alpha from background channel of channels pair.""" 198 raise NotImplementedError('Stub') 199 200 201def ncchannels_fg_rgb8(channels: int, /) -> Tuple[int, int, int]: 202 """Extract 24 bits of foreground RGB from channels pair, split into 203 subncchannels.""" 204 raise NotImplementedError('Stub') 205 206 207def ncchannels_bg_rgb8(channels: int, /) -> Tuple[int, int, int]: 208 """Extract 24 bits of background RGB from channels pair, split into 209 subncchannels.""" 210 raise NotImplementedError('Stub') 211 212 213def ncchannels_set_fg_rgb8(channels: int, r: int, g: int, b: int, /) -> int: 214 """Set the red, green and blue of foreground channel of channels pair.""" 215 raise NotImplementedError('Stub') 216 217 218def ncchannels_set_fg_rgb8_clipped(channels: int, r: int, g: int, b: int, 219 /) -> int: 220 """Set the red, green and blue of foreground channel of channels pair. 221 222 Clipped to 0..255 223 """ 224 raise NotImplementedError('Stub') 225 226 227def ncchannels_set_fg_alpha(channels: int, alpha: int, /) -> int: 228 """Set the 2-bit alpha of the foreground channel of channels pair.""" 229 raise NotImplementedError('Stub') 230 231 232def ncchannels_set_fg_palindex(channels: int, alpha: int, /) -> int: 233 """Set the 2-bit paliindex of the foreground channel of channels pair.""" 234 raise NotImplementedError('Stub') 235 236 237def ncchannels_set_fg_rgb(channels: int, rgb: int, /) -> int: 238 """Set the RGB assembled 24 bit channel of the foreground channel of 239 channels pair.""" 240 raise NotImplementedError('Stub') 241 242 243def ncchannels_set_bg_rgb8(channels: int, r: int, g: int, b: int, /) -> int: 244 """Set the red, green and blue of background channel of channels pair.""" 245 raise NotImplementedError('Stub') 246 247 248def ncchannels_set_bg_rgb8_clipped(channels: int, r: int, g: int, b: int, 249 /) -> int: 250 """Set the red, green and blue of background channel of channels pair. 251 252 Clipped to 0..255 253 """ 254 raise NotImplementedError('Stub') 255 256 257def ncchannels_set_bg_alpha(channels: int, alpha: int, /) -> int: 258 """Set the 2-bit alpha of the background channel of channels pair.""" 259 raise NotImplementedError('Stub') 260 261 262def ncchannels_set_bg_palindex(channels: int, alpha: int, /) -> int: 263 """Set the 2-bit paliindex of the background channel of channels pair.""" 264 raise NotImplementedError('Stub') 265 266 267def ncchannels_set_bg_rgb(channels: int, rgb: int, /) -> int: 268 """Set the RGB assembled 24 bit channel of the background channel of 269 channels pair.""" 270 raise NotImplementedError('Stub') 271 272 273def ncchannels_fg_default_p(channels: int, /) ->bool: 274 """Is the foreground using the default color?""" 275 raise NotImplementedError('Stub') 276 277 278def ncchannels_fg_palindex_p(channels: int, /) ->bool: 279 """Is the foreground using indexed palette color?""" 280 raise NotImplementedError('Stub') 281 282 283def ncchannels_bg_default_p(channels: int, /) ->bool: 284 """Is the foreground using the default color?""" 285 raise NotImplementedError('Stub') 286 287 288def ncchannels_bg_palindex_p(channels: int, /) ->bool: 289 """Is the foreground using indexed palette color?""" 290 raise NotImplementedError('Stub') 291 292 293def ncchannels_set_fg_default(channels: int, /) -> int: 294 """Mark the foreground ncchannel as using its default color.""" 295 raise NotImplementedError('Stub') 296 297 298def ncchannels_set_bg_default(channels: int, /) -> int: 299 """Mark the background ncchannel as using its default color.""" 300 raise NotImplementedError('Stub') 301 302# endregion ncchannel 303 304 305class Notcurses: 306 """Notcurses context.""" 307 308 def __init__( 309 self, 310 tty_fd: int = 0, 311 term_type: str = "", 312 renderfd: int = 0, 313 loglevel: int = 0, 314 margins_str: str = "", 315 margin_t: int = 0, margin_r: int = 0, 316 margin_b: int = 0, margin_l: int = 0, 317 flags: int = 0): 318 """Initialize new Notcruses context.""" 319 raise NotImplementedError('Stub') 320 321 def drop_planes(self) -> None: 322 """Destroy all ncplanes other than the stdplane.""" 323 raise NotImplementedError('Stub') 324 325 def render(self) -> None: 326 """Renders and rasterizes the standard pile in one shot. 327 328 Blocking call. 329 """ 330 raise NotImplementedError('Stub') 331 332 def top(self) -> NcPlane: 333 """Return the topmost ncplane of the standard pile.""" 334 raise NotImplementedError('Stub') 335 336 def bottom(self) -> NcPlane: 337 """Return the bottommost ncplane of the standard pile.""" 338 raise NotImplementedError('Stub') 339 340 def getc(self) -> str: 341 """Get a single unicode codepoint of input.""" 342 raise NotImplementedError('Stub') 343 344 def inputready_fd(self) -> int: 345 """Get a file descriptor suitable for input event poll.""" 346 raise NotImplementedError('Stub') 347 348 def getc_nblock(self) -> str: 349 """Get input event without blocking. If no event is ready, 350 returns None.""" 351 raise NotImplementedError('Stub') 352 353 def getc_blocking(self) -> str: 354 """Get input event completely blocking until and event or signal 355 received.""" 356 raise NotImplementedError('Stub') 357 358 def mouse_enable(self) -> None: 359 """Enable the mouse in \"button-event tracking\" mode with 360 focus detection and UTF8-style extended coordinates.""" 361 raise NotImplementedError('Stub') 362 363 def mouse_disable(self) -> None: 364 """Disable mouse events. 365 366 Any events in the input queue can still be delivered. 367 """ 368 raise NotImplementedError('Stub') 369 370 def linesigs_disable(self) -> None: 371 """Disable signals originating from the terminal's line discipline. 372 373 They are enabled by default. 374 """ 375 raise NotImplementedError('Stub') 376 377 def linesigs_enable(self) -> None: 378 """Restore signals originating from the terminal's line discipline.""" 379 raise NotImplementedError('Stub') 380 381 def refresh(self) -> Tuple[int, int]: 382 """Refresh the physical screen to match what was last rendered. 383 384 Return the new dimensions. 385 """ 386 raise NotImplementedError('Stub') 387 388 def stdplane(self) -> NcPlane: 389 """Get a reference to the standard plane. 390 391 The standard plane always exists, and its origin is always at 392 the uppermost, leftmost cell of the terminal. 393 """ 394 raise NotImplementedError('Stub') 395 396 def stddim_yx(self) -> Tuple[NcPlane, int, int]: 397 """Get standard plane plus dimensions.""" 398 raise NotImplementedError('Stub') 399 400 def term_dim_yx(self) -> Tuple[int, int]: 401 """Return our current idea of the terminal dimensions 402 in rows and cols.""" 403 raise NotImplementedError('Stub') 404 405 def at_yx(self, yoff: int, xoff: int, /) -> Tuple[int, int]: 406 """Retrieve the contents of the specified cells stylemask and channels 407 as last rendered""" 408 raise NotImplementedError('Stub') 409 410 def pile_create(self, y_pos: int = 0, x_pos: int = 0, 411 rows: int = 0, cols: int = 0, 412 name: str = "", 413 flags: int = 0, 414 margin_b: int = 0, margin_r: int = 0) -> NcPlane: 415 """Same as ncplane_create(), but creates a new pile. 416 417 The returned plane will be the top, bottom, and root of this new pile. 418 """ 419 raise NotImplementedError('Stub') 420 421 def supported_styles(self) -> int: 422 """Returns a 16-bit bitmask of supported curses-style attributes.""" 423 raise NotImplementedError('Stub') 424 425 def palette_size(self) -> int: 426 """Returns the number of simultaneous colors claimed 427 to be supported.""" 428 raise NotImplementedError('Stub') 429 430 def cantruecolor(self) -> bool: 431 """Can we directly specify RGB values per cell, 432 or only use palettes?""" 433 raise NotImplementedError('Stub') 434 435 def canfade(self) -> bool: 436 """Can we fade?""" 437 raise NotImplementedError('Stub') 438 439 def canchangecolor(self) -> bool: 440 """Can we set the \"hardware\" palette? """ 441 raise NotImplementedError('Stub') 442 443 def canopen_images(self) -> bool: 444 """Can we load images? 445 446 This requires being built against FFmpeg/OIIO. 447 """ 448 raise NotImplementedError('Stub') 449 450 def canopen_videos(self) -> bool: 451 """Can we load videos? 452 453 This requires being built against FFmpeg. 454 """ 455 raise NotImplementedError('Stub') 456 457 def canutf8(self) -> bool: 458 """Is our encoding UTF-8? 459 460 Requires LANG being set to a UTF8 locale. 461 """ 462 raise NotImplementedError('Stub') 463 464 def cansextant(self) -> bool: 465 """Can we reliably use Unicode 13 sextants?""" 466 raise NotImplementedError('Stub') 467 468 def canbraille(self) -> bool: 469 """Can we reliably use Unicode Braille?""" 470 raise NotImplementedError('Stub') 471 472 def check_pixel_support(self) -> bool: 473 """This function must successfully return before NCBLIT_PIXEL 474 is available. 475 """ 476 raise NotImplementedError('Stub') 477 478 def stats(self) -> None: 479 """Acquire an atomic snapshot of the Notcurses stats.""" 480 raise NotImplementedError('Stub') 481 482 def stats_reset(self) -> None: 483 """Reset all cumulative stats (immediate ones, such as fbbytes, 484 are not reset) and returning a copy before reset.""" 485 raise NotImplementedError('Stub') 486 487 def cursor_enable(self) -> None: 488 """Enable the terminal's cursor, if supported""" 489 raise NotImplementedError('Stub') 490 491 def cursor_disable(self) -> None: 492 """Disable the terminal's cursor.""" 493 raise NotImplementedError('Stub') 494 495 496class NcPlane: 497 """Notcurses Plane""" 498 499 def create(self, rows: int, cols: int, 500 y_pos: int = 0, x_pos: int = 0, 501 name: str = "", 502 flags: int = 0, 503 margin_b: int = 0, margin_r: int = 0,) -> None: 504 """Create a new ncplane bound to this plane.""" 505 raise NotImplementedError('Stub') 506 507 def destroy(self) -> None: 508 """Destroy the plane. 509 510 Do NOT try to use the plane after its been 511 destoryed. 512 """ 513 raise NotImplementedError('Stub') 514 515 def dim_yx(self) -> Tuple[int, int]: 516 """Return the dimensions of this NcPlane.""" 517 raise NotImplementedError('Stub') 518 519 def dim_x(self) -> int: 520 """Return X dimension of this NcPlane.""" 521 raise NotImplementedError('Stub') 522 523 def dim_y(self) -> int: 524 """Return Y dimension of this NcPlane.""" 525 raise NotImplementedError('Stub') 526 527 def pixel_geom(self) -> Tuple[int, int, int, int, int, int]: 528 """Retrieve pixel geometry for the display region, each cell 529 and the maximum displayable bitmap.""" 530 raise NotImplementedError('Stub') 531 532 def set_resizecb(self) -> None: 533 """Replace the ncplane's existing resize callback 534 535 TODO 536 """ 537 raise NotImplementedError('Stub') 538 539 def reparent(self, new_parent: NcPlane) -> None: 540 """Plane will be unbound from its parent plane 541 and will be made a bound child of passed plane.""" 542 raise NotImplementedError('Stub') 543 544 def reparent_family(self, new_parent: NcPlane) -> None: 545 """The same as reparent(), except any planes bound 546 to this plane come along with it to its new destination.""" 547 raise NotImplementedError('Stub') 548 549 def dup(self) -> NcPlane: 550 """Duplicate an existing ncplane.""" 551 raise NotImplementedError('Stub') 552 553 def translate(self, 554 another_plane: NcPlane, 555 /) -> Tuple[int, int]: 556 """Return coordinates relative to another plane.""" 557 raise NotImplementedError('Stub') 558 559 def translate_abs(self) -> bool: 560 """Check if coordinates are in the plane.""" 561 raise NotImplementedError('Stub') 562 563 def set_scrolling(self, state: bool, /) -> None: 564 """All planes are created with scrolling disabled.""" 565 raise NotImplementedError('Stub') 566 567 def resize(self, keepy: int, keepx: int, 568 keepleny: int, keeplenx: int, 569 yoff: int, xoff: int, 570 ylen: int, xlen: int,) -> None: 571 """Resize the ncplane.""" 572 raise NotImplementedError('Stub') 573 574 def resize_simple(self, ylen: int, xlen: int, /) -> None: 575 """Resize the plane, retaining what data we can. 576 577 Keep the origin where it is. 578 """ 579 raise NotImplementedError('Stub') 580 581 def set_base_cell(self) -> None: 582 """Set the plane's base NcCell. 583 584 TODO 585 """ 586 raise NotImplementedError('Stub') 587 588 def set_base(self) -> None: 589 """Set the plane's base NcCell. 590 591 TODO 592 """ 593 raise NotImplementedError('Stub') 594 595 def base(self) -> None: 596 """Extract the plane's base NcCell. 597 598 TODO 599 """ 600 raise NotImplementedError('Stub') 601 602 def move_yx(self, y: int, x: int, /) -> None: 603 """Move this plane relative to the standard plane, 604 or the plane to which it is bound.""" 605 raise NotImplementedError('Stub') 606 607 def yx(self) -> Tuple[int, int]: 608 """Get the origin of the plane relative to its 609 bound plane, or pile.""" 610 raise NotImplementedError('Stub') 611 612 def y(self) -> int: 613 """Get the Y origin of the plane relative to its 614 bound plane, or pile.""" 615 raise NotImplementedError('Stub') 616 617 def x(self) -> int: 618 """Get the X origin of the plane relative to its 619 bound plane, or pile.""" 620 raise NotImplementedError('Stub') 621 622 def abs_yx(self) -> Tuple[int, int]: 623 """Get the origin of plane relative to its pile.""" 624 raise NotImplementedError('Stub') 625 626 def abs_y(self) -> int: 627 """Get the Y origin of plane relative to its pile.""" 628 raise NotImplementedError('Stub') 629 630 def abs_x(self) -> int: 631 """Get the X origin of plane relative to its pile.""" 632 raise NotImplementedError('Stub') 633 634 def parent(self) -> Optional[NcPlane]: 635 """Get the plane to which the plane is bound or None 636 if plane does not have parent. 637 """ 638 raise NotImplementedError('Stub') 639 640 def descendant_p(self, ancestor: NcPlane, /) -> None: 641 """Return True if plane is a proper descendent of passed 642 'ancestor' plane. 643 """ 644 raise NotImplementedError('Stub') 645 646 def move_top(self) -> None: 647 """Splice ncplane out of the z-buffer, and reinsert it at the top.""" 648 raise NotImplementedError('Stub') 649 650 def move_bottom(self) -> None: 651 """Splice ncplane out of the z-buffer, and reinsert it at 652 the bottom. 653 """ 654 raise NotImplementedError('Stub') 655 656 def move_above(self, plane: NcPlane, /) -> None: 657 """Splice ncplane out of the z-buffer, and reinsert it above passed 658 plane.""" 659 raise NotImplementedError('Stub') 660 661 def move_below(self, plane: NcPlane, /) -> None: 662 """Splice ncplane out of the z-buffer, and reinsert it bellow 663 passed plane. 664 """ 665 raise NotImplementedError('Stub') 666 667 def below(self) -> Optional[NcPlane]: 668 """Return the plane below this one, or None if this is 669 at the bottom. 670 """ 671 raise NotImplementedError('Stub') 672 673 def above(self) -> Optional[NcPlane]: 674 """Return the plane above this one, or None if this is at the top.""" 675 raise NotImplementedError('Stub') 676 677 def rotate_cw(self) -> None: 678 """Rotate the plane π/2 radians clockwise.""" 679 raise NotImplementedError('Stub') 680 681 def rotate_ccw(self) -> None: 682 """Rotate the plane π/2 radians counterclockwise.""" 683 raise NotImplementedError('Stub') 684 685 def at_cursor(self) -> Tuple[str, int, int]: 686 """Retrieve the current contents of the cell under the cursor.""" 687 raise NotImplementedError('Stub') 688 689 def at_cursor_cell(self) -> None: 690 """Retrieve the current contents of the cell under the cursor. 691 692 TODO 693 """ 694 raise NotImplementedError('Stub') 695 696 def at_yx(self, y: int, x: int, /) -> Tuple[str, int, int]: 697 """Retrieve the current contents of the specified cell.""" 698 raise NotImplementedError('Stub') 699 700 def at_yx_cell(self) -> None: 701 """"Retrieve the current contents of the specified cell" 702 703 TODO 704 """ 705 raise NotImplementedError('Stub') 706 707 def contents(self, begy: int, begx: int, 708 leny: int = -1, lenx: int = -1) -> str: 709 """Create a flat string from the EGCs of the selected region 710 of the ncplane. 711 """ 712 raise NotImplementedError('Stub') 713 714 def center_abs(self) -> Tuple[int, int]: 715 """Return the plane center absolute coordiantes.""" 716 raise NotImplementedError('Stub') 717 718 def halign(self, align: int, collumn: int, /) -> int: 719 """Return the column at which cols ought start in 720 order to be aligned. 721 """ 722 raise NotImplementedError('Stub') 723 724 def valign(self, align: int, collumn: int, /) -> int: 725 """Return the row at which rows ought start in 726 order to be aligned. 727 """ 728 raise NotImplementedError('Stub') 729 730 def cursor_move_yx(self, y: int, x: int, /) -> None: 731 """Move the cursor to the specified position 732 (the cursor needn't be visible). 733 """ 734 raise NotImplementedError('Stub') 735 736 def home(self) -> None: 737 """Move the cursor to 0, 0.""" 738 raise NotImplementedError('Stub') 739 740 def cursor_yx(self) -> Tuple[int, int]: 741 """Get the current position of the cursor within plane.""" 742 raise NotImplementedError('Stub') 743 744 def channels(self) -> int: 745 """Get the current channels or attribute word.""" 746 raise NotImplementedError('Stub') 747 748 def styles(self) -> int: 749 """Return the current styling for this ncplane.""" 750 raise NotImplementedError('Stub') 751 752 def putc_yx(self) -> None: 753 """Replace the cell at the specified coordinates with 754 the provided cell. 755 756 TODO 757 """ 758 raise NotImplementedError('Stub') 759 760 def putc(self) -> None: 761 """Replace cell at the current cursor location. 762 763 TODO 764 """ 765 raise NotImplementedError('Stub') 766 767 def putchar_yx(self, y: int, x: int, char: str, /) -> None: 768 """Replace the cell at the specified coordinates 769 with the provided 7-bit char.""" 770 raise NotImplementedError('Stub') 771 772 def putchar(self, char: str) -> None: 773 """Replace the cell at the current cursor location.""" 774 raise NotImplementedError('Stub') 775 776 def putchar_stained(self, char: str, /) -> None: 777 """Replace the EGC underneath us, but retain the styling.""" 778 raise NotImplementedError('Stub') 779 780 def putegc_yx(self, y: int, x: int, egc: str, /) -> int: 781 """Replace the cell at the specified coordinates 782 with the provided EGC. 783 784 Returns number of collumns the cursor has advanced. 785 """ 786 raise NotImplementedError('Stub') 787 788 def putegc(self, egc: str, /) -> int: 789 """Replace the cell at the current cursor location 790 with the provided EGC 791 792 Returns number of collumns the cursor has advanced. 793 """ 794 raise NotImplementedError('Stub') 795 796 def putegc_stained(self, egc: str, /) -> int: 797 """Replace the EGC underneath us, but retain the styling. 798 799 Returns number of collumns the cursor has advanced. 800 """ 801 raise NotImplementedError('Stub') 802 803 def putstr_yx(self, y: int, x: int, egc: str, /) -> None: 804 """Write a series of EGCs to the location, 805 using the current style. 806 """ 807 raise NotImplementedError('Stub') 808 809 def putstr(self, egc: str, /) -> None: 810 """Write a series of EGCs to the current location, 811 using the current style. 812 """ 813 raise NotImplementedError('Stub') 814 815 def putstr_aligned(self, y: int, align: int, egc: str, /) -> None: 816 """Write a series of EGCs to the current location, 817 using the alignment. 818 """ 819 raise NotImplementedError('Stub') 820 821 def putstr_stained(self, egc: str, /) -> None: 822 """Replace a string's worth of glyphs at the current 823 cursor location, but retain the styling.""" 824 raise NotImplementedError('Stub') 825 826 def putnstr_yx(self, y: int, x: int, size: int, egc: str, /) -> None: 827 """"Write a series of EGCs to the location, using the current 828 style. 829 """ 830 raise NotImplementedError('Stub') 831 832 def putnstr(self, size: int, egc: str, /) -> None: 833 """Write a series of EGCs to the current location, 834 using the current style. 835 """ 836 raise NotImplementedError('Stub') 837 838 def putnstr_aligned(self, y: int, align: int, 839 size: int, egc: str, /) -> None: 840 """Write a series of EGCs to the current location, 841 using the alignment. 842 """ 843 raise NotImplementedError('Stub') 844 845 def puttext(self, y: int, align: int, /) -> int: 846 """Write the specified text to the plane, breaking lines sensibly, 847 beginning at the specified line. 848 849 Returns the number of columns written. 850 """ 851 raise NotImplementedError('Stub') 852 853 def box(self) -> None: 854 """Draw a box with its upper-left corner 855 at the current cursor position. 856 857 TODO 858 """ 859 raise NotImplementedError('Stub') 860 861 def box_sized(self) -> None: 862 """Draw a box with its upper-left corner at 863 the current cursor position, having dimensions. 864 865 TODO 866 """ 867 raise NotImplementedError('Stub') 868 869 def perimeter(self) -> None: 870 """Draw a perimeter with its upper-left corner 871 at the current cursor position 872 873 TODO 874 """ 875 raise NotImplementedError('Stub') 876 877 def polyfill_yx(self) -> None: 878 """Starting at the specified coordinate, if its glyph 879 is different from that of is copied into it, and the 880 original glyph is considered the fill target. 881 882 TODO 883 """ 884 raise NotImplementedError('Stub') 885 886 def gradient(self, egc: str, stylemask: int, 887 ul: int, ur: int, ll: int, lr: int, 888 ystop: int, xstop: int,) -> int: 889 """Draw a gradient with its upper-left corner 890 at the current cursor position. 891 892 Returns cells filled. 893 """ 894 raise NotImplementedError('Stub') 895 896 def highgradient(self, 897 ul: int, ur: int, ll: int, lr: int, 898 ystop: int, xstop: int) -> int: 899 """Do a high-resolution gradient using upper blocks 900 and synced backgrounds. 901 902 Returns cells filled. 903 """ 904 raise NotImplementedError('Stub') 905 906 def gradient_sized(self, egc: str, stylemask: int, 907 ul: int, ur: int, ll: int, lr: int, 908 ylen: int, xlen: int,) -> int: 909 """Draw a gradient with its upper-left corner 910 at the current cursor position. 911 912 Returns cells filled. 913 """ 914 raise NotImplementedError('Stub') 915 916 def highgradient_sized(self, 917 ul: int, ur: int, ll: int, lr: int, 918 ylen: int, xlen: int,) -> int: 919 """NcPlane.gradent_sized() meets NcPlane.highgradient(). 920 921 Returns cells filled. 922 """ 923 raise NotImplementedError('Stub') 924 925 def format(self, ystop: int, xstop: int, 926 stylemark: int, /) -> int: 927 """Set the given style throughout the specified region, 928 keeping content and attributes unchanged. 929 930 Returns the number of cells set. 931 """ 932 raise NotImplementedError('Stub') 933 934 def stain(self, ystop: int, xstop: int, 935 ul: int, ur: int, ll: int, lr: int) -> int: 936 """Set the given style throughout the specified region, 937 keeping content and attributes unchanged. 938 939 Returns the number of cells set. 940 """ 941 raise NotImplementedError('Stub') 942 943 def mergedown_simple(self, dst: NcPlane, /) -> None: 944 """Merge the ncplane down onto the passed ncplane.""" 945 raise NotImplementedError('Stub') 946 947 def mergedown(self, dst: NcPlane, 948 begsrcy: int = 0, begsrcx: int = 0, 949 leny: int = 0, lenx: int = 0, 950 dsty: int = 0, dstx: int = 0) -> None: 951 """Merge with parameters the ncplane down onto the passed ncplane.""" 952 raise NotImplementedError('Stub') 953 954 def erase(self) -> None: 955 """Erase every cell in the ncplane.""" 956 raise NotImplementedError('Stub') 957 958 def bchannel(self) -> int: 959 """Extract the 32-bit working background channel from an ncplane.""" 960 raise NotImplementedError('Stub') 961 962 def fchannel(self) -> int: 963 """Extract the 32-bit working foreground channel from an ncplane.""" 964 raise NotImplementedError('Stub') 965 966 def set_channels(self, channels: int, /) -> None: 967 """Set both foreground and background channels of the plane.""" 968 raise NotImplementedError('Stub') 969 970 def set_styles(self, stylebits: int, /) -> None: 971 """Set the specified style bits for the plane, 972 whether they're actively supported or not. 973 """ 974 raise NotImplementedError('Stub') 975 976 def on_styles(self, stylebits: int, /) -> None: 977 """Add the specified styles to the ncplane's existing spec.""" 978 raise NotImplementedError('Stub') 979 980 def off_styles(self, stylebits: int, /) -> None: 981 """Remove the specified styles from the ncplane's existing spec.""" 982 raise NotImplementedError('Stub') 983 984 def fg_rgb(self) -> int: 985 """Extract 24 bits of working foreground RGB from the plane, 986 shifted to LSBs. 987 """ 988 raise NotImplementedError('Stub') 989 990 def bg_rgb(self) -> int: 991 """Extract 24 bits of working background RGB from the plane, 992 shifted to LSBs.""" 993 raise NotImplementedError('Stub') 994 995 def fg_alpha(self) -> int: 996 """Extract 2 bits of foreground alpha from plane, 997 shifted to LSBs. 998 """ 999 raise NotImplementedError('Stub') 1000 1001 def fg_default_p(self) -> bool: 1002 """Is the plane's foreground using the \"default foreground color\"?""" 1003 raise NotImplementedError('Stub') 1004 1005 def bg_alpha(self) -> int: 1006 """Extract 2 bits of background alpha from the plane, 1007 shifted to LSBs. 1008 """ 1009 raise NotImplementedError('Stub') 1010 1011 def bg_default_p(self) -> bool: 1012 """Is the plane's background using the \"default background color\"?""" 1013 raise NotImplementedError('Stub') 1014 1015 def fg_rgb8(self) -> Tuple[int, int, int]: 1016 """Extract 24 bits of foreground RGB from the plane, 1017 split into components. 1018 """ 1019 raise NotImplementedError('Stub') 1020 1021 def bg_rgb8(self) -> Tuple[int, int, int]: 1022 """Is the plane's background using the \"default background color\"?""" 1023 raise NotImplementedError('Stub') 1024 1025 def set_fchannel(self, channel: int, /) -> int: 1026 """Set an entire foreground channel of the plane, 1027 return new channels. 1028 """ 1029 raise NotImplementedError('Stub') 1030 1031 def set_bchannel(self, channel: int, /) -> int: 1032 """Set an entire background channel of the plane, 1033 return new channels. 1034 """ 1035 raise NotImplementedError('Stub') 1036 1037 def set_fg_rgb8(self, red: int, green: int, blue: int, /) -> None: 1038 """Set the current foreground color using RGB specifications.""" 1039 raise NotImplementedError('Stub') 1040 1041 def set_bg_rgb8(self, red: int, green: int, blue: int, /) -> None: 1042 """Set the current background color using RGB specifications.""" 1043 raise NotImplementedError('Stub') 1044 1045 def set_bg_rgb8_clipped(self, red: int, green: int, blue: int, /) -> None: 1046 """Set the current foreground color using RGB specifications 1047 but clipped to [0..255].""" 1048 raise NotImplementedError('Stub') 1049 1050 def set_fg_rgb8_clipped(self, red: int, green: int, blue: int, /) -> None: 1051 """Set the current background color using RGB specifications 1052 but clipped to [0..255].""" 1053 raise NotImplementedError('Stub') 1054 1055 def set_fg_rgb(self, channel: int, /) -> None: 1056 """Set the current foreground color using channel.""" 1057 raise NotImplementedError('Stub') 1058 1059 def set_bg_rgb(self, channel: int, /) -> None: 1060 """Set the current background color using channel.""" 1061 raise NotImplementedError('Stub') 1062 1063 def set_fg_default(self) -> None: 1064 """Use the default color for the foreground.""" 1065 raise NotImplementedError('Stub') 1066 1067 def set_bg_default(self) -> None: 1068 """Use the default color for the background.""" 1069 raise NotImplementedError('Stub') 1070 1071 def set_fg_palindex(self, idx: int, /) -> None: 1072 """Set the ncplane's foreground palette index.""" 1073 raise NotImplementedError('Stub') 1074 1075 def set_bg_palindex(self, idx: int, /) -> None: 1076 """Set the ncplane's background palette index.""" 1077 raise NotImplementedError('Stub') 1078 1079 def set_fg_alpha(self, aplha: int, /) -> None: 1080 """Set the foreground alpha parameters for the plane.""" 1081 raise NotImplementedError('Stub') 1082 1083 def set_bg_alpha(self, aplha: int, /) -> None: 1084 """Set the current background color using channel.""" 1085 raise NotImplementedError('Stub') 1086 1087 def fadeout(self) -> None: 1088 """Fade the ncplane out over the provided time, 1089 calling 'fader' at each iteration. 1090 1091 TODO 1092 """ 1093 raise NotImplementedError('Stub') 1094 1095 def fadein(self) -> None: 1096 """Fade the ncplane in over the specified time. 1097 1098 TODO 1099 """ 1100 raise NotImplementedError('Stub') 1101 1102 def fade_setup(self) -> None: 1103 """Create NcFadeCtx. 1104 1105 TODO 1106 """ 1107 raise NotImplementedError('Stub') 1108 1109 def fadeout_iteration(self) -> None: 1110 """TODO""" 1111 raise NotImplementedError('Stub') 1112 1113 def fadein_iteration(self) -> None: 1114 """TODO""" 1115 raise NotImplementedError('Stub') 1116 1117 def pulse(self) -> None: 1118 """Pulse the plane in and out until the callback returns non-zero. 1119 1120 TODO 1121 """ 1122 raise NotImplementedError('Stub') 1123 1124 def cells_load_box(self) -> None: 1125 """Load up six cells with the EGCs necessary to draw a box. 1126 1127 TODO 1128 """ 1129 raise NotImplementedError('Stub') 1130 1131 def cells_rounded_box(self) -> None: 1132 """Load up six cells with the EGCs necessary to draw a round box. 1133 1134 TODO 1135 """ 1136 raise NotImplementedError('Stub') 1137 1138 def perimeter_rounded( 1139 self, 1140 stylemask: int, channels: int, 1141 ctlword: int,) -> None: 1142 """Draw a perimeter around plane.""" 1143 raise NotImplementedError('Stub') 1144 1145 def rounded_box_sized(self, 1146 styles: int, channels: int, 1147 ylen: int, xlen: int, 1148 ctlword: int) -> None: 1149 """Draw a round box around plane.""" 1150 raise NotImplementedError('Stub') 1151 1152 def cells_double_box(self) -> None: 1153 """Draw a double box with cells. 1154 1155 TODO 1156 """ 1157 raise NotImplementedError('Stub') 1158 1159 def double_box(self, 1160 styles: int, channels: int, 1161 ylen: int, xlen: int, 1162 ctlword: int) -> None: 1163 """Draw a double box.""" 1164 raise NotImplementedError('Stub') 1165 1166 def perimeter_double(self, 1167 styles: int, channels: int, 1168 ctlword: int) -> None: 1169 """Draw a double perimeter.""" 1170 raise NotImplementedError('Stub') 1171 1172 def double_box_sized(self, 1173 styles: int, channels: int, 1174 ylen: int, xlen: int, 1175 ctlword: int) -> None: 1176 """Draw a double box sized.""" 1177 raise NotImplementedError('Stub') 1178 1179 def ncvisual_from_plane(self) -> None: 1180 """Promote an plane to an NcVisual. 1181 1182 TODO 1183 """ 1184 raise NotImplementedError('Stub') 1185 1186 def as_rgba(self) -> None: 1187 """Create an RGBA flat array from the selected 1188 region of the plane. 1189 1190 TODO 1191 """ 1192 raise NotImplementedError('Stub') 1193 1194 def reel_create(self) -> None: 1195 """Take over the plane and use it to draw a reel. 1196 1197 TODO 1198 """ 1199 raise NotImplementedError('Stub') 1200 1201 def greyscale(self) -> None: 1202 """Convert the plane's content to greyscale.""" 1203 raise NotImplementedError('Stub') 1204 1205 def selector_create(self) -> None: 1206 """Create NcSelector. 1207 1208 TODO 1209 """ 1210 raise NotImplementedError('Stub') 1211 1212 def multiselector_create(self) -> None: 1213 """Create MultiSelector. 1214 1215 TODO 1216 """ 1217 raise NotImplementedError('Stub') 1218 1219 def tree_create(self) -> None: 1220 """Create NcTree. 1221 1222 TODO 1223 """ 1224 raise NotImplementedError('Stub') 1225 1226 def menu_create(self) -> None: 1227 """Create NcMenu. 1228 1229 TODO 1230 """ 1231 raise NotImplementedError('Stub') 1232 1233 def progbar_create(self) -> None: 1234 """Create NcProgbar. 1235 1236 TODO 1237 """ 1238 raise NotImplementedError('Stub') 1239 1240 def tabbed_create(self) -> None: 1241 """Create NcTabbed. 1242 1243 TODO 1244 """ 1245 raise NotImplementedError('Stub') 1246 1247 def uplot_create(self) -> None: 1248 """Create NcUplot. 1249 1250 TODO 1251 """ 1252 raise NotImplementedError('Stub') 1253 1254 def dplot_create(self) -> None: 1255 """Create NcDplot. 1256 1257 TODO 1258 """ 1259 raise NotImplementedError('Stub') 1260 1261 def fdplane_create(self) -> None: 1262 """Create NcFdPlane. 1263 1264 TODO 1265 """ 1266 raise NotImplementedError('Stub') 1267 1268 def subproc_createv(self) -> None: 1269 """Create subprocess plane. 1270 1271 TODO 1272 """ 1273 raise NotImplementedError('Stub') 1274 1275 def subproc_createvp(self) -> None: 1276 """Create subprocess plane. 1277 1278 TODO 1279 """ 1280 raise NotImplementedError('Stub') 1281 1282 def subproc_createvpe(self) -> None: 1283 """Create subprocess plane. 1284 1285 TODO 1286 """ 1287 raise NotImplementedError('Stub') 1288 1289 def qrcode(self, data: bytes, /) -> Tuple[int, int]: 1290 """Create QR code, return y and x size.""" 1291 raise NotImplementedError('Stub') 1292 1293 def reader_create(self) -> None: 1294 """Create NcReader. 1295 1296 TODO 1297 """ 1298 raise NotImplementedError('Stub') 1299 1300 def pile_top(self) -> NcPlane: 1301 """Return the topmost plane of the pile.""" 1302 raise NotImplementedError('Stub') 1303 1304 def pile_bottom(self) -> NcPlane: 1305 """Return the bottommost plane of the pile.""" 1306 raise NotImplementedError('Stub') 1307 1308 def pile_render(self) -> None: 1309 """Renders the pile of which plane is a part.""" 1310 raise NotImplementedError('Stub') 1311 1312 def pile_rasterize(self) -> None: 1313 """Make the physical screen match the last 1314 rendered frame from the pile.""" 1315 raise NotImplementedError('Stub') 1316 1317 def pile_render_to_buffer(self) -> bytes: 1318 """Perform the rendering and rasterization portion of render() 1319 and write it to bytes object instead of terminal.""" 1320 raise NotImplementedError('Stub') 1321 1322 def pile_render_to_file(self, fd: int, /) -> None: 1323 """Write the last rendered frame, in its entirety, to file descriptor. 1324 1325 If render() has not yet been called, nothing will be written. 1326 """ 1327 raise NotImplementedError('Stub') 1328