#include <fsWinApp.h>
The class represents a Windows application and its main window. Such a skeleton can be then extended through custom client classes offering particular functionality. A client class implements WinApp_t::EvRcvr_i interface to define responses to individual events. It's especially useful for rapid prototyping as only a simple client class, encapsulating requested behaviour, has to be implemented. From the user's point of view, the entry-point of the application is the WinAppInit function in the fs::rap namespace, which has to be provided by the user. Typically, the function performs two actions: it modifies default configuration and registers event receivers (clients). Note that clients can be layered in this way.
namespace fs { namespace rap { bool WinAppInit(WinApp_t &App, WinApp_t::InitCfg_t &Cfg) { // modify default configuration Cfg.m_nClW = 512; Cfg.m_nClH = 512; // register event receivers (clients) static test::Client_t Client; App.RegEvRcvr(&Client); return true; } }} // namespace fs::rap
Definition at line 59 of file fsWinApp.h.
Public Member Functions | |
bool | IsValid () const |
Checks the internal state / correct construction. | |
const char * | GetCmdLine () const |
Returns the command-line string passed to the app. by the system. | |
void | SetTitle (const char *pszTitle) |
Sets the title of the application window. | |
void | Redraw () |
Sends the 'Redraw' request. | |
void | Fscrn (bool bOn) |
Sends the 'Fullscreen' request. | |
void | Quit () |
Sends the 'Quit' request. | |
void | RegEvRcvr (EvRcvr_i *pEvRcvr) |
Registers a new event event receiver (client). | |
void * | GetWinHdle () const |
Returns a system handle of the application window (should not be 0). | |
Private Member Functions | |
WinApp_t () | |
WinApp_t (const WinApp_t &) | |
No copy. | |
WinApp_t & | operator= (const WinApp_t &) |
No assignment. | |
Friends | |
WinApp_t & | WinAppInst () |
Classes | |
struct | DrawEv_t |
Redraw request event, empty. More... | |
class | EvRcvr_i |
Event receiver (client) interface. More... | |
class | InitCfg_t |
Initial configuration. More... | |
struct | InitEv_t |
Init event, empty. More... | |
struct | KeyEv_t |
Key / mouse button event. More... | |
struct | MouseEv_t |
Mouse position event. More... | |
struct | QuitEv_t |
Quit event, empty. More... | |
struct | RunEv_t |
Run-time task event, empty. More... | |
struct | SizeEv_t |
Resize event. More... |
fs::rap::WinApp_t::WinApp_t | ( | ) | [inline, private] |
Definition at line 192 of file fsWinApp.h.
fs::rap::WinApp_t::WinApp_t | ( | const WinApp_t & | ) | [private] |
No copy.
void WinApp_t::Fscrn | ( | bool | bOn | ) |
Sends the 'Fullscreen' request.
Definition at line 466 of file fsWinApp.cpp.
References CalcWinRect(), FS_ASSERT, FS_VERIFY, FS_VERIFY_RETURN, g_Cfg, g_hWnd, GetWinStyles(), IsValid(), and fs::rap::WinApp_t::InitCfg_t::m_bFscrn.
Here is the call graph for this function:
const char * WinApp_t::GetCmdLine | ( | ) | const |
Returns the command-line string passed to the app. by the system.
Definition at line 441 of file fsWinApp.cpp.
References FS_ASSERT, and g_pszCmdLine.
void * WinApp_t::GetWinHdle | ( | ) | const |
Returns a system handle of the application window (should not be 0).
Definition at line 522 of file fsWinApp.cpp.
References FS_ASSERT, FS_VERIFY_RETURN_VAL, g_hWnd, and IsValid().
Here is the call graph for this function:
bool WinApp_t::IsValid | ( | ) | const |
Checks the internal state / correct construction.
Definition at line 436 of file fsWinApp.cpp.
References g_hWnd.
void WinApp_t::Quit | ( | ) |
Sends the 'Quit' request.
Definition at line 512 of file fsWinApp.cpp.
References FS_VERIFY_RETURN, IsValid(), and Send().
Here is the call graph for this function:
void WinApp_t::Redraw | ( | ) |
Sends the 'Redraw' request.
Definition at line 457 of file fsWinApp.cpp.
References FS_ASSERT, FS_VERIFY_RETURN, g_hWnd, and IsValid().
Here is the call graph for this function:
void WinApp_t::RegEvRcvr | ( | EvRcvr_i * | pEvRcvr | ) |
Registers a new event event receiver (client).
Definition at line 530 of file fsWinApp.cpp.
References FS_VERIFY_RETURN, and g_EvRcvrs.
void WinApp_t::SetTitle | ( | const char * | pszTitle | ) |
Sets the title of the application window.
Definition at line 448 of file fsWinApp.cpp.
References FS_ASSERT, FS_VERIFY_RETURN, g_hWnd, and IsValid().
Here is the call graph for this function:
WinApp_t& WinAppInst | ( | ) | [friend] |
Definition at line 82 of file fsWinApp.cpp.