1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
7 #include "application.hh"
8 #include "eventhandler.hh"
21 Application::Application(int argc, char **argv)
30 const ScreenInfo *s_info = _display.screenInfo(DefaultScreen(*_display));
32 _timer_manager = new TimerQueueManager();
33 _img_ctrl = new ImageControl(_timer_manager, s_info, True, 4, 5, 200);
34 _style_conf = new Configuration(False);
35 _style = new Style(_img_ctrl);
40 Application::~Application()
44 delete _timer_manager;
48 void Application::loadStyle(void)
50 // find the style name as a property
51 std::string style = "/usr/local/share/openbox/styles/artwiz";
52 _style_conf->setFile(style);
53 if (!_style_conf->load()) {
54 std::cerr << "ERROR: Unable to load style \"" << style << "\".\n";
57 _style->load(*_style_conf);
60 void Application::run(void)
62 if (_appwidget_count <= 0) {
63 std::cerr << "ERROR: No main widgets exist. You must create and show() " <<
64 "an AppWidget for the Application before calling " <<
65 "Application::run().\n";
69 while (_appwidget_count > 0) {
71 _timer_manager->fire(); // fire pending events