1 #include "application.hh"
2 #include "eventhandler.hh"
15 OtkApplication::OtkApplication(int argc, char **argv)
16 : OtkEventDispatcher(),
23 OBDisplay::initialize(0);
24 const ScreenInfo *s_info =
25 OBDisplay::screenInfo(DefaultScreen(OBDisplay::display));
27 _timer_manager = new OBTimerQueueManager();
28 _img_ctrl = new BImageControl(_timer_manager, s_info, True, 4, 5, 200);
29 _style_conf = new Configuration(False);
30 _style = new Style(_img_ctrl);
35 OtkApplication::~OtkApplication()
39 delete _timer_manager;
45 void OtkApplication::loadStyle(void)
47 // find the style name as a property
48 std::string style = "/usr/local/share/openbox/styles/artwiz";
49 _style_conf->setFile(style);
50 if (!_style_conf->load()) {
51 std::cerr << "Unable to load style \"" << style << "\". Aborting.\n";
54 _style->load(*_style_conf);
57 void OtkApplication::exec(void)
59 if (_appwidget_count <= 0) {
60 std::cerr << "ERROR: No main widgets exist. You must create and show() " <<
61 "an OtkAppWidget for the OtkApplication before calling " <<
62 "OtkApplication::exec().\n";
66 while (_appwidget_count > 0) {
68 _timer_manager->fire(); // fire pending events