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 // 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.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 // stupid macros needed to access some functions in version 2 of the GNU C
// library // library
@ -1712,37 +1712,31 @@ void BScreen::hideGeometry(void) {
//-------------- nextWorkspace --------------- //-------------- nextWorkspace ---------------
// Goes to the workspace "right" of the current // Goes to the workspace "right" of the current
//-------------------------------------------- //--------------------------------------------
void BScreen::nextWorkspace(void) { void BScreen::nextWorkspace(const int delta) {
if (getCurrentWorkspaceID()+1 > getCount()-1) changeWorkspaceID( (getCurrentWorkspaceID()+delta) % getCount());
changeWorkspaceID(0);
else
changeWorkspaceID(getCurrentWorkspaceID()+1);
} }
//------------- prevWorkspace ---------------- //------------- prevWorkspace ----------------
// Goes to the workspace "left" of the current // Goes to the workspace "left" of the current
//-------------------------------------------- //--------------------------------------------
void BScreen::prevWorkspace(void) { void BScreen::prevWorkspace(const int delta) {
if (getCurrentWorkspaceID()-1 < 0) changeWorkspaceID( (getCurrentWorkspaceID()-delta+getCount()) % getCount());
changeWorkspaceID(getCount()-1);
else
changeWorkspaceID(getCurrentWorkspaceID()-1);
} }
//-------------- rightWorkspace --------------- //-------------- rightWorkspace ---------------
// Goes to the workspace "right" of the current // Goes to the workspace "right" of the current
//-------------------------------------------- //--------------------------------------------
void BScreen::rightWorkspace(void) { void BScreen::rightWorkspace(const int delta) {
if (getCurrentWorkspaceID()+1 < getCount()) if (getCurrentWorkspaceID()+delta < getCount())
changeWorkspaceID(getCurrentWorkspaceID()+1); changeWorkspaceID(getCurrentWorkspaceID()+delta);
} }
//------------- leftWorkspace ---------------- //------------- leftWorkspace ----------------
// Goes to the workspace "left" of the current // Goes to the workspace "left" of the current
//-------------------------------------------- //--------------------------------------------
void BScreen::leftWorkspace(void) { void BScreen::leftWorkspace(const int delta) {
if (getCurrentWorkspaceID() > 0) if (getCurrentWorkspaceID() >= delta)
changeWorkspaceID(getCurrentWorkspaceID()-1); changeWorkspaceID(getCurrentWorkspaceID()-delta);
} }
#ifdef GNOME #ifdef GNOME

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.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 #ifndef SCREEN_HH
#define SCREEN_HH #define SCREEN_HH
@ -184,10 +184,10 @@ public:
int addWorkspace(void); int addWorkspace(void);
int removeLastWorkspace(void); int removeLastWorkspace(void);
//scroll workspaces //scroll workspaces
void nextWorkspace(); void nextWorkspace(const int delta);
void prevWorkspace(); void prevWorkspace(const int delta);
void rightWorkspace(); void rightWorkspace(const int delta);
void leftWorkspace(); void leftWorkspace(const int delta);
void removeWorkspaceNames(void); void removeWorkspaceNames(void);
void updateWorkspaceNamesAtom(void); void updateWorkspaceNamesAtom(void);