all repos — openbox @ 3dcebcf56c6dd3a3707291e757af485bb55df7a6

openbox fork - make it a bit more like ryudo

Added Util.h, which contains only an ASSERT macro for now
Dana Jansens danakj@orodu.net
commit

3dcebcf56c6dd3a3707291e757af485bb55df7a6

parent

0cfca85d27213ef8a308a6d6a5242432ee786837

7 files changed, 57 insertions(+), 23 deletions(-)

jump to
M src/Makefile.amsrc/Makefile.am

@@ -39,8 +39,6 @@ rm -f *\~ *.orig *.rej

# 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 \

@@ -55,6 +53,7 @@ Configmenu.o: Configmenu.cc i18n.h Configmenu.h Basemenu.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 \

@@ -66,6 +65,7 @@ Netizen.o: Netizen.cc Netizen.h BaseDisplay.h LinkedList.h Timer.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 \

@@ -95,7 +95,7 @@ Workspace.o: Workspace.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 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 \

@@ -103,7 +103,8 @@ Workspace.h Workspacemenu.h Toolbar.h Resource.h Geometry.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 \
M src/Makefile.insrc/Makefile.in

@@ -390,8 +390,6 @@ rm -f *\~ *.orig *.rej

# 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 \

@@ -406,6 +404,7 @@ Configmenu.o: Configmenu.cc i18n.h Configmenu.h Basemenu.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 \

@@ -417,6 +416,7 @@ Netizen.o: Netizen.cc Netizen.h BaseDisplay.h LinkedList.h Timer.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 \

@@ -446,7 +446,7 @@ Workspace.o: Workspace.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 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 \

@@ -454,7 +454,8 @@ Workspace.h Workspacemenu.h Toolbar.h Resource.h Geometry.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 \
M src/Resource.ccsrc/Resource.cc

@@ -20,6 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE. #include "Resource.h" +#include "Util.h" #ifdef HAVE_CONFIG_H # include "../config.h"

@@ -32,8 +33,6 @@

#ifdef HAVE_STDIO_H # include <stdio.h> #endif // HAVE_STDIO_H - -#include <assert.h> bool obResource::m_initialized = false;

@@ -72,7 +71,7 @@ m_autosave = autosave;

} void obResource::save() { - assert(m_database != NULL); + ASSERT(m_database != NULL); XrmPutFileDatabase(m_database, m_file.c_str()); m_modified = false; }

@@ -87,7 +86,7 @@ return true;

} 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;

@@ -103,7 +102,7 @@ setValue(rname, (long)value);

} void obResource::setValue(const std::string &rname, long value) { - assert(m_database != NULL); + ASSERT(m_database != NULL); char val[11]; sprintf(val, "%ld", value);

@@ -116,7 +115,7 @@ save();

} 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());

@@ -127,7 +126,7 @@ save();

} 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());

@@ -139,8 +138,8 @@ }

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;

@@ -157,7 +156,7 @@ }

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;

@@ -173,7 +172,7 @@ }

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;
M src/Screen.ccsrc/Screen.cc

@@ -32,7 +32,6 @@ #endif // HAVE_CONFIG_H

#include <X11/Xatom.h> #include <X11/keysym.h> -#include <assert.h> #include "i18n.h" #include "openbox.h"
A src/Util.h

@@ -0,0 +1,32 @@

+// 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
M src/Workspace.ccsrc/Workspace.cc

@@ -43,6 +43,7 @@ #include "Window.h"

#include "Workspace.h" #include "Windowmenu.h" #include "Geometry.h" +#include "Util.h" #ifdef HAVE_STDIO_H # include <stdio.h>

@@ -458,7 +459,7 @@ return new Point(place_x, place_y);

} void Workspace::placeWindow(OpenboxWindow *win) { - assert(win != NULL); + ASSERT(win != NULL); Bool placed = False;
M src/openbox.ccsrc/openbox.cc

@@ -55,6 +55,7 @@ #include "Toolbar.h"

#include "Window.h" #include "Workspace.h" #include "Workspacemenu.h" +#include "Util.h" #include <string> #include <algorithm>

@@ -1209,9 +1210,9 @@ }

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;