From 5314dbb8177a16372c44069a84908d8c9c9fca2b Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Mon, 14 Aug 2000 18:49:44 +0000 Subject: [PATCH] mosfet's much ligher version of the default style. Still flickers a little bit, but uses much less resources svn path=/trunk/kdebase/kwin/; revision=61022 --- clients/Makefile.am | 2 +- default/Bitmaps.h | 21 -- default/Button.cpp | 72 ----- default/Button.h | 69 ----- default/CloseButton.cpp | 61 ---- default/CloseButton.h | 52 ---- default/DBWidget.cpp | 62 ---- default/DBWidget.h | 63 ---- default/Defines.h | 7 - default/IconifyButton.cpp | 63 ---- default/IconifyButton.h | 52 ---- default/Makefile.am | 40 --- default/Manager.cpp | 179 ----------- default/Manager.h | 97 ------ default/MaximiseButton.cpp | 69 ----- default/MaximiseButton.h | 58 ---- default/QuestionButton.cpp | 47 --- default/QuestionButton.h | 52 ---- default/ResizeBar.cpp | 62 ---- default/ResizeBar.h | 62 ---- default/ResizeMid.cpp | 92 ------ default/ResizeMid.h | 56 ---- default/ResizeSide.cpp | 104 ------- default/ResizeSide.h | 57 ---- default/Static.cpp | 336 -------------------- default/Static.h | 179 ----------- default/StickyButton.cpp | 59 ---- default/StickyButton.h | 56 ---- default/TitleBar.cpp | 265 ---------------- default/TitleBar.h | 77 ----- default/TitleText.cpp | 111 ------- default/TitleText.h | 65 ---- default/kdedefault.cpp | 614 +++++++++++++++++++++++++++++++++++++ default/kdedefault.h | 65 ++++ plugins.cpp | 4 +- workspace.cpp | 3 +- 36 files changed, 683 insertions(+), 2650 deletions(-) delete mode 100644 default/Bitmaps.h delete mode 100644 default/Button.cpp delete mode 100644 default/Button.h delete mode 100644 default/CloseButton.cpp delete mode 100644 default/CloseButton.h delete mode 100644 default/DBWidget.cpp delete mode 100644 default/DBWidget.h delete mode 100644 default/Defines.h delete mode 100644 default/IconifyButton.cpp delete mode 100644 default/IconifyButton.h delete mode 100644 default/Makefile.am delete mode 100644 default/Manager.cpp delete mode 100644 default/Manager.h delete mode 100644 default/MaximiseButton.cpp delete mode 100644 default/MaximiseButton.h delete mode 100644 default/QuestionButton.cpp delete mode 100644 default/QuestionButton.h delete mode 100644 default/ResizeBar.cpp delete mode 100644 default/ResizeBar.h delete mode 100644 default/ResizeMid.cpp delete mode 100644 default/ResizeMid.h delete mode 100644 default/ResizeSide.cpp delete mode 100644 default/ResizeSide.h delete mode 100644 default/Static.cpp delete mode 100644 default/Static.h delete mode 100644 default/StickyButton.cpp delete mode 100644 default/StickyButton.h delete mode 100644 default/TitleBar.cpp delete mode 100644 default/TitleBar.h delete mode 100644 default/TitleText.cpp delete mode 100644 default/TitleText.h create mode 100644 default/kdedefault.cpp create mode 100644 default/kdedefault.h diff --git a/clients/Makefile.am b/clients/Makefile.am index 2eea36f078..38ca49139a 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -1 +1 @@ -SUBDIRS = kde1 kstep system b2 laptop riscos modernsystem +SUBDIRS = kde1 kstep system b2 laptop riscos modernsystem diff --git a/default/Bitmaps.h b/default/Bitmaps.h deleted file mode 100644 index b9b5da70d9..0000000000 --- a/default/Bitmaps.h +++ /dev/null @@ -1,21 +0,0 @@ -static unsigned char iconify_bits[] = { - 0xff, 0xff, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18}; - -static unsigned char close_bits[] = { - 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 0x00 }; - -static unsigned char maximize_bits[] = { - 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0xff, 0xff }; - -static unsigned char minmax_bits[] = { - 0x0c, 0x18, 0x33, 0x67, 0xcf, 0x9f, 0x3f, 0x3f}; - -static unsigned char unsticky_bits[] = { - 0x00, 0x18, 0x18, 0x7e, 0x7e, 0x18, 0x18, 0x00}; - -static unsigned char sticky_bits[] = { - 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00}; - -static unsigned char question_bits[] = { - 0x3c, 0x66, 0x60, 0x30, 0x18, 0x00, 0x18, 0x18}; - diff --git a/default/Button.cpp b/default/Button.cpp deleted file mode 100644 index 6a468adf15..0000000000 --- a/default/Button.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include "Button.h" -#include "Static.h" - -namespace Default -{ - -Button::Button(QWidget * parent, SymbolType t) - : QWidget (parent, "Button", WRepaintNoErase | WPaintUnclipped), - type_ (t), - align_ (Left), - down_ (false), - active_ (false) -{ - if (type_ == Sticky || type_ == Question) - setFixedWidth(Static::instance()->buttonWidth2()); - else - setFixedWidth(Static::instance()->buttonWidth1()); -} - -Button::~Button() -{ - // Empty. -} - - void -Button::updateDisplay() -{ - setBackgroundPixmap(Static::instance()->button(type_, active_, down_)); - repaint(true); -} - - void -Button::setType(SymbolType t) -{ - type_ = t; - updateDisplay(); -} - - void -Button::setActive(bool b) -{ - active_ = b; - updateDisplay(); -} - -} // End namespace - -#include "Button.moc" - -// vim:ts=2:sw=2:tw=78 diff --git a/default/Button.h b/default/Button.h deleted file mode 100644 index fe84e9d838..0000000000 --- a/default/Button.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_BUTTON_H -#define DEFAULT_BUTTON_H - -#include "Static.h" -#include - -namespace Default -{ - -class Button : public QWidget -{ - Q_OBJECT - - public: - - enum Alignment { Left, Right }; - - Button(QWidget * parent, SymbolType); - virtual ~Button(); - - void updateDisplay(); - - void setAlign(Alignment a) { align_ = a; updateDisplay(); } - void setType(SymbolType t); - - void setActive(bool); - - protected: - - bool active() const { return active_; } - - void mousePressEvent(QMouseEvent *) { down_ = true; updateDisplay(); } - void mouseReleaseEvent(QMouseEvent *) { down_ = false; updateDisplay(); } - - private: - - SymbolType type_; - Alignment align_; - bool down_; - bool active_; -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/CloseButton.cpp b/default/CloseButton.cpp deleted file mode 100644 index 450d375826..0000000000 --- a/default/CloseButton.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include "CloseButton.h" - -namespace Default -{ - -CloseButton::CloseButton(QWidget * parent) - : Button(parent, Close) -{ -} - - void -CloseButton::mouseReleaseEvent(QMouseEvent * e) -{ - Button::mouseReleaseEvent(e); - - if (!rect().contains(e->pos())) - return; - - switch (e->button()) - { - case RightButton: - emit(closeClient()); - break; - - case MidButton: - emit(closeClient()); - break; - - case LeftButton: - default: - emit(closeClient()); - break; - } -} - -} // End namespace; - -// vim:ts=2:sw=2:tw=78 -#include "CloseButton.moc" diff --git a/default/CloseButton.h b/default/CloseButton.h deleted file mode 100644 index 465cdc66e8..0000000000 --- a/default/CloseButton.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_CLOSE_BUTTON_H -#define DEFAULT_CLOSE_BUTTON_H - -#include "Button.h" - -namespace Default -{ - -class CloseButton : public Button -{ - Q_OBJECT - - public: - - CloseButton(QWidget * parent); - - signals: - - void closeClient(); - - protected: - - void mouseReleaseEvent(QMouseEvent *); -}; - -} // End namespace; - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/DBWidget.cpp b/default/DBWidget.cpp deleted file mode 100644 index df0ba48b3a..0000000000 --- a/default/DBWidget.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include "DBWidget.h" - -namespace Default -{ - -DBWidget::DBWidget(QWidget * parent, const char * name) - : QWidget(parent, name, WResizeNoErase | WRepaintNoErase | WPaintUnclipped | WNorthWestGravity) -{ - buf_.resize(20, 20); -} - - void -DBWidget::updateDisplay() -{ - updatePixmap(); - repaint(false); -} - - void -DBWidget::paintEvent(QPaintEvent * e) -{ - QRect r(e->rect()); - bitBlt(this, r.topLeft(), &buf_, r, Qt::CopyROP); -} - - void -DBWidget::resizeEvent(QResizeEvent * e) -{ - QWidget::resizeEvent(e); - - if ( (buf_.width() < size().width()) || - (QABS(size().width() - buf_.width()) > 128) ) - buf_.resize(((size().width() / 128)* 128) + 128, size().height()); - - updateDisplay(); -} - -} // End namespace - -// vim:ts=2:sw=2:tw=78 diff --git a/default/DBWidget.h b/default/DBWidget.h deleted file mode 100644 index 9988012be5..0000000000 --- a/default/DBWidget.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_DOUBLE_BUFFERED_WIDGET_H -#define DEFAULT_DOUBLE_BUFFERED_WIDGET_H - -#include -#include - -namespace Default -{ - -class DBWidget : public QWidget -{ - public: - - DBWidget(QWidget * parent = 0, const char * name = 0); - virtual ~DBWidget() { /* Empty */ } - - virtual void updateDisplay(); - - protected: - - virtual void updatePixmap() = 0; - - virtual void paintEvent(QPaintEvent * e); - virtual void resizeEvent(QResizeEvent * e); - - QPixmap & buf() { return buf_; } - - - private: - - DBWidget(const DBWidget &); - DBWidget & operator = (const DBWidget &); - - QPixmap buf_; -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/Defines.h b/default/Defines.h deleted file mode 100644 index 77d3251c37..0000000000 --- a/default/Defines.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef DEFAULT_DEFINES_H -#define DEFAULT_DEFINES_H - -#define RESIZE_SIDE_WIDTH 30 -#define RESIZE_BAR_HEIGHT 6 - -#endif diff --git a/default/IconifyButton.cpp b/default/IconifyButton.cpp deleted file mode 100644 index 2c92f175de..0000000000 --- a/default/IconifyButton.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include "IconifyButton.h" - -namespace Default -{ - -IconifyButton::IconifyButton(QWidget * parent) - : Button(parent, Iconify) -{ -} - - void -IconifyButton::mouseReleaseEvent(QMouseEvent * e) -{ - Button::mouseReleaseEvent(e); - - if (!rect().contains(e->pos())) - return; - - switch (e->button()) - { - case RightButton: - emit(iconifyClient()); - break; - - case MidButton: - emit(iconifyClient()); - break; - - case LeftButton: - default: - emit(iconifyClient()); - break; - } - - -} - -} // End namespace; - -// vim:ts=2:sw=2:tw=78 -#include "IconifyButton.moc" diff --git a/default/IconifyButton.h b/default/IconifyButton.h deleted file mode 100644 index 5bcccf7e74..0000000000 --- a/default/IconifyButton.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_ICONIFY_BUTTON_H -#define DEFAULT_ICONIFY_BUTTON_H - -#include "Button.h" - -namespace Default -{ - -class IconifyButton : public Button -{ - Q_OBJECT - - public: - - IconifyButton(QWidget * parent); - - signals: - - void iconifyClient(); - - protected: - - void mouseReleaseEvent(QMouseEvent *); -}; - -} // End namespace; - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/Makefile.am b/default/Makefile.am deleted file mode 100644 index 81c5cf28ff..0000000000 --- a/default/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -INCLUDES = $(all_includes) - -lib_LTLIBRARIES = libkwindefault.la - -libkwindefault_la_SOURCES = \ -Button.cpp \ -CloseButton.cpp \ -DBWidget.cpp \ -IconifyButton.cpp \ -QuestionButton.cpp \ -StickyButton.cpp \ -Manager.cpp \ -MaximiseButton.cpp \ -ResizeBar.cpp \ -ResizeMid.cpp \ -ResizeSide.cpp \ -TitleBar.cpp \ -TitleText.cpp \ -Static.cpp - -libkwindefault_la_LDFLAGS = $(all_libraries) - -libkwindefault_la_METASOURCES = AUTO - -noinst_HEADERS = \ -Button.h \ -CloseButton.h \ -DBWidget.h \ -IconifyButton.h \ -QuestionButton.h \ -StickyButton.h \ -Manager.h \ -MaximiseButton.h \ -ResizeBar.h \ -ResizeMid.h \ -ResizeSide.h \ -TitleBar.h \ -TitleText.h \ -Static.h - diff --git a/default/Manager.cpp b/default/Manager.cpp deleted file mode 100644 index 6afc364854..0000000000 --- a/default/Manager.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include -#include - -#include "../options.h" -#include "../workspace.h" - -#include "Manager.h" -#include "Static.h" -#include "TitleBar.h" -#include "ResizeBar.h" - -extern "C" -{ - Client * allocate(Workspace * workSpace, WId winId) - { - return new Default::Manager(workSpace, winId); - } -} - -namespace Default -{ - -Manager::Manager( - Workspace * workSpace, - WId id, - QWidget * parent, - const char * name -) - : Client(workSpace, id, parent, name) -{ - - connect(options, SIGNAL(resetClients()), this, SLOT(slotReset())); - - titleBar_ = new TitleBar(this); - titleBar_->setFixedHeight( Static::instance()->titleHeight() ); - resizeBar_ = new ResizeBar(this, this); - resizeBar_->setFixedHeight( RESIZE_BAR_HEIGHT ); - - QVBoxLayout* vbox = new QVBoxLayout( this ); - vbox->addWidget( titleBar_ ); - QHBoxLayout* hbox = new QHBoxLayout; - vbox->addLayout( hbox, 10 ); - hbox->addSpacing( 3 ); - hbox->addWidget( windowWrapper(), 10 ); - hbox->addSpacing( 3 ); - vbox->addWidget( resizeBar_ ); - - _updateDisplay(); -} - -Manager::~Manager() -{ -} - - void -Manager::slotReset() -{ - Static::instance()->update(); - titleBar_->setFixedHeight( Static::instance()->titleHeight() ); - _updateDisplay(); -} - - void -Manager::captionChange(const QString &) -{ - titleBar_->updateText(); -} - - void -Manager::stickyChange(bool b) -{ - emit(stickyStatusChanged(b)); -} - - void -Manager::paletteChange(const QPalette &) -{ - Static::instance()->update(); - _updateDisplay(); -} - - void -Manager::activeChange(bool b) -{ - titleBar_->setActive(b); -} - - void -Manager::maximizeChange(bool b) -{ - emit(maximiseChanged(b)); -} - - void -Manager::_updateDisplay() -{ - titleBar_->updateDisplay(); - resizeBar_->updateDisplay(); -} - - void -Manager::paintEvent(QPaintEvent * e) -{ - QRect r(e->rect()); - - bool intersectsLeft = - r.intersects(QRect(0, 0, 1, height())); - - bool intersectsRight = - r.intersects(QRect(width() - 1, 0, width(), height())); - - if (intersectsLeft || intersectsRight) { - - QPainter p(this); - p.setPen(Qt::black); - - if (intersectsLeft) - p.drawLine(0, r.top(), 0, r.bottom()); - - if (intersectsRight) - p.drawLine(width() - 1, r.top(), width() - 1, r.bottom()); - } -} - - void -Manager::raise() -{ - workspace()->raiseClient(this); -} - - void -Manager::vMax() -{ - maximize(MaximizeVertical); -} - - void -Manager::resizeEvent(QResizeEvent * e) -{ - Client::resizeEvent(e); -} - - - void -Manager::fakeMouseEvent(QMouseEvent * e, QWidget * w) -{ - QPoint adjustedPos = w->pos() + e->pos(); - - QMouseEvent fake(e->type(), adjustedPos, e->button(), e->state()); - Client::event(&fake); -} - - -} // End namespace - -// vim:ts=2:sw=2:tw=78 -#include "Manager.moc" diff --git a/default/Manager.h b/default/Manager.h deleted file mode 100644 index b15b8d2269..0000000000 --- a/default/Manager.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_MANAGER_H -#define DEFAULT_MANAGER_H - -#include "../client.h" - -namespace Default -{ - -class TitleBar; -class ResizeBar; - -class Manager : public Client -{ - Q_OBJECT - - public: - - Manager(Workspace *, WId, QWidget * parent = 0, const char * name = 0); - ~Manager(); - - void fakeMouseEvent(QMouseEvent *, QWidget *); - - signals: - - void maximiseChanged(bool); - void stickyStatusChanged(bool); - - public slots: - - void raise(); - void vMax(); - - protected: - - void paletteChange(const QPalette &); - void activeChange(bool); - void maximizeChange(bool); - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); - - protected slots: - - void captionChange(const QString &); - void stickyChange(bool); - void slotReset(); - - private: - - void _updateDisplay(); - - TitleBar * titleBar_; - ResizeBar * resizeBar_; - -}; - -class ToolManager : public Manager -{ - public: - - ToolManager( - Workspace * w, - WId i, - QWidget * parent = 0, - const char * name = 0 - ) - : Manager(w, i, parent, name) - { - } -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/MaximiseButton.cpp b/default/MaximiseButton.cpp deleted file mode 100644 index f6dc95f636..0000000000 --- a/default/MaximiseButton.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include "MaximiseButton.h" - -namespace Default -{ - -MaximiseButton::MaximiseButton(QWidget * parent) - : Button(parent, Max) -{ -} - - void -MaximiseButton::setOn(bool on) -{ - setType(on ? Unmax: Max); - updateDisplay(); -} - - void -MaximiseButton::mouseReleaseEvent(QMouseEvent * e) -{ - Button::mouseReleaseEvent(e); - - if (!rect().contains(e->pos())) - return; - - switch (e->button()) - { - case RightButton: - emit(maximiseClient()); - break; - - case MidButton: - emit(vMaxClient()); - break; - - case LeftButton: - default: - emit(raiseClient()); - emit(maximiseClient()); - break; - } -} - -} // End namespace - -// vim:ts=2:sw=2:tw=78 -#include "MaximiseButton.moc" diff --git a/default/MaximiseButton.h b/default/MaximiseButton.h deleted file mode 100644 index ea2bf595ce..0000000000 --- a/default/MaximiseButton.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_MAXIMISE_BUTTON_H -#define DEFAULT_MAXIMISE_BUTTON_H - -#include "Button.h" - -namespace Default -{ - -class MaximiseButton : public Button -{ - Q_OBJECT - - public: - - MaximiseButton(QWidget * parent); - - public slots: - - void setOn(bool); - - signals: - - void maximiseClient(); - void raiseClient(); - void vMaxClient(); - - protected: - - void mouseReleaseEvent(QMouseEvent *); -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/QuestionButton.cpp b/default/QuestionButton.cpp deleted file mode 100644 index bb413bffbe..0000000000 --- a/default/QuestionButton.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include "QuestionButton.h" - -namespace Default -{ - -QuestionButton::QuestionButton(QWidget * parent) - : Button(parent, Question) -{ -} - - void -QuestionButton::mouseReleaseEvent(QMouseEvent * e) -{ - Button::mouseReleaseEvent(e); - - if (!rect().contains(e->pos())) - return; - - emit(contextHelp()); -} - -} // End namespace; - -// vim:ts=2:sw=2:tw=78 -#include "QuestionButton.moc" diff --git a/default/QuestionButton.h b/default/QuestionButton.h deleted file mode 100644 index e604ec4783..0000000000 --- a/default/QuestionButton.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_QUESTION_BUTTON_H -#define DEFAULT_QUESTION_BUTTON_H - -#include "Button.h" - -namespace Default -{ - -class QuestionButton : public Button -{ - Q_OBJECT - - public: - - QuestionButton(QWidget * parent); - - signals: - - void contextHelp(); - - protected: - - void mouseReleaseEvent(QMouseEvent *); -}; - -} // End namespace; - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/ResizeBar.cpp b/default/ResizeBar.cpp deleted file mode 100644 index 8e70a5dd73..0000000000 --- a/default/ResizeBar.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include "ResizeBar.h" -#include "ResizeMid.h" -#include "ResizeSide.h" - -#include - -namespace Default -{ - -ResizeBar::ResizeBar(QWidget * parent, Manager * client) - : QWidget (parent, "ResizeBar", WResizeNoErase | WRepaintNoErase), - client_ (client) -{ - - left_ = new ResizeSide(this, client_, ResizeSide::Left); - mid_ = new ResizeMid(this, client_); - right_ = new ResizeSide(this, client_, ResizeSide::Right); - - mid_->move(30, 0); -} - - void -ResizeBar::updateDisplay() -{ - left_ ->updateDisplay(); - mid_ ->updateDisplay(); - right_->updateDisplay(); -} - - void -ResizeBar::resizeEvent(QResizeEvent *) -{ - mid_->resize(width() - 60, mid_->height()); - right_->move(width() - 30, 0); -} - -} // End namespace - -// vim:ts=2:sw=2:tw=78 -#include "ResizeBar.moc" diff --git a/default/ResizeBar.h b/default/ResizeBar.h deleted file mode 100644 index 449e834067..0000000000 --- a/default/ResizeBar.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_RESIZE_BAR_H -#define DEFAULT_RESIZE_BAR_H - -#include - -namespace Default -{ - -class Manager; - -class ResizeMid; -class ResizeSide; - -class ResizeBar : public QWidget -{ - Q_OBJECT - - public: - - ResizeBar(QWidget * parent, Manager * client); - void updateDisplay(); - - protected: - - void resizeEvent(QResizeEvent *); - - private: - - Manager * client_; - - ResizeSide * left_; - ResizeMid * mid_; - ResizeSide * right_; -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/ResizeMid.cpp b/default/ResizeMid.cpp deleted file mode 100644 index cbea00ed38..0000000000 --- a/default/ResizeMid.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include "ResizeMid.h" -#include "Manager.h" -#include "Static.h" - -namespace Default -{ - -ResizeMid::ResizeMid(QWidget * parent, Manager * client) - : DBWidget(parent, "ResizeMid"), - client_(client) -{ - setFixedHeight(RESIZE_BAR_HEIGHT); - setCursor(Qt::sizeVerCursor); -} - -ResizeMid::~ResizeMid() -{ - // Empty. -} - - void -ResizeMid::updatePixmap() -{ - QPainter p(&buf()); - - QColorGroup g( - client_->isActive() ? - palette().active() : - palette().inactive() - ); - - QBrush b(g.button()); - - QStyle * style = kapp->kstyle(); - - if (0 != style) - style->drawPanel(&p, 0, 0, width(), height(), g, false, 2, &b); - else - kapp->style().drawPanel(&p, 0, 0, width(), height(), g, false, 2, &b); -} - - void -ResizeMid::mouseMoveEvent(QMouseEvent * e) -{ - QRect g = client_->geometry(); - g.setBottom(e->globalPos().y()); - - if ( client_->isShade() ) - client_->giveUpShade(); - QSize adjustedSize = client_->adjustedSize(g.size()); - - if (adjustedSize != client_->size()) { - client_->resize( adjustedSize ); - } -} - - void -ResizeMid::mousePressEvent(QMouseEvent * e) -{ - if (e->button() == LeftButton) - client_->raise(); -} - -} // End namespace - -// vim:ts=2:sw=2:tw=78 diff --git a/default/ResizeMid.h b/default/ResizeMid.h deleted file mode 100644 index 25b455cd3d..0000000000 --- a/default/ResizeMid.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_RESIZE_MID_H -#define DEFAULT_RESIZE_MID_H - -#include "DBWidget.h" - -namespace Default -{ - -class Manager; - -class ResizeMid : public DBWidget -{ - public: - - ResizeMid(QWidget * parent, Manager * client); - virtual ~ResizeMid(); - - protected: - - void updatePixmap(); - - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - - private: - - Manager * client_; -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/ResizeSide.cpp b/default/ResizeSide.cpp deleted file mode 100644 index 10d8accbb7..0000000000 --- a/default/ResizeSide.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include "ResizeSide.h" -#include "Manager.h" -#include "Static.h" - -namespace Default -{ - -ResizeSide::ResizeSide(QWidget * parent, Manager * client, Side s) - : QWidget (parent, "ResizeSide"), - client_ (client), - side_ (s) -{ - setCursor(side_ == Left ? Qt::sizeBDiagCursor : Qt::sizeFDiagCursor); - setFixedSize(RESIZE_SIDE_WIDTH, RESIZE_BAR_HEIGHT); - updateDisplay(); -} - - void -ResizeSide::mouseMoveEvent(QMouseEvent * e) -{ - if ( client_->isShade() ) - client_->giveUpShade(); - QRect g = client_->geometry(); - g.setBottom(e->globalPos().y()); - if (side_ == Left) - g.setLeft(e->globalPos().x()); - else - g.setRight(e->globalPos().x()); - - QSize adjustedSize = client_->adjustedSize(g.size()); - - if (adjustedSize != client_->size()) { - - if (side_ == Left) - g.setLeft(g.right() - adjustedSize.width() + 1); - else - g.setRight(g.left() + adjustedSize.width() - 1); - - g.setBottom(g.top() + adjustedSize.height() - 1); - - client_->setGeometry(g); - } -} - - void -ResizeSide::updateDisplay() -{ - QPixmap pix(size()); - QPainter p(&pix); - - QColorGroup g( - client_->isActive() ? - palette().active() : - palette().inactive() - ); - - QBrush b(g.button()); - - QStyle * style = kapp->kstyle(); - - if (0 != style) - style->drawPanel(&p, 0, 0, width(), height(), g, false, 2, &b); - else - kapp->style().drawPanel(&p, 0, 0, width(), height(), g, false, 2, &b); - - setBackgroundPixmap(pix); -} - - void -ResizeSide::mousePressEvent(QMouseEvent * e) -{ - if (e->button() == LeftButton) - client_->raise(); -} - -} // End namespace - -// vim:ts=2:sw=2:tw=78 diff --git a/default/ResizeSide.h b/default/ResizeSide.h deleted file mode 100644 index a0cd7bdb77..0000000000 --- a/default/ResizeSide.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_RESIZE_SIDE_H -#define DEFAULT_RESIZE_SIDE_H - -#include - -namespace Default -{ - -class Manager; - -class ResizeSide : public QWidget -{ - public: - - enum Side { Left, Right }; - - ResizeSide(QWidget * parent, Manager * client, Side); - void updateDisplay(); - - protected: - - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - - private: - - Manager * client_; - Side side_; -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/Static.cpp b/default/Static.cpp deleted file mode 100644 index 239de930ce..0000000000 --- a/default/Static.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include - -#include "../options.h" - -#include "Static.h" - -namespace Default -{ - -static void drawButtonFrame(KPixmap & pix, const QColorGroup &g, bool sunken) -{ - QPainter p; - - int w = pix.width(); - int h = pix.height(); - - p.begin(&pix); - - p.setPen(g.dark()); - - p.drawLine(0, 0, w-1, 0); - p.drawLine(0, 0, 0, h-1); - - p.setPen(sunken ? g.dark() : g.light()); - p.drawLine(1, 1, w-2, 1); - p.drawLine(1, 1, 1, h-2); - - p.setPen(sunken ? g.light() : g.dark()); - p.drawLine(w-2, 1, w-2, h-2); - p.drawLine(1, h-2, w-2, h-2); - - p.setPen(g.light()); - p.drawLine(w-1, 0, w-1, h-1); - p.drawLine(0, h-1, w-1, h-1); - - p.end(); -} - - -Static * Static::instance_ = 0L; - - void -Static::_init() -{ - aResize_.setOptimization(QPixmap::MemoryOptim); - iResize_.setOptimization(QPixmap::MemoryOptim); - aResize_.resize(30, RESIZE_BAR_HEIGHT); - iResize_.resize(30, RESIZE_BAR_HEIGHT); - aResize_.fill(Qt::black); - iResize_.fill(Qt::black); - - aTitle_ .setOptimization(QPixmap::BestOptim); - iTitle_ .setOptimization(QPixmap::BestOptim); - - aResizeMidLeft_ .setOptimization(QPixmap::BestOptim); - aResizeMidRight_ .setOptimization(QPixmap::BestOptim); - aResizeMid_ .setOptimization(QPixmap::BestOptim); - - iResizeMidLeft_ .setOptimization(QPixmap::BestOptim); - iResizeMidRight_ .setOptimization(QPixmap::BestOptim); - iResizeMid_ .setOptimization(QPixmap::BestOptim); - - aResizeMidLeft_ .resize(3, 12); - aResizeMidRight_ .resize(3, 12); - aResizeMidLeft_ .fill(Qt::black); - aResizeMidRight_ .fill(Qt::black); - - iResizeMidLeft_ .resize(3, 12); - iResizeMidRight_ .resize(3, 12); - iResizeMidLeft_ .fill(Qt::black); - iResizeMidRight_ .fill(Qt::black); - - aResizeMid_ .resize(128, RESIZE_BAR_HEIGHT); - iResizeMid_ .resize(128, RESIZE_BAR_HEIGHT); - aResizeMid_ .fill(Qt::black); - iResizeMid_ .fill(Qt::black); - - _loadGlyphs(); - - update(); -} - - void -Static::update() -{ - QPainter p; - - titleHeight_ = 24; - btnWidth1_ = 36; - btnWidth2_ = 24; - - unsigned int availableTitleHeight = titleHeight_ - 6; - - aTitle_.resize(36, availableTitleHeight); - iTitle_.resize(36, availableTitleHeight); - - aTitleText_.resize(36, availableTitleHeight); - iTitleText_.resize(36, availableTitleHeight); - - aTitleLeft_.resize(2, availableTitleHeight); - iTitleLeft_.resize(2, availableTitleHeight); - - aTitleRight_.resize(2, availableTitleHeight); - iTitleRight_.resize(2, availableTitleHeight); - - QColor bgColor, light, dark; - QColorGroup buttonBgColorGroup = options->colorGroup(Options::ButtonBg, true); - KPixmapEffect::GradientType vertGrad = KPixmapEffect::VerticalGradient; - KPixmapEffect::GradientType diagGrad = KPixmapEffect::DiagonalGradient; - QSize buttonSize1(btnWidth1_, availableTitleHeight); - QSize buttonSize2(btnWidth2_, availableTitleHeight); - - // Titlebar - - bgColor = options->color(Options::TitleBar, true); - - light = bgColor.light(120); - dark = bgColor.dark(120); - - KPixmapEffect::gradient(aTitle_, light, dark, vertGrad); - KPixmapEffect::gradient(aTitleText_, light, dark, vertGrad); - KPixmapEffect::gradient(aTitleLeft_, light, dark, vertGrad); - KPixmapEffect::gradient(aTitleRight_, light, dark, vertGrad); - - p.begin(&aTitle_); - p.setPen(dark); - p.drawLine(0, 0, 36, 0); - p.setPen(light); - p.drawLine(0, availableTitleHeight - 1, 36, availableTitleHeight - 1); - p.end(); - - p.begin(&aTitleText_); - p.setPen(dark); - p.drawLine(0, 0, 36, 0); - p.setPen(light); - p.drawLine(0, availableTitleHeight - 1, 36, availableTitleHeight - 1); - p.end(); - - p.begin(&aTitleLeft_); - p.setPen(dark); - p.drawPoint(1, 0); - p.drawLine(0, 0, 0, availableTitleHeight - 1); - p.setPen(light); - p.drawPoint(1, availableTitleHeight - 1); - p.end(); - - p.begin(&aTitleRight_); - p.setPen(dark); - p.drawPoint(0, 1); - p.setPen(light); - p.drawLine(1, 0, 1, availableTitleHeight - 1); - p.drawPoint(0, availableTitleHeight - 1); - p.end(); - - bgColor = options->color(Options::TitleBar, false); - light = bgColor.light(120); - dark = bgColor.dark(120); - - KPixmapEffect::gradient(iTitle_, light, dark, vertGrad); - KPixmapEffect::gradient(iTitleText_, light, dark, vertGrad); - KPixmapEffect::gradient(iTitleLeft_, light, dark, vertGrad); - KPixmapEffect::gradient(iTitleRight_, light, dark, vertGrad); - - p.begin(&iTitle_); - p.setPen(dark); - p.drawLine(0, 0, 36, 0); - p.setPen(light); - p.drawLine(0, availableTitleHeight - 1, 36, availableTitleHeight - 1); - p.end(); - - p.begin(&iTitleText_); - p.setPen(dark); - p.drawLine(0, 0, 36, 0); - p.setPen(light); - p.drawLine(0, availableTitleHeight - 1, 36, availableTitleHeight - 1); - p.end(); - - p.begin(&iTitleLeft_); - p.setPen(dark); - p.drawPoint(1, 0); - p.drawLine(0, 0, 0, availableTitleHeight - 1); - p.setPen(light); - p.drawPoint(1, availableTitleHeight - 1); - p.end(); - - p.begin(&iTitleRight_); - p.setPen(dark); - p.drawPoint(0, 1); - p.setPen(light); - p.drawLine(1, 0, 1, availableTitleHeight - 1); - p.drawPoint(0, availableTitleHeight - 1); - p.end(); - - p.begin(&aTitle_); - p.setPen(options->color(Options::TitleBar, true).light(150)); - - for (unsigned int y = 3; y < availableTitleHeight - 3; y += 3) - for (unsigned int x = 1; x < 36; x += 3) - p.drawPoint(x, y); - - p.setPen(options->color(Options::TitleBar, true).dark(150)); - - for (unsigned int y = 3; y < availableTitleHeight - 3; y += 3) - for (unsigned int x = 1; x < 36; x += 3) - p.drawPoint(x + 1, y + 1); - p.end(); - - // Buttons - - bgColor = buttonBgColorGroup.background(); - light = bgColor.light(120); - dark = bgColor.dark(120); - - btnPix1_ .resize(buttonSize1); - btnDownPix1_ .resize(buttonSize1); - btnPix2_ .resize(buttonSize2); - btnDownPix2_ .resize(buttonSize2); - - iBtnPix1_ .resize(buttonSize1); - iBtnDownPix1_ .resize(buttonSize1); - iBtnPix2_ .resize(buttonSize2); - iBtnDownPix2_ .resize(buttonSize2); - - KPixmapEffect::gradient(btnPix1_, light, dark, diagGrad); - KPixmapEffect::gradient(btnDownPix1_, dark, light, diagGrad); - KPixmapEffect::gradient(btnPix2_, light, dark, diagGrad); - KPixmapEffect::gradient(btnDownPix2_, dark, light, diagGrad); - - KPixmapEffect::gradient(iBtnPix1_, light, dark, diagGrad); - KPixmapEffect::gradient(iBtnDownPix1_, dark, light, diagGrad); - KPixmapEffect::gradient(iBtnPix2_, light, dark, diagGrad); - KPixmapEffect::gradient(iBtnDownPix2_, dark, light, diagGrad); - - drawButtonFrame(btnPix1_, buttonBgColorGroup, false); - drawButtonFrame(btnDownPix1_, buttonBgColorGroup, true); - drawButtonFrame(btnPix2_, buttonBgColorGroup, false); - drawButtonFrame(btnDownPix2_, buttonBgColorGroup, true); - - drawButtonFrame(iBtnPix1_, buttonBgColorGroup, false); - drawButtonFrame(iBtnDownPix1_, buttonBgColorGroup, true); - drawButtonFrame(iBtnPix2_, buttonBgColorGroup, false); - drawButtonFrame(iBtnDownPix2_, buttonBgColorGroup, true); - - p.flush(); -} - - QPixmap -Static::button(SymbolType t, bool active, bool down) -{ - bool buttonSize2 = (t == Sticky || t == Unsticky || t == Question); - QPixmap px = buttonPixmap(!buttonSize2, active, down); - - QBitmap b = glyph(t); - b.setMask(b); - - QPainter p(&px); - QPoint offset((buttonSize2 ? btnWidth2_ : btnWidth1_) / 2 - 4, (titleHeight_ - 6) / 2 - 4); - p.drawPixmap(offset, b); - - return px; -} - -//static unsigned char unsticky_bits[] = { -// 0x38, 0x38, 0x38, 0x38, 0x7c, 0x10, 0x10, 0x10}; -// -//static unsigned char sticky_bits[] = { -// 0x20, 0x70, 0xfa, 0x7c, 0x38, 0x14, 0x22, 0x01}; - -static unsigned char iconify_bits[] = { - 0xff, 0xff, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18}; - -static unsigned char close_bits[] = { - 0x42, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0x42}; - -static unsigned char maximize_bits[] = { - 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0xff, 0xff }; - -static unsigned char unmax_bits[] = { - 0x30, 0x18, 0xcc, 0xe6, 0xf3, 0xf9, 0xfc, 0xfc}; - -static unsigned char unsticky_bits[] = { - 0x3c, 0x66, 0xdb, 0xbd, 0xbd, 0xdb, 0x66, 0x3c}; - -static unsigned char sticky_bits[] = { - 0x3c, 0x66, 0xc3, 0x81, 0x81, 0xc3, 0x66, 0x3c}; - -//static unsigned char unsticky_bits[] = { -// 0x3c, 0x42, 0x99, 0xbd, 0xbd, 0x99, 0x42, 0x3c}; - -//static unsigned char sticky_bits[] = { -// 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c}; - -static unsigned char question_bits[] = { - 0x3c, 0x66, 0x06, 0x0c, 0x18, 0x00, 0x18, 0x18}; - - void -Static::_loadGlyphs() -{ - glyphClose_ = QBitmap(8, 8, close_bits); - glyphMaximise_ = QBitmap(8, 8, maximize_bits); - glyphUnmaximise_ = QBitmap(8, 8, unmax_bits); - glyphSticky_ = QBitmap(8, 8, sticky_bits); - glyphUnsticky_ = QBitmap(8, 8, unsticky_bits); - glyphIconify_ = QBitmap(8, 8, iconify_bits); - glyphQuestion_ = QBitmap(8, 8, question_bits); -} - -} // End namespace - -// vim:ts=2:sw=2:tw=78 - diff --git a/default/Static.h b/default/Static.h deleted file mode 100644 index f3a654b2b7..0000000000 --- a/default/Static.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_STATIC_H -#define DEFAULT_STATIC_H - -#include -#include -#include -#include - -#include - -#include "Defines.h" - -namespace Default -{ - -enum SymbolType { Sticky, Unsticky, Close, Iconify, Max, Unmax, Question }; - -class Static -{ - - public: - - Static() - { - instance_ = this; - _init(); - } - - ~Static() - { - instance_ = 0L; - } - - static Static * instance() - { - if (0 == instance_) - new Static; - - return instance_; - } - - void update(); - - const QPixmap & title(bool active) const - { return active ? aTitle_ : iTitle_; } - - const QPixmap & titleText(bool active) const - { return active ? aTitleText_ : iTitleText_; } - - const QPixmap & titleLeft(bool active) const - { return active ? aTitleLeft_ : iTitleLeft_; } - - const QPixmap & titleRight(bool active) const - { return active ? aTitleRight_ : iTitleRight_; } - - const QPixmap & resizeMidLeft(bool active) const - { return active ? aResizeMidLeft_ : iResizeMidLeft_; } - - const QPixmap & resizeMidRight(bool active) const - { return active ? aResizeMidRight_ : iResizeMidRight_; } - - const QPixmap & resizeMidMid(bool active) const - { return active ? aResizeMid_ : iResizeMid_; } - - QPixmap button(SymbolType t, bool active, bool down); - - const QPixmap & resize(bool active) const - { return active ? aResize_ : iResize_; } - - const QBitmap & glyph(SymbolType t) const - { - switch (t) { - case Close: return glyphClose_; - case Sticky: return glyphSticky_; - case Unsticky: return glyphUnsticky_; - case Iconify: return glyphIconify_; - case Max: return glyphMaximise_; - case Unmax: return glyphUnmaximise_; - case Question: return glyphQuestion_; - default: return glyphClose_; - } - } - - unsigned int buttonWidth1() const { return btnWidth1_; } - unsigned int buttonWidth2() const { return btnWidth2_; } - unsigned int titleHeight() const { return titleHeight_; } - - const KPixmap & buttonPixmap(int n, bool active, bool down) const - { - if (active) { - if (n == 1) - if (down) - return btnDownPix1_; - else - return btnPix1_; - else - if (down) - return btnDownPix2_; - else - return btnPix2_; - } else { - if (n == 1) - if (down) - return iBtnDownPix1_; - else - return iBtnPix1_; - else - if (down) - return iBtnDownPix2_; - else - return iBtnPix2_; - } - - } - - private: - - void _init(); - void _loadGlyphs(); - - static Static * instance_; - - QPixmap - aResize_, iResize_, - aResizeDown_, iResizeDown_, - aResizeMidLeft_, aResizeMidRight_, - iResizeMidLeft_, iResizeMidRight_, - aResizeMid_, iResizeMid_; - - QBitmap - glyphClose_, - glyphSticky_, - glyphUnsticky_, - glyphIconify_, - glyphMaximise_, - glyphUnmaximise_, - glyphQuestion_; - - KPixmap aTitle_, iTitle_; - KPixmap aTitleLeft_, iTitleLeft_; - KPixmap aTitleRight_, iTitleRight_; - KPixmap aTitleText_, iTitleText_; - - KPixmap btnPix1_, btnDownPix1_, iBtnPix1_, iBtnDownPix1_; - KPixmap btnPix2_, btnDownPix2_, iBtnPix2_, iBtnDownPix2_; - - unsigned int btnWidth1_; - unsigned int btnWidth2_; - - unsigned int titleHeight_; -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/StickyButton.cpp b/default/StickyButton.cpp deleted file mode 100644 index 31df7e68ae..0000000000 --- a/default/StickyButton.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include "StickyButton.h" - -namespace Default -{ - -StickyButton::StickyButton(QWidget * parent) - : Button(parent, Sticky) -{ -} - - void -StickyButton::mouseReleaseEvent(QMouseEvent * e) -{ - Button::mouseReleaseEvent(e); - - if (!rect().contains(e->pos())) - return; - - switch (e->button()) - { - default: - emit(toggleSticky()); - break; - } -} - - void -StickyButton::setOn(bool b) -{ - setType(b ? Unsticky : Sticky); - updateDisplay(); -} - -} // End namespace; - -// vim:ts=2:sw=2:tw=78 -#include "StickyButton.moc" diff --git a/default/StickyButton.h b/default/StickyButton.h deleted file mode 100644 index 2f615c606a..0000000000 --- a/default/StickyButton.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_STICKY_BUTTON_H -#define DEFAULT_STICKY_BUTTON_H - -#include "Button.h" - -namespace Default -{ - -class StickyButton : public Button -{ - Q_OBJECT - - public: - - StickyButton(QWidget * parent); - - signals: - - void toggleSticky(); - - protected slots: - - void setOn(bool); - - protected: - - void mouseReleaseEvent(QMouseEvent *); -}; - -} // End namespace; - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/TitleBar.cpp b/default/TitleBar.cpp deleted file mode 100644 index aa1e8f1c2d..0000000000 --- a/default/TitleBar.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include - -#include "Manager.h" -#include "TitleBar.h" -#include "TitleText.h" -#include "CloseButton.h" -#include "IconifyButton.h" -#include "QuestionButton.h" -#include "StickyButton.h" -#include "MaximiseButton.h" - -namespace Default -{ - -TitleBar::TitleBar(Manager * client) - : QWidget(client), - question_(0L) -{ - close_ = new CloseButton (this); - text_ = new TitleText (this, client); - iconify_ = new IconifyButton (this); - maximise_ = new MaximiseButton (this); - sticky_ = new StickyButton (this); - - if (client->providesContextHelp()) - question_ = new QuestionButton(this); - - // Close | Text | Question | Sticky | Iconify | Maximise - - QHBoxLayout * layout = new QHBoxLayout(this); - layout->setMargin(3); - - layout->addWidget(close_); - layout->addSpacing(2); - layout->addWidget(text_, 1); - layout->addSpacing(2); - if (0 != question_) - layout->addWidget(question_); - layout->addWidget(sticky_); - layout->addWidget(iconify_); - layout->addWidget(maximise_); - - connect( - close_, SIGNAL(closeClient()), - client, SLOT(closeWindow()) - ); - - connect( - sticky_, SIGNAL(toggleSticky()), - client, SLOT(toggleSticky()) - ); - - connect( - client, SIGNAL(stickyStatusChanged(bool)), - sticky_, SLOT(setOn(bool)) - ); - - connect( - iconify_, SIGNAL(iconifyClient()), - client, SLOT(iconify()) - ); - - connect( - maximise_, SIGNAL(maximiseClient()), - client, SLOT(maximize()) - ); - - connect( - maximise_, SIGNAL(vMaxClient()), - client, SLOT(vMax()) - ); - - connect( - maximise_, SIGNAL(raiseClient()), - client, SLOT(raise()) - ); - - connect( - client, SIGNAL(maximiseChanged(bool)), - maximise_, SLOT(setOn(bool)) - ); - - if (0 != question_) - connect( - question_, SIGNAL(contextHelp()), - client, SLOT(contextHelp()) - ); - - if ( client->isTransient() ) { - // lighter decoration for transient windows - sticky_->hide(); - iconify_->hide(); - maximise_->hide(); - } - -} - - void -TitleBar::updateDisplay() -{ - close_ ->updateDisplay(); - sticky_ ->updateDisplay(); - if (0 != question_) - question_ ->updateDisplay(); - text_ ->updateDisplay(); - iconify_ ->updateDisplay(); - maximise_ ->updateDisplay(); -} - - void -TitleBar::updateText() -{ - text_->updateDisplay(); -} - -TitleBar::~TitleBar() -{ -} - - void -TitleBar::resizeEvent(QResizeEvent *) -{ - int sizeProblem = 0; - - if (width() < 120) sizeProblem = 3; - else if (width() < 160) sizeProblem = 2; - else if (width() < 200) sizeProblem = 1; - - bool transient = ( (Client*) parentWidget() )->isTransient(); - - switch (sizeProblem) { - - case 1: - close_ ->show(); - sticky_ ->hide(); - if ( !transient ) - iconify_ ->show(); - if (0 != question_) - question_ ->hide(); - maximise_ ->hide(); - break; - - case 2: - close_ ->show(); - if (0 != question_) - question_ ->hide(); - sticky_ ->hide(); - iconify_ ->hide(); - maximise_ ->hide(); - break; - - case 3: - close_ ->hide(); - if (0 != question_) - question_ ->hide(); - sticky_ ->hide(); - iconify_ ->hide(); - maximise_ ->hide(); - break; - - case 0: - default: - close_ ->show(); - if (0 != question_) - question_->show(); - if ( !transient ) { - sticky_ ->show(); - iconify_ ->show(); - maximise_ ->show(); - } - break; - } -} - - void -TitleBar::setActive(bool b) -{ - sticky_->setActive(b); - close_->setActive(b); - text_->setActive(b); - iconify_->setActive(b); - maximise_->setActive(b); - if (0 != question_) - question_->setActive(b); -} - - void -TitleBar::paintEvent(QPaintEvent * e) -{ - QRect r(e->rect()); - - bool intersectsLeft = - r.intersects(QRect(0, 0, 1, height())); - - bool intersectsRight = - r.intersects(QRect(width() - 1, 0, width(), height())); - - bool intersectsTop = - r.intersects(QRect(0, 0, width(), 1)); - - if (intersectsTop || intersectsLeft || intersectsRight) { - - QPainter p(this); - p.setPen(Qt::black); - - if (intersectsTop) - p.drawLine(r.left(), 0, r.right(), 0); - - if (intersectsLeft) - p.drawLine(0, r.top(), 0, r.bottom()); - - if (intersectsRight) - p.drawLine(width() - 1, r.top(), width() - 1, r.bottom()); - } -} - - - - void -TitleBar::mousePressEvent(QMouseEvent * e) -{ - text_->client()->fakeMouseEvent(e, this); - QWidget::mousePressEvent(e); -} - - void -TitleBar::mouseReleaseEvent(QMouseEvent * e) -{ - text_->client()->fakeMouseEvent(e, this); - QWidget::mouseReleaseEvent(e); -} - - void -TitleBar::mouseMoveEvent(QMouseEvent * e) -{ - text_->client()->fakeMouseEvent(e, this); - QWidget::mouseMoveEvent(e); -} - - -} // End namespace - -// vim:ts=2:sw=2:tw=78 diff --git a/default/TitleBar.h b/default/TitleBar.h deleted file mode 100644 index 2a2b196ffa..0000000000 --- a/default/TitleBar.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_TITLE_BAR_H -#define DEFAULT_TITLE_BAR_H - -#include - -namespace Default -{ - -class Manager; -class QuestionButton; -class StickyButton; -class CloseButton; -class TitleText; -class IconifyButton; -class MaximiseButton; - -class TitleBar : public QWidget -{ - public: - - TitleBar(Manager * client); - virtual ~TitleBar(); - - void updateDisplay(); - void updateText(); - void updateMaximise(bool); - - void setActive(bool); - - protected: - - void resizeEvent(QResizeEvent *); - void paintEvent(QPaintEvent *); - - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - - private: - - CloseButton * close_; - - TitleText * text_; - - QuestionButton * question_; - StickyButton * sticky_; - IconifyButton * iconify_; - MaximiseButton * maximise_; -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/TitleText.cpp b/default/TitleText.cpp deleted file mode 100644 index 04c8d2ba63..0000000000 --- a/default/TitleText.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include - -#include "../options.h" -#include "../workspace.h" - -#include "TitleText.h" -#include "Manager.h" -#include "Static.h" - -namespace Default -{ - -TitleText::TitleText(QWidget * parent, Manager * client) - : DBWidget(parent, "TitleText"), - client_(client), - active_(false) -{ -} - -TitleText::~TitleText() -{ -} - - void -TitleText::setActive(bool b) -{ - active_ = b; - updateDisplay(); -} - - void -TitleText::updatePixmap() -{ - QPainter p(&buf()); - - Static * s = Static::instance(); - - p.drawPixmap(0, 0, s->titleLeft(active_)); - p.drawPixmap(width() - 2, 0, s->titleRight(active_)); - p.drawTiledPixmap(2, 0, width() - 2, height(), s->title(active_)); - - QFontMetrics fm(options->font()); - unsigned int w = fm.width(client_->caption()); - p.drawTiledPixmap( - width() / 2 - w / 2, 0, - w, height(), - s->titleText(active_) - ); - - p.setPen(options->color(Options::Font, active_)); - p.setFont(options->font()); - p.drawText(4, 0, width() - 8, height(), AlignCenter, client_->caption()); -} - - void -TitleText::mousePressEvent(QMouseEvent * e) -{ - client_->fakeMouseEvent(e, this); - DBWidget::mousePressEvent(e); -} - - void -TitleText::mouseReleaseEvent(QMouseEvent * e) -{ - client_->fakeMouseEvent(e, this); - DBWidget::mouseReleaseEvent(e); -} - - void -TitleText::mouseMoveEvent(QMouseEvent * e) -{ - client_->fakeMouseEvent(e, this); - DBWidget::mouseMoveEvent(e); -} - - void -TitleText::mouseDoubleClickEvent(QMouseEvent * ) -{ - client_->workspace()->performWindowOperation( - client_, - options->operationTitlebarDblClick()); - - client_->workspace()->requestFocus(client_); -} - -} // End namespace - -// vim:ts=2:sw=2:tw=78 - diff --git a/default/TitleText.h b/default/TitleText.h deleted file mode 100644 index f774719d96..0000000000 --- a/default/TitleText.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Default KWin client - - Copyright 2000 - Rik Hemsley - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef DEFAULT_TITLE_TEXT_H -#define DEFAULT_TITLE_TEXT_H - -#include -#include - -#include "DBWidget.h" - -namespace Default -{ - -class Manager; - -class TitleText : public DBWidget -{ - public: - - TitleText(QWidget * parent, Manager * client); - virtual ~TitleText(); - - void setActive(bool); - Manager * client() { return client_; } - - protected: - - void updatePixmap(); - - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void mouseDoubleClickEvent(QMouseEvent *); - - private: - - Manager * client_; - bool active_; -}; - -} // End namespace - -#endif - -// vim:ts=2:sw=2:tw=78 diff --git a/default/kdedefault.cpp b/default/kdedefault.cpp new file mode 100644 index 0000000000..4796d9c1a5 --- /dev/null +++ b/default/kdedefault.cpp @@ -0,0 +1,614 @@ +#include // up here to avoid X11 header conflict :P +#include "kdedefault.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../workspace.h" +#include "../options.h" + +extern "C" +{ + Client *allocate(Workspace *ws, WId w) + { + return(new KDEClient(ws, w)); + } +} + + +static unsigned char iconify_bits[] = { + 0xff, 0xff, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18}; + +static unsigned char close_bits[] = { + 0x42, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0x42}; + +static unsigned char maximize_bits[] = { + 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0xff, 0xff }; + +static unsigned char minmax_bits[] = { + 0x0c, 0x18, 0x33, 0x67, 0xcf, 0x9f, 0x3f, 0x3f}; + +static unsigned char unsticky_bits[] = { + 0x00, 0x18, 0x18, 0x7e, 0x7e, 0x18, 0x18, 0x00}; + +static unsigned char sticky_bits[] = { + 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00}; + + + +static unsigned char question_bits[] = { + 0x3c, 0x66, 0x60, 0x30, 0x18, 0x00, 0x18, 0x18}; + +static QPixmap *titlePix=0; +static KPixmap *aUpperGradient=0; +static KPixmap *iUpperGradient=0; +// buttons active, inactive, up, down, and 2 sizes :P +static KPixmap *btnPix1=0; +static KPixmap *iBtnPix1=0; +static KPixmap *btnDownPix1=0; +static KPixmap *iBtnDownPix1=0; +static KPixmap *btnPix2=0; +static KPixmap *btnDownPix2=0; +static KPixmap *iBtnPix2=0; +static KPixmap *iBtnDownPix2=0; +static QColor btnForeground; + +static bool pixmaps_created = false; + +static int titleHeight = 14; // configurable title height not implemented yet +static int btnWidth1 = 18; +static int btnWidth2 = 28; + + +static void drawButtonFrame(KPixmap *pix, const QColorGroup &g, bool sunken) +{ + QPainter p; + int w = pix->width(); + int h = pix->height(); + int x2 = w-1; + int y2 = h-1; + p.begin(pix); + + if(sunken){ + qDrawShadePanel(&p, 0, 0, w, h, g, true, 2); + } + else{ + p.setPen(g.dark()); + p.drawRect(0, 0, w-1, h-1); + p.setPen(g.light()); + p.drawLine(x2, 0, x2, y2); + p.drawLine(0, y2, x2, y2); + p.drawLine(1, 1, x2-2, 1); + p.drawLine(1, 1, 1, y2-2); + p.end(); + } +} + +static void create_pixmaps() +{ + if(pixmaps_created) + return; + pixmaps_created = true; + + // titlebar + QPainter p; + QPainter maskPainter; + int i, x, y; + titlePix = new QPixmap(33, 12); + QBitmap mask(33, 12); + mask.fill(Qt::color0); + + p.begin(titlePix); + maskPainter.begin(&mask); + maskPainter.setPen(Qt::color1); + for(i=0, y=2; i < 3; ++i, y+=4){ + for(x=1; x <= 33; x+=3){ + p.setPen(options->color(Options::TitleBar, true).light(150)); + p.drawPoint(x, y); + maskPainter.drawPoint(x, y); + p.setPen(options->color(Options::TitleBar, true).dark(150)); + p.drawPoint(x+1, y+1); + maskPainter.drawPoint(x+1, y+1); + } + } + p.end(); + maskPainter.end(); + titlePix->setMask(mask); + + if(QPixmap::defaultDepth() > 8){ + aUpperGradient = new KPixmap; + aUpperGradient->resize(32, titleHeight+2); + iUpperGradient = new KPixmap; + iUpperGradient->resize(32, titleHeight+2); + QColor bgColor = options->color(Options::TitleBar, true); + KPixmapEffect::gradient(*aUpperGradient, + bgColor.light(120), + bgColor.dark(120), + KPixmapEffect::VerticalGradient); + bgColor = options->color(Options::TitleBar, false); + KPixmapEffect::gradient(*iUpperGradient, + bgColor.light(120), + bgColor.dark(120), + KPixmapEffect::VerticalGradient); + } + // buttons (active/inactive, sunken/unsunken, 2 sizes each) + QColorGroup g = options->colorGroup(Options::ButtonBg, true); + QColor c = g.background(); + btnPix1 = new KPixmap; + btnPix1->resize(btnWidth1, titleHeight); + btnDownPix1 = new KPixmap; + btnDownPix1->resize(btnWidth1, titleHeight); + btnPix2 = new KPixmap; + btnPix2->resize(btnWidth2, titleHeight); + btnDownPix2 = new KPixmap; + btnDownPix2->resize(btnWidth2, titleHeight); + iBtnPix1 = new KPixmap; + iBtnPix1->resize(btnWidth1, titleHeight); + iBtnDownPix1 = new KPixmap; + iBtnDownPix1->resize(btnWidth1, titleHeight); + iBtnPix2 = new KPixmap; + iBtnPix2->resize(btnWidth2, titleHeight); + iBtnDownPix2 = new KPixmap; + iBtnDownPix2->resize(btnWidth2, titleHeight); + if(QPixmap::defaultDepth() > 8){ + KPixmapEffect::gradient(*btnPix1, c.light(120), c.dark(130), + KPixmapEffect::DiagonalGradient); + KPixmapEffect::gradient(*btnDownPix1, c.dark(130), c.light(120), + KPixmapEffect::DiagonalGradient); + KPixmapEffect::gradient(*btnPix2, c.light(120), c.dark(130), + KPixmapEffect::DiagonalGradient); + KPixmapEffect::gradient(*btnDownPix2, c.dark(130), c.light(120), + KPixmapEffect::DiagonalGradient); + g = options->colorGroup(Options::ButtonBg, false); + c = g.background(); + KPixmapEffect::gradient(*iBtnPix1, c.light(120), c.dark(130), + KPixmapEffect::DiagonalGradient); + KPixmapEffect::gradient(*iBtnDownPix1, c.dark(130), c.light(120), + KPixmapEffect::DiagonalGradient); + KPixmapEffect::gradient(*iBtnPix2, c.light(120), c.dark(130), + KPixmapEffect::DiagonalGradient); + KPixmapEffect::gradient(*iBtnDownPix2, c.dark(130), c.light(120), + KPixmapEffect::DiagonalGradient); + } + else{ + btnPix1->fill(c.rgb()); + btnDownPix1->fill(c.rgb()); + btnPix2->fill(c.rgb()); + btnDownPix2->fill(c.rgb()); + g = options->colorGroup(Options::ButtonBg, false); + c = g.background(); + iBtnPix1->fill(c.rgb()); + iBtnDownPix1->fill(c.rgb()); + iBtnPix2->fill(c.rgb()); + iBtnDownPix2->fill(c.rgb()); + } + g = options->colorGroup(Options::ButtonBg, true); + c = g.background(); + drawButtonFrame(btnPix1, g, false); + drawButtonFrame(btnDownPix1, g, true); + drawButtonFrame(btnPix2, g, false); + drawButtonFrame(btnDownPix2, g, true); + g = options->colorGroup(Options::ButtonBg, false); + c = g.background(); + drawButtonFrame(iBtnPix1, g, false); + drawButtonFrame(iBtnDownPix1, g, true); + drawButtonFrame(iBtnPix2, g, false); + drawButtonFrame(iBtnDownPix2, g, true); + + if(qGray(options->color(Options::ButtonBg, true).rgb()) > 128) + btnForeground = Qt::black; + else + btnForeground = Qt::white; +} + + +SystemButton::SystemButton(int w, int h, Client *parent, const char *name, + const unsigned char *bitmap) + : QButton(parent, name) +{ + client = parent; + defaultSize = QSize(w, h); + setFixedHeight(h); + resize(defaultSize); + if(bitmap) + setBitmap(bitmap); + //setBackgroundMode(QWidget::NoBackground); +} + +QSize SystemButton::sizeHint() const +{ + return(defaultSize); +} + +void SystemButton::reset() +{ + repaint(false); +} + +void SystemButton::setBitmap(const unsigned char *bitmap) +{ + deco = QBitmap(8, 8, bitmap, true); + deco.setMask(deco); + repaint(); +} + +void SystemButton::drawButton(QPainter *p) +{ + bool smallBtn = width() == btnWidth1; + if(btnPix1){ + if(client->isActive()){ + if(isDown()) + p->drawPixmap(0, 0, smallBtn ? *btnDownPix1 : *btnDownPix2); + else + p->drawPixmap(0, 0, smallBtn ? *btnPix1 : *btnPix2); + } + else{ + if(isDown()) + p->drawPixmap(0, 0, smallBtn ? *iBtnDownPix1 : *iBtnDownPix2); + else + p->drawPixmap(0, 0, smallBtn ? *iBtnPix1 : *iBtnPix2); + } + } + else{ + QColorGroup g = options->colorGroup(Options::ButtonBg, + client->isActive()); + int w = width(); + int h = height(); + p->fillRect(1, 1, w-2, h-2, isDown() ? g.mid() : g.button()); + p->setPen(isDown() ? g.dark() : g.light()); + p->drawLine(0, 0, w-1, 0); + p->drawLine(0, 0, 0, w-1); + p->setPen(isDown() ? g.light() : g.dark()); + p->drawLine(w-1, 0, w-1, h-1); + p->drawLine(0, h-1, w-1, h-1); + } + + p->setPen(btnForeground); + int xOff = (width()-8)/2; + int yOff = (height()-8)/2; + p->drawPixmap(isDown() ? xOff+1: xOff, isDown() ? yOff+1 : yOff, deco); +} + +void KDEClient::slotReset() +{ + delete titlePix; + if(aUpperGradient){ + delete aUpperGradient; + delete iUpperGradient; + delete btnPix1; + delete btnDownPix1; + delete iBtnPix1; + delete iBtnDownPix1; + delete btnPix2; + delete btnDownPix2; + delete iBtnPix2; + delete iBtnDownPix2; + } + pixmaps_created = false; + create_pixmaps(); + int i; + for(i=0; i < 5; ++i){ + if(button[i]) + button[i]->reset(); + } + repaint(); +} + +KDEClient::KDEClient( Workspace *ws, WId w, QWidget *parent, + const char *name ) + : Client( ws, w, parent, name, WResizeNoErase ) +{ + create_pixmaps(); + connect(options, SIGNAL(resetClients()), this, SLOT(slotReset())); + bool help = providesContextHelp(); + + + QGridLayout* g = new QGridLayout(this, 0, 0, 0); + g->setResizeMode(QLayout::FreeResize); + g->addRowSpacing(0, 3); + g->addRowSpacing(2, 1); + g->addWidget(windowWrapper(), 3, 1); + g->setRowStretch(3, 10); + g->addRowSpacing(4, 8); // bottom handles + g->addColSpacing(0, 4); + g->addColSpacing(2, 4); + + button[BtnClose] = new SystemButton(28, titleHeight, this, "close", close_bits); + button[BtnSticky] = new SystemButton(18, titleHeight, this, "sticky"); + if(isSticky()) + button[BtnSticky]->setBitmap(unsticky_bits); + else + button[BtnSticky]->setBitmap(sticky_bits); + button[BtnIconify] = new SystemButton(28, titleHeight, this, "iconify", + iconify_bits); + button[BtnMax] = new SystemButton(28, titleHeight, this, "maximize", + maximize_bits); + if(help){ + button[BtnHelp] = new SystemButton(18, titleHeight, this, "help", + question_bits); + connect(button[BtnHelp], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) ); + } + else + button[BtnHelp] = NULL; + + connect( button[BtnClose], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) ); + connect( button[BtnSticky], SIGNAL( clicked() ), this, ( SLOT( toggleSticky() ) ) ); + connect( button[BtnIconify], SIGNAL( clicked() ), this, ( SLOT( iconify() ) ) ); + connect( button[BtnMax], SIGNAL( clicked() ), this, ( SLOT( maximize() ) ) ); + + hb = new QHBoxLayout(); + hb->setResizeMode(QLayout::FreeResize); + g->addLayout( hb, 1, 1 ); + hb->addWidget( button[BtnClose]); + hb->addSpacing(1); + titlebar = new QSpacerItem(10, titleHeight, QSizePolicy::Expanding, + QSizePolicy::Minimum); + hb->addItem(titlebar); + hb->addSpacing(1); + if(help){ + hb->addWidget( button[BtnHelp]); + } + hb->addWidget( button[BtnSticky]); + hb->addWidget( button[BtnIconify]); + hb->addWidget( button[BtnMax]); + + hiddenItems = false; +} + +void KDEClient::resizeEvent( QResizeEvent* e) +{ + Client::resizeEvent( e ); + + doShape(); + calcHiddenButtons(); + if ( isVisibleToTLW() && !testWFlags( WNorthWestGravity )) { + QPainter p( this ); + QRect t = titlebar->geometry(); + t.setTop( 0 ); + QRegion r = rect(); + r = r.subtract( t ); + p.setClipRegion( r ); + p.eraseRect( rect() ); + } +} + +void KDEClient::captionChange( const QString& ) +{ + repaint( titlebar->geometry(), false ); +} + +void KDEClient::paintEvent( QPaintEvent* ) +{ + QPainter p(this); + QColorGroup g = options->colorGroup(Options::Frame, isActive()); + + QRect r(rect()); + p.setPen(Qt::black); + p.drawRect(r); + // outer frame + p.setPen(g.light()); + p.drawLine(r.x()+1, r.y()+1, r.right()-1, r.y()+1); + p.drawLine(r.x()+1, r.y()+1, r.x()+1, r.bottom()-1); + p.setPen(g.dark()); + p.drawLine(r.right()-1, r.y()+1, r.right()-1, r.bottom()-1); + p.drawLine(r.x()+1, r.bottom()-1, r.right()-1, r.bottom()-1); + + // inner rect + p.drawRect(r.x()+3, r.y()+titleHeight+3, r.width()-6, + r.height()-titleHeight-10); + // handles + if(r.width() > 44){ + qDrawShadePanel(&p, r.x()+1, r.bottom()-6, 20, + 6, g, false, 1, &g.brush(QColorGroup::Mid)); + qDrawShadePanel(&p, r.x()+21, r.bottom()-6, r.width()-42, 6, + g, false, 1, isActive() ? + &g.brush(QColorGroup::Background) : + &g.brush(QColorGroup::Mid)); + qDrawShadePanel(&p, r.right()-20, r.bottom()-6, 20, 6, + g, false, 1, &g.brush(QColorGroup::Mid)); + } + else + qDrawShadePanel(&p, r.x()+1, r.bottom()-6, r.width()-2, 6, g, + false, 1, isActive() ? + &g.brush(QColorGroup::Background) : + &g.brush(QColorGroup::Mid)); + + r = titlebar->geometry(); + + if(isActive()){ + updateActiveBuffer(); + p.drawPixmap(r.x(), r.y(), activeBuffer); + } + else{ + if(iUpperGradient) + p.drawTiledPixmap(r.x(), r.y(), r.width(), r.height()-1, + *iUpperGradient); + else + p.fillRect(r.x(), r.y(), r.width(), r.height()-1, + options->color(Options::TitleBar, false)); + + p.setFont(options->font(false)); + QFontMetrics fm(options->font(false)); + g = options->colorGroup(Options::TitleBar, false); + if(iUpperGradient) + p.drawTiledPixmap(r.x()+((r.width()-fm.width(caption()))/2)-4, + r.y(), fm.width(caption())+8, r.height()-1, + *iUpperGradient); + else + p.fillRect(r.x()+((r.width()-fm.width(caption()))/2)-4, r.y(), + fm.width(caption())+8, r.height()-1, + g.brush(QColorGroup::Background)); + p.setPen(g.mid()); + p.drawLine(r.x(), r.y(), r.right(), r.y()); + p.drawLine(r.x(), r.y(), r.x(), r.bottom()); + p.setPen(g.button()); + p.drawLine(r.right(), r.y(), r.right(), r.bottom()); + p.drawLine(r.x(), r.bottom(), r.right(), r.bottom()); + p.setPen(options->color(Options::Font, false)); + p.drawText(r.x(), r.y(), r.width(), r.height()-1, + AlignCenter, caption() ); + } +} + +#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) + +void KDEClient::doShape() +{ + QRegion mask(QRect(0, 0, width(), height())); + mask -= QRect(0, 0, 1, 1); + mask -= QRect(width()-1, 0, 1, 1); + mask -= QRect(0, height()-1, 1, 1); + mask -= QRect(width()-1, height()-1, 1, 1); + + setMask(mask); +} + +void KDEClient::showEvent(QShowEvent *ev) +{ + Client::showEvent(ev); + doShape(); + repaint(); +} + +void KDEClient::windowWrapperShowEvent( QShowEvent* ) +{ + doShape(); +} + +void KDEClient::mouseDoubleClickEvent( QMouseEvent * e ) +{ + if (titlebar->geometry().contains( e->pos() ) ) + setShade( !isShade() ); + workspace()->requestFocus( this ); +} + +void KDEClient::stickyChange(bool on) +{ + button[BtnSticky]->setBitmap(on ? unsticky_bits : sticky_bits); +} + +void KDEClient::maximizeChange(bool m) +{ + button[BtnMax]->setBitmap(m ? minmax_bits : maximize_bits); +} + +void KDEClient::init() +{ + // +} + +void KDEClient::activeChange(bool) +{ + repaint(false); + int i; + for(i=0; i < 5; ++i){ + if(button[i]) + button[i]->reset(); + } +} + + +void KDEClient::calcHiddenButtons() +{ + // order of hiding is help, sticky, maximize, minimize, close; + // buttons can have + static int lastWidth=0; + int minWidth = 32 + btnWidth2*3 + (providesContextHelp() ? btnWidth1*2 : + btnWidth1); + + if(lastWidth > width()){ // shrinking + lastWidth = width(); + if(width() < minWidth){ + hiddenItems = true; + int i; + for(i=0; i<5; ++i){ + if(button[i]){ + if(button[i]->isVisible()){ + button[i]->hide(); + } + minWidth-=button[i]->sizeHint().width(); + if(width() >= minWidth) + return; + } + } + } + } + else if(hiddenItems){ // expanding + lastWidth = width(); + int i; + int totalSize=32; + for(i=4; i>=0; --i){ + if(button[i]){ + if(button[i]->sizeHint().width() + totalSize <= width()){ + totalSize+=button[i]->sizeHint().width(); + if(!button[i]->isVisible()){ + button[i]->resize(button[i]->sizeHint()); + button[i]->show(); + } + } + else + return; + } + } + // all items shown now + hiddenItems = false; + } + else + lastWidth = width(); +} + +void KDEClient::updateActiveBuffer() +{ + static int lastWidth = 0; + + if(lastWidth == titlebar->geometry().width()) + return; + lastWidth = titlebar->geometry().width(); + + activeBuffer.resize(titlebar->geometry().width(), + titlebar->geometry().height()-1); + QPainter p; + QRect r(0, 0, activeBuffer.width(), activeBuffer.height()); + p.begin(&activeBuffer); + if(aUpperGradient){ + p.drawTiledPixmap(r, *aUpperGradient); + } + else{ + p.fillRect(r, options->color(Options::TitleBar, true)); + } + if(titlePix) + p.drawTiledPixmap(r, *titlePix); + + p.setFont(options->font(true)); + QFontMetrics fm(options->font(true)); + QColorGroup g = options->colorGroup(Options::TitleBar, true); + if(aUpperGradient) + p.drawTiledPixmap(r.x()+((r.width()-fm.width(caption()))/2)-4, + r.y(), fm.width(caption())+8, r.height()-1, + *aUpperGradient); + else + p.fillRect(r.x()+((r.width()-fm.width(caption()))/2)-4, 0, + fm.width(caption())+8, r.height(), + g.brush(QColorGroup::Background)); + p.setPen(g.mid()); + p.drawLine(r.x(), r.y(), r.right(), r.y()); + p.drawLine(r.x(), r.y(), r.x(), r.bottom()); + p.setPen(g.button()); + p.drawLine(r.right(), r.y(), r.right(), r.bottom()); + p.drawLine(r.x(), r.bottom(), r.right(), r.bottom()); + p.setPen(options->color(Options::Font, true)); + p.drawText(r.x(), r.y(), r.width(), r.height()-1, + AlignCenter, caption() ); + p.end(); +} + + +#include "kdedefault.moc" diff --git a/default/kdedefault.h b/default/kdedefault.h new file mode 100644 index 0000000000..758b635f8b --- /dev/null +++ b/default/kdedefault.h @@ -0,0 +1,65 @@ +#ifndef __KDECLIENT_H +#define __KDECLIENT_H + +#include +#include +#include +#include "../client.h" +class QLabel; +class QSpacerItem; +class QHBoxLayout; + + +// get rid of autohide :P +class SystemButton : public QButton +{ +public: + SystemButton(int w, int h, Client *parent=0, const char *name=0, + const unsigned char *bitmap=NULL); + void setBitmap(const unsigned char *bitmap); + void reset(); + QSize sizeHint() const; +protected: + virtual void drawButton(QPainter *p); + void drawButtonLabel(QPainter *){;} + QSize defaultSize; + QBitmap deco; + Client *client; +}; + +class KDEClient : public Client +{ + Q_OBJECT +public: + enum Buttons{BtnHelp=0, BtnSticky, BtnMax, BtnIconify, BtnClose}; + KDEClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 ); + ~KDEClient(){;} +protected: + void resizeEvent( QResizeEvent* ); + void paintEvent( QPaintEvent* ); + void showEvent( QShowEvent* ); + void windowWrapperShowEvent( QShowEvent* ); + void mouseDoubleClickEvent( QMouseEvent * ); + void init(); + void captionChange( const QString& name ); + void stickyChange(bool on); + void maximizeChange(bool m); + void doShape(); + void activeChange(bool); + + void calcHiddenButtons(); + void updateActiveBuffer(); +protected slots: + void slotReset(); +private: + SystemButton* button[5]; + QSpacerItem* titlebar; + bool hiddenItems; + QHBoxLayout *hb; + KPixmap activeBuffer; +}; + + + + +#endif diff --git a/plugins.cpp b/plugins.cpp index 2e7179b426..86c140444b 100644 --- a/plugins.cpp +++ b/plugins.cpp @@ -17,7 +17,7 @@ Copyright (C) 1999, 2000 Daniel M. Duley #include #include "plugins.h" -#include "Manager.h" +#include "kdedefault.h" PluginMenu::PluginMenu(PluginMgr *manager, QWidget *parent, const char *name) : QPopupMenu(parent, name) @@ -122,7 +122,7 @@ Client* PluginMgr::allocateClient(Workspace *ws, WId w) if(alloc_ptr) return(alloc_ptr(ws, w)); else - return(new Default::Manager(ws, w)); + return(new KDEClient(ws, w)); } void PluginMgr::loadPlugin(QString nameStr) diff --git a/workspace.cpp b/workspace.cpp index b4631868bd..38895e9657 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -20,7 +20,6 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include "workspace.h" #include "client.h" -#include "Manager.h" #include "tabbox.h" #include "atoms.h" #include "plugins.h" @@ -167,7 +166,7 @@ Client* Workspace::clientFactory( WId w ) } case NET::Toolbar: - return new Default::ToolManager( this, w); // TODO use mgr.allocateClient... + return (mgr.allocateClient(this,w) ); // TODO use mgr.allocateClient in toolbar mode case NET::Menu: case NET::Dock: