cleaning, change getCount to numberOfWorkspaces

This commit is contained in:
fluxgen 2005-07-04 18:19:53 +00:00
parent 3626faea73
commit 63475f7796
3 changed files with 22 additions and 22 deletions

View file

@ -288,8 +288,8 @@ void Ewmh::updateClientList(BScreen &screen) {
} }
// and count icons // and count icons
BScreen::Icons::const_iterator icon_it = screen.getIconList().begin(); BScreen::Icons::const_iterator icon_it = screen.iconList().begin();
BScreen::Icons::const_iterator icon_it_end = screen.getIconList().end(); BScreen::Icons::const_iterator icon_it_end = screen.iconList().end();
for (; icon_it != icon_it_end; ++icon_it) { for (; icon_it != icon_it_end; ++icon_it) {
num += (*icon_it)->numClients(); num += (*icon_it)->numClients();
} }
@ -327,7 +327,7 @@ void Ewmh::updateClientList(BScreen &screen) {
} }
// plus iconified windows // plus iconified windows
icon_it = screen.getIconList().begin(); icon_it = screen.iconList().begin();
for (; icon_it != icon_it_end; ++icon_it) { for (; icon_it != icon_it_end; ++icon_it) {
FluxboxWindow::ClientList::iterator client_it = (*icon_it)->clientList().begin(); FluxboxWindow::ClientList::iterator client_it = (*icon_it)->clientList().begin();
FluxboxWindow::ClientList::iterator client_it_end = (*icon_it)->clientList().end(); FluxboxWindow::ClientList::iterator client_it_end = (*icon_it)->clientList().end();
@ -437,7 +437,7 @@ void Ewmh::updateWorkspaceCount(BScreen &screen) {
* Window Manager to indicate the number of virtual * Window Manager to indicate the number of virtual
* desktops. * desktops.
*/ */
unsigned long numworkspaces = screen.getCount(); unsigned long numworkspaces = screen.numberOfWorkspaces();
screen.rootWindow().changeProperty(m_net_number_of_desktops, screen.rootWindow().changeProperty(m_net_number_of_desktops,
XA_CARDINAL, 32, XA_CARDINAL, 32,
PropModeReplace, PropModeReplace,
@ -502,8 +502,8 @@ void Ewmh::updateWorkarea(BScreen &screen) {
* Not sure how to handle xinerama stuff here. * Not sure how to handle xinerama stuff here.
* So i'm just doing this on the first head. * So i'm just doing this on the first head.
*/ */
unsigned long *coords = new unsigned long[4*screen.getCount()]; unsigned long *coords = new unsigned long[4*screen.numberOfWorkspaces()];
for (unsigned int i=0; i<screen.getCount()*4; i+=4) { for (unsigned int i=0; i < screen.numberOfWorkspaces()*4; i+=4) {
// x, y // x, y
coords[i] = screen.maxLeft(0); coords[i] = screen.maxLeft(0);
coords[i + 1] = screen.maxTop(0); coords[i + 1] = screen.maxTop(0);
@ -516,7 +516,7 @@ void Ewmh::updateWorkarea(BScreen &screen) {
XA_CARDINAL, 32, XA_CARDINAL, 32,
PropModeReplace, PropModeReplace,
(unsigned char *)coords, (unsigned char *)coords,
4*screen.getCount()); 4 * screen.numberOfWorkspaces());
delete[] coords; delete[] coords;
} }
@ -638,7 +638,7 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
// which doesn't apply here (so borrow the variable :) ) // which doesn't apply here (so borrow the variable :) )
screen = &fbwin->screen(); screen = &fbwin->screen();
// valid workspace number? // valid workspace number?
if (static_cast<unsigned int>(ce.data.l[0]) < screen->getCount()) if (static_cast<unsigned int>(ce.data.l[0]) < screen->numberOfWorkspaces())
screen->sendToWorkspace(ce.data.l[0], fbwin, false); screen->sendToWorkspace(ce.data.l[0], fbwin, false);
return true; return true;
@ -668,20 +668,20 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
// no need to alter number of desktops if they are the same // no need to alter number of desktops if they are the same
// or if requested number of workspace is less than zero // or if requested number of workspace is less than zero
if (screen->getCount() == static_cast<unsigned int>(ce.data.l[0]) || if (screen->numberOfWorkspaces() == static_cast<unsigned int>(ce.data.l[0]) ||
ce.data.l[0] < 0) ce.data.l[0] < 0)
return true; return true;
if (screen->getCount() > static_cast<unsigned int>(ce.data.l[0])) { if (screen->numberOfWorkspaces() > static_cast<unsigned int>(ce.data.l[0])) {
// remove last workspace until we have // remove last workspace until we have
// the same number of workspaces // the same number of workspaces
while (screen->getCount() != static_cast<unsigned int>(ce.data.l[0])) { while (screen->numberOfWorkspaces() != static_cast<unsigned int>(ce.data.l[0])) {
screen->removeLastWorkspace(); screen->removeLastWorkspace();
if (screen->getCount() == 1) // must have at least one workspace if (screen->numberOfWorkspaces() == 1) // must have at least one workspace
break; break;
} }
} else { // add workspaces to screen until workspace count match the requested size } else { // add workspaces to screen until workspace count match the requested size
while (screen->getCount() != static_cast<unsigned int>(ce.data.l[0])) { while (screen->numberOfWorkspaces() != static_cast<unsigned int>(ce.data.l[0])) {
screen->addWorkspace(); screen->addWorkspace();
} }
} }
@ -693,7 +693,7 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
// ce.data.l[0] = workspace number // ce.data.l[0] = workspace number
// prevent out of range value // prevent out of range value
if (static_cast<unsigned int>(ce.data.l[0]) >= screen->getCount()) if (static_cast<unsigned int>(ce.data.l[0]) >= screen->numberOfWorkspaces())
return true; return true;
screen->changeWorkspaceID(ce.data.l[0]); screen->changeWorkspaceID(ce.data.l[0]);
return true; return true;

View file

@ -61,7 +61,7 @@ namespace {
void showMenu(const BScreen &screen, FbTk::Menu &menu) { void showMenu(const BScreen &screen, FbTk::Menu &menu) {
// special case for root menu // special case for root menu
if (&menu == &screen.getRootmenu()) { if (&menu == &screen.rootMenu()) {
Fluxbox* fb = Fluxbox::instance(); Fluxbox* fb = Fluxbox::instance();
if(fb->menuTimestampsChanged()) { if(fb->menuTimestampsChanged()) {
// we dont show the menu here because fluxbox // we dont show the menu here because fluxbox
@ -221,7 +221,7 @@ void ShowRootMenuCmd::execute() {
if (screen == 0) if (screen == 0)
return; return;
::showMenu(*screen, screen->getRootmenu()); ::showMenu(*screen, screen->rootMenu());
} }
void ShowWorkspaceMenuCmd::execute() { void ShowWorkspaceMenuCmd::execute() {
@ -229,7 +229,7 @@ void ShowWorkspaceMenuCmd::execute() {
if (screen == 0) if (screen == 0)
return; return;
::showMenu(*screen, screen->getWorkspacemenu()); ::showMenu(*screen, screen->workspaceMenu());
} }
@ -324,8 +324,8 @@ void DeiconifyCmd::execute() {
if (screen == 0) if (screen == 0)
return; return;
BScreen::Icons::reverse_iterator it= screen->getIconList().rbegin(); BScreen::Icons::reverse_iterator it= screen->iconList().rbegin();
BScreen::Icons::reverse_iterator itend= screen->getIconList().rend(); BScreen::Icons::reverse_iterator itend= screen->iconList().rend();
unsigned int workspace_num= screen->currentWorkspaceID(); unsigned int workspace_num= screen->currentWorkspaceID();
unsigned int old_workspace_num; unsigned int old_workspace_num;

View file

@ -234,7 +234,7 @@ void Gnome::updateCurrentWorkspace(BScreen &screen) {
} }
void Gnome::updateWorkspaceCount(BScreen &screen) { void Gnome::updateWorkspaceCount(BScreen &screen) {
long numworkspaces = screen.getCount(); long numworkspaces = screen.numberOfWorkspaces();
screen.rootWindow().changeProperty(m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace, screen.rootWindow().changeProperty(m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace,
(unsigned char *)&numworkspaces, 1); (unsigned char *)&numworkspaces, 1);
} }
@ -302,12 +302,12 @@ bool Gnome::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen,
#endif//!DEBUG #endif//!DEBUG
if ( winclient !=0 && // the message sent to client window? if ( winclient !=0 && // the message sent to client window?
ce.data.l[0] >= 0 && ce.data.l[0] >= 0 &&
ce.data.l[0] < (signed)winclient->screen().getCount()) { ce.data.l[0] < (signed)winclient->screen().numberOfWorkspaces()) {
winclient->screen().changeWorkspaceID(ce.data.l[0]); winclient->screen().changeWorkspaceID(ce.data.l[0]);
} else if (screen!=0 && //the message sent to root window? } else if (screen!=0 && //the message sent to root window?
ce.data.l[0] >= 0 && ce.data.l[0] >= 0 &&
ce.data.l[0] < (signed)screen->getCount()) ce.data.l[0] < (signed)screen->numberOfWorkspaces())
screen->changeWorkspaceID(ce.data.l[0]); screen->changeWorkspaceID(ce.data.l[0]);
return true; return true;
} else if (winclient == 0) } else if (winclient == 0)