aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/App.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-11-27 21:50:32 (GMT)
committerfluxgen <fluxgen>2002-11-27 21:50:32 (GMT)
commitc9e62e7aee97862ec0e0527b4a963bc9d244e41c (patch)
tree8afc0107a7c53a9eb03b6d08b1043c2aba9ec880 /src/FbTk/App.cc
parentd39c023411aca300017a2710d484a2b16e5dd064 (diff)
downloadfluxbox_pavel-c9e62e7aee97862ec0e0527b4a963bc9d244e41c.zip
fluxbox_pavel-c9e62e7aee97862ec0e0527b4a963bc9d244e41c.tar.bz2
virtual eventLoop, default displayname and exit eventLoop variable
Diffstat (limited to 'src/FbTk/App.cc')
-rw-r--r--src/FbTk/App.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/FbTk/App.cc b/src/FbTk/App.cc
index 89b5921..e32c806 100644
--- a/src/FbTk/App.cc
+++ b/src/FbTk/App.cc
@@ -20,6 +20,9 @@
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22#include "App.hh" 22#include "App.hh"
23
24#include "EventManager.hh"
25
23#include <cassert> 26#include <cassert>
24#include <string> 27#include <string>
25 28
@@ -33,7 +36,7 @@ App *App::instance() {
33 return s_app; 36 return s_app;
34} 37}
35 38
36App::App(const char *displayname) { 39App::App(const char *displayname):m_done(false) {
37 if (s_app != 0) 40 if (s_app != 0)
38 throw std::string("Can't create more than one instance of FbTk::App"); 41 throw std::string("Can't create more than one instance of FbTk::App");
39 s_app = this; 42 s_app = this;
@@ -48,4 +51,17 @@ App::~App() {
48 s_app = 0; 51 s_app = 0;
49} 52}
50 53
54void App::eventLoop() {
55 XEvent ev;
56 while (!m_done) {
57 XNextEvent(display(), &ev);
58 EventManager::instance()->handleEvent(ev);
59 }
60}
61
62
63void App::end() {
64 m_done = true; //end loop in App::eventLoop
65}
66
51}; // end namespace FbTk 67}; // end namespace FbTk