some signed/unsigned stuff

This commit is contained in:
fluxgen 2002-03-23 15:14:45 +00:00
parent e133cf83a3
commit 8daa080d11
9 changed files with 100 additions and 106 deletions

View file

@ -22,10 +22,9 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Basemenu.cc,v 1.14 2002/03/21 10:54:29 fluxgen Exp $ // $Id: Basemenu.cc,v 1.15 2002/03/23 15:14:45 fluxgen Exp $
// stupid macros needed to access some functions in version 2 of the GNU C //use GNU extensions
// library
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
#define _GNU_SOURCE #define _GNU_SOURCE
#endif // _GNU_SOURCE #endif // _GNU_SOURCE

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: IconBar.cc,v 1.10 2002/02/07 14:45:02 fluxgen Exp $ // $Id: IconBar.cc,v 1.11 2002/03/23 15:14:45 fluxgen Exp $
#include "IconBar.hh" #include "IconBar.hh"
#include "i18n.hh" #include "i18n.hh"
@ -239,7 +239,7 @@ void IconBar::draw(IconBarObj *obj, int width) {
FluxboxWindow *fluxboxwin = obj->getFluxboxWin(); FluxboxWindow *fluxboxwin = obj->getFluxboxWin();
Window iconwin = obj->getIconWin(); Window iconwin = obj->getIconWin();
char *title = *fluxboxwin->getIconTitle(); const char *title = fluxboxwin->getIconTitle();
unsigned int title_len = strlen(title); unsigned int title_len = strlen(title);
unsigned int title_text_w; unsigned int title_text_w;

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Screen.cc,v 1.37 2002/03/19 14:30:42 fluxgen Exp $ // $Id: Screen.cc,v 1.38 2002/03/23 15:14:45 fluxgen Exp $
//use GNU extensions //use GNU extensions
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
@ -728,11 +728,11 @@ void BScreen::removeIcon(FluxboxWindow *w) {
} }
FluxboxWindow *BScreen::getIcon(int index) { FluxboxWindow *BScreen::getIcon(unsigned int index) {
if (index >= 0 && index < iconList.size()) if (index < iconList.size())
return iconList[index]; return iconList[index];
return (FluxboxWindow *) 0; return 0;
} }
@ -782,8 +782,8 @@ int BScreen::removeLastWorkspace(void) {
} }
void BScreen::changeWorkspaceID(int id) { void BScreen::changeWorkspaceID(unsigned int id) {
if (! current_workspace || id >= workspacesList.size() || id < 0) if (! current_workspace || id >= workspacesList.size())
return; return;
if (id != current_workspace->getWorkspaceID()) { if (id != current_workspace->getWorkspaceID()) {
@ -819,13 +819,10 @@ void BScreen::changeWorkspaceID(int id) {
updateNetizenCurrentWorkspace(); updateNetizenCurrentWorkspace();
} }
void BScreen::sendToWorkspace(int id) {
BScreen::sendToWorkspace(id, true);
}
void BScreen::sendToWorkspace(int id, bool changeWS) { void BScreen::sendToWorkspace(unsigned int id, bool changeWS) {
FluxboxWindow *win; FluxboxWindow *win;
if (! current_workspace || id >= workspacesList.size() || id < 0) if (! current_workspace || id >= workspacesList.size())
return; return;
if (id != current_workspace->getWorkspaceID()) { if (id != current_workspace->getWorkspaceID()) {
@ -1084,9 +1081,9 @@ void BScreen::addWorkspaceName(char *name) {
} }
void BScreen::getNameOfWorkspace(int id, char **name) { void BScreen::getNameOfWorkspace(unsigned int workspace, char **name) {
if (id >= 0 && id < workspaceNames.size()) { if (workspace < workspaceNames.size()) {
const char *wkspc_name = workspaceNames[id].c_str(); const char *wkspc_name = workspaceNames[workspace].c_str();
if (wkspc_name) if (wkspc_name)
*name = StringUtil::strdup(wkspc_name); *name = StringUtil::strdup(wkspc_name);
@ -1095,10 +1092,10 @@ void BScreen::getNameOfWorkspace(int id, char **name) {
} }
void BScreen::reassociateWindow(FluxboxWindow *w, int wkspc_id, Bool ignore_sticky) { void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) {
if (! w) return; if (! w) return;
if (wkspc_id == -1) if (wkspc_id >= workspaceNames.size())
wkspc_id = current_workspace->getWorkspaceID(); wkspc_id = current_workspace->getWorkspaceID();
if (w->getWorkspaceNumber() == wkspc_id) if (w->getWorkspaceNumber() == wkspc_id)
@ -1807,7 +1804,7 @@ void BScreen::rightWorkspace(const int delta) {
// Goes to the workspace "left" of the current // Goes to the workspace "left" of the current
//-------------------------------------------- //--------------------------------------------
void BScreen::leftWorkspace(const int delta) { void BScreen::leftWorkspace(const int delta) {
if (getCurrentWorkspaceID() >= delta) if (getCurrentWorkspaceID() >= static_cast<unsigned int>(delta))
changeWorkspaceID(getCurrentWorkspaceID()-delta); changeWorkspaceID(getCurrentWorkspaceID()-delta);
} }

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Screen.hh,v 1.24 2002/03/19 14:30:42 fluxgen Exp $ // $Id: Screen.hh,v 1.25 2002/03/23 15:14:45 fluxgen Exp $
#ifndef SCREEN_HH #ifndef SCREEN_HH
#define SCREEN_HH #define SCREEN_HH
@ -111,7 +111,7 @@ public:
inline Toolbar *getToolbar(void) { return toolbar; } inline Toolbar *getToolbar(void) { return toolbar; }
inline Workspace *getWorkspace(int w) { return workspacesList[w]; } inline Workspace *getWorkspace(unsigned int w) { return ( w < workspacesList.size() ? workspacesList[w] : 0); }
inline Workspace *getCurrentWorkspace(void) { return current_workspace; } inline Workspace *getCurrentWorkspace(void) { return current_workspace; }
inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; }
@ -121,10 +121,10 @@ public:
inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); } inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); }
inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); } inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); }
inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; } inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; }
inline const int getCurrentWorkspaceID() { return current_workspace->getWorkspaceID(); } inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->getWorkspaceID(); }
typedef std::vector<FluxboxWindow *> Icons; typedef std::vector<FluxboxWindow *> Icons;
inline const int getCount(void) { return workspacesList.size(); } inline const unsigned int getCount(void) { return workspacesList.size(); }
inline const int getIconCount(void) { return iconList.size(); } inline const int getIconCount(void) { return iconList.size(); }
inline Icons &getIconList(void) { return iconList; } inline Icons &getIconList(void) { return iconList; }
@ -191,7 +191,7 @@ public:
inline Theme::MenuStyle *getMenuStyle(void) { return &theme->getMenuStyle(); } inline Theme::MenuStyle *getMenuStyle(void) { return &theme->getMenuStyle(); }
inline Theme::ToolbarStyle *getToolbarStyle(void) { return &theme->getToolbarStyle(); } inline Theme::ToolbarStyle *getToolbarStyle(void) { return &theme->getToolbarStyle(); }
FluxboxWindow *getIcon(int); FluxboxWindow *getIcon(unsigned int index);
int addWorkspace(void); int addWorkspace(void);
int removeLastWorkspace(void); int removeLastWorkspace(void);
@ -209,12 +209,11 @@ public:
void removeNetizen(Window); void removeNetizen(Window);
void addIcon(FluxboxWindow *); void addIcon(FluxboxWindow *);
void removeIcon(FluxboxWindow *); void removeIcon(FluxboxWindow *);
void getNameOfWorkspace(int, char **); void getNameOfWorkspace(unsigned int workspace, char **name);
void changeWorkspaceID(int); void changeWorkspaceID(unsigned int);
void sendToWorkspace(int); void sendToWorkspace(unsigned int workspace, bool changeworkspace=true);
void sendToWorkspace(int, bool);
void raiseWindows(Window *, int); void raiseWindows(Window *, int);
void reassociateWindow(FluxboxWindow *, int, Bool); void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id, bool ignore_sticky);
void prevFocus(int = 0); void prevFocus(int = 0);
void nextFocus(int = 0); void nextFocus(int = 0);
void raiseFocus(void); void raiseFocus(void);

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Toolbar.cc,v 1.14 2002/03/19 14:30:42 fluxgen Exp $ // $Id: Toolbar.cc,v 1.15 2002/03/23 15:14:45 fluxgen Exp $
// stupid macros needed to access some functions in version 2 of the GNU C // stupid macros needed to access some functions in version 2 of the GNU C
// library // library
@ -366,7 +366,7 @@ void Toolbar::reconfigure(void) {
#endif // HAVE_STRFTIME #endif // HAVE_STRFTIME
int i; unsigned int i;
unsigned int w = 0; unsigned int w = 0;
frame.workspace_label_w = 0; frame.workspace_label_w = 0;
@ -727,17 +727,17 @@ void Toolbar::redrawWindowLabel(Bool redraw) {
if (foc->getScreen() != screen) if (foc->getScreen() != screen)
return; return;
int dx = (frame.bevel_w * 2), dlen = strlen(*foc->getTitle()); int dx = (frame.bevel_w * 2), dlen = strlen(foc->getTitle());
unsigned int l; unsigned int l;
I18n *i18n = I18n::instance(); I18n *i18n = I18n::instance();
if (i18n->multibyte()) { if (i18n->multibyte()) {
XRectangle ink, logical; XRectangle ink, logical;
XmbTextExtents(screen->getToolbarStyle()->font.set, *foc->getTitle(), dlen, XmbTextExtents(screen->getToolbarStyle()->font.set, foc->getTitle(), dlen,
&ink, &logical); &ink, &logical);
l = logical.width; l = logical.width;
} else } else
l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, *foc->getTitle(), dlen); l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, foc->getTitle(), dlen);
l += (frame.bevel_w * 4); l += (frame.bevel_w * 4);
@ -746,10 +746,10 @@ void Toolbar::redrawWindowLabel(Bool redraw) {
if (i18n->multibyte()) { if (i18n->multibyte()) {
XRectangle ink, logical; XRectangle ink, logical;
XmbTextExtents(screen->getToolbarStyle()->font.set, XmbTextExtents(screen->getToolbarStyle()->font.set,
*foc->getTitle(), dlen, &ink, &logical); foc->getTitle(), dlen, &ink, &logical);
l = logical.width; l = logical.width;
} else } else
l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, *foc->getTitle(), dlen); l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, foc->getTitle(), dlen);
l += (frame.bevel_w * 4); l += (frame.bevel_w * 4);
@ -774,12 +774,12 @@ void Toolbar::redrawWindowLabel(Bool redraw) {
screen->getToolbarStyle()->font.set, screen->getToolbarStyle()->font.set,
screen->getToolbarStyle()->w_text_gc, dx, 1 - screen->getToolbarStyle()->w_text_gc, dx, 1 -
screen->getToolbarStyle()->font.set_extents->max_ink_extent.y, screen->getToolbarStyle()->font.set_extents->max_ink_extent.y,
*foc->getTitle(), dlen); foc->getTitle(), dlen);
else else
XDrawString(display, frame.window_label, XDrawString(display, frame.window_label,
screen->getToolbarStyle()->w_text_gc, dx, screen->getToolbarStyle()->w_text_gc, dx,
screen->getToolbarStyle()->font.fontstruct->ascent + 1, screen->getToolbarStyle()->font.fontstruct->ascent + 1,
*foc->getTitle(), dlen); foc->getTitle(), dlen);
} else } else
XClearWindow(display, frame.window_label); XClearWindow(display, frame.window_label);
} }

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Window.cc,v 1.34 2002/03/19 14:30:42 fluxgen Exp $ // $Id: Window.cc,v 1.35 2002/03/23 15:14:45 fluxgen Exp $
//use GNU extensions //use GNU extensions
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
@ -411,9 +411,11 @@ FluxboxWindow::~FluxboxWindow(void) {
XUngrabPointer(display, CurrentTime); XUngrabPointer(display, CurrentTime);
} }
if (workspace_number != -1 && window_number != -1) if (!iconic) {
screen->getWorkspace(workspace_number)->removeWindow(this); Workspace *workspace = screen->getWorkspace(workspace_number);
else if (iconic) if (workspace)
workspace->removeWindow(this);
} else //it's iconic
screen->removeIcon(this); screen->removeIcon(this);
if (windowmenu) if (windowmenu)
@ -2022,9 +2024,9 @@ void FluxboxWindow::iconify(void) {
void FluxboxWindow::deiconify(bool reassoc, bool raise) { void FluxboxWindow::deiconify(bool reassoc, bool raise) {
if (iconic || reassoc) if (iconic || reassoc) {
screen->reassociateWindow(this, -1, false); screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), false);
else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID()) } else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID())
return; return;
setState(NormalState); setState(NormalState);
@ -2443,7 +2445,7 @@ void FluxboxWindow::stick(void) {
stuck = false; stuck = false;
if (! iconic) if (! iconic)
screen->reassociateWindow(this, -1, true); screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), true);
} else { } else {
@ -2712,8 +2714,8 @@ void FluxboxWindow::restoreAttributes(void) {
current_state = save_state; current_state = save_state;
} }
if (((int) blackbox_attrib.workspace != screen->getCurrentWorkspaceID()) && if (( blackbox_attrib.workspace != screen->getCurrentWorkspaceID()) &&
((int) blackbox_attrib.workspace < screen->getCount())) { ( blackbox_attrib.workspace < screen->getCount())) {
screen->reassociateWindow(this, blackbox_attrib.workspace, true); screen->reassociateWindow(this, blackbox_attrib.workspace, true);
if (current_state == NormalState) current_state = WithdrawnState; if (current_state == NormalState) current_state = WithdrawnState;
@ -3675,10 +3677,10 @@ void FluxboxWindow::changeBlackboxHints(BaseDisplay::BlackboxHints *net) {
stick(); stick();
if ((net->flags & BaseDisplay::ATTRIB_WORKSPACE) && if ((net->flags & BaseDisplay::ATTRIB_WORKSPACE) &&
(workspace_number != (signed) net->workspace)) { (workspace_number != net->workspace)) {
screen->reassociateWindow(this, net->workspace, true); screen->reassociateWindow(this, net->workspace, true);
if (screen->getCurrentWorkspaceID() != (signed) net->workspace) if (screen->getCurrentWorkspaceID() != net->workspace)
withdraw(); withdraw();
else else
deiconify(); deiconify();

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Window.hh,v 1.13 2002/03/19 00:15:58 fluxgen Exp $ // $Id: Window.hh,v 1.14 2002/03/23 15:14:45 fluxgen Exp $
#ifndef WINDOW_HH #ifndef WINDOW_HH
#define WINDOW_HH #define WINDOW_HH
@ -120,55 +120,50 @@ public:
FluxboxWindow(Window, BScreen * = 0); FluxboxWindow(Window, BScreen * = 0);
virtual ~FluxboxWindow(void); virtual ~FluxboxWindow(void);
inline const bool isTransient(void) const inline const bool isTransient(void) const { return ((transient) ? true : false); }
{ return ((transient) ? true : false); } inline const bool hasTransient(void) const { return ((client.transient) ? true : false); }
inline const bool hasTransient(void) const
{ return ((client.transient) ? true : false); }
inline const bool isManaged() const { return managed; } inline const bool isManaged() const { return managed; }
inline const bool &isFocused(void) const { return focused; } inline const bool isFocused(void) const { return focused; }
inline const bool &isVisible(void) const { return visible; } inline const bool isVisible(void) const { return visible; }
inline const bool &isIconic(void) const { return iconic; } inline const bool isIconic(void) const { return iconic; }
inline const bool &isShaded(void) const { return shaded; } inline const bool isShaded(void) const { return shaded; }
inline const bool &isMaximized(void) const { return maximized; } inline const bool isMaximized(void) const { return maximized; }
inline const bool &isIconifiable(void) const { return functions.iconify; } inline const bool isIconifiable(void) const { return functions.iconify; }
inline const bool &isMaximizable(void) const { return functions.maximize; } inline const bool isMaximizable(void) const { return functions.maximize; }
inline const bool &isResizable(void) const { return functions.resize; } inline const bool isResizable(void) const { return functions.resize; }
inline const bool &isClosable(void) const { return functions.close; } inline const bool isClosable(void) const { return functions.close; }
inline const bool &isStuck(void) const { return stuck; } inline const bool isStuck(void) const { return stuck; }
inline const bool &hasTitlebar(void) const { return decorations.titlebar; } inline const bool hasTitlebar(void) const { return decorations.titlebar; }
inline const bool hasTab(void) const { return (tab!=0 ? true : false); } inline const bool hasTab(void) const { return (tab!=0 ? true : false); }
static void showError(FluxboxWindow::Error error); static void showError(FluxboxWindow::Error error);
inline BScreen *getScreen(void) { return screen; } inline BScreen *getScreen(void) const { return screen; }
inline Tab *getTab(void) { return tab; } inline Tab *getTab(void) const { return tab; }
inline FluxboxWindow *getTransient(void) { return client.transient; } inline FluxboxWindow *getTransient(void) const { return client.transient; }
inline FluxboxWindow *getTransientFor(void) { return client.transient_for; } inline FluxboxWindow *getTransientFor(void) const { return client.transient_for; }
inline const Window &getFrameWindow(void) const { return frame.window; } inline const Window &getFrameWindow(void) const { return frame.window; }
inline const Window &getClientWindow(void) const { return client.window; } inline const Window &getClientWindow(void) const { return client.window; }
inline Windowmenu *getWindowmenu(void) { return windowmenu; } inline Windowmenu *getWindowmenu(void) { return windowmenu; }
inline char **getTitle(void) { return &client.title; } inline const char *getTitle(void) const { return client.title; }
inline char **getIconTitle(void) { return &client.icon_title; } inline const char *getIconTitle(void) const { return client.icon_title; }
inline const int &getXFrame(void) const { return frame.x; } inline const int getXFrame(void) const { return frame.x; }
inline const int &getYFrame(void) const { return frame.y; } inline const int getYFrame(void) const { return frame.y; }
inline const int &getXClient(void) const { return client.x; } inline const int getXClient(void) const { return client.x; }
inline const int &getYClient(void) const { return client.y; } inline const int getYClient(void) const { return client.y; }
inline const int &getWorkspaceNumber(void) const { return workspace_number; } inline const unsigned int getWorkspaceNumber(void) const { return workspace_number; }
inline const int &getWindowNumber(void) const { return window_number; } inline const int getWindowNumber(void) const { return window_number; }
inline const WinLayer getLayer(void) const { return m_layer; } inline const WinLayer getLayer(void) const { return m_layer; }
inline const unsigned int &getWidth(void) const { return frame.width; } inline const unsigned int getWidth(void) const { return frame.width; }
inline const unsigned int &getHeight(void) const { return frame.height; } inline const unsigned int getHeight(void) const { return frame.height; }
inline const unsigned int &getClientHeight(void) const inline const unsigned int getClientHeight(void) const { return client.height; }
{ return client.height; } inline const unsigned int getClientWidth(void) const { return client.width; }
inline const unsigned int &getClientWidth(void) const inline const unsigned int getTitleHeight(void) const { return frame.title_h; }
{ return client.width; }
inline const unsigned int &getTitleHeight(void) const
{ return frame.title_h; }
inline void setWindowNumber(int n) { window_number = n; } inline void setWindowNumber(int n) { window_number = n; }
inline const timeval& getLastFocusTime() const {return lastFocusTime;} inline const timeval &getLastFocusTime() const {return lastFocusTime;}
bool validateClient(void); bool validateClient(void);
bool setInputFocus(void); bool setInputFocus(void);
@ -232,7 +227,8 @@ private:
timeval lastFocusTime; timeval lastFocusTime;
int focus_mode, window_number, workspace_number; int focus_mode, window_number;
unsigned int workspace_number;
unsigned long current_state; unsigned long current_state;
WinLayer m_layer; WinLayer m_layer;

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Workspace.cc,v 1.13 2002/03/19 14:30:43 fluxgen Exp $ // $Id: Workspace.cc,v 1.14 2002/03/23 15:14:45 fluxgen Exp $
// use GNU extensions // use GNU extensions
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
@ -63,7 +63,7 @@ using namespace std;
using namespace std; using namespace std;
#endif #endif
Workspace::Workspace(BScreen *scrn, int i): Workspace::Workspace(BScreen *scrn, unsigned int i):
screen(scrn), screen(scrn),
lastfocus(0), lastfocus(0),
name(""), name(""),
@ -87,7 +87,7 @@ Workspace::~Workspace() {
} }
const int Workspace::addWindow(FluxboxWindow *w, Bool place) { const int Workspace::addWindow(FluxboxWindow *w, bool place) {
if (! w) if (! w)
return -1; return -1;
@ -100,7 +100,7 @@ const int Workspace::addWindow(FluxboxWindow *w, Bool place) {
stackingList.push_front(w); stackingList.push_front(w);
windowList.push_back(w); windowList.push_back(w);
clientmenu->insert((const char **) w->getTitle()); clientmenu->insert(w->getTitle());
clientmenu->update(); clientmenu->update();
screen->updateNetizenWindowAdd(w->getClientWindow(), id); screen->updateNetizenWindowAdd(w->getClientWindow(), id);
@ -286,11 +286,11 @@ void Workspace::reconfigure(void) {
} }
FluxboxWindow *Workspace::getWindow(int index) { FluxboxWindow *Workspace::getWindow(unsigned int index) {
if ((index >= 0) && (index < windowList.size())) if (index < windowList.size())
return windowList[index]; return windowList[index];
else
return 0; return 0;
} }

View file

@ -39,20 +39,20 @@ class Workspace {
public: public:
typedef std::vector<FluxboxWindow *> Windows; typedef std::vector<FluxboxWindow *> Windows;
Workspace(BScreen *, int = 0); Workspace(BScreen *, unsigned int = 0);
~Workspace(void); ~Workspace(void);
inline BScreen *getScreen(void) { return screen; } inline BScreen *getScreen(void) { return screen; }
inline FluxboxWindow *getLastFocusedWindow(void) { return lastfocus; } inline FluxboxWindow *getLastFocusedWindow(void) { return lastfocus; }
inline Clientmenu *getMenu(void) { return clientmenu; } inline Clientmenu *getMenu(void) { return clientmenu; }
inline const char *getName(void) const { return name.c_str(); } inline const char *getName(void) const { return name.c_str(); }
inline const int &getWorkspaceID(void) const { return id; } inline const unsigned int getWorkspaceID(void) const { return id; }
inline void setLastFocusedWindow(FluxboxWindow *w) { lastfocus = w; } inline void setLastFocusedWindow(FluxboxWindow *w) { lastfocus = w; }
FluxboxWindow *getWindow(int); FluxboxWindow *getWindow(unsigned int id);
inline Windows &getWindowList() { return windowList; } inline Windows &getWindowList() { return windowList; }
bool isCurrent(void); bool isCurrent(void);
bool isLastWindow(FluxboxWindow *); bool isLastWindow(FluxboxWindow *);
const int addWindow(FluxboxWindow *, Bool = False); const int addWindow(FluxboxWindow *, bool = False);
const int removeWindow(FluxboxWindow *); const int removeWindow(FluxboxWindow *);
const int getCount(void); const int getCount(void);
@ -79,7 +79,8 @@ private:
Windows windowList; Windows windowList;
std::string name; std::string name;
int id, cascade_x, cascade_y; unsigned int id;
int cascade_x, cascade_y;
protected: protected: