aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Tab.cc234
1 files changed, 117 insertions, 117 deletions
diff --git a/src/Tab.cc b/src/Tab.cc
index 2c80247..1a791c8 100644
--- a/src/Tab.cc
+++ b/src/Tab.cc
@@ -57,14 +57,14 @@ Tab::Tab(FluxboxWindow *win, Tab *prev, Tab *next) {
57 m_win = win; 57 m_win = win;
58 m_display = Fluxbox::instance()->getXDisplay(); 58 m_display = Fluxbox::instance()->getXDisplay();
59 59
60 if ((m_win->screen->getTabPlacement() == PLeft || 60 if ((m_win->getScreen()->getTabPlacement() == PLeft ||
61 m_win->screen->getTabPlacement() == PRight) && 61 m_win->getScreen()->getTabPlacement() == PRight) &&
62 m_win->screen->isTabRotateVertical()) { 62 m_win->getScreen()->isTabRotateVertical()) {
63 m_size_w = m_win->screen->getTabHeight(); 63 m_size_w = m_win->getScreen()->getTabHeight();
64 m_size_h = m_win->screen->getTabWidth(); 64 m_size_h = m_win->getScreen()->getTabWidth();
65 } else { 65 } else {
66 m_size_w = m_win->screen->getTabWidth(); 66 m_size_w = m_win->getScreen()->getTabWidth();
67 m_size_h = m_win->screen->getTabHeight(); 67 m_size_h = m_win->getScreen()->getTabHeight();
68 } 68 }
69 69
70 createTabWindow(); 70 createTabWindow();
@@ -92,20 +92,20 @@ void Tab::createTabWindow() {
92 XSetWindowAttributes attrib; 92 XSetWindowAttributes attrib;
93 attrib.background_pixmap = None; 93 attrib.background_pixmap = None;
94 attrib.background_pixel = attrib.border_pixel = 94 attrib.background_pixel = attrib.border_pixel =
95 m_win->screen->getWindowStyle()->tab.border_color.getPixel(); 95 m_win->getScreen()->getWindowStyle()->tab.border_color.getPixel();
96 attrib.colormap = m_win->screen->getColormap(); 96 attrib.colormap = m_win->getScreen()->getColormap();
97 attrib.override_redirect = True; 97 attrib.override_redirect = True;
98 attrib.event_mask = ButtonPressMask | ButtonReleaseMask | 98 attrib.event_mask = ButtonPressMask | ButtonReleaseMask |
99 ButtonMotionMask | ExposureMask | EnterWindowMask; 99 ButtonMotionMask | ExposureMask | EnterWindowMask;
100 //Notice that m_size_w gets the TOTAL width of tabs INCLUDING borders 100 //Notice that m_size_w gets the TOTAL width of tabs INCLUDING borders
101 m_tabwin = XCreateWindow(m_display, m_win->screen->getRootWindow(), 101 m_tabwin = XCreateWindow(m_display, m_win->getScreen()->getRootWindow(),
102 -30000, -30000, //TODO: So that it wont flicker or 102 -30000, -30000, //TODO: So that it wont flicker or
103 // appear before the window do 103 // appear before the window do
104 m_size_w - m_win->screen->getWindowStyle()->tab.border_width_2x, 104 m_size_w - m_win->getScreen()->getWindowStyle()->tab.border_width_2x,
105 m_size_h - m_win->screen->getWindowStyle()->tab.border_width_2x, 105 m_size_h - m_win->getScreen()->getWindowStyle()->tab.border_width_2x,
106 m_win->screen->getWindowStyle()->tab.border_width, 106 m_win->getScreen()->getWindowStyle()->tab.border_width,
107 m_win->screen->getDepth(), InputOutput, 107 m_win->getScreen()->getDepth(), InputOutput,
108 m_win->screen->getVisual(), attrib_mask, &attrib); 108 m_win->getScreen()->getVisual(), attrib_mask, &attrib);
109 //set grab 109 //set grab
110 XGrabButton(m_display, Button1, Mod1Mask, m_tabwin, True, 110 XGrabButton(m_display, Button1, Mod1Mask, m_tabwin, True,
111 ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, 111 ButtonReleaseMask | ButtonMotionMask, GrabModeAsync,
@@ -128,7 +128,7 @@ void Tab::createTabWindow() {
128//----------------------------------------- 128//-----------------------------------------
129void Tab::focus() { 129void Tab::focus() {
130 130
131 if (m_win->focused) { 131 if (m_win->isFocused()) {
132 if (m_focus_pm) 132 if (m_focus_pm)
133 XSetWindowBackgroundPixmap(m_display, m_tabwin, m_focus_pm); 133 XSetWindowBackgroundPixmap(m_display, m_tabwin, m_focus_pm);
134 else 134 else
@@ -152,7 +152,7 @@ void Tab::raise() {
152 first = getFirst(this); 152 first = getFirst(this);
153 //raise tabs 153 //raise tabs
154 for (; first!=0; first = first->m_next) 154 for (; first!=0; first = first->m_next)
155 m_win->screen->raiseWindows(&first->m_tabwin, 1); 155 m_win->getScreen()->raiseWindows(&first->m_tabwin, 1);
156} 156}
157 157
158//-------------- decorate -------------------- 158//-------------- decorate --------------------
@@ -161,12 +161,12 @@ void Tab::raise() {
161//-------------------------------------------- 161//--------------------------------------------
162void Tab::decorate() { 162void Tab::decorate() {
163 163
164 BImageControl *image_ctrl = m_win->screen->getImageControl(); 164 BImageControl *image_ctrl = m_win->getScreen()->getImageControl();
165 Pixmap tmp = m_focus_pm; 165 Pixmap tmp = m_focus_pm;
166 BTexture *texture = &(m_win->screen->getWindowStyle()->tab.l_focus); 166 BTexture *texture = &(m_win->getScreen()->getWindowStyle()->tab.l_focus);
167 167
168 if (texture->getTexture() & BImage_ParentRelative ) { 168 if (texture->getTexture() & BImage_ParentRelative ) {
169 BTexture *pt = &(m_win->screen->getWindowStyle()->tab.t_focus); 169 BTexture *pt = &(m_win->getScreen()->getWindowStyle()->tab.t_focus);
170 if (pt->getTexture() == (BImage_Flat | BImage_Solid)) { 170 if (pt->getTexture() == (BImage_Flat | BImage_Solid)) {
171 m_focus_pm = None; 171 m_focus_pm = None;
172 m_focus_pixel = pt->getColor()->getPixel(); 172 m_focus_pixel = pt->getColor()->getPixel();
@@ -186,10 +186,10 @@ void Tab::decorate() {
186 } 186 }
187 187
188 tmp = m_unfocus_pm; 188 tmp = m_unfocus_pm;
189 texture = &(m_win->screen->getWindowStyle()->tab.l_unfocus); 189 texture = &(m_win->getScreen()->getWindowStyle()->tab.l_unfocus);
190 190
191 if (texture->getTexture() & BImage_ParentRelative ) { 191 if (texture->getTexture() & BImage_ParentRelative ) {
192 BTexture *pt = &(m_win->screen->getWindowStyle()->tab.t_unfocus); 192 BTexture *pt = &(m_win->getScreen()->getWindowStyle()->tab.t_unfocus);
193 if (pt->getTexture() == (BImage_Flat | BImage_Solid)) { 193 if (pt->getTexture() == (BImage_Flat | BImage_Solid)) {
194 m_unfocus_pm = None; 194 m_unfocus_pm = None;
195 m_unfocus_pixel = pt->getColor()->getPixel(); 195 m_unfocus_pixel = pt->getColor()->getPixel();
@@ -208,9 +208,9 @@ void Tab::decorate() {
208 if (tmp) image_ctrl->removeImage(tmp); 208 if (tmp) image_ctrl->removeImage(tmp);
209 209
210 XSetWindowBorderWidth(m_display, m_tabwin, 210 XSetWindowBorderWidth(m_display, m_tabwin,
211 m_win->screen->getWindowStyle()->tab.border_width); 211 m_win->getScreen()->getWindowStyle()->tab.border_width);
212 XSetWindowBorder(m_display, m_tabwin, 212 XSetWindowBorder(m_display, m_tabwin,
213 m_win->screen->getWindowStyle()->tab.border_color.getPixel()); 213 m_win->getScreen()->getWindowStyle()->tab.border_color.getPixel());
214} 214}
215 215
216 216
@@ -251,12 +251,12 @@ void Tab::stick() {
251 //now do stick for all windows in the list 251 //now do stick for all windows in the list
252 for (; first!=0; first = first->m_next) { 252 for (; first!=0; first = first->m_next) {
253 FluxboxWindow *win = first->m_win; //just for convenient 253 FluxboxWindow *win = first->m_win; //just for convenient
254 if (win->stuck) { 254 if (win->isStuck()) {
255 win->blackbox_attrib.flags ^= AttribOmnipresent; 255 win->blackbox_attrib.flags ^= AttribOmnipresent;
256 win->blackbox_attrib.attrib ^= AttribOmnipresent; 256 win->blackbox_attrib.attrib ^= AttribOmnipresent;
257 win->stuck = false; 257 win->stuck = false;
258 if (!win->iconic) 258 if (!win->iconic)
259 win->screen->reassociateWindow(win, -1, true); 259 win->getScreen()->reassociateWindow(win, -1, true);
260 260
261 } else { 261 } else {
262 win->stuck = true; 262 win->stuck = true;
@@ -284,7 +284,7 @@ void Tab::resize() {
284 } 284 }
285 285
286 // need to resize tabs if in relative mode 286 // need to resize tabs if in relative mode
287 if (m_win->screen->getTabAlignment() == ARelative) { 287 if (m_win->getScreen()->getTabAlignment() == ARelative) {
288 calcIncrease(); 288 calcIncrease();
289 setPosition(); 289 setPosition();
290 } 290 }
@@ -300,13 +300,13 @@ void Tab::shade() {
300 first->m_win->shade(); 300 first->m_win->shade();
301 } 301 }
302 302
303 if (m_win->screen->getTabPlacement() == PLeft || 303 if (m_win->getScreen()->getTabPlacement() == PLeft ||
304 m_win->screen->getTabPlacement() == PRight) { 304 m_win->getScreen()->getTabPlacement() == PRight) {
305 resizeGroup(); 305 resizeGroup();
306 calcIncrease(); 306 calcIncrease();
307 } 307 }
308 308
309 if (!(m_win->screen->getTabPlacement() == PTop)) 309 if (!(m_win->getScreen()->getTabPlacement() == PTop))
310 setPosition(); 310 setPosition();
311} 311}
312 312
@@ -319,40 +319,40 @@ void Tab::shade() {
319void Tab::draw(bool pressed) { 319void Tab::draw(bool pressed) {
320 unsigned int tabtext_w; 320 unsigned int tabtext_w;
321 321
322 GC gc = ((m_win->focused) ? m_win->screen->getWindowStyle()->tab.l_text_focus_gc : 322 GC gc = ((m_win->focused) ? m_win->getScreen()->getWindowStyle()->tab.l_text_focus_gc :
323 m_win->screen->getWindowStyle()->tab.l_text_unfocus_gc); 323 m_win->getScreen()->getWindowStyle()->tab.l_text_unfocus_gc);
324 324
325 // Different routines for drawing rotated text 325 // Different routines for drawing rotated text
326 if ((m_win->screen->getTabPlacement() == PLeft || 326 if ((m_win->getScreen()->getTabPlacement() == PLeft ||
327 m_win->screen->getTabPlacement() == PRight) && 327 m_win->getScreen()->getTabPlacement() == PRight) &&
328 (!m_win->isShaded() && m_win->screen->isTabRotateVertical())) { 328 (!m_win->isShaded() && m_win->getScreen()->isTabRotateVertical())) {
329 329
330 tabtext_w = Misc::XRotTextWidth(m_win->screen->getWindowStyle()->tab.rot_font, 330 tabtext_w = Misc::XRotTextWidth(m_win->getScreen()->getWindowStyle()->tab.rot_font,
331 m_win->client.title, m_win->client.title_len); 331 m_win->client.title, m_win->client.title_len);
332 tabtext_w += (m_win->frame.bevel_w * 4); 332 tabtext_w += (m_win->frame.bevel_w * 4);
333 333
334 Misc::DrawRotString(m_display, m_tabwin, gc, 334 Misc::DrawRotString(m_display, m_tabwin, gc,
335 m_win->screen->getWindowStyle()->tab.rot_font, 335 m_win->getScreen()->getWindowStyle()->tab.rot_font,
336 m_win->screen->getWindowStyle()->tab.font.justify, 336 m_win->getScreen()->getWindowStyle()->tab.font.justify,
337 tabtext_w, m_size_w, m_size_h, 337 tabtext_w, m_size_w, m_size_h,
338 m_win->frame.bevel_w, m_win->client.title); 338 m_win->frame.bevel_w, m_win->client.title);
339 339
340 } else { 340 } else {
341 if (I18n::instance()->multibyte()) { // TODO: maybe move this out from here? 341 if (I18n::instance()->multibyte()) { // TODO: maybe move this out from here?
342 XRectangle ink, logical; 342 XRectangle ink, logical;
343 XmbTextExtents(m_win->screen->getWindowStyle()->tab.font.set, 343 XmbTextExtents(m_win->getScreen()->getWindowStyle()->tab.font.set,
344 m_win->client.title, m_win->client.title_len, 344 m_win->client.title, m_win->client.title_len,
345 &ink, &logical); 345 &ink, &logical);
346 tabtext_w = logical.width; 346 tabtext_w = logical.width;
347 } else { 347 } else {
348 tabtext_w = XTextWidth( 348 tabtext_w = XTextWidth(
349 m_win->screen->getWindowStyle()->tab.font.fontstruct, 349 m_win->getScreen()->getWindowStyle()->tab.font.fontstruct,
350 m_win->client.title, m_win->client.title_len); 350 m_win->client.title, m_win->client.title_len);
351 } 351 }
352 tabtext_w += (m_win->frame.bevel_w * 4); 352 tabtext_w += (m_win->frame.bevel_w * 4);
353 353
354 Misc::DrawString(m_display, m_tabwin, gc, 354 Misc::DrawString(m_display, m_tabwin, gc,
355 &m_win->screen->getWindowStyle()->tab.font, 355 &m_win->getScreen()->getWindowStyle()->tab.font,
356 tabtext_w, m_size_w, 356 tabtext_w, m_size_w,
357 m_win->frame.bevel_w, m_win->client.title); 357 m_win->frame.bevel_w, m_win->client.title);
358 } 358 }
@@ -378,31 +378,31 @@ void Tab::setPosition() {
378 //posible movement to a static member function 378 //posible movement to a static member function
379 379
380 //Tab placement 380 //Tab placement
381 if (m_win->screen->getTabPlacement() == PTop) { 381 if (m_win->getScreen()->getTabPlacement() == PTop) {
382 pos_y = m_win->frame.y - m_size_h; 382 pos_y = m_win->frame.y - m_size_h;
383 383
384 } else if (m_win->screen->getTabPlacement() == PBottom || 384 } else if (m_win->getScreen()->getTabPlacement() == PBottom ||
385 m_win->isShaded()) { 385 m_win->isShaded()) {
386 if (m_win->isShaded()) 386 if (m_win->isShaded())
387 pos_y = m_win->frame.y + m_win->getTitleHeight() + 387 pos_y = m_win->frame.y + m_win->getTitleHeight() +
388 m_win->screen->getBorderWidth2x(); 388 m_win->getScreen()->getBorderWidth2x();
389 else 389 else
390 pos_y = m_win->frame.y + m_win->getHeight() + 390 pos_y = m_win->frame.y + m_win->getHeight() +
391 m_win->screen->getBorderWidth2x(); 391 m_win->getScreen()->getBorderWidth2x();
392 392
393 } else if (m_win->screen->getTabPlacement() == PLeft) { 393 } else if (m_win->getScreen()->getTabPlacement() == PLeft) {
394 pos_x = m_win->frame.x - m_size_w; 394 pos_x = m_win->frame.x - m_size_w;
395 395
396 } else if (m_win->screen->getTabPlacement() == PRight) { 396 } else if (m_win->getScreen()->getTabPlacement() == PRight) {
397 pos_x = m_win->frame.x + m_win->frame.width + 397 pos_x = m_win->frame.x + m_win->frame.width +
398 m_win->screen->getBorderWidth2x(); 398 m_win->getScreen()->getBorderWidth2x();
399 } 399 }
400 400
401 //Tab alignment 401 //Tab alignment
402 if (m_win->screen->getTabPlacement() == PTop || 402 if (m_win->getScreen()->getTabPlacement() == PTop ||
403 m_win->screen->getTabPlacement() == PBottom || 403 m_win->getScreen()->getTabPlacement() == PBottom ||
404 m_win->isShaded()) { 404 m_win->isShaded()) {
405 switch(m_win->screen->getTabAlignment()) { 405 switch(m_win->getScreen()->getTabAlignment()) {
406 case ARelative: 406 case ARelative:
407 case ALeft: 407 case ALeft:
408 pos_x = m_win->frame.x; 408 pos_x = m_win->frame.x;
@@ -412,14 +412,14 @@ void Tab::setPosition() {
412 break; 412 break;
413 case ARight: 413 case ARight:
414 pos_x = m_win->frame.x + m_win->frame.width + 414 pos_x = m_win->frame.x + m_win->frame.width +
415 m_win->screen->getBorderWidth2x() - m_size_w; 415 m_win->getScreen()->getBorderWidth2x() - m_size_w;
416 break; 416 break;
417 } 417 }
418 } else { //PLeft | PRight 418 } else { //PLeft | PRight
419 switch(m_win->screen->getTabAlignment()) { 419 switch(m_win->getScreen()->getTabAlignment()) {
420 case ALeft: 420 case ALeft:
421 pos_y = m_win->frame.y - m_size_h + m_win->frame.height + 421 pos_y = m_win->frame.y - m_size_h + m_win->frame.height +
422 m_win->screen->getBorderWidth2x(); 422 m_win->getScreen()->getBorderWidth2x();
423 break; 423 break;
424 case ACenter: 424 case ACenter:
425 pos_y = calcCenterYPos(); 425 pos_y = calcCenterYPos();
@@ -461,12 +461,12 @@ void Tab::calcIncrease(void) {
461 int inc_x = 0, inc_y = 0; 461 int inc_x = 0, inc_y = 0;
462 unsigned int tabs = 0, i = 0; 462 unsigned int tabs = 0, i = 0;
463 463
464 if (m_win->screen->getTabPlacement() == PTop || 464 if (m_win->getScreen()->getTabPlacement() == PTop ||
465 m_win->screen->getTabPlacement() == PBottom || 465 m_win->getScreen()->getTabPlacement() == PBottom ||
466 m_win->isShaded()) { 466 m_win->isShaded()) {
467 inc_y = 0; 467 inc_y = 0;
468 468
469 switch(m_win->screen->getTabAlignment()) { 469 switch(m_win->getScreen()->getTabAlignment()) {
470 case ALeft: 470 case ALeft:
471 inc_x = m_size_w; 471 inc_x = m_size_w;
472 break; 472 break;
@@ -480,11 +480,11 @@ void Tab::calcIncrease(void) {
480 inc_x = calcRelativeWidth(); 480 inc_x = calcRelativeWidth();
481 break; 481 break;
482 } 482 }
483 } else if (m_win->screen->getTabPlacement() == PLeft || 483 } else if (m_win->getScreen()->getTabPlacement() == PLeft ||
484 m_win->screen->getTabPlacement() == PRight) { 484 m_win->getScreen()->getTabPlacement() == PRight) {
485 inc_x = 0; 485 inc_x = 0;
486 486
487 switch(m_win->screen->getTabAlignment()) { 487 switch(m_win->getScreen()->getTabAlignment()) {
488 case ALeft: 488 case ALeft:
489 inc_y = -m_size_h; 489 inc_y = -m_size_h;
490 break; 490 break;
@@ -505,14 +505,14 @@ void Tab::calcIncrease(void) {
505 for (first = getFirst(this); first!=0; first = first->m_next, i++){ 505 for (first = getFirst(this); first!=0; first = first->m_next, i++){
506 506
507 //TODO: move this out from here? 507 //TODO: move this out from here?
508 if ((m_win->screen->getTabPlacement() == PTop || 508 if ((m_win->getScreen()->getTabPlacement() == PTop ||
509 m_win->screen->getTabPlacement() == PBottom || 509 m_win->getScreen()->getTabPlacement() == PBottom ||
510 m_win->isShaded()) && 510 m_win->isShaded()) &&
511 m_win->screen->getTabAlignment() == ARelative) { 511 m_win->getScreen()->getTabAlignment() == ARelative) {
512 if (!((m_win->frame.width + 512 if (!((m_win->frame.width +
513 m_win->screen->getBorderWidth2x()) % tabs) || 513 m_win->getScreen()->getBorderWidth2x()) % tabs) ||
514 i >= ((m_win->frame.width + 514 i >= ((m_win->frame.width +
515 m_win->screen->getBorderWidth2x()) % tabs)) { 515 m_win->getScreen()->getBorderWidth2x()) % tabs)) {
516 first->setTabWidth(inc_x); 516 first->setTabWidth(inc_x);
517 first->m_inc_x = inc_x; 517 first->m_inc_x = inc_x;
518 } else { // adding 1 extra pixel to get tabs like win width 518 } else { // adding 1 extra pixel to get tabs like win width
@@ -520,11 +520,11 @@ void Tab::calcIncrease(void) {
520 first->m_inc_x = inc_x + 1; 520 first->m_inc_x = inc_x + 1;
521 } 521 }
522 first->m_inc_y = inc_y; 522 first->m_inc_y = inc_y;
523 } else if (m_win->screen->getTabAlignment() == ARelative) { 523 } else if (m_win->getScreen()->getTabAlignment() == ARelative) {
524 if (!((m_win->frame.height + 524 if (!((m_win->frame.height +
525 m_win->screen->getBorderWidth2x()) % tabs) || 525 m_win->getScreen()->getBorderWidth2x()) % tabs) ||
526 i >= ((m_win->frame.height + 526 i >= ((m_win->frame.height +
527 m_win->screen->getBorderWidth2x()) % tabs)) { 527 m_win->getScreen()->getBorderWidth2x()) % tabs)) {
528 528
529 first->setTabHeight(inc_y); 529 first->setTabHeight(inc_y);
530 first->m_inc_y = inc_y; 530 first->m_inc_y = inc_y;
@@ -567,8 +567,8 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
567 m_moving = false; 567 m_moving = false;
568 568
569 //erase tabmoving rectangle 569 //erase tabmoving rectangle
570 XDrawRectangle(m_display, m_win->screen->getRootWindow(), 570 XDrawRectangle(m_display, m_win->getScreen()->getRootWindow(),
571 m_win->screen->getOpGC(), 571 m_win->getScreen()->getOpGC(),
572 m_move_x, m_move_y, 572 m_move_x, m_move_y,
573 m_size_w, m_size_h); 573 m_size_w, m_size_h);
574 574
@@ -580,8 +580,8 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
580 int dest_x = 0, dest_y = 0; 580 int dest_x = 0, dest_y = 0;
581 581
582 //find window on coordinates of buttonReleaseEvent 582 //find window on coordinates of buttonReleaseEvent
583 if (XTranslateCoordinates(m_display, m_win->screen->getRootWindow(), 583 if (XTranslateCoordinates(m_display, m_win->getScreen()->getRootWindow(),
584 m_win->screen->getRootWindow(), 584 m_win->getScreen()->getRootWindow(),
585 be->x_root, be->y_root, &dest_x, &dest_y, &child)) { 585 be->x_root, be->y_root, &dest_x, &dest_y, &child)) {
586 586
587 Tab *tab = 0; 587 Tab *tab = 0;
@@ -600,11 +600,11 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
600 disconnect(); 600 disconnect();
601 601
602 // (ab)using dest_x and dest_y 602 // (ab)using dest_x and dest_y
603 switch(m_win->screen->getTabPlacement()) { 603 switch(m_win->getScreen()->getTabPlacement()) {
604 case PTop: 604 case PTop:
605 dest_x = be->x_root; 605 dest_x = be->x_root;
606 dest_y = be->y_root; 606 dest_y = be->y_root;
607 switch(m_win->screen->getTabAlignment()) { 607 switch(m_win->getScreen()->getTabAlignment()) {
608 case ACenter: 608 case ACenter:
609 dest_x -= (m_win->frame.width / 2) - (m_size_w / 2); 609 dest_x -= (m_win->frame.width / 2) - (m_size_w / 2);
610 break; 610 break;
@@ -616,7 +616,7 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
616 case PBottom: 616 case PBottom:
617 dest_x = be->x_root; 617 dest_x = be->x_root;
618 dest_y = be->y_root - m_win->frame.height; 618 dest_y = be->y_root - m_win->frame.height;
619 switch(m_win->screen->getTabAlignment()) { 619 switch(m_win->getScreen()->getTabAlignment()) {
620 case ACenter: 620 case ACenter:
621 dest_x -= (m_win->frame.width / 2) - (m_size_w / 2); 621 dest_x -= (m_win->frame.width / 2) - (m_size_w / 2);
622 break; 622 break;
@@ -628,7 +628,7 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
628 case PLeft: 628 case PLeft:
629 dest_x = be->x_root; 629 dest_x = be->x_root;
630 dest_y = be->y_root; 630 dest_y = be->y_root;
631 switch(m_win->screen->getTabAlignment()) { 631 switch(m_win->getScreen()->getTabAlignment()) {
632 case ACenter: 632 case ACenter:
633 dest_y -= (m_win->frame.height / 2) - (m_size_h / 2); 633 dest_y -= (m_win->frame.height / 2) - (m_size_h / 2);
634 break; 634 break;
@@ -640,7 +640,7 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
640 case PRight: 640 case PRight:
641 dest_x = be->x_root - m_win->frame.width; 641 dest_x = be->x_root - m_win->frame.width;
642 dest_y = be->y_root; 642 dest_y = be->y_root;
643 switch(m_win->screen->getTabAlignment()) { 643 switch(m_win->getScreen()->getTabAlignment()) {
644 case ACenter: 644 case ACenter:
645 dest_y -= (m_win->frame.height / 2) - (m_size_h / 2); 645 dest_y -= (m_win->frame.height / 2) - (m_size_h / 2);
646 break; 646 break;
@@ -699,8 +699,8 @@ void Tab::motionNotifyEvent(XMotionEvent *me) {
699 m_move_x = me->x_root - 1; 699 m_move_x = me->x_root - 1;
700 m_move_y = me->y_root - 1; 700 m_move_y = me->y_root - 1;
701 701
702 XDrawRectangle(m_display, m_win->screen->getRootWindow(), 702 XDrawRectangle(m_display, m_win->getScreen()->getRootWindow(),
703 m_win->screen->getOpGC(), 703 m_win->getScreen()->getOpGC(),
704 m_move_x, m_move_y, 704 m_move_x, m_move_y,
705 m_size_w, m_size_h); 705 m_size_w, m_size_h);
706 706
@@ -708,55 +708,55 @@ void Tab::motionNotifyEvent(XMotionEvent *me) {
708 708
709 int dx = me->x_root - 1, dy = me->y_root - 1; 709 int dx = me->x_root - 1, dy = me->y_root - 1;
710 710
711 dx -= m_win->screen->getBorderWidth(); 711 dx -= m_win->getScreen()->getBorderWidth();
712 dy -= m_win->screen->getBorderWidth(); 712 dy -= m_win->getScreen()->getBorderWidth();
713 713
714 if (m_win->screen->getEdgeSnapThreshold()) { 714 if (m_win->getScreen()->getEdgeSnapThreshold()) {
715 int drx = m_win->screen->getWidth() - (dx + 1); 715 int drx = m_win->getScreen()->getWidth() - (dx + 1);
716 716
717 if (dx > 0 && dx < drx && dx < m_win->screen->getEdgeSnapThreshold()) 717 if (dx > 0 && dx < drx && dx < m_win->getScreen()->getEdgeSnapThreshold())
718 dx = 0; 718 dx = 0;
719 else if (drx > 0 && drx < m_win->screen->getEdgeSnapThreshold()) 719 else if (drx > 0 && drx < m_win->getScreen()->getEdgeSnapThreshold())
720 dx = m_win->screen->getWidth() - 1; 720 dx = m_win->getScreen()->getWidth() - 1;
721 721
722 int dtty, dbby, dty, dby; 722 int dtty, dbby, dty, dby;
723 723
724 switch (m_win->screen->getToolbarPlacement()) { 724 switch (m_win->getScreen()->getToolbarPlacement()) {
725 case Toolbar::TopLeft: 725 case Toolbar::TopLeft:
726 case Toolbar::TopCenter: 726 case Toolbar::TopCenter:
727 case Toolbar::TopRight: 727 case Toolbar::TopRight:
728 dtty = m_win->screen->getToolbar()->getExposedHeight() + 728 dtty = m_win->getScreen()->getToolbar()->getExposedHeight() +
729 m_win->screen->getBorderWidth(); 729 m_win->getScreen()->getBorderWidth();
730 dbby = m_win->screen->getHeight(); 730 dbby = m_win->getScreen()->getHeight();
731 break; 731 break;
732 732
733 default: 733 default:
734 dtty = 0; 734 dtty = 0;
735 dbby = m_win->screen->getToolbar()->getY(); 735 dbby = m_win->getScreen()->getToolbar()->getY();
736 break; 736 break;
737 } 737 }
738 738
739 dty = dy - dtty; 739 dty = dy - dtty;
740 dby = dbby - (dy + 1); 740 dby = dbby - (dy + 1);
741 741
742 if (dy > 0 && dty < m_win->screen->getEdgeSnapThreshold()) 742 if (dy > 0 && dty < m_win->getScreen()->getEdgeSnapThreshold())
743 dy = dtty; 743 dy = dtty;
744 else if (dby > 0 && dby < m_win->screen->getEdgeSnapThreshold()) 744 else if (dby > 0 && dby < m_win->getScreen()->getEdgeSnapThreshold())
745 dy = dbby - 1; 745 dy = dbby - 1;
746 746
747 } 747 }
748 748
749 //erase rectangle 749 //erase rectangle
750 XDrawRectangle(m_display, m_win->screen->getRootWindow(), 750 XDrawRectangle(m_display, m_win->getScreen()->getRootWindow(),
751 m_win->screen->getOpGC(), 751 m_win->getScreen()->getOpGC(),
752 m_move_x, m_move_y, 752 m_move_x, m_move_y,
753 m_size_w, m_size_h); 753 m_size_w, m_size_h);
754 754
755 //redraw rectangle at new pos 755 //redraw rectangle at new pos
756 m_move_x = dx; 756 m_move_x = dx;
757 m_move_y = dy; 757 m_move_y = dy;
758 XDrawRectangle(m_display, m_win->screen->getRootWindow(), 758 XDrawRectangle(m_display, m_win->getScreen()->getRootWindow(),
759 m_win->screen->getOpGC(), 759 m_win->getScreen()->getOpGC(),
760 m_move_x, m_move_y, 760 m_move_x, m_move_y,
761 m_size_w, m_size_h); 761 m_size_w, m_size_h);
762 762
@@ -840,8 +840,8 @@ void Tab::insert(Tab *tab) {
840 if (m_win->isShaded() != tab->m_win->isShaded()) { 840 if (m_win->isShaded() != tab->m_win->isShaded()) {
841 tab->m_stoptabs = true; // we don't want any actions performed on the 841 tab->m_stoptabs = true; // we don't want any actions performed on the
842 // tabs, just the tab windows! 842 // tabs, just the tab windows!
843 if (m_win->screen->getTabPlacement() == PLeft || 843 if (m_win->getScreen()->getTabPlacement() == PLeft ||
844 m_win->screen->getTabPlacement() == PRight) 844 m_win->getScreen()->getTabPlacement() == PRight)
845 resize_tabs = true; 845 resize_tabs = true;
846 846
847 // if the window we are grouping to, we need to shade the tab window 847 // if the window we are grouping to, we need to shade the tab window
@@ -874,7 +874,7 @@ void Tab::insert(Tab *tab) {
874 } 874 }
875 875
876 // resize if in relative mode or resize_tabs is true 876 // resize if in relative mode or resize_tabs is true
877 if(m_win->screen->getTabAlignment() == ARelative || 877 if(m_win->getScreen()->getTabAlignment() == ARelative ||
878 resize_tabs) { 878 resize_tabs) {
879 resizeGroup(); 879 resizeGroup();
880 calcIncrease(); 880 calcIncrease();
@@ -903,12 +903,12 @@ void Tab::disconnect() {
903 903
904 //reposition the tabs 904 //reposition the tabs
905 if (tmp) { 905 if (tmp) {
906 if (m_win->screen->getTabAlignment() == ARelative) 906 if (m_win->getScreen()->getTabAlignment() == ARelative)
907 tmp->calcIncrease(); 907 tmp->calcIncrease();
908 tmp->setPosition(); 908 tmp->setPosition();
909 } 909 }
910 910
911 if (m_win->screen->getTabAlignment() == ARelative) 911 if (m_win->getScreen()->getTabAlignment() == ARelative)
912 calcIncrease(); 912 calcIncrease();
913 913
914 setPosition(); 914 setPosition();
@@ -918,11 +918,11 @@ void Tab::disconnect() {
918// Sets Tab width _including_ borders 918// Sets Tab width _including_ borders
919// --------------------------------------- 919// ---------------------------------------
920void Tab::setTabWidth(unsigned int w) { 920void Tab::setTabWidth(unsigned int w) {
921 if (w > m_win->screen->getWindowStyle()->tab.border_width_2x) { 921 if (w > m_win->getScreen()->getWindowStyle()->tab.border_width_2x) {
922 m_size_w = w; 922 m_size_w = w;
923 XResizeWindow(m_display, m_tabwin, 923 XResizeWindow(m_display, m_tabwin,
924 m_size_w - m_win->screen->getWindowStyle()->tab.border_width_2x, 924 m_size_w - m_win->getScreen()->getWindowStyle()->tab.border_width_2x,
925 m_size_h - m_win->screen->getWindowStyle()->tab.border_width_2x); 925 m_size_h - m_win->getScreen()->getWindowStyle()->tab.border_width_2x);
926 } 926 }
927} 927}
928 928
@@ -930,11 +930,11 @@ void Tab::setTabWidth(unsigned int w) {
930// Sets Tab height _including_ borders 930// Sets Tab height _including_ borders
931// --------------------------------------- 931// ---------------------------------------
932void Tab::setTabHeight(unsigned int h) { 932void Tab::setTabHeight(unsigned int h) {
933 if (h > m_win->screen->getWindowStyle()->tab.border_width_2x) { 933 if (h > m_win->getScreen()->getWindowStyle()->tab.border_width_2x) {
934 m_size_h = h; 934 m_size_h = h;
935 XResizeWindow(m_display, m_tabwin, 935 XResizeWindow(m_display, m_tabwin,
936 m_size_w - m_win->screen->getWindowStyle()->tab.border_width_2x, 936 m_size_w - m_win->getScreen()->getWindowStyle()->tab.border_width_2x,
937 m_size_h - m_win->screen->getWindowStyle()->tab.border_width_2x); 937 m_size_h - m_win->getScreen()->getWindowStyle()->tab.border_width_2x);
938 } 938 }
939} 939}
940 940
@@ -949,15 +949,15 @@ void Tab::resizeGroup(void) {
949 #endif //DEBUG 949 #endif //DEBUG
950 Tab *first; 950 Tab *first;
951 for (first = getFirst(this); first != 0; first = first->m_next) { 951 for (first = getFirst(this); first != 0; first = first->m_next) {
952 if ((m_win->screen->getTabPlacement() == PLeft || 952 if ((m_win->getScreen()->getTabPlacement() == PLeft ||
953 m_win->screen->getTabPlacement() == PRight) && 953 m_win->getScreen()->getTabPlacement() == PRight) &&
954 m_win->screen->isTabRotateVertical() && 954 m_win->getScreen()->isTabRotateVertical() &&
955 !m_win->isShaded()) { 955 !m_win->isShaded()) {
956 first->setTabWidth(m_win->screen->getTabHeight()); 956 first->setTabWidth(m_win->getScreen()->getTabHeight());
957 first->setTabHeight(m_win->screen->getTabWidth()); 957 first->setTabHeight(m_win->getScreen()->getTabWidth());
958 } else { 958 } else {
959 first->setTabWidth(m_win->screen->getTabWidth()); 959 first->setTabWidth(m_win->getScreen()->getTabWidth());
960 first->setTabHeight(m_win->screen->getTabHeight()); 960 first->setTabHeight(m_win->getScreen()->getTabHeight());
961 } 961 }
962 //TODO: do I have to set this all the time? 962 //TODO: do I have to set this all the time?
963 first->m_configured = true; //used in Fluxbox::reconfigure() 963 first->m_configured = true; //used in Fluxbox::reconfigure()
@@ -973,7 +973,7 @@ unsigned int Tab::calcRelativeWidth() {
973 //calculate num objs in list (extract this to a function?) 973 //calculate num objs in list (extract this to a function?)
974 for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); 974 for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++);
975 975
976 return ((m_win->frame.width + m_win->screen->getBorderWidth2x())/num); 976 return ((m_win->frame.width + m_win->getScreen()->getBorderWidth2x())/num);
977} 977}
978 978
979//------------- calcRelativeHeight ------- 979//------------- calcRelativeHeight -------
@@ -985,7 +985,7 @@ unsigned int Tab::calcRelativeHeight() {
985 //calculate num objs in list (extract this to a function?) 985 //calculate num objs in list (extract this to a function?)
986 for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); 986 for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++);
987 987
988 return ((m_win->frame.height + m_win->screen->getBorderWidth2x())/num); 988 return ((m_win->frame.height + m_win->getScreen()->getBorderWidth2x())/num);
989} 989}
990 990
991//------------- calcCenterXPos ----------- 991//------------- calcCenterXPos -----------