diff options
author | fluxgen <fluxgen> | 2004-09-11 23:01:34 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-09-11 23:01:34 (GMT) |
commit | 049e40c9eb6e6e8651b171a2a78465398c87f6a1 (patch) | |
tree | 7aef9d57e82336221d6d953617c7a5d53ee95db0 /src/FbTk/FbWindow.cc | |
parent | acd2176355876a7bb7afe9d026f9780a3d1c2737 (diff) | |
download | fluxbox-049e40c9eb6e6e8651b171a2a78465398c87f6a1.zip fluxbox-049e40c9eb6e6e8651b171a2a78465398c87f6a1.tar.bz2 |
Font::drawText takes reference to FbDrawable instead of X Drawable + some code cleaning
Diffstat (limited to 'src/FbTk/FbWindow.cc')
-rw-r--r-- | src/FbTk/FbWindow.cc | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 1656942..2e69339 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.41 2004/09/11 15:52:23 rathnor Exp $ | 22 | // $Id: FbWindow.cc,v 1.42 2004/09/11 22:59:15 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWindow.hh" | 24 | #include "FbWindow.hh" |
25 | #include "FbPixmap.hh" | 25 | #include "FbPixmap.hh" |
@@ -74,7 +74,7 @@ FbWindow::FbWindow(int screen_num, | |||
74 | m_destroy(true), | 74 | m_destroy(true), |
75 | m_buffer_pm(0) { | 75 | m_buffer_pm(0) { |
76 | 76 | ||
77 | create(RootWindow(s_display, screen_num), | 77 | create(RootWindow(display(), screen_num), |
78 | x, y, width, height, eventmask, | 78 | x, y, width, height, eventmask, |
79 | override_redirect, save_unders, depth, class_type); | 79 | override_redirect, save_unders, depth, class_type); |
80 | }; | 80 | }; |
@@ -119,44 +119,44 @@ FbWindow::~FbWindow() { | |||
119 | // so we don't get any dangling eventhandler for this window | 119 | // so we don't get any dangling eventhandler for this window |
120 | FbTk::EventManager::instance()->remove(m_window); | 120 | FbTk::EventManager::instance()->remove(m_window); |
121 | if (m_destroy) | 121 | if (m_destroy) |
122 | XDestroyWindow(s_display, m_window); | 122 | XDestroyWindow(display(), m_window); |
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | 126 | ||
127 | void FbWindow::setBackgroundColor(const FbTk::Color &bg_color) { | 127 | void FbWindow::setBackgroundColor(const FbTk::Color &bg_color) { |
128 | XSetWindowBackground(s_display, m_window, bg_color.pixel()); | 128 | XSetWindowBackground(display(), m_window, bg_color.pixel()); |
129 | } | 129 | } |
130 | 130 | ||
131 | void FbWindow::setBackgroundPixmap(Pixmap bg_pixmap) { | 131 | void FbWindow::setBackgroundPixmap(Pixmap bg_pixmap) { |
132 | XSetWindowBackgroundPixmap(s_display, m_window, bg_pixmap); | 132 | XSetWindowBackgroundPixmap(display(), m_window, bg_pixmap); |
133 | } | 133 | } |
134 | 134 | ||
135 | void FbWindow::setBorderColor(const FbTk::Color &border_color) { | 135 | void FbWindow::setBorderColor(const FbTk::Color &border_color) { |
136 | XSetWindowBorder(s_display, m_window, border_color.pixel()); | 136 | XSetWindowBorder(display(), m_window, border_color.pixel()); |
137 | } | 137 | } |
138 | 138 | ||
139 | void FbWindow::setBorderWidth(unsigned int size) { | 139 | void FbWindow::setBorderWidth(unsigned int size) { |
140 | XSetWindowBorderWidth(s_display, m_window, size); | 140 | XSetWindowBorderWidth(display(), m_window, size); |
141 | m_border_width = size; | 141 | m_border_width = size; |
142 | } | 142 | } |
143 | 143 | ||
144 | void FbWindow::setName(const char *name) { | 144 | void FbWindow::setName(const char *name) { |
145 | XStoreName(s_display, m_window, name); | 145 | XStoreName(display(), m_window, name); |
146 | } | 146 | } |
147 | 147 | ||
148 | void FbWindow::setEventMask(long mask) { | 148 | void FbWindow::setEventMask(long mask) { |
149 | XSelectInput(s_display, m_window, mask); | 149 | XSelectInput(display(), m_window, mask); |
150 | } | 150 | } |
151 | 151 | ||
152 | void FbWindow::clear() { | 152 | void FbWindow::clear() { |
153 | XClearWindow(s_display, m_window); | 153 | XClearWindow(display(), m_window); |
154 | } | 154 | } |
155 | 155 | ||
156 | void FbWindow::clearArea(int x, int y, | 156 | void FbWindow::clearArea(int x, int y, |
157 | unsigned int width, unsigned int height, | 157 | unsigned int width, unsigned int height, |
158 | bool exposures) { | 158 | bool exposures) { |
159 | XClearArea(s_display, window(), x, y, width, height, exposures); | 159 | XClearArea(display(), window(), x, y, width, height, exposures); |
160 | } | 160 | } |
161 | 161 | ||
162 | void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, unsigned int the_height) { | 162 | void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, unsigned int the_height) { |
@@ -255,7 +255,7 @@ FbWindow &FbWindow::operator = (Window win) { | |||
255 | void FbWindow::setNew(Window win) { | 255 | void FbWindow::setNew(Window win) { |
256 | 256 | ||
257 | if (m_window != 0 && m_destroy) | 257 | if (m_window != 0 && m_destroy) |
258 | XDestroyWindow(s_display, m_window); | 258 | XDestroyWindow(display(), m_window); |
259 | 259 | ||
260 | m_window = win; | 260 | m_window = win; |
261 | 261 | ||
@@ -264,7 +264,7 @@ void FbWindow::setNew(Window win) { | |||
264 | XWindowAttributes attr; | 264 | XWindowAttributes attr; |
265 | attr.screen = 0; | 265 | attr.screen = 0; |
266 | //get screen number | 266 | //get screen number |
267 | if (XGetWindowAttributes(s_display, | 267 | if (XGetWindowAttributes(display(), |
268 | m_window, | 268 | m_window, |
269 | &attr) != 0 && attr.screen != 0) { | 269 | &attr) != 0 && attr.screen != 0) { |
270 | m_screen_num = XScreenNumberOfScreen(attr.screen); | 270 | m_screen_num = XScreenNumberOfScreen(attr.screen); |
@@ -288,39 +288,39 @@ void FbWindow::setNew(Window win) { | |||
288 | } | 288 | } |
289 | 289 | ||
290 | void FbWindow::show() { | 290 | void FbWindow::show() { |
291 | XMapWindow(s_display, m_window); | 291 | XMapWindow(display(), m_window); |
292 | } | 292 | } |
293 | 293 | ||
294 | void FbWindow::showSubwindows() { | 294 | void FbWindow::showSubwindows() { |
295 | XMapSubwindows(s_display, m_window); | 295 | XMapSubwindows(display(), m_window); |
296 | } | 296 | } |
297 | 297 | ||
298 | void FbWindow::hide() { | 298 | void FbWindow::hide() { |
299 | XUnmapWindow(s_display, m_window); | 299 | XUnmapWindow(display(), m_window); |
300 | } | 300 | } |
301 | 301 | ||
302 | void FbWindow::lower() { | 302 | void FbWindow::lower() { |
303 | XLowerWindow(s_display, window()); | 303 | XLowerWindow(display(), window()); |
304 | } | 304 | } |
305 | 305 | ||
306 | void FbWindow::raise() { | 306 | void FbWindow::raise() { |
307 | XRaiseWindow(s_display, window()); | 307 | XRaiseWindow(display(), window()); |
308 | } | 308 | } |
309 | 309 | ||
310 | void FbWindow::setInputFocus(int revert_to, int time) { | 310 | void FbWindow::setInputFocus(int revert_to, int time) { |
311 | XSetInputFocus(s_display, window(), revert_to, time); | 311 | XSetInputFocus(display(), window(), revert_to, time); |
312 | } | 312 | } |
313 | 313 | ||
314 | void FbWindow::setCursor(Cursor cur) { | 314 | void FbWindow::setCursor(Cursor cur) { |
315 | XDefineCursor(s_display, window(), cur); | 315 | XDefineCursor(display(), window(), cur); |
316 | } | 316 | } |
317 | 317 | ||
318 | void FbWindow::unsetCursor() { | 318 | void FbWindow::unsetCursor() { |
319 | XUndefineCursor(s_display, window()); | 319 | XUndefineCursor(display(), window()); |
320 | } | 320 | } |
321 | 321 | ||
322 | void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) { | 322 | void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) { |
323 | XReparentWindow(s_display, window(), parent.window(), x, y); | 323 | XReparentWindow(display(), window(), parent.window(), x, y); |
324 | m_parent = &parent; | 324 | m_parent = &parent; |
325 | if (continuing) // we will continue managing this window after reparent | 325 | if (continuing) // we will continue managing this window after reparent |
326 | updateGeometry(); | 326 | updateGeometry(); |
@@ -332,7 +332,7 @@ std::string FbWindow::textProperty(Atom property) const { | |||
332 | int count; | 332 | int count; |
333 | std::string ret; | 333 | std::string ret; |
334 | 334 | ||
335 | if (XGetTextProperty(s_display, window(), &text_prop, property) == 0) | 335 | if (XGetTextProperty(display(), window(), &text_prop, property) == 0) |
336 | return ""; | 336 | return ""; |
337 | 337 | ||
338 | if (text_prop.value == 0 || text_prop.nitems == 0) | 338 | if (text_prop.value == 0 || text_prop.nitems == 0) |
@@ -340,7 +340,7 @@ std::string FbWindow::textProperty(Atom property) const { | |||
340 | 340 | ||
341 | if (text_prop.encoding != XA_STRING) { | 341 | if (text_prop.encoding != XA_STRING) { |
342 | // still returns a "StringList" despite the different name | 342 | // still returns a "StringList" despite the different name |
343 | if (XmbTextPropertyToTextList(s_display, &text_prop, &stringlist, &count) == 0 || count == 0) | 343 | if (XmbTextPropertyToTextList(display(), &text_prop, &stringlist, &count) == 0 || count == 0) |
344 | return ""; | 344 | return ""; |
345 | } else { | 345 | } else { |
346 | if (XTextPropertyToStringList(&text_prop, &stringlist, &count) == 0 || count == 0) | 346 | if (XTextPropertyToStringList(&text_prop, &stringlist, &count) == 0 || count == 0) |
@@ -362,7 +362,7 @@ bool FbWindow::property(Atom property, | |||
362 | unsigned long *nitems_return, | 362 | unsigned long *nitems_return, |
363 | unsigned long *bytes_after_return, | 363 | unsigned long *bytes_after_return, |
364 | unsigned char **prop_return) const { | 364 | unsigned char **prop_return) const { |
365 | if (XGetWindowProperty(s_display, window(), | 365 | if (XGetWindowProperty(display(), window(), |
366 | property, long_offset, long_length, do_delete, | 366 | property, long_offset, long_length, do_delete, |
367 | req_type, actual_type_return, | 367 | req_type, actual_type_return, |
368 | actual_format_return, nitems_return, | 368 | actual_format_return, nitems_return, |
@@ -378,7 +378,7 @@ void FbWindow::changeProperty(Atom property, Atom type, | |||
378 | unsigned char *data, | 378 | unsigned char *data, |
379 | int nelements) { | 379 | int nelements) { |
380 | 380 | ||
381 | XChangeProperty(s_display, m_window, property, type, | 381 | XChangeProperty(display(), m_window, property, type, |
382 | format, mode, | 382 | format, mode, |
383 | data, nelements); | 383 | data, nelements); |
384 | } | 384 | } |
@@ -389,7 +389,7 @@ int FbWindow::screenNumber() const { | |||
389 | 389 | ||
390 | long FbWindow::eventMask() const { | 390 | long FbWindow::eventMask() const { |
391 | XWindowAttributes attrib; | 391 | XWindowAttributes attrib; |
392 | XGetWindowAttributes(s_display, window(), | 392 | XGetWindowAttributes(display(), window(), |
393 | &attrib); | 393 | &attrib); |
394 | return attrib.your_event_mask; | 394 | return attrib.your_event_mask; |
395 | 395 | ||
@@ -405,7 +405,7 @@ void FbWindow::updateGeometry() { | |||
405 | 405 | ||
406 | Window root; | 406 | Window root; |
407 | unsigned int border_width, depth; | 407 | unsigned int border_width, depth; |
408 | XGetGeometry(s_display, m_window, &root, &m_x, &m_y, | 408 | XGetGeometry(display(), m_window, &root, &m_x, &m_y, |
409 | (unsigned int *)&m_width, (unsigned int *)&m_height, | 409 | (unsigned int *)&m_width, (unsigned int *)&m_height, |
410 | &border_width, &depth); | 410 | &border_width, &depth); |
411 | m_depth = depth; | 411 | m_depth = depth; |
@@ -433,7 +433,7 @@ void FbWindow::create(Window parent, int x, int y, | |||
433 | values.save_under = True; | 433 | values.save_under = True; |
434 | } | 434 | } |
435 | 435 | ||
436 | m_window = XCreateWindow(s_display, parent, x, y, width, height, | 436 | m_window = XCreateWindow(display(), parent, x, y, width, height, |
437 | 0, // border width | 437 | 0, // border width |
438 | depth, // depth | 438 | depth, // depth |
439 | class_type, // class | 439 | class_type, // class |