aboutsummaryrefslogtreecommitdiff
path: root/src/WinButton.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2007-12-30 15:32:53 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2007-12-30 15:32:53 (GMT)
commit04cd2fd14c6f45f61457e034906f630ce46a76cc (patch)
tree67e2f2f7977c3e8525c2ae7eb30f593f7f440b82 /src/WinButton.cc
parent4cc810b0d39917d37fa08034ac7dd509292c9ce3 (diff)
downloadfluxbox-04cd2fd14c6f45f61457e034906f630ce46a76cc.zip
fluxbox-04cd2fd14c6f45f61457e034906f630ce46a76cc.tar.bz2
removed some unneeded headers
Diffstat (limited to 'src/WinButton.cc')
-rw-r--r--src/WinButton.cc40
1 files changed, 19 insertions, 21 deletions
diff --git a/src/WinButton.cc b/src/WinButton.cc
index cdfb8b5..310cf51 100644
--- a/src/WinButton.cc
+++ b/src/WinButton.cc
@@ -21,14 +21,13 @@
21 21
22/// $Id$ 22/// $Id$
23 23
24#include <X11/Xlib.h>
25 24
26#include "WinButton.hh" 25#include "WinButton.hh"
27#include "App.hh"
28#include "Window.hh" 26#include "Window.hh"
29#include "Screen.hh" 27#include "Screen.hh"
30#include "WinClient.hh" 28#include "WinClient.hh"
31#include "WinButtonTheme.hh" 29#include "WinButtonTheme.hh"
30#include "FbTk/App.hh"
32#include "FbTk/Color.hh" 31#include "FbTk/Color.hh"
33 32
34#ifdef SHAPE 33#ifdef SHAPE
@@ -36,7 +35,7 @@
36#endif // SHAPE 35#endif // SHAPE
37 36
38 37
39WinButton::WinButton(const FluxboxWindow &listen_to, 38WinButton::WinButton(const FluxboxWindow &listen_to,
40 WinButtonTheme &theme, 39 WinButtonTheme &theme,
41 Type buttontype, const FbTk::FbWindow &parent, 40 Type buttontype, const FbTk::FbWindow &parent,
42 int x, int y, 41 int x, int y,
@@ -63,7 +62,7 @@ void WinButton::buttonReleaseEvent(XButtonEvent &event) {
63// when someone else tries to set the background, we may override it 62// when someone else tries to set the background, we may override it
64void WinButton::setBackgroundPixmap(Pixmap pm) { 63void WinButton::setBackgroundPixmap(Pixmap pm) {
65 Pixmap my_pm = getBackgroundPixmap(); 64 Pixmap my_pm = getBackgroundPixmap();
66 65
67 if (my_pm != 0) { 66 if (my_pm != 0) {
68 overrode_bg = true; 67 overrode_bg = true;
69 pm = my_pm; 68 pm = my_pm;
@@ -145,7 +144,7 @@ Pixmap WinButton::getBackgroundPixmap() const {
145 else 144 else
146 return m_theme.closeUnfocusPixmap().pixmap().drawable(); 145 return m_theme.closeUnfocusPixmap().pixmap().drawable();
147 break; 146 break;
148 case SHADE: 147 case SHADE:
149 if (m_listen_to.isShaded()) { 148 if (m_listen_to.isShaded()) {
150 if (focused) 149 if (focused)
151 return m_theme.unshadePixmap().pixmap().drawable(); 150 return m_theme.unshadePixmap().pixmap().drawable();
@@ -245,7 +244,7 @@ void WinButton::drawType() {
245 } 244 }
246 break; 245 break;
247 case CLOSE: 246 case CLOSE:
248 drawLine(gc(), 247 drawLine(gc(),
249 2, 2, 248 2, 2,
250 width() - 3, height() - 3); 249 width() - 3, height() - 3);
251 // I can't figure out why this second one needs a y offset of 1????? 250 // I can't figure out why this second one needs a y offset of 1?????
@@ -259,23 +258,23 @@ void WinButton::drawType() {
259 // XFree86 Version 4.3.0.1 (Debian 4.3.0.dfsg.1-1 20040428170728) 258 // XFree86 Version 4.3.0.1 (Debian 4.3.0.dfsg.1-1 20040428170728)
260 // (X Protocol Version 11, Revision 0, Release 6.6) 259 // (X Protocol Version 11, Revision 0, Release 6.6)
261 260
262 drawLine(gc(), 261 drawLine(gc(),
263 2, height() - 3, 262 2, height() - 3,
264 width() - 3, 2); 263 width() - 3, 2);
265 break; 264 break;
266 case SHADE: 265 case SHADE:
267 266
268 { 267 {
269 int size = width() - 5 - oddW; 268 int size = width() - 5 - oddW;
270 269
271 drawRectangle(gc(), 2, 2, size, 2); 270 drawRectangle(gc(), 2, 2, size, 2);
272 271
273 // draw a one-quarter triangle below the rectangle 272 // draw a one-quarter triangle below the rectangle
274 drawTriangle(gc(), (m_listen_to.isShaded() ? 273 drawTriangle(gc(), (m_listen_to.isShaded() ?
275 FbTk::FbDrawable::DOWN: 274 FbTk::FbDrawable::DOWN:
276 FbTk::FbDrawable::UP), 275 FbTk::FbDrawable::UP),
277 4, 6, 276 4, 6,
278 size-2, size/2 - 1, 277 size-2, size/2 - 1,
279 100); 278 100);
280 279
281 break; 280 break;
@@ -284,16 +283,16 @@ void WinButton::drawType() {
284 if (m_icon_pixmap.drawable()) { 283 if (m_icon_pixmap.drawable()) {
285 284
286 if (m_icon_mask.drawable()) { 285 if (m_icon_mask.drawable()) {
287 XSetClipMask(m_listen_to.fbWindow().display(), 286 XSetClipMask(m_listen_to.fbWindow().display(),
288 gc(), m_icon_mask.drawable()); 287 gc(), m_icon_mask.drawable());
289 XSetClipOrigin(m_listen_to.fbWindow().display(), 288 XSetClipOrigin(m_listen_to.fbWindow().display(),
290 gc(), 2, 2); 289 gc(), 2, 2);
291 } 290 }
292 291
293 copyArea(m_icon_pixmap.drawable(), 292 copyArea(m_icon_pixmap.drawable(),
294 gc(), 293 gc(),
295 0, 0, 294 0, 0,
296 2, 2, 295 2, 2,
297 m_icon_pixmap.width(), m_icon_pixmap.height()); 296 m_icon_pixmap.width(), m_icon_pixmap.height());
298 297
299 if (m_icon_mask.drawable()) 298 if (m_icon_mask.drawable())
@@ -318,22 +317,22 @@ void WinButton::update(FbTk::Subject *subj) {
318 317
319 // update the menu icon 318 // update the menu icon
320 if (m_type == MENUICON && !m_listen_to.empty()) { 319 if (m_type == MENUICON && !m_listen_to.empty()) {
321 320
322 Display* display = m_listen_to.fbWindow().display(); 321 Display* display = m_listen_to.fbWindow().display();
323 int screen = m_listen_to.screen().screenNumber(); 322 int screen = m_listen_to.screen().screenNumber();
324 if (m_listen_to.icon().pixmap().drawable() != None) { 323 if (m_listen_to.icon().pixmap().drawable() != None) {
325 m_icon_pixmap.copy(m_listen_to.icon().pixmap().drawable(), 324 m_icon_pixmap.copy(m_listen_to.icon().pixmap().drawable(),
326 DefaultDepth(display, screen), screen); 325 DefaultDepth(display, screen), screen);
327 m_icon_pixmap.scale(width() - 4, height() - 4); 326 m_icon_pixmap.scale(width() - 4, height() - 4);
328 } else 327 } else
329 m_icon_pixmap.release(); 328 m_icon_pixmap.release();
330 329
331 if (m_listen_to.icon().mask().drawable() != None) { 330 if (m_listen_to.icon().mask().drawable() != None) {
332 m_icon_mask.copy(m_listen_to.icon().mask().drawable(), 0, 0); 331 m_icon_mask.copy(m_listen_to.icon().mask().drawable(), 0, 0);
333 m_icon_mask.scale(width() - 4, height() - 4); 332 m_icon_mask.scale(width() - 4, height() - 4);
334 } else 333 } else
335 m_icon_mask.release(); 334 m_icon_mask.release();
336 335
337 } 336 }
338 337
339 // pressed_pixmap isn't stateful in any current buttons, so no need 338 // pressed_pixmap isn't stateful in any current buttons, so no need
@@ -348,7 +347,6 @@ void WinButton::update(FbTk::Subject *subj) {
348 if (p_pm != None) 347 if (p_pm != None)
349 setPressedPixmap(p_pm); 348 setPressedPixmap(p_pm);
350 } 349 }
351
352 350
353 clear(); 351 clear();
354} 352}