all repos — fluxbox @ a15d9af3c7f58d671240b23607bb9488a9165eb1

custom fork of the fluxbox windowmanager

Cleanup unneeded headers (thanks Slava Semushin)
mathias mathias
commit

a15d9af3c7f58d671240b23607bb9488a9165eb1

parent

e2bc57bc0fef16faba89f996e354445c31aebedd

7 files changed, 34 insertions(+), 53 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,9 @@

(Format: Year/Month/Day) Changes for 0.9.16: *06/04/25: + * Cleanup unneeded headers (thanks Slava Semushin) + FbAtoms.cc Slit.cc Keys.cc FocusControl.cc FbTk/App.cc + util/fbrun/FbRun.cc * Fix occasional highlighting of menu nops+separators, sf.net patch #1475268 (thanks Scott Kuhl; skuhl AT cs utah edu) FbTk/MenuSeparator.hh/cc FbTk/Menu.cc MenuCreator.cc
M src/FbAtoms.ccsrc/FbAtoms.cc

@@ -25,11 +25,6 @@ #include "FbAtoms.hh"

#include "App.hh" #include <string> -#ifdef HAVE_CASSERT - #include <cassert> -#else - #include <assert.h> -#endif using namespace std;
M src/FbTk/App.ccsrc/FbTk/App.cc

@@ -25,11 +25,6 @@ #include "Image.hh"

#include "EventManager.hh" -#ifdef HAVE_CASSERT - #include <cassert> -#else - #include <assert.h> -#endif #include <string> namespace FbTk {
M src/FocusControl.ccsrc/FocusControl.cc

@@ -31,8 +31,8 @@ #include "fluxbox.hh"

#include "FbWinFrameTheme.hh" #include <string> -#include <cassert> #include <iostream> + using std::cerr; using std::endl; using std::string;
M src/Keys.ccsrc/Keys.cc

@@ -87,11 +87,6 @@ #include <iostream>

#include <fstream> #include <vector> #include <map> -#ifdef HAVE_CASSERT - #include <cassert> -#else - #include <assert.h> -#endif #include <memory> using namespace std;
M src/Slit.ccsrc/Slit.cc

@@ -67,11 +67,6 @@ #include "FbTk/I18n.hh"

#include <algorithm> #include <iostream> -#ifdef HAVE_CASSERT - #include <cassert> -#else - #include <assert.h> -#endif #ifdef HAVE_SYS_STAT_H #include <sys/types.h>
M util/fbrun/FbRun.ccutil/fbrun/FbRun.cc

@@ -48,13 +48,9 @@ #include <iostream>

#include <iterator> #include <fstream> #include <algorithm> -#ifdef HAVE_CASSERT - #include <cassert> -#else - #include <assert.h> -#endif using namespace std; + FbRun::FbRun(int x, int y, size_t width): FbTk::TextBox(DefaultScreen(FbTk::App::instance()->display()), m_font, ""),

@@ -67,7 +63,7 @@ m_current_history_item(0),

m_last_completion_prefix(""), m_current_apps_item(0), m_cursor(XCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)) { - + setGC(m_gc.gc()); setCursor(m_cursor); // setting nomaximize in local resize

@@ -78,9 +74,9 @@ XClassHint *class_hint = XAllocClassHint();

if (class_hint == 0) throw string("Out of memory"); class_hint->res_name = "fbrun"; - class_hint->res_class = "FbRun"; + class_hint->res_class = "FbRun"; XSetClassHint(m_display, window(), class_hint); - + XFree(class_hint); #ifdef HAVE_XPM Pixmap mask = 0;

@@ -123,7 +119,7 @@ exit(0); //exit child

} hide(); // hide gui - + // save command history to file if (text().size() != 0) { // no need to save empty command

@@ -134,7 +130,7 @@ && text() == m_history[m_current_history_item]) {

// m_current_history_item is the duplicate } else { m_current_history_item = 0; - for (; m_current_history_item < m_history.size(); + for (; m_current_history_item < m_history.size(); ++m_current_history_item) { if (m_history[m_current_history_item] == text()) break;

@@ -154,7 +150,7 @@

// write the history items that come after current for (i++; i < m_history.size(); i++) inoutfile<<m_history[i]<<endl; - + } else { // set put-pointer at end of file inoutfile.seekp(0, ios::end);

@@ -215,7 +211,7 @@ setName(title.c_str());

} void FbRun::resize(unsigned int width, unsigned int height) { - FbTk::TextBox::resize(width, height); + FbTk::TextBox::resize(width, height); } void FbRun::redrawLabel() {

@@ -233,7 +229,7 @@ KeySym ks;

char keychar[1]; XLookupString(&ke, keychar, 1, &ks, 0); // a modifier key by itself doesn't do anything - if (IsModifierKey(ks)) + if (IsModifierKey(ks)) return; if (FbTk::KeyUtil::instance().isolateModifierMask(ke.state)) { // a modifier key is down

@@ -374,7 +370,7 @@ }

} void FbRun::tabCompleteApps() { - + static bool first_run= true; if (m_last_completion_prefix.empty()) m_last_completion_prefix = text().substr(0, textStartPos() + cursorPosition());

@@ -387,19 +383,21 @@

// (re)build m_apps-container if (first_run || m_last_completion_prefix != prefix) { first_run= false; - + string path; - - if(!prefix.empty() && + + if(!prefix.empty() && string("/.~").find_first_of(prefix[0]) != string::npos) { size_t rseparator= prefix.find_last_of("/"); path= prefix.substr(0, rseparator + 1) + ":"; add_dirs= true; - } else - path= getenv("PATH"); - + } else { + char* tmp_path = getenv("PATH"); + if (tmp_path) + path = tmp_path; + } m_apps.clear(); - + unsigned int l; unsigned int r;

@@ -412,27 +410,27 @@ int n= dir.entries();

if (n >= 0) { while(n--) { filename= dir.readFilename(); - fncomplete= dir.name() + - (*dir.name().rbegin() != '/' ? "/" : "") + + fncomplete= dir.name() + + (*dir.name().rbegin() != '/' ? "/" : "") + filename; // directories in dirmode ? if (add_dirs && FbTk::FileUtil::isDirectory(fncomplete.c_str()) && filename != ".." && filename != ".") { - m_apps.push_back(fncomplete); + m_apps.push_back(fncomplete); // executables in dirmode ? - } else if (add_dirs && FbTk::FileUtil::isRegularFile(fncomplete.c_str()) && - FbTk::FileUtil::isExecutable(fncomplete.c_str()) && - (prefix == "" || + } else if (add_dirs && FbTk::FileUtil::isRegularFile(fncomplete.c_str()) && + FbTk::FileUtil::isExecutable(fncomplete.c_str()) && + (prefix == "" || fncomplete.substr(0, prefix.size()) == prefix)) { m_apps.push_back(fncomplete); // executables in $PATH ? - } else if (FbTk::FileUtil::isRegularFile(fncomplete.c_str()) && - FbTk::FileUtil::isExecutable(fncomplete.c_str()) && - (prefix == "" || + } else if (FbTk::FileUtil::isRegularFile(fncomplete.c_str()) && + FbTk::FileUtil::isExecutable(fncomplete.c_str()) && + (prefix == "" || filename.substr(0, prefix.size()) == prefix)) { m_apps.push_back(filename); - } + } } } l= r + 1;

@@ -473,7 +471,7 @@ break;

} apps_item++; } - if (!changed_prefix && apps_item == m_current_apps_item) + if (!changed_prefix && apps_item == m_current_apps_item) XBell(m_display, 0); } }