Base window class for windows wanting to receive resize events. More...
#include <basewindow.h>


Classes | |
| class | AlarmFunction |
| Base class for calling a function upon the alarm signal. More... | |
Public Types | |
| enum | MinDimension { MIN_Y = 24, MIN_X = 80 } |
The minimum dimensions supported. More... | |
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 () |
| static void | initCurses () throw (UIException) |
| Initializes (n)curses. | |
| static void | refreshAll () |
| static void | resizeAll () |
| static void | setTimeout (AlarmFunction *af, int sec) |
| Sets a timeout. | |
| static void | suspendTimeout () |
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 responding to window resize events should be derived from this class.
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 66 of file basewindow.h.
Resize events below either of the dimensions will not be processed.
Definition at line 194 of file basewindow.h.
| BaseWindow::BaseWindow | ( | ) |
Definition at line 223 of file basewindow.cc.
References registerBaseWindow().

| BaseWindow::~BaseWindow | ( | ) | [virtual] |
Definition at line 227 of file basewindow.cc.
References unregisterBaseWindow().

| void BaseWindow::deleteAll | ( | ) | [static] |
Deletes all registered windows by calling delete.
Definition at line 180 of file basewindow.cc.
References basewindow_list.
Referenced by sig_handler().

| void BaseWindow::endCurses | ( | ) | [static] |
Ends the curses mode.
Definition at line 159 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 110 of file basewindow.cc.
Referenced by initCurses().

| void BaseWindow::initCurses | ( | ) | throw (UIException) [static] |
Initializes curses and sets up the signal handlers.
Definition at line 137 of file basewindow.cc.
References init_signal(), YAPET::UI::Colors::initColors(), MIN_X, MIN_Y, and refresh().
Referenced by main().


| int YAPET::UI::BaseWindow::maxX | ( | ) | const [inline, protected] |
Returns the maximum x value of the screen.
Definition at line 143 of file basewindow.h.
Referenced by StatusBar::createWindow(), MainWindow::createWindow(), SearchDialog::getStartX(), PasswordRecord::getStartX(), PasswordDialog::getStartX(), YAPET::UI::MessageBox::getStartX(), SearchDialog::getWidth(), PasswordRecord::getWidth(), PasswordDialog::getWidth(), MainWindow::printTitle(), MainWindow::resize(), PWGenDialog::windowWidth(), and FileOpen::windowWidth().

| int YAPET::UI::BaseWindow::maxY | ( | ) | const [inline, protected] |
Returns the maximum y value of the screen.
Definition at line 156 of file basewindow.h.
Referenced by StatusBar::createWindow(), MainWindow::createWindow(), SearchDialog::getStartY(), PasswordRecord::getStartY(), PasswordDialog::getStartY(), YAPET::UI::MessageBox::getStartY(), MainWindow::resize(), PWGenDialog::startY(), and FileOpen::windowHeight().

| int YAPET::UI::BaseWindow::minX | ( | ) | const [inline, protected] |
Returns the minimum x value of the screen.
Definition at line 169 of file basewindow.h.
Referenced by StatusBar::createWindow(), PWGenDialog::startX(), and FileOpen::startX().

| int YAPET::UI::BaseWindow::minY | ( | ) | const [inline, protected] |
Returns the minimum y value of the screen.
Definition at line 182 of file basewindow.h.
Referenced by FileOpen::startY().

| virtual void YAPET::UI::BaseWindow::refresh | ( | ) | [pure virtual] |
Implemented in YAPET::UI::DialogBox, YAPET::UI::MessageBox, FileOpen, MainWindow, PasswordDialog, PasswordRecord, PWGenDialog, SearchDialog, and StatusBar.
Referenced by endCurses(), initCurses(), and RefreshIt::operator()().

| void BaseWindow::refreshAll | ( | ) | [static] |
Calls the refresh() method of all registered windows.
Definition at line 201 of file basewindow.cc.
References basewindow_list.
Referenced by YAPET::UI::PasswordWidget::focus(), YAPET::UI::ListWidget< YAPET::PartDec >::focus(), YAPET::UI::InputWidget::focus(), YAPET::UI::CheckBoxGroup::focus(), YAPET::UI::Button::focus(), MainWindow::handle_signal(), resizeAll(), PasswordRecord::run(), MainWindow::run(), and YAPET::UI::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 166 of file basewindow.cc.
References basewindow_list.
Referenced by BaseWindow().

| virtual void YAPET::UI::BaseWindow::resize | ( | ) | [pure virtual] |
Implemented in YAPET::UI::DialogBox, YAPET::UI::MessageBox, FileOpen, MainWindow, PasswordDialog, PasswordRecord, PWGenDialog, SearchDialog, and StatusBar.
Referenced by ResizeIt::operator()().

| void BaseWindow::resizeAll | ( | ) | [static] |
Calls the resize() method of all registered windows.
Definition at line 187 of file basewindow.cc.
References basewindow_list, MIN_X, MIN_Y, and refreshAll().
Referenced by MainWindow::lockScreen(), SearchDialog::run(), PWGenDialog::run(), PasswordRecord::run(), PasswordDialog::run(), MainWindow::run(), FileOpen::run(), and YAPET::UI::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 209 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 90 of file basewindow.cc.
References alarm_fun, deleteAll(), endCurses(), and YAPET::UI::BaseWindow::AlarmFunction::process().

| void BaseWindow::suspendTimeout | ( | ) | [static] |
Suspends a currently set timeout.
Definition at line 215 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 171 of file basewindow.cc.
References basewindow_list.
Referenced by ~BaseWindow().

BaseWindow::AlarmFunction * BaseWindow::alarm_fun = NULL [static, private] |
Definition at line 91 of file basewindow.h.
Referenced by setTimeout(), and sig_handler().
std::list< BaseWindow * > BaseWindow::basewindow_list = std::list<BaseWindow*>() [static, private] |
Definition at line 93 of file basewindow.h.
Referenced by deleteAll(), refreshAll(), registerBaseWindow(), resizeAll(), and unregisterBaseWindow().
1.7.1