aboutsummaryrefslogtreecommitdiff
path: root/src/Workspace.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-04-09 23:18:12 (GMT)
committerfluxgen <fluxgen>2002-04-09 23:18:12 (GMT)
commitbd7951bcdad7e1c4dd6b5ff267cb85fc8cbf6d7e (patch)
tree054a577207b64aa174213afd6024ab039cb3a4be /src/Workspace.cc
parent8afd178252147739025779bc8db906cabea488fe (diff)
downloadfluxbox-bd7951bcdad7e1c4dd6b5ff267cb85fc8cbf6d7e.zip
fluxbox-bd7951bcdad7e1c4dd6b5ff267cb85fc8cbf6d7e.tar.bz2
clean up
Diffstat (limited to 'src/Workspace.cc')
-rw-r--r--src/Workspace.cc43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 6b93c5d..3f57e37 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Workspace.cc,v 1.17 2002/04/04 11:28:19 fluxgen Exp $ 25// $Id: Workspace.cc,v 1.18 2002/04/09 23:18:12 fluxgen Exp $
26 26
27// use GNU extensions 27// use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -58,23 +58,18 @@
58#include <iostream> 58#include <iostream>
59using namespace std; 59using namespace std;
60 60
61#ifdef DEBUG
62#include <iostream>
63using namespace std;
64#endif
65
66Workspace::Workspace(BScreen *scrn, unsigned int i): 61Workspace::Workspace(BScreen *scrn, unsigned int i):
67screen(scrn), 62screen(scrn),
68lastfocus(0), 63lastfocus(0),
69name(""), 64m_name(""),
70id(i), 65m_id(i),
71cascade_x(32), cascade_y(32) 66cascade_x(32), cascade_y(32)
72{ 67{
73 68
74 clientmenu = new Clientmenu(this); 69 clientmenu = new Clientmenu(this);
75 70
76 char *tmp; 71 char *tmp;
77 screen->getNameOfWorkspace(id, &tmp); 72 screen->getNameOfWorkspace(m_id, &tmp);
78 setName(tmp); 73 setName(tmp);
79 74
80 if (tmp) 75 if (tmp)
@@ -94,7 +89,7 @@ const int Workspace::addWindow(FluxboxWindow *w, bool place) {
94 if (place) 89 if (place)
95 placeWindow(w); 90 placeWindow(w);
96 91
97 w->setWorkspace(id); 92 w->setWorkspace(m_id);
98 w->setWindowNumber(windowList.size()); 93 w->setWindowNumber(windowList.size());
99 94
100 stackingList.push_front(w); 95 stackingList.push_front(w);
@@ -118,7 +113,7 @@ const int Workspace::addWindow(FluxboxWindow *w, bool place) {
118 clientmenu->insert(w->getTitle().c_str()); 113 clientmenu->insert(w->getTitle().c_str());
119 clientmenu->update(); 114 clientmenu->update();
120 115
121 screen->updateNetizenWindowAdd(w->getClientWindow(), id); 116 screen->updateNetizenWindowAdd(w->getClientWindow(), m_id);
122 117
123 raiseWindow(w); 118 raiseWindow(w);
124 119
@@ -310,7 +305,7 @@ void Workspace::reconfigure(void) {
310} 305}
311 306
312 307
313FluxboxWindow *Workspace::getWindow(unsigned int index) { 308FluxboxWindow *Workspace::getWindow(unsigned int index) const{
314 if (index < windowList.size()) 309 if (index < windowList.size())
315 return windowList[index]; 310 return windowList[index];
316 311
@@ -318,7 +313,7 @@ FluxboxWindow *Workspace::getWindow(unsigned int index) {
318} 313}
319 314
320 315
321const int Workspace::getCount(void) { 316const int Workspace::getCount(void) const {
322 return windowList.size(); 317 return windowList.size();
323} 318}
324 319
@@ -329,36 +324,36 @@ void Workspace::update(void) {
329} 324}
330 325
331 326
332bool Workspace::isCurrent(void) { 327bool Workspace::isCurrent(void) const{
333 return (id == screen->getCurrentWorkspaceID()); 328 return (m_id == screen->getCurrentWorkspaceID());
334} 329}
335 330
336 331
337bool Workspace::isLastWindow(FluxboxWindow *w) { 332bool Workspace::isLastWindow(FluxboxWindow *w) const{
338 return (w == windowList.back()); 333 return (w == windowList.back());
339} 334}
340 335
341void Workspace::setCurrent(void) { 336void Workspace::setCurrent(void) {
342 screen->changeWorkspaceID(id); 337 screen->changeWorkspaceID(m_id);
343} 338}
344 339
345 340
346void Workspace::setName(char *new_name) { 341void Workspace::setName(const char *name) {
347 342
348 if (new_name) { 343 if (name) {
349 name = new_name; 344 m_name = name;
350 } else { 345 } else { //if name == 0 then set default name from nls
351 char tname[128]; 346 char tname[128];
352 sprintf(tname, I18n::instance()-> 347 sprintf(tname, I18n::instance()->
353 getMessage( 348 getMessage(
354 FBNLS::WorkspaceSet, FBNLS::WorkspaceDefaultNameFormat, 349 FBNLS::WorkspaceSet, FBNLS::WorkspaceDefaultNameFormat,
355 "Workspace %d"), id + 1); 350 "Workspace %d"), m_id + 1); //m_id starts at 0
356 name = tname; 351 m_name = tname;
357 } 352 }
358 353
359 screen->updateWorkspaceNamesAtom(); 354 screen->updateWorkspaceNamesAtom();
360 355
361 clientmenu->setLabel(name.c_str()); 356 clientmenu->setLabel(m_name.c_str());
362 clientmenu->update(); 357 clientmenu->update();
363} 358}
364 359