aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/App.hh17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/FbTk/App.hh b/src/FbTk/App.hh
index 2a64e75..e30694f 100644
--- a/src/FbTk/App.hh
+++ b/src/FbTk/App.hh
@@ -25,20 +25,31 @@
25#include <X11/Xlib.h> 25#include <X11/Xlib.h>
26 26
27namespace FbTk { 27namespace FbTk {
28
29/// Main class for applications, every application must create an instance of this class
28/** 30/**
29 Main class for applications, every application must create an instance of this class 31 * Usage: \n
30*/ 32 * App app; \n
33 * ... \n
34 * init some other stuff; \n
35 * ... \n
36 * main loop starts here: \n
37 * app.eventLoop(); \n
38 *
39 * To end main loop you call App::instance()->end()
40 */
31class App { 41class App {
32public: 42public:
33 /// @return singleton instance of App 43 /// @return singleton instance of App
34 static App *instance(); 44 static App *instance();
45 /// creates a display connection
35 explicit App(const char *displayname=0); 46 explicit App(const char *displayname=0);
36 virtual ~App(); 47 virtual ~App();
37 /// display connection 48 /// display connection
38 Display *display() const { return m_display; } 49 Display *display() const { return m_display; }
39 /// starts event loop 50 /// starts event loop
40 virtual void eventLoop(); 51 virtual void eventLoop();
41 /// ends event loop 52 /// forces an end to event loop
42 void end(); 53 void end();
43private: 54private:
44 static App *s_app; 55 static App *s_app;