]> Dogcows Code - chaz/openbox/blobdiff - otk/application.cc
Add the "obsetroot" tool. Use it to set the root background.
[chaz/openbox] / otk / application.cc
index e4de62c16bc8cf36e83b2a126d73be55b5bec761..afe06f803a41b5048604ca4f49e112dd8330fe67 100644 (file)
@@ -1,48 +1,41 @@
 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
 
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
 
 #include "application.hh"
 #include "eventhandler.hh"
-#include "widget.hh"
 #include "timer.hh"
 #include "property.hh"
 #include "rendercolor.hh"
+#include "renderstyle.hh"
+#include "display.hh"
 
-extern "C" {
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-}
-
+#include <cstdlib>
 #include <iostream>
 
 namespace otk {
 
+extern void initialize();
+extern void destroy();
+
 Application::Application(int argc, char **argv)
   : EventDispatcher(),
-    _display(),
     _dockable(false),
     _appwidget_count(0)
 {
   (void)argc;
   (void)argv;
 
-  Timer::initialize();
-  RenderColor::initialize();
-  Property::initialize();
-  _style = new RenderStyle(DefaultScreen(*_display), ""); // XXX: get a path!
-
+  otk::initialize();
+  
+  _screen = DefaultScreen(**display);
+  
   loadStyle();
 }
 
 Application::~Application()
 {
-  delete _style;
-  RenderColor::destroy();
-  Timer::destroy();
+  otk::destroy();
 }
 
 void Application::loadStyle(void)
@@ -63,6 +56,8 @@ void Application::run(void)
 
   while (_appwidget_count > 0) {
     dispatchEvents();
+    if (_appwidget_count <= 0)
+      break;
     Timer::dispatchTimers(); // fire pending events
   }
 }
This page took 0.021895 seconds and 4 git commands to generate.