summaryrefslogtreecommitdiff
path: root/src/openbox.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-11-11 10:05:06 +0000
committerDana Jansens <danakj@orodu.net>2002-11-11 10:05:06 +0000
commitcee305244662d352a7ad5ab7ae22f6221c064d3d (patch)
treed7d8baeef9a87d239baba8b60384ae534a18cc2e /src/openbox.cc
parentfb0dd6cf9a839f9990ac877bf1b3d469d883b463 (diff)
not using any old blackbox classes anymore!
Diffstat (limited to 'src/openbox.cc')
-rw-r--r--src/openbox.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/openbox.cc b/src/openbox.cc
index 6f42bc20..9d040e14 100644
--- a/src/openbox.cc
+++ b/src/openbox.cc
@@ -6,8 +6,11 @@
#include "../version.h"
#include "openbox.hh"
+#include "screen.hh"
#include "otk/property.hh"
#include "otk/display.hh"
+#include "otk/assassin.hh"
+#include "otk/util.hh" // TEMPORARY
extern "C" {
#include <X11/cursorfont.h>
@@ -41,6 +44,8 @@ extern "C" {
#define _(str) gettext(str)
}
+#include <algorithm>
+
namespace ob {
Openbox *Openbox::instance = (Openbox *) 0;
@@ -79,9 +84,24 @@ Openbox::Openbox(int argc, char **argv)
_displayreq = (char*) 0;
_argv0 = argv[0];
_doshutdown = false;
+ _rcfilepath = otk::expandTilde("~/.openbox/rc3");
parseCommandLine(argc, argv);
+ // TEMPORARY: using the xrdb rc3
+ _config.setFile(_rcfilepath);
+ if (!_config.load()) {
+ printf("failed to load rc file %s\n", _config.file().c_str());
+ ::exit(2);
+ }
+ std::string s;
+ _config.getValue("session.styleFile", s);
+ _config.setFile(s);
+ if (!_config.load()) {
+ printf("failed to load style %s\n", _config.file().c_str());
+ ::exit(2);
+ }
+
// open the X display (and gets some info about it, and its screens)
otk::OBDisplay::initialize(_displayreq);
assert(otk::OBDisplay::display);
@@ -106,6 +126,10 @@ Openbox::Openbox(int argc, char **argv)
_cursors.lr_angle = XCreateFontCursor(otk::OBDisplay::display, XC_lr_angle);
_cursors.ul_angle = XCreateFontCursor(otk::OBDisplay::display, XC_ul_angle);
_cursors.ur_angle = XCreateFontCursor(otk::OBDisplay::display, XC_ur_angle);
+
+ // initialize all the screens
+ _screens.push_back(new OBScreen(0));
+ _screens[0]->loadStyle(_config);
_state = State_Normal; // done starting
}
@@ -118,6 +142,8 @@ Openbox::~Openbox()
// unmanage all windows
while (!_clients.empty())
_xeventhandler.unmanageWindow(_clients.begin()->second);
+
+ std::for_each(_screens.begin(), _screens.end(), otk::PointerAssassin());
// close the X display
otk::OBDisplay::destroy();