aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Basemenu.cc5
-rw-r--r--src/IconBar.cc4
-rw-r--r--src/Screen.cc31
-rw-r--r--src/Screen.hh19
-rw-r--r--src/Toolbar.cc22
-rw-r--r--src/Window.cc26
-rw-r--r--src/Window.hh72
-rw-r--r--src/Workspace.cc16
-rw-r--r--src/Workspace.hh11
9 files changed, 100 insertions, 106 deletions
diff --git a/src/Basemenu.cc b/src/Basemenu.cc
index f78b47e..22e8886 100644
--- a/src/Basemenu.cc
+++ b/src/Basemenu.cc
@@ -22,10 +22,9 @@
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: Basemenu.cc,v 1.14 2002/03/21 10:54:29 fluxgen Exp $ 25// $Id: Basemenu.cc,v 1.15 2002/03/23 15:14:45 fluxgen Exp $
26 26
27// stupid macros needed to access some functions in version 2 of the GNU C 27//use GNU extensions
28// library
29#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
30#define _GNU_SOURCE 29#define _GNU_SOURCE
31#endif // _GNU_SOURCE 30#endif // _GNU_SOURCE
diff --git a/src/IconBar.cc b/src/IconBar.cc
index 392a84c..380b7a5 100644
--- a/src/IconBar.cc
+++ b/src/IconBar.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: IconBar.cc,v 1.10 2002/02/07 14:45:02 fluxgen Exp $ 22// $Id: IconBar.cc,v 1.11 2002/03/23 15:14:45 fluxgen Exp $
23 23
24#include "IconBar.hh" 24#include "IconBar.hh"
25#include "i18n.hh" 25#include "i18n.hh"
@@ -239,7 +239,7 @@ void IconBar::draw(IconBarObj *obj, int width) {
239 239
240 FluxboxWindow *fluxboxwin = obj->getFluxboxWin(); 240 FluxboxWindow *fluxboxwin = obj->getFluxboxWin();
241 Window iconwin = obj->getIconWin(); 241 Window iconwin = obj->getIconWin();
242 char *title = *fluxboxwin->getIconTitle(); 242 const char *title = fluxboxwin->getIconTitle();
243 unsigned int title_len = strlen(title); 243 unsigned int title_len = strlen(title);
244 unsigned int title_text_w; 244 unsigned int title_text_w;
245 245
diff --git a/src/Screen.cc b/src/Screen.cc
index 3c7f4a9..816c869 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.37 2002/03/19 14:30:42 fluxgen Exp $ 25// $Id: Screen.cc,v 1.38 2002/03/23 15:14:45 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -728,11 +728,11 @@ void BScreen::removeIcon(FluxboxWindow *w) {
728} 728}
729 729
730 730
731FluxboxWindow *BScreen::getIcon(int index) { 731FluxboxWindow *BScreen::getIcon(unsigned int index) {
732 if (index >= 0 && index < iconList.size()) 732 if (index < iconList.size())
733 return iconList[index]; 733 return iconList[index];
734 734
735 return (FluxboxWindow *) 0; 735 return 0;
736} 736}
737 737
738 738
@@ -782,8 +782,8 @@ int BScreen::removeLastWorkspace(void) {
782} 782}
783 783
784 784
785void BScreen::changeWorkspaceID(int id) { 785void BScreen::changeWorkspaceID(unsigned int id) {
786 if (! current_workspace || id >= workspacesList.size() || id < 0) 786 if (! current_workspace || id >= workspacesList.size())
787 return; 787 return;
788 788
789 if (id != current_workspace->getWorkspaceID()) { 789 if (id != current_workspace->getWorkspaceID()) {
@@ -819,13 +819,10 @@ void BScreen::changeWorkspaceID(int id) {
819 updateNetizenCurrentWorkspace(); 819 updateNetizenCurrentWorkspace();
820} 820}
821 821
822void BScreen::sendToWorkspace(int id) {
823 BScreen::sendToWorkspace(id, true);
824}
825 822
826void BScreen::sendToWorkspace(int id, bool changeWS) { 823void BScreen::sendToWorkspace(unsigned int id, bool changeWS) {
827 FluxboxWindow *win; 824 FluxboxWindow *win;
828 if (! current_workspace || id >= workspacesList.size() || id < 0) 825 if (! current_workspace || id >= workspacesList.size())
829 return; 826 return;
830 827
831 if (id != current_workspace->getWorkspaceID()) { 828 if (id != current_workspace->getWorkspaceID()) {
@@ -1084,9 +1081,9 @@ void BScreen::addWorkspaceName(char *name) {
1084} 1081}
1085 1082
1086 1083
1087void BScreen::getNameOfWorkspace(int id, char **name) { 1084void BScreen::getNameOfWorkspace(unsigned int workspace, char **name) {
1088 if (id >= 0 && id < workspaceNames.size()) { 1085 if (workspace < workspaceNames.size()) {
1089 const char *wkspc_name = workspaceNames[id].c_str(); 1086 const char *wkspc_name = workspaceNames[workspace].c_str();
1090 1087
1091 if (wkspc_name) 1088 if (wkspc_name)
1092 *name = StringUtil::strdup(wkspc_name); 1089 *name = StringUtil::strdup(wkspc_name);
@@ -1095,10 +1092,10 @@ void BScreen::getNameOfWorkspace(int id, char **name) {
1095} 1092}
1096 1093
1097 1094
1098void BScreen::reassociateWindow(FluxboxWindow *w, int wkspc_id, Bool ignore_sticky) { 1095void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) {
1099 if (! w) return; 1096 if (! w) return;
1100 1097
1101 if (wkspc_id == -1) 1098 if (wkspc_id >= workspaceNames.size())
1102 wkspc_id = current_workspace->getWorkspaceID(); 1099 wkspc_id = current_workspace->getWorkspaceID();
1103 1100
1104 if (w->getWorkspaceNumber() == wkspc_id) 1101 if (w->getWorkspaceNumber() == wkspc_id)
@@ -1807,7 +1804,7 @@ void BScreen::rightWorkspace(const int delta) {
1807// Goes to the workspace "left" of the current 1804// Goes to the workspace "left" of the current
1808//-------------------------------------------- 1805//--------------------------------------------
1809void BScreen::leftWorkspace(const int delta) { 1806void BScreen::leftWorkspace(const int delta) {
1810 if (getCurrentWorkspaceID() >= delta) 1807 if (getCurrentWorkspaceID() >= static_cast<unsigned int>(delta))
1811 changeWorkspaceID(getCurrentWorkspaceID()-delta); 1808 changeWorkspaceID(getCurrentWorkspaceID()-delta);
1812} 1809}
1813 1810
diff --git a/src/Screen.hh b/src/Screen.hh
index 5201eb7..9c3c39b 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -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.hh,v 1.24 2002/03/19 14:30:42 fluxgen Exp $ 25// $Id: Screen.hh,v 1.25 2002/03/23 15:14:45 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -111,7 +111,7 @@ public:
111 111
112 inline Toolbar *getToolbar(void) { return toolbar; } 112 inline Toolbar *getToolbar(void) { return toolbar; }
113 113
114 inline Workspace *getWorkspace(int w) { return workspacesList[w]; } 114 inline Workspace *getWorkspace(unsigned int w) { return ( w < workspacesList.size() ? workspacesList[w] : 0); }
115 inline Workspace *getCurrentWorkspace(void) { return current_workspace; } 115 inline Workspace *getCurrentWorkspace(void) { return current_workspace; }
116 116
117 inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } 117 inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; }
@@ -121,10 +121,10 @@ public:
121 inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); } 121 inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); }
122 inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); } 122 inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); }
123 inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; } 123 inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; }
124 inline const int getCurrentWorkspaceID() { return current_workspace->getWorkspaceID(); } 124 inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->getWorkspaceID(); }
125 125
126 typedef std::vector<FluxboxWindow *> Icons; 126 typedef std::vector<FluxboxWindow *> Icons;
127 inline const int getCount(void) { return workspacesList.size(); } 127 inline const unsigned int getCount(void) { return workspacesList.size(); }
128 inline const int getIconCount(void) { return iconList.size(); } 128 inline const int getIconCount(void) { return iconList.size(); }
129 inline Icons &getIconList(void) { return iconList; } 129 inline Icons &getIconList(void) { return iconList; }
130 130
@@ -191,7 +191,7 @@ public:
191 inline Theme::MenuStyle *getMenuStyle(void) { return &theme->getMenuStyle(); } 191 inline Theme::MenuStyle *getMenuStyle(void) { return &theme->getMenuStyle(); }
192 inline Theme::ToolbarStyle *getToolbarStyle(void) { return &theme->getToolbarStyle(); } 192 inline Theme::ToolbarStyle *getToolbarStyle(void) { return &theme->getToolbarStyle(); }
193 193
194 FluxboxWindow *getIcon(int); 194 FluxboxWindow *getIcon(unsigned int index);
195 195
196 int addWorkspace(void); 196 int addWorkspace(void);
197 int removeLastWorkspace(void); 197 int removeLastWorkspace(void);
@@ -209,12 +209,11 @@ public:
209 void removeNetizen(Window); 209 void removeNetizen(Window);
210 void addIcon(FluxboxWindow *); 210 void addIcon(FluxboxWindow *);
211 void removeIcon(FluxboxWindow *); 211 void removeIcon(FluxboxWindow *);
212 void getNameOfWorkspace(int, char **); 212 void getNameOfWorkspace(unsigned int workspace, char **name);
213 void changeWorkspaceID(int); 213 void changeWorkspaceID(unsigned int);
214 void sendToWorkspace(int); 214 void sendToWorkspace(unsigned int workspace, bool changeworkspace=true);
215 void sendToWorkspace(int, bool);
216 void raiseWindows(Window *, int); 215 void raiseWindows(Window *, int);
217 void reassociateWindow(FluxboxWindow *, int, Bool); 216 void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id, bool ignore_sticky);
218 void prevFocus(int = 0); 217 void prevFocus(int = 0);
219 void nextFocus(int = 0); 218 void nextFocus(int = 0);
220 void raiseFocus(void); 219 void raiseFocus(void);
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 3b9b652..efaefee 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.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: Toolbar.cc,v 1.14 2002/03/19 14:30:42 fluxgen Exp $ 25// $Id: Toolbar.cc,v 1.15 2002/03/23 15:14:45 fluxgen Exp $
26 26
27// stupid macros needed to access some functions in version 2 of the GNU C 27// stupid macros needed to access some functions in version 2 of the GNU C
28// library 28// library
@@ -366,7 +366,7 @@ void Toolbar::reconfigure(void) {
366 366
367 #endif // HAVE_STRFTIME 367 #endif // HAVE_STRFTIME
368 368
369 int i; 369 unsigned int i;
370 unsigned int w = 0; 370 unsigned int w = 0;
371 frame.workspace_label_w = 0; 371 frame.workspace_label_w = 0;
372 372
@@ -727,17 +727,17 @@ void Toolbar::redrawWindowLabel(Bool redraw) {
727 if (foc->getScreen() != screen) 727 if (foc->getScreen() != screen)
728 return; 728 return;
729 729
730 int dx = (frame.bevel_w * 2), dlen = strlen(*foc->getTitle()); 730 int dx = (frame.bevel_w * 2), dlen = strlen(foc->getTitle());
731 unsigned int l; 731 unsigned int l;
732 I18n *i18n = I18n::instance(); 732 I18n *i18n = I18n::instance();
733 733
734 if (i18n->multibyte()) { 734 if (i18n->multibyte()) {
735 XRectangle ink, logical; 735 XRectangle ink, logical;
736 XmbTextExtents(screen->getToolbarStyle()->font.set, *foc->getTitle(), dlen, 736 XmbTextExtents(screen->getToolbarStyle()->font.set, foc->getTitle(), dlen,
737 &ink, &logical); 737 &ink, &logical);
738 l = logical.width; 738 l = logical.width;
739 } else 739 } else
740 l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, *foc->getTitle(), dlen); 740 l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, foc->getTitle(), dlen);
741 741
742 l += (frame.bevel_w * 4); 742 l += (frame.bevel_w * 4);
743 743
@@ -746,10 +746,10 @@ void Toolbar::redrawWindowLabel(Bool redraw) {
746 if (i18n->multibyte()) { 746 if (i18n->multibyte()) {
747 XRectangle ink, logical; 747 XRectangle ink, logical;
748 XmbTextExtents(screen->getToolbarStyle()->font.set, 748 XmbTextExtents(screen->getToolbarStyle()->font.set,
749 *foc->getTitle(), dlen, &ink, &logical); 749 foc->getTitle(), dlen, &ink, &logical);
750 l = logical.width; 750 l = logical.width;
751 } else 751 } else
752 l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, *foc->getTitle(), dlen); 752 l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, foc->getTitle(), dlen);
753 753
754 l += (frame.bevel_w * 4); 754 l += (frame.bevel_w * 4);
755 755
@@ -774,12 +774,12 @@ void Toolbar::redrawWindowLabel(Bool redraw) {
774 screen->getToolbarStyle()->font.set, 774 screen->getToolbarStyle()->font.set,
775 screen->getToolbarStyle()->w_text_gc, dx, 1 - 775 screen->getToolbarStyle()->w_text_gc, dx, 1 -
776 screen->getToolbarStyle()->font.set_extents->max_ink_extent.y, 776 screen->getToolbarStyle()->font.set_extents->max_ink_extent.y,
777 *foc->getTitle(), dlen); 777 foc->getTitle(), dlen);
778 else 778 else
779 XDrawString(display, frame.window_label, 779 XDrawString(display, frame.window_label,
780 screen->getToolbarStyle()->w_text_gc, dx, 780 screen->getToolbarStyle()->w_text_gc, dx,
781 screen->getToolbarStyle()->font.fontstruct->ascent + 1, 781 screen->getToolbarStyle()->font.fontstruct->ascent + 1,
782 *foc->getTitle(), dlen); 782 foc->getTitle(), dlen);
783 } else 783 } else
784 XClearWindow(display, frame.window_label); 784 XClearWindow(display, frame.window_label);
785} 785}
diff --git a/src/Window.cc b/src/Window.cc
index c74f101..bbeb640 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.34 2002/03/19 14:30:42 fluxgen Exp $ 25// $Id: Window.cc,v 1.35 2002/03/23 15:14:45 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -411,9 +411,11 @@ FluxboxWindow::~FluxboxWindow(void) {
411 XUngrabPointer(display, CurrentTime); 411 XUngrabPointer(display, CurrentTime);
412 } 412 }
413 413
414 if (workspace_number != -1 && window_number != -1) 414 if (!iconic) {
415 screen->getWorkspace(workspace_number)->removeWindow(this); 415 Workspace *workspace = screen->getWorkspace(workspace_number);
416 else if (iconic) 416 if (workspace)
417 workspace->removeWindow(this);
418 } else //it's iconic
417 screen->removeIcon(this); 419 screen->removeIcon(this);
418 420
419 if (windowmenu) 421 if (windowmenu)
@@ -2022,9 +2024,9 @@ void FluxboxWindow::iconify(void) {
2022 2024
2023 2025
2024void FluxboxWindow::deiconify(bool reassoc, bool raise) { 2026void FluxboxWindow::deiconify(bool reassoc, bool raise) {
2025 if (iconic || reassoc) 2027 if (iconic || reassoc) {
2026 screen->reassociateWindow(this, -1, false); 2028 screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), false);
2027 else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID()) 2029 } else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID())
2028 return; 2030 return;
2029 2031
2030 setState(NormalState); 2032 setState(NormalState);
@@ -2443,7 +2445,7 @@ void FluxboxWindow::stick(void) {
2443 stuck = false; 2445 stuck = false;
2444 2446
2445 if (! iconic) 2447 if (! iconic)
2446 screen->reassociateWindow(this, -1, true); 2448 screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), true);
2447 2449
2448 2450
2449 } else { 2451 } else {
@@ -2712,8 +2714,8 @@ void FluxboxWindow::restoreAttributes(void) {
2712 current_state = save_state; 2714 current_state = save_state;
2713 } 2715 }
2714 2716
2715 if (((int) blackbox_attrib.workspace != screen->getCurrentWorkspaceID()) && 2717 if (( blackbox_attrib.workspace != screen->getCurrentWorkspaceID()) &&
2716 ((int) blackbox_attrib.workspace < screen->getCount())) { 2718 ( blackbox_attrib.workspace < screen->getCount())) {
2717 screen->reassociateWindow(this, blackbox_attrib.workspace, true); 2719 screen->reassociateWindow(this, blackbox_attrib.workspace, true);
2718 2720
2719 if (current_state == NormalState) current_state = WithdrawnState; 2721 if (current_state == NormalState) current_state = WithdrawnState;
@@ -3675,10 +3677,10 @@ void FluxboxWindow::changeBlackboxHints(BaseDisplay::BlackboxHints *net) {
3675 stick(); 3677 stick();
3676 3678
3677 if ((net->flags & BaseDisplay::ATTRIB_WORKSPACE) && 3679 if ((net->flags & BaseDisplay::ATTRIB_WORKSPACE) &&
3678 (workspace_number != (signed) net->workspace)) { 3680 (workspace_number != net->workspace)) {
3679 screen->reassociateWindow(this, net->workspace, true); 3681 screen->reassociateWindow(this, net->workspace, true);
3680 3682
3681 if (screen->getCurrentWorkspaceID() != (signed) net->workspace) 3683 if (screen->getCurrentWorkspaceID() != net->workspace)
3682 withdraw(); 3684 withdraw();
3683 else 3685 else
3684 deiconify(); 3686 deiconify();
diff --git a/src/Window.hh b/src/Window.hh
index 5bf7232..06e482b 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -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: Window.hh,v 1.13 2002/03/19 00:15:58 fluxgen Exp $ 25// $Id: Window.hh,v 1.14 2002/03/23 15:14:45 fluxgen Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -120,55 +120,50 @@ public:
120 FluxboxWindow(Window, BScreen * = 0); 120 FluxboxWindow(Window, BScreen * = 0);
121 virtual ~FluxboxWindow(void); 121 virtual ~FluxboxWindow(void);
122 122
123 inline const bool isTransient(void) const 123 inline const bool isTransient(void) const { return ((transient) ? true : false); }
124 { return ((transient) ? true : false); } 124 inline const bool hasTransient(void) const { return ((client.transient) ? true : false); }
125 inline const bool hasTransient(void) const
126 { return ((client.transient) ? true : false); }
127 inline const bool isManaged() const { return managed; } 125 inline const bool isManaged() const { return managed; }
128 inline const bool &isFocused(void) const { return focused; } 126 inline const bool isFocused(void) const { return focused; }
129 inline const bool &isVisible(void) const { return visible; } 127 inline const bool isVisible(void) const { return visible; }
130 inline const bool &isIconic(void) const { return iconic; } 128 inline const bool isIconic(void) const { return iconic; }
131 inline const bool &isShaded(void) const { return shaded; } 129 inline const bool isShaded(void) const { return shaded; }
132 inline const bool &isMaximized(void) const { return maximized; } 130 inline const bool isMaximized(void) const { return maximized; }
133 inline const bool &isIconifiable(void) const { return functions.iconify; } 131 inline const bool isIconifiable(void) const { return functions.iconify; }
134 inline const bool &isMaximizable(void) const { return functions.maximize; } 132 inline const bool isMaximizable(void) const { return functions.maximize; }
135 inline const bool &isResizable(void) const { return functions.resize; } 133 inline const bool isResizable(void) const { return functions.resize; }
136 inline const bool &isClosable(void) const { return functions.close; } 134 inline const bool isClosable(void) const { return functions.close; }
137 inline const bool &isStuck(void) const { return stuck; } 135 inline const bool isStuck(void) const { return stuck; }
138 inline const bool &hasTitlebar(void) const { return decorations.titlebar; } 136 inline const bool hasTitlebar(void) const { return decorations.titlebar; }
139 inline const bool hasTab(void) const { return (tab!=0 ? true : false); } 137 inline const bool hasTab(void) const { return (tab!=0 ? true : false); }
140 static void showError(FluxboxWindow::Error error); 138 static void showError(FluxboxWindow::Error error);
141 inline BScreen *getScreen(void) { return screen; } 139 inline BScreen *getScreen(void) const { return screen; }
142 inline Tab *getTab(void) { return tab; } 140 inline Tab *getTab(void) const { return tab; }
143 inline FluxboxWindow *getTransient(void) { return client.transient; } 141 inline FluxboxWindow *getTransient(void) const { return client.transient; }
144 inline FluxboxWindow *getTransientFor(void) { return client.transient_for; } 142 inline FluxboxWindow *getTransientFor(void) const { return client.transient_for; }
145 143
146 inline const Window &getFrameWindow(void) const { return frame.window; } 144 inline const Window &getFrameWindow(void) const { return frame.window; }
147 inline const Window &getClientWindow(void) const { return client.window; } 145 inline const Window &getClientWindow(void) const { return client.window; }
148 146
149 inline Windowmenu *getWindowmenu(void) { return windowmenu; } 147 inline Windowmenu *getWindowmenu(void) { return windowmenu; }
150 148
151 inline char **getTitle(void) { return &client.title; } 149 inline const char *getTitle(void) const { return client.title; }
152 inline char **getIconTitle(void) { return &client.icon_title; } 150 inline const char *getIconTitle(void) const { return client.icon_title; }
153 inline const int &getXFrame(void) const { return frame.x; } 151 inline const int getXFrame(void) const { return frame.x; }
154 inline const int &getYFrame(void) const { return frame.y; } 152 inline const int getYFrame(void) const { return frame.y; }
155 inline const int &getXClient(void) const { return client.x; } 153 inline const int getXClient(void) const { return client.x; }
156 inline const int &getYClient(void) const { return client.y; } 154 inline const int getYClient(void) const { return client.y; }
157 inline const int &getWorkspaceNumber(void) const { return workspace_number; } 155 inline const unsigned int getWorkspaceNumber(void) const { return workspace_number; }
158 inline const int &getWindowNumber(void) const { return window_number; } 156 inline const int getWindowNumber(void) const { return window_number; }
159 inline const WinLayer getLayer(void) const { return m_layer; } 157 inline const WinLayer getLayer(void) const { return m_layer; }
160 inline const unsigned int &getWidth(void) const { return frame.width; } 158 inline const unsigned int getWidth(void) const { return frame.width; }
161 inline const unsigned int &getHeight(void) const { return frame.height; } 159 inline const unsigned int getHeight(void) const { return frame.height; }
162 inline const unsigned int &getClientHeight(void) const 160 inline const unsigned int getClientHeight(void) const { return client.height; }
163 { return client.height; } 161 inline const unsigned int getClientWidth(void) const { return client.width; }
164 inline const unsigned int &getClientWidth(void) const 162 inline const unsigned int getTitleHeight(void) const { return frame.title_h; }
165 { return client.width; }
166 inline const unsigned int &getTitleHeight(void) const
167 { return frame.title_h; }
168 163
169 inline void setWindowNumber(int n) { window_number = n; } 164 inline void setWindowNumber(int n) { window_number = n; }
170 165
171 inline const timeval& getLastFocusTime() const {return lastFocusTime;} 166 inline const timeval &getLastFocusTime() const {return lastFocusTime;}
172 167
173 bool validateClient(void); 168 bool validateClient(void);
174 bool setInputFocus(void); 169 bool setInputFocus(void);
@@ -232,7 +227,8 @@ private:
232 227
233 timeval lastFocusTime; 228 timeval lastFocusTime;
234 229
235 int focus_mode, window_number, workspace_number; 230 int focus_mode, window_number;
231 unsigned int workspace_number;
236 unsigned long current_state; 232 unsigned long current_state;
237 WinLayer m_layer; 233 WinLayer m_layer;
238 234
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 85bd2aa..ff6140d 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.13 2002/03/19 14:30:43 fluxgen Exp $ 25// $Id: Workspace.cc,v 1.14 2002/03/23 15:14:45 fluxgen Exp $
26 26
27// use GNU extensions 27// use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -63,7 +63,7 @@ using namespace std;
63using namespace std; 63using namespace std;
64#endif 64#endif
65 65
66Workspace::Workspace(BScreen *scrn, int i): 66Workspace::Workspace(BScreen *scrn, unsigned int i):
67screen(scrn), 67screen(scrn),
68lastfocus(0), 68lastfocus(0),
69name(""), 69name(""),
@@ -87,7 +87,7 @@ Workspace::~Workspace() {
87} 87}
88 88
89 89
90const int Workspace::addWindow(FluxboxWindow *w, Bool place) { 90const int Workspace::addWindow(FluxboxWindow *w, bool place) {
91 if (! w) 91 if (! w)
92 return -1; 92 return -1;
93 93
@@ -100,7 +100,7 @@ const int Workspace::addWindow(FluxboxWindow *w, Bool place) {
100 stackingList.push_front(w); 100 stackingList.push_front(w);
101 windowList.push_back(w); 101 windowList.push_back(w);
102 102
103 clientmenu->insert((const char **) w->getTitle()); 103 clientmenu->insert(w->getTitle());
104 clientmenu->update(); 104 clientmenu->update();
105 105
106 screen->updateNetizenWindowAdd(w->getClientWindow(), id); 106 screen->updateNetizenWindowAdd(w->getClientWindow(), id);
@@ -286,11 +286,11 @@ void Workspace::reconfigure(void) {
286} 286}
287 287
288 288
289FluxboxWindow *Workspace::getWindow(int index) { 289FluxboxWindow *Workspace::getWindow(unsigned int index) {
290 if ((index >= 0) && (index < windowList.size())) 290 if (index < windowList.size())
291 return windowList[index]; 291 return windowList[index];
292 else 292
293 return 0; 293 return 0;
294} 294}
295 295
296 296
diff --git a/src/Workspace.hh b/src/Workspace.hh
index dd41281..d53420d 100644
--- a/src/Workspace.hh
+++ b/src/Workspace.hh
@@ -39,20 +39,20 @@ class Workspace {
39public: 39public:
40 typedef std::vector<FluxboxWindow *> Windows; 40 typedef std::vector<FluxboxWindow *> Windows;
41 41
42 Workspace(BScreen *, int = 0); 42 Workspace(BScreen *, unsigned int = 0);
43 ~Workspace(void); 43 ~Workspace(void);
44 44
45 inline BScreen *getScreen(void) { return screen; } 45 inline BScreen *getScreen(void) { return screen; }
46 inline FluxboxWindow *getLastFocusedWindow(void) { return lastfocus; } 46 inline FluxboxWindow *getLastFocusedWindow(void) { return lastfocus; }
47 inline Clientmenu *getMenu(void) { return clientmenu; } 47 inline Clientmenu *getMenu(void) { return clientmenu; }
48 inline const char *getName(void) const { return name.c_str(); } 48 inline const char *getName(void) const { return name.c_str(); }
49 inline const int &getWorkspaceID(void) const { return id; } 49 inline const unsigned int getWorkspaceID(void) const { return id; }
50 inline void setLastFocusedWindow(FluxboxWindow *w) { lastfocus = w; } 50 inline void setLastFocusedWindow(FluxboxWindow *w) { lastfocus = w; }
51 FluxboxWindow *getWindow(int); 51 FluxboxWindow *getWindow(unsigned int id);
52 inline Windows &getWindowList() { return windowList; } 52 inline Windows &getWindowList() { return windowList; }
53 bool isCurrent(void); 53 bool isCurrent(void);
54 bool isLastWindow(FluxboxWindow *); 54 bool isLastWindow(FluxboxWindow *);
55 const int addWindow(FluxboxWindow *, Bool = False); 55 const int addWindow(FluxboxWindow *, bool = False);
56 const int removeWindow(FluxboxWindow *); 56 const int removeWindow(FluxboxWindow *);
57 const int getCount(void); 57 const int getCount(void);
58 58
@@ -79,7 +79,8 @@ private:
79 Windows windowList; 79 Windows windowList;
80 80
81 std::string name; 81 std::string name;
82 int id, cascade_x, cascade_y; 82 unsigned int id;
83 int cascade_x, cascade_y;
83 84
84 85
85protected: 86protected: