minor cleaning
This commit is contained in:
parent
7149b4dd5b
commit
c188d1d39a
8 changed files with 68 additions and 82 deletions
10
src/Gnome.cc
10
src/Gnome.cc
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Gnome.cc,v 1.21 2003/05/11 13:36:10 fluxgen Exp $
|
||||
// $Id: Gnome.cc,v 1.22 2003/05/11 17:11:58 fluxgen Exp $
|
||||
|
||||
#include "Gnome.hh"
|
||||
|
||||
|
@ -134,9 +134,9 @@ void Gnome::updateClientList(BScreen &screen) {
|
|||
screen.getWorkspacesList().end();
|
||||
for (; workspace_it != workspace_it_end; ++workspace_it) {
|
||||
Workspace::Windows::iterator win_it =
|
||||
(*workspace_it)->getWindowList().begin();
|
||||
(*workspace_it)->windowList().begin();
|
||||
Workspace::Windows::iterator win_it_end =
|
||||
(*workspace_it)->getWindowList().end();
|
||||
(*workspace_it)->windowList().end();
|
||||
for (; win_it != win_it_end; ++win_it)
|
||||
num += (*win_it)->numClients();
|
||||
}
|
||||
|
@ -154,9 +154,9 @@ void Gnome::updateClientList(BScreen &screen) {
|
|||
|
||||
// Fill in array of window ID's
|
||||
Workspace::Windows::const_iterator it =
|
||||
(*workspace_it)->getWindowList().begin();
|
||||
(*workspace_it)->windowList().begin();
|
||||
Workspace::Windows::const_iterator it_end =
|
||||
(*workspace_it)->getWindowList().end();
|
||||
(*workspace_it)->windowList().end();
|
||||
for (; it != it_end; ++it) {
|
||||
// TODO!
|
||||
//check if the window don't want to be visible in the list
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Screen.cc,v 1.155 2003/05/11 15:26:34 fluxgen Exp $
|
||||
// $Id: Screen.cc,v 1.156 2003/05/11 17:11:59 fluxgen Exp $
|
||||
|
||||
|
||||
#include "Screen.hh"
|
||||
|
@ -1068,7 +1068,7 @@ void BScreen::changeWorkspaceID(unsigned int id) {
|
|||
|
||||
// reassociate all windows that are stuck to the new workspace
|
||||
Workspace *wksp = getCurrentWorkspace();
|
||||
Workspace::Windows wins = wksp->getWindowList();
|
||||
Workspace::Windows wins = wksp->windowList();
|
||||
Workspace::Windows::iterator it = wins.begin();
|
||||
for (; it != wins.end(); ++it) {
|
||||
if ((*it)->isStuck()) {
|
||||
|
@ -1138,24 +1138,28 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS
|
|||
}
|
||||
|
||||
|
||||
void BScreen::addNetizen(Netizen *n) {
|
||||
netizenList.push_back(n);
|
||||
void BScreen::addNetizen(Window win) {
|
||||
Netizen *net = new Netizen(*this, win);
|
||||
netizenList.push_back(net);
|
||||
|
||||
n->sendWorkspaceCount();
|
||||
n->sendCurrentWorkspace();
|
||||
net->sendWorkspaceCount();
|
||||
net->sendCurrentWorkspace();
|
||||
|
||||
// send all windows to netizen
|
||||
Workspaces::iterator it = workspacesList.begin();
|
||||
Workspaces::iterator it_end = workspacesList.end();
|
||||
for (; it != it_end; ++it) {
|
||||
for (int i = 0; i < (*it)->getCount(); ++i) {
|
||||
n->sendWindowAdd((*it)->getWindow(i)->getClientWindow(),
|
||||
Workspace::Windows::iterator win_it = (*it)->windowList().begin();
|
||||
Workspace::Windows::iterator win_it_end = (*it)->windowList().end();
|
||||
for (; win_it != win_it_end; ++win_it) {
|
||||
net->sendWindowAdd((*win_it)->getClientWindow(),
|
||||
(*it)->workspaceID());
|
||||
}
|
||||
}
|
||||
|
||||
Window f = ((Fluxbox::instance()->getFocusedWindow()) ?
|
||||
Fluxbox::instance()->getFocusedWindow()->getClientWindow() : None);
|
||||
n->sendWindowFocus(f);
|
||||
net->sendWindowFocus(f);
|
||||
}
|
||||
|
||||
void BScreen::removeNetizen(Window w) {
|
||||
|
@ -1475,7 +1479,7 @@ void BScreen::nextFocus(int opts) {
|
|||
bool have_focused = false;
|
||||
int focused_window_number = -1;
|
||||
FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow();
|
||||
const int num_windows = getCurrentWorkspace()->getCount();
|
||||
const int num_windows = getCurrentWorkspace()->numberOfWindows();
|
||||
|
||||
if (focused != 0) {
|
||||
if (focused->screen().getScreenNumber() ==
|
||||
|
@ -1535,7 +1539,7 @@ void BScreen::nextFocus(int opts) {
|
|||
cycling_window = it;
|
||||
} else { // not stacked cycling
|
||||
Workspace *wksp = getCurrentWorkspace();
|
||||
Workspace::Windows &wins = wksp->getWindowList();
|
||||
Workspace::Windows &wins = wksp->windowList();
|
||||
Workspace::Windows::iterator it = wins.begin();
|
||||
|
||||
if (!have_focused) {
|
||||
|
@ -1565,7 +1569,7 @@ void BScreen::prevFocus(int opts) {
|
|||
bool have_focused = false;
|
||||
int focused_window_number = -1;
|
||||
FluxboxWindow *focused;
|
||||
int num_windows = getCurrentWorkspace()->getCount();
|
||||
int num_windows = getCurrentWorkspace()->numberOfWindows();
|
||||
|
||||
if ((focused = Fluxbox::instance()->getFocusedWindow())) {
|
||||
if (focused->screen().getScreenNumber() ==
|
||||
|
@ -1578,7 +1582,7 @@ void BScreen::prevFocus(int opts) {
|
|||
if (num_windows >= 1) {
|
||||
if (!(opts & CYCLELINEAR)) {
|
||||
if (!cycling_focus) {
|
||||
cycling_focus = True;
|
||||
cycling_focus = true;
|
||||
cycling_window = focused_list.end();
|
||||
cycling_last = 0;
|
||||
} else {
|
||||
|
@ -1628,7 +1632,7 @@ void BScreen::prevFocus(int opts) {
|
|||
} else { // not stacked cycling
|
||||
|
||||
Workspace *wksp = getCurrentWorkspace();
|
||||
Workspace::Windows &wins = wksp->getWindowList();
|
||||
Workspace::Windows &wins = wksp->windowList();
|
||||
Workspace::Windows::iterator it = wins.begin();
|
||||
|
||||
if (!have_focused) {
|
||||
|
@ -1666,7 +1670,7 @@ void BScreen::raiseFocus() {
|
|||
focused_window_number = fb->getFocusedWindow()->getWindowNumber();
|
||||
}
|
||||
|
||||
if ((getCurrentWorkspace()->getCount() > 1) && have_focused)
|
||||
if ((getCurrentWorkspace()->numberOfWindows() > 1) && have_focused)
|
||||
fb->getFocusedWindow()->raise();
|
||||
}
|
||||
|
||||
|
@ -1693,7 +1697,7 @@ void BScreen::dirFocus(FluxboxWindow &win, FocusDir dir) {
|
|||
left = win.getXFrame(),
|
||||
right = win.getXFrame() + win.width() + 2*borderW;
|
||||
|
||||
Workspace::Windows &wins = getCurrentWorkspace()->getWindowList();
|
||||
Workspace::Windows &wins = getCurrentWorkspace()->windowList();
|
||||
Workspace::Windows::iterator it = wins.begin();
|
||||
for (; it != wins.end(); ++it) {
|
||||
if ((*it) == &win) continue; // skip self
|
||||
|
@ -2378,14 +2382,14 @@ void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) {
|
|||
Goes to the workspace "right" of the current
|
||||
*/
|
||||
void BScreen::nextWorkspace(const int delta) {
|
||||
changeWorkspaceID( (getCurrentWorkspaceID()+delta) % getCount());
|
||||
changeWorkspaceID( (getCurrentWorkspaceID() + delta) % getCount());
|
||||
}
|
||||
|
||||
/**
|
||||
Goes to the workspace "left" of the current
|
||||
*/
|
||||
void BScreen::prevWorkspace(const int delta) {
|
||||
changeWorkspaceID( (getCurrentWorkspaceID()-delta+getCount()) % getCount());
|
||||
changeWorkspaceID( (getCurrentWorkspaceID() - delta + getCount()) % getCount());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Screen.hh,v 1.92 2003/05/10 22:45:08 fluxgen Exp $
|
||||
// $Id: Screen.hh,v 1.93 2003/05/11 17:11:58 fluxgen Exp $
|
||||
|
||||
#ifndef SCREEN_HH
|
||||
#define SCREEN_HH
|
||||
|
@ -252,7 +252,7 @@ public:
|
|||
void updateWorkspaceNamesAtom();
|
||||
|
||||
void addWorkspaceName(const char *name);
|
||||
void addNetizen(Netizen *net);
|
||||
void addNetizen(Window win);
|
||||
void removeNetizen(Window win);
|
||||
void addIcon(FluxboxWindow *win);
|
||||
void removeIcon(FluxboxWindow *win);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: ToolbarHandler.cc,v 1.9 2003/05/11 13:36:11 fluxgen Exp $
|
||||
// $Id: ToolbarHandler.cc,v 1.10 2003/05/11 17:11:58 fluxgen Exp $
|
||||
|
||||
/**
|
||||
* The ToolbarHandler class acts as a rough interface to the toolbar.
|
||||
|
@ -152,7 +152,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
|
|||
BScreen::Workspaces::const_iterator workspace_it = m_screen.getWorkspacesList().begin();
|
||||
BScreen::Workspaces::const_iterator workspace_it_end = m_screen.getWorkspacesList().end();
|
||||
for (; workspace_it != workspace_it_end; ++workspace_it) {
|
||||
Workspace::Windows &wins = (*workspace_it)->getWindowList();
|
||||
Workspace::Windows &wins = (*workspace_it)->windowList();
|
||||
Workspace::Windows::iterator wit = wins.begin();
|
||||
Workspace::Windows::iterator wit_end = wins.end();
|
||||
for (; wit != wit_end; ++wit) {
|
||||
|
@ -180,7 +180,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
|
|||
break;
|
||||
case WORKSPACE:
|
||||
{
|
||||
Workspace::Windows &wins = m_screen.getCurrentWorkspace()->getWindowList();
|
||||
Workspace::Windows &wins = m_screen.getCurrentWorkspace()->windowList();
|
||||
Workspace::Windows::iterator wit = wins.begin();
|
||||
Workspace::Windows::iterator wit_end = wins.end();
|
||||
for (; wit != wit_end; ++wit) {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Window.cc,v 1.170 2003/05/11 15:32:23 fluxgen Exp $
|
||||
// $Id: Window.cc,v 1.171 2003/05/11 17:14:41 fluxgen Exp $
|
||||
|
||||
#include "Window.hh"
|
||||
|
||||
|
@ -857,7 +857,7 @@ void FluxboxWindow::getWMProtocols() {
|
|||
else if (proto[i] == fbatoms->getWMTakeFocusAtom())
|
||||
send_focus_message = true;
|
||||
else if (proto[i] == fbatoms->getFluxboxStructureMessagesAtom())
|
||||
screen().addNetizen(new Netizen(screen(), m_client->window()));
|
||||
screen().addNetizen(m_client->window());
|
||||
}
|
||||
|
||||
XFree(proto);
|
||||
|
@ -2855,7 +2855,7 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
|
|||
// now check window edges
|
||||
|
||||
Workspace::Windows &wins =
|
||||
screen().getCurrentWorkspace()->getWindowList();
|
||||
screen().getCurrentWorkspace()->windowList();
|
||||
|
||||
Workspace::Windows::iterator it = wins.begin();
|
||||
Workspace::Windows::iterator it_end = wins.end();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Workspace.cc,v 1.62 2003/05/11 15:35:03 fluxgen Exp $
|
||||
// $Id: Workspace.cc,v 1.63 2003/05/11 17:14:41 fluxgen Exp $
|
||||
|
||||
#include "Workspace.hh"
|
||||
|
||||
|
@ -114,12 +114,12 @@ Workspace::GroupList Workspace::m_groups;
|
|||
|
||||
Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager, unsigned int i):
|
||||
m_screen(scrn),
|
||||
lastfocus(0),
|
||||
m_lastfocus(0),
|
||||
m_clientmenu(*scrn.menuTheme(), scrn.getScreenNumber(), *scrn.getImageControl()),
|
||||
m_layermanager(layermanager),
|
||||
m_name(""),
|
||||
m_id(i),
|
||||
cascade_x(32), cascade_y(32) {
|
||||
m_cascade_x(32), m_cascade_y(32) {
|
||||
|
||||
m_clientmenu.setInternalMenu();
|
||||
setName(screen().getNameOfWorkspace(m_id));
|
||||
|
@ -134,9 +134,9 @@ Workspace::~Workspace() {
|
|||
void Workspace::setLastFocusedWindow(FluxboxWindow *win) {
|
||||
// make sure we have this window in the list
|
||||
if (std::find(m_windowlist.begin(), m_windowlist.end(), win) != m_windowlist.end())
|
||||
lastfocus = win;
|
||||
m_lastfocus = win;
|
||||
else
|
||||
lastfocus = 0;
|
||||
m_lastfocus = 0;
|
||||
}
|
||||
|
||||
int Workspace::addWindow(FluxboxWindow &w, bool place) {
|
||||
|
@ -212,8 +212,8 @@ int Workspace::removeWindow(FluxboxWindow *w) {
|
|||
if (w == 0)
|
||||
return -1;
|
||||
|
||||
if (lastfocus == w) {
|
||||
lastfocus = 0;
|
||||
if (m_lastfocus == w) {
|
||||
m_lastfocus = 0;
|
||||
}
|
||||
|
||||
if (w->isFocused()) {
|
||||
|
@ -246,8 +246,8 @@ int Workspace::removeWindow(FluxboxWindow *w) {
|
|||
|
||||
updateClientmenu();
|
||||
|
||||
if (lastfocus == w || m_windowlist.empty())
|
||||
lastfocus = 0;
|
||||
if (m_lastfocus == w || m_windowlist.empty())
|
||||
m_lastfocus = 0;
|
||||
|
||||
if (!w->isStuck()) {
|
||||
FluxboxWindow::ClientList::iterator client_it =
|
||||
|
@ -314,21 +314,7 @@ void Workspace::reconfigure() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
const FluxboxWindow *Workspace::getWindow(unsigned int index) const {
|
||||
if (index < m_windowlist.size())
|
||||
return m_windowlist[index];
|
||||
return 0;
|
||||
}
|
||||
|
||||
FluxboxWindow *Workspace::getWindow(unsigned int index) {
|
||||
if (index < m_windowlist.size())
|
||||
return m_windowlist[index];
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Workspace::getCount() const {
|
||||
int Workspace::numberOfWindows() const {
|
||||
return m_windowlist.size();
|
||||
}
|
||||
|
||||
|
@ -670,15 +656,15 @@ void Workspace::placeWindow(FluxboxWindow &win) {
|
|||
// cascade placement or smart placement failed
|
||||
if (! placed) {
|
||||
|
||||
if (((unsigned) cascade_x > (screen().getWidth() / 2)) ||
|
||||
((unsigned) cascade_y > (screen().getHeight() / 2)))
|
||||
cascade_x = cascade_y = 32;
|
||||
if (((unsigned) m_cascade_x > (screen().getWidth() / 2)) ||
|
||||
((unsigned) m_cascade_y > (screen().getHeight() / 2)))
|
||||
m_cascade_x = m_cascade_y = 32;
|
||||
|
||||
place_x = cascade_x;
|
||||
place_y = cascade_y;
|
||||
place_x = m_cascade_x;
|
||||
place_y = m_cascade_y;
|
||||
|
||||
cascade_x += win.getTitleHeight();
|
||||
cascade_y += win.getTitleHeight();
|
||||
m_cascade_x += win.getTitleHeight();
|
||||
m_cascade_y += win.getTitleHeight();
|
||||
}
|
||||
|
||||
if (place_x + win_w > (signed) screen().getWidth())
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Workspace.hh for Fluxbox
|
||||
// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org)
|
||||
// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen(at)users.sourceforge.net)
|
||||
//
|
||||
// Workspace.hh for Blackbox - an X11 Window manager
|
||||
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
|
||||
|
@ -52,9 +52,8 @@ public:
|
|||
~Workspace();
|
||||
|
||||
void setLastFocusedWindow(FluxboxWindow *w);
|
||||
/**
|
||||
Set workspace name
|
||||
*/
|
||||
|
||||
/// Set workspace name
|
||||
void setName(const std::string &name);
|
||||
void showAll();
|
||||
void hideAll();
|
||||
|
@ -66,11 +65,13 @@ public:
|
|||
int addWindow(FluxboxWindow &win, bool place = false);
|
||||
int removeWindow(FluxboxWindow *win);
|
||||
void removeWindow(WinClient &client);
|
||||
BScreen &screen() { return m_screen; }
|
||||
FluxboxWindow *getLastFocusedWindow() { return lastfocus; }
|
||||
|
||||
BScreen &screen() { return m_screen; }
|
||||
const BScreen &screen() const { return m_screen; }
|
||||
const FluxboxWindow *getLastFocusedWindow() const { return lastfocus; }
|
||||
|
||||
FluxboxWindow *lastFocusedWindow() { return m_lastfocus; }
|
||||
const FluxboxWindow *lastFocusedWindow() const { return m_lastfocus; }
|
||||
|
||||
FbTk::Menu &menu() { return m_clientmenu; }
|
||||
inline const FbTk::Menu &menu() const { return m_clientmenu; }
|
||||
/// name of this workspace
|
||||
|
@ -79,18 +80,13 @@ public:
|
|||
@return the number of this workspace, note: obsolete, should be in BScreen
|
||||
*/
|
||||
inline unsigned int workspaceID() const { return m_id; }
|
||||
/**
|
||||
@param id the window id number
|
||||
@return window that match the id, else 0
|
||||
*/
|
||||
FluxboxWindow *getWindow(unsigned int id);
|
||||
const FluxboxWindow *getWindow(unsigned int id) const;
|
||||
const Windows &getWindowList() const { return m_windowlist; }
|
||||
Windows &getWindowList() { return m_windowlist; }
|
||||
|
||||
const Windows &windowList() const { return m_windowlist; }
|
||||
Windows &windowList() { return m_windowlist; }
|
||||
|
||||
bool isCurrent() const;
|
||||
bool isLastWindow(FluxboxWindow *window) const;
|
||||
int getCount() const;
|
||||
int numberOfWindows() const;
|
||||
void checkGrouping(FluxboxWindow &win);
|
||||
static bool loadGroups(const std::string &filename);
|
||||
protected:
|
||||
|
@ -100,7 +96,7 @@ private:
|
|||
void updateClientmenu();
|
||||
|
||||
BScreen &m_screen;
|
||||
FluxboxWindow *lastfocus;
|
||||
FluxboxWindow *m_lastfocus;
|
||||
FbTk::Menu m_clientmenu;
|
||||
|
||||
typedef std::list<FluxboxWindow *> WindowStack;
|
||||
|
@ -114,7 +110,7 @@ private:
|
|||
|
||||
std::string m_name; ///< name of this workspace
|
||||
unsigned int m_id; ///< id, obsolete, this should be in BScreen
|
||||
int cascade_x, cascade_y;
|
||||
int m_cascade_x, m_cascade_y;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: fluxbox.cc,v 1.136 2003/05/11 15:24:09 fluxgen Exp $
|
||||
// $Id: fluxbox.cc,v 1.137 2003/05/11 17:11:59 fluxgen Exp $
|
||||
|
||||
#include "fluxbox.hh"
|
||||
|
||||
|
@ -1242,7 +1242,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
|
|||
//!! just attach last window to focused window
|
||||
if (m_focused_window) {
|
||||
Workspace *space = keyscreen->getCurrentWorkspace();
|
||||
Workspace::Windows &wins = space->getWindowList();
|
||||
Workspace::Windows &wins = space->windowList();
|
||||
if (wins.size() == 1)
|
||||
break;
|
||||
BScreen::FocusedWindows &fwins = keyscreen->getFocusedList();
|
||||
|
|
Loading…
Reference in a new issue