From b5d38fd2e94066885d4620b0c35c48a2faa5aa44 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:27:15 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeartwork@1157637 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kwin-styles/riscos/AboveButton.cpp | 6 +- kwin-styles/riscos/AboveButton.h | 4 +- kwin-styles/riscos/Button.cpp | 30 +++---- kwin-styles/riscos/Button.h | 18 ++-- kwin-styles/riscos/CloseButton.cpp | 6 +- kwin-styles/riscos/CloseButton.h | 4 +- kwin-styles/riscos/HelpButton.cpp | 6 +- kwin-styles/riscos/HelpButton.h | 4 +- kwin-styles/riscos/IconifyButton.cpp | 6 +- kwin-styles/riscos/IconifyButton.h | 4 +- kwin-styles/riscos/LowerButton.cpp | 6 +- kwin-styles/riscos/LowerButton.h | 4 +- kwin-styles/riscos/Manager.cpp | 150 +++++++++++++++++----------------- kwin-styles/riscos/Manager.h | 34 ++++---- kwin-styles/riscos/MaximiseButton.cpp | 16 ++-- kwin-styles/riscos/MaximiseButton.h | 4 +- kwin-styles/riscos/Palette.h | 6 +- kwin-styles/riscos/Static.cpp | 64 +++++++-------- kwin-styles/riscos/Static.h | 32 ++++---- kwin-styles/riscos/StickyButton.cpp | 16 ++-- kwin-styles/riscos/StickyButton.h | 4 +- 21 files changed, 212 insertions(+), 212 deletions(-) (limited to 'kwin-styles/riscos') diff --git a/kwin-styles/riscos/AboveButton.cpp b/kwin-styles/riscos/AboveButton.cpp index 738b7f79..7b66e3ba 100644 --- a/kwin-styles/riscos/AboveButton.cpp +++ b/kwin-styles/riscos/AboveButton.cpp @@ -44,13 +44,13 @@ static const char * const above_xpm[] = { " ..... ", " "}; -AboveButton::AboveButton(QWidget *parent) +AboveButton::AboveButton(TQWidget *parent) : Button(parent, i18n("Keep above others")) { - setPixmap(QPixmap((const char **)above_xpm)); + setPixmap(TQPixmap((const char **)above_xpm)); } -void AboveButton::mouseReleaseEvent(QMouseEvent *e) +void AboveButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/AboveButton.h b/kwin-styles/riscos/AboveButton.h index b7a910ec..9ea0e005 100644 --- a/kwin-styles/riscos/AboveButton.h +++ b/kwin-styles/riscos/AboveButton.h @@ -34,7 +34,7 @@ class AboveButton : public Button public: - AboveButton(QWidget *parent); + AboveButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class AboveButton : public Button protected: - void mouseReleaseEvent(QMouseEvent*); + void mouseReleaseEvent(TQMouseEvent*); }; } // End namespace diff --git a/kwin-styles/riscos/Button.cpp b/kwin-styles/riscos/Button.cpp index d4da6ecc..d126ced1 100644 --- a/kwin-styles/riscos/Button.cpp +++ b/kwin-styles/riscos/Button.cpp @@ -20,23 +20,23 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include "Button.h" #include "Static.h" namespace RiscOS { -Button::Button(QWidget *parent, const QString& tip, +Button::Button(TQWidget *parent, const TQString& tip, const ButtonState realizeButtons) - : QWidget(parent, "Button", 0), + : TQWidget(parent, "Button", 0), realizeButtons_(realizeButtons), lastButton_(NoButton), alignment_(Left), down_ (false), active_ (false) { - QToolTip::add(this, tip); + TQToolTip::add(this, tip); setBackgroundColor(Qt::black); setFixedSize(Static::instance()->titleHeight() - 1, @@ -65,32 +65,32 @@ Button::Alignment Button::alignment() const return alignment_; } -void Button::mousePressEvent(QMouseEvent *e) +void Button::mousePressEvent(TQMouseEvent *e) { down_ = true; lastButton_ = e->button(); repaint(); - QMouseEvent me(e->type(), e->pos(), e->globalPos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons_) ? LeftButton : NoButton, e->state()); - QWidget::mousePressEvent(&me); + TQWidget::mousePressEvent(&me); } -void Button::mouseReleaseEvent(QMouseEvent *e) +void Button::mouseReleaseEvent(TQMouseEvent *e) { down_ = false; lastButton_ = e->button(); repaint(); - QMouseEvent me(e->type(), e->pos(), e->globalPos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons_) ? LeftButton : NoButton, e->state()); - QWidget::mouseReleaseEvent(&me); + TQWidget::mouseReleaseEvent(&me); } -void Button::setPixmap(const QPixmap &p) +void Button::setPixmap(const TQPixmap &p) { - if (QPixmap::defaultDepth() <= 8) + if (TQPixmap::defaultDepth() <= 8) aPixmap_ = iPixmap_ = p; else { @@ -98,8 +98,8 @@ void Button::setPixmap(const QPixmap &p) QRgb* data = NULL; QRgb w = qRgb(255, 255, 255); - QImage aTx(p.convertToImage()); - QImage iTx(aTx.copy()); + TQImage aTx(p.convertToImage()); + TQImage iTx(aTx.copy()); const KDecorationOptions* options = KDecoration::options(); light = options->color(KDecoration::ColorButtonBg, true).light(150).rgb(); @@ -136,7 +136,7 @@ void Button::setPixmap(const QPixmap &p) repaint(); } -void Button::paintEvent(QPaintEvent *) +void Button::paintEvent(TQPaintEvent *) { bitBlt(this, alignment_ == Left ? 1 : 0, 0, &Static::instance()->buttonBase(active_, down_)); diff --git a/kwin-styles/riscos/Button.h b/kwin-styles/riscos/Button.h index 1289a2fa..fc29e205 100644 --- a/kwin-styles/riscos/Button.h +++ b/kwin-styles/riscos/Button.h @@ -23,8 +23,8 @@ #ifndef RISC_OS_BUTTON_H #define RISC_OS_BUTTON_H -#include -#include +#include +#include #include #include @@ -41,7 +41,7 @@ class Button : public QWidget enum Alignment { Left, Right }; - Button(QWidget *parent, const QString &tip, + Button(TQWidget *parent, const TQString &tip, const ButtonState realizeButton = LeftButton); virtual ~Button(); @@ -55,13 +55,13 @@ class Button : public QWidget protected: - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *) { /* Empty. */ } + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *) { /* Empty. */ } - void setPixmap(const QPixmap &); + void setPixmap(const TQPixmap &); ButtonState realizeButtons_; ButtonState lastButton_; @@ -71,7 +71,7 @@ class Button : public QWidget Alignment alignment_; bool down_; bool active_; - QPixmap aPixmap_, iPixmap_; + TQPixmap aPixmap_, iPixmap_; }; } // End namespace diff --git a/kwin-styles/riscos/CloseButton.cpp b/kwin-styles/riscos/CloseButton.cpp index 4f2066cf..1a4c06b5 100644 --- a/kwin-styles/riscos/CloseButton.cpp +++ b/kwin-styles/riscos/CloseButton.cpp @@ -44,13 +44,13 @@ static const char * const close_xpm[] = { " .+. .+. ", " . . "}; -CloseButton::CloseButton(QWidget *parent) +CloseButton::CloseButton(TQWidget *parent) : Button(parent, i18n("Close")) { - setPixmap(QPixmap((const char **)close_xpm)); + setPixmap(TQPixmap((const char **)close_xpm)); } -void CloseButton::mouseReleaseEvent(QMouseEvent *e) +void CloseButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/CloseButton.h b/kwin-styles/riscos/CloseButton.h index 73791b76..b9173c14 100644 --- a/kwin-styles/riscos/CloseButton.h +++ b/kwin-styles/riscos/CloseButton.h @@ -34,7 +34,7 @@ class CloseButton : public Button public: - CloseButton(QWidget *parent); + CloseButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class CloseButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); }; } // End namespace; diff --git a/kwin-styles/riscos/HelpButton.cpp b/kwin-styles/riscos/HelpButton.cpp index a3d36668..936738eb 100644 --- a/kwin-styles/riscos/HelpButton.cpp +++ b/kwin-styles/riscos/HelpButton.cpp @@ -44,13 +44,13 @@ static const char * const help_xpm[] = { " + ++ ", " ++ "}; -HelpButton::HelpButton(QWidget *parent) +HelpButton::HelpButton(TQWidget *parent) : Button(parent, i18n("Help")) { - setPixmap(QPixmap((const char **)help_xpm)); + setPixmap(TQPixmap((const char **)help_xpm)); } -void HelpButton::mouseReleaseEvent(QMouseEvent *e) +void HelpButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/HelpButton.h b/kwin-styles/riscos/HelpButton.h index 89d76453..f825a05b 100644 --- a/kwin-styles/riscos/HelpButton.h +++ b/kwin-styles/riscos/HelpButton.h @@ -34,7 +34,7 @@ class HelpButton : public Button public: - HelpButton(QWidget *parent); + HelpButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class HelpButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); }; } // End namespace; diff --git a/kwin-styles/riscos/IconifyButton.cpp b/kwin-styles/riscos/IconifyButton.cpp index 760194f5..b5eef9e5 100644 --- a/kwin-styles/riscos/IconifyButton.cpp +++ b/kwin-styles/riscos/IconifyButton.cpp @@ -44,13 +44,13 @@ static const char * const iconify_xpm[] = { " ", " "}; -IconifyButton::IconifyButton(QWidget *parent) +IconifyButton::IconifyButton(TQWidget *parent) : Button(parent, i18n("Minimize")) { - setPixmap(QPixmap((const char **)iconify_xpm)); + setPixmap(TQPixmap((const char **)iconify_xpm)); } -void IconifyButton::mouseReleaseEvent(QMouseEvent *e) +void IconifyButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/IconifyButton.h b/kwin-styles/riscos/IconifyButton.h index 9c940713..8f757cb4 100644 --- a/kwin-styles/riscos/IconifyButton.h +++ b/kwin-styles/riscos/IconifyButton.h @@ -34,7 +34,7 @@ class IconifyButton : public Button public: - IconifyButton(QWidget *parent); + IconifyButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class IconifyButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); }; } // End namespace; diff --git a/kwin-styles/riscos/LowerButton.cpp b/kwin-styles/riscos/LowerButton.cpp index a14c6149..7f03e41f 100644 --- a/kwin-styles/riscos/LowerButton.cpp +++ b/kwin-styles/riscos/LowerButton.cpp @@ -44,13 +44,13 @@ static const char * const lower_xpm[] = { " ..... ", " "}; -LowerButton::LowerButton(QWidget *parent) +LowerButton::LowerButton(TQWidget *parent) : Button(parent, i18n("Keep below others")) { - setPixmap(QPixmap((const char **)lower_xpm)); + setPixmap(TQPixmap((const char **)lower_xpm)); } -void LowerButton::mouseReleaseEvent(QMouseEvent *e) +void LowerButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/LowerButton.h b/kwin-styles/riscos/LowerButton.h index ec5ab474..f3fc4df1 100644 --- a/kwin-styles/riscos/LowerButton.h +++ b/kwin-styles/riscos/LowerButton.h @@ -34,7 +34,7 @@ class LowerButton : public Button public: - LowerButton(QWidget *parent); + LowerButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class LowerButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); }; } // End namespace; diff --git a/kwin-styles/riscos/Manager.cpp b/kwin-styles/riscos/Manager.cpp index a890ac63..c4b77f0a 100644 --- a/kwin-styles/riscos/Manager.cpp +++ b/kwin-styles/riscos/Manager.cpp @@ -24,11 +24,11 @@ #include // for usleep on non-linux platforms #include // for sin and cos -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -80,37 +80,37 @@ void Manager::init() resetLayout(); } -bool Manager::eventFilter(QObject *o, QEvent *e) +bool Manager::eventFilter(TQObject *o, TQEvent *e) { if (o != widget()) return false; switch (e->type()) { - case QEvent::Resize: - resizeEvent(static_cast(e)); + case TQEvent::Resize: + resizeEvent(static_cast(e)); return true; - case QEvent::Paint: - paintEvent(static_cast(e)); + case TQEvent::Paint: + paintEvent(static_cast(e)); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast(e)); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast(e)); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast(e)); + case TQEvent::MouseButtonPress: + processMousePressEvent(static_cast(e)); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: return false; - case QEvent::Show: + case TQEvent::Show: return false; - case QEvent::MouseMove: + case TQEvent::MouseMove: return false; - case QEvent::Enter: + case TQEvent::Enter: return false; - case QEvent::Leave: + case TQEvent::Leave: return false; - case QEvent::Move: + case TQEvent::Move: return false; default: return false; @@ -129,12 +129,12 @@ void Manager::borders(int &left, int &right, int &top, int &bottom) const bottom = isResizable() ? Static::instance()->resizeHeight() : 1; } -void Manager::resize(const QSize &s) +void Manager::resize(const TQSize &s) { widget()->resize(s); } -QSize Manager::minimumSize() const +TQSize Manager::minimumSize() const { return widget()->minimumSize(); } @@ -169,16 +169,16 @@ void Manager::shadeChange() { } -void Manager::paintEvent(QPaintEvent *e) +void Manager::paintEvent(TQPaintEvent *e) { - QPainter p(widget()); + TQPainter p(widget()); - QRect r(e->rect()); + TQRect r(e->rect()); - bool intersectsLeft = r.intersects(QRect(0, 0, 1, height())); + bool intersectsLeft = r.intersects(TQRect(0, 0, 1, height())); bool intersectsRight = - r.intersects(QRect(width() - 1, 0, width(), height())); + r.intersects(TQRect(width() - 1, 0, width(), height())); if (intersectsLeft || intersectsRight) { @@ -197,7 +197,7 @@ void Manager::paintEvent(QPaintEvent *e) // Title bar. - QRect tr = titleSpacer_->geometry(); + TQRect tr = titleSpacer_->geometry(); bitBlt(widget(), tr.topLeft(), &titleBuf_); // Resize bar. @@ -220,7 +220,7 @@ void Manager::paintEvent(QPaintEvent *e) p.drawLine(1, height() - 1, width() - 2, height() - 1); } -void Manager::resizeEvent(QResizeEvent*) +void Manager::resizeEvent(TQResizeEvent*) { updateButtonVisibility(); updateTitleBuffer(); @@ -292,14 +292,14 @@ void Manager::updateTitleBuffer() Static * s = Static::instance(); - QRect tr = titleSpacer_->geometry(); + TQRect tr = titleSpacer_->geometry(); if (tr.width() == 0 || tr.height() == 0) titleBuf_.resize(8, 8); else titleBuf_.resize(tr.size()); - QPainter p(&titleBuf_); + TQPainter p(&titleBuf_); p.drawPixmap(0, 0, s->titleTextLeft(active)); @@ -316,7 +316,7 @@ void Manager::updateTitleBuffer() p.drawPixmap(tr.width() - 3, 0, s->titleTextRight(active)); } -KDecoration::Position Manager::mousePosition(const QPoint& p) const +KDecoration::Position Manager::mousePosition(const TQPoint& p) const { Position m = PositionCenter; @@ -350,19 +350,19 @@ KDecoration::Position Manager::mousePosition(const QPoint& p) const return m; } -void Manager::mouseDoubleClickEvent(QMouseEvent *e) +void Manager::mouseDoubleClickEvent(TQMouseEvent *e) { if (e->button() == LeftButton && titleSpacer_->geometry().contains(e->pos())) titlebarDblClickOperation(); } -void Manager::wheelEvent(QWheelEvent *e) +void Manager::wheelEvent(TQWheelEvent *e) { if (isSetShade() || titleLayout_->geometry().contains(e->pos()) ) titlebarMouseWheelOperation( e->delta()); } -void Manager::paletteChange(const QPalette &) +void Manager::paletteChange(const TQPalette &) { resetLayout(); } @@ -430,7 +430,7 @@ bool Manager::animateMinimize(bool iconify) helperShowHide(false); qApp->syncX(); - QRect r = iconGeometry(); + TQRect r = iconGeometry(); if (!r.isValid()) return true; @@ -462,7 +462,7 @@ bool Manager::animateMinimize(bool iconify) double delta = finalAngle / steps; - QPainter p(workspaceWidget()); + TQPainter p(workspaceWidget()); p.setRasterOp(Qt::NotROP); for (double angle = 0; ; angle += delta) @@ -474,10 +474,10 @@ bool Manager::animateMinimize(bool iconify) double dch = (ch / 2) * cos(angle); double midy = cy + (ch / 2); - QPoint p1(int(cx + dx), int(midy - dch)); - QPoint p2(int(cx + cw - dx), p1.y()); - QPoint p3(int(cx + dw + dx), int(midy + dch)); - QPoint p4(int(cx - dx), p3.y()); + TQPoint p1(int(cx + dx), int(midy - dch)); + TQPoint p2(int(cx + cw - dx), p1.y()); + TQPoint p3(int(cx + dw + dx), int(midy + dch)); + TQPoint p4(int(cx - dx), p3.y()); grabXServer(); @@ -521,12 +521,12 @@ bool Manager::animateMinimize(bool iconify) int stepCount = 12; - QRect r(geometry()); + TQRect r(geometry()); int dx = r.width() / (stepCount * 2); int dy = r.height() / (stepCount * 2); - QPainter p(workspaceWidget()); + TQPainter p(workspaceWidget()); p.setRasterOp(Qt::NotROP); for (int step = 0; step < stepCount; step++) @@ -550,19 +550,19 @@ bool Manager::animateMinimize(bool iconify) default: { - QRect icongeom = iconGeometry(); + TQRect icongeom = iconGeometry(); if (!icongeom.isValid()) return true; - QRect wingeom = geometry(); + TQRect wingeom = geometry(); - QPainter p(workspaceWidget()); + TQPainter p(workspaceWidget()); p.setRasterOp(Qt::NotROP); #if 0 if (iconify) - p.setClipRegion(QRegion(workspaceWidget()->rect()) - wingeom); + p.setClipRegion(TQRegion(workspaceWidget()->rect()) - wingeom); #endif grabXServer(); @@ -594,7 +594,7 @@ void Manager::createTitle() leftButtonList_.clear(); rightButtonList_.clear(); - QString buttons; + TQString buttons; if (options()->customButtonPositions()) buttons = options()->titleButtonsLeft() + "|" + @@ -602,7 +602,7 @@ void Manager::createTitle() else buttons = "XSH|IA"; - QPtrList