]> Dogcows Code - chaz/openbox/blob - otk/application.cc
change the default titlebar layout
[chaz/openbox] / otk / application.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 #include "config.h"
4
5 #include "application.hh"
6 #include "eventhandler.hh"
7 #include "timer.hh"
8 #include "property.hh"
9 #include "rendercolor.hh"
10 #include "renderstyle.hh"
11 #include "display.hh"
12
13 #include <cstdlib>
14 #include <iostream>
15
16 namespace otk {
17
18 extern void initialize();
19 extern void destroy();
20
21 Application::Application(int argc, char **argv)
22 : EventDispatcher(),
23 _dockable(false),
24 _appwidget_count(0)
25 {
26 (void)argc;
27 (void)argv;
28
29 otk::initialize();
30
31 _screen = DefaultScreen(**display);
32
33 loadStyle();
34 }
35
36 Application::~Application()
37 {
38 otk::destroy();
39 }
40
41 void Application::loadStyle(void)
42 {
43 // XXX: find the style name as a property
44 std::string style = "/usr/local/share/openbox/styles/artwiz";
45 //_style->load(style);
46 otk::RenderStyle::setStyle(_screen, style);
47 }
48
49 void Application::run(void)
50 {
51 if (_appwidget_count <= 0) {
52 std::cerr << "ERROR: No main widgets exist. You must create and show() " <<
53 "an AppWidget for the Application before calling " <<
54 "Application::run().\n";
55 ::exit(1);
56 }
57
58 while (_appwidget_count > 0) {
59 dispatchEvents();
60 if (_appwidget_count > 0)
61 Timer::dispatchTimers(); // fire pending events
62 }
63 }
64
65 }
This page took 0.040479 seconds and 4 git commands to generate.