#include <X11/Xatom.h>
#include <X11/keysym.h>
-#include <iostream>
#include "i18n.h"
#include "openbox.h"
for (int i = 0; i < resource.workspaces; ++i) {
wkspc = new Workspace(*this, workspacesList->count());
workspacesList->insert(wkspc);
- saveWorkspaceNames();
workspacemenu->insert(wkspc->getName(), wkspc->getMenu());
}
} else {
wkspc = new Workspace(*this, workspacesList->count());
workspacesList->insert(wkspc);
- saveWorkspaceNames();
workspacemenu->insert(wkspc->getName(), wkspc->getMenu());
}
+ saveWorkspaceNames();
workspacemenu->insert(i18n->getMessage(IconSet, IconIcons, "Icons"),
iconmenu);
BTexture *texture,
unsigned long default_pixel)
{
- string s;
+ std::string s;
if (resource.styleconfig.getValue(rname, rclass, s))
image_control->parseTexture(texture, s.c_str());
void BScreen::readDatabaseColor(const char *rname, const char *rclass,
BColor *color, unsigned long default_pixel)
{
- string s;
+ std::string s;
if (resource.styleconfig.getValue(rname, rclass, s))
image_control->parseColor(color, s.c_str());
else {
- // parsing with no color string just deallocates the color, if it has
+ // parsing with no color std::string just deallocates the color, if it has
// been previously allocated
image_control->parseColor(color);
color->setPixel(default_pixel);
static char *defaultFont = "fixed";
bool load_default = false;
- string s;
+ std::string s;
if (*fontset)
XFreeFontSet(getBaseDisplay().getXDisplay(), *fontset);
static char *defaultFont = "fixed";
bool load_default = false;
- string s;
+ std::string s;
if (*font)
XFreeFont(getBaseDisplay().getXDisplay(), *font);
if (w != NULL) {
names << w->getName();
if (i < resource.workspaces-1)
- names << ',';
+ names << ",";
}
}
names << ends;
#ifdef HAVE_STRFTIME
// it deletes the current value before setting the new one, so we have to
// duplicate the current value.
- string s = resource.strftime_format;
+ std::string s = resource.strftime_format;
setStrftimeFormat(s.c_str());
#else // !HAVE_STRFTIME
setDateFormat(resource.date_format);
setHideToolbar(resource.hide_toolbar);
}
+
void BScreen::load() {
ostrstream rscreen, rname, rclass;
- string s;
+ std::string s;
bool b;
long l;
rscreen << "session.screen" << getScreenNumber() << '.' << ends;
}
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "fullMaximization" << ends;
rclass << rscreen.str() << "FullMaximization" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.full_max = false;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "focusNewWindows" << ends;
rclass << rscreen.str() << "FocusNewWindows" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.focus_new = false;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "focusLastWindow" << ends;
rclass << rscreen.str() << "FocusLastWindow" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.focus_last = false;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "rowPlacementDirection" << ends;
rclass << rscreen.str() << "RowPlacementDirection" << ends;
if (config.getValue(rname.str(), rclass.str(), s)) {
resource.row_direction = LeftRight;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "colPlacementDirection" << ends;
rclass << rscreen.str() << "ColPlacementDirection" << ends;
if (config.getValue(rname.str(), rclass.str(), s)) {
resource.col_direction = TopBottom;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "workspaces" << ends;
rclass << rscreen.str() << "Workspaces" << ends;
- if (config.getValue(rname.str(), rclass.str(), l))
+ if (config.getValue(rname.str(), rclass.str(), l)) {
resource.workspaces = l;
- else
+ } else
resource.workspaces = 1;
removeWorkspaceNames();
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "workspaceNames" << ends;
rclass << rscreen.str() << "WorkspaceNames" << ends;
if (config.getValue(rname.str(), rclass.str(), s)) {
while(1) {
string::const_iterator tmp = it;// current string.begin()
it = std::find(tmp, end, ','); // look for comma between tmp and end
- string name(tmp, it); // name = s[tmp:it]
+ std::string name(tmp, it); // name = s[tmp:it]
addWorkspaceName(name.c_str());
if (it == end)
break;
}
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "focusModel" << ends;
rclass << rscreen.str() << "FocusModel" << ends;
if (config.getValue(rname.str(), rclass.str(), s)) {
}
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "windowZones" << ends;
rclass << rscreen.str() << "WindowZones" << ends;
if (config.getValue(rname.str(), rclass.str(), l))
resource.zones = 4;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "windowPlacement" << ends;
rclass << rscreen.str() << "WindowPlacement" << ends;
if (config.getValue(rname.str(), rclass.str(), s)) {
#ifdef HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "strftimeFormat" << ends;
rclass << rscreen.str() << "StrftimeFormat" << ends;
resource.strftime_format = bstrdup("%I:%M %p");
#else // !HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "dateFormat" << ends;
rclass << rscreen.str() << "DateFormat" << ends;
if (config.getValue(rname.str(), rclass.str(), s)) {
resource.date_format = B_AmericanDate;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "clockFormat" << ends;
rclass << rscreen.str() << "ClockFormat" << ends;
if (config.getValue(rname.str(), rclass.str(), l)) {
#endif // HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "edgeSnapThreshold" << ends;
rclass << rscreen.str() << "EdgeSnapThreshold" << ends;
if (config.getValue(rname.str(), rclass.str(), l))
resource.edge_snap_threshold = 4;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "imageDither" << ends;
rclass << rscreen.str() << "ImageDither" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.image_dither = true;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "rootCommand" << ends;
rclass << rscreen.str() << "RootCommand" << ends;
resource.root_command = NULL;
rname.seekp(0); rclass.seekp(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
rname << rscreen.str() << "opaqueMove" << ends;
rclass << rscreen.str() << "OpaqueMove" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.opaque_move = false;
rscreen.rdbuf()->freeze(0);
- rname.rdbuf()->freeze(0);
- rclass.rdbuf()->freeze(0);
+ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0);
}
void BScreen::reconfigure(void) {
}
}
- string s;
+ std::string s;
long l;
// load fonts/fontsets
int BScreen::addWorkspace(void) {
Workspace *wkspc = new Workspace(*this, workspacesList->count());
workspacesList->insert(wkspc);
+ setWorkspaceCount(workspaceCount()+1);
saveWorkspaceNames();
workspacemenu->insert(wkspc->getName(), wkspc->getMenu(),
workspacesList->remove(wkspc);
delete wkspc;
+ setWorkspaceCount(workspaceCount()-1);
+ saveWorkspaceNames();
toolbar->reconfigure();