]>
Dogcows Code - chaz/openbox/blob - otk/application.cc
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
)
29 Display::initialize(0);
30 const ScreenInfo
*s_info
=
31 Display::screenInfo(DefaultScreen(Display::display
));
33 _timer_manager
= new TimerQueueManager();
34 _img_ctrl
= new ImageControl(_timer_manager
, s_info
, True
, 4, 5, 200);
35 _style_conf
= new Configuration(False
);
36 _style
= new Style(_img_ctrl
);
41 Application::~Application()
45 delete _timer_manager
;
51 void Application::loadStyle(void)
53 // find the style name as a property
54 std::string style
= "/usr/local/share/openbox/styles/artwiz";
55 _style_conf
->setFile(style
);
56 if (!_style_conf
->load()) {
57 std::cerr
<< "ERROR: Unable to load style \"" << style
<< "\".\n";
60 _style
->load(*_style_conf
);
63 void Application::run(void)
65 if (_appwidget_count
<= 0) {
66 std::cerr
<< "ERROR: No main widgets exist. You must create and show() " <<
67 "an AppWidget for the Application before calling " <<
68 "Application::run().\n";
72 while (_appwidget_count
> 0) {
74 _timer_manager
->fire(); // fire pending events
This page took 0.038135 seconds and 4 git commands to generate.