Enumerations | Functions

ui/curswa.h File Reference

Holds workarounds for curses.h. More...

Go to the source code of this file.

Enumerations

enum  {
  KEY_REFRESH = 12, KEY_ESC = 27, KEY_TAB = '\t', KEY_SPACE = ' ',
  KEY_CTRL_E = 5
}

Functions

int _mvwchgat_ (WINDOW *w, int y, int x, int n, int attr, short color, const void *)
int box (WINDOW *win, int verch, int horch)
int clear ()
int erase ()
int move (int y, int x)
int mvwaddnstr_c (WINDOW *win, int y, int x, const char *str, int n)
int mvwaddstr_c (WINDOW *win, int y, int x, const char *str)
int refresh ()
void visibleCursor (bool v)
int waddstr_c (WINDOW *win, const char *str)

Detailed Description

Holds workarounds for curses.h when compiling under C++. It specifically removes the macros:

and replaces them by inline functions.

It also defines certain inline functions for dealing with const char* arguments. Some curses functions simply use char* which doesn't go along well with std::string::c_str(). The defined functions do have the same syntax as their cousins.

The configure script figures out which one to use.

The following functions are defined to handle const char* arguments

mvwchgat is also defined as inline function in case the curses library does not provide it. The configure script takes care of figuring whether or not the function is provided by the curses library.

Please note that this file has to be included after the (n)curses header file.

Definition in file curswa.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
KEY_REFRESH 

The value returned by [w]getch() when the user presses ^L.

KEY_ESC 

The value returned by [w]getch() upon pressing the escape key

KEY_TAB 

The value returned by [w]getch() upon pressing the tab key

KEY_SPACE 

The value returned by [w]getch() upon pressing the space key

KEY_CTRL_E 

Definition at line 69 of file curswa.h.


Function Documentation

int _mvwchgat_ ( WINDOW *  w,
int  y,
int  x,
int  n,
int  attr,
short  color,
const void *   
) [inline]

Definition at line 227 of file curswa.h.

int box ( WINDOW *  win,
int  verch,
int  horch 
) [inline]
int clear (  )  [inline]

Definition at line 133 of file curswa.h.

Referenced by YAPET::UI::BaseWindow::endCurses(), and CSVImport::import().

Here is the caller graph for this function:

int erase (  )  [inline]

Definition at line 140 of file curswa.h.

int move ( int  y,
int  x 
) [inline]

Definition at line 147 of file curswa.h.

int mvwaddnstr_c ( WINDOW *  win,
int  y,
int  x,
const char *  str,
int  n 
) [inline]

Definition at line 209 of file curswa.h.

int mvwaddstr_c ( WINDOW *  win,
int  y,
int  x,
const char *  str 
) [inline]

Definition at line 189 of file curswa.h.

int refresh (  )  [inline]

Definition at line 154 of file curswa.h.

Referenced by MainWindow::openFile(), and YAPET::UI::InputWidget::setText().

Here is the caller graph for this function:

void visibleCursor ( bool  v  )  [inline]

Shows or hides the cursor.

Definition at line 107 of file curswa.h.

Referenced by YAPET::UI::PasswordWidget::focus(), YAPET::UI::InputWidget::focus(), and YAPET::UI::CheckBoxGroup::focus().

Here is the caller graph for this function:

int waddstr_c ( WINDOW *  win,
const char *  str 
) [inline]

Definition at line 169 of file curswa.h.