]>
Dogcows Code - chaz/openbox/blob - src/Geometry.h
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 {
44 unsigned int m_w
, m_h
;
47 Size(const Size
&size
);
48 Size(const unsigned int w
, const unsigned int h
);
50 void setW(const unsigned int w
);
51 inline unsigned int w() const {
55 void setH(const unsigned int h
);
56 inline unsigned int h() const {
66 Rect(const Point
&origin
, const Size
&size
);
67 Rect(const int x
, const int y
, const unsigned int w
, const unsigned int h
);
69 void setSize(const Size
&size
);
70 void setSize(const unsigned int w
, const unsigned int h
);
71 inline const Size
&size() const {
72 return const_cast<const Size
&>(m_size
);
75 void setOrigin(const Point
&origin
);
76 void setOrigin(const int x
, const int y
);
77 inline const Point
&origin() const {
78 return const_cast<const Point
&>(m_origin
);
81 void setX(const int x
);
82 inline int x() const {
86 void setY(const int y
);
87 inline int y() const {
91 void setW(const unsigned int w
);
92 inline unsigned int w() const {
96 void setH(const unsigned int h
);
97 inline unsigned int h() const {
101 bool Intersect(const Rect
&r
) const;
102 // returns a rect that is this rect increased in size by the passed in amount
103 Rect
Inflate(const unsigned int i
) const;
104 Rect
Inflate(const unsigned int iw
, const unsigned int ih
) const;
105 Rect
Inflate(const Size
&i
) const;
106 // returns a rect that is this rect decreased in size by the passed in amount
107 Rect
Deflate(const unsigned int d
) const;
108 Rect
Deflate(const unsigned int dw
, const unsigned int dh
) const;
109 Rect
Deflate(const Size
&d
) const;
110 // returns a rect that is moved the amount specified
111 Rect
Translate(const int t
) const;
112 Rect
Translate(const int tx
, const int ty
) const;
113 Rect
Translate(const Point
&t
) const;
116 #endif // __geometry_h
This page took 0.036385 seconds and 4 git commands to generate.