1505 |
1591 | Types
1506 |-
1507 |
chtype* = int64
1508 | - 1509 | 1510 | 1511 | 1512 |
mmask_t* = uint32
1513 | - 1514 | 1515 | 1516 | 1517 |
attr_t* = chtype
1518 | - 1519 | 1520 | 1521 | 1522 |
window* = win_st
1523 | - 1524 | 1525 | 1526 | 1527 |
ldat* = object
1528 | - 1529 | 1530 | 1531 | 1532 |
pdat_4299782170994856172* = object 1533 | pad_y*: cshort 1534 | pad_x*: cshort 1535 | pad_top*: cshort 1536 | pad_left*: cshort 1537 | pad_bottom*: cshort 1538 | pad_right*: cshort 1539 |
1540 | - 1541 | 1542 | 1543 | 1544 |
win_st* = object 1545 | cury*: cshort 1546 | curx*: cshort 1547 | maxy*: cshort 1548 | maxx*: cshort 1549 | begy*: cshort 1550 | begx*: cshort 1551 | flags*: cshort 1552 | attrs*: attr_t 1553 | bkgd*: chtype 1554 | notimeout*: bool 1555 | clear*: bool 1556 | leaveok*: bool 1557 | scroll*: bool 1558 | idlok*: bool 1559 | idcok*: bool 1560 | immed*: bool 1561 | sync*: bool 1562 | use_keypad*: bool 1563 | delay*: cint 1564 | line*: ptr ldat 1565 | regtop*: cshort 1566 | regbottom*: cshort 1567 | parx*: cint 1568 | pary*: cint 1569 | parent*: ptr window 1570 | pad*: pdat_4299782170994856172 1571 | yoffset*: cshort 1572 | color*: cint 1573 |
1574 | - 1575 | 1576 | 1577 | 1578 |
MEVENT* = object 1579 | id*: cshort 1580 | x*: cint 1581 | y*: cint 1582 | z*: cint 1583 | bstate*: mmask_t 1584 |
1585 | - 1586 | 1587 | 1588 | 1589 | 1590 |
1592 |
1606 | Vars
1593 |
1607 |
1931 | Consts
1608 |-
1609 |
libncurses* = "libncurses.dll"
1610 | - 1611 | 1612 | 1613 | 1614 |
ERR* = (- 1)
1615 | - 1616 | 1617 | 1618 | 1619 |
OK* = (0)
1620 | - 1621 | 1622 | 1623 | 1624 |
COLOR_BLACK* = 0
1625 | - 1626 | 1627 | 1628 | 1629 |
COLOR_RED* = 1
1630 | - 1631 | 1632 | 1633 | 1634 |
COLOR_GREEN* = 2
1635 | - 1636 | 1637 | 1638 | 1639 |
COLOR_YELLOW* = 3
1640 | - 1641 | 1642 | 1643 | 1644 |
COLOR_BLUE* = 4
1645 | - 1646 | 1647 | 1648 | 1649 |
COLOR_MAGENTA* = 5
1650 | - 1651 | 1652 | 1653 | 1654 |
COLOR_CYAN* = 6
1655 | - 1656 | 1657 | 1658 | 1659 |
COLOR_WHITE* = 7
1660 | - 1661 | 1662 | 1663 | 1664 |
NCURSES_ATTR_SHIFT* = 8'i64
1665 | - 1666 | 1667 | 1668 | 1669 |
A_NORMAL* = 0
1670 | - 1671 | 1672 | 1673 | 1674 |
A_BOLD* = 2097152
1675 | - 1676 | 1677 | 1678 | 1679 |
A_UNDERLINE* = 131072
1680 | - 1681 | 1682 | 1683 | 1684 |
A_ATTRIBUTES* = 4294967040'i64
1685 | - 1686 | 1687 | 1688 | 1689 |
A_CHAR_TEXT* = 255
1690 | - 1691 | 1692 | 1693 | 1694 |
A_REVERSE* = 262144
1695 | - 1696 | 1697 | 1698 | 1699 |
A_BLINK* = 524288
1700 | - 1701 | 1702 | 1703 | 1704 |
A_DIM* = 1048576
1705 | - 1706 | 1707 | 1708 | 1709 |
A_ALT_CHARSET* = 4194304
1710 | - 1711 | 1712 | 1713 | 1714 |
A_INVIS* = 8388608
1715 | - 1716 | 1717 | 1718 | 1719 |
A_PROTECT* = 16777216
1720 | - 1721 | 1722 | 1723 | 1724 |
A_HORIZONTAL* = 33554432
1725 | - 1726 | 1727 | 1728 | 1729 |
A_LEFT* = 67108864
1730 | - 1731 | 1732 | 1733 | 1734 |
A_LOW* = 34217728
1735 | - 1736 | 1737 | 1738 | 1739 |
A_RIGHT* = 268435456
1740 | - 1741 | 1742 | 1743 | 1744 |
A_TOP* = 536870912
1745 | - 1746 | 1747 | 1748 | 1749 |
A_VERTICAL* = 1073741824
1750 | - 1751 | 1752 | 1753 | 1754 |
A_ITALIC* = 2147483648'i64
1755 | - 1756 | 1757 | 1758 | 1759 |
NCURSES_BUTTON_RELEASED* = 1
1760 | - 1761 | 1762 | 1763 | 1764 |
NCURSES_BUTTON_PRESSED* = 2
1765 | - 1766 | 1767 | 1768 | 1769 |
NCURSES_BUTTON_CLICKED* = 4
1770 | - 1771 | 1772 | 1773 | 1774 |
NCURSES_DOUBLE_CLICKED* = 0o000000000010
1775 | - 1776 | 1777 | 1778 | 1779 |
NCURSES_TRIPLE_CLICKED* = 0o000000000020
1780 | - 1781 | 1782 | 1783 | 1784 |
NCURSES_RESERVED_EVENT* = 0o000000000040
1785 | - 1786 | 1787 | 1788 | 1789 |
BUTTON1_RELEASED* = NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED)
1790 | - 1791 | 1792 | 1793 | 1794 |
BUTTON1_PRESSED* = NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED)
1795 | - 1796 | 1797 | 1798 | 1799 |
BUTTON1_CLICKED* = NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_CLICKED)
1800 | - 1801 | 1802 | 1803 | 1804 |
BUTTON1_DOUBLE_CLICKED* = NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED)
1805 | - 1806 | 1807 | 1808 | 1809 |
BUTTON1_TRIPLE_CLICKED* = NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED)
1810 | - 1811 | 1812 | 1813 | 1814 |
BUTTON2_RELEASED* = NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_RELEASED)
1815 | - 1816 | 1817 | 1818 | 1819 |
BUTTON2_PRESSED* = NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED)
1820 | - 1821 | 1822 | 1823 | 1824 |
BUTTON2_CLICKED* = NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_CLICKED)
1825 | - 1826 | 1827 | 1828 | 1829 |
BUTTON2_DOUBLE_CLICKED* = NCURSES_MOUSE_MASK(2, NCURSES_DOUBLE_CLICKED)
1830 | - 1831 | 1832 | 1833 | 1834 |
BUTTON2_TRIPLE_CLICKED* = NCURSES_MOUSE_MASK(2, NCURSES_TRIPLE_CLICKED)
1835 | - 1836 | 1837 | 1838 | 1839 |
BUTTON3_RELEASED* = NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_RELEASED)
1840 | - 1841 | 1842 | 1843 | 1844 |
BUTTON3_PRESSED* = NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_PRESSED)
1845 | - 1846 | 1847 | 1848 | 1849 |
BUTTON3_CLICKED* = NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_CLICKED)
1850 | - 1851 | 1852 | 1853 | 1854 |
BUTTON3_DOUBLE_CLICKED* = NCURSES_MOUSE_MASK(3, NCURSES_DOUBLE_CLICKED)
1855 | - 1856 | 1857 | 1858 | 1859 |
BUTTON3_TRIPLE_CLICKED* = NCURSES_MOUSE_MASK(3, NCURSES_TRIPLE_CLICKED)
1860 | - 1861 | 1862 | 1863 | 1864 |
BUTTON4_RELEASED* = NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_RELEASED)
1865 | - 1866 | 1867 | 1868 | 1869 |
BUTTON4_PRESSED* = NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_PRESSED)
1870 | - 1871 | 1872 | 1873 | 1874 |
BUTTON4_CLICKED* = NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_CLICKED)
1875 | - 1876 | 1877 | 1878 | 1879 |
BUTTON4_DOUBLE_CLICKED* = NCURSES_MOUSE_MASK(4, NCURSES_DOUBLE_CLICKED)
1880 | - 1881 | 1882 | 1883 | 1884 |
BUTTON4_TRIPLE_CLICKED* = NCURSES_MOUSE_MASK(4, NCURSES_TRIPLE_CLICKED)
1885 | - 1886 | 1887 | 1888 | 1889 |
BUTTON5_RELEASED* = NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_RELEASED)
1890 | - 1891 | 1892 | 1893 | 1894 |
BUTTON5_PRESSED* = NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_PRESSED)
1895 | - 1896 | 1897 | 1898 | 1899 |
BUTTON5_CLICKED* = NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_CLICKED)
1900 | - 1901 | 1902 | 1903 | 1904 |
BUTTON5_DOUBLE_CLICKED* = NCURSES_MOUSE_MASK(5, NCURSES_DOUBLE_CLICKED)
1905 | - 1906 | 1907 | 1908 | 1909 |
BUTTON5_TRIPLE_CLICKED* = NCURSES_MOUSE_MASK(5, NCURSES_TRIPLE_CLICKED)
1910 | - 1911 | 1912 | 1913 | 1914 |
BUTTON_CTRL* = NCURSES_MOUSE_MASK(6, 1)
1915 | - 1916 | 1917 | 1918 | 1919 |
BUTTON_SHIFT* = NCURSES_MOUSE_MASK(6, 2)
1920 | - 1921 | 1922 | 1923 | 1924 |
BUTTON_ALT* = NCURSES_MOUSE_MASK(6, 4)
1925 | - 1926 | 1927 | 1928 | 1929 | 1930 |
1932 |
2245 | Procs
1933 |-
1934 |
proc has_mouse*(): bool {.cdecl, importc: "has_mouse", dynlib: libncurses.}
1935 | - 1936 | 1937 | 1938 | 1939 |
proc getmouse*(a2: ptr MEVENT): cint {.cdecl, importc: "getmouse", 1940 | dynlib: libncurses.}
1941 | - 1942 | 1943 | 1944 | 1945 |
proc ungetmouse*(a2: ptr MEVENT): cint {.cdecl, importc: "ungetmouse", 1946 | dynlib: libncurses.}
1947 | - 1948 | 1949 | 1950 | 1951 |
proc mousemask*(a2: mmask_t; a3: ptr mmask_t): mmask_t {.cdecl, 1952 | importc: "mousemask", dynlib: libncurses.}
1953 | - 1954 | 1955 | 1956 | 1957 |
proc wenclose*(a2: ptr window; a3: cint; a4: cint): bool {.cdecl, 1958 | importc: "wenclose", dynlib: libncurses.}
1959 | - 1960 | 1961 | 1962 | 1963 |
proc mouseinterval*(a2: cint): cint {.cdecl, importc: "mouseinterval", 1964 | dynlib: libncurses.}
1965 | - 1966 | 1967 | 1968 | 1969 |
proc wmouse_trafo*(a2: ptr window; a3: ptr cint; a4: ptr cint; a5: bool): bool {. 1970 | cdecl, importc: "wmouse_trafo", dynlib: libncurses.}
1971 | - 1972 | 1973 | 1974 | 1975 |
proc mouse_trafo*(a2: ptr cint; a3: ptr cint; a4: bool): bool {.cdecl, 1976 | importc: "mouse_trafo", dynlib: libncurses.}
1977 | - 1978 | 1979 | 1980 | 1981 |
proc getattrs*(a2: ptr window): int {.cdecl, discardable, importc: "getattrs", 1982 | dynlib: libncurses.}
1983 | - 1984 | 1985 | 1986 | 1987 |
proc getcurx*(a2: ptr window): int {.cdecl, discardable, importc: "getcurx", 1988 | dynlib: libncurses.}
1989 | - 1990 | 1991 | 1992 | 1993 |
proc getcury*(a2: ptr window): int {.cdecl, discardable, importc: "getcury", 1994 | dynlib: libncurses.}
1995 | - 1996 | 1997 | 1998 | 1999 |
proc getbegx*(a2: ptr window): int {.cdecl, discardable, importc: "getbegx", 2000 | dynlib: libncurses.}
2001 | - 2002 | 2003 | 2004 | 2005 |
proc getbegy*(a2: ptr window): int {.cdecl, discardable, importc: "getbegy", 2006 | dynlib: libncurses.}
2007 | - 2008 | 2009 | 2010 | 2011 |
proc getmaxx*(a2: ptr window): int {.cdecl, discardable, importc: "getmaxx", 2012 | dynlib: libncurses.}
2013 | - 2014 | 2015 | 2016 | 2017 |
proc getmaxy*(a2: ptr window): int {.cdecl, discardable, importc: "getmaxy", 2018 | dynlib: libncurses.}
2019 | - 2020 | 2021 | 2022 | 2023 |
proc getparx*(a2: ptr window): int {.cdecl, discardable, importc: "getparx", 2024 | dynlib: libncurses.}
2025 | - 2026 | 2027 | 2028 | 2029 |
proc getpary*(a2: ptr window): int {.cdecl, discardable, importc: "getpary", 2030 | dynlib: libncurses.}
2031 | - 2032 | 2033 | 2034 | 2035 |
proc addch*(character: chtype): int {.cdecl, discardable, importc: "addch", 2036 | dynlib: libncurses.}
2037 | - 2038 | Puts a character into the stdscr at its current window position and then advances the current window position to the next position. @Param: 'character' the character to put into the current window. @Returns: ERR on failure and OK upon successful completion. 2039 | 2040 | 2041 |
proc addstr*(stringToAdd: cstring): int {.cdecl, discardable, importc: "addstr", 2042 | dynlib: libncurses.}
2043 | - 2044 | Adds a string of characters the the stdscr and advances the cursor. @Param: The string to add the stdscr. @Returns: ERR on failure and OK upon successful completion. 2045 | 2046 | 2047 |
proc attroff*(attributes: int64): int {.cdecl, discardable, importc: "attroff", 2048 | dynlib: libncurses.}
2049 | - 2050 | Turns off the named attributes without affecting any other attributes. @Param: 'attributes' the attributes to turn off for the current window. @Returns: An integer value, but the returned value does not have any meaning and can thus be ignored. 2051 | 2052 | 2053 |
proc attron*(attributes: int64): int {.cdecl, discardable, importc: "attron", 2054 | dynlib: libncurses.}
2055 | - 2056 | Turns on the named attributes without affecting any other attributes. @Param: 'attributes' the attributes to turn on for the current window. @Returns: An integer value, but the returned value does not have any meaning and can thus be ignored. 2057 | 2058 | 2059 |
proc attrset*(attributes: int64): int {.cdecl, discardable, importc: "attrset", 2060 | dynlib: libncurses.}
2061 | - 2062 | Sets the current attributes of the given window to the provided attributes. @Param: 'attributes', the attributes to apply to the current window. @Returns: An integer value, but the returned value does not have any meaning and can thus be ignored. 2063 | 2064 | 2065 |
proc beep*(): int {.cdecl, discardable, importc: "beep", dynlib: libncurses.}
2066 | - 2067 | Sounds an audible alarm on the terminal, otherwise it flashes the screen (visible bell). @Returns: ERR on failure and OK upon successfully beeping. 2068 | 2069 | 2070 |
proc bkgd*(background: int64): int {.cdecl, discardable, importc: "bkgd", 2071 | dynlib: libncurses.}
2072 | - 2073 | Sets the background property of the current window and apply this setting to every character position in the window. @Param: 'background' the background property to apply. 2074 | 2075 | 2076 |
proc can_change_color*(): bool {.cdecl, importc: "can_change_color", 2077 | dynlib: libncurses.}
2078 | - 2079 | Used to determine if the terminal supports colours and can change their definitions. @Returns: true if the terminal supports colours and can change their definitions or false otherwise. 2080 | 2081 | 2082 |
proc cbreak*(): int {.cdecl, discardable, importc: "cbreak", dynlib: libncurses.}
2083 | - 2084 | The cbreak routine disables line buffering and erase/kill character-processing (interrupt and flow control characters are unaffected), making characters typed by the user immediately available to the program. @Returns: ERR on failure and OK upon successful completion. 2085 | 2086 | 2087 |
proc delch*(): int {.cdecl, discardable, importc: "delch", dynlib: libncurses.}
2088 | - 2089 | Delete the character under the cursor in the stdscr. @Returns: ERR on failure and OK upon successfully flashing. 2090 | 2091 | 2092 |
proc deleteln*(): int {.cdecl, discardable, importc: "deleteln", 2093 | dynlib: libncurses.}
2094 | - 2095 | Deletes the line under the cursor in the stdscr. All lines below the current line are moved up one line. The bottom line of the window is cleared and the cursor position does not change. @Returns: ERR on failure and OK upon successful completion. 2096 | 2097 | 2098 |
proc endwin*(): int {.cdecl, discardable, importc: "endwin", dynlib: libncurses.}
2099 | - 2100 | A program should always call endwin before exiting or escaping from curses mode temporarily. This routine restores tty modes, moves the cursor to the lower left-hand corner of the screen and resets the terminal into the proper non-visual mode. Calling refresh or doupdate after a temporary escape causes the program to resume visual mode. @Returns: ERR on failure and OK upon successful completion. 2101 | 2102 | 2103 |
proc flash*(): int {.cdecl, discardable, importc: "flash", dynlib: libncurses.}
2104 | - 2105 | Flashes the screen and if that is not possible it sounds the alert. If this is not possible nothing happens. @Returns: ERR on failure and OK upon successfully flashing. 2106 | 2107 | 2108 |
proc getch*(): int {.cdecl, discardable, importc: "getch", dynlib: libncurses.}
2109 | - 2110 | Read a character from the stdscr window. @Returns: ERR on failure and OK upon successful completion. 2111 | 2112 | 2113 |
proc getnstr*(inputString: cstring; numberOfCharacters: int): int {.cdecl, 2114 | discardable, importc: "getnstr", dynlib: libncurses.}
2115 | - 2116 | Reads at most the specified number of characters into the provided string. @Param: 'inputString' the variable to read the input into. @Param: 'numberOfCharacters' the maximum number of characters to read. @Returns: ERR on failure and OK upon successful completion. 2117 | 2118 | 2119 |
proc getstr*(inputString: cstring): int {.cdecl, discardable, importc: "getstr", 2120 | dynlib: libncurses.}
2121 | - 2122 | Reads the inputted characters into the provided string. @Param: 'inputString' the variable to read the input into. @Returns: ERR on failure and OK upon successful completion. 2123 | 2124 | 2125 |
proc has_colors*(): bool {.cdecl, importc: "has_colors", dynlib: libncurses.}
2126 | - 2127 | Used to determine if the terminal can manipulate colours. @Returns: true if the terminal can manipulate colours or false if it cannot. 2128 | 2129 | 2130 |
proc init_pair*(pair: cshort; foreground: cshort; background: cshort): int {. 2131 | cdecl, discardable, importc: "init_pair", dynlib: libncurses.}
2132 | - 2133 | Changes the definition of a colour pair. @Param: 'pair' the number of the colour pair to change. @Param: 'foreground': the foreground colour number. @Param: 'background': the background colour number. @Returns: ERR on failure and OK upon successful completion. 2134 | 2135 | 2136 |
proc initscr*(): ptr window {.cdecl, discardable, importc: "initscr", 2137 | dynlib: libncurses.}
2138 | - 2139 | Usually the first curses routine to be called when initialising a program The initscr code determines the terminal type and initialises all curses data structures. initscr also causes the first call to refresh to clear the screen. @Returns: A pointer to stdscr is returned if the operation is successful. @Note: If errors occur, initscr writes an appropriate error message to standard error and exits. 2140 | 2141 | 2142 |
proc insch*(character: chtype): int {.cdecl, discardable, importc: "insch", 2143 | dynlib: libncurses.}
2144 | - 2145 | Inserts a character before the cursor in the stdscr. @Param: 'character' the character to insert. @Returns: ERR on failure and OK upon successful completion. 2146 | 2147 | 2148 |
proc insertln*(): int {.cdecl, discardable, importc: "insertln", 2149 | dynlib: libncurses.}
2150 | - 2151 | Inserts a blank line above the current line in stdscr and the bottom line is lost. @Returns: ERR on failure and OK upon successful completion. 2152 | 2153 | 2154 |
proc move*(y: int; x: int): int {.cdecl, discardable, importc: "move", 2155 | dynlib: libncurses.}
2156 | - 2157 | Moves the cursor of stdscr to the specified coordinates. @Param: 'y' the line to move the cursor to. @Param: 'x' the column to move the cursor to. @Returns: ERR on failure and OK upon successful completion. 2158 | 2159 | 2160 |
proc mvaddch*(y: int; x: int; character: chtype): int {.cdecl, discardable, 2161 | importc: "mvaddch", dynlib: libncurses.}
2162 | - 2163 | Moves the cursor to the specified position and outputs the provided character. The cursor is then advanced to the next position. @Param: 'y' the line to move the cursor to. @Param: 'x' the column to move the cursor to. @Param: 'character' the character to put into the current window. @Returns: ERR on failure and OK upon successful completion. 2164 | 2165 | 2166 |
proc mvaddstr*(y: int; x: int; stringToOutput: cstring): int {.cdecl, 2167 | discardable, importc: "mvaddstr", dynlib: libncurses.}
2168 | - 2169 | Moves the cursor to the specified position and outputs the provided string. The cursor is then advanced to the next position. @Param: 'y' the line to move the cursor to. @Param: 'x' the column to move the cursor to. @Param: 'stringToOutput' the string to put into the current window. @Returns: ERR on failure and OK upon successful completion. 2170 | 2171 | 2172 |
proc mvprintw*(y: int; x: int; formattedString: cstring): int {.varargs, cdecl, 2173 | discardable, importc: "mvprintw", dynlib: libncurses.}
2174 | - 2175 | Prints out a formatted string to the stdscr at the specified row and column. @Param: 'y' the line to move the cursor to. @Param: 'x' the column to move the cursor to. @Param: 'formattedString' the string with formatting to be output to stdscr. @Returns: ERR on failure and OK upon successful completion. 2176 | 2177 | 2178 |
proc mvwprintw*(destinationWindow: ptr window; y: int; x: int; 2179 | formattedString: cstring): int {.varargs, cdecl, discardable, 2180 | importc: "mvwprintw", dynlib: libncurses.}
2181 | - 2182 | Prints out a formatted string to the specified window at the specified row and column. @Param: 'destinationWindow' the window to write the string to. @Param: 'y' the line to move the cursor to. @Param: 'x' the column to move the cursor to. @Param: 'formattedString' the string with formatting to be output to stdscr. @Returns: ERR on failure and OK upon successful completion. 2183 | 2184 | 2185 |
proc napms*(milliseconds: int): int {.cdecl, discardable, importc: "napms", 2186 | dynlib: libncurses.}
2187 | - 2188 | Used to sleep for the specified milliseconds. @Params: 'milliseconds' the number of milliseconds to sleep for. @Returns: ERR on failure and OK upon successful completion. 2189 | 2190 | 2191 |
proc nocbreak*(): int {.cdecl, discardable, importc: "nocbreak", 2192 | dynlib: libncurses.}
2193 | - 2194 | Returns the terminal to normal (cooked mode). @Returns: ERR on failure and OK upon successful completion. 2195 | 2196 | 2197 |
proc printw*(formattedString: cstring): int {.varargs, cdecl, discardable, 2198 | importc: "printw", dynlib: libncurses.}
2199 | - 2200 | Prints out a formatted string to the stdscr. @Param: 'formattedString' the string with formatting to be output to stdscr. @Returns: ERR on failure and OK upon successful completion. 2201 | 2202 | 2203 |
proc refresh*(): int {.cdecl, discardable, importc: "refresh", 2204 | dynlib: libncurses.}
2205 | - 2206 | Must be called to get actual output to the terminal. refresh uses stdscr has the default window. @Returns: ERR on failure and OK upon successful completion. 2207 | 2208 | 2209 |
proc scanw*(formattedInput: cstring): int {.varargs, cdecl, discardable, 2210 | importc: "scanw", dynlib: libncurses.}
2211 | - 2212 | Converts formatted input from the stdscr. @Param: 'formattedInput' Contains the fields for the input to be mapped to. @Returns: The number of fields that were mapped in the call. 2213 | 2214 | 2215 |
proc start_color*(): int {.cdecl, discardable, importc: "start_color", 2216 | dynlib: libncurses.}
2217 | - 2218 | Initialises the the eight basic colours and the two global varables COLORS and COLOR_PAIRS. It also restores the colours on the terminal to the values that they had when the terminal was just turned on. @Note: It is good practice to call this routine right after initscr. It must be called before any other colour manipulating routines. 2219 | 2220 | 2221 |
proc waddstr*(destinationWindow: ptr window; stringToWrite: cstring): int {. 2222 | cdecl, discardable, importc: "waddstr", dynlib: libncurses.}
2223 | - 2224 | Writes a string to the specified window. @Param: 'destinationWindow' the window to write the string to. @Param: 'stringToWrite' @Returns: ERR on failure and OK upon successful completion. 2225 | 2226 | 2227 |
proc wgetch*(sourceWindow: ptr window): int {.cdecl, discardable, 2228 | importc: "wgetch", dynlib: libncurses.}
2229 | - 2230 | Read a character from the specified window. @Param: 'sourceWindow' the window to read a character from. @Returns: ERR on failure and OK upon successful completion. 2231 | 2232 | 2233 |
proc getmaxyx*(win: ptr window; y, x: var int)
2234 | - 2235 | retrieves the size of the specified window in the provided y and x parameters. @Param: 'win' the window to measure. @Param: 'y' stores the height of the window. @Param: 'x' stores the width of the window. 2236 | 2237 | 2238 |
proc getyx*(win: ptr window; y, x: var int)
2239 | - 2240 | Reads the logical cursor location from the specified window. @Param: 'win' the window to get the cursor location from. @Param: 'y' stores the height of the window. @Param: 'x' stores the width of the window. 2241 | 2242 | 2243 | 2244 |
2246 |
2305 |
2306 | Templates
2247 |-
2248 |
template NCURSES_CAST*(`type`, value: expr): expr
2249 | - 2250 | 2251 | 2252 | 2253 |
template NCURSES_BITS*(mask, shift: expr): expr
2254 | - 2255 | 2256 | 2257 | 2258 |
template COLOR_PAIR*(n: expr): expr
2259 | - 2260 | 2261 | 2262 | 2263 |
template PAIR_NUMBER*(a: expr): expr
2264 | - 2265 | 2266 | 2267 | 2268 |
template NCURSES_MOUSE_MASK*(b, m: expr): expr
2269 | - 2270 | 2271 | 2272 | 2273 |
template BUTTON_RELEASE*(e, x: expr): expr
2274 | - 2275 | 2276 | 2277 | 2278 |
template BUTTON_PRESS*(e, x: expr): expr
2279 | - 2280 | 2281 | 2282 | 2283 |
template BUTTON_CLICK*(e, x: expr): expr
2284 | - 2285 | 2286 | 2287 | 2288 |
template BUTTON_DOUBLE_CLICK*(e, x: expr): expr
2289 | - 2290 | 2291 | 2292 | 2293 |
template BUTTON_TRIPLE_CLICK*(e, x: expr): expr
2294 | - 2295 | 2296 | 2297 | 2298 |
template BUTTON_RESERVED_EVENT*(e, x: expr): expr
2299 | - 2300 | 2301 | 2302 | 2303 | 2304 |