summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-03-11 07:36:24 +0100
committerDanny Baumann <dannybaumann@web.de>2009-03-11 07:36:24 +0100
commitdd47a9460c34a30c4428c2eb815c3b8428da148b (patch)
tree856152c5e3441ac90083ced66ded4b7867b5c8fe
parent2470523f8d9800c8687a24a7c3c701cbed6c326b (diff)
downloadtile-dd47a9460c34a30c4428c2eb815c3b8428da148b.tar.gz
tile-dd47a9460c34a30c4428c2eb815c3b8428da148b.tar.bz2
Track core changes.
-rw-r--r--tile.cpp71
-rw-r--r--tile.h26
2 files changed, 48 insertions, 49 deletions
diff --git a/tile.cpp b/tile.cpp
index e1bc521..acf2e8c 100644
--- a/tile.cpp
+++ b/tile.cpp
@@ -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 ())
diff --git a/tile.h b/tile.h
index 4540626..4e7f642 100644
--- a/tile.h
+++ b/tile.h
@@ -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 */