diff options
author | fluxgen <fluxgen> | 2003-04-29 08:51:59 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-29 08:51:59 (GMT) |
commit | d9467066a9babcf3c179084592342887272f8d57 (patch) | |
tree | 2c61cd46e5db63a6f58cc175e7d337d7c76a4fcb | |
parent | e76c16bc159274fc8022e9ee2fe7fa383abfe137 (diff) | |
download | fluxbox_pavel-d9467066a9babcf3c179084592342887272f8d57.zip fluxbox_pavel-d9467066a9babcf3c179084592342887272f8d57.tar.bz2 |
FbWindow is a FbDrawable
-rw-r--r-- | src/FbTk/FbWindow.cc | 55 | ||||
-rw-r--r-- | src/FbTk/FbWindow.hh | 27 |
2 files changed, 9 insertions, 73 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index f0ddaad..6b05344 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWindow.cc,v 1.11 2003/04/25 17:32:21 fluxgen Exp $ | 22 | // $Id: FbWindow.cc,v 1.12 2003/04/29 08:51:59 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWindow.hh" | 24 | #include "FbWindow.hh" |
25 | #include "EventManager.hh" | 25 | #include "EventManager.hh" |
@@ -163,59 +163,6 @@ void FbWindow::raise() { | |||
163 | XRaiseWindow(s_display, m_window); | 163 | XRaiseWindow(s_display, m_window); |
164 | } | 164 | } |
165 | 165 | ||
166 | void FbWindow::copyArea(Drawable src, GC gc, | ||
167 | int src_x, int src_y, | ||
168 | int dest_x, int dest_y, | ||
169 | unsigned int width, unsigned int height) { | ||
170 | if (window() == 0 || src == 0 || gc == 0) | ||
171 | return; | ||
172 | XCopyArea(s_display, | ||
173 | src, window(), gc, | ||
174 | src_x, src_y, | ||
175 | dest_x, dest_y, | ||
176 | width, height); | ||
177 | } | ||
178 | |||
179 | void FbWindow::fillRectangle(GC gc, int x, int y, | ||
180 | unsigned int width, unsigned int height) { | ||
181 | if (window() == 0 || gc == 0) | ||
182 | return; | ||
183 | XFillRectangle(s_display, | ||
184 | window(), gc, | ||
185 | x, y, | ||
186 | width, height); | ||
187 | } | ||
188 | |||
189 | void FbWindow::drawRectangle(GC gc, int x, int y, | ||
190 | unsigned int width, unsigned int height) { | ||
191 | if (window() == 0 || gc == 0) | ||
192 | return; | ||
193 | XDrawRectangle(s_display, | ||
194 | window(), gc, | ||
195 | x, y, | ||
196 | width, height); | ||
197 | } | ||
198 | |||
199 | void FbWindow::fillPolygon(GC gc, XPoint *points, int npoints, | ||
200 | int shape, int mode) { | ||
201 | if (window() == 0 || gc == 0 || points == 0 || npoints == 0) | ||
202 | return; | ||
203 | XFillPolygon(s_display, | ||
204 | window(), gc, points, npoints, | ||
205 | shape, mode); | ||
206 | } | ||
207 | |||
208 | void FbWindow::drawLine(GC gc, int start_x, int start_y, | ||
209 | int end_x, int end_y) { | ||
210 | if (window() == 0 || gc == 0) | ||
211 | return; | ||
212 | XDrawLine(s_display, | ||
213 | window(), | ||
214 | gc, | ||
215 | start_x, start_y, | ||
216 | end_x, end_y); | ||
217 | } | ||
218 | |||
219 | int FbWindow::screenNumber() const { | 166 | int FbWindow::screenNumber() const { |
220 | return m_screen_num; | 167 | return m_screen_num; |
221 | } | 168 | } |
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index d8ed7a9..0422c9d 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh | |||
@@ -19,21 +19,21 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWindow.hh,v 1.11 2003/04/25 17:31:38 fluxgen Exp $ | 22 | // $Id: FbWindow.hh,v 1.12 2003/04/29 08:51:27 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef FBTK_FBWINDOW_HH | 24 | #ifndef FBTK_FBWINDOW_HH |
25 | #define FBTK_FBWINDOW_HH | 25 | #define FBTK_FBWINDOW_HH |
26 | 26 | ||
27 | #include "FbDrawable.hh" | ||
28 | |||
27 | #include <X11/Xlib.h> | 29 | #include <X11/Xlib.h> |
28 | 30 | ||
29 | namespace FbTk { | 31 | namespace FbTk { |
30 | 32 | ||
31 | class Color; | 33 | class Color; |
32 | 34 | ||
33 | /** | 35 | /// Wrapper for X window |
34 | Wrapper for X window | 36 | class FbWindow: public FbDrawable { |
35 | */ | ||
36 | class FbWindow { | ||
37 | public: | 37 | public: |
38 | FbWindow(); | 38 | FbWindow(); |
39 | FbWindow(const FbWindow &win_copy); | 39 | FbWindow(const FbWindow &win_copy); |
@@ -59,7 +59,7 @@ public: | |||
59 | void setName(const char *name); | 59 | void setName(const char *name); |
60 | void setEventMask(long mask); | 60 | void setEventMask(long mask); |
61 | /// clear window with background pixmap or color | 61 | /// clear window with background pixmap or color |
62 | void clear(); | 62 | virtual void clear(); |
63 | /// assign a new X window to this | 63 | /// assign a new X window to this |
64 | virtual FbWindow &operator = (Window win); | 64 | virtual FbWindow &operator = (Window win); |
65 | virtual void hide(); | 65 | virtual void hide(); |
@@ -72,21 +72,10 @@ public: | |||
72 | virtual void lower(); | 72 | virtual void lower(); |
73 | virtual void raise(); | 73 | virtual void raise(); |
74 | 74 | ||
75 | void copyArea(Drawable src, GC gc, | ||
76 | int src_x, int src_y, | ||
77 | int dest_x, int dest_y, | ||
78 | unsigned int width, unsigned int height); | ||
79 | void fillRectangle(GC gc, int x, int y, | ||
80 | unsigned int width, unsigned int height); | ||
81 | void drawRectangle(GC gc, int x, int y, | ||
82 | unsigned int width, unsigned int height); | ||
83 | void fillPolygon(GC gc, XPoint *points, int npoints, | ||
84 | int shape, int mode); | ||
85 | void drawLine(GC gc, int start_x, int start_y, | ||
86 | int end_x, int end_y); | ||
87 | 75 | ||
88 | const FbWindow *parent() const { return m_parent; } | 76 | const FbWindow *parent() const { return m_parent; } |
89 | Window window() const { return m_window; } | 77 | inline Window window() const { return m_window; } |
78 | inline Drawable drawable() const { return window(); } | ||
90 | int x() const { return m_x; } | 79 | int x() const { return m_x; } |
91 | int y() const { return m_y; } | 80 | int y() const { return m_y; } |
92 | unsigned int width() const { return m_width; } | 81 | unsigned int width() const { return m_width; } |