#include <basewindow.h>
Public Member Functions | |
BaseWindow () | |
virtual void | refresh ()=0 |
virtual void | resize ()=0 |
virtual | ~BaseWindow () |
Static Public Member Functions | |
static void | deleteAll () |
Delete all registered windows. | |
static void | endCurses () |
Ends the curses mode. | |
static void | initCurses () |
Initializes (n)curses. | |
static void | refreshAll () |
Calls the refresh() method of all registered windows. | |
static void | resizeAll () |
Calls the resize() method of all registered windows. | |
static void | setTimeout (AlarmFunction *af, int sec) |
Sets a timeout. | |
static void | suspendTimeout () |
Suspends a currently set timeout. | |
Protected Member Functions | |
int | maxX () const |
The maximum x value of the screen. | |
int | maxY () const |
The maximum y value of the screen. | |
int | minX () const |
The minimum x value of the screen. | |
int | minY () const |
The minimum y value of the screen. | |
Static Protected Member Functions | |
static void | init_signal () |
Initializes the signal handlers. | |
static void | registerBaseWindow (BaseWindow *r) |
Register a base window. | |
static void | sig_handler (int signo) |
The signal handler. | |
static void | unregisterBaseWindow (BaseWindow *r) |
un-registers a base window. | |
Static Private Attributes | |
static AlarmFunction * | alarm_fun = NULL |
static std::list< BaseWindow * > | basewindow_list = std::list<BaseWindow*>() |
Classes | |
class | AlarmFunction |
Base class for calling a function upon the alarm signal. More... |
The constructor of this class registers the window to receive the resize event. The destructor un-registers the class from the list of base windows.
There are also static members for dealing with signals and initializing (n)curses.
Definition at line 62 of file basewindow.h.
BaseWindow::BaseWindow | ( | ) |
BaseWindow::~BaseWindow | ( | ) | [virtual] |
void BaseWindow::deleteAll | ( | ) | [static] |
Deletes all registered windows by calling delete
.
Definition at line 162 of file basewindow.cc.
References basewindow_list.
Referenced by sig_handler().
void BaseWindow::endCurses | ( | ) | [static] |
Ends the curses mode.
Definition at line 140 of file basewindow.cc.
References clear(), and refresh().
Referenced by main(), and sig_handler().
void BaseWindow::init_signal | ( | ) | [static, protected] |
Initializes the signal handlers. This method will be called by initCurses()
.
Definition at line 98 of file basewindow.cc.
References sig_handler().
Referenced by initCurses().
void BaseWindow::initCurses | ( | ) | [static] |
Initializes curses and sets up the signal handlers.
Definition at line 127 of file basewindow.cc.
References init_signal(), YAPETUI::Colors::initColors(), and refresh().
Referenced by main().
int YAPETUI::BaseWindow::maxX | ( | ) | const [inline, protected] |
Returns the maximum x value of the screen.
Definition at line 139 of file basewindow.h.
Referenced by StatusBar::createWindow(), MainWindow::createWindow(), PasswordRecord::getStartX(), PasswordDialog::getStartX(), YAPETUI::MessageBox::getStartX(), PasswordRecord::getWidth(), PasswordDialog::getWidth(), MainWindow::printTitle(), MainWindow::resize(), and FileOpen::windowWidth().
int YAPETUI::BaseWindow::maxY | ( | ) | const [inline, protected] |
Returns the maximum y value of the screen.
Definition at line 152 of file basewindow.h.
Referenced by StatusBar::createWindow(), MainWindow::createWindow(), PasswordRecord::getStartY(), PasswordDialog::getStartY(), YAPETUI::MessageBox::getStartY(), MainWindow::resize(), and FileOpen::windowHeight().
int YAPETUI::BaseWindow::minX | ( | ) | const [inline, protected] |
Returns the minimum x value of the screen.
Definition at line 165 of file basewindow.h.
Referenced by StatusBar::createWindow(), and FileOpen::startX().
int YAPETUI::BaseWindow::minY | ( | ) | const [inline, protected] |
Returns the minimum y value of the screen.
Definition at line 178 of file basewindow.h.
Referenced by FileOpen::startY().
virtual void YAPETUI::BaseWindow::refresh | ( | ) | [pure virtual] |
Implemented in YAPETUI::DialogBox, YAPETUI::MessageBox, FileOpen, MainWindow, PasswordDialog, PasswordRecord, and StatusBar.
Referenced by endCurses(), initCurses(), and RefreshIt::operator()().
void BaseWindow::refreshAll | ( | ) | [static] |
Calls the refresh()
method of all registered windows.
Definition at line 179 of file basewindow.cc.
References basewindow_list.
Referenced by YAPETUI::ListWidget< YAPET::PartDec >::focus(), YAPETUI::InputWidget::focus(), YAPETUI::Button::focus(), MainWindow::handle_signal(), resizeAll(), MainWindow::run(), and YAPETUI::MessageBox::run().
void BaseWindow::registerBaseWindow | ( | BaseWindow * | r | ) | [static, protected] |
This method will be called by the constructor of BaseWindow
.
r | the pointer to the BaseWindow . Usually this . |
Definition at line 147 of file basewindow.cc.
References basewindow_list.
Referenced by BaseWindow().
virtual void YAPETUI::BaseWindow::resize | ( | ) | [pure virtual] |
Implemented in YAPETUI::DialogBox, YAPETUI::MessageBox, FileOpen, MainWindow, PasswordDialog, PasswordRecord, and StatusBar.
Referenced by ResizeIt::operator()().
void BaseWindow::resizeAll | ( | ) | [static] |
Calls the resize()
method of all registered windows.
Definition at line 169 of file basewindow.cc.
References basewindow_list, and refreshAll().
Referenced by MainWindow::lockScreen(), PasswordRecord::run(), PasswordDialog::run(), MainWindow::run(), FileOpen::run(), and YAPETUI::DialogBox::run().
void BaseWindow::setTimeout | ( | AlarmFunction * | af, | |
int | sec | |||
) | [static] |
Sets a timeout using the system function alarm
. Upon the SIGALRM
signal, the process()
method of the AlarmFunction
class is called.
af | pointer to the AlarmFunction class. | |
sec | the number of seconds before SIGALRM is raised. |
Definition at line 187 of file basewindow.cc.
References alarm_fun.
Referenced by MainWindow::run().
void BaseWindow::sig_handler | ( | int | signo | ) | [static, protected] |
This is the signal handler for the signals processed.
Upon SIGALRM
(set by setTimeout()
) it will call the process
method of the AlarmFunction
class pointed to be alarm_fun
.
signo | the number of the signal. |
Definition at line 80 of file basewindow.cc.
References alarm_fun, deleteAll(), endCurses(), and YAPETUI::BaseWindow::AlarmFunction::process().
Referenced by init_signal().
void BaseWindow::suspendTimeout | ( | ) | [static] |
Suspends a currently set timeout.
Definition at line 193 of file basewindow.cc.
Referenced by MainWindow::run().
void BaseWindow::unregisterBaseWindow | ( | BaseWindow * | r | ) | [static, protected] |
This method will be called by the destructor of BaseWindow
.
r | the pointer to the BaseWindow to be removed from the list. Usually this . |
Definition at line 152 of file basewindow.cc.
References basewindow_list.
Referenced by ~BaseWindow().
BaseWindow::AlarmFunction * BaseWindow::alarm_fun = NULL [static, private] |
std::list< BaseWindow * > BaseWindow::basewindow_list = std::list<BaseWindow*>() [static, private] |
Definition at line 89 of file basewindow.h.
Referenced by deleteAll(), refreshAll(), registerBaseWindow(), resizeAll(), and unregisterBaseWindow().