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 | |
parent | 84fbdc90df2b2a53dd94cae3d1f51a012ac42c49 (diff) | |
download | zcomp-b818e224418ec8883c076ec3f39e4943e3b09d3a.tar.gz zcomp-b818e224418ec8883c076ec3f39e4943e3b09d3a.tar.bz2 |
Added new CompSize, CompPoint and CompWindow::Geometry classes.
-rw-r--r-- | include/comppoint.h | 28 | ||||
-rw-r--r-- | include/compsize.h | 28 | ||||
-rw-r--r-- | include/compwindow.h | 20 | ||||
-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 |
8 files changed, 184 insertions, 2 deletions
diff --git a/include/comppoint.h b/include/comppoint.h new file mode 100644 index 0000000..6cf09d7 --- /dev/null +++ b/include/comppoint.h @@ -0,0 +1,28 @@ +#ifndef _COMPPOINT_H +#define _COMPPOINT_H + +#include <vector> +#include <list> + +class CompPoint { + + public: + CompPoint (); + CompPoint (int, int); + + int x (); + int y (); + + void setX (int); + void setY (int); + + typedef std::vector<CompPoint> vector; + typedef std::vector<CompPoint *> ptrVector; + typedef std::list<CompPoint> list; + typedef std::list<CompPoint *> ptrList; + + private: + int mX, mY; +}; + +#endif diff --git a/include/compsize.h b/include/compsize.h new file mode 100644 index 0000000..45a2509 --- /dev/null +++ b/include/compsize.h @@ -0,0 +1,28 @@ +#ifndef _COMPSIZE_H +#define _COMPSIZE_H + +#include <vector> +#include <list> + +class CompSize { + + public: + CompSize (); + CompSize (unsigned int, unsigned int); + + unsigned int width (); + unsigned int height (); + + void setWidth (unsigned int); + void setHeight (unsigned int); + + typedef std::vector<CompSize> vector; + typedef std::vector<CompSize *> ptrVector; + typedef std::list<CompSize> list; + typedef std::list<CompSize *> ptrList; + + private: + unsigned int mWidth, mHeight; +}; + +#endif diff --git a/include/compwindow.h b/include/compwindow.h index d4d4f32..a2ae65f 100644 --- a/include/compwindow.h +++ b/include/compwindow.h @@ -1,6 +1,10 @@ #ifndef _COMPWINDOW_H #define _COMPWINDOW_H +#include <compiz-core.h> +#include <compsize.h> +#include <comppoint.h> + class CompWindow; class PrivateWindow; @@ -41,6 +45,22 @@ class WindowInterface : public WrapableInterface<CompWindow> { class CompWindow : public WrapableHandler<WindowInterface>, public CompObject { public: + + class Geometry : public CompPoint, public CompSize { + + public: + Geometry (); + Geometry (int, int, unsigned int, unsigned int, unsigned int); + + unsigned int border (); + + void setBorder (unsigned int); + + private: + unsigned int mBorder; + }; + + public: CompWindow *next; CompWindow *prev; 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; +} |