Cosmetic patch from Slava Semushin

This commit is contained in:
mathias 2006-10-30 19:31:15 +00:00
parent 426c12c25c
commit e5e76e7761
30 changed files with 747 additions and 632 deletions

View file

@ -1,16 +1,24 @@
(Format: Year/Month/Day)
Changes for 1.0rc3:
*06/10/30:
* Cosmetic patch from Slava Semushin
CommandDialog.cc Ewmh.cc FbCommands.cc FbAtoms.cc Xutil.cc Gnome.cc
MenuTheme.cc Window.cc Resources.cc tests/testFont.cc FbWinFrameTheme.cc
SystemTray.cc MenuCreator.cc FbTk/TextureRender.cc FbTk/XFontImp.cc
FbTk/EventManager.cc FbTk/Menu.cc FbTk/FbPixmap.cc FbTk/ImageControl.cc
FbTk/XmbFontImp.cc FbTk/Font.cc ScreenResources.cc fluxbox.cc
Workspace.cc Toolbar.cc IconbarTool.cc util/fbsetroot.cc
util/fbrun/FbRun.cc util/fbrun/main.cc
*06/10/27:
* Changed mode for .fluxbox/startup to 644 (Mathias)
some people on noexec-mounted partitions ran into problems
util/startfluxbox.in
* Small updates to the asciidoc-docs (Mathias)
* Cosmetic patch from Slave Semushin
* Cosmetic patch from Slava Semushin
Slit.cc Screen.cc Keys.cc main.cc ToolbarTheme.cc FbTk/MultLayers.cc
FbTk/Transparent.cc FbTk/Resource.cc FbTk/Theme.cc FbTk/XLayer.cc
FbTk/Image.cc FbTk/Color.cc FbTk/FbString.cc Remember.cc RegExp.cc
WinClient.cc Shape.cc ClientPattern.cc FbWinFrame.cc
*06/10/16:
* Added CachedPixmap (Henrik)
FbTk/CachedPixmap.hh/cc

View file

@ -40,13 +40,17 @@
#include <X11/keysym.h>
#include <X11/Xutil.h>
#include <iostream>
#include <memory>
#include <stdexcept>
using namespace std;
using std::string;
using std::vector;
using std::auto_ptr;
using std::less;
using std::out_of_range;
CommandDialog::CommandDialog(BScreen &screen,
const std::string &title, const std::string precommand) :
const string &title, const string precommand) :
FbTk::FbWindow(screen.rootWindow().screenNumber(), 0, 0, 200, 1, ExposureMask),
m_textbox(*this, screen.winFrameTheme().font(), ""),
m_label(*this, screen.winFrameTheme().font(), title),
@ -67,7 +71,7 @@ CommandDialog::~CommandDialog() {
m_screen.imageControl().removeImage(m_pixmap);
}
void CommandDialog::setText(const std::string &text) {
void CommandDialog::setText(const string &text) {
m_textbox.setText(text);
}
@ -135,7 +139,7 @@ void CommandDialog::keyPressEvent(XKeyEvent &event) {
if (ks == XK_Return) {
hide(); // hide and return focus to a FluxboxWindow
// create command from line
std::auto_ptr<FbTk::Command> cmd(CommandParser::instance().
auto_ptr<FbTk::Command> cmd(CommandParser::instance().
parseLine(m_precommand + m_textbox.text()));
if (cmd.get())
cmd->execute();
@ -168,7 +172,7 @@ void CommandDialog::tabComplete() {
CommandParser::CommandFactoryMap::const_iterator it = CommandParser::instance().factorys().begin();
const CommandParser::CommandFactoryMap::const_iterator it_end = CommandParser::instance().factorys().end();
std::vector<std::string> matches;
vector<string> matches;
for (; it != it_end; ++it) {
if ((*it).first.find(prefix) == 0) {
matches.push_back((*it).first);
@ -177,12 +181,12 @@ void CommandDialog::tabComplete() {
if (!matches.empty()) {
// sort and apply larges match
std::sort(matches.begin(), matches.end(), less<string>());
sort(matches.begin(), matches.end(), less<string>());
m_textbox.setText(m_textbox.text() + matches[0].substr(prefix.size()));
} else
XBell(FbTk::App::instance()->display(), 0);
} catch (std::out_of_range &oor) {
} catch (out_of_range &oor) {
XBell(FbTk::App::instance()->display(), 0);
}
}

View file

@ -43,7 +43,10 @@
#include <algorithm>
#include <new>
using namespace std;
using std::cerr;
using std::endl;
using std::vector;
using std::list;
// mipspro has no new(nothrow)
#if defined sgi && ! defined GCC
@ -379,7 +382,7 @@ void Ewmh::updateClientClose(WinClient &winclient){
void Ewmh::updateClientList(BScreen &screen) {
std::list<WinClient *> creation_order_list = screen.focusControl().creationOrderList();
list<WinClient *> creation_order_list = screen.focusControl().creationOrderList();
size_t num = creation_order_list.size();
Window *wl = FB_new_nothrow Window[num];
@ -391,8 +394,8 @@ void Ewmh::updateClientList(BScreen &screen) {
}
int win=0;
std::list<WinClient *>::iterator client_it = creation_order_list.begin();
std::list<WinClient *>::iterator client_it_end = creation_order_list.end();
list<WinClient *>::iterator client_it = creation_order_list.begin();
list<WinClient *>::iterator client_it_end = creation_order_list.end();
for (; client_it != client_it_end; ++client_it)
wl[win++] = (*client_it)->window();
@ -598,7 +601,7 @@ void Ewmh::updateState(FluxboxWindow &win) {
updateActions(win);
typedef std::vector<unsigned int> StateVec;
typedef vector<unsigned int> StateVec;
StateVec state;
@ -1182,7 +1185,7 @@ void Ewmh::updateActions(FluxboxWindow &win) {
* decide which actions should be made available to the user.
*/
typedef std::vector<Atom> ActionsVector;
typedef vector<Atom> ActionsVector;
ActionsVector actions;
actions.reserve(10);
// all windows can change desktop,

View file

@ -26,7 +26,7 @@
#include <string>
using namespace std;
using std::string;
FbAtoms *FbAtoms::s_singleton = 0;

View file

@ -54,7 +54,12 @@
#include <process.h> // for P_NOWAIT
#endif // __EMX__
using namespace std;
using std::string;
using std::pair;
using std::set;
using std::ofstream;
using std::endl;
using std::ios;
namespace {
@ -107,7 +112,7 @@ void showMenu(const BScreen &screen, FbTk::Menu &menu) {
namespace FbCommands {
ExecuteCmd::ExecuteCmd(const std::string &cmd, int screen_num):m_cmd(cmd), m_screen_num(screen_num) {
ExecuteCmd::ExecuteCmd(const string &cmd, int screen_num):m_cmd(cmd), m_screen_num(screen_num) {
}
@ -125,7 +130,7 @@ int ExecuteCmd::run() {
if (pid)
return pid;
std::string displaystring("DISPLAY=");
string displaystring("DISPLAY=");
displaystring += DisplayString(FbTk::App::instance()->display());
char intbuff[64];
int screen_num = m_screen_num;
@ -149,7 +154,7 @@ int ExecuteCmd::run() {
return pid; // compiler happy -> we are happy ;)
}
SetModKeyCmd::SetModKeyCmd(const std::string& modkey) : m_modkey(modkey) { }
SetModKeyCmd::SetModKeyCmd(const string& modkey) : m_modkey(modkey) { }
void SetModKeyCmd::execute() {
Fluxbox::instance()->setModKey(m_modkey.c_str());
@ -158,7 +163,7 @@ void SetModKeyCmd::execute() {
Fluxbox::instance()->reconfigure();
}
ExportCmd::ExportCmd(const std::string& name, const std::string& value) :
ExportCmd::ExportCmd(const string& name, const string& value) :
m_name(name), m_value(value) {
}
@ -167,7 +172,7 @@ void ExportCmd::execute() {
// the setenv()-routine is not everywhere available and
// putenv() doesnt manage the strings in the environment
// and hence we have to do that on our own to avoid memleaking
static std::set<char*> stored;
static set<char*> stored;
char* newenv = new char[m_name.size() + m_value.size() + 2];
if (newenv) {
@ -203,7 +208,7 @@ void SaveResources::execute() {
Fluxbox::instance()->save_rc();
}
RestartFluxboxCmd::RestartFluxboxCmd(const std::string &cmd):m_cmd(cmd){
RestartFluxboxCmd::RestartFluxboxCmd(const string &cmd):m_cmd(cmd){
}
void RestartFluxboxCmd::execute() {
@ -223,7 +228,7 @@ void ReloadStyleCmd::execute() {
cmd.execute();
}
SetStyleCmd::SetStyleCmd(const std::string &filename):m_filename(filename) {
SetStyleCmd::SetStyleCmd(const string &filename):m_filename(filename) {
}
@ -234,7 +239,7 @@ void SetStyleCmd::execute() {
Fluxbox::instance()->getStyleOverlayFilename());
}
KeyModeCmd::KeyModeCmd(const std::string &arguments):m_keymode(arguments),m_end_args("None Escape") {
KeyModeCmd::KeyModeCmd(const string &arguments):m_keymode(arguments),m_end_args("None Escape") {
string::size_type second_pos = m_keymode.find_first_of(" \t", 0);
if (second_pos != string::npos) {
// ok we have arguments, parsing them here
@ -267,7 +272,7 @@ void ShowWorkspaceMenuCmd::execute() {
SetWorkspaceNameCmd::SetWorkspaceNameCmd(const std::string &name, int spaceid):
SetWorkspaceNameCmd::SetWorkspaceNameCmd(const string &name, int spaceid):
m_name(name), m_workspace(spaceid) { }
void SetWorkspaceNameCmd::execute() {
@ -312,8 +317,8 @@ void CommandDialogCmd::execute() {
}
SetResourceValueCmd::SetResourceValueCmd(const std::string &resname,
const std::string &value):
SetResourceValueCmd::SetResourceValueCmd(const string &resname,
const string &value):
m_resname(resname),
m_value(value) {
@ -336,7 +341,7 @@ void SetResourceValueDialogCmd::execute() {
win->show();
};
BindKeyCmd::BindKeyCmd(const std::string &keybind):m_keybind(keybind) { }
BindKeyCmd::BindKeyCmd(const string &keybind):m_keybind(keybind) { }
void BindKeyCmd::execute() {
if (Fluxbox::instance()->keys() != 0) {

View file

@ -25,8 +25,11 @@
#include "FbWindow.hh"
#include "App.hh"
#ifdef DEBUG
#include <iostream>
using namespace std;
using std::cerr;
using std::endl;
#endif // DEBUG
namespace FbTk {

View file

@ -30,9 +30,8 @@
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <iostream>
#include <string>
using namespace std;
using std::cerr;
namespace FbTk {

View file

@ -55,7 +55,6 @@
#define __USE_GNU
#endif //__USE_GNU
#include <iostream>
#ifdef HAVE_CSTRING
#include <cstring>
#else
@ -79,8 +78,9 @@
#include <stdlib.h>
#endif
using namespace std;
using std::string;
using std::map;
using std::list;
namespace {
@ -89,12 +89,12 @@ namespace {
#endif //HAVE_SETLOCALE
// use to map <font1>|<font2>|<font3> => <fontthatworks>
typedef std::map<std::string, std::string> StringMap;
typedef map<string, string> StringMap;
typedef StringMap::iterator StringMapIt;
StringMap lookup_map;
// stores <fontthatworks and the fontimp
typedef std::map<std::string, FbTk::FontImp* > FontCache;
typedef map<string, FbTk::FontImp* > FontCache;
typedef FontCache::iterator FontCacheIt;
FontCache font_cache;
@ -165,7 +165,7 @@ Font::Font(const char *name):
Font::~Font() {
}
bool Font::load(const std::string &name) {
bool Font::load(const string &name) {
if (name.size() == 0)
return false;
@ -183,7 +183,7 @@ bool Font::load(const std::string &name) {
}
// split up the namelist
typedef std::list<std::string> StringList;
typedef list<string> StringList;
typedef StringList::iterator StringListIt;
StringList names;
FbTk::StringUtil::stringtok<StringList>(names, name, "|");

View file

@ -67,7 +67,9 @@
#include <iostream>
using namespace std;
using std::cerr;
using std::endl;
using std::list;
namespace FbTk {
@ -398,7 +400,7 @@ unsigned long ImageControl::getSqrt(unsigned int x) const {
void ImageControl::cleanCache() {
Display *disp = FbTk::App::instance()->display();
std::list<CacheList::iterator> deadlist;
list<CacheList::iterator> deadlist;
CacheList::iterator it = cache.begin();
CacheList::iterator it_end = cache.end();
for (; it != it_end; ++it) {
@ -411,8 +413,8 @@ void ImageControl::cleanCache() {
}
}
std::list<CacheList::iterator>::iterator dead_it = deadlist.begin();
std::list<CacheList::iterator>::iterator dead_it_end = deadlist.end();
list<CacheList::iterator>::iterator dead_it = deadlist.begin();
list<CacheList::iterator>::iterator dead_it_end = deadlist.end();
for (; dead_it != dead_it_end; ++dead_it) {
cache.erase(*dead_it);
}

View file

@ -63,10 +63,13 @@
#else
#include <string.h>
#endif
#include <iostream>
#include <typeinfo>
using namespace std;
#ifdef DEBUG
#include <iostream>
using std::cout;
using std::endl;
#endif // DEBUG
namespace FbTk {
@ -216,9 +219,9 @@ int Menu::insert(MenuItem *item, int pos) {
int Menu::remove(unsigned int index) {
if (index >= menuitems.size()) {
#ifdef DEBUG
std::cout << "Bad index (" << index << ") given to Menu::remove()"
cout << "Bad index (" << index << ") given to Menu::remove()"
<< " -- should be between 0 and " << menuitems.size()
<< " inclusive." << std::endl;
<< " inclusive." << endl;
#endif // DEBUG
return -1;
}
@ -948,7 +951,6 @@ void Menu::motionNotifyEvent(XMotionEvent &me) {
return;
if (validIndex(m_active_index) && w != m_active_index) {
int old_active_index = m_active_index;
m_active_index = -1;

View file

@ -39,7 +39,6 @@
#else
#include <stdio.h>
#endif
using namespace std;
// mipspro has no new(nothrow)
#if defined sgi && ! defined GCC
@ -48,6 +47,12 @@ using namespace std;
#define FB_new_nothrow new(std::nothrow)
#endif
using std::cerr;
using std::endl;
using std::string;
using std::max;
using std::min;
namespace FbTk {
TextureRender::TextureRender(ImageControl &imgctrl,
@ -119,8 +124,8 @@ void TextureRender::allocateColorTables() {
if (red == 0) {
char sbuf[128];
sprintf(sbuf, "%ld", (long int) size);
throw std::string("TextureRender::TextureRender(): " +
std::string(_FBTK_CONSOLETEXT(Error, OutOfMemoryRed, "Out of memory while allocating red buffer.", "")) + string(sbuf));
throw string("TextureRender::TextureRender(): " +
string(_FBTK_CONSOLETEXT(Error, OutOfMemoryRed, "Out of memory while allocating red buffer.", "")) + string(sbuf));
}
@ -128,16 +133,16 @@ void TextureRender::allocateColorTables() {
if (green == 0) {
char sbuf[128];
sprintf(sbuf, "%ld", (long int) size);
throw std::string("TextureRender::TextureRender(): " +
std::string(_FBTK_CONSOLETEXT(Error, OutOfMemoryGreen, "Out of memory while allocating green buffer.", ""))+ string(sbuf));
throw string("TextureRender::TextureRender(): " +
string(_FBTK_CONSOLETEXT(Error, OutOfMemoryGreen, "Out of memory while allocating green buffer.", ""))+ string(sbuf));
}
blue = FB_new_nothrow unsigned char[size];
if (blue == 0) {
char sbuf[128];
sprintf(sbuf, "%ld", (long int) size);
throw std::string("TextureRender::TextureRender(): " +
std::string(_FBTK_CONSOLETEXT(Error, OutOfMemoryBlue, "Out of memory while allocating blue buffer.", ""))+ string(sbuf));
throw string("TextureRender::TextureRender(): " +
string(_FBTK_CONSOLETEXT(Error, OutOfMemoryBlue, "Out of memory while allocating blue buffer.", ""))+ string(sbuf));
}
@ -1441,9 +1446,9 @@ void TextureRender::rgradient() {
// normal rgradient
for (yt = ytable, y = 0; y < height; y++, yt += 3) {
for (xt = xtable, x = 0; x < width; x++) {
*(pr++) = (unsigned char) (tr - (rsign * std::max(*(xt++), *(yt))));
*(pg++) = (unsigned char) (tg - (gsign * std::max(*(xt++), *(yt + 1))));
*(pb++) = (unsigned char) (tb - (bsign * std::max(*(xt++), *(yt + 2))));
*(pr++) = (unsigned char) (tr - (rsign * max(*(xt++), *(yt))));
*(pg++) = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1))));
*(pb++) = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2))));
}
}
@ -1454,32 +1459,32 @@ void TextureRender::rgradient() {
for (yt = ytable, y = 0; y < height; y++, yt += 3) {
for (xt = xtable, x = 0; x < width; x++) {
if (y & 1) {
channel = (unsigned char) (tr - (rsign * std::max(*(xt++), *(yt))));
channel = (unsigned char) (tr - (rsign * max(*(xt++), *(yt))));
channel2 = (channel >> 1) + (channel >> 2);
if (channel2 > channel) channel2 = 0;
*(pr++) = channel2;
channel = (unsigned char) (tg - (gsign * std::max(*(xt++), *(yt + 1))));
channel = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1))));
channel2 = (channel >> 1) + (channel >> 2);
if (channel2 > channel) channel2 = 0;
*(pg++) = channel2;
channel = (unsigned char) (tb - (bsign * std::max(*(xt++), *(yt + 2))));
channel = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2))));
channel2 = (channel >> 1) + (channel >> 2);
if (channel2 > channel) channel2 = 0;
*(pb++) = channel2;
} else {
channel = (unsigned char) (tr - (rsign * std::max(*(xt++), *(yt))));
channel = (unsigned char) (tr - (rsign * max(*(xt++), *(yt))));
channel2 = channel + (channel >> 3);
if (channel2 < channel) channel2 = ~0;
*(pr++) = channel2;
channel = (unsigned char) (tg - (gsign * std::max(*(xt++), *(yt + 1))));
channel = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1))));
channel2 = channel + (channel >> 3);
if (channel2 < channel) channel2 = ~0;
*(pg++) = channel2;
channel = (unsigned char) (tb - (bsign * std::max(*(xt++), *(yt + 2))));
channel = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2))));
channel2 = channel + (channel >> 3);
if (channel2 < channel) channel2 = ~0;
*(pb++) = channel2;
@ -1675,9 +1680,9 @@ void TextureRender::pcgradient() {
// normal pcgradient
for (yt = ytable, y = 0; y < height; y++, yt += 3) {
for (xt = xtable, x = 0; x < width; x++) {
*(pr++) = (unsigned char) (tr - (rsign * std::min(*(xt++), *(yt))));
*(pg++) = (unsigned char) (tg - (gsign * std::min(*(xt++), *(yt + 1))));
*(pb++) = (unsigned char) (tb - (bsign * std::min(*(xt++), *(yt + 2))));
*(pr++) = (unsigned char) (tr - (rsign * min(*(xt++), *(yt))));
*(pg++) = (unsigned char) (tg - (gsign * min(*(xt++), *(yt + 1))));
*(pb++) = (unsigned char) (tb - (bsign * min(*(xt++), *(yt + 2))));
}
}
@ -1688,32 +1693,32 @@ void TextureRender::pcgradient() {
for (yt = ytable, y = 0; y < height; y++, yt += 3) {
for (xt = xtable, x = 0; x < width; x++) {
if (y & 1) {
channel = (unsigned char) (tr - (rsign * std::min(*(xt++), *(yt))));
channel = (unsigned char) (tr - (rsign * min(*(xt++), *(yt))));
channel2 = (channel >> 1) + (channel >> 2);
if (channel2 > channel) channel2 = 0;
*(pr++) = channel2;
channel = (unsigned char) (tg - (bsign * std::min(*(xt++), *(yt + 1))));
channel = (unsigned char) (tg - (bsign * min(*(xt++), *(yt + 1))));
channel2 = (channel >> 1) + (channel >> 2);
if (channel2 > channel) channel2 = 0;
*(pg++) = channel2;
channel = (unsigned char) (tb - (gsign * std::min(*(xt++), *(yt + 2))));
channel = (unsigned char) (tb - (gsign * min(*(xt++), *(yt + 2))));
channel2 = (channel >> 1) + (channel >> 2);
if (channel2 > channel) channel2 = 0;
*(pb++) = channel2;
} else {
channel = (unsigned char) (tr - (rsign * std::min(*(xt++), *(yt))));
channel = (unsigned char) (tr - (rsign * min(*(xt++), *(yt))));
channel2 = channel + (channel >> 3);
if (channel2 < channel) channel2 = ~0;
*(pr++) = channel2;
channel = (unsigned char) (tg - (gsign * std::min(*(xt++), *(yt + 1))));
channel = (unsigned char) (tg - (gsign * min(*(xt++), *(yt + 1))));
channel2 = channel + (channel >> 3);
if (channel2 < channel) channel2 = ~0;
*(pg++) = channel2;
channel = (unsigned char) (tb - (bsign * std::min(*(xt++), *(yt + 2))));
channel = (unsigned char) (tb - (bsign * min(*(xt++), *(yt + 2))));
channel2 = channel + (channel >> 3);
if (channel2 < channel) channel2 = ~0;
*(pb++) = channel2;

View file

@ -36,7 +36,11 @@
#else
#include <stdio.h>
#endif
using namespace std;
using std::cerr;
using std::endl;
using std::string;
using std::nothrow;
namespace FbTk {
@ -64,7 +68,7 @@ int XFontImp::ascent() const {
return m_fontstruct->ascent;
}
bool XFontImp::load(const std::string &fontname) {
bool XFontImp::load(const string &fontname) {
XFontStruct *font = XLoadQueryFont(App::instance()->display(), fontname.c_str());
if (font == 0)
@ -91,8 +95,8 @@ void XFontImp::drawText(const FbDrawable &w, int screen, GC gc, const FbString &
return;
}
std::string localestr = text;
localestr.erase(len, std::string::npos);
string localestr = text;
localestr.erase(len, string::npos);
localestr = FbStringUtil::FbStrToLocale(localestr);
XSetFont(w.display(), gc, m_fontstruct->fid);
@ -103,8 +107,8 @@ unsigned int XFontImp::textWidth(const FbString &text, unsigned int size) const
if (text.empty() || m_fontstruct == 0)
return 0;
std::string localestr = text;
localestr.erase(size, std::string::npos);
string localestr = text;
localestr.erase(size, string::npos);
localestr = FbStringUtil::FbStrToLocale(localestr);
return XTextWidth(m_fontstruct, localestr.data(), localestr.size());
@ -335,8 +339,8 @@ void XFontImp::drawRotText(Drawable w, int screen, GC gc, const FbString &text,
// vertical or upside down
XSetFillStyle(dpy, my_gc, FillStippled);
std::string localestr = text;
localestr.erase(len, std::string::npos);
string localestr = text;
localestr.erase(len, string::npos);
localestr = FbStringUtil::FbStrToLocale(localestr);
const char *ctext = localestr.data();
len = localestr.size();

View file

@ -50,7 +50,6 @@
#else
#include <stdarg.h>
#endif
#include <iostream>
#ifdef HAVE_CSTRING
#include <cstring>
#else
@ -59,7 +58,7 @@
#include <X11/Xlib.h>
using namespace std;
using std::string;
namespace {
@ -118,7 +117,7 @@ XFontSet createFontSet(const char *fontname, bool& utf8mode) {
XFontSet fs;
char **missing, *def = "-";
int nmissing;
std::string orig_locale = "";
string orig_locale = "";
#ifdef HAVE_SETLOCALE
if (utf8mode) {
@ -173,7 +172,7 @@ XmbFontImp::~XmbFontImp() {
XFreeFontSet(App::instance()->display(), m_fontset);
}
bool XmbFontImp::load(const std::string &fontname) {
bool XmbFontImp::load(const string &fontname) {
if (fontname.empty())
return false;
@ -205,8 +204,8 @@ void XmbFontImp::drawText(const FbDrawable &d, int screen, GC main_gc, const FbS
} else
#endif //X_HAVE_UTF8_STRING
{
std::string localestr = text;
localestr.erase(len, std::string::npos);
string localestr = text;
localestr.erase(len, string::npos);
localestr = FbStringUtil::FbStrToLocale(localestr);
XmbDrawString(d.display(), d.drawable(), m_fontset,
main_gc, x, y,
@ -244,8 +243,8 @@ void XmbFontImp::drawText(const FbDrawable &d, int screen, GC main_gc, const FbS
} else
#endif //X_HAVE_UTF8_STRING
{
std::string localestr = text;
localestr.erase(len, std::string::npos);
string localestr = text;
localestr.erase(len, string::npos);
localestr = FbStringUtil::FbStrToLocale(localestr);
XmbDrawString(dpy, canvas.drawable(), m_fontset,
font_gc.gc(), xpos, ypos,
@ -292,8 +291,8 @@ unsigned int XmbFontImp::textWidth(const FbString &text, unsigned int len) const
}
#endif // X_HAVE_UTF8_STRING
std::string localestr = text;
localestr.erase(len, std::string::npos);
string localestr = text;
localestr.erase(len, string::npos);
localestr = FbStringUtil::FbStrToLocale(localestr);
XmbTextExtents(m_fontset, localestr.data(), localestr.size(),
&ink, &logical);

View file

@ -26,9 +26,6 @@
#include <X11/cursorfont.h>
#include <iostream>
using namespace std;
FbWinFrameTheme::FbWinFrameTheme(int screen_num):
FbTk::Theme(screen_num),
m_label_focus(*this, "window.label.focus", "Window.Label.Focus"),

View file

@ -31,10 +31,17 @@
#include "Layer.hh"
#include "FbTk/I18n.hh"
#include <iostream>
#include <new>
using namespace std;
using std::cerr;
using std::endl;
using std::list;
#ifdef DEBUG
using std::hex;
using std::dec;
#endif // DEBUG
Gnome::Gnome() {
createAtoms();
@ -185,9 +192,9 @@ void Gnome::updateClientList(BScreen &screen) {
// TODO!
//check if the window don't want to be visible in the list
//if (! ( (*it)->getGnomeHints() & WIN_STATE_HIDDEN) ) {
std::list<WinClient *>::iterator client_it =
list<WinClient *>::iterator client_it =
(*it)->clientList().begin();
std::list<WinClient *>::iterator client_it_end =
list<WinClient *>::iterator client_it_end =
(*it)->clientList().end();
for (; client_it != client_it_end; ++client_it)
wl[win++] = (*client_it)->window();
@ -319,9 +326,6 @@ bool Gnome::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen,
if (ce.message_type == m_gnome_wm_win_state) {
#ifdef DEBUG
cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_STATE"<<endl;
#endif // DEBUG
#ifdef DEBUG
cerr<<__FILE__<<"("<<__LINE__<<"): Mask of members to change:"<<
hex<<ce.data.l[0]<<dec<<endl; // mask_of_members_to_change
cerr<<"New members:"<<ce.data.l[1]<<endl;

View file

@ -49,7 +49,14 @@
#include <typeinfo>
#include <string>
#include <iterator>
using namespace std;
using std::string;
using std::list;
#ifdef DEBUG
using std::cerr;
using std::endl;
#endif // DEBUG
namespace FbTk {
@ -93,17 +100,17 @@ void FbTk::Resource<IconbarTool::WheelMode>::setFromString(const char* strval) {
template<>
std::string FbTk::Resource<IconbarTool::WheelMode>::getString() const {
string FbTk::Resource<IconbarTool::WheelMode>::getString() const {
switch(m_value) {
case IconbarTool::ON:
return std::string("On");
return string("On");
break;
case IconbarTool::SCREEN:
return std::string("Screen");
return string("Screen");
break;
case IconbarTool::OFF:
default:
return std::string("Off");
return string("Off");
};
}
@ -314,10 +321,10 @@ inline bool checkAddWindow(IconbarTool::Mode mode, const FluxboxWindow &win) {
return ret_val;
}
void removeDuplicate(const IconbarTool::IconList &iconlist, std::list<FluxboxWindow *> &windowlist) {
void removeDuplicate(const IconbarTool::IconList &iconlist, list<FluxboxWindow *> &windowlist) {
IconbarTool::IconList::const_iterator icon_it = iconlist.begin();
IconbarTool::IconList::const_iterator icon_it_end = iconlist.end();
std::list<FluxboxWindow *>::iterator remove_it = windowlist.end();
list<FluxboxWindow *>::iterator remove_it = windowlist.end();
for (; icon_it != icon_it_end; ++icon_it)
remove_it = remove(windowlist.begin(), remove_it, &(*icon_it)->win());
@ -365,7 +372,8 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr
save_and_reconfig->add(reconfig);
save_and_reconfig->add(save);
RefCount<Command> s_and_reconfig(save_and_reconfig);
m_menu.insert(new BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons, "Show Pictures", "chooses if little icons are shown next to title in the iconbar") ,
m_menu.insert(new BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons,
"Show Pictures", "chooses if little icons are shown next to title in the iconbar"),
*m_rc_use_pixmap, s_and_reconfig));
m_menu.updateMenu();
// must be internal menu, otherwise toolbar main menu tries to delete it.
@ -802,10 +810,10 @@ void IconbarTool::addWindow(FluxboxWindow &win) {
}
void IconbarTool::updateList() {
std::list<WinClient *> ordered_list =
list<WinClient *> ordered_list =
m_screen.focusControl().creationOrderList();
std::list<WinClient *>::iterator it = ordered_list.begin();
std::list<WinClient *>::iterator it_end = ordered_list.end();
list<WinClient *>::iterator it = ordered_list.begin();
list<WinClient *>::iterator it_end = ordered_list.end();
for (; it != it_end; ++it) {
if ((*it)->fbwindow() && checkAddWindow(mode(), *(*it)->fbwindow()) &&
!checkDuplicate(*(*it)->fbwindow()))

View file

@ -53,15 +53,21 @@
#include "FbTk/MenuIcon.hh"
#include <iostream>
using namespace std;
std::list<std::string> MenuCreator::encoding_stack;
std::list<size_t> MenuCreator::stacksize_stack;
using std::cerr;
using std::endl;
using std::string;
using std::vector;
using std::list;
using std::less;
list<string> MenuCreator::encoding_stack;
list<size_t> MenuCreator::stacksize_stack;
FbTk::StringConvertor MenuCreator::m_stringconvertor(FbTk::StringConvertor::ToFbString);
static void createStyleMenu(FbTk::Menu &parent, const std::string &label,
const std::string &directory) {
static void createStyleMenu(FbTk::Menu &parent, const string &label,
const string &directory) {
// perform shell style ~ home directory expansion
string stylesdir(FbTk::StringUtil::expandFilename(directory));
@ -72,15 +78,15 @@ static void createStyleMenu(FbTk::Menu &parent, const std::string &label,
// create a vector of all the filenames in the directory
// add sort it
std::vector<std::string> filelist(dir.entries());
vector<string> filelist(dir.entries());
for (size_t file_index = 0; file_index < dir.entries(); ++file_index)
filelist[file_index] = dir.readFilename();
std::sort(filelist.begin(), filelist.end(), less<string>());
sort(filelist.begin(), filelist.end(), less<string>());
// for each file in directory add filename and path to menu
for (size_t file_index = 0; file_index < dir.entries(); file_index++) {
std::string style(stylesdir + '/' + filelist[file_index]);
string style(stylesdir + '/' + filelist[file_index]);
// add to menu only if the file is a regular file, and not a
// .file or a backup~ file
if ((FbTk::FileUtil::isRegularFile(style.c_str()) &&
@ -140,10 +146,10 @@ public:
p>>m_key>>m_label>>m_cmd>>m_icon;
m_label.second = m_labelconvertor.recode(m_label.second);
}
inline const std::string &icon() const { return m_icon.second; }
inline const std::string &command() const { return m_cmd.second; }
inline const std::string &label() const { return m_label.second; }
inline const std::string &key() const { return m_key.second; }
inline const string &icon() const { return m_icon.second; }
inline const string &command() const { return m_cmd.second; }
inline const string &label() const { return m_label.second; }
inline const string &key() const { return m_key.second; }
inline FbTk::Menu *menu() { return m_menu; }
private:
Parser::Item m_key, m_label, m_cmd, m_icon;
@ -182,9 +188,9 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve
throw string("translateMenuItem: We must have a menu in ParseItem!");
FbTk::Menu &menu = *pitem.menu();
const std::string &str_key = pitem.key();
const std::string &str_cmd = pitem.command();
const std::string &str_label = pitem.label();
const string &str_key = pitem.key();
const string &str_cmd = pitem.command();
const string &str_label = pitem.label();
const int screen_number = menu.screenNumber();
_FB_USES_NLS;
@ -250,13 +256,13 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve
// inject every file in this directory into the current menu
FbTk::Directory dir(newfile.c_str());
std::vector<std::string> filelist(dir.entries());
vector<string> filelist(dir.entries());
for (size_t file_index = 0; file_index < dir.entries(); ++file_index)
filelist[file_index] = dir.readFilename();
std::sort(filelist.begin(), filelist.end(), less<string>());
sort(filelist.begin(), filelist.end(), less<string>());
for (size_t file_index = 0; file_index < dir.entries(); file_index++) {
std::string thisfile(newfile + '/' + filelist[file_index]);
string thisfile(newfile + '/' + filelist[file_index]);
if (FbTk::FileUtil::isRegularFile(thisfile.c_str()) &&
(filelist[file_index][0] != '.') &&
@ -367,7 +373,7 @@ static void parseWindowMenu(Parser &parse, FbTk::Menu &menu, FbTk::StringConvert
}
}
FbTk::Menu *MenuCreator::createMenu(const std::string &label, int screen_number) {
FbTk::Menu *MenuCreator::createMenu(const string &label, int screen_number) {
BScreen *screen = Fluxbox::instance()->findScreen(screen_number);
if (screen == 0)
return 0;
@ -381,7 +387,7 @@ FbTk::Menu *MenuCreator::createMenu(const std::string &label, int screen_number)
return menu;
}
bool getStart(FbMenuParser &parser, std::string &label, FbTk::StringConvertor &labelconvertor) {
bool getStart(FbMenuParser &parser, string &label, FbTk::StringConvertor &labelconvertor) {
ParseItem pitem(0);
while (!parser.eof()) {
// get first begin line
@ -397,15 +403,15 @@ bool getStart(FbMenuParser &parser, std::string &label, FbTk::StringConvertor &l
return true;
}
FbTk::Menu *MenuCreator::createFromFile(const std::string &filename, int screen_number, bool require_begin) {
std::string real_filename = FbTk::StringUtil::expandFilename(filename);
FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_number, bool require_begin) {
string real_filename = FbTk::StringUtil::expandFilename(filename);
Fluxbox::instance()->saveMenuFilename(real_filename.c_str());
FbMenuParser parser(real_filename);
if (!parser.isLoaded())
return 0;
std::string label;
string label;
if (require_begin && !getStart(parser, label, m_stringconvertor))
return 0;
@ -420,15 +426,15 @@ FbTk::Menu *MenuCreator::createFromFile(const std::string &filename, int screen_
}
bool MenuCreator::createFromFile(const std::string &filename,
bool MenuCreator::createFromFile(const string &filename,
FbTk::Menu &inject_into, bool require_begin) {
std::string real_filename = FbTk::StringUtil::expandFilename(filename);
string real_filename = FbTk::StringUtil::expandFilename(filename);
FbMenuParser parser(real_filename);
if (!parser.isLoaded())
return false;
std::string label;
string label;
if (require_begin && !getStart(parser, label, m_stringconvertor))
return false;
@ -440,15 +446,15 @@ bool MenuCreator::createFromFile(const std::string &filename,
}
bool MenuCreator::createWindowMenuFromFile(const std::string &filename,
bool MenuCreator::createWindowMenuFromFile(const string &filename,
FbTk::Menu &inject_into,
bool require_begin) {
std::string real_filename = FbTk::StringUtil::expandFilename(filename);
string real_filename = FbTk::StringUtil::expandFilename(filename);
FbMenuParser parser(real_filename);
if (!parser.isLoaded())
return false;
std::string label;
string label;
if (require_begin && !getStart(parser, label, m_stringconvertor))
return false;
@ -461,7 +467,7 @@ bool MenuCreator::createWindowMenuFromFile(const std::string &filename,
}
FbTk::Menu *MenuCreator::createMenuType(const std::string &type, int screen_num) {
FbTk::Menu *MenuCreator::createMenuType(const string &type, int screen_num) {
BScreen *screen = Fluxbox::instance()->findScreen(screen_num);
if (screen == 0)
return 0;
@ -499,8 +505,8 @@ FbTk::Menu *MenuCreator::createMenuType(const std::string &type, int screen_num)
return 0;
}
bool MenuCreator::createWindowMenuItem(const std::string &type,
const std::string &label,
bool MenuCreator::createWindowMenuItem(const string &type,
const string &label,
FbTk::Menu &menu) {
typedef FbTk::RefCount<FbTk::Command> RefCmd;
_FB_USES_NLS;
@ -630,7 +636,7 @@ void MenuCreator::endFile() {
/**
* Push the encoding onto the stack, and make it active.
*/
void MenuCreator::startEncoding(const std::string &encoding) {
void MenuCreator::startEncoding(const string &encoding) {
// we push it regardless of whether it's valid, since we
// need to stay balanced with the endEncodings.
encoding_stack.push_back(encoding);
@ -646,7 +652,6 @@ void MenuCreator::startEncoding(const std::string &encoding) {
void MenuCreator::endEncoding() {
size_t min_size = stacksize_stack.back();
if (encoding_stack.size() <= min_size) {
// TODO: nls
_FB_USES_NLS;
cerr<<_FB_CONSOLETEXT(Menu, ErrorEndEncoding, "Warning: unbalanced [encoding] tags", "User menu file had unbalanced [encoding] tags")<<endl;
return;
@ -655,8 +660,8 @@ void MenuCreator::endEncoding() {
encoding_stack.pop_back();
m_stringconvertor.reset();
std::list<std::string>::reverse_iterator it = encoding_stack.rbegin();
std::list<std::string>::reverse_iterator it_end = encoding_stack.rend();
list<string>::reverse_iterator it = encoding_stack.rbegin();
list<string>::reverse_iterator it_end = encoding_stack.rend();
while (it != it_end && !m_stringconvertor.setSource(*it))
++it;

View file

@ -23,13 +23,13 @@
#include "MenuTheme.hh"
#include "StringUtil.hh"
#include <iostream>
using namespace std;
using std::string;
namespace FbTk {
template <>
void FbTk::ThemeItem<Shape::ShapePlace>::load(const std::string *name, const std::string *altname) { }
void FbTk::ThemeItem<Shape::ShapePlace>::load(const string *name, const string *altname) { }
template <>
void FbTk::ThemeItem<Shape::ShapePlace>::setDefaultValue() {

View file

@ -35,7 +35,10 @@
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
using std::string;
using std::vector;
using namespace FbTk;
//-----------------------------------------------------------------
@ -52,7 +55,7 @@ setFromString(const char* strval) {
}
template<>
void FbTk::Resource<std::string>::
void FbTk::Resource<string>::
setFromString(const char *strval) {
*this = strval;
}
@ -64,9 +67,9 @@ setFromString(char const *strval) {
}
template<>
void FbTk::Resource<std::vector<WinButton::Type> >::
void FbTk::Resource<vector<WinButton::Type> >::
setFromString(char const *strval) {
vector<std::string> val;
vector<string> val;
StringUtil::stringtok(val, strval);
//clear old values
m_value.clear();
@ -115,26 +118,26 @@ setFromString(const char *strval) {
//---- manipulators for int, bool, and some enums with Resource ---
//-----------------------------------------------------------------
template<>
std::string FbTk::Resource<bool>::
string FbTk::Resource<bool>::
getString() const {
return std::string(**this == true ? "true" : "false");
return string(**this == true ? "true" : "false");
}
template<>
std::string FbTk::Resource<int>::
string FbTk::Resource<int>::
getString() const {
char strval[256];
sprintf(strval, "%d", **this);
return std::string(strval);
return string(strval);
}
template<>
std::string FbTk::Resource<std::string>::
string FbTk::Resource<string>::
getString() const { return **this; }
template<>
std::string FbTk::Resource<std::vector<WinButton::Type> >::
string FbTk::Resource<vector<WinButton::Type> >::
getString() const {
string retval;
for (size_t i = 0; i < m_value.size(); i++) {
@ -167,7 +170,7 @@ getString() const {
}
template<>
std::string FbTk::Resource<Fluxbox::TabsAttachArea>::
string FbTk::Resource<Fluxbox::TabsAttachArea>::
getString() const {
if (m_value == Fluxbox::ATTACH_AREA_TITLEBAR)
return "Titlebar";
@ -217,27 +220,27 @@ setFromString(const char *strval) {
template<>
std::string FbTk::Resource<Layer>::
string FbTk::Resource<Layer>::
getString() const {
switch (m_value.getNum()) {
case Layer::MENU:
return std::string("Menu");
return string("Menu");
case Layer::ABOVE_DOCK:
return std::string("AboveDock");
return string("AboveDock");
case Layer::DOCK:
return std::string("Dock");
return string("Dock");
case Layer::TOP:
return std::string("Top");
return string("Top");
case Layer::NORMAL:
return std::string("Normal");
return string("Normal");
case Layer::BOTTOM:
return std::string("Bottom");
return string("Bottom");
case Layer::DESKTOP:
return std::string("Desktop");
return string("Desktop");
default:
char tmpstr[128];
sprintf(tmpstr, "%d", m_value.getNum());
return std::string(tmpstr);
return string(tmpstr);
}
}

View file

@ -27,7 +27,8 @@
#include "Screen.hh"
#include <string>
using namespace std;
using std::string;
namespace FbTk {
@ -53,17 +54,17 @@ void FbTk::Resource<FbTk::MenuTheme::MenuMode>::setFromString(const char *str) {
}
template <>
std::string FbTk::Resource<BScreen::ResizeModel>::getString() const {
string FbTk::Resource<BScreen::ResizeModel>::getString() const {
switch (m_value) {
case BScreen::QUADRANTRESIZE:
return std::string("Quadrant");
return string("Quadrant");
case BScreen::BOTTOMRESIZE:
return std::string("Bottom");
return string("Bottom");
case BScreen::CENTERRESIZE:
return std::string("Center");
return string("Center");
}
return std::string("Default");
return string("Default");
}
template<>
@ -80,20 +81,20 @@ setFromString(char const *strval) {
}
template<>
std::string FbTk::Resource<BScreen::FollowModel>::getString() const {
string FbTk::Resource<BScreen::FollowModel>::getString() const {
switch (m_value) {
case BScreen::FOLLOW_ACTIVE_WINDOW:
return std::string("Follow");
return string("Follow");
break;
case BScreen::FETCH_ACTIVE_WINDOW:
return std::string("Current");
return string("Current");
break;
case BScreen::SEMIFOLLOW_ACTIVE_WINDOW:
return std::string("SemiFollow");
return string("SemiFollow");
break;
case BScreen::IGNORE_OTHER_WORKSPACES:
default:
return std::string("Ignore");
return string("Ignore");
break;
}
@ -115,7 +116,7 @@ setFromString(char const *strval) {
}
template<>
std::string FbTk::Resource<FbTk::GContext::LineStyle>::getString() const {
string FbTk::Resource<FbTk::GContext::LineStyle>::getString() const {
switch(m_value) {
case FbTk::GContext::LINESOLID:
return "LineSolid";
@ -145,7 +146,7 @@ void FbTk::Resource<FbTk::GContext::LineStyle>
}
template<>
std::string FbTk::Resource<FbTk::GContext::JoinStyle>::getString() const {
string FbTk::Resource<FbTk::GContext::JoinStyle>::getString() const {
switch(m_value) {
case FbTk::GContext::JOINMITER:
return "JoinMiter";
@ -175,7 +176,7 @@ void FbTk::Resource<FbTk::GContext::JoinStyle>
}
template<>
std::string FbTk::Resource<FbTk::GContext::CapStyle>::getString() const {
string FbTk::Resource<FbTk::GContext::CapStyle>::getString() const {
switch(m_value) {
case FbTk::GContext::CAPNOTLAST:
return "CapNotLast";

View file

@ -36,7 +36,15 @@
#include <string>
using namespace std;
using std::string;
#ifdef DEBUG
#include <iostream>
using std::cerr;
using std::endl;
using std::hex;
using std::dec;
#endif // DEBUG
/// helper class for tray windows, so we dont call XDestroyWindow
class TrayWindow: public FbTk::FbWindow {
@ -118,7 +126,7 @@ SystemTray::SystemTray(const FbTk::FbWindow& parent, ButtonTheme& theme, BScreen
// setup atom name to _NET_SYSTEM_TRAY_S<screen number>
char intbuff[16];
sprintf(intbuff, "%d", m_window.screenNumber());
std::string atom_name("_NET_SYSTEM_TRAY_S");
string atom_name("_NET_SYSTEM_TRAY_S");
atom_name += intbuff; // append number
// get selection owner and see if it's free
@ -240,7 +248,7 @@ bool SystemTray::clientMessage(const XClientMessageEvent &event) {
int type = event.data.l[1];
if (type == SYSTEM_TRAY_REQUEST_DOCK) {
#ifndef DEBUG
#ifdef DEBUG
cerr<<"SystemTray::clientMessage(const XClientMessageEvent): SYSTEM_TRAY_REQUEST_DOCK"<<endl;
cerr<<"window = event.data.l[2] = "<<event.data.l[2]<<endl;
#endif // DEBUG

View file

@ -76,7 +76,9 @@
#include <iterator>
#include <typeinfo>
using namespace std;
using std::string;
using std::pair;
using std::list;
namespace FbTk {
@ -376,7 +378,7 @@ void Toolbar::reconfigure() {
bool need_update = false;
// parse and transform to lower case
std::list<std::string> tools;
list<string> tools;
FbTk::StringUtil::stringtok(tools, *m_rc_tools, ", ");
transform(tools.begin(),
tools.end(),

View file

@ -84,9 +84,23 @@
#include <functional>
#include <algorithm>
using namespace std;
using std::cerr;
using std::endl;
using std::string;
using std::vector;
using std::bind2nd;
using std::mem_fun;
using std::equal_to;
using std::max;
using std::swap;
using namespace FbTk;
#ifdef DEBUG
using std::dec;
using std::hex;
#endif // DEBUG
namespace {
void grabButton(unsigned int button,
@ -879,7 +893,7 @@ void FluxboxWindow::moveClientLeft() {
// move client in clientlist to the left
ClientList::iterator oldpos = find(m_clientlist.begin(), m_clientlist.end(), &winClient());
ClientList::iterator newpos = oldpos; newpos--;
std::swap(*newpos, *oldpos);
swap(*newpos, *oldpos);
frame().moveLabelButtonLeft(*m_labelbuttons[&winClient()]);
updateClientLeftWindow();
@ -893,13 +907,13 @@ void FluxboxWindow::moveClientRight() {
ClientList::iterator oldpos = find(m_clientlist.begin(), m_clientlist.end(), &winClient());
ClientList::iterator newpos = oldpos; newpos++;
std::swap(*newpos, *oldpos);
swap(*newpos, *oldpos);
frame().moveLabelButtonRight(*m_labelbuttons[&winClient()]);
updateClientLeftWindow();
}
//std::list<*WinClient>::iterator FluxboxWindow::getClientInsertPosition(int x, int y) {
//list<*WinClient>::iterator FluxboxWindow::getClientInsertPosition(int x, int y) {
FluxboxWindow::ClientList::iterator FluxboxWindow::getClientInsertPosition(int x, int y) {
int dest_x = 0, dest_y = 0;
@ -3778,14 +3792,14 @@ Window FluxboxWindow::clientWindow() const {
return m_client->window();
}
const std::string &FluxboxWindow::title() const {
const string &FluxboxWindow::title() const {
static string empty_string("");
if (m_client == 0)
return empty_string;
return m_client->title();
}
const std::string &FluxboxWindow::iconTitle() const {
const string &FluxboxWindow::iconTitle() const {
static string empty_string("");
if (m_client == 0)
return empty_string;
@ -3992,10 +4006,10 @@ void FluxboxWindow::setupWindow() {
// clear old buttons from frame
frame().removeAllButtons();
typedef FbTk::Resource<std::vector<WinButton::Type> > WinButtonsResource;
typedef FbTk::Resource<vector<WinButton::Type> > WinButtonsResource;
std::string titlebar_name[2];
std::string titlebar_alt_name[2];
string titlebar_name[2];
string titlebar_alt_name[2];
titlebar_name[0] = screen().name() + ".titlebar.left";
titlebar_alt_name[0] = screen().altName() + ".Titlebar.Left";
titlebar_name[1] = screen().name() + ".titlebar.right";
@ -4050,7 +4064,7 @@ void FluxboxWindow::setupWindow() {
for (size_t c = 0; c < 2 ; c++) {
// get titlebar configuration for current side
const std::vector<WinButton::Type> &dir = *(*titlebar_side[c]);
const vector<WinButton::Type> &dir = *(*titlebar_side[c]);
for (size_t i=0; i < dir.size(); ++i) {
//create new buttons
@ -4142,10 +4156,10 @@ void FluxboxWindow::setupWindow() {
if (screen().getScrollReverse())
reverse = 1;
if (StringUtil::toLower(screen().getScrollAction()) == std::string("shade")) {
if (StringUtil::toLower(screen().getScrollAction()) == string("shade")) {
frame().setOnClickTitlebar(shade_on_cmd, 5 - reverse); // shade on mouse roll
frame().setOnClickTitlebar(shade_off_cmd, 4 + reverse); // unshade if rolled oposite direction
} else if (StringUtil::toLower(screen().getScrollAction()) == std::string("nexttab")) {
} else if (StringUtil::toLower(screen().getScrollAction()) == string("nexttab")) {
frame().setOnClickTitlebar(next_tab_cmd, 5 - reverse); // next tab
frame().setOnClickTitlebar(prev_tab_cmd, 4 + reverse); // previous tab
}

View file

@ -67,7 +67,14 @@
#include <iostream>
#include <iterator>
using namespace std;
using std::string;
using std::vector;
using std::ifstream;
#ifdef DEBUG
using std::cerr;
using std::endl;
#endif // DEBUG
namespace { // anonymous
@ -123,7 +130,7 @@ public:
win.raiseAndFocus();
}
const std::string &label() const { return m_client.title(); }
const string &label() const { return m_client.title(); }
bool isSelected() const {
if (m_client.fbwindow() == 0)
return false;
@ -141,7 +148,7 @@ private:
Workspace::GroupList Workspace::m_groups;
Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager,
const std::string &name, unsigned int id):
const string &name, unsigned int id):
m_screen(scrn),
m_clientmenu(scrn.menuTheme(), scrn.imageControl(),
*scrn.layerManager().getLayer(Layer::MENU)),
@ -333,7 +340,7 @@ bool Workspace::checkGrouping(FluxboxWindow &win) {
return false;
}
bool Workspace::loadGroups(const std::string &filename) {
bool Workspace::loadGroups(const string &filename) {
string real_filename = FbTk::StringUtil::expandFilename(filename);
FbTk::StringUtil::removeTrailingWhitespace(real_filename);
ifstream infile(real_filename.c_str());
@ -359,7 +366,7 @@ void Workspace::update(FbTk::Subject *subj) {
}
void Workspace::setName(const std::string &name) {
void Workspace::setName(const string &name) {
if (!name.empty() && name != "") {
m_name = name;
} else { //if name == 0 then set default name from nls

View file

@ -32,7 +32,13 @@
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <iostream>
using namespace std;
using std::string;
#ifdef DEBUG
using std::cerr;
using std::endl;
#endif // DEBUG
namespace Xutil {
@ -48,7 +54,7 @@ FbTk::FbString getWMName(Window window) {
char **list;
int num;
_FB_USES_NLS;
std::string name;
string name;
if (XGetWMName(display, window, &text_prop)) {
if (text_prop.value && text_prop.nitems > 0) {
@ -82,9 +88,9 @@ FbTk::FbString getWMName(Window window) {
// The name of this particular instance
std::string getWMClassName(Window win) {
string getWMClassName(Window win) {
XClassHint ch;
std::string instance_name;
string instance_name;
if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) {
#ifdef DEBUG
@ -108,9 +114,9 @@ std::string getWMClassName(Window win) {
}
// the name of the general class of the app
std::string getWMClassClass(Window win) {
string getWMClassClass(Window win) {
XClassHint ch;
std::string class_name;
string class_name;
if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) {
#ifdef DEBUG

View file

@ -154,7 +154,21 @@ class Toolbar { };
#include <algorithm>
#include <typeinfo>
using namespace std;
using std::cerr;
using std::endl;
using std::string;
using std::vector;
using std::list;
using std::pair;
using std::bind2nd;
using std::mem_fun;
using std::equal_to;
#ifdef DEBUG
using std::hex;
using std::dec;
#endif // DEBUG
using namespace FbTk;
namespace {
@ -1348,7 +1362,7 @@ BScreen *Fluxbox::searchScreen(Window window) {
}
AtomHandler* Fluxbox::getAtomHandler(const std::string &name) {
AtomHandler* Fluxbox::getAtomHandler(const string &name) {
if ( name != "" ) {
using namespace FbTk;
AtomHandlerContainerIt it = find_if(m_atomhandler.begin(),
@ -1360,7 +1374,7 @@ AtomHandler* Fluxbox::getAtomHandler(const std::string &name) {
}
return 0;
}
void Fluxbox::addAtomHandler(AtomHandler *atomh, const std::string &name) {
void Fluxbox::addAtomHandler(AtomHandler *atomh, const string &name) {
m_atomhandler[atomh]= name;;
}
@ -1514,7 +1528,7 @@ string Fluxbox::getRcFilename() {
}
/// Provides default filename of data file
void Fluxbox::getDefaultDataFilename(char *name, std::string &filename) {
void Fluxbox::getDefaultDataFilename(char *name, string &filename) {
filename = string(getenv("HOME") + string("/.") + m_RC_PATH + string("/") + name);
}
@ -1607,7 +1621,7 @@ void Fluxbox::load_rc(BScreen &screen) {
sprintf(class_lookup, "Session.Screen%d.imageSearchPath", screen_number);
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
&value) && value.addr) {
std::vector<std::string> paths;
vector<string> paths;
StringUtil::stringtok(paths, value.addr, ", ");
for (size_t i = 0; i < paths.size(); ++i)
FbTk::Image::addSearchPath(paths[i]);
@ -1685,8 +1699,8 @@ BScreen *Fluxbox::findScreen(int id) {
}
bool Fluxbox::menuTimestampsChanged() const {
std::list<MenuTimestamp *>::const_iterator it = m_menu_timestamps.begin();
std::list<MenuTimestamp *>::const_iterator it_end = m_menu_timestamps.end();
list<MenuTimestamp *>::const_iterator it = m_menu_timestamps.begin();
list<MenuTimestamp *>::const_iterator it_end = m_menu_timestamps.end();
for (; it != it_end; ++it) {
time_t timestamp = FbTk::FileUtil::getLastStatusChangeTimestamp((*it)->filename.c_str());
@ -1745,8 +1759,8 @@ void Fluxbox::saveMenuFilename(const char *filename) {
bool found = false;
std::list<MenuTimestamp *>::iterator it = m_menu_timestamps.begin();
std::list<MenuTimestamp *>::iterator it_end = m_menu_timestamps.end();
list<MenuTimestamp *>::iterator it = m_menu_timestamps.begin();
list<MenuTimestamp *>::iterator it_end = m_menu_timestamps.end();
for (; it != it_end; ++it) {
if ((*it)->filename == filename) {
found = true;

View file

@ -85,7 +85,6 @@ public:
int by1 = 0;
int bx2 = text_w;
int by2 = 0;
int tmp;
switch (m_orient) {
case FbTk::ROT90:
@ -99,6 +98,8 @@ public:
by2 = -bx2;
bx2 = 0;
break;
default:
break;
}
/*

View file

@ -49,7 +49,13 @@
#include <fstream>
#include <algorithm>
using namespace std;
using std::cerr;
using std::endl;
using std::string;
using std::fstream;
using std::ifstream;
using std::ofstream;
using std::ios;
FbRun::FbRun(int x, int y, size_t width):
FbTk::TextBox(DefaultScreen(FbTk::App::instance()->display()),

View file

@ -35,7 +35,9 @@ extern "C" {
#include <string>
#include <iostream>
using namespace std;
using std::cerr;
using std::endl;
using std::string;
void showUsage(const char *progname) {
cerr<<"fbrun 1.5 : (c) 2002-2004 Henrik Kinnunen"<<endl;

View file

@ -50,7 +50,10 @@
#endif
#include <iostream>
using namespace std;
using std::cout;
using std::cerr;
using std::endl;
using std::string;
fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name)
: FbTk::App(dpy_name), m_app_name(argv[0]) {
@ -398,7 +401,7 @@ int main(int argc, char **argv) {
try {
fbsetroot app(argc, argv, display_name);
} catch (std::string error_str) {
} catch (string error_str) {
_FB_USES_NLS;
cerr<<_FB_CONSOLETEXT(Common, Error, "Error", "Error message header")<<": "<<error_str<<endl;
}