# local dependencies
-Geometry.o: Geometry.cc Geometry.h
-Resource.o: Resource.cc Resource.h
BaseDisplay.o: BaseDisplay.cc i18n.h BaseDisplay.h LinkedList.h \
Timer.h
Basemenu.o: Basemenu.cc i18n.h openbox.h BaseDisplay.h \
LinkedList.h Screen.h BaseDisplay.h Timer.h Iconmenu.h Netizen.h \
Rootmenu.h Workspace.h Workspacemenu.h openbox.h Image.h \
Window.h Windowmenu.h Slit.h Toolbar.h Resource.h Geometry.h
+Geometry.o: Geometry.cc Geometry.h
Icon.o: Iconmenu.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \
Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \
Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \
Screen.h Configmenu.h Basemenu.h openbox.h Image.h Window.h \
Iconmenu.h Windowmenu.h Slit.h Rootmenu.h Workspace.h \
Workspacemenu.h Resource.h Geometry.h
+Resource.o: Resource.cc Resource.h Util.h
Rootmenu.o: Rootmenu.cc openbox.h BaseDisplay.h LinkedList.h \
Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \
Rootmenu.h Screen.h Configmenu.h Netizen.h Workspace.h \
LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \
Windowmenu.h Slit.h Clientmenu.h Workspace.h Screen.h \
Configmenu.h Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h Resource.h \
- Geometry.h Geometry.h
+ Geometry.h Geometry.h Util.h
Workspacemenu.o: Workspacemenu.cc i18n.h openbox.h BaseDisplay.h \
LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \
Windowmenu.h Slit.h Screen.h Configmenu.h Netizen.h Rootmenu.h \
openbox.o: openbox.cc i18n.h openbox.h BaseDisplay.h \
LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \
Windowmenu.h Slit.h Clientmenu.h Workspace.h Rootmenu.h \
- Screen.h Configmenu.h Netizen.h Workspacemenu.h Toolbar.h Resource.h Geometry.h
+ Screen.h Configmenu.h Netizen.h Workspacemenu.h Toolbar.h Resource.h \
+ Geometry.h Util.h
bsd-snprintf.o: bsd-snprintf.c bsd-snprintf.h
i18n.o: i18n.cc i18n.h
main.o: main.cc ../version.h i18n.h openbox.h BaseDisplay.h \
# local dependencies
-Geometry.o: Geometry.cc Geometry.h
-Resource.o: Resource.cc Resource.h
BaseDisplay.o: BaseDisplay.cc i18n.h BaseDisplay.h LinkedList.h \
Timer.h
Basemenu.o: Basemenu.cc i18n.h openbox.h BaseDisplay.h \
LinkedList.h Screen.h BaseDisplay.h Timer.h Iconmenu.h Netizen.h \
Rootmenu.h Workspace.h Workspacemenu.h openbox.h Image.h \
Window.h Windowmenu.h Slit.h Toolbar.h Resource.h Geometry.h
+Geometry.o: Geometry.cc Geometry.h
Icon.o: Iconmenu.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \
Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \
Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \
Screen.h Configmenu.h Basemenu.h openbox.h Image.h Window.h \
Iconmenu.h Windowmenu.h Slit.h Rootmenu.h Workspace.h \
Workspacemenu.h Resource.h Geometry.h
+Resource.o: Resource.cc Resource.h Util.h
Rootmenu.o: Rootmenu.cc openbox.h BaseDisplay.h LinkedList.h \
Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \
Rootmenu.h Screen.h Configmenu.h Netizen.h Workspace.h \
LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \
Windowmenu.h Slit.h Clientmenu.h Workspace.h Screen.h \
Configmenu.h Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h Resource.h \
- Geometry.h Geometry.h
+ Geometry.h Geometry.h Util.h
Workspacemenu.o: Workspacemenu.cc i18n.h openbox.h BaseDisplay.h \
LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \
Windowmenu.h Slit.h Screen.h Configmenu.h Netizen.h Rootmenu.h \
openbox.o: openbox.cc i18n.h openbox.h BaseDisplay.h \
LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \
Windowmenu.h Slit.h Clientmenu.h Workspace.h Rootmenu.h \
- Screen.h Configmenu.h Netizen.h Workspacemenu.h Toolbar.h Resource.h Geometry.h
+ Screen.h Configmenu.h Netizen.h Workspacemenu.h Toolbar.h Resource.h \
+ Geometry.h Util.h
bsd-snprintf.o: bsd-snprintf.c bsd-snprintf.h
i18n.o: i18n.cc i18n.h
main.o: main.cc ../version.h i18n.h openbox.h BaseDisplay.h \
// DEALINGS IN THE SOFTWARE.
#include "Resource.h"
+#include "Util.h"
#ifdef HAVE_CONFIG_H
# include "../config.h"
# include <stdio.h>
#endif // HAVE_STDIO_H
-#include <assert.h>
-
bool obResource::m_initialized = false;
obResource::obResource(const std::string &file) {
}
void obResource::save() {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
XrmPutFileDatabase(m_database, m_file.c_str());
m_modified = false;
}
}
void obResource::setValue(const std::string &rname, bool value) {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
const char *val = (value ? "True" : "False");
std::string rc_string = rname + ": " + val;
}
void obResource::setValue(const std::string &rname, long value) {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
char val[11];
sprintf(val, "%ld", value);
}
void obResource::setValue(const std::string &rname, const char *value) {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
std::string rc_string = rname + ": " + value;
XrmPutLineResource(&m_database, rc_string.c_str());
}
void obResource::setValue(const std::string &rname, const std::string &value) {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
std::string rc_string = rname + ": " + value;
XrmPutLineResource(&m_database, rc_string.c_str());
bool obResource::getValue(const std::string &rname, const std::string &rclass,
bool &value) const {
- assert(rclass.c_str() != NULL);
- assert(m_database != NULL);
+ ASSERT(rclass.c_str() != NULL);
+ ASSERT(m_database != NULL);
char *rettype;
XrmValue retvalue;
bool obResource::getValue(const std::string &rname, const std::string &rclass,
long &value) const {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
char *rettype;
XrmValue retvalue;
bool obResource::getValue(const std::string &rname, const std::string &rclass,
std::string &value) const {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
char *rettype;
XrmValue retvalue;
#include <X11/Xatom.h>
#include <X11/keysym.h>
-#include <assert.h>
#include "i18n.h"
#include "openbox.h"
--- /dev/null
+// Util.h for Openbox
+// Copyright (c) 2002 - 2002 Ben Jansens (ben@orodu.net)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#ifndef __Util_hh
+#define __Util_hh
+
+#ifdef DEBUG
+# include <assert.h>
+# define ASSERT(x) assert(x)
+#else // !DEBUG
+# define ASSERT(x)
+#endif // DEBUG
+
+#endif // __Util_hh
#include "Workspace.h"
#include "Windowmenu.h"
#include "Geometry.h"
+#include "Util.h"
#ifdef HAVE_STDIO_H
# include <stdio.h>
}
void Workspace::placeWindow(OpenboxWindow *win) {
- assert(win != NULL);
+ ASSERT(win != NULL);
Bool placed = False;
#include "Window.h"
#include "Workspace.h"
#include "Workspacemenu.h"
+#include "Util.h"
#include <string>
#include <algorithm>
void Openbox::load_rc(BScreen *screen) {
- assert (screen != NULL);
+ ASSERT (screen != NULL);
const int screen_number = screen->getScreenNumber();
- assert (screen_number >= 0);
+ ASSERT (screen_number >= 0);
if (!config.load())
return;