aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-11 17:14:41 (GMT)
committerfluxgen <fluxgen>2003-05-11 17:14:41 (GMT)
commitc188d1d39a57d9a16a220a0663024fcd919b0ad0 (patch)
tree54869068a6d3b55fcaa77d910687faa04554a581 /src/Screen.cc
parent7149b4dd5b403cdb7a84ca627496aeb997322abf (diff)
downloadfluxbox-c188d1d39a57d9a16a220a0663024fcd919b0ad0.zip
fluxbox-c188d1d39a57d9a16a220a0663024fcd919b0ad0.tar.bz2
minor cleaning
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 3130499..d8c02ef 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.155 2003/05/11 15:26:34 fluxgen Exp $ 25// $Id: Screen.cc,v 1.156 2003/05/11 17:11:59 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1068,7 +1068,7 @@ void BScreen::changeWorkspaceID(unsigned int id) {
1068 1068
1069 // reassociate all windows that are stuck to the new workspace 1069 // reassociate all windows that are stuck to the new workspace
1070 Workspace *wksp = getCurrentWorkspace(); 1070 Workspace *wksp = getCurrentWorkspace();
1071 Workspace::Windows wins = wksp->getWindowList(); 1071 Workspace::Windows wins = wksp->windowList();
1072 Workspace::Windows::iterator it = wins.begin(); 1072 Workspace::Windows::iterator it = wins.begin();
1073 for (; it != wins.end(); ++it) { 1073 for (; it != wins.end(); ++it) {
1074 if ((*it)->isStuck()) { 1074 if ((*it)->isStuck()) {
@@ -1138,24 +1138,28 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS
1138} 1138}
1139 1139
1140 1140
1141void BScreen::addNetizen(Netizen *n) { 1141void BScreen::addNetizen(Window win) {
1142 netizenList.push_back(n); 1142 Netizen *net = new Netizen(*this, win);
1143 netizenList.push_back(net);
1143 1144
1144 n->sendWorkspaceCount(); 1145 net->sendWorkspaceCount();
1145 n->sendCurrentWorkspace(); 1146 net->sendCurrentWorkspace();
1146 1147
1148 // send all windows to netizen
1147 Workspaces::iterator it = workspacesList.begin(); 1149 Workspaces::iterator it = workspacesList.begin();
1148 Workspaces::iterator it_end = workspacesList.end(); 1150 Workspaces::iterator it_end = workspacesList.end();
1149 for (; it != it_end; ++it) { 1151 for (; it != it_end; ++it) {
1150 for (int i = 0; i < (*it)->getCount(); ++i) { 1152 Workspace::Windows::iterator win_it = (*it)->windowList().begin();
1151 n->sendWindowAdd((*it)->getWindow(i)->getClientWindow(), 1153 Workspace::Windows::iterator win_it_end = (*it)->windowList().end();
1154 for (; win_it != win_it_end; ++win_it) {
1155 net->sendWindowAdd((*win_it)->getClientWindow(),
1152 (*it)->workspaceID()); 1156 (*it)->workspaceID());
1153 } 1157 }
1154 } 1158 }
1155 1159
1156 Window f = ((Fluxbox::instance()->getFocusedWindow()) ? 1160 Window f = ((Fluxbox::instance()->getFocusedWindow()) ?
1157 Fluxbox::instance()->getFocusedWindow()->getClientWindow() : None); 1161 Fluxbox::instance()->getFocusedWindow()->getClientWindow() : None);
1158 n->sendWindowFocus(f); 1162 net->sendWindowFocus(f);
1159} 1163}
1160 1164
1161void BScreen::removeNetizen(Window w) { 1165void BScreen::removeNetizen(Window w) {
@@ -1475,7 +1479,7 @@ void BScreen::nextFocus(int opts) {
1475 bool have_focused = false; 1479 bool have_focused = false;
1476 int focused_window_number = -1; 1480 int focused_window_number = -1;
1477 FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow(); 1481 FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow();
1478 const int num_windows = getCurrentWorkspace()->getCount(); 1482 const int num_windows = getCurrentWorkspace()->numberOfWindows();
1479 1483
1480 if (focused != 0) { 1484 if (focused != 0) {
1481 if (focused->screen().getScreenNumber() == 1485 if (focused->screen().getScreenNumber() ==
@@ -1535,7 +1539,7 @@ void BScreen::nextFocus(int opts) {
1535 cycling_window = it; 1539 cycling_window = it;
1536 } else { // not stacked cycling 1540 } else { // not stacked cycling
1537 Workspace *wksp = getCurrentWorkspace(); 1541 Workspace *wksp = getCurrentWorkspace();
1538 Workspace::Windows &wins = wksp->getWindowList(); 1542 Workspace::Windows &wins = wksp->windowList();
1539 Workspace::Windows::iterator it = wins.begin(); 1543 Workspace::Windows::iterator it = wins.begin();
1540 1544
1541 if (!have_focused) { 1545 if (!have_focused) {
@@ -1565,7 +1569,7 @@ void BScreen::prevFocus(int opts) {
1565 bool have_focused = false; 1569 bool have_focused = false;
1566 int focused_window_number = -1; 1570 int focused_window_number = -1;
1567 FluxboxWindow *focused; 1571 FluxboxWindow *focused;
1568 int num_windows = getCurrentWorkspace()->getCount(); 1572 int num_windows = getCurrentWorkspace()->numberOfWindows();
1569 1573
1570 if ((focused = Fluxbox::instance()->getFocusedWindow())) { 1574 if ((focused = Fluxbox::instance()->getFocusedWindow())) {
1571 if (focused->screen().getScreenNumber() == 1575 if (focused->screen().getScreenNumber() ==
@@ -1578,7 +1582,7 @@ void BScreen::prevFocus(int opts) {
1578 if (num_windows >= 1) { 1582 if (num_windows >= 1) {
1579 if (!(opts & CYCLELINEAR)) { 1583 if (!(opts & CYCLELINEAR)) {
1580 if (!cycling_focus) { 1584 if (!cycling_focus) {
1581 cycling_focus = True; 1585 cycling_focus = true;
1582 cycling_window = focused_list.end(); 1586 cycling_window = focused_list.end();
1583 cycling_last = 0; 1587 cycling_last = 0;
1584 } else { 1588 } else {
@@ -1628,7 +1632,7 @@ void BScreen::prevFocus(int opts) {
1628 } else { // not stacked cycling 1632 } else { // not stacked cycling
1629 1633
1630 Workspace *wksp = getCurrentWorkspace(); 1634 Workspace *wksp = getCurrentWorkspace();
1631 Workspace::Windows &wins = wksp->getWindowList(); 1635 Workspace::Windows &wins = wksp->windowList();
1632 Workspace::Windows::iterator it = wins.begin(); 1636 Workspace::Windows::iterator it = wins.begin();
1633 1637
1634 if (!have_focused) { 1638 if (!have_focused) {
@@ -1666,7 +1670,7 @@ void BScreen::raiseFocus() {
1666 focused_window_number = fb->getFocusedWindow()->getWindowNumber(); 1670 focused_window_number = fb->getFocusedWindow()->getWindowNumber();
1667 } 1671 }
1668 1672
1669 if ((getCurrentWorkspace()->getCount() > 1) && have_focused) 1673 if ((getCurrentWorkspace()->numberOfWindows() > 1) && have_focused)
1670 fb->getFocusedWindow()->raise(); 1674 fb->getFocusedWindow()->raise();
1671} 1675}
1672 1676
@@ -1693,7 +1697,7 @@ void BScreen::dirFocus(FluxboxWindow &win, FocusDir dir) {
1693 left = win.getXFrame(), 1697 left = win.getXFrame(),
1694 right = win.getXFrame() + win.width() + 2*borderW; 1698 right = win.getXFrame() + win.width() + 2*borderW;
1695 1699
1696 Workspace::Windows &wins = getCurrentWorkspace()->getWindowList(); 1700 Workspace::Windows &wins = getCurrentWorkspace()->windowList();
1697 Workspace::Windows::iterator it = wins.begin(); 1701 Workspace::Windows::iterator it = wins.begin();
1698 for (; it != wins.end(); ++it) { 1702 for (; it != wins.end(); ++it) {
1699 if ((*it) == &win) continue; // skip self 1703 if ((*it) == &win) continue; // skip self
@@ -2378,14 +2382,14 @@ void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) {
2378 Goes to the workspace "right" of the current 2382 Goes to the workspace "right" of the current
2379*/ 2383*/
2380void BScreen::nextWorkspace(const int delta) { 2384void BScreen::nextWorkspace(const int delta) {
2381 changeWorkspaceID( (getCurrentWorkspaceID()+delta) % getCount()); 2385 changeWorkspaceID( (getCurrentWorkspaceID() + delta) % getCount());
2382} 2386}
2383 2387
2384/** 2388/**
2385 Goes to the workspace "left" of the current 2389 Goes to the workspace "left" of the current
2386*/ 2390*/
2387void BScreen::prevWorkspace(const int delta) { 2391void BScreen::prevWorkspace(const int delta) {
2388 changeWorkspaceID( (getCurrentWorkspaceID()-delta+getCount()) % getCount()); 2392 changeWorkspaceID( (getCurrentWorkspaceID() - delta + getCount()) % getCount());
2389} 2393}
2390 2394
2391/** 2395/**