diff options
-rw-r--r-- | tile.cpp | 71 | ||||
-rw-r--r-- | tile.h | 26 |
2 files changed, 48 insertions, 49 deletions
@@ -727,15 +727,15 @@ TileScreen::restoreTile () void TileScreen::squareTile (CompWindowExtents &border, - XRectangle &workArea, - int count) + const CompRect &workArea, + int count) { int countX = ceil (sqrt (count)); int countY = ceil ((float)count / countX); - int currentX = workArea.x; - int currentY = workArea.y; - int winWidth = workArea.width / countX; - int winHeight = workArea.height / countY; + int currentX = workArea.x (); + int currentY = workArea.y (); + int winWidth = workArea.width () / countX; + int winHeight = workArea.height () / countY; int i_x = 0; int i_y = 0; @@ -757,7 +757,7 @@ TileScreen::squareTile (CompWindowExtents &border, /* Reset currentX back to the workArea start * and move current Y */ - currentX = workArea.x; + currentX = workArea.x (); currentY += winHeight; i_x = 0; i_y++; @@ -773,12 +773,12 @@ TileScreen::squareTile (CompWindowExtents &border, void TileScreen::horizontalTile (CompWindowExtents &border, - XRectangle &workArea, - int count) + const CompRect &workArea, + int count) { - int winWidth = workArea.width; - int winHeight = workArea.height / (count); - int x = workArea.x; + int winWidth = workArea.width (); + int winHeight = workArea.height () / (count); + int x = workArea.x (); int i = 0; foreach (CompWindow *w, screen->windows ()) @@ -789,8 +789,8 @@ TileScreen::horizontalTile (CompWindowExtents &border, continue; tw->placeWin (x + border.left, - workArea.y + border.top + - (i * (winHeight - (border.bottom))), + workArea.y () + border.top + + (i * (winHeight - (border.bottom))), winWidth - (border.left + border.right), winHeight - (border.top + border.bottom)); @@ -800,12 +800,12 @@ TileScreen::horizontalTile (CompWindowExtents &border, void TileScreen::verticalTile (CompWindowExtents &border, - XRectangle &workArea, - int count) + const CompRect &workArea, + int count) { - int winWidth = workArea.width / (count); - int winHeight = workArea.height; - int y = workArea.y; + int winWidth = workArea.width () / count; + int winHeight = workArea.height () ; + int y = workArea.y (); int i = 0; foreach (CompWindow *w, screen->windows ()) @@ -815,8 +815,8 @@ TileScreen::verticalTile (CompWindowExtents &border, if (!tw->tiler) continue; - tw->placeWin (workArea.x + border.left - + (i * (winWidth - (border.right))), + tw->placeWin (workArea.x () + border.left + + (i * (winWidth - (border.right))), y + border.top, winWidth - (border.left + border.right), winHeight - (border.top + border.bottom)); @@ -831,8 +831,8 @@ TileScreen::verticalTile (CompWindowExtents &border, void TileScreen::evenTile (CompWindowExtents &border, - XRectangle &workArea, - int count) + const CompRect &workArea, + int count) { } @@ -842,8 +842,8 @@ TileScreen::evenTile (CompWindowExtents &border, void TileScreen::expandTile (CompWindowExtents &border, - XRectangle &workArea, - int count) + const CompRect &workArea, + int count) { } @@ -854,21 +854,21 @@ TileScreen::expandTile (CompWindowExtents &border, void TileScreen::organicTile (CompWindowExtents &border, - XRectangle &workArea, - int count) + const CompRect &workArea, + int count) { } void TileScreen::cascadeTile (CompWindowExtents &border, - XRectangle &workArea, - int count) + const CompRect &workArea, + int count) { int delta = optionGetCascadeDelta (); - int currentX = workArea.x; - int currentY = workArea.y; - int winWidth = workArea.width - delta * (count -1); - int winHeight = workArea.height - delta * (count -1); + int currentX = workArea.x (); + int currentY = workArea.y (); + int winWidth = workArea.width () - delta * (count -1); + int winHeight = workArea.height () - delta * (count -1); foreach (CompWindow *w, screen->windows ()) { @@ -890,11 +890,10 @@ TileScreen::cascadeTile (CompWindowExtents &border, bool TileScreen::chooseTileModeAndTile () { - int count = 0; - XRectangle workArea; + int count = 0; + const CompRect& workArea = screen->workArea (); CompWindowExtents border; - workArea = screen->workArea (); memset (&border, 0, sizeof (CompWindowExtents)); foreach (CompWindow *w, screen->windows ()) @@ -118,38 +118,38 @@ class TileScreen : void squareTile (CompWindowExtents &border, - XRectangle &workArea, + const CompRect &workArea, int count); void horizontalTile (CompWindowExtents &border, - XRectangle &workArea, - int count); + const CompRect &workArea, + int count); void verticalTile (CompWindowExtents &border, - XRectangle &workArea, - int count); + const CompRect &workArea, + int count); void evenTile (CompWindowExtents &border, - XRectangle &workArea, - int count); + const CompRect &workArea, + int count); void expandTile (CompWindowExtents &border, - XRectangle &workArea, - int count); + const CompRect &workArea, + int count); void organicTile (CompWindowExtents &border, - XRectangle &workArea, - int count); + const CompRect &workArea, + int count); void cascadeTile (CompWindowExtents &border, - XRectangle &workArea, - int count); + const CompRect &workArea, + int count); /* Actions */ |