1 // Geometry.h for Openbox
2 // Copyright (c) 2002 - 2002 ben Jansens (ben@orodu.net)
4 // Permission is hereby granted, free of charge, to any person obtaining a
5 // copy of this software and associated documentation files (the "Software"),
6 // to deal in the Software without restriction, including without limitation
7 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 // and/or sell copies of the Software, and to permit persons to whom the
9 // Software is furnished to do so, subject to the following conditions:
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 // DEALINGS IN THE SOFTWARE.
29 Point(const Point &point);
30 Point(const int x, const int y);
32 void setX(const int x);
33 inline int x() const {
37 void setY(const int y);
38 inline int y() const {
47 Size(const Size &size);
48 Size(const int w, const int h);
50 void setW(const int w);
51 inline int w() const {
55 void setH(const int h);
56 inline int h() const {
66 Rect(const Point &origin, const Size &size);
67 Rect(const int x, const int y, const int w, const int h);
69 void setSize(const Size &size);
70 inline const Size &size() const {
71 return const_cast<const Size &>(m_size);
74 void setOrigin(const Point &origin);
75 inline const Point &origin() const {
76 return const_cast<const Point &>(m_origin);
79 void setX(const int x);
80 inline int x() const {
84 void setY(const int y);
85 inline int y() const {
89 void setW(const int w);
90 inline int w() const {
94 void setH(const int h);
95 inline int h() const {
99 bool Intersect(const Rect &r) const;
102 #endif // __geometry_h