From: <bra...@us...> - 2003-11-28 12:59:13
|
Update of /cvsroot/blackboxwm/blackbox/src In directory sc8-pr-cvs1:/tmp/cvs-serv3655/src Modified Files: Window.cc Log Message: 1. remove all use of Font and fontid from the Pen/PenCache (no longer needed). 2. add bt::Pen::setLineWidth(int), to allow drawing with various linewidth 3. use the above to draw resize/move frames using the styles borderWidth... Index: Window.cc =================================================================== RCS file: /cvsroot/blackboxwm/blackbox/src/Window.cc,v retrieving revision 1.293 retrieving revision 1.294 diff -C2 -d -r1.293 -r1.294 *** Window.cc 28 Nov 2003 10:47:57 -0000 1.293 --- Window.cc 28 Nov 2003 12:59:09 -0000 1.294 *************** *** 2845,2853 **** */ bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); pen.setGCFunction(GXxor); pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), frame.changing.x(), frame.changing.y(), ! frame.changing.width() - 1, frame.changing.height() - 1); XUngrabServer(blackbox->XDisplay()); --- 2845,2858 ---- */ bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); + const int hw = frame.border_w / 2; pen.setGCFunction(GXxor); + pen.setLineWidth(frame.border_w); pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), ! frame.changing.x() + hw, ! frame.changing.y() + hw, ! frame.changing.width() - frame.border_w, ! frame.changing.height() - frame.border_w); XUngrabServer(blackbox->XDisplay()); *************** *** 2862,2870 **** } else if (client.state.resizing) { bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); pen.setGCFunction(GXxor); pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), frame.changing.x(), frame.changing.y(), ! frame.changing.width() - 1, frame.changing.height() - 1); XUngrabServer(blackbox->XDisplay()); --- 2867,2880 ---- } else if (client.state.resizing) { bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); + const int hw = frame.border_w / 2; pen.setGCFunction(GXxor); + pen.setLineWidth(frame.border_w);; pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), ! frame.changing.x() + hw, ! frame.changing.y() + hw, ! frame.changing.width() - frame.border_w, ! frame.changing.height() - frame.border_w); XUngrabServer(blackbox->XDisplay()); *************** *** 2944,2953 **** bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); pen.setGCFunction(GXxor); pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), frame.changing.x(), frame.changing.y(), ! frame.changing.width() - 1, ! frame.changing.height() - 1); } } else { --- 2954,2967 ---- bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); + const int hw = frame.border_w / 2; pen.setGCFunction(GXxor); + pen.setLineWidth(frame.border_w);; pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), ! frame.changing.x() + hw, ! frame.changing.y() + hw, ! frame.changing.width() - frame.border_w, ! frame.changing.height() - frame.border_w); } } else { *************** *** 2971,2987 **** } else { bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); pen.setGCFunction(GXxor); pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), frame.changing.x(), frame.changing.y(), ! frame.changing.width() - 1, ! frame.changing.height() - 1); frame.changing.setPos(dx, dy); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), frame.changing.x(), frame.changing.y(), ! frame.changing.width() - 1, ! frame.changing.height() - 1); } --- 2985,3007 ---- } else { bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); + const int hw = frame.border_w / 2; pen.setGCFunction(GXxor); + pen.setLineWidth(frame.border_w);; pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), ! frame.changing.x() + hw, ! frame.changing.y() + hw, ! frame.changing.width() - frame.border_w, ! frame.changing.height() - frame.border_w); frame.changing.setPos(dx, dy); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), ! frame.changing.x() + hw, ! frame.changing.y() + hw, ! frame.changing.width() - frame.border_w, ! frame.changing.height() - frame.border_w); } *************** *** 3015,3024 **** bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); pen.setGCFunction(GXxor); pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), frame.changing.x(), frame.changing.y(), ! frame.changing.width() - 1, ! frame.changing.height() - 1); showGeometry(frame.changing); --- 3035,3048 ---- bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); + const int hw = frame.border_w / 2; pen.setGCFunction(GXxor); + pen.setLineWidth(frame.border_w);; pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), ! frame.changing.x() + hw, ! frame.changing.y() + hw, ! frame.changing.width() - frame.border_w, ! frame.changing.height() - frame.border_w); showGeometry(frame.changing); *************** *** 3048,3061 **** if (curr != frame.changing) { bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); pen.setGCFunction(GXxor); pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), curr.x(), curr.y(), ! curr.width() - 1, curr.height() - 1); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), frame.changing.x(), frame.changing.y(), ! frame.changing.width() - 1, ! frame.changing.height() - 1); showGeometry(frame.changing); --- 3072,3092 ---- if (curr != frame.changing) { bt::Pen pen(screen->screenNumber(), bt::Color(0xff, 0xff, 0xff)); + const int hw = frame.border_w / 2; pen.setGCFunction(GXxor); + pen.setLineWidth(frame.border_w);; pen.setSubWindowMode(IncludeInferiors); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), ! curr.x() + hw, ! curr.y() + hw, ! curr.width() - frame.border_w, ! curr.height() - frame.border_w); XDrawRectangle(blackbox->XDisplay(), screen->screenInfo().rootWindow(), ! pen.gc(), ! frame.changing.x() + hw, ! frame.changing.y() + hw, ! frame.changing.width() - frame.border_w, ! frame.changing.height() - frame.border_w); showGeometry(frame.changing); |