libyui-ncurses
2.44.1
|
C++ class for windows. More...
#include <ncursesw.h>
Public Member Functions | |
NCursesWindow (WINDOW *window) | |
NCursesWindow (int lines, int cols, int begin_y, int begin_x) | |
NCursesWindow (NCursesWindow &parent, int lines, int cols, int begin_y, int begin_x, char absrel= 'a') | |
virtual | ~NCursesWindow () |
NCursesWindow | Clone () |
int | colors () const |
int | height () const |
int | width () const |
int | begx () const |
int | begy () const |
int | maxx () const |
int | maxy () const |
wsze | size () const |
wpos | begpos () const |
wpos | maxpos () const |
wrect | area () const |
short | getcolor () const |
short | foreground () const |
short | background () const |
int | setpalette (short fore, short back) |
int | setcolor (short pair) |
virtual int | mvwin (int begin_y, int begin_x) |
int | mvsubwin (NCursesWindow *sub, int begin_y, int begin_x) |
virtual int | resize (int lines, int columns) |
int | move (int y, int x) |
void | getyx (int &y, int &x) const |
int | mvcur (int oldrow, int oldcol, int newrow, int newcol) const |
int | nodelay (bool bf) |
int | getch () |
int | getch (int y, int x) |
int | getstr (char *str, int n=-1) |
int | getstr (int y, int x, char *str, int n=-1) |
int | instr (char *s, int n=-1) |
int | instr (int y, int x, char *s, int n=-1) |
int | addch (const char ch) |
int | addch (const chtype ch) |
int | add_attr_char (int y, int x) |
int | add_attr_char () |
int | add_wch (const cchar_t *cch) |
int | add_wch (int y, int x, const cchar_t *cch) |
int | addch (int y, int x, const char ch) |
int | addch (int y, int x, const chtype ch) |
int | echochar (const char ch) |
int | echochar (const chtype ch) |
int | addstr (const char *str, int n=-1) |
int | addstr (int y, int x, const char *str, int n=-1) |
int | addwstr (const wchar_t *str, int n=-1) |
int | addwstr (int y, int x, const wchar_t *str, int n=-1) |
int | printw (const char *fmt,...) |
int | printw (int y, int x, const char *fmt,...) |
chtype | inch () const |
chtype | inchar () const |
chtype | inch (int y, int x) |
chtype | inchar (int y, int x) |
int | in_wchar (cchar_t *cchar) |
int | in_wchar (int y, int x, cchar_t *cchar) |
int | insch (chtype ch) |
int | insch (int y, int x, chtype ch) |
int | ins_wch (int y, int x, const cchar_t *cchar) |
int | insertln () |
int | insdelln (int n=1) |
int | insstr (const char *s, int n=-1) |
int | insstr (int y, int x, const char *s, int n=-1) |
int | attron (chtype at) |
int | attroff (chtype at) |
int | attrset (chtype at) |
int | chgat (int n, attr_t attr, short color, const void *opts=NULL) |
int | chgat (int y, int x, int n, attr_t attr, short color, const void *opts=NULL) |
chtype | getbkgd () const |
int | bkgd (const chtype ch) |
void | bkgdset (chtype ch) |
int | box () |
int | border (chtype left=0, chtype right=0, chtype top=0, chtype bottom=0, chtype top_left=0, chtype top_right=0, chtype bottom_left=0, chtype bottom_right=0) |
int | hline (int len, chtype ch=0) |
int | hline (int y, int x, int len, chtype ch=0) |
int | vline (int len, chtype ch=0) |
int | vline (int y, int x, int len, chtype ch=0) |
int | box (const wrect &dim) |
int | erase () |
int | clear () |
int | clearok (bool bf) |
int | clrtobot () |
int | clrtoeol () |
int | delch () |
int | delch (int y, int x) |
int | deleteln () |
int | scroll (int amount=1) |
int | scrollok (bool bf) |
int | setscrreg (int from, int to) |
int | idlok (bool bf) |
void | idcok (bool bf) |
int | touchwin () |
int | untouchwin () |
int | touchln (int s, int cnt, bool changed=TRUE) |
bool | is_linetouched (int line) const |
bool | is_wintouched () const |
int | leaveok (bool bf) |
int | redrawln (int from, int n) |
int | redrawwin () |
int | doupdate () |
void | syncdown () |
void | syncup () |
void | cursyncup () |
int | syncok (bool bf) |
void | immedok (bool bf) |
int | keypad (bool bf) |
int | meta (bool bf) |
int | standout () |
int | standend () |
virtual int | refresh () |
virtual int | noutrefresh () |
int | overlay (NCursesWindow &win) |
int | overwrite (NCursesWindow &win) |
int | copywin (NCursesWindow &win, int sminrow, int smincol, int dminrow, int dmincol, int dmaxrow, int dmaxcol, bool overlay=TRUE) |
bool | has_mouse () const |
NCursesWindow * | child () |
const NCursesWindow * | child () const |
NCursesWindow * | sibling () |
const NCursesWindow * | sibling () const |
NCursesWindow * | parent () |
const NCursesWindow * | parent () const |
bool | isDescendant (NCursesWindow &win) |
Static Public Member Functions | |
static void | useColors (void) |
static int | ripoffline (int ripoff_lines, int(*init)(NCursesWindow &win)) |
static int | lines () |
static int | cols () |
static int | tabsize () |
static int | NumberOfColors () |
static int | maxcoord () |
Protected Member Functions | |
void | err_handler (const char *) const THROWS(NCursesException) |
void | kill_subwindows () |
NCursesWindow () | |
Protected Attributes | |
WINDOW * | w |
bool | alloced |
NCursesWindow * | par |
NCursesWindow * | subwins |
NCursesWindow * | sib |
Static Protected Attributes | |
static long | count = 0L |
Friends | |
class | NCursesMenu |
class | NCursesForm |
std::ostream & | operator<< (std::ostream &Stream, const NCursesWindow &Obj_Cv) |
std::ostream & | operator<< (std::ostream &Stream, const NCursesWindow *Obj_Cv) |
C++ class for windows.
Definition at line 904 of file ncursesw.h.
|
protected |
Only for use by derived classes. They are then in charge to fill the member variables correctly.
Definition at line 255 of file ncursesw.cc.
NCursesWindow::NCursesWindow | ( | WINDOW * | window | ) |
Constructor. Useful only for stdscr
Definition at line 300 of file ncursesw.cc.
NCursesWindow::NCursesWindow | ( | int | lines, |
int | cols, | ||
int | begin_y, | ||
int | begin_x | ||
) |
NCursesWindow::NCursesWindow | ( | NCursesWindow & | parent, |
int | lines, | ||
int | cols, | ||
int | begin_y, | ||
int | begin_x, | ||
char | absrel = 'a' |
||
) |
Constructor.
If 'absrel' is 'a', begin_x/y are absolute screen pos, if `r', they are relative to parent origin.
Definition at line 313 of file ncursesw.cc.
|
virtual |
int NCursesWindow::add_attr_char | ( | int | y, |
int | x | ||
) |
Put attributed character from given position to the window.
Definition at line 166 of file ncursesw.cc.
|
inline |
Put a combined character to the window.
Definition at line 1244 of file ncursesw.h.
|
inline |
Put attributed character to the window.
Definition at line 1228 of file ncursesw.h.
|
inline |
Move cursor to the requested position and then put attributed character to the window.
Definition at line 1252 of file ncursesw.h.
|
inline |
Write the std::string str to the window, stop writing if the terminating NUL or the limit n is reached. If n is negative, it is ignored.
Definition at line 1276 of file ncursesw.h.
|
inline |
Move the cursor to the requested position and then perform the addstr as described above.
Definition at line 1285 of file ncursesw.h.
int NCursesWindow::addwstr | ( | const wchar_t * | str, |
int | n = -1 |
||
) |
Write the wchar_t str to the window, stop writing if the terminating NUL or the limit n is reached. If n is negative, it is ignored.
Definition at line 123 of file ncursesw.cc.
int NCursesWindow::addwstr | ( | int | y, |
int | x, | ||
const wchar_t * | str, | ||
int | n = -1 |
||
) |
Move the cursor to the requested position and then perform the addwstr as described above.
Definition at line 106 of file ncursesw.cc.
|
inline |
Switch off the window attributes;
Definition at line 1405 of file ncursesw.h.
|
inline |
Switch on the window attributes;
Definition at line 1400 of file ncursesw.h.
|
inline |
Set the window attributes;
Definition at line 1410 of file ncursesw.h.
|
inline |
Actual background color
Definition at line 1121 of file ncursesw.h.
|
inline |
Column of top left corner relative to stdscr
Definition at line 1080 of file ncursesw.h.
|
inline |
Line of top left corner relative to stdscr
Definition at line 1085 of file ncursesw.h.
|
inline |
Set the background property and apply it to the window.
Definition at line 1443 of file ncursesw.h.
|
inline |
Set the background property.
Definition at line 1448 of file ncursesw.h.
|
inline |
Draw a border around the window with the given characters for the various parts of the border. If you pass zero for a character, curses will try to find "nice" characters.
Definition at line 1469 of file ncursesw.h.
|
inline |
Draw a box around the window with the given vertical and horizontal drawing characters. If you specifiy a zero as character, curses will try to find a "nice" character.
Definition at line 1462 of file ncursesw.h.
|
inline |
Change the attributes of the next n characters in the current line. If n is negative or greater than the number of remaining characters in the line, the attributes will be changed up to the end of the line.
Definition at line 1417 of file ncursesw.h.
|
inline |
Move the cursor to the requested position and then perform chgat() as described above.
Definition at line 1426 of file ncursesw.h.
|
inline |
Get the first child window.
Definition at line 1763 of file ncursesw.h.
|
inline |
Clear the window.
Definition at line 1522 of file ncursesw.h.
|
inline |
Set/Reset the clear flag. If std::set, the next refresh() will clear the screen.
Definition at line 1528 of file ncursesw.h.
NCursesWindow NCursesWindow::Clone | ( | ) |
Make an exact copy of the window.
Definition at line 364 of file ncursesw.cc.
|
inline |
Clear to the end of the window.
Definition at line 1533 of file ncursesw.h.
|
inline |
Clear to the end of the line.
Definition at line 1538 of file ncursesw.h.
|
inline |
Number of available colors
Definition at line 1062 of file ncursesw.h.
|
inlinestatic |
Number of cols on terminal, not window
Definition at line 1047 of file ncursesw.h.
|
inline |
Overlay or overwrite the rectangle in win given by dminrow,dmincol, dmaxrow,dmaxcol with the rectangle in this window beginning at sminrow,smincol.
Definition at line 1740 of file ncursesw.h.
|
inline |
Position the cursor in all ancestor windows corresponding to our setting
Definition at line 1661 of file ncursesw.h.
|
inline |
Delete character under the cursor.
Definition at line 1543 of file ncursesw.h.
|
inline |
Move cursor to requested position and delete the character under the cursor.
Definition at line 1549 of file ncursesw.h.
|
inline |
Delete the current line.
Definition at line 1554 of file ncursesw.h.
|
inline |
Do all outputs to make the physical screen looking like the virtual one
Definition at line 1646 of file ncursesw.h.
|
inline |
Put attributed character to the window and refresh it immediately.
Definition at line 1265 of file ncursesw.h.
|
inline |
Erase the window.
Definition at line 1517 of file ncursesw.h.
|
protected |
Signal an error with the given message text.
Definition at line 230 of file ncursesw.cc.
|
inline |
Actual foreground color
Definition at line 1116 of file ncursesw.h.
|
inline |
Get current background setting.
Definition at line 1438 of file ncursesw.h.
|
inline |
Get a keystroke from the window.
Definition at line 1179 of file ncursesw.h.
|
inline |
Move cursor to position and get a keystroke from the window
Definition at line 1184 of file ncursesw.h.
short NCursesWindow::getcolor | ( | ) | const |
Actual color pair
Definition at line 556 of file ncursesw.cc.
|
inline |
Read a series of characters into str until a newline or carriage return is received. Read at most n characters. If n is negative, the limit is ignored.
Definition at line 1191 of file ncursesw.h.
|
inline |
Move the cursor to the requested position and then perform the getstr() as described above.
Definition at line 1200 of file ncursesw.h.
|
inline |
Get current position of the cursor
Definition at line 1160 of file ncursesw.h.
bool NCursesWindow::has_mouse | ( | ) | const |
Return TRUE if terminal supports a mouse, FALSE otherwise
Definition at line 601 of file ncursesw.cc.
|
inline |
Number of lines in this window
Definition at line 1070 of file ncursesw.h.
|
inline |
Draw a horizontal line of len characters with the given character. If you pass zero for the character, curses will try to find a "nice" one.
Definition at line 1485 of file ncursesw.h.
|
inline |
Move the cursor to the requested position and then draw a horizontal line.
Definition at line 1490 of file ncursesw.h.
|
inline |
If bf is TRUE, use insert/delete character hardware support if possible. Otherwise do it in software.
Definition at line 1590 of file ncursesw.h.
|
inline |
If bf is TRUE, use insert/delete line hardware support if possible. Otherwise do it in software.
Definition at line 1584 of file ncursesw.h.
|
inline |
If called with bf=TRUE, any change in the window will cause an automatic immediate refresh()
Definition at line 1677 of file ncursesw.h.
int NCursesWindow::in_wchar | ( | cchar_t * | cchar | ) |
Retrieve combined character under the current cursor position.
Definition at line 153 of file ncursesw.cc.
|
inline |
Retrieve attributed character under the current cursor position.
Definition at line 1325 of file ncursesw.h.
|
inline |
Move cursor to requested position and then retrieve attributed character at this position.
Definition at line 1333 of file ncursesw.h.
|
inline |
Move cursor to requested position and then insert the attributed character before that position.
Definition at line 1362 of file ncursesw.h.
|
inline |
Insert attributed character into the window before current cursor position.
Definition at line 1347 of file ncursesw.h.
|
inline |
Move cursor to requested position and then insert the attributed character before that position.
Definition at line 1353 of file ncursesw.h.
|
inline |
If n>0 insert that many lines above the current line. If n<0 delete that many lines beginning with the current line.
Definition at line 1376 of file ncursesw.h.
|
inline |
Insert an empty line above the current line.
Definition at line 1370 of file ncursesw.h.
|
inline |
Insert the std::string into the window before the current cursor position. Insert stops at end of std::string or when the limit n is reached. If n is negative, it is ignored.
Definition at line 1383 of file ncursesw.h.
|
inline |
Move the cursor to the requested position and then perform the insstr() as described above.
Definition at line 1392 of file ncursesw.h.
|
inline |
Get a std::string of characters from the window into the buffer s. Retrieve at most n characters, if n is negative retrieve all characters up to the end of the current line. Attributes are stripped from the characters.
Definition at line 1210 of file ncursesw.h.
|
inline |
Move the cursor to the requested position and then perform the instr() as described above.
Definition at line 1216 of file ncursesw.h.
|
inline |
Return TRUE if line is marked as changed, FALSE otherwise
Definition at line 1614 of file ncursesw.h.
|
inline |
Return TRUE if window is marked as changed, FALSE otherwise
Definition at line 1622 of file ncursesw.h.
bool NCursesWindow::isDescendant | ( | NCursesWindow & | win | ) |
Return TRUE if win is a descendant of this.
Definition at line 419 of file ncursesw.cc.
|
inline |
If called with bf=TRUE, the application will interpret function keys.
Definition at line 1682 of file ncursesw.h.
|
protected |
Destroy all subwindows.
Definition at line 436 of file ncursesw.cc.
|
inline |
If bf is TRUE, curses will leave the cursor after an update whereever it is after the update.
Definition at line 1631 of file ncursesw.h.
|
inlinestatic |
Number of lines on terminal, not window
Definition at line 1042 of file ncursesw.h.
|
inlinestatic |
Ncurses up to ncurses5 internally uses short
.
Definition at line 1098 of file ncursesw.h.
|
inline |
Largest x coord in window
Definition at line 1090 of file ncursesw.h.
|
inline |
Largest y coord in window
Definition at line 1095 of file ncursesw.h.
|
inline |
If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise 7-Bit characters are generated.
Definition at line 1688 of file ncursesw.h.
|
inline |
Move cursor the this position
Definition at line 1155 of file ncursesw.h.
|
inline |
Perform lowlevel cursor motion that takes effect immediately.
Definition at line 1165 of file ncursesw.h.
|
inlinevirtual |
Move window to new position with the new position as top left corner. This is virtual because it is redefined in NCursesPanel.
Reimplemented in NCursesPanel.
Definition at line 1140 of file ncursesw.h.
|
inlinevirtual |
Propagate the changes in this window to the virtual screen. This is redefined in NCursesPanel.
Reimplemented in NCursesPad, and NCursesPanel.
Definition at line 1714 of file ncursesw.h.
|
static |
Number of available colors
Definition at line 547 of file ncursesw.cc.
|
inline |
Overlay this window over win.
Definition at line 1722 of file ncursesw.h.
|
inline |
Overwrite win with this window.
Definition at line 1730 of file ncursesw.h.
|
inline |
Get my parent.
Definition at line 1777 of file ncursesw.h.
int NCursesWindow::printw | ( | const char * | fmt, |
... | |||
) |
Do a formatted print to the window.
Definition at line 75 of file ncursesw.cc.
int NCursesWindow::printw | ( | int | y, |
int | x, | ||
const char * | fmt, | ||
... | |||
) |
Move the cursor and then do a formatted print to the window.
Definition at line 87 of file ncursesw.cc.
|
inline |
Redraw n lines starting from the requested line
Definition at line 1636 of file ncursesw.h.
|
inline |
Redraw the whole window
Definition at line 1641 of file ncursesw.h.
|
inlinevirtual |
Propagate the changes in this window to the virtual screen and call doupdate(). This is redefined in NCursesPanel.
Reimplemented in NCursesPad, and NCursesPanel.
Definition at line 1708 of file ncursesw.h.
|
static |
This function is used to generate a window of ripped-of lines. If the argument is positive, lines are removed from the top, if it is negative lines are removed from the bottom. This enhances the lowlevel ripoffline() function because it uses the internal implementation that allows to remove more than just a single line. This function must be called before any other ncurses function. The creation of the window is defered until ncurses gets initialized. The initialization function is then called.
Definition at line 405 of file ncursesw.cc.
|
inline |
Scroll amount lines. If amount is positive, scroll up, otherwise scroll down.
Definition at line 1563 of file ncursesw.h.
|
inline |
If bf is TRUE, window scrolls if cursor is moved off the bottom edge of the window or a scrolling region, otherwise the cursor is left at the bottom line.
Definition at line 1570 of file ncursesw.h.
int NCursesWindow::setcolor | ( | short | pair | ) |
Set actually used palette entry
Definition at line 584 of file ncursesw.cc.
int NCursesWindow::setpalette | ( | short | fore, |
short | back | ||
) |
Set color palette entry
Definition at line 574 of file ncursesw.cc.
|
inline |
Define a soft scrolling region.
Definition at line 1575 of file ncursesw.h.
|
inline |
Get the next child of my parent.
Definition at line 1770 of file ncursesw.h.
|
inline |
Disable "standout" attributes
Definition at line 1698 of file ncursesw.h.
|
inline |
Enable "standout" attributes
Definition at line 1693 of file ncursesw.h.
|
inline |
Propagate the changes down to all descendant windows
Definition at line 1651 of file ncursesw.h.
|
inline |
If called with bf=TRUE, syncup() is called whenever the window is changed
Definition at line 1666 of file ncursesw.h.
|
inline |
Propagate the changes up in the hierarchy
Definition at line 1656 of file ncursesw.h.
|
inlinestatic |
Size of a tab on terminal, not window
Definition at line 1052 of file ncursesw.h.
|
inline |
Mark cnt lines beginning from line s as changed or unchanged, depending on the value of the changed flag.
Definition at line 1606 of file ncursesw.h.
|
inline |
Mark the whole window as modified.
Definition at line 1595 of file ncursesw.h.
|
inline |
Mark the whole window as unmodified.
Definition at line 1600 of file ncursesw.h.
|
static |
Call this routine very early if you want to have colors.
Definition at line 508 of file ncursesw.cc.
|
inline |
Draw a vertical line of len characters with the given character. If you pass zero for the character, curses will try to find a "nice" one.
Definition at line 1499 of file ncursesw.h.
|
inline |
Move the cursor to the requested position and then draw a vertical line.
Definition at line 1504 of file ncursesw.h.
|
inline |
Number of columns in this window
Definition at line 1075 of file ncursesw.h.
|
protected |
TRUE if we own the WINDOW
Definition at line 952 of file ncursesw.h.
|
staticprotected |
count of all active windows
Definition at line 939 of file ncursesw.h.
|
protected |
parent, if subwindow
Definition at line 957 of file ncursesw.h.
|
protected |
next subwindow of parent
Definition at line 965 of file ncursesw.h.
|
protected |
head of subwindows std::list
Definition at line 961 of file ncursesw.h.
|
protected |
the curses WINDOW
Definition at line 947 of file ncursesw.h.