From 05761f6059fb1dc12f6922b06c297b5f10780a05 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 3 Apr 2002 12:08:54 +0000 Subject: Fixed some signed/unsigned warnings --- src/Basemenu.hh | 4 +- src/Clientmenu.cc | 2 +- src/Clientmenu.hh | 2 +- src/Configmenu.cc | 312 +++++++++++++++++---------------------------------- src/Configmenu.hh | 10 +- src/Icon.cc | 7 +- src/Icon.hh | 2 +- src/Rootmenu.cc | 2 +- src/Rootmenu.hh | 2 +- src/Screen.hh | 6 +- src/Slit.cc | 50 +++++---- src/Slit.hh | 6 +- src/Tab.cc | 8 +- src/Timer.cc | 4 +- src/Toolbar.cc | 16 +-- src/Toolbar.hh | 8 +- src/Windowmenu.cc | 8 +- src/Windowmenu.hh | 8 +- src/Workspace.hh | 3 + src/Workspacemenu.cc | 5 +- src/Workspacemenu.hh | 2 +- 21 files changed, 185 insertions(+), 282 deletions(-) diff --git a/src/Basemenu.hh b/src/Basemenu.hh index c5c2b9c..bfd27ca 100644 --- a/src/Basemenu.hh +++ b/src/Basemenu.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Basemenu.hh,v 1.9 2002/03/27 18:47:12 fluxgen Exp $ +// $Id: Basemenu.hh,v 1.10 2002/04/03 12:08:53 fluxgen Exp $ #ifndef BASEMENU_HH #define BASEMENU_HH @@ -129,7 +129,7 @@ protected: inline void setHideTree(bool h) { hide_tree = h; } inline void setMinimumSublevels(int m) { menu.minsub = m; } - virtual void itemSelected(int, int) = 0; + virtual void itemSelected(int button, unsigned int index) = 0; virtual void drawItem(unsigned int index, bool highlight= false, bool clear= false, int x= -1, int y= -1, unsigned int width= 0, unsigned int height= 0); virtual void redrawTitle(); diff --git a/src/Clientmenu.cc b/src/Clientmenu.cc index e873124..68b6173 100644 --- a/src/Clientmenu.cc +++ b/src/Clientmenu.cc @@ -45,7 +45,7 @@ Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()) { } -void Clientmenu::itemSelected(int button, int index) { +void Clientmenu::itemSelected(int button, unsigned int index) { if (button > 2) return; FluxboxWindow *win = wkspc->getWindow(index); diff --git a/src/Clientmenu.hh b/src/Clientmenu.hh index d49f5dd..19a6d57 100644 --- a/src/Clientmenu.hh +++ b/src/Clientmenu.hh @@ -37,7 +37,7 @@ private: protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: diff --git a/src/Configmenu.cc b/src/Configmenu.cc index 9e3edf2..0f8257f 100644 --- a/src/Configmenu.cc +++ b/src/Configmenu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Configmenu.cc,v 1.10 2002/01/11 12:30:22 fluxgen Exp $ +// $Id: Configmenu.cc,v 1.11 2002/04/03 12:08:53 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -169,7 +169,7 @@ Configmenu::~Configmenu(void) { } -void Configmenu::itemSelected(int button, int index) { +void Configmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); @@ -303,7 +303,7 @@ Configmenu::Focusmenu::Focusmenu(Configmenu *cm) : Basemenu(cm->screen) { } -void Configmenu::Focusmenu::itemSelected(int button, int index) { +void Configmenu::Focusmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); @@ -368,83 +368,51 @@ Configmenu::Placementmenu::Placementmenu(Configmenu *cm) : Basemenu(cm->screen) I18n *i18n = I18n::instance(); setLabel(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuWindowPlacement, -#else // !NLS - 0, 0, -#endif // NLS - "Window Placement")); + ConfigmenuSet, ConfigmenuWindowPlacement, + "Window Placement")); setInternalMenu(); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuSmartRows, -#else // !NLS - 0, 0, -#endif // NLS - "Smart Placement (Rows)"), BScreen::ROWSMARTPLACEMENT); + ConfigmenuSet, ConfigmenuSmartRows, + "Smart Placement (Rows)"), BScreen::ROWSMARTPLACEMENT); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuSmartCols, -#else // !NLS - 0, 0, -#endif // NLS - "Smart Placement (Columns)"), BScreen::COLSMARTPLACEMENT); + ConfigmenuSet, ConfigmenuSmartCols, + "Smart Placement (Columns)"), BScreen::COLSMARTPLACEMENT); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuCascade, -#else // !NLS - 0, 0, -#endif // NLS - "Cascade Placement"), BScreen::CASCADEPLACEMENT); + ConfigmenuSet, ConfigmenuCascade, + "Cascade Placement"), BScreen::CASCADEPLACEMENT); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuLeftRight, -#else // !NLS - 0, 0, -#endif // NLS - "Left to Right"), BScreen::LEFTRIGHT); + ConfigmenuSet, ConfigmenuLeftRight, + "Left to Right"), BScreen::LEFTRIGHT); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuRightLeft, -#else // !NLS - 0, 0, -#endif // NLS - "Right to Left"), BScreen::RIGHTLEFT); + ConfigmenuSet, ConfigmenuRightLeft, + "Right to Left"), BScreen::RIGHTLEFT); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuTopBottom, -#else // !NLS - 0, 0, -#endif // NLS - "Top to Bottom"), BScreen::TOPBOTTOM); + ConfigmenuSet, ConfigmenuTopBottom, + "Top to Bottom"), BScreen::TOPBOTTOM); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuBottomTop, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom to Top"), BScreen::BOTTOMTOP); + ConfigmenuSet, ConfigmenuBottomTop, + "Bottom to Top"), BScreen::BOTTOMTOP); update(); switch (configmenu->screen->getPlacementPolicy()) { case BScreen::ROWSMARTPLACEMENT: - setItemSelected(0, True); + setItemSelected(0, true); break; case BScreen::COLSMARTPLACEMENT: - setItemSelected(1, True); + setItemSelected(1, true); break; case BScreen::CASCADEPLACEMENT: - setItemSelected(2, True); + setItemSelected(2, true); break; } - Bool rl = (configmenu->screen->getRowPlacementDirection() == + bool rl = (configmenu->screen->getRowPlacementDirection() == BScreen::LEFTRIGHT), - tb = (configmenu->screen->getColPlacementDirection() == + tb = (configmenu->screen->getColPlacementDirection() == BScreen::TOPBOTTOM); setItemSelected(3, rl); @@ -455,7 +423,7 @@ Configmenu::Placementmenu::Placementmenu(Configmenu *cm) : Basemenu(cm->screen) } -void Configmenu::Placementmenu::itemSelected(int button, int index) { +void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); @@ -464,61 +432,61 @@ void Configmenu::Placementmenu::itemSelected(int button, int index) { case BScreen::ROWSMARTPLACEMENT: configmenu->screen->savePlacementPolicy(item->function()); - setItemSelected(0, True); - setItemSelected(1, False); - setItemSelected(2, False); + setItemSelected(0, true); + setItemSelected(1, false); + setItemSelected(2, false); break; case BScreen::COLSMARTPLACEMENT: configmenu->screen->savePlacementPolicy(item->function()); - setItemSelected(0, False); - setItemSelected(1, True); - setItemSelected(2, False); + setItemSelected(0, false); + setItemSelected(1, true); + setItemSelected(2, false); break; case BScreen::CASCADEPLACEMENT: configmenu->screen->savePlacementPolicy(item->function()); - setItemSelected(0, False); - setItemSelected(1, False); - setItemSelected(2, True); + setItemSelected(0, false); + setItemSelected(1, false); + setItemSelected(2, true); break; case BScreen::LEFTRIGHT: configmenu->screen->saveRowPlacementDirection(BScreen::LEFTRIGHT); - setItemSelected(3, True); - setItemSelected(4, False); + setItemSelected(3, true); + setItemSelected(4, false); break; case BScreen::RIGHTLEFT: configmenu->screen->saveRowPlacementDirection(BScreen::RIGHTLEFT); - setItemSelected(3, False); - setItemSelected(4, True); + setItemSelected(3, false); + setItemSelected(4, true); - break; + break; case BScreen::TOPBOTTOM: - configmenu->screen->saveColPlacementDirection(BScreen::TOPBOTTOM); + configmenu->screen->saveColPlacementDirection(BScreen::TOPBOTTOM); - setItemSelected(5, True); - setItemSelected(6, False); + setItemSelected(5, true); + setItemSelected(6, false); - break; + break; case BScreen::BOTTOMTOP: - configmenu->screen->saveColPlacementDirection(BScreen::BOTTOMTOP); + configmenu->screen->saveColPlacementDirection(BScreen::BOTTOMTOP); - setItemSelected(5, False); - setItemSelected(6, True); + setItemSelected(5, false); + setItemSelected(6, true); - break; + break; } } } @@ -529,141 +497,71 @@ Configmenu::Tabmenu::Tabmenu(Configmenu *cm) : Basemenu(cm->screen) { I18n *i18n = I18n::instance(); setLabel(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuTabPlacement, -#else // !NLS - 0, 0, -#endif // NLS - "Tab Placement")); + ConfigmenuSet, ConfigmenuTabPlacement, + "Tab Placement")); setInternalMenu(); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopLeft, -#else // !NLS - 0, 0, -#endif // NLS - "Top Left"), Tab::PTOP + Tab::ALEFT); + CommonSet, CommonPlacementTopLeft, + "Top Left"), Tab::PTOP + Tab::ALEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopCenter, -#else // !NLS - 0, 0, -#endif // NLS - "Top Center"), Tab::PTOP + Tab::ACENTER); + CommonSet, CommonPlacementTopCenter, + "Top Center"), Tab::PTOP + Tab::ACENTER); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopRight, -#else // !NLS - 0, 0, -#endif // NLS - "Top Right"), Tab::PTOP + Tab::ARIGHT); + CommonSet, CommonPlacementTopRight, + "Top Right"), Tab::PTOP + Tab::ARIGHT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopRelative, -#else // !NLS - 0, 0, -#endif // NLS - "Top Relative"), Tab::PTOP + Tab::ARELATIVE); + CommonSet, CommonPlacementTopRelative, + "Top Relative"), Tab::PTOP + Tab::ARELATIVE); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomLeft, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Left"), Tab::PBOTTOM + Tab::ALEFT); + CommonSet, CommonPlacementBottomLeft, + "Bottom Left"), Tab::PBOTTOM + Tab::ALEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomCenter, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Center"), Tab::PBOTTOM + Tab::ACENTER); + CommonSet, CommonPlacementBottomCenter, + "Bottom Center"), Tab::PBOTTOM + Tab::ACENTER); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomRight, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Right"), Tab::PBOTTOM + Tab::ARIGHT); + CommonSet, CommonPlacementBottomRight, + "Bottom Right"), Tab::PBOTTOM + Tab::ARIGHT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomRelative, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Relative"), Tab::PBOTTOM + Tab::ARELATIVE); + CommonSet, CommonPlacementBottomRelative, + "Bottom Relative"), Tab::PBOTTOM + Tab::ARELATIVE); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementLeftTop, -#else // !NLS - 0, 0, -#endif // NLS - "Left Top"), Tab::PLEFT + Tab::ARIGHT); + CommonSet, CommonPlacementLeftTop, + "Left Top"), Tab::PLEFT + Tab::ARIGHT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementLeftCenter, -#else // !NLS - 0, 0, -#endif // NLS - "Left Center"), Tab::PLEFT + Tab::ACENTER); + CommonSet, CommonPlacementLeftCenter, + "Left Center"), Tab::PLEFT + Tab::ACENTER); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementLeftBottom, -#else // !NLS - 0, 0, -#endif // NLS - "Left Bottom"), Tab::PLEFT + Tab::ALEFT); + CommonSet, CommonPlacementLeftBottom, + "Left Bottom"), Tab::PLEFT + Tab::ALEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementLeftRelative, -#else // !NLS - 0, 0, -#endif // NLS - "Left Relative"), Tab::PLEFT + Tab::ARELATIVE); + CommonSet, CommonPlacementLeftRelative, + "Left Relative"), Tab::PLEFT + Tab::ARELATIVE); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementRightTop, -#else // !NLS - 0, 0, -#endif // NLS - "Right Top"), Tab::PRIGHT + Tab::ARIGHT); + CommonSet, CommonPlacementRightTop, + "Right Top"), Tab::PRIGHT + Tab::ARIGHT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementRightCenter, -#else // !NLS - 0, 0, -#endif // NLS - "Right Center"), Tab::PRIGHT + Tab::ACENTER); + CommonSet, CommonPlacementRightCenter, + "Right Center"), Tab::PRIGHT + Tab::ACENTER); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementRightBottom, -#else // !NLS - 0, 0, -#endif // NLS - "Right Bottom"), Tab::PRIGHT + Tab::ALEFT); + CommonSet, CommonPlacementRightBottom, + "Right Bottom"), Tab::PRIGHT + Tab::ALEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementRightRelative, -#else // !NLS - 0, 0, -#endif // NLS - "Right Relative"), Tab::PRIGHT + Tab::ARELATIVE); + CommonSet, CommonPlacementRightRelative, + "Right Relative"), Tab::PRIGHT + Tab::ARELATIVE); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuTabRotateVertical, -#else // !NLS - 0, 0, -#endif // NLS - "Rotate Vertical Tabs"), CMENU_TAB_ROTATE); + ConfigmenuSet, ConfigmenuTabRotateVertical, + "Rotate Vertical Tabs"), CMENU_TAB_ROTATE); update(); setSelected(); } -void Configmenu::Tabmenu::itemSelected(int button, int index) { +void Configmenu::Tabmenu::itemSelected(int button, unsigned int index) { if (button == 1) { + #ifdef DEBUG fprintf(stderr, "Item(%d)\n", index); + #endif BasemenuItem *item = find(index); switch (item->function()) { @@ -808,40 +706,40 @@ void Configmenu::Tabmenu::itemSelected(int button, int index) { void Configmenu::Tabmenu::setSelected(void) { setItemSelected(0, (configmenu->screen->getTabPlacement() == Tab::PTOP && - configmenu->screen->getTabAlignment() == Tab::ALEFT)); + configmenu->screen->getTabAlignment() == Tab::ALEFT)); setItemSelected(1, (configmenu->screen->getTabPlacement() == Tab::PTOP && - configmenu->screen->getTabAlignment() == Tab::ACENTER)); + configmenu->screen->getTabAlignment() == Tab::ACENTER)); setItemSelected(2, (configmenu->screen->getTabPlacement() == Tab::PTOP && - configmenu->screen->getTabAlignment() == Tab::ARIGHT)); + configmenu->screen->getTabAlignment() == Tab::ARIGHT)); setItemSelected(3, (configmenu->screen->getTabPlacement() == Tab::PTOP && - configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); + configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); setItemSelected(4, (configmenu->screen->getTabPlacement() == Tab::PBOTTOM && - configmenu->screen->getTabAlignment() == Tab::ALEFT)); + configmenu->screen->getTabAlignment() == Tab::ALEFT)); setItemSelected(5, (configmenu->screen->getTabPlacement() == Tab::PBOTTOM && - configmenu->screen->getTabAlignment() == Tab::ACENTER)); + configmenu->screen->getTabAlignment() == Tab::ACENTER)); setItemSelected(6, (configmenu->screen->getTabPlacement() == Tab::PBOTTOM && - configmenu->screen->getTabAlignment() == Tab::ARIGHT)); + configmenu->screen->getTabAlignment() == Tab::ARIGHT)); setItemSelected(7, (configmenu->screen->getTabPlacement() == Tab::PBOTTOM && - configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); + configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); setItemSelected(8, (configmenu->screen->getTabPlacement() == Tab::PLEFT && - configmenu->screen->getTabAlignment() == Tab::ARIGHT)); + configmenu->screen->getTabAlignment() == Tab::ARIGHT)); setItemSelected(9, (configmenu->screen->getTabPlacement() == Tab::PLEFT && - configmenu->screen->getTabAlignment() == Tab::ACENTER)); + configmenu->screen->getTabAlignment() == Tab::ACENTER)); setItemSelected(10, (configmenu->screen->getTabPlacement() == Tab::PLEFT && - configmenu->screen->getTabAlignment() == Tab::ALEFT)); + configmenu->screen->getTabAlignment() == Tab::ALEFT)); setItemSelected(11, (configmenu->screen->getTabPlacement() == Tab::PLEFT && - configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); + configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); setItemSelected(12, (configmenu->screen->getTabPlacement() == Tab::PRIGHT && - configmenu->screen->getTabAlignment() == Tab::ARIGHT)); + configmenu->screen->getTabAlignment() == Tab::ARIGHT)); setItemSelected(13, (configmenu->screen->getTabPlacement() == Tab::PRIGHT && - configmenu->screen->getTabAlignment() == Tab::ACENTER)); + configmenu->screen->getTabAlignment() == Tab::ACENTER)); setItemSelected(14, (configmenu->screen->getTabPlacement() == Tab::PRIGHT && - configmenu->screen->getTabAlignment() == Tab::ALEFT)); + configmenu->screen->getTabAlignment() == Tab::ALEFT)); setItemSelected(15, (configmenu->screen->getTabPlacement() == Tab::PRIGHT && - configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); + configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); setItemEnabled(16, (configmenu->screen->getTabPlacement() == Tab::PLEFT || - configmenu->screen->getTabPlacement() == Tab::PRIGHT)); + configmenu->screen->getTabPlacement() == Tab::PRIGHT)); setItemSelected(16, (configmenu->screen->isTabRotateVertical() && - (configmenu->screen->getTabPlacement() == Tab::PLEFT || - configmenu->screen->getTabPlacement() == Tab::PRIGHT))); + (configmenu->screen->getTabPlacement() == Tab::PLEFT || + configmenu->screen->getTabPlacement() == Tab::PRIGHT))); } diff --git a/src/Configmenu.hh b/src/Configmenu.hh index eceac82..912777f 100644 --- a/src/Configmenu.hh +++ b/src/Configmenu.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Configmenu.hh,v 1.3 2002/02/17 18:57:47 fluxgen Exp $ +// $Id: Configmenu.hh,v 1.4 2002/04/03 12:08:54 fluxgen Exp $ #ifndef CONFIGMENU_HH #define CONFIGMENU_HH @@ -41,7 +41,7 @@ private: Configmenu *configmenu; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: Focusmenu(Configmenu *); @@ -52,7 +52,7 @@ private: Configmenu *configmenu; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: Placementmenu(Configmenu *); @@ -63,7 +63,7 @@ private: Configmenu *configmenu; void setSelected(void); protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: Tabmenu(Configmenu *); @@ -81,7 +81,7 @@ private: protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: diff --git a/src/Icon.cc b/src/Icon.cc index 4a0a7f2..423cb60 100644 --- a/src/Icon.cc +++ b/src/Icon.cc @@ -19,8 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// stupid macros needed to access some functions in version 2 of the GNU C -// library +//Use GNU extensions #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE @@ -50,9 +49,9 @@ Iconmenu::Iconmenu(BScreen *scrn) : Basemenu(scrn) { } -void Iconmenu::itemSelected(int button, int index) { +void Iconmenu::itemSelected(int button, unsigned int index) { if (button == 1) { - if (index >= 0 && index < screen->getIconCount()) { + if (index < screen->getIconCount()) { FluxboxWindow *win = screen->getIcon(index); if (win) diff --git a/src/Icon.hh b/src/Icon.hh index af4f28a..5d37cf1 100644 --- a/src/Icon.hh +++ b/src/Icon.hh @@ -36,7 +36,7 @@ private: protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: diff --git a/src/Rootmenu.cc b/src/Rootmenu.cc index 9e0c83b..46bbe34 100644 --- a/src/Rootmenu.cc +++ b/src/Rootmenu.cc @@ -56,7 +56,7 @@ Rootmenu::Rootmenu(BScreen *scrn) : Basemenu(scrn) { } -void Rootmenu::itemSelected(int button, int index) { +void Rootmenu::itemSelected(int button, unsigned int index) { Fluxbox *fluxbox = Fluxbox::instance(); diff --git a/src/Rootmenu.hh b/src/Rootmenu.hh index 0fabc43..d8b7d95 100644 --- a/src/Rootmenu.hh +++ b/src/Rootmenu.hh @@ -35,7 +35,7 @@ private: protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: diff --git a/src/Screen.hh b/src/Screen.hh index 4109682..c34809d 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -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.26 2002/04/02 23:14:54 fluxgen Exp $ +// $Id: Screen.hh,v 1.27 2002/04/03 12:08:54 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -124,8 +124,8 @@ public: inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->getWorkspaceID(); } typedef std::vector Icons; - inline const unsigned int getCount(void) { return workspacesList.size(); } - inline const int getIconCount(void) { return iconList.size(); } + inline const unsigned int getCount(void) const { return workspacesList.size(); } + inline const unsigned int getIconCount(void) const { return iconList.size(); } inline Icons &getIconList(void) { return iconList; } inline const int getNumberOfWorkspaces(void) { return *resource.workspaces; } diff --git a/src/Slit.cc b/src/Slit.cc index c33d2e0..08370f9 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -722,8 +722,8 @@ Slitmenu::Slitmenu(Slit *sl) : Basemenu(sl->screen) { update(); - if (slit->isOnTop()) setItemSelected(2, True); - if (slit->doAutoHide()) setItemSelected(3, True); + if (slit->isOnTop()) setItemSelected(2, true); + if (slit->doAutoHide()) setItemSelected(3, true); } @@ -738,30 +738,32 @@ Slitmenu::~Slitmenu(void) { } -void Slitmenu::itemSelected(int button, int index) { +void Slitmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); if (! item) return; switch (item->function()) { case 1: // always on top - { - Bool change = ((slit->isOnTop()) ? False : True); - slit->on_top = change; - setItemSelected(2, change); + { + bool change = ((slit->isOnTop()) ? false : true); + slit->on_top = change; + setItemSelected(2, change); - if (slit->isOnTop()) slit->screen->raiseWindows((Window *) 0, 0); - break; - } + if (slit->isOnTop()) + slit->screen->raiseWindows((Window *) 0, 0); + + break; + } case 2: // auto hide - { - Bool change = ((slit->doAutoHide()) ? False : True); - slit->do_auto_hide = change; - setItemSelected(3, change); + { + bool change = ((slit->doAutoHide()) ? false : true); + slit->do_auto_hide = change; + setItemSelected(3, change); - break; - } + break; + } } } } @@ -820,13 +822,13 @@ Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm) : Basemenu(sm->slit->screen update(); if (sm->slit->screen->getSlitDirection() == Slit::HORIZONTAL) - setItemSelected(0, True); + setItemSelected(0, true); else - setItemSelected(1, True); + setItemSelected(1, true); } -void Slitmenu::Directionmenu::itemSelected(int button, int index) { +void Slitmenu::Directionmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); if (! item) return; @@ -834,11 +836,11 @@ void Slitmenu::Directionmenu::itemSelected(int button, int index) { slitmenu->slit->screen->saveSlitDirection(item->function()); if (item->function() == Slit::HORIZONTAL) { - setItemSelected(0, True); - setItemSelected(1, False); + setItemSelected(0, true); + setItemSelected(1, false); } else { - setItemSelected(0, False); - setItemSelected(1, True); + setItemSelected(0, false); + setItemSelected(1, true); } hide(); @@ -931,7 +933,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen } -void Slitmenu::Placementmenu::itemSelected(int button, int index) { +void Slitmenu::Placementmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); if (! item) return; diff --git a/src/Slit.hh b/src/Slit.hh index 211ae76..f4065be 100644 --- a/src/Slit.hh +++ b/src/Slit.hh @@ -55,7 +55,7 @@ private: Slitmenu *slitmenu; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: Directionmenu(Slitmenu *); @@ -66,7 +66,7 @@ private: Slitmenu *slitmenu; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: Placementmenu(Slitmenu *); @@ -101,7 +101,7 @@ private: protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); virtual void internal_hide(void); }; diff --git a/src/Tab.cc b/src/Tab.cc index 88524ad..22925c0 100644 --- a/src/Tab.cc +++ b/src/Tab.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Tab.cc,v 1.20 2002/02/04 06:50:48 fluxgen Exp $ +// $Id: Tab.cc,v 1.21 2002/04/03 12:08:54 fluxgen Exp $ #include "Tab.hh" @@ -284,8 +284,10 @@ void Tab::stick() { win->blackbox_attrib.flags ^= BaseDisplay::ATTRIB_OMNIPRESENT; win->blackbox_attrib.attrib ^= BaseDisplay::ATTRIB_OMNIPRESENT; win->stuck = false; - if (!win->isIconic()) - win->getScreen()->reassociateWindow(win, -1, true); + if (!win->isIconic()) { + BScreen *screen = win->getScreen(); + screen->reassociateWindow(win, screen->getCurrentWorkspace()->getWorkspaceID(), true); + } } else { win->stuck = true; diff --git a/src/Timer.cc b/src/Timer.cc index 47f70de..cf2733e 100644 --- a/src/Timer.cc +++ b/src/Timer.cc @@ -21,11 +21,11 @@ //use GNU extensions #ifndef _GNU_SOURCE -# define _GNU_SOURCE +#define _GNU_SOURCE #endif // _GNU_SOURCE #ifdef HAVE_CONFIG_H -# include "../config.h" +#include "../config.h" #endif // HAVE_CONFIG_H #include "Timer.hh" diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 11fea4d..fc61d55 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.16 2002/03/29 21:47:58 pekdon Exp $ +// $Id: Toolbar.cc,v 1.17 2002/04/03 12:08:54 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -1308,9 +1308,9 @@ Toolbarmenu::Toolbarmenu(Toolbar *tb) : Basemenu(tb->screen) { update(); if (toolbar->isOnTop()) - setItemSelected(1, True); + setItemSelected(1, true); if (toolbar->doAutoHide()) - setItemSelected(2, True); + setItemSelected(2, true); } @@ -1325,7 +1325,7 @@ Toolbarmenu::~Toolbarmenu(void) { } -void Toolbarmenu::itemSelected(int button, int index) { +void Toolbarmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); if (! item) return; @@ -1333,7 +1333,7 @@ void Toolbarmenu::itemSelected(int button, int index) { switch (item->function()) { case 1: // always on top { - Bool change = ((toolbar->isOnTop()) ? False : True); + bool change = ((toolbar->isOnTop()) ? False : True); toolbar->on_top = change; setItemSelected(1, change); @@ -1343,7 +1343,7 @@ void Toolbarmenu::itemSelected(int button, int index) { case 2: // auto hide { - Bool change = ((toolbar->doAutoHide()) ? False : True); + bool change = ((toolbar->doAutoHide()) ? False : True); toolbar->do_auto_hide = change; setItemSelected(2, change); @@ -1450,7 +1450,7 @@ Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) } -void Toolbarmenu::Placementmenu::itemSelected(int button, int index) { +void Toolbarmenu::Placementmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); if (! item) @@ -1494,7 +1494,7 @@ Toolbarmenu::Headmenu::Headmenu(Toolbarmenu *tm) } -void Toolbarmenu::Headmenu::itemSelected(int button, int index) { +void Toolbarmenu::Headmenu::itemSelected(int button, unsigned int index) { if (button == 1) { BasemenuItem *item = find(index); if (! item) diff --git a/src/Toolbar.hh b/src/Toolbar.hh index 1a70a48..1f3ba8f 100644 --- a/src/Toolbar.hh +++ b/src/Toolbar.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.hh,v 1.9 2002/03/19 14:30:42 fluxgen Exp $ +// $Id: Toolbar.hh,v 1.10 2002/04/03 12:08:54 fluxgen Exp $ #ifndef TOOLBAR_HH #define TOOLBAR_HH @@ -42,7 +42,7 @@ private: Toolbarmenu *toolbarmenu; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: Placementmenu(Toolbarmenu *); @@ -56,7 +56,7 @@ private: Toolbarmenu *toolbarmenu; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); }; #endif // XINERAMA @@ -73,7 +73,7 @@ private: protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); virtual void internal_hide(void); public: diff --git a/src/Windowmenu.cc b/src/Windowmenu.cc index c09b2a5..3946e92 100644 --- a/src/Windowmenu.cc +++ b/src/Windowmenu.cc @@ -170,7 +170,7 @@ void Windowmenu::show(void) { } -void Windowmenu::itemSelected(int button, int index) { +void Windowmenu::itemSelected(int button, unsigned int index) { BasemenuItem *item = find(index); switch (item->function()) { @@ -254,7 +254,7 @@ Windowmenu::SendtoWorkspacemenu::SendtoWorkspacemenu(Windowmenu *w) } -void Windowmenu::SendtoWorkspacemenu::itemSelected(int button, int index) { +void Windowmenu::SendtoWorkspacemenu::itemSelected(int button, unsigned int index) { if (button > 2) return; if (index <= windowmenu->screen->getCount()) { @@ -272,7 +272,7 @@ void Windowmenu::SendtoWorkspacemenu::itemSelected(int button, int index) { void Windowmenu::SendtoWorkspacemenu::update(void) { - int i, r = getCount(); + unsigned int i, r = getCount(); if (getCount() != 0) { for (i = 0; i < r; ++i) @@ -291,7 +291,7 @@ void Windowmenu::SendtoWorkspacemenu::show(void) { Basemenu::show(); } -void Windowmenu::SendGroupToWorkspacemenu::itemSelected(int button, int index) { +void Windowmenu::SendGroupToWorkspacemenu::itemSelected(int button, unsigned int index) { if (button > 2) return; diff --git a/src/Windowmenu.hh b/src/Windowmenu.hh index 5e167ed..6ed6852 100644 --- a/src/Windowmenu.hh +++ b/src/Windowmenu.hh @@ -44,7 +44,7 @@ private: Windowmenu *windowmenu; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: SendtoWorkspacemenu(Windowmenu *); @@ -56,9 +56,9 @@ private: class SendGroupToWorkspacemenu : public SendtoWorkspacemenu { protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: - SendGroupToWorkspacemenu(Windowmenu *); + SendGroupToWorkspacemenu(Windowmenu *winmenu); }; @@ -69,7 +69,7 @@ private: friend class SendGroupToWorkspacemenu; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: diff --git a/src/Workspace.hh b/src/Workspace.hh index d53420d..f004fc5 100644 --- a/src/Workspace.hh +++ b/src/Workspace.hh @@ -1,3 +1,6 @@ +// Workspace.hh for Fluxbox +// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) +// // Workspace.hh for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // diff --git a/src/Workspacemenu.cc b/src/Workspacemenu.cc index 05f5072..bedb6c0 100644 --- a/src/Workspacemenu.cc +++ b/src/Workspacemenu.cc @@ -21,8 +21,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// stupid macros needed to access some functions in version 2 of the GNU C -// library +//use GNU extension #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE @@ -71,7 +70,7 @@ Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) { } -void Workspacemenu::itemSelected(int button, int index) { +void Workspacemenu::itemSelected(int button, unsigned int index) { if (button == 1) { if (index == 0) screen->addWorkspace(); diff --git a/src/Workspacemenu.hh b/src/Workspacemenu.hh index 26060c5..28e1cca 100644 --- a/src/Workspacemenu.hh +++ b/src/Workspacemenu.hh @@ -32,7 +32,7 @@ private: BScreen *screen; protected: - virtual void itemSelected(int, int); + virtual void itemSelected(int button, unsigned int index); public: Workspacemenu(BScreen *); -- cgit v0.11.2