diff options
Diffstat (limited to 'src/Workspace.cc')
-rw-r--r-- | src/Workspace.cc | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc index a83aab3..553baca 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.34 2002/10/29 16:00:20 fluxgen Exp $ | 25 | // $Id: Workspace.cc,v 1.35 2002/11/03 15:02:21 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Workspace.hh" | 27 | #include "Workspace.hh" |
28 | 28 | ||
@@ -93,7 +93,7 @@ Workspace::~Workspace() { | |||
93 | 93 | ||
94 | void Workspace::setLastFocusedWindow(FluxboxWindow *win) { | 94 | void Workspace::setLastFocusedWindow(FluxboxWindow *win) { |
95 | // make sure we have this window in the list | 95 | // make sure we have this window in the list |
96 | if (std::find(windowList.begin(), windowList.end(), win) != windowList.end()) | 96 | if (std::find(m_windowlist.begin(), m_windowlist.end(), win) != m_windowlist.end()) |
97 | lastfocus = win; | 97 | lastfocus = win; |
98 | else | 98 | else |
99 | lastfocus = 0; | 99 | lastfocus = 0; |
@@ -107,7 +107,7 @@ int Workspace::addWindow(FluxboxWindow *w, bool place) { | |||
107 | placeWindow(w); | 107 | placeWindow(w); |
108 | 108 | ||
109 | w->setWorkspace(m_id); | 109 | w->setWorkspace(m_id); |
110 | w->setWindowNumber(windowList.size()); | 110 | w->setWindowNumber(m_windowlist.size()); |
111 | 111 | ||
112 | stackingList.push_front(w); | 112 | stackingList.push_front(w); |
113 | 113 | ||
@@ -117,20 +117,20 @@ int Workspace::addWindow(FluxboxWindow *w, bool place) { | |||
117 | //if there isn't any window that's focused, just add it to the end of the list | 117 | //if there isn't any window that's focused, just add it to the end of the list |
118 | /* | 118 | /* |
119 | if (focused == 0) { | 119 | if (focused == 0) { |
120 | windowList.push_back(w); | 120 | m_windowlist.push_back(w); |
121 | //Add client to clientmenu | 121 | //Add client to clientmenu |
122 | m_clientmenu.insert(w->getTitle().c_str()); | 122 | m_clientmenu.insert(w->getTitle().c_str()); |
123 | } else { | 123 | } else { |
124 | Windows::iterator it = windowList.begin(); | 124 | Windows::iterator it = m_windowlist.begin(); |
125 | size_t client_insertpoint=0; | 125 | size_t client_insertpoint=0; |
126 | for (; it != windowList.end(); ++it, ++client_insertpoint) { | 126 | for (; it != m_windowlist.end(); ++it, ++client_insertpoint) { |
127 | if (*it == focused) { | 127 | if (*it == focused) { |
128 | ++it; | 128 | ++it; |
129 | break; | 129 | break; |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 | ||
133 | windowList.insert(it, w); | 133 | m_windowlist.insert(it, w); |
134 | //Add client to clientmenu | 134 | //Add client to clientmenu |
135 | m_clientmenu.insert(w->getTitle().c_str(), client_insertpoint); | 135 | m_clientmenu.insert(w->getTitle().c_str(), client_insertpoint); |
136 | 136 | ||
@@ -139,7 +139,7 @@ int Workspace::addWindow(FluxboxWindow *w, bool place) { | |||
139 | */ | 139 | */ |
140 | //add to list | 140 | //add to list |
141 | m_clientmenu.insert(w->getTitle().c_str()); | 141 | m_clientmenu.insert(w->getTitle().c_str()); |
142 | windowList.push_back(w); | 142 | m_windowlist.push_back(w); |
143 | 143 | ||
144 | //update menugraphics | 144 | //update menugraphics |
145 | m_clientmenu.update(); | 145 | m_clientmenu.update(); |
@@ -190,11 +190,11 @@ int Workspace::removeWindow(FluxboxWindow *w) { | |||
190 | 190 | ||
191 | 191 | ||
192 | 192 | ||
193 | Windows::iterator it = windowList.begin(); | 193 | Windows::iterator it = m_windowlist.begin(); |
194 | Windows::iterator it_end = windowList.end(); | 194 | Windows::iterator it_end = m_windowlist.end(); |
195 | for (; it != it_end; ++it) { | 195 | for (; it != it_end; ++it) { |
196 | if (*it == w) { | 196 | if (*it == w) { |
197 | windowList.erase(it); | 197 | m_windowlist.erase(it); |
198 | break; | 198 | break; |
199 | } | 199 | } |
200 | } | 200 | } |
@@ -206,17 +206,17 @@ int Workspace::removeWindow(FluxboxWindow *w) { | |||
206 | screen->updateNetizenWindowDel(w->getClientWindow()); | 206 | screen->updateNetizenWindowDel(w->getClientWindow()); |
207 | 207 | ||
208 | { | 208 | { |
209 | Windows::iterator it = windowList.begin(); | 209 | Windows::iterator it = m_windowlist.begin(); |
210 | Windows::const_iterator it_end = windowList.end(); | 210 | Windows::const_iterator it_end = m_windowlist.end(); |
211 | for (int i = 0; it != it_end; ++it, ++i) { | 211 | for (int i = 0; it != it_end; ++it, ++i) { |
212 | (*it)->setWindowNumber(i); | 212 | (*it)->setWindowNumber(i); |
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | if (lastfocus == w || windowList.empty()) | 216 | if (lastfocus == w || m_windowlist.empty()) |
217 | lastfocus = 0; | 217 | lastfocus = 0; |
218 | 218 | ||
219 | return windowList.size(); | 219 | return m_windowlist.size(); |
220 | } | 220 | } |
221 | 221 | ||
222 | 222 | ||
@@ -240,8 +240,8 @@ void Workspace::hideAll(void) { | |||
240 | 240 | ||
241 | 241 | ||
242 | void Workspace::removeAll(void) { | 242 | void Workspace::removeAll(void) { |
243 | Windows::iterator it = windowList.begin(); | 243 | Windows::iterator it = m_windowlist.begin(); |
244 | Windows::const_iterator it_end = windowList.end(); | 244 | Windows::const_iterator it_end = m_windowlist.end(); |
245 | for (; it != it_end; ++it) { | 245 | for (; it != it_end; ++it) { |
246 | (*it)->iconify(); | 246 | (*it)->iconify(); |
247 | } | 247 | } |
@@ -305,11 +305,11 @@ void Workspace::lowerWindow(FluxboxWindow *w) { | |||
305 | } | 305 | } |
306 | 306 | ||
307 | 307 | ||
308 | void Workspace::reconfigure(void) { | 308 | void Workspace::reconfigure() { |
309 | m_clientmenu.reconfigure(); | 309 | m_clientmenu.reconfigure(); |
310 | 310 | ||
311 | Windows::iterator it = windowList.begin(); | 311 | Windows::iterator it = m_windowlist.begin(); |
312 | Windows::iterator it_end = windowList.end(); | 312 | Windows::iterator it_end = m_windowlist.end(); |
313 | for (; it != it_end; ++it) { | 313 | for (; it != it_end; ++it) { |
314 | if ((*it)->validateClient()) | 314 | if ((*it)->validateClient()) |
315 | (*it)->reconfigure(); | 315 | (*it)->reconfigure(); |
@@ -318,20 +318,20 @@ void Workspace::reconfigure(void) { | |||
318 | 318 | ||
319 | 319 | ||
320 | const FluxboxWindow *Workspace::getWindow(unsigned int index) const { | 320 | const FluxboxWindow *Workspace::getWindow(unsigned int index) const { |
321 | if (index < windowList.size()) | 321 | if (index < m_windowlist.size()) |
322 | return windowList[index]; | 322 | return m_windowlist[index]; |
323 | return 0; | 323 | return 0; |
324 | } | 324 | } |
325 | 325 | ||
326 | FluxboxWindow *Workspace::getWindow(unsigned int index) { | 326 | FluxboxWindow *Workspace::getWindow(unsigned int index) { |
327 | if (index < windowList.size()) | 327 | if (index < m_windowlist.size()) |
328 | return windowList[index]; | 328 | return m_windowlist[index]; |
329 | return 0; | 329 | return 0; |
330 | } | 330 | } |
331 | 331 | ||
332 | 332 | ||
333 | int Workspace::getCount() const { | 333 | int Workspace::getCount() const { |
334 | return windowList.size(); | 334 | return m_windowlist.size(); |
335 | } | 335 | } |
336 | 336 | ||
337 | namespace { | 337 | namespace { |
@@ -360,6 +360,7 @@ void Workspace::checkGrouping(FluxboxWindow &win) { | |||
360 | #endif // DEBUG | 360 | #endif // DEBUG |
361 | return; | 361 | return; |
362 | } | 362 | } |
363 | |||
363 | // go throu every group and search for matching win instancename | 364 | // go throu every group and search for matching win instancename |
364 | GroupList::iterator g(m_groups.begin()); | 365 | GroupList::iterator g(m_groups.begin()); |
365 | GroupList::iterator g_end(m_groups.end()); | 366 | GroupList::iterator g_end(m_groups.end()); |
@@ -372,8 +373,8 @@ void Workspace::checkGrouping(FluxboxWindow &win) { | |||
372 | continue; | 373 | continue; |
373 | 374 | ||
374 | // find a window with the specific name | 375 | // find a window with the specific name |
375 | Windows::iterator wit(getWindowList().begin()); | 376 | Windows::iterator wit(m_windowlist.begin()); |
376 | Windows::iterator wit_end(getWindowList().end()); | 377 | Windows::iterator wit_end(m_windowlist.end()); |
377 | for (; wit != wit_end; ++wit) { | 378 | for (; wit != wit_end; ++wit) { |
378 | #ifdef DEBUG | 379 | #ifdef DEBUG |
379 | cerr<<__FILE__<<" check group with : "<<(*wit)->instanceName()<<endl; | 380 | cerr<<__FILE__<<" check group with : "<<(*wit)->instanceName()<<endl; |
@@ -431,7 +432,7 @@ bool Workspace::isCurrent() const{ | |||
431 | 432 | ||
432 | 433 | ||
433 | bool Workspace::isLastWindow(FluxboxWindow *w) const{ | 434 | bool Workspace::isLastWindow(FluxboxWindow *w) const{ |
434 | return (w == windowList.back()); | 435 | return (w == m_windowlist.back()); |
435 | } | 436 | } |
436 | 437 | ||
437 | void Workspace::setCurrent() { | 438 | void Workspace::setCurrent() { |
@@ -460,13 +461,13 @@ void Workspace::setName(const std::string &name) { | |||
460 | //------------ shutdown --------- | 461 | //------------ shutdown --------- |
461 | // Calls restore on all windows | 462 | // Calls restore on all windows |
462 | // on the workspace and then | 463 | // on the workspace and then |
463 | // clears the windowList | 464 | // clears the m_windowlist |
464 | //------------------------------- | 465 | //------------------------------- |
465 | void Workspace::shutdown() { | 466 | void Workspace::shutdown() { |
466 | // note: when the window dies it'll remove it self from the list | 467 | // note: when the window dies it'll remove it self from the list |
467 | while (!windowList.empty()) { | 468 | while (!m_windowlist.empty()) { |
468 | windowList.back()->restore(true); // restore with remap | 469 | m_windowlist.back()->restore(true); // restore with remap |
469 | delete windowList.back(); //delete window (the window removes it self from windowList) | 470 | delete m_windowlist.back(); //delete window (the window removes it self from m_windowlist) |
470 | } | 471 | } |
471 | } | 472 | } |
472 | 473 | ||
@@ -570,8 +571,8 @@ void Workspace::placeWindow(FluxboxWindow *win) { | |||
570 | 571 | ||
571 | placed = True; | 572 | placed = True; |
572 | 573 | ||
573 | Windows::iterator it = windowList.begin(); | 574 | Windows::iterator it = m_windowlist.begin(); |
574 | Windows::iterator it_end = windowList.end(); | 575 | Windows::iterator it_end = m_windowlist.end(); |
575 | 576 | ||
576 | for (; it != it_end && placed; ++it) { | 577 | for (; it != it_end && placed; ++it) { |
577 | curr_x = (*it)->getXFrame(); | 578 | curr_x = (*it)->getXFrame(); |
@@ -689,8 +690,8 @@ void Workspace::placeWindow(FluxboxWindow *win) { | |||
689 | ! placed) { | 690 | ! placed) { |
690 | placed = True; | 691 | placed = True; |
691 | 692 | ||
692 | Windows::iterator it = windowList.begin(); | 693 | Windows::iterator it = m_windowlist.begin(); |
693 | Windows::iterator it_end = windowList.end(); | 694 | Windows::iterator it_end = m_windowlist.end(); |
694 | for (; it != it_end && placed; ++it) { | 695 | for (; it != it_end && placed; ++it) { |
695 | curr_x = (*it)->getXFrame(); | 696 | curr_x = (*it)->getXFrame(); |
696 | curr_y = (*it)->getYFrame(); | 697 | curr_y = (*it)->getYFrame(); |