diff options
author | Dennis Kasprzyk <onestone@opencompositing.org> | 2008-08-06 18:47:30 +0200 |
---|---|---|
committer | Dennis Kasprzyk <onestone@opencompositing.org> | 2008-08-06 18:47:30 +0200 |
commit | b818e224418ec8883c076ec3f39e4943e3b09d3a (patch) | |
tree | ebb0308d1e9012a7f6b54d5aca937e0ce99a97f9 /src | |
parent | 84fbdc90df2b2a53dd94cae3d1f51a012ac42c49 (diff) | |
download | zcomp-b818e224418ec8883c076ec3f39e4943e3b09d3a.tar.gz zcomp-b818e224418ec8883c076ec3f39e4943e3b09d3a.tar.bz2 |
Added new CompSize, CompPoint and CompWindow::Geometry classes.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 5 | ||||
-rw-r--r-- | src/point.cpp | 37 | ||||
-rw-r--r-- | src/rect.cpp | 2 | ||||
-rw-r--r-- | src/size.cpp | 37 | ||||
-rw-r--r-- | src/windowgeometry.cpp | 29 |
5 files changed, 108 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index edd53d7..8f687e9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,4 +31,7 @@ compiz_SOURCES = \ match.cpp \ metadata.cpp \ output.cpp \ - rect.cpp + rect.cpp \ + size.cpp \ + point.cpp \ + windowgeometry.cpp diff --git a/src/point.cpp b/src/point.cpp new file mode 100644 index 0000000..5eda20b --- /dev/null +++ b/src/point.cpp @@ -0,0 +1,37 @@ +#include <comppoint.h> + +CompPoint::CompPoint () : + mX (0), + mY (0) +{ +} + +CompPoint::CompPoint (int x, int y) : + mX (x), + mY (y) +{ +} + +int +CompPoint::x () +{ + return mX; +} + +int +CompPoint::y () +{ + return mY; +} + +void +CompPoint::setX (int x) +{ + mX = x; +} + +void +CompPoint::setY (int y) +{ + mY = y; +} diff --git a/src/rect.cpp b/src/rect.cpp index 892e369..8914d4d 100644 --- a/src/rect.cpp +++ b/src/rect.cpp @@ -13,7 +13,7 @@ CompRect::CompRect () CompRect::CompRect (int x1, int x2, int y1, int y2) { - CompRect (); + CompRect::CompRect (); setGeometry (x1, x2, y1, y2); } diff --git a/src/size.cpp b/src/size.cpp new file mode 100644 index 0000000..63cd83a --- /dev/null +++ b/src/size.cpp @@ -0,0 +1,37 @@ +#include <compsize.h> + +CompSize::CompSize () : + mWidth (0), + mHeight (0) +{ +} + +CompSize::CompSize (unsigned int width, unsigned int height) : + mWidth (width), + mHeight (height) +{ +} + +unsigned int +CompSize::width () +{ + return mWidth; +} + +unsigned int +CompSize::height () +{ + return mHeight; +} + +void +CompSize::setWidth (unsigned int width) +{ + mWidth = width; +} + +void +CompSize::setHeight (unsigned int height) +{ + mHeight = height; +} diff --git a/src/windowgeometry.cpp b/src/windowgeometry.cpp new file mode 100644 index 0000000..aa94487 --- /dev/null +++ b/src/windowgeometry.cpp @@ -0,0 +1,29 @@ +#include <compwindow.h> + + +CompWindow::Geometry::Geometry () : + mBorder (0) +{ +} + +CompWindow::Geometry::Geometry (int x, int y, + unsigned int width, + unsigned int height, + unsigned int border) : + mBorder (border) +{ + CompPoint::CompPoint (x,y); + CompSize::CompSize (width, height); +} + +unsigned int +CompWindow::Geometry::border () +{ + return mBorder; +} + +void +CompWindow::Geometry::setBorder (unsigned int border) +{ + mBorder = border; +} |