libyui-ncurses
|
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_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.
|
protected |
Only for use by derived classes. They are then in charge to fill the member variables correctly.
NCursesWindow::NCursesWindow | ( | WINDOW * | window | ) |
Constructor. Useful only for stdscr
NCursesWindow::NCursesWindow | ( | int | lines, |
int | cols, | ||
int | begin_y, | ||
int | begin_x | ||
) |
Constructor.
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.
|
virtual |
Destructor.
int NCursesWindow::add_attr_char | ( | int | y, |
int | x | ||
) |
Put attributed character from given position to the window.
|
inline |
Put a combined character to the window.
|
inline |
Put attributed character to the window.
|
inline |
Move cursor to the requested position and then put attributed character to the window.
|
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.
|
inline |
Move the cursor to the requested position and then perform the addstr as described above.
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.
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.
|
inline |
Switch off the window attributes;
|
inline |
Switch on the window attributes;
|
inline |
Set the window attributes;
|
inline |
Actual background color
|
inline |
Column of top left corner relative to stdscr
|
inline |
Line of top left corner relative to stdscr
|
inline |
Set the background property and apply it to the window.
|
inline |
Set the background property.
|
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.
|
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.
|
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.
|
inline |
Move the cursor to the requested position and then perform chgat() as described above.
|
inline |
Get the first child window.
|
inline |
Clear the window.
|
inline |
Set/Reset the clear flag. If std::set, the next refresh() will clear the screen.
NCursesWindow NCursesWindow::Clone | ( | ) |
Make an exact copy of the window.
|
inline |
Clear to the end of the window.
|
inline |
Clear to the end of the line.
|
inline |
Number of available colors
|
inlinestatic |
Number of cols on terminal, not window
|
inline |
Overlay or overwrite the rectangle in win given by dminrow,dmincol, dmaxrow,dmaxcol with the rectangle in this window beginning at sminrow,smincol.
|
inline |
Position the cursor in all ancestor windows corresponding to our setting
|
inline |
Delete character under the cursor.
|
inline |
Move cursor to requested position and delete the character under the cursor.
|
inline |
Delete the current line.
|
inline |
Do all outputs to make the physical screen looking like the virtual one
|
inline |
Put attributed character to the window and refresh it immediately.
|
inline |
Erase the window.
|
protected |
Signal an error with the given message text.
|
inline |
Actual foreground color
|
inline |
Get current background setting.
|
inline |
Get a keystroke from the window.
|
inline |
Move cursor to position and get a keystroke from the window
short NCursesWindow::getcolor | ( | ) | const |
Actual color pair
|
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.
|
inline |
Move the cursor to the requested position and then perform the getstr() as described above.
|
inline |
Get current position of the cursor
bool NCursesWindow::has_mouse | ( | ) | const |
Return TRUE if terminal supports a mouse, FALSE otherwise
|
inline |
Number of lines in this window
|
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.
|
inline |
Move the cursor to the requested position and then draw a horizontal line.
|
inline |
If bf is TRUE, use insert/delete character hardware support if possible. Otherwise do it in software.
|
inline |
If bf is TRUE, use insert/delete line hardware support if possible. Otherwise do it in software.
|
inline |
If called with bf=TRUE, any change in the window will cause an automatic immediate refresh()
int NCursesWindow::in_wchar | ( | cchar_t * | cchar | ) |
Retrieve combined character under the current cursor position.
|
inline |
Retrieve attributed character under the current cursor position.
|
inline |
Move cursor to requested position and then retrieve attributed character at this position.
|
inline |
Move cursor to requested position and then insert the attributed character before that position.
|
inline |
Insert attributed character into the window before current cursor position.
|
inline |
Move cursor to requested position and then insert the attributed character before that position.
|
inline |
If n>0 insert that many lines above the current line. If n<0 delete that many lines beginning with the current line.
|
inline |
Insert an empty line above the current line.
|
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.
|
inline |
Move the cursor to the requested position and then perform the insstr() as described above.
|
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.
|
inline |
Move the cursor to the requested position and then perform the instr() as described above.
|
inline |
Return TRUE if window is marked as changed, FALSE otherwise
bool NCursesWindow::isDescendant | ( | NCursesWindow & | win | ) |
Return TRUE if win is a descendant of this.
|
inline |
If called with bf=TRUE, the application will interpret function keys.
|
protected |
Destroy all subwindows.
|
inline |
If bf is TRUE, curses will leave the cursor after an update whereever it is after the update.
|
inlinestatic |
Number of lines on terminal, not window
|
inlinestatic |
Ncurses up to ncurses5 internally uses short
.
|
inline |
Largest x coord in window
|
inline |
Largest y coord in window
|
inline |
If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise 7-Bit characters are generated.
|
inline |
Move cursor the this position
|
inline |
Perform lowlevel cursor motion that takes effect immediately.
|
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.
|
inlinevirtual |
Propagate the changes in this window to the virtual screen. This is redefined in NCursesPanel.
Reimplemented in NCursesPanel, and NCursesPad.
|
static |
Number of available colors
|
inline |
Overlay this window over win.
|
inline |
Overwrite win with this window.
|
inline |
Get my parent.
int NCursesWindow::printw | ( | const char * | fmt, |
... | |||
) |
Do a formatted print to the window.
int NCursesWindow::printw | ( | int | y, |
int | x, | ||
const char * | fmt, | ||
... | |||
) |
Move the cursor and then do a formatted print to the window.
|
inline |
Redraw n lines starting from the requested line
|
inline |
Redraw the whole window
|
inlinevirtual |
Propagate the changes in this window to the virtual screen and call doupdate(). This is redefined in NCursesPanel.
Reimplemented in NCursesPanel, and NCursesPad.
|
virtual |
Reimplemented in NCursesPanel.
|
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.
|
inline |
Scroll amount lines. If amount is positive, scroll up, otherwise scroll down.
|
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.
int NCursesWindow::setcolor | ( | short | pair | ) |
Set actually used palette entry
int NCursesWindow::setpalette | ( | short | fore, |
short | back | ||
) |
Set color palette entry
|
inline |
Define a soft scrolling region.
|
inline |
Get the next child of my parent.
|
inline |
Disable "standout" attributes
|
inline |
Enable "standout" attributes
|
inline |
Propagate the changes down to all descendant windows
|
inline |
If called with bf=TRUE, syncup() is called whenever the window is changed
|
inline |
Propagate the changes up in the hierarchy
|
inlinestatic |
Size of a tab on terminal, not window
|
inline |
Mark cnt lines beginning from line s as changed or unchanged, depending on the value of the changed flag.
|
inline |
Mark the whole window as modified.
|
inline |
Mark the whole window as unmodified.
|
static |
Call this routine very early if you want to have colors.
|
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.
|
inline |
Move the cursor to the requested position and then draw a vertical line.
|
inline |
Number of columns in this window
|
protected |
TRUE if we own the WINDOW
|
staticprotected |
count of all active windows
|
protected |
parent, if subwindow
|
protected |
next subwindow of parent
|
protected |
head of subwindows std::list
|
protected |
the curses WINDOW