parameter values for next/prev/right/leftWorkspace

This commit is contained in:
fluxgen 2002-02-20 23:04:51 +00:00
parent 18931280a7
commit f7c88e4da3
2 changed files with 16 additions and 22 deletions

View file

@ -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.26 2002/02/20 22:40:19 fluxgen Exp $
// $Id: Screen.cc,v 1.27 2002/02/20 23:04:51 fluxgen Exp $
// stupid macros needed to access some functions in version 2 of the GNU C
// library
@ -1712,37 +1712,31 @@ void BScreen::hideGeometry(void) {
//-------------- nextWorkspace ---------------
// Goes to the workspace "right" of the current
//--------------------------------------------
void BScreen::nextWorkspace(void) {
if (getCurrentWorkspaceID()+1 > getCount()-1)
changeWorkspaceID(0);
else
changeWorkspaceID(getCurrentWorkspaceID()+1);
void BScreen::nextWorkspace(const int delta) {
changeWorkspaceID( (getCurrentWorkspaceID()+delta) % getCount());
}
//------------- prevWorkspace ----------------
// Goes to the workspace "left" of the current
//--------------------------------------------
void BScreen::prevWorkspace(void) {
if (getCurrentWorkspaceID()-1 < 0)
changeWorkspaceID(getCount()-1);
else
changeWorkspaceID(getCurrentWorkspaceID()-1);
void BScreen::prevWorkspace(const int delta) {
changeWorkspaceID( (getCurrentWorkspaceID()-delta+getCount()) % getCount());
}
//-------------- rightWorkspace ---------------
// Goes to the workspace "right" of the current
//--------------------------------------------
void BScreen::rightWorkspace(void) {
if (getCurrentWorkspaceID()+1 < getCount())
changeWorkspaceID(getCurrentWorkspaceID()+1);
void BScreen::rightWorkspace(const int delta) {
if (getCurrentWorkspaceID()+delta < getCount())
changeWorkspaceID(getCurrentWorkspaceID()+delta);
}
//------------- leftWorkspace ----------------
// Goes to the workspace "left" of the current
//--------------------------------------------
void BScreen::leftWorkspace(void) {
if (getCurrentWorkspaceID() > 0)
changeWorkspaceID(getCurrentWorkspaceID()-1);
void BScreen::leftWorkspace(const int delta) {
if (getCurrentWorkspaceID() >= delta)
changeWorkspaceID(getCurrentWorkspaceID()-delta);
}
#ifdef GNOME

View file

@ -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.19 2002/02/20 22:41:13 fluxgen Exp $
// $Id: Screen.hh,v 1.20 2002/02/20 23:04:35 fluxgen Exp $
#ifndef SCREEN_HH
#define SCREEN_HH
@ -184,10 +184,10 @@ public:
int addWorkspace(void);
int removeLastWorkspace(void);
//scroll workspaces
void nextWorkspace();
void prevWorkspace();
void rightWorkspace();
void leftWorkspace();
void nextWorkspace(const int delta);
void prevWorkspace(const int delta);
void rightWorkspace(const int delta);
void leftWorkspace(const int delta);
void removeWorkspaceNames(void);
void updateWorkspaceNamesAtom(void);