diff options
Diffstat (limited to 'kstyles')
37 files changed, 3693 insertions, 3693 deletions
diff --git a/kstyles/highcolor/highcolor.cpp b/kstyles/highcolor/highcolor.cpp index b033ea2d5..3f559d0fa 100644 --- a/kstyles/highcolor/highcolor.cpp +++ b/kstyles/highcolor/highcolor.cpp @@ -25,21 +25,21 @@ * Boston, MA 02110-1301, USA. */ -#include <qdrawutil.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qstyleplugin.h> - -#include <qcombobox.h> -#include <qheader.h> -#include <qmenubar.h> -#include <qpushbutton.h> -#include <qscrollbar.h> -#include <qslider.h> -#include <qtabbar.h> -#include <qtoolbutton.h> -#include <qtoolbar.h> -#include <qpopupmenu.h> +#include <tqdrawutil.h> +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqstyleplugin.h> + +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqmenubar.h> +#include <tqpushbutton.h> +#include <tqscrollbar.h> +#include <tqslider.h> +#include <tqtabbar.h> +#include <tqtoolbutton.h> +#include <tqtoolbar.h> +#include <tqpopupmenu.h> #include <kdrawutil.h> #include <kpixmapeffect.h> @@ -56,12 +56,12 @@ class HighColorStylePlugin : public QStylePlugin HighColorStylePlugin() {} ~HighColorStylePlugin() {} - QStringList keys() const + TQStringList keys() const { - return QStringList() << "HighColor" << "Default" << "B3"; + return TQStringList() << "HighColor" << "Default" << "B3"; } - QStyle* create( const QString& key ) + TQStyle* create( const TQString& key ) { if ( key == "highcolor" ) return new HighColorStyle( HighColorStyle::HighColor ); @@ -80,13 +80,13 @@ KDE_Q_EXPORT_PLUGIN( HighColorStylePlugin ) // --------------------------------------------------- -static QBitmap lightBmp; -static QBitmap grayBmp; -static QBitmap dgrayBmp; -static QBitmap centerBmp; -static QBitmap maskBmp; -static QBitmap xBmp; -static QIntDict<GradientSet> gDict; +static TQBitmap lightBmp; +static TQBitmap grayBmp; +static TQBitmap dgrayBmp; +static TQBitmap centerBmp; +static TQBitmap maskBmp; +static TQBitmap xBmp; +static TQIntDict<GradientSet> gDict; static const int itemFrame = 1; static const int itemHMargin = 3; @@ -97,7 +97,7 @@ static const char* kdeToolbarWidget = "kde toolbar widget"; // --------------------------------------------------------------------------- -GradientSet::GradientSet(const QColor &baseColor) +GradientSet::GradientSet(const TQColor &baseColor) { c = baseColor; for(int i=0; i < GradientCount; i++) @@ -174,7 +174,7 @@ HighColorStyle::HighColorStyle( StyleType styleType ) : KStyle( AllowMenuTransparency | FilledFrameWorkaround, ThreeButtonScrollBar ) { type = styleType; - highcolor = (type == HighColor && QPixmap::defaultDepth() > 8); + highcolor = (type == HighColor && TQPixmap::defaultDepth() > 8); gDict.setAutoDelete(true); hoverWidget = 0L; selectionBackground = false; @@ -186,20 +186,20 @@ HighColorStyle::~HighColorStyle() } -void HighColorStyle::polish(QWidget* widget) +void HighColorStyle::polish(TQWidget* widget) { // Put in order of highest occurrence to maximise hit rate - if (widget->inherits("QPushButton")) { + if (widget->inherits("TQPushButton")) { widget->installEventFilter(this); - } else if (widget->inherits("QMenuBar") || widget->inherits("QPopupMenu")) { - widget->setBackgroundMode(QWidget::NoBackground); + } else if (widget->inherits("TQMenuBar") || widget->inherits("TQPopupMenu")) { + widget->setBackgroundMode(TQWidget::NoBackground); } else if (type == HighColor && widget->inherits("QToolBarExtensionWidget")) { widget->installEventFilter(this); } else if ( !qstrcmp( widget->name(), kdeToolbarWidget) ) { widget->setBackgroundMode( NoBackground ); // We paint the whole background. widget->installEventFilter(this); } else if (widget->inherits("QToolBoxButton")) { - QFont font = widget->font(); + TQFont font = widget->font(); font.setBold(true); widget->setFont(font); } @@ -208,13 +208,13 @@ void HighColorStyle::polish(QWidget* widget) } -void HighColorStyle::unPolish(QWidget* widget) +void HighColorStyle::unPolish(TQWidget* widget) { - if (widget->inherits("QPushButton")) { + if (widget->inherits("TQPushButton")) { widget->removeEventFilter(this); } - else if (widget->inherits("QMenuBar") || widget->inherits("QPopupMenu")) { - widget->setBackgroundMode(QWidget::PaletteBackground); + else if (widget->inherits("TQMenuBar") || widget->inherits("TQPopupMenu")) { + widget->setBackgroundMode(TQWidget::PaletteBackground); } else if (type == HighColor && widget->inherits("QToolBarExtensionWidget")) { widget->removeEventFilter(this); } else if ( !qstrcmp( widget->name(), kdeToolbarWidget) ) { @@ -227,13 +227,13 @@ void HighColorStyle::unPolish(QWidget* widget) /* reimp. */ -void HighColorStyle::renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg, - const QPopupMenu* /* popup */ ) const +void HighColorStyle::renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup &cg, + const TQPopupMenu* /* popup */ ) const { - QColor col = cg.button(); + TQColor col = cg.button(); #ifdef Q_WS_X11 // Only draw menu gradients on TrueColor, X11 visuals - if ( QPaintDevice::x11AppDepth() >= 24 ) + if ( TQPaintDevice::x11AppDepth() >= 24 ) KPixmapEffect::gradient( pix, col.light(120), col.dark(115), KPixmapEffect::HorizontalGradient ); else @@ -244,11 +244,11 @@ void HighColorStyle::renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg, // This function draws primitive elements as well as their masks. void HighColorStyle::drawPrimitive( PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { bool down = flags & Style_Down; bool on = flags & Style_On; @@ -279,7 +279,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, r.rect(&x, &y, &w, &h); int x2 = x+w-1; int y2 = y+h-1; - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); // Outer frame (round style) p->setPen(cg.shadow()); @@ -314,10 +314,10 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, if ( sunken ) kDrawBeButton( p, x, y, w, h, cg, true, - &cg.brush(QColorGroup::Mid) ); + &cg.brush(TQColorGroup::Mid) ); else if ( flags & Style_MouseOver && !flat ) { - QBrush brush(cg.button().light(110)); + TQBrush brush(cg.button().light(110)); kDrawBeButton( p, x, y, w, h, cg, false, &brush ); } @@ -326,7 +326,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, if ( flags & Style_MouseOver ) p->fillRect(r, cg.button().light(110)); else - renderGradient(p, QRect(x, y, w-1, h-1), + renderGradient(p, TQRect(x, y, w-1, h-1), cg.button(), false); p->setPen(cg.button().light(75)); @@ -360,11 +360,11 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, p->drawLine(x+1, y+2, x+1, y2-1); p->drawLine(x2-2, y+3, x2-2, y2-2); - renderGradient(p, QRect(x+4, y+4, w-6, h-6), + renderGradient(p, TQRect(x+4, y+4, w-6, h-6), cg.button(), false); } else kDrawBeButton(p, x, y, w, h, cg, false, - &cg.brush(QColorGroup::Button)); + &cg.brush(TQColorGroup::Button)); break; } @@ -394,7 +394,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, if (sunken) p->fillRect(x+2, y+2, w-4, h-4, cg.button()); else - renderGradient( p, QRect(x+2, y+2, w-4, h-4), + renderGradient( p, TQRect(x+2, y+2, w-4, h-4), cg.button(), flags & Style_Horizontal ); } break; @@ -414,8 +414,8 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, case PE_HeaderSection: { // Temporary solution for the proper orientation of gradients. bool horizontal = true; - if (p && p->device()->devType() == QInternal::Widget) { - QHeader* hdr = dynamic_cast<QHeader*>(p->device()); + if (p && p->device()->devType() == TQInternal::Widget) { + TQHeader* hdr = dynamic_cast<TQHeader*>(p->device()); if (hdr) horizontal = hdr->orientation() == Horizontal; } @@ -425,7 +425,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, bool sunken = on || down; int x2 = x+w-1; int y2 = y+h-1; - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); // Bevel p->setPen(sunken ? cg.mid() : cg.light()); @@ -441,7 +441,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, if (sunken) p->fillRect(x+1, y+1, w-3, h-3, cg.button()); else - renderGradient( p, QRect(x+1, y+1, w-3, h-3), + renderGradient( p, TQRect(x+1, y+1, w-3, h-3), cg.button(), !horizontal ); p->setPen( oldPen ); break; @@ -563,12 +563,12 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, if (flags & Style_Horizontal) { p->drawLine(x, y, x2, y); p->drawLine(x, y2, x2, y2); - renderGradient(p, QRect(x, y+1, w, h-2), + renderGradient(p, TQRect(x, y+1, w, h-2), cg.mid(), false); } else { p->drawLine(x, y, x, y2); p->drawLine(x2, y, x2, y2); - renderGradient(p, QRect(x+1, y, w-2, h), + renderGradient(p, TQRect(x+1, y, w-2, h), cg.mid(), true); } } else { @@ -579,12 +579,12 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, if (flags & Style_Horizontal) { p->drawLine(x, y, x2, y); p->drawLine(x, y2, x2, y2); - p->fillRect( QRect(x, y+1, w, h-2), + p->fillRect( TQRect(x, y+1, w, h-2), flags & Style_Down ? cg.button() : cg.midlight() ); } else { p->drawLine(x, y, x, y2); p->drawLine(x2, y, x2, y2); - p->fillRect( QRect(x+1, y, w-2, h), + p->fillRect( TQRect(x+1, y, w-2, h), flags & Style_Down ? cg.button() : cg.midlight() ); } } @@ -620,7 +620,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, bool nochange = flags & Style_NoChange; if (xBmp.isNull()) { - xBmp = QBitmap(7, 7, x_bits, true); + xBmp = TQBitmap(7, 7, x_bits, true); xBmp.setMask(xBmp); } @@ -674,10 +674,10 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, case PE_ExclusiveIndicator: { if (lightBmp.isNull()) { - lightBmp = QBitmap(13, 13, radiooff_light_bits, true); - grayBmp = QBitmap(13, 13, radiooff_gray_bits, true); - dgrayBmp = QBitmap(13, 13, radiooff_dgray_bits, true); - centerBmp = QBitmap(13, 13, radiooff_center_bits, true); + lightBmp = TQBitmap(13, 13, radiooff_light_bits, true); + grayBmp = TQBitmap(13, 13, radiooff_gray_bits, true); + dgrayBmp = TQBitmap(13, 13, radiooff_dgray_bits, true); + centerBmp = TQBitmap(13, 13, radiooff_center_bits, true); centerBmp.setMask( centerBmp ); } @@ -694,7 +694,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, // Indicator "dot" if ( on ) { - QColor color = flags & Style_NoChange ? + TQColor color = flags & Style_NoChange ? cg.dark() : cg.text(); p->setPen(color); @@ -713,7 +713,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, // ------------------------------------------------------------------- case PE_ExclusiveIndicatorMask: { if (maskBmp.isNull()) { - maskBmp = QBitmap(13, 13, radiomask_bits, true); + maskBmp = TQBitmap(13, 13, radiomask_bits, true); maskBmp.setMask(maskBmp); } @@ -748,7 +748,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, p->setPen(cg.mid()); p->drawLine(x2-1, y+1, x2-1, y2-1); p->drawLine(x+1, y2-1, x2-1, y2-1); - p->fillRect(x+3, y+3, w-5, h-5, cg.brush(QColorGroup::Background)); + p->fillRect(x+3, y+3, w-5, h-5, cg.brush(TQColorGroup::Background)); break; } @@ -764,7 +764,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, : opt.lineWidth(); if (lw == 2) { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); int x,y,w,h; r.rect(&x, &y, &w, &h); int x2 = x+w-1; @@ -808,7 +808,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, p->drawLine(x2, r.y(), x2, y2); // ### Qt should specify Style_Horizontal where appropriate - renderGradient( p, QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2), + renderGradient( p, TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2), cg.button(), (r.width() < r.height()) && (pe != PE_PanelMenuBar) ); } @@ -847,7 +847,7 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, // ------------------------------------------------------------------- if (pe >= PE_ArrowUp && pe <= PE_ArrowLeft) { - QPointArray a; + TQPointArray a; if ( type != B3 ) { // HighColor & Default arrows @@ -914,12 +914,12 @@ void HighColorStyle::drawPrimitive( PrimitiveElement pe, void HighColorStyle::drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { switch ( kpe ) { @@ -1000,15 +1000,15 @@ void HighColorStyle::drawKStylePrimitive( KStylePrimitive kpe, // SLIDER GROOVE // ------------------------------------------------------------------- case KPE_SliderGroove: { - const QSlider* slider = (const QSlider*)widget; + const TQSlider* slider = (const TQSlider*)widget; bool horizontal = slider->orientation() == Horizontal; int gcenter = (horizontal ? r.height() : r.width()) / 2; - QRect gr; + TQRect gr; if (horizontal) - gr = QRect(r.x(), r.y()+gcenter-3, r.width(), 7); + gr = TQRect(r.x(), r.y()+gcenter-3, r.width(), 7); else - gr = QRect(r.x()+gcenter-3, r.y(), 7, r.height()); + gr = TQRect(r.x()+gcenter-3, r.y(), 7, r.height()); int x,y,w,h; gr.rect(&x, &y, &w, &h); @@ -1034,7 +1034,7 @@ void HighColorStyle::drawKStylePrimitive( KStylePrimitive kpe, // SLIDER HANDLE // ------------------------------------------------------------------- case KPE_SliderHandle: { - const QSlider* slider = (const QSlider*)widget; + const TQSlider* slider = (const TQSlider*)widget; bool horizontal = slider->orientation() == Horizontal; int x,y,w,h; r.rect(&x, &y, &w, &h); @@ -1060,7 +1060,7 @@ void HighColorStyle::drawKStylePrimitive( KStylePrimitive kpe, p->setPen(cg.mid()); p->drawLine(x+3, y2-2, x2-2, y2-2); p->drawLine(x2-2, y+3, x2-2, y2-2); - renderGradient(p, QRect(x+3, y+3, w-6, h-6), + renderGradient(p, TQRect(x+3, y+3, w-6, h-6), cg.button(), !horizontal); // Paint riffles @@ -1093,12 +1093,12 @@ void HighColorStyle::drawKStylePrimitive( KStylePrimitive kpe, void HighColorStyle::drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { switch (element) { @@ -1109,8 +1109,8 @@ void HighColorStyle::drawControl( ControlElement element, flags |= Style_MouseOver; if ( type != HighColor ) { - QPushButton *button = (QPushButton*) widget; - QRect br = r; + TQPushButton *button = (TQPushButton*) widget; + TQRect br = r; bool btnDefault = button->isDefault(); if ( btnDefault || button->autoDefault() ) { @@ -1134,7 +1134,7 @@ void HighColorStyle::drawControl( ControlElement element, // PUSHBUTTON LABEL // ------------------------------------------------------------------- case CE_PushButtonLabel: { - const QPushButton* button = (const QPushButton*)widget; + const TQPushButton* button = (const TQPushButton*)widget; bool active = button->isOn() || button->isDown(); int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1149,22 +1149,22 @@ void HighColorStyle::drawControl( ControlElement element, // Does the button have a popup menu? if ( button->isMenuButton() ) { int dx = pixelMetric( PM_MenuButtonIndicator, widget ); - drawPrimitive( PE_ArrowDown, p, QRect(x + w - dx - 2, y + 2, dx, h - 4), + drawPrimitive( PE_ArrowDown, p, TQRect(x + w - dx - 2, y + 2, dx, h - 4), cg, flags, opt ); w -= dx; } // Draw the icon if there is one if ( button->iconSet() && !button->iconSet()->isNull() ) { - QIconSet::Mode mode = QIconSet::Disabled; - QIconSet::State state = QIconSet::Off; + TQIconSet::Mode mode = TQIconSet::Disabled; + TQIconSet::State state = TQIconSet::Off; if (button->isEnabled()) - mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + mode = button->hasFocus() ? TQIconSet::Active : TQIconSet::Normal; if (button->isToggleButton() && button->isOn()) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap pixmap = button->iconSet()->pixmap( QIconSet::Small, mode, state ); + TQPixmap pixmap = button->iconSet()->pixmap( TQIconSet::Small, mode, state ); // Center the iconset if there's no text or pixmap if (button->text().isEmpty() && !button->pixmap()) @@ -1181,33 +1181,33 @@ void HighColorStyle::drawControl( ControlElement element, // Make the label indicate if the button is a default button or not if ( active || button->isDefault() ) { // Draw "fake" bold text - this enables the font metrics to remain - // the same as computed in QPushButton::sizeHint(), but gives + // the same as computed in TQPushButton::sizeHint(), but gives // a reasonable bold effect. int i; // Text shadow if (button->isEnabled()) // Don't draw double-shadow when disabled for(i=0; i<2; i++) - drawItem( p, QRect(x+i+1, y+1, w, h), AlignCenter | ShowPrefix, + drawItem( p, TQRect(x+i+1, y+1, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), NULL, button->text(), -1, active ? &button->colorGroup().dark() : &button->colorGroup().mid() ); // Normal Text for(i=0; i<2; i++) - drawItem( p, QRect(x+i, y, w, h), AlignCenter | ShowPrefix, + drawItem( p, TQRect(x+i, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), i == 0 ? button->pixmap() : NULL, button->text(), -1, active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); } else - drawItem( p, QRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), + drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), button->text(), -1, active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); // Draw a focus rect if the button has focus if ( flags & Style_HasFocus ) drawPrimitive( PE_FocusRect, p, - QStyle::visualRect(subRect(SR_PushButtonFocusRect, widget), widget), + TQStyle::visualRect(subRect(SR_PushButtonFocusRect, widget), widget), cg, flags ); break; } @@ -1229,13 +1229,13 @@ void HighColorStyle::drawControl( ControlElement element, p->drawLine( x, y2, x2, y2 ); p->drawLine( x2, y, x2, y2 ); - QColor fill = selected ? cg.highlight() : cg.button(); + TQColor fill = selected ? cg.highlight() : cg.button(); selectionBackground = selected; if ( pressed ) - p->fillRect( QRect(x+1, y+1, r.width()-2, r.height()-2), fill ); + p->fillRect( TQRect(x+1, y+1, r.width()-2, r.height()-2), fill ); else - renderGradient(p, QRect(x+1, y+1, r.width()-2, r.height()-2), + renderGradient(p, TQRect(x+1, y+1, r.width()-2, r.height()-2), fill, false); break; } @@ -1252,16 +1252,16 @@ void HighColorStyle::drawControl( ControlElement element, // ------------------------------------------------------------------- case CE_MenuBarItem: { - QMenuBar *mb = (QMenuBar*)widget; - QMenuItem *mi = opt.menuItem(); - QRect pr = mb->rect(); + TQMenuBar *mb = (TQMenuBar*)widget; + TQMenuItem *mi = opt.menuItem(); + TQRect pr = mb->rect(); bool active = flags & Style_Active; bool focused = flags & Style_HasFocus; if ( active && focused ) qDrawShadePanel(p, r.x(), r.y(), r.width(), r.height(), - cg, true, 1, &cg.brush(QColorGroup::Midlight)); + cg, true, 1, &cg.brush(TQColorGroup::Midlight)); else renderGradient( p, r, cg.button(), false, r.x(), r.y()-1, pr.width()-2, pr.height()-2); @@ -1277,14 +1277,14 @@ void HighColorStyle::drawControl( ControlElement element, // POPUPMENU ITEM // ------------------------------------------------------------------- case CE_PopupMenuItem: { - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; + const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); if ( !mi ) { - // Don't leave blank holes if we set NoBackground for the QPopupMenu. + // Don't leave blank holes if we set NoBackground for the TQPopupMenu. // This only happens when the popupMenu spans more than one column. if (! (widget->erasePixmap() && !widget->erasePixmap()->isNull()) ) - p->fillRect(r, cg.brush(QColorGroup::Button) ); + p->fillRect(r, cg.brush(TQColorGroup::Button) ); break; } @@ -1294,7 +1294,7 @@ void HighColorStyle::drawControl( ControlElement element, bool checkable = popupmenu->isCheckable(); bool active = flags & Style_Active; bool etchtext = styleHint( SH_EtchDisabledText ); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1313,7 +1313,7 @@ void HighColorStyle::drawControl( ControlElement element, // Draw the menu item background if ( active ) qDrawShadePanel( p, x, y, w, h, cg, true, 1, - &cg.brush(QColorGroup::Midlight) ); + &cg.brush(TQColorGroup::Midlight) ); // Draw the transparency pixmap else if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) p->drawPixmap( x, y, *widget->erasePixmap(), x, y, w, h ); @@ -1323,23 +1323,23 @@ void HighColorStyle::drawControl( ControlElement element, // Do we have an icon? if ( mi->iconSet() ) { - QIconSet::Mode mode; - QRect cr = visualRect( QRect(x, y, checkcol, h), r ); + TQIconSet::Mode mode; + TQRect cr = visualRect( TQRect(x, y, checkcol, h), r ); // Select the correct icon from the iconset if ( active ) - mode = enabled ? QIconSet::Active : QIconSet::Disabled; + mode = enabled ? TQIconSet::Active : TQIconSet::Disabled; else - mode = enabled ? QIconSet::Normal : QIconSet::Disabled; + mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled; // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon if ( checkable && !active && mi->isChecked() ) qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), - cg, true, 1, &cg.brush(QColorGroup::Midlight) ); + cg, true, 1, &cg.brush(TQColorGroup::Midlight) ); // Draw the icon - QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); - QRect pmr( 0, 0, pixmap.width(), pixmap.height() ); + TQPixmap pixmap = mi->iconSet()->pixmap( TQIconSet::Small, mode ); + TQRect pmr( 0, 0, pixmap.width(), pixmap.height() ); pmr.moveCenter( cr.center() ); p->drawPixmap( pmr.topLeft(), pixmap ); } @@ -1352,13 +1352,13 @@ void HighColorStyle::drawControl( ControlElement element, // if it's active the "pressed" background is already drawn if ( ! active ) qDrawShadePanel( p, cx, y, checkcol, h, cg, true, 1, - &cg.brush(QColorGroup::Midlight) ); + &cg.brush(TQColorGroup::Midlight) ); // Draw the checkmark SFlags cflags = Style_Default; cflags |= active ? Style_Enabled : Style_On; - drawPrimitive( PE_CheckMark, p, QRect( cx + itemFrame, y + itemFrame, + drawPrimitive( PE_CheckMark, p, TQRect( cx + itemFrame, y + itemFrame, checkcol - itemFrame*2, h - itemFrame*2), cg, cflags ); } @@ -1380,7 +1380,7 @@ void HighColorStyle::drawControl( ControlElement element, // This color will be used instead of the above if the menu item // is active and disabled at the same time. (etched text) - QColor discol = cg.mid(); + TQColor discol = cg.mid(); // Does the menu item draw it's own label? if ( mi->custom() ) { @@ -1400,7 +1400,7 @@ void HighColorStyle::drawControl( ControlElement element, } else { // The menu item doesn't draw it's own label - QString s = mi->text(); + TQString s = mi->text(); // Does the menu item have a text label? if ( !s.isNull() ) { @@ -1441,7 +1441,7 @@ void HighColorStyle::drawControl( ControlElement element, // The menu item doesn't have a text label // Check if it has a pixmap instead else if ( mi->pixmap() ) { - QPixmap *pixmap = mi->pixmap(); + TQPixmap *pixmap = mi->pixmap(); // Draw the pixmap if ( pixmap->depth() == 1 ) @@ -1460,7 +1460,7 @@ void HighColorStyle::drawControl( ControlElement element, if ( mi->popup() ) { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; int dim = pixelMetric(PM_MenuButtonIndicator); - QRect vr = visualRect( QRect( x + w - arrowHMargin - 2*itemFrame - dim, + TQRect vr = visualRect( TQRect( x + w - arrowHMargin - 2*itemFrame - dim, y + h / 2 - dim / 2, dim, dim), r ); // Draw an arrow at the far end of the menu item @@ -1468,7 +1468,7 @@ void HighColorStyle::drawControl( ControlElement element, if ( enabled ) discol = cg.buttonText(); - QColorGroup g2( discol, cg.highlight(), white, white, + TQColorGroup g2( discol, cg.highlight(), white, white, enabled ? white : discol, discol, white ); drawPrimitive( arrow, p, vr, g2, Style_Enabled ); @@ -1486,10 +1486,10 @@ void HighColorStyle::drawControl( ControlElement element, void HighColorStyle::drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { switch (element) { @@ -1501,7 +1501,7 @@ void HighColorStyle::drawControlMask( ControlElement element, QCOORD corners[] = { x1,y1, x2,y1, x1,y2, x2,y2 }; p->fillRect( r, color1 ); p->setPen( color0 ); - p->drawPoints( QPointArray(4, corners) ); + p->drawPoints( TQPointArray(4, corners) ); break; } @@ -1512,14 +1512,14 @@ void HighColorStyle::drawControlMask( ControlElement element, void HighColorStyle::drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { switch(control) { @@ -1550,7 +1550,7 @@ void HighColorStyle::drawComplexControl( ComplexControl control, p->drawPoint(x2,y); p->drawPoint(x2,y2); - renderGradient( p, QRect(x+2, y+2, w-4, h-4), + renderGradient( p, TQRect(x+2, y+2, w-4, h-4), cg.button(), false); p->setPen(sunken ? cg.light() : cg.mid()); @@ -1562,7 +1562,7 @@ void HighColorStyle::drawComplexControl( ComplexControl control, p->drawLine(x+1, y+2, x+1, y2-2); // Get the button bounding box - QRect ar = QStyle::visualRect( + TQRect ar = TQStyle::visualRect( querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow), widget ); @@ -1580,8 +1580,8 @@ void HighColorStyle::drawComplexControl( ComplexControl control, // Draw an edit field if required if ( controls & SC_ComboBoxEditField ) { - const QComboBox * cb = (const QComboBox *) widget; - QRect re = QStyle::visualRect( + const TQComboBox * cb = (const TQComboBox *) widget; + TQRect re = TQStyle::visualRect( querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField), widget ); @@ -1603,13 +1603,13 @@ void HighColorStyle::drawComplexControl( ComplexControl control, if ( cb->hasFocus() && !cb->editable() ) { // Draw the contents p->fillRect( re.x(), re.y(), re.width(), re.height(), - cg.brush( QColorGroup::Highlight ) ); + cg.brush( TQColorGroup::Highlight ) ); - QRect re = QStyle::visualRect( + TQRect re = TQStyle::visualRect( subRect(SR_ComboBoxFocusRect, cb), widget); drawPrimitive( PE_FocusRect, p, re, cg, - Style_FocusAtBorder, QStyleOption(cg.highlight())); + Style_FocusAtBorder, TQStyleOption(cg.highlight())); } } break; @@ -1618,9 +1618,9 @@ void HighColorStyle::drawComplexControl( ComplexControl control, // TOOLBUTTON // ------------------------------------------------------------------- case CC_ToolButton: { - const QToolButton *toolbutton = (const QToolButton *) widget; + const TQToolButton *toolbutton = (const TQToolButton *) widget; - QRect button, menuarea; + TQRect button, menuarea; button = querySubControlMetrics(control, widget, SC_ToolButton, opt); menuarea = querySubControlMetrics(control, widget, SC_ToolButtonMenu, opt); @@ -1643,15 +1643,15 @@ void HighColorStyle::drawComplexControl( ComplexControl control, toolbutton->parentWidget()->backgroundPixmap() && !toolbutton->parentWidget()->backgroundPixmap()->isNull() ) { - QPixmap pixmap = *(toolbutton->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(toolbutton->parentWidget()->backgroundPixmap()); p->drawTiledPixmap( r, pixmap, toolbutton->pos() ); } else if (widget->parent()) { - if (widget->parent()->inherits("QToolBar")) + if (widget->parent()->inherits("TQToolBar")) { - QToolBar* parent = (QToolBar*)widget->parent(); - QRect pr = parent->rect(); + TQToolBar* parent = (TQToolBar*)widget->parent(); + TQRect pr = parent->rect(); renderGradient( p, r, cg.button(), parent->orientation() == Qt::Vertical, @@ -1659,9 +1659,9 @@ void HighColorStyle::drawComplexControl( ComplexControl control, } else if (widget->parent()->inherits("QToolBarExtensionWidget")) { - QWidget* parent = (QWidget*)widget->parent(); - QToolBar* toolbar = (QToolBar*)parent->parent(); - QRect tr = toolbar->rect(); + TQWidget* parent = (TQWidget*)widget->parent(); + TQToolBar* toolbar = (TQToolBar*)parent->parent(); + TQRect tr = toolbar->rect(); if ( toolbar->orientation() == Qt::Horizontal ) { renderGradient( p, r, cg.button(), false, r.x(), r.y(), @@ -1683,7 +1683,7 @@ void HighColorStyle::drawComplexControl( ComplexControl control, } if (toolbutton->hasFocus() && !toolbutton->focusProxy()) { - QRect fr = toolbutton->rect(); + TQRect fr = toolbutton->rect(); fr.addCoords(3, 3, -3, -3); drawPrimitive(PE_FocusRect, p, fr, cg); } @@ -1701,10 +1701,10 @@ void HighColorStyle::drawComplexControl( ComplexControl control, void HighColorStyle::drawComplexControlMask( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { switch (control) { @@ -1717,7 +1717,7 @@ void HighColorStyle::drawComplexControlMask( ComplexControl control, QCOORD corners[] = { x1,y1, x2,y1, x1,y2, x2,y2 }; p->fillRect( r, color1 ); p->setPen( color0 ); - p->drawPoints( QPointArray(4, corners) ); + p->drawPoints( TQPointArray(4, corners) ); break; } @@ -1727,21 +1727,21 @@ void HighColorStyle::drawComplexControlMask( ComplexControl control, } -void HighColorStyle::drawItem( QPainter *p, - const QRect &r, +void HighColorStyle::drawItem( TQPainter *p, + const TQRect &r, int flags, - const QColorGroup &cg, + const TQColorGroup &cg, bool enabled, - const QPixmap *pixmap, - const QString &text, + const TQPixmap *pixmap, + const TQString &text, int len, - const QColor *penColor ) const + const TQColor *penColor ) const { // We only reimplement this method this so we can override the // text color used for widgets when we draw them with the selection // color and Qt expects them to be drawn them with the button color. // ------------------------------------------------------------------- - const QColor *col; + const TQColor *col; if ( selectionBackground ) { col = &cg.highlightedText(); @@ -1754,14 +1754,14 @@ void HighColorStyle::drawItem( QPainter *p, } -QRect HighColorStyle::subRect(SubRect r, const QWidget *widget) const +TQRect HighColorStyle::subRect(SubRect r, const TQWidget *widget) const { // We want the focus rect for buttons to be adjusted from // the Qt3 defaults to be similar to Qt 2's defaults. // ------------------------------------------------------------------- if (r == SR_PushButtonFocusRect ) { - const QPushButton* button = (const QPushButton*) widget; - QRect wrect(widget->rect()); + const TQPushButton* button = (const TQPushButton*) widget; + TQRect wrect(widget->rect()); int dbw1 = 0, dbw2 = 0; if (button->isDefault() || button->autoDefault()) { @@ -1772,7 +1772,7 @@ QRect HighColorStyle::subRect(SubRect r, const QWidget *widget) const int dfw1 = pixelMetric(PM_DefaultFrameWidth, widget) * 2, dfw2 = dfw1 * 2; - return QRect(wrect.x() + dfw1 + dbw1 + 1, + return TQRect(wrect.x() + dfw1 + dbw1 + 1, wrect.y() + dfw1 + dbw1 + 1, wrect.width() - dfw2 - dbw2 - 1, wrect.height() - dfw2 - dbw2 - 1); @@ -1781,7 +1781,7 @@ QRect HighColorStyle::subRect(SubRect r, const QWidget *widget) const } -int HighColorStyle::pixelMetric(PixelMetric m, const QWidget *widget) const +int HighColorStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const { switch(m) { @@ -1819,17 +1819,17 @@ int HighColorStyle::pixelMetric(PixelMetric m, const QWidget *widget) const } -QSize HighColorStyle::sizeFromContents( ContentsType contents, - const QWidget* widget, - const QSize &contentSize, - const QStyleOption& opt ) const +TQSize HighColorStyle::sizeFromContents( ContentsType contents, + const TQWidget* widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const { switch (contents) { // PUSHBUTTON SIZE // ------------------------------------------------------------------ case CT_PushButton: { - const QPushButton* button = (const QPushButton*) widget; + const TQPushButton* button = (const TQPushButton*) widget; int w = contentSize.width(); int h = contentSize.height(); int bm = pixelMetric( PM_ButtonMargin, widget ); @@ -1854,7 +1854,7 @@ QSize HighColorStyle::sizeFromContents( ContentsType contents, if ( h < 22 ) h = 22; - return QSize( w, h ); + return TQSize( w, h ); } @@ -1864,9 +1864,9 @@ QSize HighColorStyle::sizeFromContents( ContentsType contents, if ( ! widget || opt.isDefault() ) return contentSize; - const QPopupMenu *popup = (const QPopupMenu *) widget; + const TQPopupMenu *popup = (const TQPopupMenu *) widget; bool checkable = popup->isCheckable(); - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = contentSize.width(), h = contentSize.height(); @@ -1894,7 +1894,7 @@ QSize HighColorStyle::sizeFromContents( ContentsType contents, if ( mi->iconSet() ) h = QMAX( h, mi->iconSet()->pixmap( - QIconSet::Small, QIconSet::Normal).height() + + TQIconSet::Small, TQIconSet::Normal).height() + 2 * itemFrame ); } @@ -1912,7 +1912,7 @@ QSize HighColorStyle::sizeFromContents( ContentsType contents, w += rightBorder; - return QSize( w, h ); + return TQSize( w, h ); } @@ -1923,15 +1923,15 @@ QSize HighColorStyle::sizeFromContents( ContentsType contents, // Fix Qt's wacky image alignment -QPixmap HighColorStyle::stylePixmap(StylePixmap stylepixmap, - const QWidget* widget, - const QStyleOption& opt) const +TQPixmap HighColorStyle::stylePixmap(StylePixmap stylepixmap, + const TQWidget* widget, + const TQStyleOption& opt) const { switch (stylepixmap) { case SP_TitleBarMinButton: - return QPixmap((const char **)hc_minimize_xpm); + return TQPixmap((const char **)hc_minimize_xpm); case SP_TitleBarCloseButton: - return QPixmap((const char **)hc_close_xpm); + return TQPixmap((const char **)hc_close_xpm); default: break; } @@ -1940,23 +1940,23 @@ QPixmap HighColorStyle::stylePixmap(StylePixmap stylepixmap, } -bool HighColorStyle::eventFilter( QObject *object, QEvent *event ) +bool HighColorStyle::eventFilter( TQObject *object, TQEvent *event ) { if (KStyle::eventFilter( object, event )) return true; - QToolBar* toolbar; + TQToolBar* toolbar; // Handle push button hover effects. - QPushButton* button = dynamic_cast<QPushButton*>(object); + TQPushButton* button = dynamic_cast<TQPushButton*>(object); if ( button ) { - if ( (event->type() == QEvent::Enter) && + if ( (event->type() == TQEvent::Enter) && (button->isEnabled()) ) { hoverWidget = button; button->repaint( false ); } - else if ( (event->type() == QEvent::Leave) && + else if ( (event->type() == TQEvent::Leave) && (object == hoverWidget) ) { hoverWidget = 0L; button->repaint( false ); @@ -1966,42 +1966,42 @@ bool HighColorStyle::eventFilter( QObject *object, QEvent *event ) // Draw a gradient background for custom widgets in the toolbar // that have specified a "kde toolbar widget" name. - if (event->type() == QEvent::Paint ) { + if (event->type() == TQEvent::Paint ) { // Find the top-level toolbar of this widget, since it may be nested in other // widgets that are on the toolbar. - QWidget *widget = static_cast<QWidget*>(object); - QWidget *parent = static_cast<QWidget*>(object->parent()); + TQWidget *widget = static_cast<TQWidget*>(object); + TQWidget *parent = static_cast<TQWidget*>(object->parent()); int x_offset = widget->x(), y_offset = widget->y(); while (parent && parent->parent() && !qstrcmp( parent->name(), kdeToolbarWidget ) ) { x_offset += parent->x(); y_offset += parent->y(); - parent = static_cast<QWidget*>(parent->parent()); + parent = static_cast<TQWidget*>(parent->parent()); } - QRect r = widget->rect(); - QRect pr = parent->rect(); + TQRect r = widget->rect(); + TQRect pr = parent->rect(); bool horiz_grad = pr.width() < pr.height(); // Check if the parent is a QToolbar, and use its orientation, else guess. - QToolBar* tb = dynamic_cast<QToolBar*>(parent); + TQToolBar* tb = dynamic_cast<TQToolBar*>(parent); if (tb) horiz_grad = tb->orientation() == Qt::Vertical; - QPainter p( widget ); + TQPainter p( widget ); renderGradient(&p, r, parent->colorGroup().button(), horiz_grad, x_offset, y_offset, pr.width(), pr.height()); return false; // Now draw the contents } } else if ( object->parent() && - (toolbar = dynamic_cast<QToolBar*>(object->parent())) ) + (toolbar = dynamic_cast<TQToolBar*>(object->parent())) ) { // We need to override the paint event to draw a // gradient on a QToolBarExtensionWidget. - if ( event->type() == QEvent::Paint ) { - QWidget *widget = static_cast<QWidget*>(object); - QRect wr = widget->rect(), tr = toolbar->rect(); - QPainter p( widget ); + if ( event->type() == TQEvent::Paint ) { + TQWidget *widget = static_cast<TQWidget*>(object); + TQRect wr = widget->rect(), tr = toolbar->rect(); + TQPainter p( widget ); renderGradient(&p, wr, toolbar->colorGroup().button(), toolbar->orientation() == Qt::Vertical, wr.x(), wr.y(), tr.width() - 2, tr.height() - 2); @@ -2020,8 +2020,8 @@ bool HighColorStyle::eventFilter( QObject *object, QEvent *event ) } -void HighColorStyle::renderGradient( QPainter* p, const QRect& r, - QColor clr, bool horizontal, int px, int py, int pwidth, int pheight) const +void HighColorStyle::renderGradient( TQPainter* p, const TQRect& r, + TQColor clr, bool horizontal, int px, int py, int pwidth, int pheight) const { // Make 8 bit displays happy if (!highcolor) { @@ -2045,9 +2045,9 @@ void HighColorStyle::renderGradient( QPainter* p, const QRect& r, int width = (pwidth != -1) ? pwidth : r.width(); if (width <= 34) - p->drawTiledPixmap(r, *grSet->gradient(HMed), QPoint(px, 0)); + p->drawTiledPixmap(r, *grSet->gradient(HMed), TQPoint(px, 0)); else if (width <= 52) - p->drawTiledPixmap(r, *grSet->gradient(HLarge), QPoint(px, 0)); + p->drawTiledPixmap(r, *grSet->gradient(HLarge), TQPoint(px, 0)); else { KPixmap *hLarge = grSet->gradient(HLarge); @@ -2073,11 +2073,11 @@ void HighColorStyle::renderGradient( QPainter* p, const QRect& r, int height = (pheight != -1) ? pheight : r.height(); if (height <= 24) - p->drawTiledPixmap(r, *grSet->gradient(VSmall), QPoint(0, py)); + p->drawTiledPixmap(r, *grSet->gradient(VSmall), TQPoint(0, py)); else if (height <= 34) - p->drawTiledPixmap(r, *grSet->gradient(VMed), QPoint(0, py)); + p->drawTiledPixmap(r, *grSet->gradient(VMed), TQPoint(0, py)); else if (height <= 64) - p->drawTiledPixmap(r, *grSet->gradient(VLarge), QPoint(0, py)); + p->drawTiledPixmap(r, *grSet->gradient(VLarge), TQPoint(0, py)); else { KPixmap *vLarge = grSet->gradient(VLarge); diff --git a/kstyles/highcolor/highcolor.h b/kstyles/highcolor/highcolor.h index 4841f92a7..8081f1c9f 100644 --- a/kstyles/highcolor/highcolor.h +++ b/kstyles/highcolor/highcolor.h @@ -30,8 +30,8 @@ #ifndef __HIGHCOLOR_H #define __HIGHCOLOR_H -#include <qbitmap.h> -#include <qintdict.h> +#include <tqbitmap.h> +#include <tqintdict.h> #include <kdrawutil.h> #include <kpixmap.h> #include <kstyle.h> @@ -42,14 +42,14 @@ enum GradientType{ VSmall=0, VMed, VLarge, HMed, HLarge, GradientCount }; class GradientSet { public: - GradientSet(const QColor &baseColor); + GradientSet(const TQColor &baseColor); ~GradientSet(); KPixmap* gradient(GradientType type); - QColor* color() { return(&c); } + TQColor* color() { return(&c); } private: KPixmap *gradients[5]; - QColor c; + TQColor c; }; @@ -65,96 +65,96 @@ class HighColorStyle : public KStyle HighColorStyle( StyleType ); virtual ~HighColorStyle(); - void polish( QWidget* widget ); - void unPolish( QWidget* widget ); + void polish( TQWidget* widget ); + void unPolish( TQWidget* widget ); - void renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg, - const QPopupMenu* popup ) const; + void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup &cg, + const TQPopupMenu* popup ) const; void drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawPrimitive( PrimitiveElement pe, - QPainter* p, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& = QStyleOption::Default ) const; + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControlMask( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& = QStyleOption::Default ) const; + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& = TQStyleOption::Default ) const; - void drawItem( QPainter *p, - const QRect &r, + void drawItem( TQPainter *p, + const TQRect &r, int flags, - const QColorGroup &cg, + const TQColorGroup &cg, bool enabled, - const QPixmap *pixmap, - const QString &text, + const TQPixmap *pixmap, + const TQString &text, int len = -1, - const QColor *penColor = 0 ) const; + const TQColor *penColor = 0 ) const; int pixelMetric( PixelMetric m, - const QWidget *widget = 0 ) const; + const TQWidget *widget = 0 ) const; - QSize sizeFromContents( ContentsType contents, - const QWidget *widget, - const QSize &contentSize, - const QStyleOption& opt ) const; + TQSize sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const; - QRect subRect( SubRect r, - const QWidget *widget ) const; + TQRect subRect( SubRect r, + const TQWidget *widget ) const; // Fix Qt3's wacky image positions - QPixmap stylePixmap( StylePixmap stylepixmap, - const QWidget *widget = 0, - const QStyleOption& = QStyleOption::Default ) const; + TQPixmap stylePixmap( StylePixmap stylepixmap, + const TQWidget *widget = 0, + const TQStyleOption& = TQStyleOption::Default ) const; protected: - bool eventFilter( QObject *object, QEvent *event ); + bool eventFilter( TQObject *object, TQEvent *event ); - void renderGradient( QPainter* p, - const QRect& r, - QColor clr, + void renderGradient( TQPainter* p, + const TQRect& r, + TQColor clr, bool horizontal, int px=0, int py=0, int pwidth=-1, int pheight=-1 ) const; - QWidget *hoverWidget; + TQWidget *hoverWidget; StyleType type; bool highcolor; mutable bool selectionBackground; diff --git a/kstyles/highcontrast/config/highcontrastconfig.cpp b/kstyles/highcontrast/config/highcontrastconfig.cpp index 33771f76c..233fb7365 100644 --- a/kstyles/highcontrast/config/highcontrastconfig.cpp +++ b/kstyles/highcontrast/config/highcontrastconfig.cpp @@ -24,40 +24,40 @@ DEALINGS IN THE SOFTWARE. */ -#include <qcheckbox.h> -#include <qlayout.h> -#include <qsettings.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqsettings.h> #include <kdialog.h> #include <kglobal.h> #include <klocale.h> #include "highcontrastconfig.h" -extern "C" KDE_EXPORT QWidget* -allocate_kstyle_config(QWidget* parent) +extern "C" KDE_EXPORT TQWidget* +allocate_kstyle_config(TQWidget* parent) { return new HighContrastStyleConfig(parent); } HighContrastStyleConfig::HighContrastStyleConfig( - QWidget* parent): QWidget(parent) + TQWidget* parent): TQWidget(parent) { // Should have no margins here, the dialog provides them - QVBoxLayout* layout = new QVBoxLayout(this, 0, 0); + TQVBoxLayout* layout = new TQVBoxLayout(this, 0, 0); KGlobal::locale()->insertCatalogue("kstyle_highcontrast_config"); - wideLinesBox = new QCheckBox(i18n("Use wider lines"), this); + wideLinesBox = new TQCheckBox(i18n("Use wider lines"), this); layout->add(wideLinesBox); layout->addStretch(1); - QSettings s; + TQSettings s; originalWideLinesState = s.readBoolEntry( "/highcontraststyle/Settings/wideLines", false); wideLinesBox->setChecked(originalWideLinesState); - connect(wideLinesBox, SIGNAL(toggled(bool)), SLOT(updateChanged())); + connect(wideLinesBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(updateChanged())); } HighContrastStyleConfig::~HighContrastStyleConfig() @@ -69,7 +69,7 @@ HighContrastStyleConfig::~HighContrastStyleConfig() void HighContrastStyleConfig::save() { - QSettings s; + TQSettings s; s.writeEntry("/highcontraststyle/Settings/wideLines", wideLinesBox->isChecked()); } diff --git a/kstyles/highcontrast/config/highcontrastconfig.h b/kstyles/highcontrast/config/highcontrastconfig.h index 26d8a0593..26bd2ff4b 100644 --- a/kstyles/highcontrast/config/highcontrastconfig.h +++ b/kstyles/highcontrast/config/highcontrastconfig.h @@ -33,7 +33,7 @@ class HighContrastStyleConfig: public QWidget { Q_OBJECT public: - HighContrastStyleConfig(QWidget* parent); + HighContrastStyleConfig(TQWidget* parent); ~HighContrastStyleConfig(); // This signal and the next two slots are the plugin @@ -52,7 +52,7 @@ protected slots: protected: // We store settings directly in widgets to // avoid the hassle of sync'ing things - QCheckBox* wideLinesBox; + TQCheckBox* wideLinesBox; // Original settings, for accurate dirtiness tracking bool originalWideLinesState; diff --git a/kstyles/highcontrast/highcontrast.cpp b/kstyles/highcontrast/highcontrast.cpp index d7669ff9d..b5be5cff8 100644 --- a/kstyles/highcontrast/highcontrast.cpp +++ b/kstyles/highcontrast/highcontrast.cpp @@ -24,25 +24,25 @@ * Boston, MA 02110-1301, USA. */ -#include <qdrawutil.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qstyleplugin.h> - -#include <qfont.h> -#include <qcombobox.h> -#include <qheader.h> -#include <qmenubar.h> -#include <qpushbutton.h> -#include <qscrollbar.h> -#include <qslider.h> -#include <qtabbar.h> -#include <qtoolbutton.h> -#include <qtoolbar.h> -#include <qpopupmenu.h> -#include <qprogressbar.h> -#include <qlistview.h> -#include <qsettings.h> +#include <tqdrawutil.h> +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqstyleplugin.h> + +#include <tqfont.h> +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqmenubar.h> +#include <tqpushbutton.h> +#include <tqscrollbar.h> +#include <tqslider.h> +#include <tqtabbar.h> +#include <tqtoolbutton.h> +#include <tqtoolbar.h> +#include <tqpopupmenu.h> +#include <tqprogressbar.h> +#include <tqlistview.h> +#include <tqsettings.h> #include <kdrawutil.h> #include <kpixmapeffect.h> @@ -57,12 +57,12 @@ class HighContrastStylePlugin : public QStylePlugin HighContrastStylePlugin() {} ~HighContrastStylePlugin() {} - QStringList keys() const + TQStringList keys() const { - return QStringList() << "HighContrast"; + return TQStringList() << "HighContrast"; } - QStyle* create( const QString& key ) + TQStyle* create( const TQString& key ) { if ( key == "highcontrast" ) return new HighContrastStyle(); @@ -82,7 +82,7 @@ static const int arrowHMargin = 6; static const int rightBorder = 12; -void addOffset (QRect* r, int offset, int lineWidth = 0) +void addOffset (TQRect* r, int offset, int lineWidth = 0) { int offset1 = offset; int offset2 = offset; @@ -112,7 +112,7 @@ void addOffset (QRect* r, int offset, int lineWidth = 0) HighContrastStyle::HighContrastStyle() : KStyle( 0, ThreeButtonScrollBar ) { - QSettings settings; + TQSettings settings; settings.beginGroup("/highcontraststyle/Settings/"); bool useWideLines = settings.readBoolEntry("wideLines", false); hoverWidget = 0L; @@ -125,42 +125,42 @@ HighContrastStyle::~HighContrastStyle() } -void HighContrastStyle::polish( QPalette& pal ) +void HighContrastStyle::polish( TQPalette& pal ) { //We do not want the disabled widgets to be greyed out, //as that may be hard indeed (and since we use crossed-out text instead), //so we make disabled colors be the same as active foreground and //background colour - for (int c = 0; c < QColorGroup::NColorRoles; ++c) + for (int c = 0; c < TQColorGroup::NColorRoles; ++c) switch (c) { - case QColorGroup::Button: - case QColorGroup::Base: - case QColorGroup::Highlight: - pal.setColor(QPalette::Disabled, QColorGroup::ColorRole(c), pal.color(QPalette::Active, QColorGroup::Background)); + case TQColorGroup::Button: + case TQColorGroup::Base: + case TQColorGroup::Highlight: + pal.setColor(TQPalette::Disabled, TQColorGroup::ColorRole(c), pal.color(TQPalette::Active, TQColorGroup::Background)); break; - case QColorGroup::ButtonText: - case QColorGroup::Text: - case QColorGroup::HighlightedText: - pal.setColor(QPalette::Disabled, QColorGroup::ColorRole(c), pal.color(QPalette::Active, QColorGroup::Foreground)); + case TQColorGroup::ButtonText: + case TQColorGroup::Text: + case TQColorGroup::HighlightedText: + pal.setColor(TQPalette::Disabled, TQColorGroup::ColorRole(c), pal.color(TQPalette::Active, TQColorGroup::Foreground)); break; default: - pal.setColor(QPalette::Disabled, QColorGroup::ColorRole(c), pal.color(QPalette::Active, QColorGroup::ColorRole(c))); + pal.setColor(TQPalette::Disabled, TQColorGroup::ColorRole(c), pal.color(TQPalette::Active, TQColorGroup::ColorRole(c))); } } -void HighContrastStyle::polish (QWidget* widget) +void HighContrastStyle::polish (TQWidget* widget) { - if (widget->inherits ("QButton") - || widget->inherits ("QComboBox") - || widget->inherits ("QSpinWidget") - || widget->inherits ("QLineEdit") - || widget->inherits ("QTextEdit")) + if (widget->inherits ("TQButton") + || widget->inherits ("TQComboBox") + || widget->inherits ("TQSpinWidget") + || widget->inherits ("TQLineEdit") + || widget->inherits ("TQTextEdit")) { widget->installEventFilter (this); - QSpinWidget* spinwidget = dynamic_cast<QSpinWidget*>(widget); + TQSpinWidget* spinwidget = dynamic_cast<TQSpinWidget*>(widget); if (spinwidget && spinwidget->editWidget()) spinwidget->editWidget()->installEventFilter (this); } @@ -169,54 +169,54 @@ void HighContrastStyle::polish (QWidget* widget) } -void HighContrastStyle::unPolish (QWidget* widget) +void HighContrastStyle::unPolish (TQWidget* widget) { - if (widget->inherits ("QWidget") || widget->inherits ("QComboBox") || widget->inherits ("QSpinWidget") || widget->inherits ("QLineEdit") || widget->inherits ("QTextEdit")) + if (widget->inherits ("TQWidget") || widget->inherits ("TQComboBox") || widget->inherits ("TQSpinWidget") || widget->inherits ("TQLineEdit") || widget->inherits ("TQTextEdit")) widget->removeEventFilter (this); KStyle::unPolish (widget); } -void HighContrastStyle::setColorsNormal (QPainter* p, const QColorGroup& cg, int flags, int highlight) const +void HighContrastStyle::setColorsNormal (TQPainter* p, const TQColorGroup& cg, int flags, int highlight) const { setColorsByState (p, cg, cg.foreground(), cg.background(), flags, highlight); } -void HighContrastStyle::setColorsButton (QPainter* p, const QColorGroup& cg, int flags, int highlight) const +void HighContrastStyle::setColorsButton (TQPainter* p, const TQColorGroup& cg, int flags, int highlight) const { setColorsByState (p, cg, cg.buttonText(), cg.button(), flags, highlight); } -void HighContrastStyle::setColorsText (QPainter* p, const QColorGroup& cg, int flags, int highlight) const +void HighContrastStyle::setColorsText (TQPainter* p, const TQColorGroup& cg, int flags, int highlight) const { setColorsByState (p, cg, cg.text(), cg.base(), flags, highlight); } -void HighContrastStyle::setColorsHighlight (QPainter* p, const QColorGroup& cg, int flags) const +void HighContrastStyle::setColorsHighlight (TQPainter* p, const TQColorGroup& cg, int flags) const { setColorsByState (p, cg, cg.highlightedText(), cg.highlight(), flags, 0); } -void HighContrastStyle::setColorsByState (QPainter* p, const QColorGroup& cg, const QColor& fg, const QColor& bg, int flags, int highlight) const +void HighContrastStyle::setColorsByState (TQPainter* p, const TQColorGroup& cg, const TQColor& fg, const TQColor& bg, int flags, int highlight) const { - QFont font = p->font(); + TQFont font = p->font(); font.setStrikeOut (! (flags & Style_Enabled)); p->setFont (font); if ((flags & Style_Enabled) && (flags & highlight)) { - p->setPen (QPen (cg.highlightedText(), basicLineWidth, flags & Style_Enabled ? Qt::SolidLine : Qt::DotLine)); + p->setPen (TQPen (cg.highlightedText(), basicLineWidth, flags & Style_Enabled ? Qt::SolidLine : Qt::DotLine)); p->setBackgroundColor (cg.highlight()); } else { - p->setPen (QPen (fg, basicLineWidth, flags & Style_Enabled ? Qt::SolidLine : Qt::DotLine)); + p->setPen (TQPen (fg, basicLineWidth, flags & Style_Enabled ? Qt::SolidLine : Qt::DotLine)); p->setBackgroundColor (bg); } - p->setBrush (QBrush ()); + p->setBrush (TQBrush ()); } -void HighContrastStyle::drawRect (QPainter* p, QRect r, int offset, bool filled) const +void HighContrastStyle::drawRect (TQPainter* p, TQRect r, int offset, bool filled) const { addOffset (&r, offset, p->pen().width()); if (filled) @@ -225,16 +225,16 @@ void HighContrastStyle::drawRect (QPainter* p, QRect r, int offset, bool filled) p->drawRect (r); } -void HighContrastStyle::drawRoundRect (QPainter* p, QRect r, int offset, bool filled) const +void HighContrastStyle::drawRoundRect (TQPainter* p, TQRect r, int offset, bool filled) const { int lineWidth = p->pen().width(); if ((r.width() >= 5*lineWidth + 2*offset) && (r.height() >= 5*lineWidth + 2*offset)) { - QRect r2 (r); + TQRect r2 (r); addOffset (&r2, offset, lineWidth); addOffset (&r, offset); - QRect r3 (r); + TQRect r3 (r); addOffset (&r3, lineWidth); p->save(); @@ -257,7 +257,7 @@ void HighContrastStyle::drawRoundRect (QPainter* p, QRect r, int offset, bool fi drawRect (p, r, offset, filled); } -void HighContrastStyle::drawEllipse (QPainter* p, QRect r, int offset, bool filled) const +void HighContrastStyle::drawEllipse (TQPainter* p, TQRect r, int offset, bool filled) const { addOffset (&r, offset, p->pen().width()); @@ -271,12 +271,12 @@ void HighContrastStyle::drawEllipse (QPainter* p, QRect r, int offset, bool fill p->drawRoundRect (r, 99, 99); } -void HighContrastStyle::drawArrow (QPainter* p, QRect r, PrimitiveElement arrow, int offset) const +void HighContrastStyle::drawArrow (TQPainter* p, TQRect r, PrimitiveElement arrow, int offset) const { p->save(); addOffset (&r, offset); - QPoint center = r.center(); + TQPoint center = r.center(); if (r.height() < r.width()) r.setWidth (r.height()); if (r.width() % 2 != 0) @@ -284,7 +284,7 @@ void HighContrastStyle::drawArrow (QPainter* p, QRect r, PrimitiveElement arrow, r.setHeight (r.width()); r.moveCenter (center); - QPointArray points (3); + TQPointArray points (3); switch (arrow) { case PE_ArrowUp: case PE_SpinWidgetUp: @@ -323,11 +323,11 @@ void HighContrastStyle::drawArrow (QPainter* p, QRect r, PrimitiveElement arrow, // This function draws primitive elements void HighContrastStyle::drawPrimitive (PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { switch(pe) { @@ -353,10 +353,10 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, // ------------------------------------------------------------------- case PE_FocusRect: { p->save(); - p->setBrush (QBrush ()); - p->setPen (QPen (cg.highlight(), basicLineWidth, Qt::SolidLine)); + p->setBrush (TQBrush ()); + p->setPen (TQPen (cg.highlight(), basicLineWidth, Qt::SolidLine)); drawRoundRect (p, r, basicLineWidth, false); - p->setPen (QPen (cg.highlightedText(), basicLineWidth, Qt::DashLine)); + p->setPen (TQPen (cg.highlightedText(), basicLineWidth, Qt::DashLine)); drawRoundRect (p, r, basicLineWidth, false); p->restore(); break; @@ -387,7 +387,7 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, drawRoundRect (p, r); if (r.width() >= 7*basicLineWidth && r.height() >= 7*basicLineWidth) { - QRect r2 (r); + TQRect r2 (r); r2.setWidth (4*basicLineWidth); r2.setHeight (4*basicLineWidth); r2.moveCenter (r.center()); @@ -402,7 +402,7 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, setColorsNormal (p, cg); p->fillRect (r, p->backgroundColor()); - QRect r2 (r); + TQRect r2 (r); if (flags & Style_Horizontal) { if (r2.height() > 5*basicLineWidth) @@ -426,7 +426,7 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, r2.addCoords (0, basicLineWidth, 0, -basicLineWidth); else r2.addCoords (basicLineWidth, 0, -basicLineWidth, 0); - QPen pen = p->pen(); + TQPen pen = p->pen(); pen.setColor (p->backgroundColor()); p->setPen (pen); drawRect (p, r2); @@ -469,7 +469,7 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, if (!(flags & Style_Off)) { - QRect r2 (r); + TQRect r2 (r); addOffset (&r2, basicLineWidth); if (flags & Style_On) { @@ -480,7 +480,7 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, { // Tristate p->drawLine (r2.left(), r2.top()+r2.width()/2, r2.right(), r2.top()+r2.width()/2); } - QPen pen = p->pen(); + TQPen pen = p->pen(); pen.setColor (p->backgroundColor()); p->setPen (pen); drawRect (p, r2, 0, false); @@ -533,7 +533,7 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, setColorsButton (p, cg, flags); p->fillRect (r, p->backgroundColor()); - p->setPen (QPen (p->pen().color(), 1, Qt::DashLine)); + p->setPen (TQPen (p->pen().color(), 1, Qt::DashLine)); if (flags & Style_Horizontal) p->drawLine (r.center().x(), r.top(), r.center().x(), r.bottom()); else @@ -550,7 +550,7 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, setColorsNormal (p, cg, flags, 0); if (!opt.isDefault()) { - QPen pen = p->pen(); + TQPen pen = p->pen(); pen.setWidth (opt.lineWidth()); p->setPen (pen); } @@ -570,7 +570,7 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, setColorsText (p, cg, flags, 0); drawRoundRect (p, r); if (flags & (Style_HasFocus | Style_Active)) - drawPrimitive (PE_FocusRect, p, r, cg, flags, QStyleOption (p->backgroundColor())); + drawPrimitive (PE_FocusRect, p, r, cg, flags, TQStyleOption (p->backgroundColor())); break; } case PE_PanelTabWidget: @@ -637,12 +637,12 @@ void HighContrastStyle::drawPrimitive (PrimitiveElement pe, void HighContrastStyle::drawKStylePrimitive (KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { if ( widget == hoverWidget ) flags |= Style_MouseOver; @@ -657,7 +657,7 @@ void HighContrastStyle::drawKStylePrimitive (KStylePrimitive kpe, { setColorsButton (p, cg); p->fillRect (r, p->backgroundColor()); - p->setBrush (QBrush (p->pen().color(), Qt::BDiagPattern)); + p->setBrush (TQBrush (p->pen().color(), Qt::BDiagPattern)); drawRoundRect (p, r); break; } @@ -667,8 +667,8 @@ void HighContrastStyle::drawKStylePrimitive (KStylePrimitive kpe, // ------------------------------------------------------------------- case KPE_SliderGroove: { setColorsText (p, cg, flags); - QRect r2 (r); - const QSlider *slider = dynamic_cast<const QSlider*>(widget); + TQRect r2 (r); + const TQSlider *slider = dynamic_cast<const TQSlider*>(widget); if (slider != 0) { if (slider->orientation() == Qt::Horizontal) @@ -730,12 +730,12 @@ void HighContrastStyle::drawKStylePrimitive (KStylePrimitive kpe, void HighContrastStyle::drawControl (ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { if ( widget == hoverWidget ) flags |= Style_MouseOver; @@ -754,10 +754,10 @@ void HighContrastStyle::drawControl (ControlElement element, setColorsNormal (p, cg, flags, Style_Selected); drawRoundRect (p, r); - const QTabBar *tb = static_cast< const QTabBar * >(widget); - QTabBar::Shape shape = tb->shape(); - if (shape == QTabBar::TriangularBelow || - shape == QTabBar::RoundedBelow) { + const TQTabBar *tb = static_cast< const TQTabBar * >(widget); + TQTabBar::Shape shape = tb->shape(); + if (shape == TQTabBar::TriangularBelow || + shape == TQTabBar::RoundedBelow) { p->fillRect (r.left(), r.top(), r.width(), 2*basicLineWidth, p->pen().color()); @@ -783,8 +783,8 @@ void HighContrastStyle::drawControl (ControlElement element, // PUSHBUTTON // ------------------------------------------------------------------- case CE_PushButton: { - QPushButton *button = (QPushButton*) widget; - QRect br = r; + TQPushButton *button = (TQPushButton*) widget; + TQRect br = r; bool btnDefault = button->isDefault(); if (( btnDefault || button->autoDefault() ) && (button->isEnabled())) { @@ -810,49 +810,49 @@ void HighContrastStyle::drawControl (ControlElement element, case CE_CheckBoxLabel: case CE_ToolButtonLabel: case CE_PushButtonLabel: { - const QPixmap* pixmap = 0; - QPixmap icon; - QString text; + const TQPixmap* pixmap = 0; + TQPixmap icon; + TQString text; bool popup = false; - QIconSet::Mode mode = flags & Style_Enabled ? ((flags & Style_HasFocus) ? QIconSet::Active : QIconSet::Normal) : QIconSet::Disabled; - QIconSet::State state = flags & Style_On ? QIconSet::On : QIconSet::Off; + TQIconSet::Mode mode = flags & Style_Enabled ? ((flags & Style_HasFocus) ? TQIconSet::Active : TQIconSet::Normal) : TQIconSet::Disabled; + TQIconSet::State state = flags & Style_On ? TQIconSet::On : TQIconSet::Off; int x, y, w, h; r.rect( &x, &y, &w, &h ); if (element == CE_ProgressBarLabel) { - QProgressBar* progressbar = (QProgressBar*) widget; + TQProgressBar* progressbar = (TQProgressBar*) widget; text = progressbar->progressString(); setColorsNormal (p, cg, flags); } else if (element == CE_TabBarLabel) { if (!opt.isDefault()) { - QTab* tab = opt.tab(); + TQTab* tab = opt.tab(); text = tab->text(); } setColorsNormal (p, cg, flags, Style_Selected); } else if (element == CE_ToolButtonLabel) { - QToolButton* toolbutton = (QToolButton*) widget; + TQToolButton* toolbutton = (TQToolButton*) widget; text = toolbutton->text(); pixmap = toolbutton->pixmap(); if (!toolbutton->iconSet().isNull()) - icon = toolbutton->iconSet().pixmap (QIconSet::Small, mode, state); + icon = toolbutton->iconSet().pixmap (TQIconSet::Small, mode, state); popup = toolbutton->popup(); setColorsButton (p, cg, flags); } else if (element == CE_PushButtonLabel) { - QPushButton* pushbutton = (QPushButton*) widget; + TQPushButton* pushbutton = (TQPushButton*) widget; text = pushbutton->text(); pixmap = pushbutton->pixmap(); if (pushbutton->iconSet() && !pushbutton->iconSet()->isNull()) - icon = pushbutton->iconSet()->pixmap (QIconSet::Small, mode, state); + icon = pushbutton->iconSet()->pixmap (TQIconSet::Small, mode, state); popup = pushbutton->popup(); setColorsButton (p, cg, flags); } else { - const QButton* button = (const QButton*)widget; + const TQButton* button = (const TQButton*)widget; pixmap = button->pixmap(); text = button->text(); setColorsNormal (p, cg); @@ -861,7 +861,7 @@ void HighContrastStyle::drawControl (ControlElement element, // Does the button have a popup menu? if (popup) { int dx = pixelMetric (PM_MenuButtonIndicator, widget); - drawArrow (p, QRect(x + w - dx - 2, y + 2, dx, h - 4), PE_ArrowDown); + drawArrow (p, TQRect(x + w - dx - 2, y + 2, dx, h - 4), PE_ArrowDown); w -= dx; } @@ -882,11 +882,11 @@ void HighContrastStyle::drawControl (ControlElement element, // Draw a focus rect if the button has focus if (flags & Style_HasFocus) - drawPrimitive (PE_FocusRect, p, r, cg, flags, QStyleOption (p->backgroundColor())); + drawPrimitive (PE_FocusRect, p, r, cg, flags, TQStyleOption (p->backgroundColor())); // Draw the label itself - QColor color = p->pen().color(); - drawItem (p, QRect(x, y, w, h), + TQColor color = p->pen().color(); + drawItem (p, TQRect(x, y, w, h), (element == CE_RadioButtonLabel || element == CE_CheckBoxLabel || element == CE_ProgressBarLabel) ? AlignVCenter|AlignLeft|ShowPrefix : AlignCenter|ShowPrefix, cg, flags & Style_Enabled, pixmap, text, -1, &color); break; @@ -914,9 +914,9 @@ void HighContrastStyle::drawControl (ControlElement element, setColorsNormal (p, cg, flags, Style_Active|Style_MouseOver); p->fillRect (r, p->backgroundColor ()); if (!opt.isDefault()) { - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); - QColor color = p->pen().color(); + TQColor color = p->pen().color(); drawItem (p, r, AlignCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, cg, flags, mi->pixmap(), mi->text(), -1, &color); @@ -942,9 +942,9 @@ void HighContrastStyle::drawControl (ControlElement element, // ------------------------------------------------------------------- case CE_ProgressBarGroove: { setColorsText (p, cg, flags); - const QProgressBar *progressbar = dynamic_cast<const QProgressBar*>(widget); + const TQProgressBar *progressbar = dynamic_cast<const TQProgressBar*>(widget); if (progressbar) { - QRect r2 (r); + TQRect r2 (r); r2.setLeft (p->boundingRect (r, AlignVCenter|AlignLeft|ShowPrefix, progressbar->progressString()).right() + 4*basicLineWidth); drawRoundRect (p, r2); @@ -952,10 +952,10 @@ void HighContrastStyle::drawControl (ControlElement element, break; } case CE_ProgressBarContents: { - const QProgressBar *progressbar = dynamic_cast<const QProgressBar*>(widget); + const TQProgressBar *progressbar = dynamic_cast<const TQProgressBar*>(widget); if (progressbar) { - QRect r2 (r); + TQRect r2 (r); r2.setLeft (p->boundingRect (r, AlignVCenter|AlignLeft|ShowPrefix, progressbar->progressString()).right() + 4*basicLineWidth); long progress = r2.width() * progressbar->progress(); @@ -985,15 +985,15 @@ void HighContrastStyle::drawControl (ControlElement element, setColorsNormal (p, cg, flags, Style_Active|Style_MouseOver); p->fillRect (r, p->backgroundColor ()); - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; - QMenuItem *mi = opt.menuItem(); + const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; + TQMenuItem *mi = opt.menuItem(); if (!mi) break; int tab = opt.tabWidth(); int checkcol = opt.maxIconWidth(); bool checkable = popupmenu->isCheckable(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1008,20 +1008,20 @@ void HighContrastStyle::drawControl (ControlElement element, // Do we have an icon? if ( mi->iconSet() && !mi->iconSet()->isNull() ) { - QIconSet::Mode mode; - QRect cr = visualRect( QRect(x, y, checkcol, h), r ); + TQIconSet::Mode mode; + TQRect cr = visualRect( TQRect(x, y, checkcol, h), r ); // Select the correct icon from the iconset if (!(flags & Style_Enabled)) - mode = QIconSet::Disabled; + mode = TQIconSet::Disabled; else if (flags & Style_Active) - mode = QIconSet::Active; + mode = TQIconSet::Active; else - mode = QIconSet::Normal; + mode = TQIconSet::Normal; // Draw the icon - QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); - QRect pmr( 0, 0, pixmap.width(), pixmap.height() ); + TQPixmap pixmap = mi->iconSet()->pixmap( TQIconSet::Small, mode ); + TQRect pmr( 0, 0, pixmap.width(), pixmap.height() ); pmr.moveCenter( cr.center() ); p->drawPixmap( pmr.topLeft(), pixmap ); @@ -1037,9 +1037,9 @@ void HighContrastStyle::drawControl (ControlElement element, else if ( checkable && mi->isChecked() ) { int cx = reverse ? x+w - checkcol : x; - QRect rc (cx, y, checkcol, h); + TQRect rc (cx, y, checkcol, h); addOffset (&rc, 2*basicLineWidth); - QPoint center = rc.center(); + TQPoint center = rc.center(); if (rc.width() > rc.height()) rc.setWidth (rc.height()); else @@ -1071,7 +1071,7 @@ void HighContrastStyle::drawControl (ControlElement element, } else { // The menu item doesn't draw it's own label - QString s = mi->text(); + TQString s = mi->text(); // Does the menu item have a text label? if ( !s.isNull() ) { @@ -1100,7 +1100,7 @@ void HighContrastStyle::drawControl (ControlElement element, // The menu item doesn't have a text label // Check if it has a pixmap instead else if ( mi->pixmap() ) { - QPixmap *pixmap = mi->pixmap(); + TQPixmap *pixmap = mi->pixmap(); // Draw the pixmap if ( pixmap->depth() == 1 ) @@ -1119,7 +1119,7 @@ void HighContrastStyle::drawControl (ControlElement element, if ( mi->popup() ) { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; int dim = pixelMetric(PM_MenuButtonIndicator); - QRect vr = visualRect( QRect( x + w - arrowHMargin - 2*itemFrame - dim, + TQRect vr = visualRect( TQRect( x + w - arrowHMargin - 2*itemFrame - dim, y + h / 2 - dim / 2, dim, dim), r ); // Draw an arrow at the far end of the menu item @@ -1134,10 +1134,10 @@ void HighContrastStyle::drawControl (ControlElement element, } void HighContrastStyle::drawControlMask (ControlElement element, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &opt) const + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &opt) const { switch (element) { case CE_PushButton: @@ -1164,9 +1164,9 @@ void HighContrastStyle::drawControlMask (ControlElement element, // Helper to find the next sibling that's not hidden // Lifted from kstyle.cpp -static QListViewItem* nextVisibleSibling(QListViewItem* item) +static TQListViewItem* nextVisibleSibling(TQListViewItem* item) { - QListViewItem* sibling = item; + TQListViewItem* sibling = item; do { sibling = sibling->nextSibling(); @@ -1177,14 +1177,14 @@ static QListViewItem* nextVisibleSibling(QListViewItem* item) } void HighContrastStyle::drawComplexControl (ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { if ( widget == hoverWidget ) flags |= Style_MouseOver; @@ -1197,15 +1197,15 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, setColorsText (p, cg, flags); drawRoundRect (p, r); - QRect r2 = QStyle::visualRect (querySubControlMetrics (CC_ComboBox, widget, SC_ComboBoxArrow), widget); + TQRect r2 = TQStyle::visualRect (querySubControlMetrics (CC_ComboBox, widget, SC_ComboBoxArrow), widget); if (flags & Style_HasFocus) { - QRect r3 (r); + TQRect r3 (r); if (r2.left() > 0) r3.setRight (r2.left()+basicLineWidth-1); else r3.setLeft (r2.right()-basicLineWidth+1); - drawPrimitive (PE_FocusRect, p, r3, cg, flags, QStyleOption (p->backgroundColor())); + drawPrimitive (PE_FocusRect, p, r3, cg, flags, TQStyleOption (p->backgroundColor())); } setColorsButton (p, cg, flags); @@ -1226,18 +1226,18 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, setColorsText (p, cg, flags); drawRoundRect (p, r); if (flags & Style_HasFocus) - drawPrimitive(PE_FocusRect, p, r, cg, flags, QStyleOption (p->backgroundColor())); + drawPrimitive(PE_FocusRect, p, r, cg, flags, TQStyleOption (p->backgroundColor())); } setColorsButton (p, cg, flags); // Draw arrows if required if (controls & SC_SpinWidgetDown) { - QRect r2 = QStyle::visualRect (querySubControlMetrics (CC_SpinWidget, widget, SC_SpinWidgetDown), widget); + TQRect r2 = TQStyle::visualRect (querySubControlMetrics (CC_SpinWidget, widget, SC_SpinWidgetDown), widget); drawRoundRect (p, r2); drawArrow (p, r2, PE_SpinWidgetDown, 2*basicLineWidth); } if (controls & SC_SpinWidgetUp) { - QRect r2 = QStyle::visualRect (querySubControlMetrics (CC_SpinWidget, widget, SC_SpinWidgetUp), widget); + TQRect r2 = TQStyle::visualRect (querySubControlMetrics (CC_SpinWidget, widget, SC_SpinWidgetUp), widget); drawRoundRect (p, r2); drawArrow (p, r2, PE_SpinWidgetUp, 2*basicLineWidth); } @@ -1249,12 +1249,12 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, // TOOLBUTTON // ------------------------------------------------------------------- case CC_ToolButton: { - const QToolButton *toolbutton = (const QToolButton *) widget; + const TQToolButton *toolbutton = (const TQToolButton *) widget; setColorsButton (p, cg, flags); p->fillRect (r, p->backgroundColor ()); - QRect button, menuarea; + TQRect button, menuarea; button = querySubControlMetrics(control, widget, SC_ToolButton, opt); menuarea = querySubControlMetrics(control, widget, SC_ToolButtonMenu, opt); @@ -1277,7 +1277,7 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, toolbutton->parentWidget()->backgroundPixmap() && !toolbutton->parentWidget()->backgroundPixmap()->isNull() ) { - QPixmap pixmap = *(toolbutton->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(toolbutton->parentWidget()->backgroundPixmap()); p->drawTiledPixmap( r, pixmap, toolbutton->pos() ); } } @@ -1291,9 +1291,9 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, } if (toolbutton->hasFocus() && !toolbutton->focusProxy()) { - QRect fr = toolbutton->rect(); + TQRect fr = toolbutton->rect(); addOffset (&fr, 3); - drawPrimitive(PE_FocusRect, p, fr, cg, flags, QStyleOption (p->backgroundColor())); + drawPrimitive(PE_FocusRect, p, fr, cg, flags, TQStyleOption (p->backgroundColor())); } break; @@ -1306,13 +1306,13 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, * Sigh... Lifted and modified from kstyle.cpp */ /* - * Many thanks to TrollTech AS for donating CC_ListView from QWindowsStyle. + * Many thanks to TrollTech AS for donating CC_ListView from TQWindowsStyle. * CC_ListView code is Copyright (C) 1998-2000 TrollTech AS. */ // Paint the icon and text. if ( controls & SC_ListView ) - QCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); + TQCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); // If we're have a branch or are expanded... if ( controls & (SC_ListViewBranch | SC_ListViewExpand) ) @@ -1321,20 +1321,20 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, if (opt.isDefault()) break; - QListViewItem *item = opt.listViewItem(); - QListViewItem *child = item->firstChild(); + TQListViewItem *item = opt.listViewItem(); + TQListViewItem *child = item->firstChild(); int y = r.y(); int c; // dotline vertice count int dotoffset = 0; - QPointArray dotlines; + TQPointArray dotlines; if ( active == SC_All && controls == SC_ListViewExpand ) { // We only need to draw a vertical line c = 2; dotlines.resize(2); - dotlines[0] = QPoint( r.right(), r.top() ); - dotlines[1] = QPoint( r.right(), r.bottom() ); + dotlines[0] = TQPoint( r.right(), r.top() ); + dotlines[1] = TQPoint( r.right(), r.bottom() ); } else { @@ -1354,15 +1354,15 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, int bx = r.width() / 2; // paint stuff in the magical area - QListView* v = item->listView(); + TQListView* v = item->listView(); int lh = QMAX( p->fontMetrics().height() + 2 * v->itemMargin(), - QApplication::globalStrut().height() ); + TQApplication::globalStrut().height() ); if ( lh % 2 > 0 ) lh++; // Draw all the expand/close boxes... - QRect boxrect; - QStyle::StyleFlags boxflags; + TQRect boxrect; + TQStyle::StyleFlags boxflags; while ( child && y < r.height() ) { linebot = y + lh/2; @@ -1376,23 +1376,23 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, h &= ~1; // Force an even number of pixels // The primitive requires a rect. - boxrect = QRect( bx-h/2, linebot-h/2, h, h ); - boxflags = child->isOpen() ? QStyle::Style_Off : QStyle::Style_On; + boxrect = TQRect( bx-h/2, linebot-h/2, h, h ); + boxflags = child->isOpen() ? TQStyle::Style_Off : TQStyle::Style_On; // KStyle extension: Draw the box and expand/collapse indicator drawKStylePrimitive( KPE_ListViewExpander, p, NULL, boxrect, cg, boxflags, opt ); // dotlinery p->setPen( cg.mid() ); - dotlines[c++] = QPoint( bx, linetop ); - dotlines[c++] = QPoint( bx, linebot - 5 ); - dotlines[c++] = QPoint( bx + 5, linebot ); - dotlines[c++] = QPoint( r.width(), linebot ); + dotlines[c++] = TQPoint( bx, linetop ); + dotlines[c++] = TQPoint( bx, linebot - 5 ); + dotlines[c++] = TQPoint( bx + 5, linebot ); + dotlines[c++] = TQPoint( r.width(), linebot ); linetop = linebot + 5; } else { // just dotlinery - dotlines[c++] = QPoint( bx+1, linebot ); - dotlines[c++] = QPoint( r.width(), linebot ); + dotlines[c++] = TQPoint( bx+1, linebot ); + dotlines[c++] = TQPoint( r.width(), linebot ); } y += child->totalHeight(); @@ -1404,16 +1404,16 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, if ( linetop < linebot ) { - dotlines[c++] = QPoint( bx, linetop ); - dotlines[c++] = QPoint( bx, linebot ); + dotlines[c++] = TQPoint( bx, linetop ); + dotlines[c++] = TQPoint( bx, linebot ); } } // Draw all the branches... static int thickness = kPixelMetric( KPM_ListViewBranchThickness ); int line; // index into dotlines - QRect branchrect; - QStyle::StyleFlags branchflags; + TQRect branchrect; + TQStyle::StyleFlags branchflags; for( line = 0; line < c; line += 2 ) { // assumptions here: lines are horizontal or vertical. @@ -1430,8 +1430,8 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, int point = dotlines[line].x(); int other = dotlines[line].y(); - branchrect = QRect( point, other-(thickness/2), end-point, thickness ); - branchflags = QStyle::Style_Horizontal; + branchrect = TQRect( point, other-(thickness/2), end-point, thickness ); + branchflags = TQStyle::Style_Horizontal; // KStyle extension: Draw the horizontal branch drawKStylePrimitive( KPE_ListViewBranch, p, NULL, branchrect, cg, branchflags, opt ); @@ -1443,11 +1443,11 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, int other = dotlines[line].x(); int pixmapoffset = ((point & 1) != dotoffset ) ? 1 : 0; - branchrect = QRect( other-(thickness/2), point, thickness, end-point ); + branchrect = TQRect( other-(thickness/2), point, thickness, end-point ); if (!pixmapoffset) // ### Hackish - used to hint the offset - branchflags = QStyle::Style_NoChange; + branchflags = TQStyle::Style_NoChange; else - branchflags = QStyle::Style_Default; + branchflags = TQStyle::Style_Default; // KStyle extension: Draw the vertical branch drawKStylePrimitive( KPE_ListViewBranch, p, NULL, branchrect, cg, branchflags, opt ); @@ -1465,10 +1465,10 @@ void HighContrastStyle::drawComplexControl (ComplexControl control, } void HighContrastStyle::drawComplexControlMask(ComplexControl c, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &o) const + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &o) const { switch (c) { case CC_SpinWidget: @@ -1483,20 +1483,20 @@ void HighContrastStyle::drawComplexControlMask(ComplexControl c, } } -void HighContrastStyle::drawItem( QPainter *p, - const QRect &r, +void HighContrastStyle::drawItem( TQPainter *p, + const TQRect &r, int flags, - const QColorGroup &cg, + const TQColorGroup &cg, bool enabled, - const QPixmap *pixmap, - const QString &text, + const TQPixmap *pixmap, + const TQString &text, int len, - const QColor *penColor ) const + const TQColor *penColor ) const { p->save(); // make the disabled things use the cross-line - QFont font = p->font(); + TQFont font = p->font(); font.setStrikeOut (!enabled); p->setFont (font); @@ -1507,10 +1507,10 @@ void HighContrastStyle::drawItem( QPainter *p, p->restore(); } -QRect HighContrastStyle::querySubControlMetrics( ComplexControl control, - const QWidget* widget, +TQRect HighContrastStyle::querySubControlMetrics( ComplexControl control, + const TQWidget* widget, SubControl subcontrol, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { switch (control) { @@ -1519,11 +1519,11 @@ QRect HighContrastStyle::querySubControlMetrics( ComplexControl control, switch (subcontrol) { case SC_ComboBoxFrame: - return QRect (0, 0, widget->width(), widget->height()); + return TQRect (0, 0, widget->width(), widget->height()); case SC_ComboBoxArrow: - return QRect (widget->width() - arrow, 0, arrow, widget->height()); + return TQRect (widget->width() - arrow, 0, arrow, widget->height()); case SC_ComboBoxEditField: - return QRect (2*basicLineWidth, 2*basicLineWidth, + return TQRect (2*basicLineWidth, 2*basicLineWidth, widget->width() - arrow - 3*basicLineWidth, widget->height() - 4*basicLineWidth); default: break; @@ -1535,16 +1535,16 @@ QRect HighContrastStyle::querySubControlMetrics( ComplexControl control, switch (subcontrol) { case SC_SpinWidgetFrame: - return QRect (0, 0, widget->width(), widget->height()); + return TQRect (0, 0, widget->width(), widget->height()); case SC_SpinWidgetButtonField: - return QRect (widget->width() - arrow, 0, arrow, widget->height()); + return TQRect (widget->width() - arrow, 0, arrow, widget->height()); case SC_SpinWidgetUp: - return QRect (widget->width() - arrow, 0, arrow, widget->height()/2); + return TQRect (widget->width() - arrow, 0, arrow, widget->height()/2); case SC_SpinWidgetDown: - return QRect (widget->width() - arrow, widget->height()/2, + return TQRect (widget->width() - arrow, widget->height()/2, arrow, widget->height()-widget->height()/2); case SC_SpinWidgetEditField: - return QRect (2*basicLineWidth, 2*basicLineWidth, + return TQRect (2*basicLineWidth, 2*basicLineWidth, widget->width() - arrow - 3*basicLineWidth, widget->height() - 4*basicLineWidth); default: break; @@ -1559,7 +1559,7 @@ QRect HighContrastStyle::querySubControlMetrics( ComplexControl control, } -int HighContrastStyle::pixelMetric(PixelMetric m, const QWidget *widget) const +int HighContrastStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const { //### TODO: Use the tab metrics changes from Ker. switch(m) @@ -1592,7 +1592,7 @@ int HighContrastStyle::pixelMetric(PixelMetric m, const QWidget *widget) const } case PM_DefaultFrameWidth: { - if (widget && (widget->inherits ("QLineEdit") || widget->inherits ("QTextEdit"))) + if (widget && (widget->inherits ("TQLineEdit") || widget->inherits ("TQTextEdit"))) return 2*basicLineWidth; else return basicLineWidth; @@ -1647,7 +1647,7 @@ int HighContrastStyle::pixelMetric(PixelMetric m, const QWidget *widget) const } } -int HighContrastStyle::kPixelMetric( KStylePixelMetric kpm, const QWidget *widget ) const +int HighContrastStyle::kPixelMetric( KStylePixelMetric kpm, const TQWidget *widget ) const { switch (kpm) { case KPM_ListViewBranchThickness: @@ -1659,17 +1659,17 @@ int HighContrastStyle::kPixelMetric( KStylePixelMetric kpm, const QWidget *widge } } -QSize HighContrastStyle::sizeFromContents( ContentsType contents, - const QWidget* widget, - const QSize &contentSize, - const QStyleOption& opt ) const +TQSize HighContrastStyle::sizeFromContents( ContentsType contents, + const TQWidget* widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const { switch (contents) { // PUSHBUTTON SIZE // ------------------------------------------------------------------ case CT_PushButton: { - const QPushButton* button = (const QPushButton*) widget; + const TQPushButton* button = (const TQPushButton*) widget; int w = contentSize.width(); int h = contentSize.height(); int bm = pixelMetric( PM_ButtonMargin, widget ); @@ -1692,7 +1692,7 @@ QSize HighContrastStyle::sizeFromContents( ContentsType contents, if ( h < 22 ) h = 22; - return QSize( w + basicLineWidth*2, h + basicLineWidth*2 ); + return TQSize( w + basicLineWidth*2, h + basicLineWidth*2 ); } // TOOLBUTTON SIZE @@ -1700,17 +1700,17 @@ QSize HighContrastStyle::sizeFromContents( ContentsType contents, case CT_ToolButton: { int w = contentSize.width(); int h = contentSize.height(); - return QSize(w + basicLineWidth*2 + 6, h + basicLineWidth*2 + 5); + return TQSize(w + basicLineWidth*2 + 6, h + basicLineWidth*2 + 5); break; } // COMBOBOX SIZE // ----------------------------------------------------------------- case CT_ComboBox: { - const QComboBox *cb = static_cast< const QComboBox* > (widget); + const TQComboBox *cb = static_cast< const TQComboBox* > (widget); int borderSize = (cb->editable() ? 4 : 2) * basicLineWidth; int arrowSize = pixelMetric (PM_ScrollBarExtent, cb); - return QSize(borderSize + basicLineWidth + arrowSize, borderSize) + contentSize; + return TQSize(borderSize + basicLineWidth + arrowSize, borderSize) + contentSize; } // POPUPMENU ITEM SIZE @@ -1719,9 +1719,9 @@ QSize HighContrastStyle::sizeFromContents( ContentsType contents, if ( ! widget || opt.isDefault() ) return contentSize; - const QPopupMenu *popup = (const QPopupMenu *) widget; + const TQPopupMenu *popup = (const TQPopupMenu *) widget; bool checkable = popup->isCheckable(); - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = contentSize.width(), h = contentSize.height(); @@ -1749,7 +1749,7 @@ QSize HighContrastStyle::sizeFromContents( ContentsType contents, if ( mi->iconSet() && ! mi->iconSet()->isNull() ) h = QMAX( h, mi->iconSet()->pixmap( - QIconSet::Small, QIconSet::Normal).height() + + TQIconSet::Small, TQIconSet::Normal).height() + 2 * itemFrame ); } @@ -1767,14 +1767,14 @@ QSize HighContrastStyle::sizeFromContents( ContentsType contents, w += rightBorder; - return QSize( w, h ); + return TQSize( w, h ); } // LINEDIT SIZE // ----------------------------------------------------------------- case CT_LineEdit: { - return contentSize + QSize (4*basicLineWidth, 4*basicLineWidth); + return contentSize + TQSize (4*basicLineWidth, 4*basicLineWidth); } @@ -1783,7 +1783,7 @@ QSize HighContrastStyle::sizeFromContents( ContentsType contents, } } -QRect HighContrastStyle::subRect (SubRect subrect, const QWidget * widget) const +TQRect HighContrastStyle::subRect (SubRect subrect, const TQWidget * widget) const { switch (subrect) { case SR_ProgressBarGroove: @@ -1795,38 +1795,38 @@ QRect HighContrastStyle::subRect (SubRect subrect, const QWidget * widget) const } } -bool HighContrastStyle::eventFilter (QObject *object, QEvent *event) +bool HighContrastStyle::eventFilter (TQObject *object, TQEvent *event) { - QWidget* widget = dynamic_cast<QWidget*>(object); + TQWidget* widget = dynamic_cast<TQWidget*>(object); if (widget) { // Handle hover effects. - if (event->type() == QEvent::Enter - && (widget->inherits ("QButton") - || widget->inherits ("QComboBox") - || widget->inherits ("QSpinWidget"))) + if (event->type() == TQEvent::Enter + && (widget->inherits ("TQButton") + || widget->inherits ("TQComboBox") + || widget->inherits ("TQSpinWidget"))) { hoverWidget = widget; widget->repaint (false); } - else if (event->type() == QEvent::Leave - && (widget->inherits ("QButton") - || widget->inherits ("QComboBox") - || widget->inherits ("QSpinWidget"))) + else if (event->type() == TQEvent::Leave + && (widget->inherits ("TQButton") + || widget->inherits ("TQComboBox") + || widget->inherits ("TQSpinWidget"))) { if (object == hoverWidget) hoverWidget = 0L; widget->repaint (false); } // Make sure the focus rectangle is shown correctly. - else if (event->type() == QEvent::FocusIn || event->type() == QEvent::FocusOut) + else if (event->type() == TQEvent::FocusIn || event->type() == TQEvent::FocusOut) { - QWidget* widgetparent = dynamic_cast<QWidget*>(widget->parent()); + TQWidget* widgetparent = dynamic_cast<TQWidget*>(widget->parent()); while (widgetparent - && ! widgetparent->inherits ("QComboBox") - && ! widgetparent->inherits ("QSpinWidget")) + && ! widgetparent->inherits ("TQComboBox") + && ! widgetparent->inherits ("TQSpinWidget")) { - widgetparent = dynamic_cast<QWidget*>(widgetparent->parent()); + widgetparent = dynamic_cast<TQWidget*>(widgetparent->parent()); } if (widgetparent) diff --git a/kstyles/highcontrast/highcontrast.h b/kstyles/highcontrast/highcontrast.h index 0758b806c..b3d64fcc0 100644 --- a/kstyles/highcontrast/highcontrast.h +++ b/kstyles/highcontrast/highcontrast.h @@ -37,8 +37,8 @@ #ifndef __HIGHCONTRAST_H #define __HIGHCONTRAST_H -#include <qbitmap.h> -#include <qintdict.h> +#include <tqbitmap.h> +#include <tqintdict.h> #include <kdrawutil.h> #include <kpixmap.h> #include <kstyle.h> @@ -54,101 +54,101 @@ class HighContrastStyle : public KStyle HighContrastStyle(); virtual ~HighContrastStyle(); - void polish( QPalette& pal ); + void polish( TQPalette& pal ); - void polish( QWidget* widget ); - void unPolish( QWidget* widget ); + void polish( TQWidget* widget ); + void unPolish( TQWidget* widget ); void drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawPrimitive( PrimitiveElement pe, - QPainter* p, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& = QStyleOption::Default ) const; + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControlMask( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& = QStyleOption::Default ) const; + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& = TQStyleOption::Default ) const; - QRect querySubControlMetrics( ComplexControl control, - const QWidget* widget, + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget* widget, SubControl subcontrol, - const QStyleOption& opt = QStyleOption::Default ) const; + const TQStyleOption& opt = TQStyleOption::Default ) const; - void drawItem( QPainter *p, - const QRect &r, + void drawItem( TQPainter *p, + const TQRect &r, int flags, - const QColorGroup &cg, + const TQColorGroup &cg, bool enabled, - const QPixmap *pixmap, - const QString &text, + const TQPixmap *pixmap, + const TQString &text, int len = -1, - const QColor *penColor = 0 ) const; + const TQColor *penColor = 0 ) const; int pixelMetric( PixelMetric m, - const QWidget *widget = 0 ) const; + const TQWidget *widget = 0 ) const; int kPixelMetric( KStylePixelMetric m, - const QWidget *widget = 0 ) const; + const TQWidget *widget = 0 ) const; - QSize sizeFromContents( ContentsType contents, - const QWidget *widget, - const QSize &contentSize, - const QStyleOption& opt ) const; + TQSize sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const; - QRect subRect (SubRect subrect, const QWidget * widget) const; + TQRect subRect (SubRect subrect, const TQWidget * widget) const; protected: - bool eventFilter( QObject *object, QEvent *event ); + bool eventFilter( TQObject *object, TQEvent *event ); - QWidget *hoverWidget; + TQWidget *hoverWidget; private: - void setColorsNormal (QPainter* p, const QColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const; - void setColorsButton (QPainter* p, const QColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const; - void setColorsText (QPainter* p, const QColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const; - void setColorsHighlight (QPainter* p, const QColorGroup& cg, int flags = Style_Enabled) const; - void setColorsByState (QPainter* p, const QColorGroup& cg, const QColor& fg, const QColor& bg, int flags, int highlight) const; - - void drawRect (QPainter* p, QRect r, int offset = 0, bool filled = true) const; - void drawRoundRect (QPainter* p, QRect r, int offset = 0, bool filled = true) const; - void drawEllipse (QPainter* p, QRect r, int offset = 0, bool filled = true) const; - void drawArrow (QPainter* p, QRect r, PrimitiveElement arrow, int offset = 0) const; + void setColorsNormal (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const; + void setColorsButton (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const; + void setColorsText (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const; + void setColorsHighlight (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled) const; + void setColorsByState (TQPainter* p, const TQColorGroup& cg, const TQColor& fg, const TQColor& bg, int flags, int highlight) const; + + void drawRect (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const; + void drawRoundRect (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const; + void drawEllipse (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const; + void drawArrow (TQPainter* p, TQRect r, PrimitiveElement arrow, int offset = 0) const; int basicLineWidth; // Disable copy constructor and = operator diff --git a/kstyles/keramik/colorutil.cpp b/kstyles/keramik/colorutil.cpp index 71bf75873..81d5eeb7a 100644 --- a/kstyles/keramik/colorutil.cpp +++ b/kstyles/keramik/colorutil.cpp @@ -19,13 +19,13 @@ */ // $Id$ -#include <qcolor.h> +#include <tqcolor.h> #include "colorutil.h" namespace Keramik { - QColor ColorUtil::lighten(QColor in, int factor) + TQColor ColorUtil::lighten(TQColor in, int factor) { if (factor > 100) { @@ -41,7 +41,7 @@ namespace Keramik int hd = int(mShare*diff); int delta = int((diff - hd)*7.55); - QColor wrk = in.light(100+hd); + TQColor wrk = in.light(100+hd); int r = wrk.red(); int g = wrk.green(); @@ -55,7 +55,7 @@ namespace Keramik if (g>255) g=255; if (b>255) b=255; - return QColor(r,g,b); + return TQColor(r,g,b); } return in; diff --git a/kstyles/keramik/colorutil.h b/kstyles/keramik/colorutil.h index ae01b450a..62b2a14b2 100644 --- a/kstyles/keramik/colorutil.h +++ b/kstyles/keramik/colorutil.h @@ -30,7 +30,7 @@ namespace Keramik class ColorUtil { public: - static QColor lighten(QColor in, int factor); + static TQColor lighten(TQColor in, int factor); }; } diff --git a/kstyles/keramik/genembed.cpp b/kstyles/keramik/genembed.cpp index 2f9449406..2fecf94d1 100644 --- a/kstyles/keramik/genembed.cpp +++ b/kstyles/keramik/genembed.cpp @@ -23,12 +23,12 @@ DEALINGS IN THE SOFTWARE. */ -#include <qfileinfo.h> -#include <qimage.h> -#include <qmap.h> -#include <qregexp.h> -#include <qtextstream.h> -#include <qvaluevector.h> +#include <tqfileinfo.h> +#include <tqimage.h> +#include <tqmap.h> +#include <tqregexp.h> +#include <tqtextstream.h> +#include <tqvaluevector.h> #include <kimageeffect.h> @@ -52,7 +52,7 @@ so that one can do (R*T+GreyAdd, G*T+GreyAdd, B*T+GreyAdd, SrcAlpha) as pixel va */ -int evalSuffix(QString suffix) +int evalSuffix(TQString suffix) { if (suffix == "-tl") return 0; @@ -120,28 +120,28 @@ int main(int argc, char** argv) if (argc < 2) return 0; - QValueVector<KeramikEmbedImage> images; + TQValueVector<KeramikEmbedImage> images; - cout<<"#include <qintdict.h>\n\n"; + cout<<"#include <tqintdict.h>\n\n"; cout<<"#include \"keramikimage.h\"\n\n"; - QMap<QString, int> assignID; + TQMap<TQString, int> assignID; int nextID = 0; for (int c = 1; c<argc; c++) { - QImage input(argv[c]); + TQImage input(argv[c]); - QFileInfo fi(argv[c]); - QString s = fi.baseName(); + TQFileInfo fi(argv[c]); + TQString s = fi.baseName(); KeramikEmbedImage image; int pos; - QString id = s; + TQString id = s; int readJustID = 0; @@ -248,7 +248,7 @@ int main(int argc, char** argv) QRgb basePix = (QRgb)*read; //cout<<(r*destAlpha.alphas[pos])<<"\n"; //cout<<(int)destAlpha.alphas[pos]<<"\n"; - QColor clr(basePix); + TQColor clr(basePix); int h,s,v; clr.hsv(&h,&s,&v); @@ -363,16 +363,16 @@ int main(int argc, char** argv) - QFile file("keramikrc.h"); + TQFile file("keramikrc.h"); file.open(IO_WriteOnly); - QTextStream ts( &file); + TQTextStream ts( &file); ts<<"#ifndef KERAMIK_RC_H\n"; ts<<"#define KERAMIK_RC_H\n"; ts<<"enum KeramikWidget {\n"; - for (QMap<QString, int>::iterator i = assignID.begin(); i != assignID.end(); ++i) + for (TQMap<TQString, int>::iterator i = assignID.begin(); i != assignID.end(); ++i) { - QString name = "keramik_"+i.key(); + TQString name = "keramik_"+i.key(); name.replace("-","_"); ts<<"\t"<<name<<" = "<<i.data()<<",\n"; } diff --git a/kstyles/keramik/gradients.cpp b/kstyles/keramik/gradients.cpp index cf18500bd..ab804d117 100644 --- a/kstyles/keramik/gradients.cpp +++ b/kstyles/keramik/gradients.cpp @@ -19,28 +19,28 @@ */ // $Id$ -#include <qpainter.h> -#include <qrect.h> -#include <qcolor.h> +#include <tqpainter.h> +#include <tqrect.h> +#include <tqcolor.h> #include "gradients.h" #include "colorutil.h" -#include <qimage.h> -#include <qintcache.h> +#include <tqimage.h> +#include <tqintcache.h> #include <kimageeffect.h> namespace { struct GradientCacheEntry { - QPixmap* m_pixmap; + TQPixmap* m_pixmap; QRgb m_color; bool m_menu; int m_width; int m_height; - GradientCacheEntry(int width, int height, const QColor& color, bool menu): + GradientCacheEntry(int width, int height, const TQColor& color, bool menu): m_pixmap(0), m_color(color.rgb()), m_menu(menu), m_width(width), m_height(height) {} @@ -65,7 +65,7 @@ namespace }; - QIntCache<GradientCacheEntry> cache(65636, 17); + TQIntCache<GradientCacheEntry> cache(65636, 17); } @@ -76,7 +76,7 @@ void GradientPainter::releaseCache() cache.clear(); } -void GradientPainter::renderGradient( QPainter* p, const QRect& r, QColor c, +void GradientPainter::renderGradient( TQPainter* p, const TQRect& r, TQColor c, bool horizontal, bool menu, int px, int py, int pwidth, int pheight) { @@ -100,7 +100,7 @@ void GradientPainter::renderGradient( QPainter* p, const QRect& r, QColor c, { if (entry == *cacheEntry) { - p->drawTiledPixmap(r, *cacheEntry->m_pixmap, horizontal? QPoint(0,py): QPoint(px,0)); + p->drawTiledPixmap(r, *cacheEntry->m_pixmap, horizontal? TQPoint(0,py): TQPoint(px,0)); return; } else @@ -111,13 +111,13 @@ void GradientPainter::renderGradient( QPainter* p, const QRect& r, QColor c, if (horizontal) { - QPixmap* pix = new QPixmap(18, height); + TQPixmap* pix = new TQPixmap(18, height); if (menu) { - QImage gr = KImageEffect::gradient(QSize(4,height), c.light(93), ColorUtil::lighten(c,109), KImageEffect::VerticalGradient ); - QPixmap grT(gr); - QPainter p2(pix); + TQImage gr = KImageEffect::gradient(TQSize(4,height), c.light(93), ColorUtil::lighten(c,109), KImageEffect::VerticalGradient ); + TQPixmap grT(gr); + TQPainter p2(pix); p2.drawTiledPixmap(0,0, 18, height, grT); p2.end(); } @@ -126,13 +126,13 @@ void GradientPainter::renderGradient( QPainter* p, const QRect& r, QColor c, int h1 = 3 * height/4; int h2 = height - h1; - QImage top = KImageEffect::gradient(QSize(4,h1), ColorUtil::lighten(c,110), c.light(94), KImageEffect::VerticalGradient ); - QImage bot = KImageEffect::gradient(QSize(4,h2), c.light(94), ColorUtil::lighten(c,109), KImageEffect::VerticalGradient ); + TQImage top = KImageEffect::gradient(TQSize(4,h1), ColorUtil::lighten(c,110), c.light(94), KImageEffect::VerticalGradient ); + TQImage bot = KImageEffect::gradient(TQSize(4,h2), c.light(94), ColorUtil::lighten(c,109), KImageEffect::VerticalGradient ); - QPixmap topT(top); - QPixmap botT(bot); + TQPixmap topT(top); + TQPixmap botT(bot); - QPainter p2(pix); + TQPainter p2(pix); p2.drawTiledPixmap(0, 0, 18, h1, topT); p2.drawTiledPixmap(0, h1, 18, h2, botT); p2.end(); @@ -142,18 +142,18 @@ void GradientPainter::renderGradient( QPainter* p, const QRect& r, QColor c, } else { - QPixmap* pix = new QPixmap(width, 18); + TQPixmap* pix = new TQPixmap(width, 18); int h1 = 3 * width/4; int h2 = width - h1; - QImage top = KImageEffect::gradient(QSize(h1,4), ColorUtil::lighten(c,110), c.light(94), KImageEffect::HorizontalGradient ); - QImage bot = KImageEffect::gradient(QSize(h2,4), c.light(94), ColorUtil::lighten(c,109), KImageEffect::HorizontalGradient ); + TQImage top = KImageEffect::gradient(TQSize(h1,4), ColorUtil::lighten(c,110), c.light(94), KImageEffect::HorizontalGradient ); + TQImage bot = KImageEffect::gradient(TQSize(h2,4), c.light(94), ColorUtil::lighten(c,109), KImageEffect::HorizontalGradient ); - QPixmap topT(top); - QPixmap botT(bot); + TQPixmap topT(top); + TQPixmap botT(bot); - QPainter p2(pix); + TQPainter p2(pix); p2.drawTiledPixmap(0, 0, h1, 18, topT); p2.drawTiledPixmap(h1, 0, h2, 18, botT); p2.end(); @@ -168,7 +168,7 @@ void GradientPainter::renderGradient( QPainter* p, const QRect& r, QColor c, imgToAdd->m_pixmap->width() * imgToAdd->m_pixmap->height()* imgToAdd->m_pixmap->depth()/8); - p->drawTiledPixmap(r, *imgToAdd->m_pixmap, horizontal? QPoint(0,py): QPoint(px,0)); + p->drawTiledPixmap(r, *imgToAdd->m_pixmap, horizontal? TQPoint(0,py): TQPoint(px,0)); if (!cacheOK) delete imgToAdd; diff --git a/kstyles/keramik/gradients.h b/kstyles/keramik/gradients.h index d4dfd2c95..8ee0a281b 100644 --- a/kstyles/keramik/gradients.h +++ b/kstyles/keramik/gradients.h @@ -30,7 +30,7 @@ namespace Keramik class GradientPainter { public: - static void renderGradient( QPainter* p, const QRect& r, QColor cr, + static void renderGradient( TQPainter* p, const TQRect& r, TQColor cr, bool horizontal, bool menu = false, int px = 0, int py = 0, int pwidth = -1, int pheight = -1 ); diff --git a/kstyles/keramik/keramik.cpp b/kstyles/keramik/keramik.cpp index 5157c34ed..6eb6c57ad 100644 --- a/kstyles/keramik/keramik.cpp +++ b/kstyles/keramik/keramik.cpp @@ -33,27 +33,27 @@ // $Id$ -#include <qbitmap.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qdrawutil.h> -#include <qframe.h> -#include <qheader.h> -#include <qintdict.h> -#include <qlineedit.h> -#include <qlistbox.h> -#include <qmenubar.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qprogressbar.h> -#include <qpushbutton.h> -#include <qsettings.h> -#include <qslider.h> -#include <qstyleplugin.h> -#include <qtabbar.h> -#include <qtimer.h> -#include <qtoolbar.h> -#include <qtoolbutton.h> +#include <tqbitmap.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqdrawutil.h> +#include <tqframe.h> +#include <tqheader.h> +#include <tqintdict.h> +#include <tqlineedit.h> +#include <tqlistbox.h> +#include <tqmenubar.h> +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqprogressbar.h> +#include <tqpushbutton.h> +#include <tqsettings.h> +#include <tqslider.h> +#include <tqstyleplugin.h> +#include <tqtabbar.h> +#include <tqtimer.h> +#include <tqtoolbar.h> +#include <tqtoolbutton.h> #include <kpixmap.h> #include <kpixmapeffect.h> @@ -77,15 +77,15 @@ public: KeramikStylePlugin() {} ~KeramikStylePlugin() {} - QStringList keys() const + TQStringList keys() const { - if (QPixmap::defaultDepth() > 8) - return QStringList() << "Keramik"; + if (TQPixmap::defaultDepth() > 8) + return TQStringList() << "Keramik"; else - return QStringList(); + return TQStringList(); } - QStyle* create( const QString& key ) + TQStyle* create( const TQString& key ) { if ( key == "keramik" ) return new KeramikStyle(); return 0; @@ -98,12 +98,12 @@ KDE_Q_EXPORT_PLUGIN( KeramikStylePlugin ) // ### Remove globals /* -QBitmap lightBmp; -QBitmap grayBmp; -QBitmap dgrayBmp; -QBitmap centerBmp; -QBitmap maskBmp; -QBitmap xBmp; +TQBitmap lightBmp; +TQBitmap grayBmp; +TQBitmap dgrayBmp; +TQBitmap centerBmp; +TQBitmap maskBmp; +TQBitmap xBmp; */ namespace { @@ -122,21 +122,21 @@ namespace namespace { - void drawKeramikArrow(QPainter* p, QColorGroup cg, QRect r, QStyle::PrimitiveElement pe, bool down, bool enabled) + void drawKeramikArrow(TQPainter* p, TQColorGroup cg, TQRect r, TQStyle::PrimitiveElement pe, bool down, bool enabled) { - QPointArray a; + TQPointArray a; switch(pe) { - case QStyle::PE_ArrowUp: + case TQStyle::PE_ArrowUp: a.setPoints(QCOORDARRLEN(keramik_up_arrow), keramik_up_arrow); break; - case QStyle::PE_ArrowDown: + case TQStyle::PE_ArrowDown: a.setPoints(QCOORDARRLEN(keramik_down_arrow), keramik_down_arrow); break; - case QStyle::PE_ArrowLeft: + case TQStyle::PE_ArrowLeft: a.setPoints(QCOORDARRLEN(keramik_left_arrow), keramik_left_arrow); break; @@ -173,13 +173,13 @@ namespace // XXX /* reimp. */ -void KeramikStyle::renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg, - const QPopupMenu* /* popup */ ) const +void KeramikStyle::renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup &cg, + const TQPopupMenu* /* popup */ ) const { - QColor col = cg.button(); + TQColor col = cg.button(); #ifdef Q_WS_X11 // Only draw menu gradients on TrueColor, X11 visuals - if ( QPaintDevice::x11AppDepth() >= 24 ) + if ( TQPaintDevice::x11AppDepth() >= 24 ) KPixmapEffect::gradient( pix, col.light(120), col.dark(115), KPixmapEffect::HorizontalGradient ); else @@ -188,7 +188,7 @@ void KeramikStyle::renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg, } // XXX -QRect KeramikStyle::subRect(SubRect r, const QWidget *widget) const +TQRect KeramikStyle::subRect(SubRect r, const TQWidget *widget) const { // We want the focus rect for buttons to be adjusted from // the Qt3 defaults to be similar to Qt 2's defaults. @@ -197,16 +197,16 @@ QRect KeramikStyle::subRect(SubRect r, const QWidget *widget) const { case SR_PushButtonFocusRect: { - const QPushButton* button = (const QPushButton*) widget; - QRect wrect(widget->rect()); + const TQPushButton* button = (const TQPushButton*) widget; + TQRect wrect(widget->rect()); if (button->isDefault() || button->autoDefault()) { - return QRect(wrect.x() + 6, wrect.y() + 5, wrect.width() - 12, wrect.height() - 10); + return TQRect(wrect.x() + 6, wrect.y() + 5, wrect.width() - 12, wrect.height() - 10); } else { - return QRect(wrect.x() + 3, wrect.y() + 5, wrect.width() - 8, wrect.height() - 10); + return TQRect(wrect.x() + 3, wrect.y() + 5, wrect.width() - 8, wrect.height() - 10); } break; @@ -219,17 +219,17 @@ QRect KeramikStyle::subRect(SubRect r, const QWidget *widget) const case SR_CheckBoxFocusRect: { - const QCheckBox* cb = static_cast<const QCheckBox*>(widget); + const TQCheckBox* cb = static_cast<const TQCheckBox*>(widget); //Only checkbox, no label if (cb->text().isEmpty() && (cb->pixmap() == 0) ) { - QRect bounding = cb->rect(); - QSize checkDim = loader.size( keramik_checkbox_on); + TQRect bounding = cb->rect(); + TQSize checkDim = loader.size( keramik_checkbox_on); int cw = checkDim.width(); int ch = checkDim.height(); - QRect checkbox(bounding.x() + 1, bounding.y() + 1 + (bounding.height() - ch)/2, + TQRect checkbox(bounding.x() + 1, bounding.y() + 1 + (bounding.height() - ch)/2, cw - 3, ch - 4); return checkbox; @@ -244,9 +244,9 @@ QRect KeramikStyle::subRect(SubRect r, const QWidget *widget) const } -QPixmap KeramikStyle::stylePixmap(StylePixmap stylepixmap, - const QWidget* widget, - const QStyleOption& opt) const +TQPixmap KeramikStyle::stylePixmap(StylePixmap stylepixmap, + const TQWidget* widget, + const TQStyleOption& opt) const { switch (stylepixmap) { case SP_TitleBarMinButton: @@ -283,15 +283,15 @@ KeramikStyle::KeramikStyle() forceSmallMode = false; hoverWidget = 0; - QSettings settings; + TQSettings settings; highlightScrollBar = settings.readBoolEntry("/keramik/Settings/highlightScrollBar", true); animateProgressBar = settings.readBoolEntry("/keramik/Settings/animateProgressBar", false); if (animateProgressBar) { - animationTimer = new QTimer( this ); - connect( animationTimer, SIGNAL(timeout()), this, SLOT(updateProgressPos()) ); + animationTimer = new TQTimer( this ); + connect( animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateProgressPos()) ); } firstComboPopupRelease = false; @@ -300,11 +300,11 @@ KeramikStyle::KeramikStyle() void KeramikStyle::updateProgressPos() { //Update the registered progressbars. - QMap<QProgressBar*, int>::iterator iter; + TQMap<TQProgressBar*, int>::iterator iter; bool visible = false; for (iter = progAnimWidgets.begin(); iter != progAnimWidgets.end(); ++iter) { - QProgressBar* pbar = iter.key(); + TQProgressBar* pbar = iter.key(); if (pbar->isVisible() && pbar->isEnabled() && pbar->progress() != pbar->totalSteps()) { @@ -328,28 +328,28 @@ KeramikStyle::~KeramikStyle() KeramikDbCleanup(); } -void KeramikStyle::polish(QApplication* app) +void KeramikStyle::polish(TQApplication* app) { if (!qstrcmp(app->argv()[0], "kicker")) kickerMode = true; } -void KeramikStyle::polish(QWidget* widget) +void KeramikStyle::polish(TQWidget* widget) { // Put in order of highest occurrence to maximise hit rate - if ( widget->inherits( "QPushButton" ) || widget->inherits( "QComboBox" ) || widget->inherits("QToolButton") ) + if ( widget->inherits( "TQPushButton" ) || widget->inherits( "TQComboBox" ) || widget->inherits("TQToolButton") ) { widget->installEventFilter(this); - if ( widget->inherits( "QComboBox" ) ) + if ( widget->inherits( "TQComboBox" ) ) widget->setBackgroundMode( NoBackground ); } - else if ( widget->inherits( "QMenuBar" ) || widget->inherits( "QPopupMenu" ) ) + else if ( widget->inherits( "TQMenuBar" ) || widget->inherits( "TQPopupMenu" ) ) widget->setBackgroundMode( NoBackground ); else if ( widget->parentWidget() && - ( ( widget->inherits( "QListBox" ) && widget->parentWidget()->inherits( "QComboBox" ) ) || + ( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) ) || widget->inherits( "KCompletionBox" ) ) ) { - QListBox* listbox = (QListBox*) widget; + TQListBox* listbox = (TQListBox*) widget; listbox->setLineWidth( 4 ); listbox->setBackgroundMode( NoBackground ); widget->installEventFilter( this ); @@ -363,11 +363,11 @@ void KeramikStyle::polish(QWidget* widget) widget->installEventFilter(this); } - if (animateProgressBar && ::qt_cast<QProgressBar*>(widget)) + if (animateProgressBar && ::qt_cast<TQProgressBar*>(widget)) { widget->installEventFilter(this); - progAnimWidgets[static_cast<QProgressBar*>(widget)] = 0; - connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(progressBarDestroyed(QObject*))); + progAnimWidgets[static_cast<TQProgressBar*>(widget)] = 0; + connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(progressBarDestroyed(TQObject*))); if (!animationTimer->isActive()) animationTimer->start( 50, false ); } @@ -375,22 +375,22 @@ void KeramikStyle::polish(QWidget* widget) KStyle::polish(widget); } -void KeramikStyle::unPolish(QWidget* widget) +void KeramikStyle::unPolish(TQWidget* widget) { //### TODO: This needs major cleanup (and so does polish() ) - if ( widget->inherits( "QPushButton" ) || widget->inherits( "QComboBox" ) ) + if ( widget->inherits( "TQPushButton" ) || widget->inherits( "TQComboBox" ) ) { - if ( widget->inherits( "QComboBox" ) ) + if ( widget->inherits( "TQComboBox" ) ) widget->setBackgroundMode( PaletteButton ); widget->removeEventFilter(this); } - else if ( widget->inherits( "QMenuBar" ) || widget->inherits( "QPopupMenu" ) ) + else if ( widget->inherits( "TQMenuBar" ) || widget->inherits( "TQPopupMenu" ) ) widget->setBackgroundMode( PaletteBackground ); else if ( widget->parentWidget() && - ( ( widget->inherits( "QListBox" ) && widget->parentWidget()->inherits( "QComboBox" ) ) || + ( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) ) || widget->inherits( "KCompletionBox" ) ) ) { - QListBox* listbox = (QListBox*) widget; + TQListBox* listbox = (TQListBox*) widget; listbox->setLineWidth( 1 ); listbox->setBackgroundMode( PaletteBackground ); widget->removeEventFilter( this ); @@ -402,21 +402,21 @@ void KeramikStyle::unPolish(QWidget* widget) widget->setBackgroundMode( PaletteBackground ); widget->removeEventFilter(this); } - else if ( ::qt_cast<QProgressBar*>(widget) ) + else if ( ::qt_cast<TQProgressBar*>(widget) ) { - progAnimWidgets.remove(static_cast<QProgressBar*>(widget)); + progAnimWidgets.remove(static_cast<TQProgressBar*>(widget)); } KStyle::unPolish(widget); } -void KeramikStyle::progressBarDestroyed(QObject* obj) +void KeramikStyle::progressBarDestroyed(TQObject* obj) { - progAnimWidgets.remove(static_cast<QProgressBar*>(obj)); + progAnimWidgets.remove(static_cast<TQProgressBar*>(obj)); } -void KeramikStyle::polish( QPalette& ) +void KeramikStyle::polish( TQPalette& ) { loader.clear(); } @@ -424,8 +424,8 @@ void KeramikStyle::polish( QPalette& ) /** Draws gradient background for toolbar buttons, handles and spacers */ -static void renderToolbarEntryBackground(QPainter* paint, - const QToolBar* parent, QRect r, const QColorGroup& cg, bool horiz) +static void renderToolbarEntryBackground(TQPainter* paint, + const TQToolBar* parent, TQRect r, const TQColorGroup& cg, bool horiz) { int toolWidth, toolHeight; @@ -439,7 +439,7 @@ static void renderToolbarEntryBackground(QPainter* paint, //If we're floating, however, wee need to fiddle //with height to skip the titlebar - if (parent->place() == QDockWindow::OutsideDock) + if (parent->place() == TQDockWindow::OutsideDock) { toolHeight = toolHeight - titleBarH - 2*parent->frameWidth() + 2; //2 at the end = the 2 pixels of border of a "regular" @@ -468,7 +468,7 @@ static void renderToolbarEntryBackground(QPainter* paint, toolWidth, toolHeight); } -static void renderToolbarWidgetBackground(QPainter* painter, const QWidget* widget) +static void renderToolbarWidgetBackground(TQPainter* painter, const TQWidget* widget) { // Draw a gradient background for custom widgets in the toolbar // that have specified a "kde toolbar widget" name, or @@ -476,16 +476,16 @@ static void renderToolbarWidgetBackground(QPainter* painter, const QWidget* widg // Find the top-level toolbar of this widget, since it may be nested in other // widgets that are on the toolbar. - QWidget *parent = static_cast<QWidget*>(widget->parentWidget()); + TQWidget *parent = static_cast<TQWidget*>(widget->parentWidget()); int x_offset = widget->x(), y_offset = widget->y(); while (parent && parent->parent() && !qstrcmp( parent->name(), kdeToolbarWidget ) ) { x_offset += parent->x(); y_offset += parent->y(); - parent = static_cast<QWidget*>(parent->parent()); + parent = static_cast<TQWidget*>(parent->parent()); } - QRect pr = parent->rect(); + TQRect pr = parent->rect(); bool horiz_grad = pr.width() > pr.height(); int toolHeight = parent->height(); @@ -493,13 +493,13 @@ static void renderToolbarWidgetBackground(QPainter* painter, const QWidget* widg // Check if the parent is a QToolbar, and use its orientation, else guess. //Also, get the height to use in the gradient from it. - QToolBar* tb = dynamic_cast<QToolBar*>(parent); + TQToolBar* tb = dynamic_cast<TQToolBar*>(parent); if (tb) { horiz_grad = tb->orientation() == Qt::Horizontal; //If floating, we need to skip the titlebar. - if (tb->place() == QDockWindow::OutsideDock) + if (tb->place() == TQDockWindow::OutsideDock) { toolHeight = tb->height() - titleBarH - 2*tb->frameWidth() + 2; //Calculate offset here by looking at the bottom edge difference, and height. @@ -524,7 +524,7 @@ static void renderToolbarWidgetBackground(QPainter* painter, const QWidget* widg } else { - QPainter p( widget ); + TQPainter p( widget ); Keramik::GradientPainter::renderGradient( &p, widget->rect(), widget->colorGroup().button(), horiz_grad, false, x_offset, y_offset, toolWidth, toolHeight); @@ -533,11 +533,11 @@ static void renderToolbarWidgetBackground(QPainter* painter, const QWidget* widg // This function draws primitive elements as well as their masks. void KeramikStyle::drawPrimitive( PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { bool down = flags & Style_Down; bool on = flags & Style_On; @@ -574,11 +574,11 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, { if (titleBarMode) { - QRect nr; + TQRect nr; if (titleBarMode == Maximized) { //### What should we draw at sides? - nr = QRect(r.x(), r.y(), r.width()-1, r.height() ); + nr = TQRect(r.x(), r.y(), r.width()-1, r.height() ); } else { @@ -588,7 +588,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, if (flags & Style_Down) offY += 1; - nr = QRect(r.x()+offX, r.y()+offY, 15, 15); + nr = TQRect(r.x()+offX, r.y()+offY, 15, 15); } Keramik::ScaledPainter(flags & Style_Down ? keramik_titlebutton_pressed : keramik_titlebutton, @@ -611,12 +611,12 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, if (flags & Style_MouseOver) { Keramik::GradientPainter::renderGradient( p, - QRect(r.x(), 0, r.width(), r.height()), + TQRect(r.x(), 0, r.width(), r.height()), Keramik::ColorUtil::lighten(cg.button(), 115), flags & Style_Horizontal, false ); } else Keramik::GradientPainter::renderGradient( p, - QRect(r.x(), 0, r.width(), r.height()), + TQRect(r.x(), 0, r.width(), r.height()), cg.button(), flags & Style_Horizontal, false ); p->setPen(cg.button().light(70)); @@ -717,7 +717,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, if (sunken) p->fillRect(x+2, y+2, w-4, h-4, cg.button()); else - Keramik::GradientPainter::renderGradient( p, QRect(x+2, y+2, w-4, h-4), + Keramik::GradientPainter::renderGradient( p, TQRect(x+2, y+2, w-4, h-4), cg.button(), flags & Style_Horizontal ); } break; @@ -777,7 +777,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, loader.size( keramik_scrollbar_vbar+KeramikSlider3 ).height() + 2 ) ) count = 5; - QColor col = cg.highlight(); + TQColor col = cg.highlight(); if (customScrollMode || !highlightScrollBar) col = cg.button(); @@ -804,9 +804,9 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, r.x()+r.width()/2 - 1, r.y() + r.height()/2 + 3); - drawKeramikArrow(p, cg, QRect(r.x(), r.y(), r.width()/2, r.height()), PE_ArrowLeft, down, !disabled); + drawKeramikArrow(p, cg, TQRect(r.x(), r.y(), r.width()/2, r.height()), PE_ArrowLeft, down, !disabled); - drawKeramikArrow(p, cg, QRect(r.x()+r.width()/2, r.y(), r.width() - r.width()/2, r.height()), + drawKeramikArrow(p, cg, TQRect(r.x()+r.width()/2, r.y(), r.width() - r.width()/2, r.height()), PE_ArrowRight, down, !disabled); } else @@ -819,9 +819,9 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, r.x()+r.width()/2 + 2, r.y()+r.height()/2); - drawKeramikArrow(p, cg, QRect(r.x(), r.y(), r.width(), r.height()/2), PE_ArrowUp, down, !disabled); + drawKeramikArrow(p, cg, TQRect(r.x(), r.y(), r.width(), r.height()/2), PE_ArrowUp, down, !disabled); - drawKeramikArrow(p, cg, QRect(r.x(), r.y()+r.height()/2, r.width(), r.height() - r.height()/2), + drawKeramikArrow(p, cg, TQRect(r.x(), r.y()+r.height()/2, r.width(), r.height() - r.height()/2), PE_ArrowDown, down, !disabled); //drawKeramikArrow(p, cg, r, PE_ArrowUp, down, !disabled); } @@ -932,7 +932,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, p->setPen(cg.mid()); p->drawLine(x2-1, y+1, x2-1, y2-1); p->drawLine(x+1, y2-1, x2-1, y2-1); - p->fillRect(x+3, y+3, w-5, h-5, cg.brush(QColorGroup::Background)); + p->fillRect(x+3, y+3, w-5, h-5, cg.brush(TQColorGroup::Background)); break; } @@ -944,7 +944,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, //p->setPen( cg.shadow() ); //p->drawRect( r.x()+1, r.y()+1, r.width()-2, r.height()-2); - //p->fillRect( visualRect( QRect( x + 1, y + 1, 23, h - 2 ), r ), cg.background().dark( 105 ) ); + //p->fillRect( visualRect( TQRect( x + 1, y + 1, 23, h - 2 ), r ), cg.background().dark( 105 ) ); //break; // GENERAL PANELS @@ -953,8 +953,8 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, { if (kickerMode) { - if (p->device() && p->device()->devType() == QInternal::Widget && - QCString(static_cast<QWidget*>(p->device())->className()) == "FittsLawFrame" ) + if (p->device() && p->device()->devType() == TQInternal::Widget && + TQCString(static_cast<TQWidget*>(p->device())->className()) == "FittsLawFrame" ) { int x2 = x + r.width() - 1; int y2 = y + r.height() - 1; @@ -980,7 +980,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, : opt.lineWidth(); if (lw == 2) { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); int x,y,w,h; r.rect(&x, &y, &w, &h); int x2 = x+w-1; @@ -1041,8 +1041,8 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, { //Gradient border colors. //(Same as in gradients.cpp) - QColor gradTop = Keramik::ColorUtil::lighten(cg.button(),110); - QColor gradBot = Keramik::ColorUtil::lighten(cg.button(),109); + TQColor gradTop = Keramik::ColorUtil::lighten(cg.button(),110); + TQColor gradBot = Keramik::ColorUtil::lighten(cg.button(),109); if (horiz) { //Top line @@ -1055,7 +1055,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, //Left line Keramik::GradientPainter::renderGradient( - p, QRect(r.x(), r.y(), 1, r.height()), + p, TQRect(r.x(), r.y(), 1, r.height()), cg.button(), true); //Right end-line @@ -1074,7 +1074,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, //Top line Keramik::GradientPainter::renderGradient( - p, QRect(r.x(), r.y(), r.width(), 1), + p, TQRect(r.x(), r.y(), r.width(), 1), cg.button(), false); //Bottom end-line @@ -1089,10 +1089,10 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, // ------------------------------------------------------------------- case PE_DockWindowSeparator: { - QWidget* paintWidget = dynamic_cast<QWidget*>(p->device()); - QToolBar* parent = 0; + TQWidget* paintWidget = dynamic_cast<TQWidget*>(p->device()); + TQToolBar* parent = 0; if (paintWidget) - parent = ::qt_cast<QToolBar*>(paintWidget->parentWidget()); + parent = ::qt_cast<TQToolBar*>(paintWidget->parentWidget()); renderToolbarEntryBackground(p, parent, r, cg, (flags & Style_Horizontal) ); if ( !(flags & Style_Horizontal) ) @@ -1118,7 +1118,7 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, // ------------------------------------------------------------------- if (pe >= PE_ArrowUp && pe <= PE_ArrowLeft) { - QPointArray a; + TQPointArray a; switch(pe) { @@ -1168,12 +1168,12 @@ void KeramikStyle::drawPrimitive( PrimitiveElement pe, } void KeramikStyle::drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { bool disabled = ( flags & Style_Enabled ) == 0; int x, y, w, h; @@ -1185,7 +1185,7 @@ void KeramikStyle::drawKStylePrimitive( KStylePrimitive kpe, // ------------------------------------------------------------------- case KPE_SliderGroove: { - const QSlider* slider = static_cast< const QSlider* >( widget ); + const TQSlider* slider = static_cast< const TQSlider* >( widget ); bool horizontal = slider->orientation() == Horizontal; Keramik::TilePainter::PaintMode pmod = Keramik::TilePainter::PaintNormal; @@ -1205,10 +1205,10 @@ void KeramikStyle::drawKStylePrimitive( KStylePrimitive kpe, // ------------------------------------------------------------------- case KPE_SliderHandle: { - const QSlider* slider = static_cast< const QSlider* >( widget ); + const TQSlider* slider = static_cast< const TQSlider* >( widget ); bool horizontal = slider->orientation() == Horizontal; - QColor hl = cg.highlight(); + TQColor hl = cg.highlight(); if (!disabled && flags & Style_Active) hl = Keramik::ColorUtil::lighten(cg.highlight(),110); @@ -1228,10 +1228,10 @@ void KeramikStyle::drawKStylePrimitive( KStylePrimitive kpe, int x2 = r.x() + r.width()-1; int y2 = r.y() + r.height()-1; - QToolBar* parent = 0; + TQToolBar* parent = 0; - if (widget && widget->parent() && widget->parent()->inherits("QToolBar")) - parent = static_cast<QToolBar*>(widget->parent()); + if (widget && widget->parent() && widget->parent()->inherits("TQToolBar")) + parent = static_cast<TQToolBar*>(widget->parent()); renderToolbarEntryBackground(p, parent, r, cg, (flags & Style_Horizontal)); if (flags & Style_Horizontal) { @@ -1301,20 +1301,20 @@ void KeramikStyle::drawKStylePrimitive( KStylePrimitive kpe, } } -bool KeramikStyle::isFormWidget(const QWidget* widget) const +bool KeramikStyle::isFormWidget(const TQWidget* widget) const { //Form widgets are in the KHTMLView, but that has 2 further inner levels //of widgets - QClipperWidget, and outside of that, QViewportWidget - QWidget* potentialClipPort = widget->parentWidget(); + TQWidget* potentialClipPort = widget->parentWidget(); if ( !potentialClipPort || potentialClipPort->isTopLevel() ) return false; - QWidget* potentialViewPort = potentialClipPort->parentWidget(); + TQWidget* potentialViewPort = potentialClipPort->parentWidget(); if (!potentialViewPort || potentialViewPort->isTopLevel() || qstrcmp(potentialViewPort->name(), "qt_viewport") ) return false; - QWidget* potentialKHTML = potentialViewPort->parentWidget(); + TQWidget* potentialKHTML = potentialViewPort->parentWidget(); if (!potentialKHTML || potentialKHTML->isTopLevel() || qstrcmp(potentialKHTML->className(), "KHTMLView") ) return false; @@ -1324,12 +1324,12 @@ bool KeramikStyle::isFormWidget(const QWidget* widget) const } void KeramikStyle::drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { bool disabled = ( flags & Style_Enabled ) == 0; int x, y, w, h; @@ -1341,7 +1341,7 @@ void KeramikStyle::drawControl( ControlElement element, // ------------------------------------------------------------------- case CE_PushButton: { - const QPushButton* btn = static_cast< const QPushButton* >( widget ); + const TQPushButton* btn = static_cast< const TQPushButton* >( widget ); if (isFormWidget(btn)) formMode = true; @@ -1358,7 +1358,7 @@ void KeramikStyle::drawControl( ControlElement element, } else { - if (widget->parent() && widget->parent()->inherits("QToolBar")) + if (widget->parent() && widget->parent()->inherits("TQToolBar")) toolbarBlendWidget = widget; drawPrimitive( PE_ButtonCommand, p, r, cg, flags ); @@ -1374,7 +1374,7 @@ void KeramikStyle::drawControl( ControlElement element, // ------------------------------------------------------------------- case CE_PushButtonLabel: { - const QPushButton* button = static_cast<const QPushButton *>( widget ); + const TQPushButton* button = static_cast<const TQPushButton *>( widget ); bool active = button->isOn() || button->isDown(); bool cornArrow = false; @@ -1391,13 +1391,13 @@ void KeramikStyle::drawControl( ControlElement element, { int dx = pixelMetric( PM_MenuButtonIndicator, widget ); if ( button->iconSet() && !button->iconSet()->isNull() && - (dx + button->iconSet()->pixmap (QIconSet::Small, QIconSet::Normal, QIconSet::Off ).width()) >= w ) + (dx + button->iconSet()->pixmap (TQIconSet::Small, TQIconSet::Normal, TQIconSet::Off ).width()) >= w ) { cornArrow = true; //To little room. Draw the arrow in the corner, don't adjust the widget } else { - drawPrimitive( PE_ArrowDown, p, visualRect( QRect(x + w - dx - 8, y + 2, dx, h - 4), r ), + drawPrimitive( PE_ArrowDown, p, visualRect( TQRect(x + w - dx - 8, y + 2, dx, h - 4), r ), cg, flags, opt ); w -= dx; } @@ -1406,15 +1406,15 @@ void KeramikStyle::drawControl( ControlElement element, // Draw the icon if there is one if ( button->iconSet() && !button->iconSet()->isNull() ) { - QIconSet::Mode mode = QIconSet::Disabled; - QIconSet::State state = QIconSet::Off; + TQIconSet::Mode mode = TQIconSet::Disabled; + TQIconSet::State state = TQIconSet::Off; if (button->isEnabled()) - mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + mode = button->hasFocus() ? TQIconSet::Active : TQIconSet::Normal; if (button->isToggleButton() && button->isOn()) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap icon = button->iconSet()->pixmap( QIconSet::Small, mode, state ); + TQPixmap icon = button->iconSet()->pixmap( TQIconSet::Small, mode, state ); if (!button->text().isEmpty()) { @@ -1446,12 +1446,12 @@ void KeramikStyle::drawControl( ControlElement element, } if (cornArrow) //Draw over the icon - drawPrimitive( PE_ArrowDown, p, visualRect( QRect(x + w - 6, x + h - 6, 7, 7), r ), + drawPrimitive( PE_ArrowDown, p, visualRect( TQRect(x + w - 6, x + h - 6, 7, 7), r ), cg, flags, opt ); } // Make the label indicate if the button is a default button or not - drawItem( p, QRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), + drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), button->text(), -1, &button->colorGroup().buttonText() ); @@ -1464,9 +1464,9 @@ void KeramikStyle::drawControl( ControlElement element, case CE_ToolButtonLabel: { - //const QToolButton *toolbutton = static_cast<const QToolButton * >(widget); - bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "QToolBar" ); - QRect nr = r; + //const TQToolButton *toolbutton = static_cast<const TQToolButton * >(widget); + bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "TQToolBar" ); + TQRect nr = r; if (!onToolbar) { @@ -1492,17 +1492,17 @@ void KeramikStyle::drawControl( ControlElement element, case CE_TabBarTab: { - const QTabBar* tabBar = static_cast< const QTabBar* >( widget ); + const TQTabBar* tabBar = static_cast< const TQTabBar* >( widget ); - bool bottom = tabBar->shape() == QTabBar::RoundedBelow || - tabBar->shape() == QTabBar::TriangularBelow; + bool bottom = tabBar->shape() == TQTabBar::RoundedBelow || + tabBar->shape() == TQTabBar::TriangularBelow; if ( flags & Style_Selected ) { - QRect tabRect = r; + TQRect tabRect = r; //If not the right-most tab, readjust the painting to be one pixel wider //to avoid a doubled line - int rightMost = QApplication::reverseLayout() ? 0 : tabBar->count() - 1; + int rightMost = TQApplication::reverseLayout() ? 0 : tabBar->count() - 1; if (tabBar->indexOf( opt.tab()->identifier() ) != rightMost) tabRect.setWidth( tabRect.width() + 1); @@ -1535,14 +1535,14 @@ void KeramikStyle::drawControl( ControlElement element, case CE_DockWindowEmptyArea: { - QRect pr = r; - if (widget && widget->inherits("QToolBar")) + TQRect pr = r; + if (widget && widget->inherits("TQToolBar")) { - const QToolBar* tb = static_cast<const QToolBar*>(widget); - if (tb->place() == QDockWindow::OutsideDock) + const TQToolBar* tb = static_cast<const TQToolBar*>(widget); + if (tb->place() == TQDockWindow::OutsideDock) { //Readjust the paint rectangle to skip the titlebar - pr = QRect(r.x(), titleBarH + tb->frameWidth(), + pr = TQRect(r.x(), titleBarH + tb->frameWidth(), r.width(), tb->height() - titleBarH - 2 * tb->frameWidth() + 2); //2 at the end = the 2 pixels of border of a "regular" //toolbar we normally paint over. @@ -1564,16 +1564,16 @@ void KeramikStyle::drawControl( ControlElement element, // ------------------------------------------------------------------- case CE_MenuBarItem: { - QMenuBar *mb = (QMenuBar*)widget; - QMenuItem *mi = opt.menuItem(); - QRect pr = mb->rect(); + TQMenuBar *mb = (TQMenuBar*)widget; + TQMenuItem *mi = opt.menuItem(); + TQRect pr = mb->rect(); bool active = flags & Style_Active; bool focused = flags & Style_HasFocus; if ( active && focused ) qDrawShadePanel(p, r.x(), r.y(), r.width(), r.height(), - cg, true, 1, &cg.brush(QColorGroup::Midlight)); + cg, true, 1, &cg.brush(TQColorGroup::Midlight)); else Keramik::GradientPainter::renderGradient( p, pr, cg.button(), true, true); @@ -1588,14 +1588,14 @@ void KeramikStyle::drawControl( ControlElement element, // POPUPMENU ITEM // ------------------------------------------------------------------- case CE_PopupMenuItem: { - const QPopupMenu *popupmenu = static_cast< const QPopupMenu * >( widget ); - QRect main = r; + const TQPopupMenu *popupmenu = static_cast< const TQPopupMenu * >( widget ); + TQRect main = r; - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); if ( !mi ) { - // Don't leave blank holes if we set NoBackground for the QPopupMenu. + // Don't leave blank holes if we set NoBackground for the TQPopupMenu. // This only happens when the popupMenu spans more than one column. if (! ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) ) p->fillRect( r, cg.background().light( 105 ) ); @@ -1608,7 +1608,7 @@ void KeramikStyle::drawControl( ControlElement element, bool checkable = popupmenu->isCheckable(); bool active = flags & Style_Active; bool etchtext = styleHint( SH_EtchDisabledText ); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); if ( checkable ) checkcol = QMAX( checkcol, 20 ); @@ -1641,28 +1641,28 @@ void KeramikStyle::drawControl( ControlElement element, break; } - QRect cr = visualRect( QRect( x + 2, y + 2, checkcol - 1, h - 4 ), r ); + TQRect cr = visualRect( TQRect( x + 2, y + 2, checkcol - 1, h - 4 ), r ); // Do we have an icon? if ( mi->iconSet() ) { - QIconSet::Mode mode; + TQIconSet::Mode mode; // Select the correct icon from the iconset if ( active ) - mode = enabled ? QIconSet::Active : QIconSet::Disabled; + mode = enabled ? TQIconSet::Active : TQIconSet::Disabled; else - mode = enabled ? QIconSet::Normal : QIconSet::Disabled; + mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled; // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon if ( checkable && /*!active &&*/ mi->isChecked() ) qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), - cg, true, 1, &cg.brush(QColorGroup::Midlight) ); + cg, true, 1, &cg.brush(TQColorGroup::Midlight) ); // Draw the icon - QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); - QRect pmr( 0, 0, pixmap.width(), pixmap.height() ); + TQPixmap pixmap = mi->iconSet()->pixmap( TQIconSet::Small, mode ); + TQRect pmr( 0, 0, pixmap.width(), pixmap.height() ); pmr.moveCenter( cr.center() ); p->drawPixmap( pmr.topLeft(), pixmap ); } @@ -1674,7 +1674,7 @@ void KeramikStyle::drawControl( ControlElement element, // if it's active the "pressed" background is already drawn // if ( ! active ) qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), cg, true, 1, - &cg.brush(QColorGroup::Midlight) ); + &cg.brush(TQColorGroup::Midlight) ); // Draw the checkmark SFlags cflags = Style_Default; @@ -1701,7 +1701,7 @@ void KeramikStyle::drawControl( ControlElement element, // This color will be used instead of the above if the menu item // is active and disabled at the same time. (etched text) - QColor discol = cg.mid(); + TQColor discol = cg.mid(); // Does the menu item draw it's own label? if ( mi->custom() ) { @@ -1721,7 +1721,7 @@ void KeramikStyle::drawControl( ControlElement element, } else { // The menu item doesn't draw it's own label - QString s = mi->text(); + TQString s = mi->text(); // Does the menu item have a text label? if ( !s.isNull() ) { int t = s.find( '\t' ); @@ -1729,8 +1729,8 @@ void KeramikStyle::drawControl( ControlElement element, int text_flags = AlignVCenter | ShowPrefix | DontClip | SingleLine; text_flags |= reverse ? AlignRight : AlignLeft; - //QColor draw = cg.text(); - QColor draw = (active && enabled) ? cg.highlightedText () : cg.text(); + //TQColor draw = cg.text(); + TQColor draw = (active && enabled) ? cg.highlightedText () : cg.text(); p->setPen(draw); @@ -1769,7 +1769,7 @@ void KeramikStyle::drawControl( ControlElement element, // The menu item doesn't have a text label // Check if it has a pixmap instead else if ( mi->pixmap() ) { - QPixmap *pixmap = mi->pixmap(); + TQPixmap *pixmap = mi->pixmap(); // Draw the pixmap if ( pixmap->depth() == 1 ) @@ -1788,7 +1788,7 @@ void KeramikStyle::drawControl( ControlElement element, if ( mi->popup() ) { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; int dim = pixelMetric(PM_MenuButtonIndicator) - itemFrame; - QRect vr = visualRect( QRect( x + w - arrowHMargin - itemFrame - dim, + TQRect vr = visualRect( TQRect( x + w - arrowHMargin - itemFrame - dim, y + h / 2 - dim / 2, dim, dim), r ); // Draw an arrow at the far end of the menu item @@ -1796,7 +1796,7 @@ void KeramikStyle::drawControl( ControlElement element, if ( enabled ) discol = cg.buttonText(); - QColorGroup g2( discol, cg.highlight(), white, white, + TQColorGroup g2( discol, cg.highlight(), white, white, enabled ? white : discol, discol, white ); drawPrimitive( arrow, p, vr, g2, Style_Enabled ); @@ -1807,10 +1807,10 @@ void KeramikStyle::drawControl( ControlElement element, break; } case CE_ProgressBarContents: { - const QProgressBar* pb = (const QProgressBar*)widget; - QRect cr = subRect(SR_ProgressBarContents, widget); + const TQProgressBar* pb = (const TQProgressBar*)widget; + TQRect cr = subRect(SR_ProgressBarContents, widget); double progress = pb->progress(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int steps = pb->totalSteps(); if (!cr.isValid()) @@ -1839,56 +1839,56 @@ void KeramikStyle::drawControl( ControlElement element, } //Store the progress rect. - QRect progressRect; + TQRect progressRect; if (reverse) - progressRect = QRect(cr.x() + cr.width() - width - pstep, cr.y(), + progressRect = TQRect(cr.x() + cr.width() - width - pstep, cr.y(), width, cr.height()); else - progressRect = QRect(cr.x() + pstep, cr.y(), width, cr.height()); + progressRect = TQRect(cr.x() + pstep, cr.y(), width, cr.height()); Keramik::RowPainter(keramik_progressbar).draw(p, progressRect, cg.highlight(), cg.background() ); return; } - QRect progressRect; + TQRect progressRect; if (reverse) - progressRect = QRect(cr.x()+(cr.width()-width), cr.y(), width, cr.height()); + progressRect = TQRect(cr.x()+(cr.width()-width), cr.y(), width, cr.height()); else - progressRect = QRect(cr.x(), cr.y(), width, cr.height()); + progressRect = TQRect(cr.x(), cr.y(), width, cr.height()); //Apply the animation rectangle. ////////////////////////////////////// if (animateProgressBar) { - int progAnimShift = progAnimWidgets[const_cast<QProgressBar*>(pb)]; + int progAnimShift = progAnimWidgets[const_cast<TQProgressBar*>(pb)]; if (reverse) { //Here, we can't simply shift, as the painter code calculates everything based //on the left corner, so we need to draw the 2 portions ourselves. //Start off by checking the geometry of the end pixmap - it introduces a bit of an offset - QSize endDim = loader.size(keramik_progressbar + 3); //3 = 3*1 + 0 = (1,0) = cl + TQSize endDim = loader.size(keramik_progressbar + 3); //3 = 3*1 + 0 = (1,0) = cl //We might not have anything to animate at all, though, if the ender is the only thing to paint if (endDim.width() < progressRect.width()) { //OK, so we do have some stripes. // Render the endline now - the clip region below will protect it from getting overwriten - QPixmap endline = loader.scale(keramik_progressbar + 3, endDim.width(), progressRect.height(), + TQPixmap endline = loader.scale(keramik_progressbar + 3, endDim.width(), progressRect.height(), cg.highlight(), cg.background()); p->drawPixmap(progressRect.x(), progressRect.y(), endline); //Now, calculate where the stripes should be, and set a clip region to that progressRect.setLeft(progressRect.x() + endline.width()); - p->setClipRect(progressRect, QPainter::CoordPainter); + p->setClipRect(progressRect, TQPainter::CoordPainter); //Expand the paint region slightly to get the animation offset. progressRect.setLeft(progressRect.x() - progAnimShift); //Paint the stripes. - QPixmap stripe = loader.scale(keramik_progressbar + 4, 28, progressRect.height(), + TQPixmap stripe = loader.scale(keramik_progressbar + 4, 28, progressRect.height(), cg.highlight(), cg.background()); //4 = 3*1 + 1 = (1,1) = cc @@ -1900,7 +1900,7 @@ void KeramikStyle::drawControl( ControlElement element, else { //Clip to the old rectangle - p->setClipRect(progressRect, QPainter::CoordPainter); + p->setClipRect(progressRect, TQPainter::CoordPainter); //Expand the paint region progressRect.setLeft(progressRect.x() - 28 + progAnimShift); } @@ -1919,18 +1919,18 @@ void KeramikStyle::drawControl( ControlElement element, } void KeramikStyle::drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { p->fillRect(r, color1); maskMode = true; - drawControl( element, p, widget, r, QApplication::palette().active(), QStyle::Style_Default, opt); + drawControl( element, p, widget, r, TQApplication::palette().active(), TQStyle::Style_Default, opt); maskMode = false; } -bool KeramikStyle::isSizeConstrainedCombo(const QComboBox* combo) const +bool KeramikStyle::isSizeConstrainedCombo(const TQComboBox* combo) const { if (combo->width() >= 80) return false; @@ -1943,14 +1943,14 @@ bool KeramikStyle::isSizeConstrainedCombo(const QComboBox* combo) const } void KeramikStyle::drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { bool disabled = ( flags & Style_Enabled ) == 0; switch(control) @@ -1960,27 +1960,27 @@ void KeramikStyle::drawComplexControl( ComplexControl control, case CC_ComboBox: { bool toolbarMode = false; - const QComboBox* cb = static_cast< const QComboBox* >( widget ); + const TQComboBox* cb = static_cast< const TQComboBox* >( widget ); bool compact = isSizeConstrainedCombo(cb); if (isFormWidget(cb)) formMode = true; - QPixmap * buf = 0; - QPainter* p2 = p; + TQPixmap * buf = 0; + TQPainter* p2 = p; - QRect br = r; + TQRect br = r; if (controls == SC_All) { //Double-buffer only when we are in the slower full-blend mode if (widget->parent() && - ( widget->parent()->inherits("QToolBar")|| !qstrcmp(widget->parent()->name(), kdeToolbarWidget) ) ) + ( widget->parent()->inherits("TQToolBar")|| !qstrcmp(widget->parent()->name(), kdeToolbarWidget) ) ) { - buf = new QPixmap( r.width(), r.height() ); + buf = new TQPixmap( r.width(), r.height() ); br.setX(0); br.setY(0); - p2 = new QPainter(buf); + p2 = new TQPainter(buf); //Ensure that we have clipping on, and have a sane base. //If need be, Qt will shrink us to the paint region. @@ -2028,20 +2028,20 @@ void KeramikStyle::drawComplexControl( ComplexControl control, if ( active ) flags |= Style_On; - QRect ar = querySubControlMetrics( CC_ComboBox, widget, + TQRect ar = querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxArrow ); if (!compact) { ar.setWidth(ar.width()-13); - QRect rr = visualRect( QRect( ar.x(), ar.y() + 4, + TQRect rr = visualRect( TQRect( ar.x(), ar.y() + 4, loader.size(keramik_ripple ).width(), ar.height() - 8 ), widget ); - ar = visualRect( QRect( ar.x() + loader.size( keramik_ripple ).width() + 4, ar.y(), + ar = visualRect( TQRect( ar.x() + loader.size( keramik_ripple ).width() + 4, ar.y(), 11, ar.height() ), widget ); - QPointArray a; + TQPointArray a; a.setPoints(QCOORDARRLEN(keramik_combo_arrow), keramik_combo_arrow); @@ -2054,8 +2054,8 @@ void KeramikStyle::drawComplexControl( ComplexControl control, else //Size-constrained combo -- loose the ripple. { ar.setWidth(ar.width() - 7); - ar = visualRect( QRect( ar.x(), ar.y(), 11, ar.height() ), widget); - QPointArray a; + ar = visualRect( TQRect( ar.x(), ar.y(), 11, ar.height() ), widget); + TQPointArray a; a.setPoints(QCOORDARRLEN(keramik_combo_arrow), keramik_combo_arrow); @@ -2069,7 +2069,7 @@ void KeramikStyle::drawComplexControl( ComplexControl control, { if ( cb->editable() ) { - QRect er = visualRect( querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField ), widget ); + TQRect er = visualRect( querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField ), widget ); er.addCoords( -2, -2, 2, 2 ); p2->fillRect( er, cg.base() ); drawPrimitive( PE_PanelLineEdit, p2, er, cg ); @@ -2078,14 +2078,14 @@ void KeramikStyle::drawComplexControl( ComplexControl control, } else if ( cb->hasFocus() ) { - QRect re = QStyle::visualRect(subRect(SR_ComboBoxFocusRect, cb), widget); + TQRect re = TQStyle::visualRect(subRect(SR_ComboBoxFocusRect, cb), widget); if ( compact ) re.addCoords( 3, 3, 0, -3 ); - p2->fillRect( re, cg.brush( QColorGroup::Highlight ) ); + p2->fillRect( re, cg.brush( TQColorGroup::Highlight ) ); drawPrimitive( PE_FocusRect, p2, re, cg, - Style_FocusAtBorder, QStyleOption( cg.highlight() ) ); + Style_FocusAtBorder, TQStyleOption( cg.highlight() ) ); } - // QComboBox draws the text on its own and uses the painter's current colors + // TQComboBox draws the text on its own and uses the painter's current colors if ( cb->hasFocus() ) { p->setPen( cg.highlightedText() ); @@ -2112,8 +2112,8 @@ void KeramikStyle::drawComplexControl( ComplexControl control, case CC_SpinWidget: { - const QSpinWidget* sw = static_cast< const QSpinWidget* >( widget ); - QRect br = visualRect( querySubControlMetrics( CC_SpinWidget, widget, SC_SpinWidgetButtonField ), widget ); + const TQSpinWidget* sw = static_cast< const TQSpinWidget* >( widget ); + TQRect br = visualRect( querySubControlMetrics( CC_SpinWidget, widget, SC_SpinWidgetButtonField ), widget ); if ( controls & SC_SpinWidgetButtonField ) { Keramik::SpinBoxPainter().draw( p, br, cg.button(), cg.background(), !sw->isEnabled() ); @@ -2134,14 +2134,14 @@ void KeramikStyle::drawComplexControl( ComplexControl control, } case CC_ScrollBar: { - const QScrollBar* sb = static_cast< const QScrollBar* >( widget ); + const TQScrollBar* sb = static_cast< const TQScrollBar* >( widget ); if (highlightScrollBar && sb->parentWidget()) //Don't do the check if not highlighting anyway { if (sb->parentWidget()->colorGroup().button() != sb->colorGroup().button()) customScrollMode = true; } bool horizontal = sb->orientation() == Horizontal; - QRect slider, subpage, addpage, subline, addline; + TQRect slider, subpage, addpage, subline, addline; if ( sb->minValue() == sb->maxValue() ) flags &= ~Style_Enabled; slider = querySubControlMetrics( control, widget, SC_ScrollBarSlider, opt ); @@ -2154,13 +2154,13 @@ void KeramikStyle::drawComplexControl( ComplexControl control, drawPrimitive( PE_ScrollBarSubLine, p, subline, cg, flags | ( ( active & SC_ScrollBarSubLine ) ? Style_Down : 0 ) ); - QRegion clip; + TQRegion clip; if ( controls & SC_ScrollBarSubPage ) clip |= subpage; if ( controls & SC_ScrollBarAddPage ) clip |= addpage; if ( horizontal ) - clip |= QRect( slider.x(), 0, slider.width(), sb->height() ); + clip |= TQRect( slider.x(), 0, slider.width(), sb->height() ); else - clip |= QRect( 0, slider.y(), sb->width(), slider.height() ); + clip |= TQRect( 0, slider.y(), sb->width(), slider.height() ); clip ^= slider; p->setClipRegion( clip ); @@ -2183,17 +2183,17 @@ void KeramikStyle::drawComplexControl( ComplexControl control, if ( active & SC_ScrollBarSubLine ) { if ( horizontal ) - p->setClipRect( QRect( addline.x(), addline.y(), addline.width() / 2, addline.height() ) ); + p->setClipRect( TQRect( addline.x(), addline.y(), addline.width() / 2, addline.height() ) ); else - p->setClipRect( QRect( addline.x(), addline.y(), addline.width(), addline.height() / 2 ) ); + p->setClipRect( TQRect( addline.x(), addline.y(), addline.width(), addline.height() / 2 ) ); drawPrimitive( PE_ScrollBarAddLine, p, addline, cg, flags | Style_Down ); } else if ( active & SC_ScrollBarAddLine ) { if ( horizontal ) - p->setClipRect( QRect( addline.x() + addline.width() / 2, addline.y(), addline.width() / 2, addline.height() ) ); + p->setClipRect( TQRect( addline.x() + addline.width() / 2, addline.y(), addline.width() / 2, addline.height() ) ); else - p->setClipRect( QRect( addline.x(), addline.y() + addline.height() / 2, addline.width(), addline.height() / 2 ) ); + p->setClipRect( TQRect( addline.x(), addline.y() + addline.height() / 2, addline.width(), addline.height() / 2 ) ); drawPrimitive( PE_ScrollBarAddLine, p, addline, cg, flags | Style_Down ); } } @@ -2207,11 +2207,11 @@ void KeramikStyle::drawComplexControl( ComplexControl control, // TOOLBUTTON // ------------------------------------------------------------------- case CC_ToolButton: { - const QToolButton *toolbutton = (const QToolButton *) widget; - bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "QToolBar" ); + const TQToolButton *toolbutton = (const TQToolButton *) widget; + bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "TQToolBar" ); bool onExtender = !onToolbar && widget->parentWidget() && widget->parentWidget()->inherits( "QToolBarExtensionWidget") && - widget->parentWidget()->parentWidget()->inherits( "QToolBar" ); + widget->parentWidget()->parentWidget()->inherits( "TQToolBar" ); bool onControlButtons = false; if (!onToolbar && !onExtender && widget->parentWidget() && @@ -2221,7 +2221,7 @@ void KeramikStyle::drawComplexControl( ComplexControl control, titleBarMode = Maximized; } - QRect button, menuarea; + TQRect button, menuarea; button = querySubControlMetrics(control, widget, SC_ToolButton, opt); menuarea = querySubControlMetrics(control, widget, SC_ToolButtonMenu, opt); @@ -2237,7 +2237,7 @@ void KeramikStyle::drawComplexControl( ComplexControl control, bflags |= Style_MouseOver; - if (onToolbar && static_cast<QToolBar*>(widget->parent())->orientation() == Qt::Horizontal) + if (onToolbar && static_cast<TQToolBar*>(widget->parent())->orientation() == Qt::Horizontal) bflags |= Style_Horizontal; if (controls & SC_ToolButton) @@ -2258,7 +2258,7 @@ void KeramikStyle::drawComplexControl( ComplexControl control, toolbutton->parentWidget()->backgroundPixmap() && !toolbutton->parentWidget()->backgroundPixmap()->isNull() ) { - QPixmap pixmap = *(toolbutton->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(toolbutton->parentWidget()->backgroundPixmap()); p->drawTiledPixmap( r, pixmap, toolbutton->pos() ); } else if (onToolbar) @@ -2269,9 +2269,9 @@ void KeramikStyle::drawComplexControl( ComplexControl control, { // This assumes floating toolbars can't have extenders, //(so if we're on an extender, we're not floating) - QWidget* parent = static_cast<QWidget*> (widget->parent()); - QToolBar* toolbar = static_cast<QToolBar*>(parent->parent()); - QRect tr = toolbar->rect(); + TQWidget* parent = static_cast<TQWidget*> (widget->parent()); + TQToolBar* toolbar = static_cast<TQToolBar*>(parent->parent()); + TQRect tr = toolbar->rect(); bool horiz = toolbar->orientation() == Qt::Horizontal; //Calculate offset. We do this by translating our coordinates, @@ -2298,7 +2298,7 @@ void KeramikStyle::drawComplexControl( ComplexControl control, } if (toolbutton->hasFocus() && !toolbutton->focusProxy()) { - QRect fr = toolbutton->rect(); + TQRect fr = toolbutton->rect(); fr.addCoords(3, 3, -3, -3); drawPrimitive(PE_FocusRect, p, fr, cg); } @@ -2319,16 +2319,16 @@ void KeramikStyle::drawComplexControl( ComplexControl control, } void KeramikStyle::drawComplexControlMask( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { if (control == CC_ComboBox) { maskMode = true; drawComplexControl(CC_ComboBox, p, widget, r, - QApplication::palette().active(), Style_Default, + TQApplication::palette().active(), Style_Default, SC_ComboBoxFrame,SC_None, opt); maskMode = false; @@ -2338,7 +2338,7 @@ void KeramikStyle::drawComplexControlMask( ComplexControl control, } -int KeramikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const +int KeramikStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const { switch(m) { @@ -2392,11 +2392,11 @@ int KeramikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const case PM_TabBarTabShiftVertical: { - const QTabBar* tb = ::qt_cast<const QTabBar*>(widget); + const TQTabBar* tb = ::qt_cast<const TQTabBar*>(widget); if (tb) { - if (tb->shape() == QTabBar::RoundedBelow || - tb->shape() == QTabBar::TriangularBelow) + if (tb->shape() == TQTabBar::RoundedBelow || + tb->shape() == TQTabBar::TriangularBelow) return 0; } @@ -2413,10 +2413,10 @@ int KeramikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const } -QSize KeramikStyle::sizeFromContents( ContentsType contents, - const QWidget* widget, - const QSize &contentSize, - const QStyleOption& opt ) const +TQSize KeramikStyle::sizeFromContents( ContentsType contents, + const TQWidget* widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const { switch (contents) { @@ -2424,28 +2424,28 @@ QSize KeramikStyle::sizeFromContents( ContentsType contents, // ------------------------------------------------------------------ case CT_PushButton: { - const QPushButton* btn = static_cast< const QPushButton* >( widget ); + const TQPushButton* btn = static_cast< const TQPushButton* >( widget ); int w = contentSize.width() + 2 * pixelMetric( PM_ButtonMargin, widget ); int h = contentSize.height() + 2 * pixelMetric( PM_ButtonMargin, widget ); - if ( btn->text().isEmpty() && contentSize.width() < 32 ) return QSize( w, h ); + if ( btn->text().isEmpty() && contentSize.width() < 32 ) return TQSize( w, h ); //For some reason kcontrol no longer does this... //if ( btn->isDefault() || btn->autoDefault() ) // w = QMAX( w, 40 ); - return QSize( w + 30, h + 5 ); //MX: No longer blank space -- can make a bit smaller + return TQSize( w + 30, h + 5 ); //MX: No longer blank space -- can make a bit smaller } case CT_ToolButton: { - bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "QToolBar" ); + bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "TQToolBar" ); if (!onToolbar) //Behaves like a button, so scale appropriately to the border { int w = contentSize.width(); int h = contentSize.height(); - return QSize( w + 12, h + 10 ); + return TQSize( w + 12, h + 10 ); } else { @@ -2455,8 +2455,8 @@ QSize KeramikStyle::sizeFromContents( ContentsType contents, case CT_ComboBox: { int arrow = 11 + loader.size( keramik_ripple ).width(); - const QComboBox *cb = static_cast<const QComboBox*>( widget ); - return QSize( contentSize.width() + arrow + (cb->editable() ? 26 : 22), + const TQComboBox *cb = static_cast<const TQComboBox*>( widget ); + return TQSize( contentSize.width() + arrow + (cb->editable() ? 26 : 22), contentSize.height() + 10 ); } @@ -2466,9 +2466,9 @@ QSize KeramikStyle::sizeFromContents( ContentsType contents, if ( ! widget || opt.isDefault() ) return contentSize; - const QPopupMenu *popup = (const QPopupMenu *) widget; + const TQPopupMenu *popup = (const TQPopupMenu *) widget; bool checkable = popup->isCheckable(); - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = contentSize.width(), h = contentSize.height(); @@ -2496,7 +2496,7 @@ QSize KeramikStyle::sizeFromContents( ContentsType contents, if ( mi->iconSet() ) h = QMAX( h, mi->iconSet()->pixmap( - QIconSet::Small, QIconSet::Normal).height() + + TQIconSet::Small, TQIconSet::Normal).height() + 2 * itemFrame ); } @@ -2514,7 +2514,7 @@ QSize KeramikStyle::sizeFromContents( ContentsType contents, w += rightBorder; - return QSize( w, h ); + return TQSize( w, h ); } default: @@ -2523,16 +2523,16 @@ QSize KeramikStyle::sizeFromContents( ContentsType contents, } -QStyle::SubControl KeramikStyle::querySubControl( ComplexControl control, - const QWidget* widget, - const QPoint& point, - const QStyleOption& opt ) const +TQStyle::SubControl KeramikStyle::querySubControl( ComplexControl control, + const TQWidget* widget, + const TQPoint& point, + const TQStyleOption& opt ) const { SubControl result = KStyle::querySubControl( control, widget, point, opt ); if ( control == CC_ScrollBar && result == SC_ScrollBarAddLine ) { - QRect addline = querySubControlMetrics( control, widget, result, opt ); - if ( static_cast< const QScrollBar* >( widget )->orientation() == Horizontal ) + TQRect addline = querySubControlMetrics( control, widget, result, opt ); + if ( static_cast< const TQScrollBar* >( widget )->orientation() == Horizontal ) { if ( point.x() < addline.center().x() ) result = SC_ScrollBarSubLine; } @@ -2541,10 +2541,10 @@ QStyle::SubControl KeramikStyle::querySubControl( ComplexControl control, return result; } -QRect KeramikStyle::querySubControlMetrics( ComplexControl control, - const QWidget* widget, +TQRect KeramikStyle::querySubControlMetrics( ComplexControl control, + const TQWidget* widget, SubControl subcontrol, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { switch ( control ) { @@ -2552,7 +2552,7 @@ QRect KeramikStyle::querySubControlMetrics( ComplexControl control, { int arrow; bool compact = false; - if ( isSizeConstrainedCombo(static_cast<const QComboBox*>(widget) ) ) //### constant + if ( isSizeConstrainedCombo(static_cast<const TQComboBox*>(widget) ) ) //### constant compact = true; if ( compact ) @@ -2564,20 +2564,20 @@ QRect KeramikStyle::querySubControlMetrics( ComplexControl control, { case SC_ComboBoxArrow: if ( compact ) - return QRect( widget->width() - arrow - 7, 0, arrow + 6, widget->height() ); + return TQRect( widget->width() - arrow - 7, 0, arrow + 6, widget->height() ); else - return QRect( widget->width() - arrow - 14, 0, arrow + 13, widget->height() ); + return TQRect( widget->width() - arrow - 14, 0, arrow + 13, widget->height() ); case SC_ComboBoxEditField: { if ( compact ) - return QRect( 2, 4, widget->width() - arrow - 2 - 7, widget->height() - 8 ); + return TQRect( 2, 4, widget->width() - arrow - 2 - 7, widget->height() - 8 ); else if ( widget->width() < 36 || widget->height() < 22 ) - return QRect( 4, 3, widget->width() - arrow - 20, widget->height() - 6 ); - else if ( static_cast< const QComboBox* >( widget )->editable() ) - return QRect( 8, 4, widget->width() - arrow - 26, widget->height() - 11 ); + return TQRect( 4, 3, widget->width() - arrow - 20, widget->height() - 6 ); + else if ( static_cast< const TQComboBox* >( widget )->editable() ) + return TQRect( 8, 4, widget->width() - arrow - 26, widget->height() - 11 ); else - return QRect( 6, 4, widget->width() - arrow - 22, widget->height() - 9 ); + return TQRect( 6, 4, widget->width() - arrow - 22, widget->height() - 9 ); } case SC_ComboBoxListBoxPopup: @@ -2585,7 +2585,7 @@ QRect KeramikStyle::querySubControlMetrics( ComplexControl control, //Note that the widget here == the combo, not the completion //box, so we don't get any recursion int suggestedWidth = widget->sizeHint().width(); - QRect def = opt.rect(); + TQRect def = opt.rect(); def.addCoords( 4, -4, -6, 4 ); if ((def.width() - suggestedWidth < -12) && (def.width() < 80)) @@ -2601,7 +2601,7 @@ QRect KeramikStyle::querySubControlMetrics( ComplexControl control, case CC_ScrollBar: { - const QScrollBar* sb = static_cast< const QScrollBar* >( widget ); + const TQScrollBar* sb = static_cast< const TQScrollBar* >( widget ); bool horizontal = sb->orientation() == Horizontal; int addline, subline, sliderpos, sliderlen, maxlen, slidermin; if ( horizontal ) @@ -2630,28 +2630,28 @@ QRect KeramikStyle::querySubControlMetrics( ComplexControl control, switch ( subcontrol ) { case SC_ScrollBarGroove: - if ( horizontal ) return QRect( subline, 0, maxlen, sb->height() ); - else return QRect( 0, subline, sb->width(), maxlen ); + if ( horizontal ) return TQRect( subline, 0, maxlen, sb->height() ); + else return TQRect( 0, subline, sb->width(), maxlen ); case SC_ScrollBarSlider: - if (horizontal) return QRect( sliderpos, 0, sliderlen, sb->height() ); - else return QRect( 0, sliderpos, sb->width(), sliderlen ); + if (horizontal) return TQRect( sliderpos, 0, sliderlen, sb->height() ); + else return TQRect( 0, sliderpos, sb->width(), sliderlen ); case SC_ScrollBarSubLine: - if ( horizontal ) return QRect( 0, 0, subline, sb->height() ); - else return QRect( 0, 0, sb->width(), subline ); + if ( horizontal ) return TQRect( 0, 0, subline, sb->height() ); + else return TQRect( 0, 0, sb->width(), subline ); case SC_ScrollBarAddLine: - if ( horizontal ) return QRect( sb->width() - addline, 0, addline, sb->height() ); - else return QRect( 0, sb->height() - addline, sb->width(), addline ); + if ( horizontal ) return TQRect( sb->width() - addline, 0, addline, sb->height() ); + else return TQRect( 0, sb->height() - addline, sb->width(), addline ); case SC_ScrollBarSubPage: - if ( horizontal ) return QRect( subline, 0, sliderpos - subline, sb->height() ); - else return QRect( 0, subline, sb->width(), sliderpos - subline ); + if ( horizontal ) return TQRect( subline, 0, sliderpos - subline, sb->height() ); + else return TQRect( 0, subline, sb->width(), sliderpos - subline ); case SC_ScrollBarAddPage: - if ( horizontal ) return QRect( sliderpos + sliderlen, 0, sb->width() - addline - (sliderpos + sliderlen) , sb->height() ); - else return QRect( 0, sliderpos + sliderlen, sb->width(), sb->height() - addline - (sliderpos + sliderlen) + if ( horizontal ) return TQRect( sliderpos + sliderlen, 0, sb->width() - addline - (sliderpos + sliderlen) , sb->height() ); + else return TQRect( 0, sliderpos + sliderlen, sb->width(), sb->height() - addline - (sliderpos + sliderlen) /*maxlen - sliderpos - sliderlen + subline - 5*/ ); default: break; @@ -2660,9 +2660,9 @@ QRect KeramikStyle::querySubControlMetrics( ComplexControl control, } case CC_Slider: { - const QSlider* sl = static_cast< const QSlider* >( widget ); + const TQSlider* sl = static_cast< const TQSlider* >( widget ); bool horizontal = sl->orientation() == Horizontal; - QSlider::TickSetting ticks = sl->tickmarks(); + TQSlider::TickSetting ticks = sl->tickmarks(); int pos = sl->sliderStart(); int size = pixelMetric( PM_SliderControlThickness, widget ); int handleSize = pixelMetric( PM_SliderThickness, widget ); @@ -2682,36 +2682,36 @@ QRect KeramikStyle::querySubControlMetrics( ComplexControl control, case SC_SliderGroove: if ( horizontal ) { - if ( ticks == QSlider::Both ) - return QRect( 0, ( sl->height() - size ) / 2, sl->width(), size ); - else if ( ticks == QSlider::Above ) - return QRect( 0, sl->height() - size - ( handleSize - size ) / 2, sl->width(), size ); - return QRect( 0, ( handleSize - size ) / 2, sl->width(), size ); + if ( ticks == TQSlider::Both ) + return TQRect( 0, ( sl->height() - size ) / 2, sl->width(), size ); + else if ( ticks == TQSlider::Above ) + return TQRect( 0, sl->height() - size - ( handleSize - size ) / 2, sl->width(), size ); + return TQRect( 0, ( handleSize - size ) / 2, sl->width(), size ); } else { - if ( ticks == QSlider::Both ) - return QRect( ( sl->width() - size ) / 2, 0, size, sl->height() ); - else if ( ticks == QSlider::Above ) - return QRect( sl->width() - size - ( handleSize - size ) / 2, 0, size, sl->height() ); - return QRect( ( handleSize - size ) / 2, 0, size, sl->height() ); + if ( ticks == TQSlider::Both ) + return TQRect( ( sl->width() - size ) / 2, 0, size, sl->height() ); + else if ( ticks == TQSlider::Above ) + return TQRect( sl->width() - size - ( handleSize - size ) / 2, 0, size, sl->height() ); + return TQRect( ( handleSize - size ) / 2, 0, size, sl->height() ); } case SC_SliderHandle: if ( horizontal ) { - if ( ticks == QSlider::Both ) - return QRect( pos, ( sl->height() - handleSize ) / 2, len, handleSize ); - else if ( ticks == QSlider::Above ) - return QRect( pos, sl->height() - handleSize, len, handleSize ); - return QRect( pos, 0, len, handleSize ); + if ( ticks == TQSlider::Both ) + return TQRect( pos, ( sl->height() - handleSize ) / 2, len, handleSize ); + else if ( ticks == TQSlider::Above ) + return TQRect( pos, sl->height() - handleSize, len, handleSize ); + return TQRect( pos, 0, len, handleSize ); } else { - if ( ticks == QSlider::Both ) - return QRect( ( sl->width() - handleSize ) / 2, pos, handleSize, len ); - else if ( ticks == QSlider::Above ) - return QRect( sl->width() - handleSize, pos, handleSize, len ); - return QRect( 0, pos, handleSize, len ); + if ( ticks == TQSlider::Both ) + return TQRect( ( sl->width() - handleSize ) / 2, pos, handleSize, len ); + else if ( ticks == TQSlider::Above ) + return TQRect( sl->width() - handleSize, pos, handleSize, len ); + return TQRect( 0, pos, handleSize, len ); } default: break; } @@ -2737,7 +2737,7 @@ QRect KeramikStyle::querySubControlMetrics( ComplexControl control, #undef KeyRelease #endif -bool KeramikStyle::eventFilter( QObject* object, QEvent* event ) +bool KeramikStyle::eventFilter( TQObject* object, TQEvent* event ) { if (KStyle::eventFilter( object, event )) return true; @@ -2745,53 +2745,53 @@ bool KeramikStyle::eventFilter( QObject* object, QEvent* event ) if ( !object->isWidgetType() ) return false; //Clear hover highlight when needed - if ( (event->type() == QEvent::Leave) && (object == hoverWidget) ) + if ( (event->type() == TQEvent::Leave) && (object == hoverWidget) ) { - QWidget* button = static_cast<QWidget*>(object); + TQWidget* button = static_cast<TQWidget*>(object); hoverWidget = 0; button->repaint( false ); return false; } //Hover highlight on buttons, toolbuttons and combos - if ( ::qt_cast<QPushButton*>(object) || ::qt_cast<QComboBox*>(object) || ::qt_cast<QToolButton*>(object) ) + if ( ::qt_cast<TQPushButton*>(object) || ::qt_cast<TQComboBox*>(object) || ::qt_cast<TQToolButton*>(object) ) { - if (event->type() == QEvent::Enter && static_cast<QWidget*>(object)->isEnabled() ) + if (event->type() == TQEvent::Enter && static_cast<TQWidget*>(object)->isEnabled() ) { - hoverWidget = static_cast<QWidget*>(object); + hoverWidget = static_cast<TQWidget*>(object); hoverWidget->repaint( false ); } return false; } //Combo line edits get special frames - if ( event->type() == QEvent::Paint && ::qt_cast<QLineEdit*>(object) ) + if ( event->type() == TQEvent::Paint && ::qt_cast<TQLineEdit*>(object) ) { static bool recursion = false; if (recursion ) return false; recursion = true; - object->event( static_cast< QPaintEvent* >( event ) ); - QWidget* widget = static_cast< QWidget* >( object ); - QPainter p( widget ); + object->event( static_cast< TQPaintEvent* >( event ) ); + TQWidget* widget = static_cast< TQWidget* >( object ); + TQPainter p( widget ); Keramik::RectTilePainter( keramik_frame_shadow, false, false, 2, 2 ).draw( &p, widget->rect(), - widget->palette().color( QPalette::Normal, QColorGroup::Button ), + widget->palette().color( TQPalette::Normal, TQColorGroup::Button ), Qt::black, false, Keramik::TilePainter::PaintFullBlend); recursion = false; return true; } - else if ( ::qt_cast<QListBox*>(object) ) + else if ( ::qt_cast<TQListBox*>(object) ) { //Handle combobox drop downs switch (event->type()) { #ifdef HAVE_X11_EXTENSIONS_SHAPE_H //Combo dropdowns are shaped - case QEvent::Resize: + case TQEvent::Resize: { - QListBox* listbox = static_cast<QListBox*>(object); - QResizeEvent* resize = static_cast<QResizeEvent*>(event); + TQListBox* listbox = static_cast<TQListBox*>(object); + TQResizeEvent* resize = static_cast<TQResizeEvent*>(event); if (resize->size().height() < 6) return false; @@ -2810,23 +2810,23 @@ bool KeramikStyle::eventFilter( QObject* object, QEvent* event ) break; #endif //Combo dropdowns get fancy borders - case QEvent::Paint: + case TQEvent::Paint: { static bool recursion = false; if (recursion ) return false; - QListBox* listbox = (QListBox*) object; - QPaintEvent* paint = (QPaintEvent*) event; + TQListBox* listbox = (TQListBox*) object; + TQPaintEvent* paint = (TQPaintEvent*) event; if ( !listbox->contentsRect().contains( paint->rect() ) ) { - QPainter p( listbox ); + TQPainter p( listbox ); Keramik::RectTilePainter( keramik_combobox_list, false, false ).draw( &p, 0, 0, listbox->width(), listbox->height(), - listbox->palette().color( QPalette::Normal, QColorGroup::Button ), - listbox->palette().color( QPalette::Normal, QColorGroup::Background ) ); + listbox->palette().color( TQPalette::Normal, TQColorGroup::Button ), + listbox->palette().color( TQPalette::Normal, TQColorGroup::Background ) ); - QPaintEvent newpaint( paint->region().intersect( listbox->contentsRect() ), paint->erased() ); + TQPaintEvent newpaint( paint->region().intersect( listbox->contentsRect() ), paint->erased() ); recursion = true; object->event( &newpaint ); recursion = false; @@ -2842,7 +2842,7 @@ bool KeramikStyle::eventFilter( QObject* object, QEvent* event ) move ourselves to front of event filter list, and then capture the first release event, and if it's in the overlap area, filter it out. */ - case QEvent::Show: + case TQEvent::Show: //Prioritize ourselves to see the mouse events first object->removeEventFilter(this); object->installEventFilter(this); @@ -2850,52 +2850,52 @@ bool KeramikStyle::eventFilter( QObject* object, QEvent* event ) break; //We need to filter some clicks out. - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: if (firstComboPopupRelease) { firstComboPopupRelease = false; - QMouseEvent* mev = static_cast<QMouseEvent*>(event); - QListBox* box = static_cast<QListBox*> (object); + TQMouseEvent* mev = static_cast<TQMouseEvent*>(event); + TQListBox* box = static_cast<TQListBox*> (object); - QWidget* parent = box->parentWidget(); + TQWidget* parent = box->parentWidget(); if (!parent) return false; - QPoint inParCoords = parent->mapFromGlobal(mev->globalPos()); + TQPoint inParCoords = parent->mapFromGlobal(mev->globalPos()); if (parent->rect().contains(inParCoords)) return true; } break; - case QEvent::MouseButtonPress: - case QEvent::MouseButtonDblClick: - case QEvent::Wheel: - case QEvent::KeyPress: - case QEvent::KeyRelease: + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonDblClick: + case TQEvent::Wheel: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: firstComboPopupRelease = false; default: return false; } } //Toolbar background gradient handling - else if (event->type() == QEvent::Paint && + else if (event->type() == TQEvent::Paint && object->parent() && !qstrcmp(object->name(), kdeToolbarWidget) ) { // Draw a gradient background for custom widgets in the toolbar // that have specified a "kde toolbar widget" name. - renderToolbarWidgetBackground(0, static_cast<QWidget*>(object)); + renderToolbarWidgetBackground(0, static_cast<TQWidget*>(object)); return false; // Now draw the contents } - else if (event->type() == QEvent::Paint && object->parent() && ::qt_cast<QToolBar*>(object->parent()) - && !::qt_cast<QPopupMenu*>(object) ) + else if (event->type() == TQEvent::Paint && object->parent() && ::qt_cast<TQToolBar*>(object->parent()) + && !::qt_cast<TQPopupMenu*>(object) ) { // We need to override the paint event to draw a // gradient on a QToolBarExtensionWidget. - QToolBar* toolbar = static_cast<QToolBar*>(object->parent()); - QWidget* widget = static_cast<QWidget*>(object); - QRect wr = widget->rect (), tr = toolbar->rect(); - QPainter p( widget ); + TQToolBar* toolbar = static_cast<TQToolBar*>(object->parent()); + TQWidget* widget = static_cast<TQWidget*>(object); + TQRect wr = widget->rect (), tr = toolbar->rect(); + TQPainter p( widget ); if ( toolbar->orientation() == Qt::Horizontal ) { @@ -2921,9 +2921,9 @@ bool KeramikStyle::eventFilter( QObject* object, QEvent* event ) } // Track show events for progress bars - if ( animateProgressBar && ::qt_cast<QProgressBar*>(object) ) + if ( animateProgressBar && ::qt_cast<TQProgressBar*>(object) ) { - if ((event->type() == QEvent::Show) && !animationTimer->isActive()) + if ((event->type() == TQEvent::Show) && !animationTimer->isActive()) { animationTimer->start( 50, false ); } diff --git a/kstyles/keramik/keramik.h b/kstyles/keramik/keramik.h index 1c1792fd3..76d099a5e 100644 --- a/kstyles/keramik/keramik.h +++ b/kstyles/keramik/keramik.h @@ -32,7 +32,7 @@ #ifndef __keramik_h__ #define __keramik_h__ -#include <qframe.h> +#include <tqframe.h> #include <kstyle.h> #include "pixmaploader.h" @@ -47,85 +47,85 @@ public: KeramikStyle(); virtual ~KeramikStyle(); - void renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg, const QPopupMenu* ) const; - QPixmap stylePixmap(StylePixmap stylepixmap, const QWidget* widget, const QStyleOption& opt) const; + void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup &cg, const TQPopupMenu* ) const; + TQPixmap stylePixmap(StylePixmap stylepixmap, const TQWidget* widget, const TQStyleOption& opt) const; - void polish( QWidget* widget ); - void unPolish( QWidget* widget ); - void polish( QPalette& ); - void polish( QApplication *app ); + void polish( TQWidget* widget ); + void unPolish( TQWidget* widget ); + void polish( TQPalette& ); + void polish( TQApplication *app ); void drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect& r, - const QColorGroup& cg, + TQPainter* p, + const TQWidget* widget, + const TQRect& r, + const TQColorGroup& cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawPrimitive( PrimitiveElement pe, - QPainter* p, - const QRect& r, - const QColorGroup& cg, + TQPainter* p, + const TQRect& r, + const TQColorGroup& cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawControl( ControlElement element, - QPainter* p, - const QWidget* widget, - const QRect& r, - const QColorGroup& cg, + TQPainter* p, + const TQWidget* widget, + const TQRect& r, + const TQColorGroup& cg, SFlags flags = Style_Default, - const QStyleOption& opt = QStyleOption::Default ) const; + const TQStyleOption& opt = TQStyleOption::Default ) const; void drawControlMask( ControlElement element, - QPainter* p, - const QWidget* widget, - const QRect& r, - const QStyleOption& opt = QStyleOption::Default ) const; + TQPainter* p, + const TQWidget* widget, + const TQRect& r, + const TQStyleOption& opt = TQStyleOption::Default ) const; void drawComplexControl( ComplexControl control, - QPainter* p, - const QWidget* widget, - const QRect& r, - const QColorGroup& cg, + TQPainter* p, + const TQWidget* widget, + const TQRect& r, + const TQColorGroup& cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControlMask( ComplexControl control, - QPainter* p, - const QWidget* widget, - const QRect& r, - const QStyleOption& = QStyleOption::Default ) const; + TQPainter* p, + const TQWidget* widget, + const TQRect& r, + const TQStyleOption& = TQStyleOption::Default ) const; - int pixelMetric( PixelMetric m, const QWidget* widget = 0 ) const; + int pixelMetric( PixelMetric m, const TQWidget* widget = 0 ) const; - QSize sizeFromContents( ContentsType contents, - const QWidget* widget, - const QSize& contentSize, - const QStyleOption& opt ) const; + TQSize sizeFromContents( ContentsType contents, + const TQWidget* widget, + const TQSize& contentSize, + const TQStyleOption& opt ) const; SubControl querySubControl( ComplexControl control, - const QWidget* widget, - const QPoint& point, - const QStyleOption& opt = QStyleOption::Default ) const; + const TQWidget* widget, + const TQPoint& point, + const TQStyleOption& opt = TQStyleOption::Default ) const; - QRect querySubControlMetrics( ComplexControl control, - const QWidget* widget, + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget* widget, SubControl subcontrol, - const QStyleOption& opt = QStyleOption::Default ) const; + const TQStyleOption& opt = TQStyleOption::Default ) const; private slots: //Animation slots. void updateProgressPos(); - void progressBarDestroyed(QObject* bar); + void progressBarDestroyed(TQObject* bar); private: - bool isSizeConstrainedCombo(const QComboBox* combo) const; - bool isFormWidget (const QWidget* widget) const; + bool isSizeConstrainedCombo(const TQComboBox* combo) const; + bool isFormWidget (const TQWidget* widget) const; ///Configuration settings bool animateProgressBar; @@ -136,7 +136,7 @@ private: mutable bool maskMode; //Ugly round trip flag to permit masking with little code; mutable bool formMode; //Set when rendering form widgets - mutable const QWidget* toolbarBlendWidget; //Ditto for blending with toolbars + mutable const TQWidget* toolbarBlendWidget; //Ditto for blending with toolbars enum TitleBarMode { @@ -157,9 +157,9 @@ private: bool firstComboPopupRelease; //Animation support. - QMap<QProgressBar*, int> progAnimWidgets; + TQMap<TQProgressBar*, int> progAnimWidgets; - bool eventFilter( QObject* object, QEvent* event ); + bool eventFilter( TQObject* object, TQEvent* event ); Keramik::TilePainter::PaintMode pmode() const { @@ -186,15 +186,15 @@ private: return maskMode?Keramik::TilePainter::PaintMask : Keramik::TilePainter::PaintFullBlend; } - QWidget* hoverWidget; + TQWidget* hoverWidget; bool kickerMode; // For progress bar animation - QTimer *animationTimer; + TQTimer *animationTimer; - QRect subRect(SubRect r, const QWidget *widget) const; + TQRect subRect(SubRect r, const TQWidget *widget) const; // Disable copy constructor and = operator KeramikStyle( const KeramikStyle& ); diff --git a/kstyles/keramik/pixmaploader.cpp b/kstyles/keramik/pixmaploader.cpp index b3c4a8c47..01cdf5fc6 100644 --- a/kstyles/keramik/pixmaploader.cpp +++ b/kstyles/keramik/pixmaploader.cpp @@ -20,13 +20,13 @@ // $Id$ -#include <qapplication.h> -#include <qbitmap.h> -#include <qglobal.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpixmapcache.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqglobal.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpixmapcache.h> #include "pixmaploader.h" @@ -55,7 +55,7 @@ void PixmapLoader::clear() //m_cache.clear(); } -QImage* PixmapLoader::getDisabled(int name, const QColor& color, const QColor& back, bool blend) +TQImage* PixmapLoader::getDisabled(int name, const TQColor& color, const TQColor& back, bool blend) { KeramikEmbedImage* edata = KeramikGetDbImage(name); if (!edata) @@ -64,7 +64,7 @@ QImage* PixmapLoader::getDisabled(int name, const QColor& color, const QColor& b //Like getColored, but desaturate a bit, and lower gamma.. //Create a real image... - QImage* img = new QImage(edata->width, edata->height, 32); + TQImage* img = new TQImage(edata->width, edata->height, 32); @@ -148,14 +148,14 @@ QImage* PixmapLoader::getDisabled(int name, const QColor& color, const QColor& b return img; } -QImage* PixmapLoader::getColored(int name, const QColor& color, const QColor& back, bool blend) +TQImage* PixmapLoader::getColored(int name, const TQColor& color, const TQColor& back, bool blend) { KeramikEmbedImage* edata = KeramikGetDbImage(name); if (!edata) return 0; //Create a real image... - QImage* img = new QImage(edata->width, edata->height, 32); + TQImage* img = new TQImage(edata->width, edata->height, 32); //OK, now, fill it in, using the color.. Q_UINT32 r, g,b; @@ -247,13 +247,13 @@ QImage* PixmapLoader::getColored(int name, const QColor& color, const QColor& ba return img; } -QPixmap PixmapLoader::pixmap( int name, const QColor& color, const QColor& bg, bool disabled, bool blend ) +TQPixmap PixmapLoader::pixmap( int name, const TQColor& color, const TQColor& bg, bool disabled, bool blend ) { return scale(name, 0, 0, color, bg, disabled, blend); } -QPixmap PixmapLoader::scale( int name, int width, int height, const QColor& color, const QColor& bg, bool disabled, bool blend ) +TQPixmap PixmapLoader::scale( int name, int width, int height, const TQColor& color, const TQColor& bg, bool disabled, bool blend ) { KeramikCacheEntry entry(name, color, bg, disabled, blend, width, height); KeramikCacheEntry* cacheEntry; @@ -269,8 +269,8 @@ QPixmap PixmapLoader::scale( int name, int width, int height, const QColor& colo } - QImage* img = 0; - QPixmap* result = 0; + TQImage* img = 0; + TQPixmap* result = 0; if (disabled) img = getDisabled(name, color, bg, blend); @@ -280,15 +280,15 @@ QPixmap PixmapLoader::scale( int name, int width, int height, const QColor& colo if (!img) { KeramikCacheEntry* toAdd = new KeramikCacheEntry(entry); - toAdd->m_pixmap = new QPixmap(); + toAdd->m_pixmap = new TQPixmap(); m_pixmapCache.insert(key, toAdd, 16); - return QPixmap(); + return TQPixmap(); } if (width == 0 && height == 0) - result = new QPixmap(*img); + result = new TQPixmap(*img); else - result = new QPixmap(img->smoothScale( width ? width : img->width(), + result = new TQPixmap(img->smoothScale( width ? width : img->width(), height ? height: img->height())); delete img; @@ -296,7 +296,7 @@ QPixmap PixmapLoader::scale( int name, int width, int height, const QColor& colo toAdd->m_pixmap = result; if (!m_pixmapCache.insert(key, toAdd, result->width()*result->height()*result->depth()/8)) { - QPixmap toRet = *result; + TQPixmap toRet = *result; delete toAdd; return toRet; } @@ -304,15 +304,15 @@ QPixmap PixmapLoader::scale( int name, int width, int height, const QColor& colo return *result; } -QSize PixmapLoader::size( int id ) +TQSize PixmapLoader::size( int id ) { KeramikEmbedImage* edata = KeramikGetDbImage(id); if (!edata) - return QSize(0,0); - return QSize(edata->width, edata->height); + return TQSize(0,0); + return TQSize(edata->width, edata->height); } -void TilePainter::draw( QPainter *p, int x, int y, int width, int height, const QColor& color, const QColor& bg, bool disabled, PaintMode mode ) +void TilePainter::draw( TQPainter *p, int x, int y, int width, int height, const TQColor& color, const TQColor& bg, bool disabled, PaintMode mode ) { if (mode == PaintTrivialMask) { @@ -422,7 +422,7 @@ void TilePainter::draw( QPainter *p, int x, int y, int width, int height, const } else { - const QBitmap* mask = scale( col, row, w, h, color, bg, disabled, false ).mask(); + const TQBitmap* mask = scale( col, row, w, h, color, bg, disabled, false ).mask(); if (mask) { p->setBackgroundColor(Qt::color0); @@ -442,7 +442,7 @@ void TilePainter::draw( QPainter *p, int x, int y, int width, int height, const } else { - const QBitmap* mask = tile( col, row, color, bg, disabled, false ).mask(); + const TQBitmap* mask = tile( col, row, color, bg, disabled, false ).mask(); if (mask) { p->setBackgroundColor(Qt::color0); @@ -570,13 +570,13 @@ InactiveTabPainter::InactiveTabPainter( Mode mode, bool bottom ) tile. */ - Mode rightMost = QApplication::reverseLayout() ? First : Last; + Mode rightMost = TQApplication::reverseLayout() ? First : Last; m_columns = (m_mode == rightMost ? 3 : 2); } int InactiveTabPainter::tileName( unsigned int column, unsigned int row ) const { - Mode leftMost = QApplication::reverseLayout() ? Last : First; + Mode leftMost = TQApplication::reverseLayout() ? Last : First; if ( column == 0 && m_mode != leftMost ) return KeramikTileSeparator; if ( m_bottom ) diff --git a/kstyles/keramik/pixmaploader.h b/kstyles/keramik/pixmaploader.h index 28b2afd78..3ee17b2f0 100644 --- a/kstyles/keramik/pixmaploader.h +++ b/kstyles/keramik/pixmaploader.h @@ -22,9 +22,9 @@ #ifndef __pixmaploader_h__ #define __pixmaploader_h__ -#include <qintcache.h> -#include <qdict.h> -#include <qimage.h> +#include <tqintcache.h> +#include <tqdict.h> +#include <tqimage.h> class QPixmap; class QImage; @@ -38,12 +38,12 @@ namespace Keramik public: PixmapLoader(); - QPixmap pixmap( int name, const QColor& color, const QColor& bg, + TQPixmap pixmap( int name, const TQColor& color, const TQColor& bg, bool disabled = false, bool blend = true ); - QPixmap scale( int name, int width, int height, const QColor& color, const QColor& bg, + TQPixmap scale( int name, int width, int height, const TQColor& color, const TQColor& bg, bool disabled = false, bool blend = true ); - QSize size( int id ); + TQSize size( int id ); void clear(); @@ -72,10 +72,10 @@ namespace Keramik bool m_disabled; bool m_blended; - QPixmap* m_pixmap; + TQPixmap* m_pixmap; - KeramikCacheEntry(int id, const QColor& color, const QColor& bg, bool disabled, - bool blended, int width, int height, QPixmap* pixmap = 0 ): + KeramikCacheEntry(int id, const TQColor& color, const TQColor& bg, bool disabled, + bool blended, int width, int height, TQPixmap* pixmap = 0 ): m_id(id), m_width(width), m_height(height), m_colorCode(color.rgb()),m_bgCode(bg.rgb()), m_disabled(disabled), m_blended(blended), m_pixmap(pixmap) {} @@ -104,9 +104,9 @@ namespace Keramik - QImage* getColored(int id, const QColor& color, const QColor& bg, bool blended); - QImage* getDisabled(int id, const QColor& color, const QColor& bg, bool blended); - QIntCache <KeramikCacheEntry> m_pixmapCache; + TQImage* getColored(int id, const TQColor& color, const TQColor& bg, bool blended); + TQImage* getDisabled(int id, const TQColor& color, const TQColor& bg, bool blended); + TQIntCache <KeramikCacheEntry> m_pixmapCache; unsigned char clamp[540]; @@ -128,9 +128,9 @@ namespace Keramik PaintTrivialMask }; - void draw( QPainter *p, int x, int y, int width, int height, const QColor& color, const QColor& bg, + void draw( TQPainter *p, int x, int y, int width, int height, const TQColor& color, const TQColor& bg, bool disabled = false, PaintMode mode = PaintNormal ); - void draw( QPainter *p, const QRect& rect, const QColor& color, const QColor& bg, bool disabled = false, PaintMode mode = PaintNormal ) + void draw( TQPainter *p, const TQRect& rect, const TQColor& color, const TQColor& bg, bool disabled = false, PaintMode mode = PaintNormal ) { draw( p, rect.x(), rect.y(), rect.width(), rect.height(), color, bg, disabled, mode ); } @@ -188,9 +188,9 @@ namespace Keramik } - QPixmap tile( unsigned int column, unsigned int row, const QColor& color, const QColor& bg, bool disabled, bool blend) + TQPixmap tile( unsigned int column, unsigned int row, const TQColor& color, const TQColor& bg, bool disabled, bool blend) { return PixmapLoader::the().pixmap( absTileName( column, row ), color, bg, disabled, blend ); } - QPixmap scale( unsigned int column, unsigned int row, int width, int height, const QColor& color, const QColor& bg, + TQPixmap scale( unsigned int column, unsigned int row, int width, int height, const TQColor& color, const TQColor& bg, bool disabled, bool blend ) { return PixmapLoader::the().scale( absTileName( column, row ), width, height, color, bg, disabled, blend ); } diff --git a/kstyles/klegacy/klegacystyle.cpp b/kstyles/klegacy/klegacystyle.cpp index e3796a079..6cac8b695 100644 --- a/kstyles/klegacy/klegacystyle.cpp +++ b/kstyles/klegacy/klegacystyle.cpp @@ -28,83 +28,83 @@ #include <kiconloader.h> #define INCLUDE_MENUITEM_DEF -#include <qapplication.h> -#include <qbitmap.h> -#include <qbuttongroup.h> -#include <qcanvas.h> -#include <qcheckbox.h> -#include <qcolor.h> -#include <qcolordialog.h> -#include <qcombobox.h> -#include <qdial.h> -#include <qdialog.h> -#include <qdict.h> -#include <qfile.h> -#include <qfiledialog.h> -#include <qfileinfo.h> -#include <qfont.h> -#include <qfontdialog.h> -#include <qframe.h> -#include <qguardedptr.h> -#include <qgrid.h> -#include <qgroupbox.h> -#include <qhbox.h> -#include <qhbuttongroup.h> -#include <qheader.h> -#include <qhgroupbox.h> -#include <qiconview.h> -#include <qimage.h> -#include <qinputdialog.h> -#include <qintdict.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlcdnumber.h> -#include <qlineedit.h> -#include <qptrlist.h> -#include <qlistbox.h> -#include <qlistview.h> -#include <qmainwindow.h> -#include <qmenubar.h> -#include <qmenudata.h> -#include <qmessagebox.h> -#include <qmultilineedit.h> -#include <qobjectlist.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpixmapcache.h> -#include <qpopupmenu.h> -#include <qprintdialog.h> -#include <qprogressbar.h> -#include <qprogressdialog.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qregexp.h> -#include <qscrollbar.h> -#include <qscrollview.h> -#include <qsemimodal.h> -#include <qsizegrip.h> -#include <qslider.h> -#include <qspinbox.h> -#include <qsplitter.h> -#include <qstatusbar.h> -#include <qstring.h> -#include <qtabbar.h> -#include <qtabdialog.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqbuttongroup.h> +#include <tqcanvas.h> +#include <tqcheckbox.h> +#include <tqcolor.h> +#include <tqcolordialog.h> +#include <tqcombobox.h> +#include <tqdial.h> +#include <tqdialog.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqfiledialog.h> +#include <tqfileinfo.h> +#include <tqfont.h> +#include <tqfontdialog.h> +#include <tqframe.h> +#include <tqguardedptr.h> +#include <tqgrid.h> +#include <tqgroupbox.h> +#include <tqhbox.h> +#include <tqhbuttongroup.h> +#include <tqheader.h> +#include <tqhgroupbox.h> +#include <tqiconview.h> +#include <tqimage.h> +#include <tqinputdialog.h> +#include <tqintdict.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlcdnumber.h> +#include <tqlineedit.h> +#include <tqptrlist.h> +#include <tqlistbox.h> +#include <tqlistview.h> +#include <tqmainwindow.h> +#include <tqmenubar.h> +#include <tqmenudata.h> +#include <tqmessagebox.h> +#include <tqmultilineedit.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpixmapcache.h> +#include <tqpopupmenu.h> +#include <tqprintdialog.h> +#include <tqprogressbar.h> +#include <tqprogressdialog.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqregexp.h> +#include <tqscrollbar.h> +#include <tqscrollview.h> +#include <tqsemimodal.h> +#include <tqsizegrip.h> +#include <tqslider.h> +#include <tqspinbox.h> +#include <tqsplitter.h> +#include <tqstatusbar.h> +#include <tqstring.h> +#include <tqtabbar.h> +#include <tqtabdialog.h> #include <qtableview.h> -#include <qtabwidget.h> -#include <qtextbrowser.h> -#include <qtextstream.h> -#include <qtextview.h> -#include <qtoolbar.h> -#include <qtoolbutton.h> -#include <qtooltip.h> -#include <qvbox.h> -#include <qvbuttongroup.h> -#include <qvgroupbox.h> -#include <qwidget.h> -#include <qwidgetstack.h> -#include <qwizard.h> -#include <qworkspace.h> +#include <tqtabwidget.h> +#include <tqtextbrowser.h> +#include <tqtextstream.h> +#include <tqtextview.h> +#include <tqtoolbar.h> +#include <tqtoolbutton.h> +#include <tqtooltip.h> +#include <tqvbox.h> +#include <tqvbuttongroup.h> +#include <tqvgroupbox.h> +#include <tqwidget.h> +#include <tqwidgetstack.h> +#include <tqwizard.h> +#include <tqworkspace.h> #include <stdlib.h> #include <unistd.h> @@ -118,8 +118,8 @@ class KLegacyImageData; class GtkObject; // declaration of hidden functions -typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, - QMenuItem *, QColorGroup &, bool, bool); +typedef void (TQStyle::*QDrawMenuBarItemImpl) (TQPainter *, int, int, int, int, + TQMenuItem *, TQColorGroup &, bool, bool); extern QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); // the addresses of the integers are used to place things in the @@ -134,11 +134,11 @@ static int checkmenuitem_ptr = 6; static int radiomenuitem_ptr = 7; static int eventbox_ptr = 8; -// a QImage cache, since we need to resize some images to different sizes, we +// a TQImage cache, since we need to resize some images to different sizes, we // will cache them, to save the overhead of loading the image from disk each // time it's needed static const int imageCacheSize = 61; -static QDict<QImage> *imageCache = 0; +static TQDict<TQImage> *imageCache = 0; class KLegacy { @@ -205,12 +205,12 @@ class KLegacyImageData : public KLegacy { public: KLegacyImageDataKey key; - QString file; - QString detail; - QString overlayFile; - QString gapFile; - QString gapStartFile; - QString gapEndFile; + TQString file; + TQString detail; + TQString overlayFile; + TQString gapFile; + TQString gapStartFile; + TQString gapEndFile; KLegacyBorder border; KLegacyBorder overlayBorder; @@ -233,17 +233,17 @@ public: class KLegacyStyleData : public KLegacy { public: // name of this style - QString name; + TQString name; // font to use - QFont *fn; + TQFont *fn; // list of image datas (which tell us how to draw things) QList<KLegacyImageData> imageList; // background, foreground and base colors for the 5 widget //states that Gtk defines - QColor back[5], fore[5], base[5]; + TQColor back[5], fore[5], base[5]; // reference count int ref; @@ -257,7 +257,7 @@ public: }; -class GtkObject : public QObject { +class GtkObject : public TQObject { private: KLegacyStyleData *d; @@ -266,37 +266,37 @@ private: public: GtkObject(GtkObject *parent, const char *name) - : QObject(parent, name) + : TQObject(parent, name) { d = 0; } - GtkObject *find(QRegExp &) const; + GtkObject *find(TQRegExp &) const; - QColor backColor(KLegacy::State); - QColor baseColor(KLegacy::State); - QColor foreColor(KLegacy::State); + TQColor backColor(KLegacy::State); + TQColor baseColor(KLegacy::State); + TQColor foreColor(KLegacy::State); - QFont *font(); + TQFont *font(); - inline QString styleName() + inline TQString styleName() { return styleData()->name; } KLegacyStyleData *styleData(); KLegacyImageData *getImageData(KLegacyImageDataKey, - const QString & = QString::null); + const TQString & = TQString::null); - QPixmap *draw(KLegacyImageDataKey, int, int, const QString & = QString::null); - QPixmap *draw(KLegacyImageData *, int, int); + TQPixmap *draw(KLegacyImageDataKey, int, int, const TQString & = TQString::null); + TQPixmap *draw(KLegacyImageData *, int, int); }; -static QPixmap *drawImage(QImage *image, int width, int height, +static TQPixmap *drawImage(TQImage *image, int width, int height, KLegacyBorder border, bool scale) { if ((! image) || (image->isNull()) || (width < 1) || (height < 1)) { - return (QPixmap *) 0; + return (TQPixmap *) 0; } - QPixmap *pixmap = new QPixmap(width, height); + TQPixmap *pixmap = new TQPixmap(width, height); if (scale) { if (width < 2) width = 2; @@ -386,10 +386,10 @@ static QPixmap *drawImage(QImage *image, int width, int height, // draw the image bool mask = image->hasAlphaBuffer(); - QBitmap bm(width, height); + TQBitmap bm(width, height); bm.fill(Qt::color1); - QImage nimage[3][3]; + TQImage nimage[3][3]; int xx = -1, yy = -1; while (++yy < 3) { xx = -1; @@ -407,7 +407,7 @@ static QPixmap *drawImage(QImage *image, int width, int height, 0, 0, w2[xx], h2[yy], Qt::CopyROP); if (mask) { - QImage am = nimage[yy][xx].createAlphaMask(); + TQImage am = nimage[yy][xx].createAlphaMask(); bitBlt(&bm, x2[xx], y2[yy], &am, 0, 0, w2[xx], h2[yy], Qt::CopyROP); } @@ -422,10 +422,10 @@ static QPixmap *drawImage(QImage *image, int width, int height, bitBlt(pixmap, x, y, image, 0, 0, -1, -1, Qt::CopyROP); if (image->hasAlphaBuffer()) { - QImage mask = image->createAlphaMask(); + TQImage mask = image->createAlphaMask(); if (! mask.isNull() && mask.depth() == 1) { - QBitmap bm(width, height); + TQBitmap bm(width, height); bm.fill(Qt::color1); bm = mask; pixmap->setMask(bm); @@ -439,7 +439,7 @@ static QPixmap *drawImage(QImage *image, int width, int height, // Generate an object tree for all the known Gtk widgets... // returns a pointer to the bottom of the tree -static GtkObject *initialize(QPtrDict<GtkObject> &dict) { +static GtkObject *initialize(TQPtrDict<GtkObject> &dict) { // // auto generated stuff from : // -- @@ -670,64 +670,64 @@ static GtkObject *initialize(QPtrDict<GtkObject> &dict) { // sort | uniq > meta //-- - dict.insert(QButton::staticMetaObject(), myGtkButton); - dict.insert(QButtonGroup::staticMetaObject(), myGtkButtonBox); - dict.insert(QCanvas::staticMetaObject(), myGtkDrawingArea); - dict.insert(QCanvasView::staticMetaObject(), myGtkDrawingArea); - dict.insert(QCheckBox::staticMetaObject(), myGtkCheckButton); + dict.insert(TQButton::staticMetaObject(), myGtkButton); + dict.insert(TQButtonGroup::staticMetaObject(), myGtkButtonBox); + dict.insert(TQCanvas::staticMetaObject(), myGtkDrawingArea); + dict.insert(TQCanvasView::staticMetaObject(), myGtkDrawingArea); + dict.insert(TQCheckBox::staticMetaObject(), myGtkCheckButton); dict.insert(QColorDialog::staticMetaObject(), myGtkColorSelectionDialog); - dict.insert(QComboBox::staticMetaObject(), myGtkCombo); - dict.insert(QDial::staticMetaObject(), myGtkWidget); - dict.insert(QDialog::staticMetaObject(), myGtkDialog); - dict.insert(QFileDialog::staticMetaObject(), myGtkFileSelection); + dict.insert(TQComboBox::staticMetaObject(), myGtkCombo); + dict.insert(TQDial::staticMetaObject(), myGtkWidget); + dict.insert(TQDialog::staticMetaObject(), myGtkDialog); + dict.insert(TQFileDialog::staticMetaObject(), myGtkFileSelection); dict.insert(QFontDialog::staticMetaObject(), myGtkFontSelectionDialog); - dict.insert(QFrame::staticMetaObject(), myGtkFrame); - dict.insert(QGrid::staticMetaObject(), myGtkFrame); - dict.insert(QGroupBox::staticMetaObject(), myGtkBox); - dict.insert(QHBox::staticMetaObject(), myGtkHBox); - dict.insert(QHButtonGroup::staticMetaObject(), myGtkHButtonBox); - dict.insert(QHGroupBox::staticMetaObject(), myGtkHBox); - dict.insert(QHeader::staticMetaObject(), myGtkRuler); - dict.insert(QIconView::staticMetaObject(), myGtkCTree); + dict.insert(TQFrame::staticMetaObject(), myGtkFrame); + dict.insert(TQGrid::staticMetaObject(), myGtkFrame); + dict.insert(TQGroupBox::staticMetaObject(), myGtkBox); + dict.insert(TQHBox::staticMetaObject(), myGtkHBox); + dict.insert(TQHButtonGroup::staticMetaObject(), myGtkHButtonBox); + dict.insert(TQHGroupBox::staticMetaObject(), myGtkHBox); + dict.insert(TQHeader::staticMetaObject(), myGtkRuler); + dict.insert(TQIconView::staticMetaObject(), myGtkCTree); dict.insert(QInputDialog::staticMetaObject(), myGtkInputDialog); - dict.insert(QLCDNumber::staticMetaObject(), myGtkFrame); - dict.insert(QLabel::staticMetaObject(), myGtkLabel); - dict.insert(QLineEdit::staticMetaObject(), myGtkEntry); - dict.insert(QListBox::staticMetaObject(), myGtkCList); - dict.insert(QListView::staticMetaObject(), myGtkCTree); - dict.insert(QMainWindow::staticMetaObject(), myGtkWindow); - dict.insert(QMenuBar::staticMetaObject(), myGtkMenuBar); - dict.insert(QMessageBox::staticMetaObject(), myGtkDialog); - dict.insert(QMultiLineEdit::staticMetaObject(), myGtkText); - dict.insert(QPopupMenu::staticMetaObject(), myGtkMenu); - dict.insert(QPrintDialog::staticMetaObject(), myGtkDialog); - dict.insert(QProgressBar::staticMetaObject(), myGtkProgressBar); - dict.insert(QProgressDialog::staticMetaObject(), myGtkDialog); - dict.insert(QPushButton::staticMetaObject(), myGtkButton); - dict.insert(QRadioButton::staticMetaObject(), myGtkRadioButton); - dict.insert(QScrollBar::staticMetaObject(), myGtkScrollbar); - dict.insert(QScrollView::staticMetaObject(), myGtkViewport); - dict.insert(QSemiModal::staticMetaObject(), myGtkDialog); - dict.insert(QSizeGrip::staticMetaObject(), myGtkWidget); - dict.insert(QSlider::staticMetaObject(), myGtkScale); - dict.insert(QSpinBox::staticMetaObject(), myGtkSpinButton); - dict.insert(QSplitter::staticMetaObject(), myGtkPaned); - dict.insert(QStatusBar::staticMetaObject(), myGtkStatusbar); - dict.insert(QTabBar::staticMetaObject(), myGtkNotebook); - dict.insert(QTabDialog::staticMetaObject(), myGtkNotebook); - dict.insert(QTabWidget::staticMetaObject(), myGtkNotebook); + dict.insert(TQLCDNumber::staticMetaObject(), myGtkFrame); + dict.insert(TQLabel::staticMetaObject(), myGtkLabel); + dict.insert(TQLineEdit::staticMetaObject(), myGtkEntry); + dict.insert(TQListBox::staticMetaObject(), myGtkCList); + dict.insert(TQListView::staticMetaObject(), myGtkCTree); + dict.insert(TQMainWindow::staticMetaObject(), myGtkWindow); + dict.insert(TQMenuBar::staticMetaObject(), myGtkMenuBar); + dict.insert(TQMessageBox::staticMetaObject(), myGtkDialog); + dict.insert(TQMultiLineEdit::staticMetaObject(), myGtkText); + dict.insert(TQPopupMenu::staticMetaObject(), myGtkMenu); + dict.insert(TQPrintDialog::staticMetaObject(), myGtkDialog); + dict.insert(TQProgressBar::staticMetaObject(), myGtkProgressBar); + dict.insert(TQProgressDialog::staticMetaObject(), myGtkDialog); + dict.insert(TQPushButton::staticMetaObject(), myGtkButton); + dict.insert(TQRadioButton::staticMetaObject(), myGtkRadioButton); + dict.insert(TQScrollBar::staticMetaObject(), myGtkScrollbar); + dict.insert(TQScrollView::staticMetaObject(), myGtkViewport); + dict.insert(TQSemiModal::staticMetaObject(), myGtkDialog); + dict.insert(TQSizeGrip::staticMetaObject(), myGtkWidget); + dict.insert(TQSlider::staticMetaObject(), myGtkScale); + dict.insert(TQSpinBox::staticMetaObject(), myGtkSpinButton); + dict.insert(TQSplitter::staticMetaObject(), myGtkPaned); + dict.insert(TQStatusBar::staticMetaObject(), myGtkStatusbar); + dict.insert(TQTabBar::staticMetaObject(), myGtkNotebook); + dict.insert(TQTabDialog::staticMetaObject(), myGtkNotebook); + dict.insert(TQTabWidget::staticMetaObject(), myGtkNotebook); dict.insert(QTableView::staticMetaObject(), myGtkTable); - dict.insert(QTextBrowser::staticMetaObject(), myGtkText); - dict.insert(QTextView::staticMetaObject(), myGtkText); - dict.insert(QToolBar::staticMetaObject(), myGtkToolbar); - dict.insert(QToolButton::staticMetaObject(), myGtkButton); - dict.insert(QVBox::staticMetaObject(), myGtkVBox); - dict.insert(QVButtonGroup::staticMetaObject(), myGtkVButtonBox); - dict.insert(QVGroupBox::staticMetaObject(), myGtkVBox); - dict.insert(QWidget::staticMetaObject(), myGtkWidget); - dict.insert(QWidgetStack::staticMetaObject(), myGtkWidget); - dict.insert(QWizard::staticMetaObject(), myGtkWindow); - dict.insert(QWorkspace::staticMetaObject(), myGtkWindow); + dict.insert(TQTextBrowser::staticMetaObject(), myGtkText); + dict.insert(TQTextView::staticMetaObject(), myGtkText); + dict.insert(TQToolBar::staticMetaObject(), myGtkToolbar); + dict.insert(TQToolButton::staticMetaObject(), myGtkButton); + dict.insert(TQVBox::staticMetaObject(), myGtkVBox); + dict.insert(TQVButtonGroup::staticMetaObject(), myGtkVButtonBox); + dict.insert(TQVGroupBox::staticMetaObject(), myGtkVBox); + dict.insert(TQWidget::staticMetaObject(), myGtkWidget); + dict.insert(TQWidgetStack::staticMetaObject(), myGtkWidget); + dict.insert(TQWizard::staticMetaObject(), myGtkWindow); + dict.insert(TQWorkspace::staticMetaObject(), myGtkWindow); // stuff that we don't have meta data for, but want to know about dict.insert(&listboxitem_ptr, myGtkListItem); @@ -744,7 +744,7 @@ static GtkObject *initialize(QPtrDict<GtkObject> &dict) { } -KLegacyImageData *GtkObject::getImageData(KLegacyImageDataKey key, const QString &detail) { +KLegacyImageData *GtkObject::getImageData(KLegacyImageDataKey key, const TQString &detail) { KLegacyImageData *imagedata = 0; if (styleData()) { @@ -803,7 +803,7 @@ KLegacyStyleData *GtkObject::styleData() { } -QColor GtkObject::backColor(KLegacy::State s) { +TQColor GtkObject::backColor(KLegacy::State s) { if ((! styleData()->back[s].isValid()) && parent()) { return ((GtkObject *) parent())->backColor(s); } @@ -815,7 +815,7 @@ QColor GtkObject::backColor(KLegacy::State s) { } -QColor GtkObject::baseColor(KLegacy::State s) { +TQColor GtkObject::baseColor(KLegacy::State s) { if ((! styleData()->base[s].isValid()) && parent()) { return ((GtkObject *) parent())->baseColor(s); } @@ -827,7 +827,7 @@ QColor GtkObject::baseColor(KLegacy::State s) { } -QColor GtkObject::foreColor(KLegacy::State s) { +TQColor GtkObject::foreColor(KLegacy::State s) { if ((! styleData()->fore[s].isValid()) && parent()) { return ((GtkObject *) parent())->foreColor(s); } @@ -839,7 +839,7 @@ QColor GtkObject::foreColor(KLegacy::State s) { } -QFont *GtkObject::font() { +TQFont *GtkObject::font() { if ((! styleData()->fn) && parent()) { return ((GtkObject *) parent())->font(); } @@ -848,7 +848,7 @@ QFont *GtkObject::font() { } -GtkObject *GtkObject::find(QRegExp &r) const { +GtkObject *GtkObject::find(TQRegExp &r) const { // if the regular expression matches the name of this widget, return if (r.match(name()) != -1) { return (GtkObject *) this; @@ -857,10 +857,10 @@ GtkObject *GtkObject::find(QRegExp &r) const { // regex doesn't match us, and we have no children, return 0 if (! children()) return 0; - QObject *o; + TQObject *o; GtkObject *obj, *gobj; - QObjectListIt ot(*children()); + TQObjectListIt ot(*children()); // search our children to see if any match the regex while ((o = ot.current()) != 0) { @@ -890,8 +890,8 @@ GtkObject *GtkObject::find(QRegExp &r) const { } -QPixmap *GtkObject::draw(KLegacyImageDataKey key, int width, int height, - const QString &detail) +TQPixmap *GtkObject::draw(KLegacyImageDataKey key, int width, int height, + const TQString &detail) { KLegacyImageData *imagedata = getImageData(key, detail); if (! imagedata) { @@ -902,26 +902,26 @@ QPixmap *GtkObject::draw(KLegacyImageDataKey key, int width, int height, } -QPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { - QString pixmapKey; - QTextOStream(&pixmapKey) << "$KLegacy_Image_" << styleData()->name << "_" << +TQPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { + TQString pixmapKey; + TQTextOStream(&pixmapKey) << "$KLegacy_Image_" << styleData()->name << "_" << className() << "_" << width << "x" << height << "_" << imagedata->key.cachekey << "_" << (uint) imagedata->recolorable << (uint) imagedata->stretch << (uint) imagedata->overlayStretch; - QPixmap *pixmap = QPixmapCache::find(pixmapKey); + TQPixmap *pixmap = TQPixmapCache::find(pixmapKey); if (pixmap) { return pixmap; } - QPixmap *main = 0, *overlay = 0; + TQPixmap *main = 0, *overlay = 0; if (! imagedata->file.isNull()) { - QImage *image = imageCache->find(imagedata->file); + TQImage *image = imageCache->find(imagedata->file); bool found = true; if (! image) { - image = new QImage(imagedata->file); + image = new TQImage(imagedata->file); if (! image || image->isNull()) { found = false; @@ -938,11 +938,11 @@ QPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { } if (! imagedata->overlayFile.isNull()) { - QImage *image = imageCache->find(imagedata->overlayFile); + TQImage *image = imageCache->find(imagedata->overlayFile); bool found = true; if (! image) { - image = new QImage(imagedata->overlayFile); + image = new TQImage(imagedata->overlayFile); if (! image || image->isNull()) { found = false; @@ -959,7 +959,7 @@ QPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { } } - QSize sz; + TQSize sz; if (main) { sz = sz.expandedTo(main->size()); } @@ -969,19 +969,19 @@ QPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { } if (sz.isEmpty()) { - return (QPixmap *) 0; + return (TQPixmap *) 0; } - pixmap = new QPixmap(sz); - pixmap->fill(QColor(192,192,176)); - QPainter p(pixmap); + pixmap = new TQPixmap(sz); + pixmap->fill(TQColor(192,192,176)); + TQPainter p(pixmap); if (main && (! main->isNull())) { p.drawTiledPixmap(0, 0, sz.width(), sz.height(), *main); } if (overlay && (! overlay->isNull())) { - QPoint pt((sz.width() - overlay->width()) / 2, + TQPoint pt((sz.width() - overlay->width()) / 2, (sz.height() - overlay->height()) / 2); p.drawPixmap(pt, *overlay); } @@ -990,9 +990,9 @@ QPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { if (main) { if (main->mask() && (! main->mask()->isNull())) { - QBitmap bm(sz); - QPainter m(&bm); - QRect r(0, 0, width, height); + TQBitmap bm(sz); + TQPainter m(&bm); + TQRect r(0, 0, width, height); m.drawTiledPixmap(r, *(main->mask())); m.end(); @@ -1001,9 +1001,9 @@ QPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { } } else if (overlay) { if (overlay->mask() && (! overlay->mask()->isNull())) { - QBitmap bm(sz); - QPainter m(&bm); - QRect r((sz.width() - overlay->width()) / 2, + TQBitmap bm(sz); + TQPainter m(&bm); + TQRect r((sz.width() - overlay->width()) / 2, (sz.height() - overlay->height()) / 2, sz.width(), sz.height()); m.drawTiledPixmap(r, *(overlay->mask())); @@ -1013,9 +1013,9 @@ QPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { } } - if (! QPixmapCache::insert(pixmapKey, pixmap)) { + if (! TQPixmapCache::insert(pixmapKey, pixmap)) { delete pixmap; - pixmap = (QPixmap *) 0; + pixmap = (TQPixmap *) 0; } return pixmap; @@ -1024,21 +1024,21 @@ QPixmap *GtkObject::draw(KLegacyImageData *imagedata, int width, int height) { class KLegacyStylePrivate : public KLegacy { private: - QDict<KLegacyStyleData> styleDict; - QStringList pixmapPath; - QTextStream filestream; + TQDict<KLegacyStyleData> styleDict; + TQStringList pixmapPath; + TQTextStream filestream; - QFont oldfont; - QPalette oldpalette; + TQFont oldfont; + TQPalette oldpalette; // pointer to the widget under the pointer - QGuardedPtr<QWidget> lastWidget; + TQGuardedPtr<TQWidget> lastWidget; // current position of the mouse - QPoint mousePos; + TQPoint mousePos; bool hovering; - QPtrDict<GtkObject> gtkDict; + TQPtrDict<GtkObject> gtkDict; GtkObject *gtktree; friend class KLegacyStyle; @@ -1049,7 +1049,7 @@ public: ~KLegacyStylePrivate(); // parse the filename passed - bool parse(const QString &filename); + bool parse(const TQString &filename); bool parseClass(); bool parseEngine(KLegacyStyleData *); @@ -1062,10 +1062,10 @@ public: KLegacyStylePrivate::KLegacyStylePrivate() : lastWidget(0), mousePos(-1, -1), hovering(false), gtktree(0) { - QPixmapCache::setCacheLimit(8192); + TQPixmapCache::setCacheLimit(8192); if (! imageCache) { - imageCache = new QDict<QImage>(imageCacheSize); + imageCache = new TQDict<TQImage>(imageCacheSize); CHECK_PTR(imageCache); imageCache->setAutoDelete(true); @@ -1082,16 +1082,16 @@ KLegacyStylePrivate::KLegacyStylePrivate() } // get the path to this users .gtkrc - QString gtkrcFilename = getenv("HOME"); + TQString gtkrcFilename = getenv("HOME"); gtkrcFilename += "/.gtkrc"; - QFile gtkrc(gtkrcFilename); + TQFile gtkrc(gtkrcFilename); if (gtkrc.open(IO_ReadOnly)) { filestream.setDevice(>krc); while (! filestream.atEnd()) { - QString next; + TQString next; filestream >> next; if (next.isNull()) continue; @@ -1133,7 +1133,7 @@ KLegacyStylePrivate::~KLegacyStylePrivate() { bool KLegacyStylePrivate::parseClass() { if (filestream.atEnd()) return false; - QString classname, keyword, stylename; + TQString classname, keyword, stylename; filestream >> classname; filestream >> keyword; filestream >> stylename; @@ -1147,7 +1147,7 @@ bool KLegacyStylePrivate::parseClass() { classname = classname.mid(1, classname.length() - 2); stylename = stylename.mid(1, stylename.length() - 2); - QRegExp r(classname); + TQRegExp r(classname); r.setWildcard(true); GtkObject *obj = gtktree->find(r); @@ -1177,7 +1177,7 @@ bool KLegacyStylePrivate::parseImage(KLegacyStyleData *styledata) { return false; } - QString next, equals, parameter; + TQString next, equals, parameter; filestream >> next; // skip comments @@ -1224,7 +1224,7 @@ bool KLegacyStylePrivate::parseImage(KLegacyStyleData *styledata) { if (equals.isNull() || parameter.isNull() || equals != "=" || parameter != "{") continue; - QString border =filestream.readLine(); + TQString border =filestream.readLine(); int lp, rp, tp, bp, l, r, t, b; lp = border.find(','); @@ -1263,9 +1263,9 @@ bool KLegacyStylePrivate::parseImage(KLegacyStyleData *styledata) { parameter = parameter.mid(1, parameter.length() - 2); - QStringList::Iterator it; + TQStringList::Iterator it; for (it = pixmapPath.begin(); it != pixmapPath.end(); ++it) { - QFileInfo fileinfo((*it) + parameter); + TQFileInfo fileinfo((*it) + parameter); if (fileinfo.exists()) { imagedata->file = fileinfo.filePath(); @@ -1333,7 +1333,7 @@ bool KLegacyStylePrivate::parseImage(KLegacyStyleData *styledata) { if (equals.isNull() || parameter.isNull() || equals != "=" || parameter != "{") continue; - QString border = filestream.readLine(); + TQString border = filestream.readLine(); int lp, rp, tp, bp, l, r, t, b; lp = border.find(','); @@ -1362,9 +1362,9 @@ bool KLegacyStylePrivate::parseImage(KLegacyStyleData *styledata) { parameter = parameter.mid(1, parameter.length() - 2); - QStringList::Iterator it; + TQStringList::Iterator it; for (it = pixmapPath.begin(); it != pixmapPath.end(); ++it) { - QFileInfo fileinfo((*it) + parameter); + TQFileInfo fileinfo((*it) + parameter); if (fileinfo.exists()) { imagedata->overlayFile = fileinfo.filePath(); @@ -1436,7 +1436,7 @@ bool KLegacyStylePrivate::parseImage(KLegacyStyleData *styledata) { bool KLegacyStylePrivate::parseEngine(KLegacyStyleData *styledata) { if (filestream.atEnd()) return false; - QString enginename, paren; + TQString enginename, paren; filestream >> enginename; filestream >> paren; @@ -1446,7 +1446,7 @@ bool KLegacyStylePrivate::parseEngine(KLegacyStyleData *styledata) { return false; } - QString next; + TQString next; int paren_count = 1; while (paren_count) { filestream >> next; @@ -1477,7 +1477,7 @@ bool KLegacyStylePrivate::parsePixmapPath() { return false; } - QString next; + TQString next; filestream >> next; if (next.isNull() || next[0] != '\"' || next[next.length() - 1] != '\"') { @@ -1488,13 +1488,13 @@ bool KLegacyStylePrivate::parsePixmapPath() { int start = 0, end = next.find(":"); while (end != -1) { - QString path(next.mid(start, end - start)); + TQString path(next.mid(start, end - start)); if (path[path.length() - 1] != '/') { path += '/'; } - QFileInfo fileinfo(path); + TQFileInfo fileinfo(path); if (fileinfo.exists() && fileinfo.isDir()) { pixmapPath.append(path); } @@ -1505,13 +1505,13 @@ bool KLegacyStylePrivate::parsePixmapPath() { // get the straggler end = next.length(); - QString path(next.mid(start, end - start)); + TQString path(next.mid(start, end - start)); if (path[path.length() - 1] != '/') { path += '/'; } - QFileInfo fileinfo(path); + TQFileInfo fileinfo(path); if (fileinfo.exists() && fileinfo.isDir()) { pixmapPath.append(path); } @@ -1523,7 +1523,7 @@ bool KLegacyStylePrivate::parsePixmapPath() { bool KLegacyStylePrivate::parseStyle() { if (filestream.atEnd()) return false; - QString stylename, paren; + TQString stylename, paren; filestream >> stylename; filestream >> paren; @@ -1534,7 +1534,7 @@ bool KLegacyStylePrivate::parseStyle() { stylename = stylename.mid(1, stylename.length() - 2); if (paren == "=") { - QString newstylename; + TQString newstylename; filestream >> newstylename; if (newstylename.isNull() || @@ -1561,7 +1561,7 @@ bool KLegacyStylePrivate::parseStyle() { KLegacyStyleData *styledata = new KLegacyStyleData; styledata->name = stylename; - QString next, parameter; + TQString next, parameter; int paren_count = 1; while (paren_count) { filestream >> next; @@ -1577,7 +1577,7 @@ bool KLegacyStylePrivate::parseStyle() { if (l < 1 || r < 1 || r < l) continue; - QString mode = next.mid(l + 1, r - l - 1); + TQString mode = next.mid(l + 1, r - l - 1); if (mode == "ACTIVE") state = Active; else if (mode == "NORMAL") @@ -1595,12 +1595,12 @@ bool KLegacyStylePrivate::parseStyle() { if (next.isNull() || parameter.isNull() || next != "=") continue; if (parameter[0] == '\"') { // assume color of the form "#rrggbb" - QString colorname = parameter.mid(1, parameter.length() - 2); + TQString colorname = parameter.mid(1, parameter.length() - 2); if (colorname.isNull()) continue; styledata->base[state].setNamedColor(colorname); } else if (parameter == "{") { // assume color of the form { ri, gi, bi } - QString color =filestream.readLine(); + TQString color =filestream.readLine(); int rp, gp, bp; float ri, gi, bi; @@ -1623,7 +1623,7 @@ bool KLegacyStylePrivate::parseStyle() { if (l < 1 || r < 1 || r < l) continue; - QString mode = next.mid(l + 1, r - l - 1); + TQString mode = next.mid(l + 1, r - l - 1); if (mode == "ACTIVE") state = Active; else if (mode == "NORMAL") @@ -1641,12 +1641,12 @@ bool KLegacyStylePrivate::parseStyle() { if (next.isNull() || parameter.isNull() || next != "=") continue; if (parameter[0] == '\"') { // assume color of the form "#rrggbb" - QString colorname = parameter.mid(1, parameter.length() - 2); + TQString colorname = parameter.mid(1, parameter.length() - 2); if (colorname.isNull()) continue; styledata->back[state].setNamedColor(colorname); } else if (parameter == "{") { // assume color of the form { ri, gi, bi } - QString color =filestream.readLine(); + TQString color =filestream.readLine(); int rp, gp, bp; float ri, gi, bi; @@ -1672,7 +1672,7 @@ bool KLegacyStylePrivate::parseStyle() { if (l < 1 || r < 1 || r < l) continue; - QString mode = next.mid(l + 1, r - l - 1); + TQString mode = next.mid(l + 1, r - l - 1); if (mode == "ACTIVE") state = Active; else if (mode == "NORMAL") @@ -1690,12 +1690,12 @@ bool KLegacyStylePrivate::parseStyle() { if (next.isNull() || parameter.isNull() || next != "=") continue; if (parameter[0] == '\"') { // assume color of the form "#rrggbb" - QString colorname = parameter.mid(1, parameter.length() - 2); + TQString colorname = parameter.mid(1, parameter.length() - 2); if (colorname.isNull()) continue; styledata->fore[state].setNamedColor(colorname); } else if (parameter == "{") { // assume color of the form { ri, gi, bi } - QString color = filestream.readLine(); + TQString color = filestream.readLine(); int rp, gp, bp; float ri, gi, bi; @@ -1763,110 +1763,110 @@ int KLegacyStyle::defaultFrameWidth() const { } -void KLegacyStyle::polish(QApplication *app) { +void KLegacyStyle::polish(TQApplication *app) { priv->oldfont = app->font(); priv->oldpalette = app->palette(); - GtkObject *gobj = priv->gtkDict.find(QMainWindow::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQMainWindow::staticMetaObject()); if (gobj) { if (gobj->font()) { app->setFont(*gobj->font(), true); } - QPalette pal = app->palette(); - QBrush brush; + TQPalette pal = app->palette(); + TQBrush brush; // background - brush = pal.brush(QPalette::Active, QColorGroup::Background); + brush = pal.brush(TQPalette::Active, TQColorGroup::Background); brush.setColor(gobj->backColor(KLegacy::Active)); - pal.setBrush(QPalette::Active, QColorGroup::Background, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Inactive, QColorGroup::Background); + brush = pal.brush(TQPalette::Inactive, TQColorGroup::Background); brush.setColor(gobj->backColor(KLegacy::Normal)); - pal.setBrush(QPalette::Inactive, QColorGroup::Background, brush); + pal.setBrush(TQPalette::Inactive, TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Disabled, QColorGroup::Background); + brush = pal.brush(TQPalette::Disabled, TQColorGroup::Background); brush.setColor(gobj->backColor(KLegacy::Insensitive)); - pal.setBrush(QPalette::Disabled, QColorGroup::Background, brush); + pal.setBrush(TQPalette::Disabled, TQColorGroup::Background, brush); // foreground - brush = pal.brush(QPalette::Active, QColorGroup::Foreground); + brush = pal.brush(TQPalette::Active, TQColorGroup::Foreground); brush.setColor(gobj->foreColor(KLegacy::Active)); - pal.setBrush(QPalette::Active, QColorGroup::Foreground, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::Foreground, brush); - brush = pal.brush(QPalette::Inactive, QColorGroup::Foreground); + brush = pal.brush(TQPalette::Inactive, TQColorGroup::Foreground); brush.setColor(gobj->foreColor(KLegacy::Normal)); - pal.setBrush(QPalette::Inactive, QColorGroup::Foreground, brush); + pal.setBrush(TQPalette::Inactive, TQColorGroup::Foreground, brush); - brush = pal.brush(QPalette::Disabled, QColorGroup::Foreground); + brush = pal.brush(TQPalette::Disabled, TQColorGroup::Foreground); brush.setColor(gobj->foreColor(KLegacy::Insensitive)); - pal.setBrush(QPalette::Disabled, QColorGroup::Foreground, brush); + pal.setBrush(TQPalette::Disabled, TQColorGroup::Foreground, brush); // base - brush = pal.brush(QPalette::Active, QColorGroup::Base); + brush = pal.brush(TQPalette::Active, TQColorGroup::Base); brush.setColor(gobj->baseColor(KLegacy::Normal)); - pal.setBrush(QPalette::Active, QColorGroup::Base, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::Base, brush); - brush = pal.brush(QPalette::Inactive, QColorGroup::Base); + brush = pal.brush(TQPalette::Inactive, TQColorGroup::Base); brush.setColor(gobj->baseColor(KLegacy::Normal)); - pal.setBrush(QPalette::Inactive, QColorGroup::Base, brush); + pal.setBrush(TQPalette::Inactive, TQColorGroup::Base, brush); - brush = pal.brush(QPalette::Disabled, QColorGroup::Base); + brush = pal.brush(TQPalette::Disabled, TQColorGroup::Base); brush.setColor(gobj->baseColor(KLegacy::Normal)); - pal.setBrush(QPalette::Disabled, QColorGroup::Base, brush); + pal.setBrush(TQPalette::Disabled, TQColorGroup::Base, brush); // button - brush = pal.brush(QPalette::Active, QColorGroup::Button); + brush = pal.brush(TQPalette::Active, TQColorGroup::Button); brush.setColor(gobj->backColor(KLegacy::Active)); - pal.setBrush(QPalette::Active, QColorGroup::Button, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::Button, brush); - brush = pal.brush(QPalette::Normal, QColorGroup::Button); + brush = pal.brush(TQPalette::Normal, TQColorGroup::Button); brush.setColor(gobj->backColor(KLegacy::Normal)); - pal.setBrush(QPalette::Normal, QColorGroup::Button, brush); + pal.setBrush(TQPalette::Normal, TQColorGroup::Button, brush); - brush = pal.brush(QPalette::Disabled, QColorGroup::Button); + brush = pal.brush(TQPalette::Disabled, TQColorGroup::Button); brush.setColor(gobj->backColor(KLegacy::Insensitive)); - pal.setBrush(QPalette::Disabled, QColorGroup::Button, brush); + pal.setBrush(TQPalette::Disabled, TQColorGroup::Button, brush); // text - brush = pal.brush(QPalette::Active, QColorGroup::Text); + brush = pal.brush(TQPalette::Active, TQColorGroup::Text); brush.setColor(gobj->foreColor(KLegacy::Active)); - pal.setBrush(QPalette::Active, QColorGroup::Text, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::Text, brush); - brush = pal.brush(QPalette::Inactive, QColorGroup::Text); + brush = pal.brush(TQPalette::Inactive, TQColorGroup::Text); brush.setColor(gobj->foreColor(KLegacy::Normal)); - pal.setBrush(QPalette::Inactive, QColorGroup::Text, brush); + pal.setBrush(TQPalette::Inactive, TQColorGroup::Text, brush); - brush = pal.brush(QPalette::Disabled, QColorGroup::Text); + brush = pal.brush(TQPalette::Disabled, TQColorGroup::Text); brush.setColor(gobj->foreColor(KLegacy::Insensitive)); - pal.setBrush(QPalette::Disabled, QColorGroup::Text, brush); + pal.setBrush(TQPalette::Disabled, TQColorGroup::Text, brush); // highlight - brush = pal.brush(QPalette::Active, QColorGroup::Highlight); + brush = pal.brush(TQPalette::Active, TQColorGroup::Highlight); brush.setColor(gobj->backColor(KLegacy::Selected)); - pal.setBrush(QPalette::Active, QColorGroup::Highlight, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::Highlight, brush); - brush = pal.brush(QPalette::Active, QColorGroup::Highlight); + brush = pal.brush(TQPalette::Active, TQColorGroup::Highlight); brush.setColor(gobj->backColor(KLegacy::Selected)); - pal.setBrush(QPalette::Active, QColorGroup::Highlight, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::Highlight, brush); - brush = pal.brush(QPalette::Active, QColorGroup::Highlight); + brush = pal.brush(TQPalette::Active, TQColorGroup::Highlight); brush.setColor(gobj->backColor(KLegacy::Selected)); - pal.setBrush(QPalette::Active, QColorGroup::Highlight, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::Highlight, brush); // highlight text - brush = pal.brush(QPalette::Active, QColorGroup::HighlightedText); + brush = pal.brush(TQPalette::Active, TQColorGroup::HighlightedText); brush.setColor(gobj->foreColor(KLegacy::Selected)); - pal.setBrush(QPalette::Active, QColorGroup::HighlightedText, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::HighlightedText, brush); - brush = pal.brush(QPalette::Active, QColorGroup::HighlightedText); + brush = pal.brush(TQPalette::Active, TQColorGroup::HighlightedText); brush.setColor(gobj->foreColor(KLegacy::Active)); - pal.setBrush(QPalette::Active, QColorGroup::HighlightedText, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::HighlightedText, brush); - brush = pal.brush(QPalette::Active, QColorGroup::HighlightedText); + brush = pal.brush(TQPalette::Active, TQColorGroup::HighlightedText); brush.setColor(gobj->foreColor(KLegacy::Active)); - pal.setBrush(QPalette::Active, QColorGroup::HighlightedText, brush); + pal.setBrush(TQPalette::Active, TQColorGroup::HighlightedText, brush); app->setPalette(pal, true); } @@ -1877,19 +1877,19 @@ void KLegacyStyle::polish(QApplication *app) { } -void KLegacyStyle::polish(QWidget *widget) { +void KLegacyStyle::polish(TQWidget *widget) { if (qstrcmp(widget->name(), "qt_viewport") == 0 || widget->testWFlags(WType_Popup) || widget->inherits("KDesktop")) return; - if (widget->backgroundMode() == QWidget::PaletteBackground || - widget->backgroundMode() == QWidget::PaletteButton && + if (widget->backgroundMode() == TQWidget::PaletteBackground || + widget->backgroundMode() == TQWidget::PaletteButton && (! widget->ownPalette())) - widget->setBackgroundMode(QWidget::X11ParentRelative); + widget->setBackgroundMode(TQWidget::X11ParentRelative); - QMetaObject *metaobject = 0; - QString detail; + TQMetaObject *metaobject = 0; + TQString detail; KLegacyImageDataKey key; key.cachekey = 0; @@ -1898,40 +1898,40 @@ void KLegacyStyle::polish(QWidget *widget) { bool immediateRender = false; bool bgPixmap = false; - if (widget->inherits("QButton")) { - metaobject = QButton::staticMetaObject(); + if (widget->inherits("TQButton")) { + metaobject = TQButton::staticMetaObject(); eventFilter = true; } - if (widget->inherits("QComboBox")) { - metaobject = QComboBox::staticMetaObject(); + if (widget->inherits("TQComboBox")) { + metaobject = TQComboBox::staticMetaObject(); eventFilter = true; } - if (widget->inherits("QScrollBar")) { - metaobject = QScrollBar::staticMetaObject(); + if (widget->inherits("TQScrollBar")) { + metaobject = TQScrollBar::staticMetaObject(); eventFilter = true; mouseTrack = true; } - if (widget->inherits("QMenuBar")) { + if (widget->inherits("TQMenuBar")) { eventFilter = true; immediateRender = true; - metaobject = QMenuBar::staticMetaObject(); + metaobject = TQMenuBar::staticMetaObject(); detail = "menubar"; key.data.function = KLegacy::Box; key.data.shadow = KLegacy::Out; key.data.state = KLegacy::Normal; - ((QMenuBar *) widget)->setFrameShape(QFrame::StyledPanel); - ((QMenuBar *) widget)->setLineWidth(0); - widget->setBackgroundMode(QWidget::PaletteBackground); + ((TQMenuBar *) widget)->setFrameShape(TQFrame::StyledPanel); + ((TQMenuBar *) widget)->setLineWidth(0); + widget->setBackgroundMode(TQWidget::PaletteBackground); } - if (widget->inherits("QToolBar")) { - metaobject = QToolBar::staticMetaObject(); + if (widget->inherits("TQToolBar")) { + metaobject = TQToolBar::staticMetaObject(); eventFilter = true; immediateRender = true; @@ -1941,11 +1941,11 @@ void KLegacyStyle::polish(QWidget *widget) { key.data.shadow = KLegacy::Out; key.data.state = KLegacy::Normal; - widget->setBackgroundMode(QWidget::PaletteBackground); + widget->setBackgroundMode(TQWidget::PaletteBackground); } - if (widget->inherits("QLineEdit")) { - metaobject = QLineEdit::staticMetaObject(); + if (widget->inherits("TQLineEdit")) { + metaobject = TQLineEdit::staticMetaObject(); eventFilter = true; immediateRender = true; @@ -1955,101 +1955,101 @@ void KLegacyStyle::polish(QWidget *widget) { key.data.shadow = KLegacy::NoShadow; key.data.state = (widget->isEnabled()) ? KLegacy::Normal : KLegacy::Insensitive; - widget->setBackgroundMode(QWidget::PaletteBase); + widget->setBackgroundMode(TQWidget::PaletteBase); } if (widget->isTopLevel() || widget->inherits("QWorkspaceChild")) { immediateRender = true; bgPixmap = true; - metaobject = QMainWindow::staticMetaObject(); + metaobject = TQMainWindow::staticMetaObject(); key.cachekey = 0; key.data.function = KLegacy::FlatBox; detail = "base"; } - if (widget->inherits("QPopupMenu")) { + if (widget->inherits("TQPopupMenu")) { qDebug("polishing popup '%s'", widget->className()); - metaobject = QPopupMenu::staticMetaObject(); - widget->setBackgroundMode(QWidget::PaletteBackground); + metaobject = TQPopupMenu::staticMetaObject(); + widget->setBackgroundMode(TQWidget::PaletteBackground); } GtkObject *gobj = gobj = priv->gtkDict.find(((metaobject) ? metaobject : widget->metaObject())); if (gobj) { - if (gobj->font() && (*gobj->font() != QApplication::font())) + if (gobj->font() && (*gobj->font() != TQApplication::font())) widget->setFont(*gobj->font()); if (immediateRender) { - QPixmap *pix = gobj->draw(key, widget->width(), widget->height(), detail); + TQPixmap *pix = gobj->draw(key, widget->width(), widget->height(), detail); if (pix && ! pix->isNull()) { if (! bgPixmap) { - QPalette pal = widget->palette(); - QBrush brush; + TQPalette pal = widget->palette(); + TQBrush brush; // base // active - brush = pal.brush(QPalette::Active, - QColorGroup::Base); + brush = pal.brush(TQPalette::Active, + TQColorGroup::Base); brush.setPixmap(*pix); - pal.setBrush(QPalette::Active, - QColorGroup::Base, brush); + pal.setBrush(TQPalette::Active, + TQColorGroup::Base, brush); // inactive - brush = pal.brush(QPalette::Inactive, - QColorGroup::Base); + brush = pal.brush(TQPalette::Inactive, + TQColorGroup::Base); brush.setPixmap(*pix); - pal.setBrush(QPalette::Inactive, - QColorGroup::Base, brush); + pal.setBrush(TQPalette::Inactive, + TQColorGroup::Base, brush); // disabled - brush = pal.brush(QPalette::Disabled, - QColorGroup::Base); + brush = pal.brush(TQPalette::Disabled, + TQColorGroup::Base); brush.setPixmap(*pix); - pal.setBrush(QPalette::Disabled, - QColorGroup::Base, brush); + pal.setBrush(TQPalette::Disabled, + TQColorGroup::Base, brush); // background - button // active - brush = pal.brush(QPalette::Active, - QColorGroup::Background); + brush = pal.brush(TQPalette::Active, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Active, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Active, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Active, - QColorGroup::Button); + brush = pal.brush(TQPalette::Active, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Active, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Active, + TQColorGroup::Button, brush); // inactive - brush = pal.brush(QPalette::Inactive, - QColorGroup::Background); + brush = pal.brush(TQPalette::Inactive, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Inactive, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Inactive, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Inactive, - QColorGroup::Button); + brush = pal.brush(TQPalette::Inactive, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Inactive, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Inactive, + TQColorGroup::Button, brush); // disabled - brush = pal.brush(QPalette::Disabled, - QColorGroup::Background); + brush = pal.brush(TQPalette::Disabled, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Disabled, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Disabled, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Disabled, - QColorGroup::Button); + brush = pal.brush(TQPalette::Disabled, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Disabled, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Disabled, + TQColorGroup::Button, brush); widget->setPalette(pal); } else @@ -2070,7 +2070,7 @@ void KLegacyStyle::polish(QWidget *widget) { } -void KLegacyStyle::polishPopupMenu(QPopupMenu *popup) { +void KLegacyStyle::polishPopupMenu(TQPopupMenu *popup) { KStyle::polishPopupMenu(popup); popup->setMouseTracking(true); @@ -2080,12 +2080,12 @@ void KLegacyStyle::polishPopupMenu(QPopupMenu *popup) { } -void KLegacyStyle::unPolish(QWidget *widget) { +void KLegacyStyle::unPolish(TQWidget *widget) { if (widget->inherits("KDesktop")) return; - widget->setBackgroundOrigin(QWidget::WidgetOrigin); - widget->setBackgroundPixmap(QPixmap()); + widget->setBackgroundOrigin(TQWidget::WidgetOrigin); + widget->setBackgroundPixmap(TQPixmap()); widget->removeEventFilter(this); widget->unsetPalette(); widget->setAutoMask(false); @@ -2093,7 +2093,7 @@ void KLegacyStyle::unPolish(QWidget *widget) { } -void KLegacyStyle::unPolish(QApplication *app) { +void KLegacyStyle::unPolish(TQApplication *app) { app->setFont(priv->oldfont, true); app->setPalette(priv->oldpalette, true); @@ -2103,16 +2103,16 @@ void KLegacyStyle::unPolish(QApplication *app) { } -void KLegacyStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h, const QColorGroup &g, - bool active, QMenuItem *mi, QBrush *) +void KLegacyStyle::drawKMenuItem(TQPainter *p, int x, int y, int w, int h, const TQColorGroup &g, + bool active, TQMenuItem *mi, TQBrush *) { - drawMenuBarItem(p, x, y, w, h, mi, (QColorGroup &) g, + drawMenuBarItem(p, x, y, w, h, mi, (TQColorGroup &) g, (mi) ? mi->isEnabled() : false, active); } -void KLegacyStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, QMenuItem *mi, - QColorGroup &g, bool enabled, bool active) +void KLegacyStyle::drawMenuBarItem(TQPainter *p, int x, int y, int w, int h, TQMenuItem *mi, + TQColorGroup &g, bool enabled, bool active) { if (enabled && active) { GtkObject *gobj = priv->gtkDict.find(&menuitem_ptr); @@ -2124,7 +2124,7 @@ void KLegacyStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, QMen key.data.state = KLegacy::Prelight; key.data.shadow = KLegacy::Out; - QPixmap *pix = gobj->draw(key, w, h, "menuitem"); + TQPixmap *pix = gobj->draw(key, w, h, "menuitem"); if (pix && ! pix->isNull()) p->drawPixmap(x, y, *pix); @@ -2136,18 +2136,18 @@ void KLegacyStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, QMen } -void KLegacyStyle::drawButton(QPainter *p, int x, int y , int w, int h, - const QColorGroup &g, bool sunken, const QBrush *fill) +void KLegacyStyle::drawButton(TQPainter *p, int x, int y , int w, int h, + const TQColorGroup &g, bool sunken, const TQBrush *fill) { drawBevelButton(p, x, y, w, h, g, sunken, fill); } -void KLegacyStyle::drawBevelButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup & g, bool sunken, - const QBrush *fill) +void KLegacyStyle::drawBevelButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup & g, bool sunken, + const TQBrush *fill) { - GtkObject *gobj = priv->gtkDict.find(QButton::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQButton::staticMetaObject()); if (! gobj) { KStyle::drawBevelButton(p, x, y, w, h, g, sunken, fill); @@ -2160,7 +2160,7 @@ void KLegacyStyle::drawBevelButton(QPainter *p, int x, int y, int w, int h, key.data.shadow = (sunken) ? KLegacy::In : KLegacy::Out; key.data.state = (sunken) ? KLegacy::Active : KLegacy::Normal; - QPixmap *pix = gobj->draw(key, w, h, "button"); + TQPixmap *pix = gobj->draw(key, w, h, "button"); if (pix && (! pix->isNull())) p->drawPixmap(x, y, *pix); @@ -2169,8 +2169,8 @@ void KLegacyStyle::drawBevelButton(QPainter *p, int x, int y, int w, int h, } -void KLegacyStyle::drawPushButton(QPushButton *btn, QPainter *p) { - GtkObject *gobj = priv->gtkDict.find(QPushButton::staticMetaObject()); +void KLegacyStyle::drawPushButton(TQPushButton *btn, TQPainter *p) { + GtkObject *gobj = priv->gtkDict.find(TQPushButton::staticMetaObject()); if (! gobj) { KStyle::drawPushButton(btn, p); @@ -2181,8 +2181,8 @@ void KLegacyStyle::drawPushButton(QPushButton *btn, QPainter *p) { key.cachekey = 0; key.data.function = KLegacy::Box; - QColorGroup g = btn->colorGroup(); - QBrush fill = g.brush(QColorGroup::Button); + TQColorGroup g = btn->colorGroup(); + TQBrush fill = g.brush(TQColorGroup::Button); int x1, y1, x2, y2; btn->rect().coords(&x1, &y1, &x2, &y2); @@ -2191,7 +2191,7 @@ void KLegacyStyle::drawPushButton(QPushButton *btn, QPainter *p) { key.data.state = (btn->isEnabled()) ? KLegacy::Normal : KLegacy::Insensitive; key.data.shadow = KLegacy::In; - QPixmap *pix = gobj->draw(key, x2 -x1 + 1, y2 - y1 + 1, "buttondefault"); + TQPixmap *pix = gobj->draw(key, x2 -x1 + 1, y2 - y1 + 1, "buttondefault"); if (! pix) pix = gobj->draw(key, x2 - x1 + 1, y2 - y1 + 1, "button"); @@ -2216,13 +2216,13 @@ void KLegacyStyle::drawPushButton(QPushButton *btn, QPainter *p) { key.data.shadow = KLegacy::In; } else { key.data.state = ((btn->isEnabled()) ? - ((static_cast<QWidget *>( btn ) == priv->lastWidget) ? KLegacy::Prelight : KLegacy::Normal) : + ((static_cast<TQWidget *>( btn ) == priv->lastWidget) ? KLegacy::Prelight : KLegacy::Normal) : KLegacy::Insensitive); key.data.shadow = ((btn->isOn() || btn->isDown()) ? KLegacy::In : KLegacy::Out); } - QPixmap *pix = gobj->draw(key, x2 - x1 + 1, y2 - y1 + 1, "button"); + TQPixmap *pix = gobj->draw(key, x2 - x1 + 1, y2 - y1 + 1, "button"); if (pix && ! pix->isNull()) p->drawPixmap(x1, y1, *pix); @@ -2233,11 +2233,11 @@ void KLegacyStyle::drawPushButton(QPushButton *btn, QPainter *p) { } -void KLegacyStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, int state, +void KLegacyStyle::drawIndicator(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, int state, bool down, bool enabled) { - GtkObject *gobj = priv->gtkDict.find(QCheckBox::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQCheckBox::staticMetaObject()); if (! gobj) { KStyle::drawIndicator(p, x, y, w, h, g, state, down, enabled); @@ -2248,9 +2248,9 @@ void KLegacyStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, key.cachekey = 0; key.data.function = KLegacy::Check; key.data.state = KLegacy::Normal; - key.data.shadow = ((state != QButton::Off) || down) ? KLegacy::In : KLegacy::Out; + key.data.shadow = ((state != TQButton::Off) || down) ? KLegacy::In : KLegacy::Out; - QPixmap *pix = gobj->draw(key, w, h, "checkbutton"); + TQPixmap *pix = gobj->draw(key, w, h, "checkbutton"); if (pix && (! pix->isNull())) p->drawPixmap(x, y, *pix); @@ -2259,8 +2259,8 @@ void KLegacyStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, } -void KLegacyStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, int state) { - GtkObject *gobj = priv->gtkDict.find(QCheckBox::staticMetaObject()); +void KLegacyStyle::drawIndicatorMask(TQPainter *p, int x, int y, int w, int h, int state) { + GtkObject *gobj = priv->gtkDict.find(TQCheckBox::staticMetaObject()); if (! gobj) { KStyle::drawIndicatorMask(p, x, y, w, h, state); @@ -2271,9 +2271,9 @@ void KLegacyStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, in key.cachekey = 0; key.data.function = KLegacy::Check; key.data.state = KLegacy::Normal; - key.data.shadow = (state != QButton::Off) ? KLegacy::In : KLegacy::Out; + key.data.shadow = (state != TQButton::Off) ? KLegacy::In : KLegacy::Out; - QPixmap *pix = gobj->draw(key, w, h, "checkbutton"); + TQPixmap *pix = gobj->draw(key, w, h, "checkbutton"); if (pix && pix->mask() && ! pix->mask()->isNull()) p->drawPixmap(x, y, *(pix->mask())); @@ -2282,8 +2282,8 @@ void KLegacyStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, in } -QSize KLegacyStyle::indicatorSize(void) const { - GtkObject *gobj = priv->gtkDict.find(QCheckBox::staticMetaObject()); +TQSize KLegacyStyle::indicatorSize(void) const { + GtkObject *gobj = priv->gtkDict.find(TQCheckBox::staticMetaObject()); if (! gobj) return KStyle::indicatorSize(); @@ -2295,7 +2295,7 @@ QSize KLegacyStyle::indicatorSize(void) const { if (! id) return KStyle::indicatorSize(); - QString filename; + TQString filename; if (! id->file.isNull()) filename = id->file; else if (! id->overlayFile.isNull()) @@ -2303,24 +2303,24 @@ QSize KLegacyStyle::indicatorSize(void) const { else return KStyle::indicatorSize(); - QImage *image = imageCache->find(filename); + TQImage *image = imageCache->find(filename); if (! image) { - image = new QImage(filename); + image = new TQImage(filename); if (! image) return KStyle::indicatorSize(); imageCache->insert(filename, image); } - return QSize(image->width(), image->height()); + return TQSize(image->width(), image->height()); } -void KLegacyStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool on, +void KLegacyStyle::drawExclusiveIndicator(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool on, bool down, bool enabled) { - GtkObject *gobj = priv->gtkDict.find(QRadioButton::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQRadioButton::staticMetaObject()); if (! gobj) { drawExclusiveIndicator(p, x, y, w, h, g, on, down, enabled); @@ -2333,7 +2333,7 @@ void KLegacyStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, int key.data.state = KLegacy::Normal; key.data.shadow = (on || down) ? KLegacy::In : KLegacy::Out; - QPixmap *pix = gobj->draw(key, w, h, "radiobutton"); + TQPixmap *pix = gobj->draw(key, w, h, "radiobutton"); if (pix && (! pix->isNull())) p->drawPixmap(x, y, *pix); @@ -2342,10 +2342,10 @@ void KLegacyStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, int } -void KLegacyStyle::drawExclusiveIndicatorMask(QPainter *p, int x, int y, int w, int h, +void KLegacyStyle::drawExclusiveIndicatorMask(TQPainter *p, int x, int y, int w, int h, bool on) { - GtkObject *gobj = priv->gtkDict.find(QRadioButton::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQRadioButton::staticMetaObject()); if (! gobj) { KStyle::drawExclusiveIndicatorMask(p, x, y, w, h, on); @@ -2358,7 +2358,7 @@ void KLegacyStyle::drawExclusiveIndicatorMask(QPainter *p, int x, int y, int w, key.data.state = KLegacy::Normal; key.data.shadow = (on) ? KLegacy::In : KLegacy::Out; - QPixmap *pix = gobj->draw(key, w, h, "radiobutton"); + TQPixmap *pix = gobj->draw(key, w, h, "radiobutton"); if (pix && pix->mask() && ! pix->mask()->isNull()) p->drawPixmap(x, y, *(pix->mask())); @@ -2367,8 +2367,8 @@ void KLegacyStyle::drawExclusiveIndicatorMask(QPainter *p, int x, int y, int w, } -QSize KLegacyStyle::exclusiveIndicatorSize(void) const { - GtkObject *gobj = priv->gtkDict.find(QRadioButton::staticMetaObject()); +TQSize KLegacyStyle::exclusiveIndicatorSize(void) const { + GtkObject *gobj = priv->gtkDict.find(TQRadioButton::staticMetaObject()); if (! gobj) { return KStyle::indicatorSize(); @@ -2382,7 +2382,7 @@ QSize KLegacyStyle::exclusiveIndicatorSize(void) const { if (! id) return KStyle::indicatorSize(); - QString filename; + TQString filename; if (! id->file.isNull()) { filename = id->file; } else if (! id->overlayFile.isNull()) { @@ -2391,9 +2391,9 @@ QSize KLegacyStyle::exclusiveIndicatorSize(void) const { return KStyle::indicatorSize(); } - QImage *image = imageCache->find(filename); + TQImage *image = imageCache->find(filename); if (! image) { - image = new QImage(filename); + image = new TQImage(filename); if (! image) { return KStyle::indicatorSize(); @@ -2402,16 +2402,16 @@ QSize KLegacyStyle::exclusiveIndicatorSize(void) const { imageCache->insert(filename, image); } - return QSize(image->width(), image->height()); + return TQSize(image->width(), image->height()); } -void KLegacyStyle::drawPopupMenuItem(QPainter *p, bool checkable, int maxpmw, int tab, - QMenuItem *mi, const QPalette &pal, bool act, +void KLegacyStyle::drawPopupMenuItem(TQPainter *p, bool checkable, int maxpmw, int tab, + TQMenuItem *mi, const TQPalette &pal, bool act, bool enabled, int x, int y, int w, int h) { - const QColorGroup & g = pal.active(); - QColorGroup itemg = (! enabled) ? pal.disabled() : pal.active(); + const TQColorGroup & g = pal.active(); + TQColorGroup itemg = (! enabled) ? pal.disabled() : pal.active(); if (checkable) maxpmw = QMAX(maxpmw, 15); @@ -2436,13 +2436,13 @@ void KLegacyStyle::drawPopupMenuItem(QPainter *p, bool checkable, int maxpmw, in key.data.state = KLegacy::Prelight; key.data.shadow = KLegacy::Out; - QPixmap *pix = gobj->draw(key, w, h, "menuitem"); + TQPixmap *pix = gobj->draw(key, w, h, "menuitem"); if (pix && ! pix->isNull()) p->drawPixmap(x, y, *pix); } } else - p->fillRect(x, y, w, h, g.brush( QColorGroup::Button )); + p->fillRect(x, y, w, h, g.brush( TQColorGroup::Button )); if ( !mi ) return; @@ -2450,26 +2450,26 @@ void KLegacyStyle::drawPopupMenuItem(QPainter *p, bool checkable, int maxpmw, in if ( mi->isChecked() ) { if ( mi->iconSet() ) { qDrawShadePanel( p, x+2, y+2, checkcol, h-2*2, - g, true, 1, &g.brush( QColorGroup::Midlight ) ); + g, true, 1, &g.brush( TQColorGroup::Midlight ) ); } } else if ( !act ) { p->fillRect(x+2, y+2, checkcol, h-2*2, - g.brush( QColorGroup::Button )); + g.brush( TQColorGroup::Button )); } if ( mi->iconSet() ) { // draw iconset - QIconSet::Mode mode = (enabled) ? QIconSet::Normal : QIconSet::Disabled; + TQIconSet::Mode mode = (enabled) ? TQIconSet::Normal : TQIconSet::Disabled; if (act && enabled) - mode = QIconSet::Active; + mode = TQIconSet::Active; - QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode); + TQPixmap pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode); int pixw = pixmap.width(); int pixh = pixmap.height(); - QRect cr( x + 2, y+2, checkcol, h-2*2 ); - QRect pmr( 0, 0, pixw, pixh ); + TQRect cr( x + 2, y+2, checkcol, h-2*2 ); + TQRect pmr( 0, 0, pixw, pixh ); pmr.moveCenter(cr.center()); @@ -2486,7 +2486,7 @@ void KLegacyStyle::drawPopupMenuItem(QPainter *p, bool checkable, int maxpmw, in p->setPen( g.buttonText() ); - QColor discol; + TQColor discol; if (! enabled) { discol = itemg.text(); p->setPen( discol ); @@ -2499,7 +2499,7 @@ void KLegacyStyle::drawPopupMenuItem(QPainter *p, bool checkable, int maxpmw, in p->restore(); } - QString s = mi->text(); + TQString s = mi->text(); if ( !s.isNull() ) { // draw text int t = s.find( '\t' ); int m = 2; @@ -2511,7 +2511,7 @@ void KLegacyStyle::drawPopupMenuItem(QPainter *p, bool checkable, int maxpmw, in p->drawText(x + checkcol + 4, y + 2, w - checkcol -tab - 3, h - 4, text_flags, s, t); } else if (mi->pixmap()) { - QPixmap *pixmap = mi->pixmap(); + TQPixmap *pixmap = mi->pixmap(); if (pixmap->depth() == 1) p->setBackgroundMode(OpaqueMode); p->drawPixmap(x + checkcol + 2, y + 2, *pixmap); @@ -2527,11 +2527,11 @@ void KLegacyStyle::drawPopupMenuItem(QPainter *p, bool checkable, int maxpmw, in } -void KLegacyStyle::drawComboButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, bool editable, - bool enabled, const QBrush *b) +void KLegacyStyle::drawComboButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, bool editable, + bool enabled, const TQBrush *b) { - GtkObject *gobj = priv->gtkDict.find(QComboBox::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQComboBox::staticMetaObject()); if (! gobj) { KStyle::drawComboButton(p, x, y, w, h, g, sunken, editable, enabled, b); @@ -2544,10 +2544,10 @@ void KLegacyStyle::drawComboButton(QPainter *p, int x, int y, int w, int h, key.data.state = KLegacy::Normal; key.data.shadow = KLegacy::Out; - if (priv->lastWidget && priv->lastWidget->inherits("QComboBox")) + if (priv->lastWidget && priv->lastWidget->inherits("TQComboBox")) key.data.state = KLegacy::Prelight; - QPixmap *pix = gobj->draw(key, w, h, "optionmenu"); + TQPixmap *pix = gobj->draw(key, w, h, "optionmenu"); if (pix && ! pix->isNull()) { p->drawPixmap(x, y, *pix); @@ -2556,7 +2556,7 @@ void KLegacyStyle::drawComboButton(QPainter *p, int x, int y, int w, int h, return; } - QRect rect = comboButtonRect(x, y, w, h); + TQRect rect = comboButtonRect(x, y, w, h); int tw = w - rect.width() - rect.right() - rect.left(); int th = rect.height(); @@ -2570,8 +2570,8 @@ void KLegacyStyle::drawComboButton(QPainter *p, int x, int y, int w, int h, } -QRect KLegacyStyle::comboButtonRect(int x, int y, int w, int h) { - GtkObject *gobj = priv->gtkDict.find(QComboBox::staticMetaObject()); +TQRect KLegacyStyle::comboButtonRect(int x, int y, int w, int h) { + GtkObject *gobj = priv->gtkDict.find(TQComboBox::staticMetaObject()); if (! gobj) { return KStyle::comboButtonRect(x, y, w, h); @@ -2586,32 +2586,32 @@ QRect KLegacyStyle::comboButtonRect(int x, int y, int w, int h) { return KStyle::comboButtonRect(x, y, w, h); } - return QRect(x + id->border.left() + 1, y + id->border.top() + 1, + return TQRect(x + id->border.left() + 1, y + id->border.top() + 1, w - id->border.left() - id->border.right() - 18, h - id->border.top() - id->border.bottom() - 2); } -QRect KLegacyStyle::comboButtonFocusRect(int x, int y, int w, int h) { +TQRect KLegacyStyle::comboButtonFocusRect(int x, int y, int w, int h) { return comboButtonRect(x, y, w, h); } -QStyle::ScrollControl KLegacyStyle::scrollBarPointOver(const QScrollBar *scrollbar, - int sliderStart, const QPoint &p) +TQStyle::ScrollControl KLegacyStyle::scrollBarPointOver(const TQScrollBar *scrollbar, + int sliderStart, const TQPoint &p) { - return QCommonStyle::scrollBarPointOver(scrollbar, sliderStart, p); + return TQCommonStyle::scrollBarPointOver(scrollbar, sliderStart, p); } -void KLegacyStyle::scrollBarMetrics(const QScrollBar *scrollbar, int &sliderMin, +void KLegacyStyle::scrollBarMetrics(const TQScrollBar *scrollbar, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim) { int maxLength; int b = defaultFrameWidth(); - int length = ((scrollbar->orientation() == QScrollBar::Horizontal) ? + int length = ((scrollbar->orientation() == TQScrollBar::Horizontal) ? scrollbar->width() : scrollbar->height()); - int extent = ((scrollbar->orientation() == QScrollBar::Horizontal) ? + int extent = ((scrollbar->orientation() == TQScrollBar::Horizontal) ? scrollbar->height() : scrollbar->width()); if (length > ((extent - (b * 2) - 1) * 2) + (b * 2)) @@ -2643,12 +2643,12 @@ void KLegacyStyle::scrollBarMetrics(const QScrollBar *scrollbar, int &sliderMin, } -void KLegacyStyle::drawScrollBarControls(QPainter *p, const QScrollBar *scrollbar, +void KLegacyStyle::drawScrollBarControls(TQPainter *p, const TQScrollBar *scrollbar, int start, uint controls, uint active) { if (! scrollbar->isVisible()) return; - GtkObject *gobj = priv->gtkDict.find(QScrollBar::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQScrollBar::staticMetaObject()); if (! gobj) { KStyle::drawScrollBarControls(p, scrollbar, start, controls, active); @@ -2674,7 +2674,7 @@ void KLegacyStyle::drawScrollBarControls(QPainter *p, const QScrollBar *scrollba scrollBarMetrics(scrollbar, sliderMin, sliderMax, sliderLen, buttonDim); // the rectangle for the slider - QRect slider( + TQRect slider( // x ((scrollbar->orientation() == Vertical) ? defaultFrameWidth() : start), @@ -2708,21 +2708,21 @@ void KLegacyStyle::drawScrollBarControls(QPainter *p, const QScrollBar *scrollba return; } - QPixmap *groove_pm = gobj->draw(groove_id, scrollbar->width(), scrollbar->height()); + TQPixmap *groove_pm = gobj->draw(groove_id, scrollbar->width(), scrollbar->height()); if ((! groove_pm) || (groove_pm->isNull())) { groove_pm = 0; } - QPixmap *slider_pm = gobj->draw(slider_id, slider.width(), slider.height()); + TQPixmap *slider_pm = gobj->draw(slider_id, slider.width(), slider.height()); if ((! slider_pm) || (slider_pm->isNull())) { slider_pm = 0; } - QPixmap buf(scrollbar->size()); + TQPixmap buf(scrollbar->size()); { - QPainter p2(&buf); + TQPainter p2(&buf); if (groove_pm) { p2.drawTiledPixmap(scrollbar->rect(), *groove_pm); @@ -2759,10 +2759,10 @@ void KLegacyStyle::drawScrollBarControls(QPainter *p, const QScrollBar *scrollba } -void KLegacyStyle::drawSlider(QPainter *p, int x, int y, int w, int h, const QColorGroup &g, +void KLegacyStyle::drawSlider(TQPainter *p, int x, int y, int w, int h, const TQColorGroup &g, Orientation orientation, bool tickAbove, bool tickBelow) { - GtkObject *gobj = priv->gtkDict.find(QSlider::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQSlider::staticMetaObject()); if (! gobj) { KStyle::drawSlider(p, x, y, w, h, g, orientation, tickAbove, tickBelow); @@ -2776,7 +2776,7 @@ void KLegacyStyle::drawSlider(QPainter *p, int x, int y, int w, int h, const QCo key.data.state = KLegacy::Normal; key.data.orientation = orientation + 1; - QPixmap *pix = gobj->draw(key, w, h, "slider"); + TQPixmap *pix = gobj->draw(key, w, h, "slider"); if (pix && ! pix->isNull()) p->drawPixmap(x, y, *pix); @@ -2786,10 +2786,10 @@ void KLegacyStyle::drawSlider(QPainter *p, int x, int y, int w, int h, const QCo -void KLegacyStyle::drawSliderGroove(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, QCOORD c, Orientation o) +void KLegacyStyle::drawSliderGroove(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, QCOORD c, Orientation o) { - GtkObject *gobj = priv->gtkDict.find(QSlider::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQSlider::staticMetaObject()); if (! gobj) { KStyle::drawSliderGroove(p, x, y, w, h, g, c, o); @@ -2803,7 +2803,7 @@ void KLegacyStyle::drawSliderGroove(QPainter *p, int x, int y, int w, int h, key.data.state = KLegacy::Active; key.data.orientation = o + 1; - QPixmap *pix = gobj->draw(key, w, h, "trough"); + TQPixmap *pix = gobj->draw(key, w, h, "trough"); if (pix && ! pix->isNull()) p->drawPixmap(x, y, *pix); @@ -2812,9 +2812,9 @@ void KLegacyStyle::drawSliderGroove(QPainter *p, int x, int y, int w, int h, } -void KLegacyStyle::drawArrow(QPainter *p, ArrowType type, bool down, +void KLegacyStyle::drawArrow(TQPainter *p, ArrowType type, bool down, int x, int y, int w, int h, - const QColorGroup &g, bool enabled, const QBrush *b) + const TQColorGroup &g, bool enabled, const TQBrush *b) { GtkObject *gobj = priv->gtkDict.find(&arrow_ptr); @@ -2831,11 +2831,11 @@ void KLegacyStyle::drawArrow(QPainter *p, ArrowType type, bool down, key.data.arrowDirection = type + 1; if ((! down) && priv->hovering && - QRect(x, y, w, h).contains(priv->mousePos)) { + TQRect(x, y, w, h).contains(priv->mousePos)) { key.data.state = KLegacy::Prelight; } - QPixmap *pix = gobj->draw(key, w, h, "arrow"); + TQPixmap *pix = gobj->draw(key, w, h, "arrow"); if (pix && ! pix->isNull()) p->drawPixmap(x, y, *pix); @@ -2844,9 +2844,9 @@ void KLegacyStyle::drawArrow(QPainter *p, ArrowType type, bool down, } -void KLegacyStyle::drawMenuArrow(QPainter *p, ArrowType type, bool down, +void KLegacyStyle::drawMenuArrow(TQPainter *p, ArrowType type, bool down, int x, int y, int w, int h, - const QColorGroup &g, bool enabled, const QBrush *b) + const TQColorGroup &g, bool enabled, const TQBrush *b) { GtkObject *gobj = priv->gtkDict.find(&menuitem_ptr); @@ -2862,7 +2862,7 @@ void KLegacyStyle::drawMenuArrow(QPainter *p, ArrowType type, bool down, key.data.shadow = (down) ? KLegacy::In : KLegacy::NoShadow; key.data.arrowDirection = type + 1; - QPixmap *pix = gobj->draw(key, w, h, "arrow"); + TQPixmap *pix = gobj->draw(key, w, h, "arrow"); if (pix && ! pix->isNull()) p->drawPixmap(x + ((w - pix->width()) / 2), @@ -2872,24 +2872,24 @@ void KLegacyStyle::drawMenuArrow(QPainter *p, ArrowType type, bool down, } -void KLegacyStyle::drawPanel(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, int, const QBrush *brush) +void KLegacyStyle::drawPanel(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, int, const TQBrush *brush) { KStyle::drawPanel(p, x, y, w, h, g, sunken, 1, brush); } -void KLegacyStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, int, const QBrush *fill) +void KLegacyStyle::drawPopupPanel(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, int, const TQBrush *fill) { - QBrush brush = (fill) ? *fill : g.brush(QColorGroup::Background); + TQBrush brush = (fill) ? *fill : g.brush(TQColorGroup::Background); p->fillRect(x, y, w, h, brush); } -void KLegacyStyle::drawCheckMark(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool activated, bool disabled) +void KLegacyStyle::drawCheckMark(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool activated, bool disabled) { GtkObject *gobj = priv->gtkDict.find(&checkmenuitem_ptr); @@ -2903,7 +2903,7 @@ void KLegacyStyle::drawCheckMark(QPainter *p, int x, int y, int w, int h, key.data.function = KLegacy::Check; key.data.shadow = (disabled) ? KLegacy::Out : KLegacy::In; - QPixmap *pix = gobj->draw(key, w, h); + TQPixmap *pix = gobj->draw(key, w, h); if (pix && (! pix->isNull())) { x += (w - pix->width()) / 2; @@ -2915,8 +2915,8 @@ void KLegacyStyle::drawCheckMark(QPainter *p, int x, int y, int w, int h, } -void KLegacyStyle::drawSplitter(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, Orientation orientation) +void KLegacyStyle::drawSplitter(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, Orientation orientation) { if (orientation == Horizontal) { int xpos = x + (w / 2); @@ -2925,7 +2925,7 @@ void KLegacyStyle::drawSplitter(QPainter *p, int x, int y, int w, int h, qDrawShadeLine(p, xpos, kpos + ksize - 1, xpos, h, g); drawBevelButton(p, xpos - (splitterWidth() / 2) + 1, kpos, ksize, ksize, - g, false, &g.brush(QColorGroup::Button)); + g, false, &g.brush(TQColorGroup::Button)); qDrawShadeLine(p, xpos, 0, xpos, kpos, g); } else { int ypos = y + (h / 2); @@ -2934,15 +2934,15 @@ void KLegacyStyle::drawSplitter(QPainter *p, int x, int y, int w, int h, qDrawShadeLine(p, 0, ypos, kpos, ypos, g); drawBevelButton(p, kpos, ypos - (splitterWidth() / 2) + 1, ksize, ksize, - g, false, &g.brush(QColorGroup::Button)); + g, false, &g.brush(TQColorGroup::Button)); qDrawShadeLine(p, kpos + ksize - 1, ypos, w, ypos, g); } } -void KLegacyStyle::drawTab(QPainter *p, const QTabBar *tabbar, QTab *tab, bool selected) +void KLegacyStyle::drawTab(TQPainter *p, const TQTabBar *tabbar, TQTab *tab, bool selected) { - GtkObject *gobj = priv->gtkDict.find(QTabBar::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQTabBar::staticMetaObject()); if (! gobj) { KStyle::drawTab(p, tabbar, tab, selected); @@ -2954,8 +2954,8 @@ void KLegacyStyle::drawTab(QPainter *p, const QTabBar *tabbar, QTab *tab, bool s key.data.function = KLegacy::Extension; key.data.state = (! selected) ? KLegacy::Active : KLegacy::Normal; key.data.shadow = KLegacy::Out; - key.data.gapSide = (tabbar->shape() == QTabBar::RoundedAbove || - tabbar->shape() == QTabBar::TriangularAbove) ? + key.data.gapSide = (tabbar->shape() == TQTabBar::RoundedAbove || + tabbar->shape() == TQTabBar::TriangularAbove) ? KLegacy::Bottom : KLegacy::Top; int ry = tab->r.top(), rh = tab->r.height(); @@ -2963,12 +2963,12 @@ void KLegacyStyle::drawTab(QPainter *p, const QTabBar *tabbar, QTab *tab, bool s if (! selected) { rh -= 2; - if (tabbar->shape() == QTabBar::RoundedAbove || - tabbar->shape() == QTabBar::TriangularAbove) + if (tabbar->shape() == TQTabBar::RoundedAbove || + tabbar->shape() == TQTabBar::TriangularAbove) ry += 2; } - QPixmap *pix = gobj->draw(key, tab->r.width(), rh, "tab"); + TQPixmap *pix = gobj->draw(key, tab->r.width(), rh, "tab"); if (pix && ! pix->isNull()) @@ -2978,10 +2978,10 @@ void KLegacyStyle::drawTab(QPainter *p, const QTabBar *tabbar, QTab *tab, bool s } -void KLegacyStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, KToolBarPos type, QBrush *fill) +void KLegacyStyle::drawKBarHandle(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, KToolBarPos type, TQBrush *fill) { - GtkObject *gobj = priv->gtkDict.find(QToolBar::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQToolBar::staticMetaObject()); if (! gobj) { KStyle::drawKBarHandle(p, x, y, w, h, g, type, fill); @@ -2996,37 +2996,37 @@ void KLegacyStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, key.data.orientation = (type == Left || type == Right) ? Vertical + 1: Horizontal + 1; - QPixmap *pix = gobj->draw(key, w, h, "handle"); + TQPixmap *pix = gobj->draw(key, w, h, "handle"); if (pix && ! pix->isNull()) p->drawPixmap(x, y, *pix); } -void KLegacyStyle::drawKickerHandle(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, QBrush *fill) +void KLegacyStyle::drawKickerHandle(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, TQBrush *fill) { drawKBarHandle(p, x, y, w, h, g, Left, fill); } -void KLegacyStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, QBrush *fill) +void KLegacyStyle::drawKickerAppletHandle(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, TQBrush *fill) { drawKBarHandle(p, x, y, w, h, g, Left, fill); } -void KLegacyStyle::drawKickerTaskButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, const QString &title, - bool active, QPixmap *icon, QBrush *fill) +void KLegacyStyle::drawKickerTaskButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, const TQString &title, + bool active, TQPixmap *icon, TQBrush *fill) { drawBevelButton(p, x, y, w, h, g, active, fill); const int pxWidth = 20; int textPos = pxWidth; - QRect br(buttonRect(x, y, w, h)); + TQRect br(buttonRect(x, y, w, h)); if (active) p->translate(1,1); @@ -3038,17 +3038,17 @@ void KLegacyStyle::drawKickerTaskButton(QPainter *p, int x, int y, int w, int h, p->drawPixmap(br.x() + dx, dy, *icon); } - QString s(title); + TQString s(title); - static const QString &modStr = KGlobal::staticQString( - QString::fromUtf8("[") + i18n("modified") + QString::fromUtf8("]")); + static const TQString &modStr = KGlobal::staticQString( + TQString::fromUtf8("[") + i18n("modified") + TQString::fromUtf8("]")); int modStrPos = s.find(modStr); if (modStrPos != -1) { s.remove(modStrPos, modStr.length()+1); - QPixmap modPixmap = SmallIcon("modified"); + TQPixmap modPixmap = SmallIcon("modified"); int dx = (pxWidth - modPixmap.width()) / 2; int dy = (h - modPixmap.height()) / 2; @@ -3075,14 +3075,14 @@ void KLegacyStyle::drawKickerTaskButton(QPainter *p, int x, int y, int w, int h, } -bool KLegacyStyle::eventFilter(QObject *obj, QEvent *e) { +bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) { switch (e->type()) { - case QEvent::Resize: + case TQEvent::Resize: { - QWidget *w = (QWidget *) obj; + TQWidget *w = (TQWidget *) obj; - if (w->inherits("QPopupMenu") && w->width() < 700) { - GtkObject *gobj = priv->gtkDict.find(QPopupMenu::staticMetaObject()); + if (w->inherits("TQPopupMenu") && w->width() < 700) { + GtkObject *gobj = priv->gtkDict.find(TQPopupMenu::staticMetaObject()); if (gobj) { KLegacyImageDataKey key; @@ -3091,68 +3091,68 @@ bool KLegacyStyle::eventFilter(QObject *obj, QEvent *e) { key.data.state = KLegacy::Normal; key.data.shadow = KLegacy::Out; - QPixmap *pix = gobj->draw(key, w->width(), w->height(), "menu"); + TQPixmap *pix = gobj->draw(key, w->width(), w->height(), "menu"); if (pix && ! pix->isNull()) { - QPalette pal = w->palette(); + TQPalette pal = w->palette(); // active - QBrush brush = pal.brush(QPalette::Active, - QColorGroup::Background); + TQBrush brush = pal.brush(TQPalette::Active, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Active, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Active, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Active, - QColorGroup::Button); + brush = pal.brush(TQPalette::Active, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Active, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Active, + TQColorGroup::Button, brush); // inactive - brush = pal.brush(QPalette::Inactive, - QColorGroup::Background); + brush = pal.brush(TQPalette::Inactive, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Inactive, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Inactive, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Inactive, - QColorGroup::Button); + brush = pal.brush(TQPalette::Inactive, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Inactive, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Inactive, + TQColorGroup::Button, brush); // disabled - brush = pal.brush(QPalette::Disabled, - QColorGroup::Background); + brush = pal.brush(TQPalette::Disabled, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Disabled, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Disabled, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Disabled, - QColorGroup::Button); + brush = pal.brush(TQPalette::Disabled, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Disabled, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Disabled, + TQColorGroup::Button, brush); w->setPalette(pal); } } } else if (w->isTopLevel() || w->inherits("QWorkspaceChild")) { - GtkObject *gobj = priv->gtkDict.find(QMainWindow::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQMainWindow::staticMetaObject()); if (gobj) { KLegacyImageDataKey key; key.cachekey = 0; key.data.function = KLegacy::FlatBox; - QPixmap *p = gobj->draw(key, w->width(), w->height(), "base"); + TQPixmap *p = gobj->draw(key, w->width(), w->height(), "base"); if (p && (! p->isNull())) w->setBackgroundPixmap(*p); } - } else if (w->inherits("QLineEdit")) { - GtkObject *gobj = priv->gtkDict.find(QLineEdit::staticMetaObject()); + } else if (w->inherits("TQLineEdit")) { + GtkObject *gobj = priv->gtkDict.find(TQLineEdit::staticMetaObject()); if (gobj) { KLegacyImageDataKey key; @@ -3161,39 +3161,39 @@ bool KLegacyStyle::eventFilter(QObject *obj, QEvent *e) { key.data.shadow = KLegacy::NoShadow; key.data.state = (w->isEnabled()) ? KLegacy::Normal : KLegacy::Insensitive; - QPixmap *pix = gobj->draw(key, w->width(), w->height(), + TQPixmap *pix = gobj->draw(key, w->width(), w->height(), "entry_bg"); if (pix && (! pix->isNull())) { - QPalette pal = w->palette(); + TQPalette pal = w->palette(); // active - QBrush brush = pal.brush(QPalette::Active, - QColorGroup::Base); + TQBrush brush = pal.brush(TQPalette::Active, + TQColorGroup::Base); brush.setPixmap(*pix); - pal.setBrush(QPalette::Active, - QColorGroup::Base, brush); + pal.setBrush(TQPalette::Active, + TQColorGroup::Base, brush); // inactive - brush = pal.brush(QPalette::Inactive, - QColorGroup::Base); + brush = pal.brush(TQPalette::Inactive, + TQColorGroup::Base); brush.setPixmap(*pix); - pal.setBrush(QPalette::Inactive, - QColorGroup::Base, brush); + pal.setBrush(TQPalette::Inactive, + TQColorGroup::Base, brush); // disabled - brush = pal.brush(QPalette::Disabled, - QColorGroup::Base); + brush = pal.brush(TQPalette::Disabled, + TQColorGroup::Base); brush.setPixmap(*pix); - pal.setBrush(QPalette::Disabled, - QColorGroup::Base, brush); + pal.setBrush(TQPalette::Disabled, + TQColorGroup::Base, brush); w->setPalette(pal); } } - } else if (w->inherits("QMenuBar") || - w->inherits("QToolBar")) { - GtkObject *gobj = priv->gtkDict.find(QMenuBar::staticMetaObject()); + } else if (w->inherits("TQMenuBar") || + w->inherits("TQToolBar")) { + GtkObject *gobj = priv->gtkDict.find(TQMenuBar::staticMetaObject()); if (gobj) { KLegacyImageDataKey key; @@ -3202,49 +3202,49 @@ bool KLegacyStyle::eventFilter(QObject *obj, QEvent *e) { key.data.state = KLegacy::Normal; key.data.shadow = KLegacy::Out; - QPixmap *pix = gobj->draw(key, w->width(), w->height(), + TQPixmap *pix = gobj->draw(key, w->width(), w->height(), "menubar"); if (pix && (! pix->isNull())) { - QPalette pal = w->palette(); + TQPalette pal = w->palette(); // active - QBrush brush = pal.brush(QPalette::Active, - QColorGroup::Background); + TQBrush brush = pal.brush(TQPalette::Active, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Active, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Active, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Active, - QColorGroup::Button); + brush = pal.brush(TQPalette::Active, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Active, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Active, + TQColorGroup::Button, brush); // inactive - brush = pal.brush(QPalette::Inactive, - QColorGroup::Background); + brush = pal.brush(TQPalette::Inactive, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Inactive, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Inactive, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Inactive, - QColorGroup::Button); + brush = pal.brush(TQPalette::Inactive, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Inactive, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Inactive, + TQColorGroup::Button, brush); // disabled - brush = pal.brush(QPalette::Disabled, - QColorGroup::Background); + brush = pal.brush(TQPalette::Disabled, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Disabled, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Disabled, + TQColorGroup::Background, brush); - brush = pal.brush(QPalette::Disabled, - QColorGroup::Button); + brush = pal.brush(TQPalette::Disabled, + TQColorGroup::Button); brush.setPixmap(*pix); - pal.setBrush(QPalette::Disabled, - QColorGroup::Button, brush); + pal.setBrush(TQPalette::Disabled, + TQColorGroup::Button, brush); w->setPalette(pal); } @@ -3254,67 +3254,67 @@ bool KLegacyStyle::eventFilter(QObject *obj, QEvent *e) { break; } - case QEvent::Enter: + case TQEvent::Enter: { - if (obj->inherits("QPushButton") || - obj->inherits("QComboBox") || - obj->inherits("QSlider") || + if (obj->inherits("TQPushButton") || + obj->inherits("TQComboBox") || + obj->inherits("TQSlider") || obj->inherits("QScrollbar")) { - priv->lastWidget = (QWidget *) obj; + priv->lastWidget = (TQWidget *) obj; priv->lastWidget->repaint(false); - } else if (obj->inherits("QRadioButton")) { - QWidget *w = (QWidget *) obj; + } else if (obj->inherits("TQRadioButton")) { + TQWidget *w = (TQWidget *) obj; if (! w->isTopLevel() && w->isEnabled()) { - GtkObject *gobj = priv->gtkDict.find(QRadioButton::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQRadioButton::staticMetaObject()); if (gobj) { KLegacyImageDataKey key; key.cachekey = 0; key.data.function = KLegacy::FlatBox; - QPixmap *pix = gobj->draw(key, w->width(), w->height()); + TQPixmap *pix = gobj->draw(key, w->width(), w->height()); if (pix && (! pix->isNull())) { - QPalette pal = w->palette(); - QBrush brush = pal.brush(QPalette::Normal, - QColorGroup::Background); + TQPalette pal = w->palette(); + TQBrush brush = pal.brush(TQPalette::Normal, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Normal, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Normal, + TQColorGroup::Background, brush); w->setPalette(pal); - w->setBackgroundMode(QWidget::PaletteBackground); - w->setBackgroundOrigin(QWidget::WidgetOrigin); + w->setBackgroundMode(TQWidget::PaletteBackground); + w->setBackgroundOrigin(TQWidget::WidgetOrigin); } } } - } else if (obj->inherits("QCheckBox")) { - QWidget *w = (QWidget *) obj; + } else if (obj->inherits("TQCheckBox")) { + TQWidget *w = (TQWidget *) obj; if (! w->isTopLevel() && w->isEnabled()) { - GtkObject *gobj = priv->gtkDict.find(QCheckBox::staticMetaObject()); + GtkObject *gobj = priv->gtkDict.find(TQCheckBox::staticMetaObject()); if (gobj) { KLegacyImageDataKey key; key.cachekey = 0; key.data.function = KLegacy::FlatBox; - QPixmap *pix = gobj->draw(key, w->width(), w->height()); + TQPixmap *pix = gobj->draw(key, w->width(), w->height()); if (pix && (! pix->isNull())) { - QPalette pal = w->palette(); - QBrush brush = pal.brush(QPalette::Normal, - QColorGroup::Background); + TQPalette pal = w->palette(); + TQBrush brush = pal.brush(TQPalette::Normal, + TQColorGroup::Background); brush.setPixmap(*pix); - pal.setBrush(QPalette::Normal, - QColorGroup::Background, brush); + pal.setBrush(TQPalette::Normal, + TQColorGroup::Background, brush); w->setPalette(pal); - w->setBackgroundMode(QWidget::PaletteBackground); - w->setBackgroundOrigin(QWidget::WidgetOrigin); + w->setBackgroundMode(TQWidget::PaletteBackground); + w->setBackgroundOrigin(TQWidget::WidgetOrigin); } } } @@ -3323,18 +3323,18 @@ bool KLegacyStyle::eventFilter(QObject *obj, QEvent *e) { break; } - case QEvent::Leave: + case TQEvent::Leave: { if (obj == priv->lastWidget) { priv->lastWidget = 0; - ((QWidget *) obj)->repaint(false); - } else if (obj->inherits("QRadioButton") || - obj->inherits("QCheckBox")) { - QWidget *w = (QWidget *) obj; + ((TQWidget *) obj)->repaint(false); + } else if (obj->inherits("TQRadioButton") || + obj->inherits("TQCheckBox")) { + TQWidget *w = (TQWidget *) obj; if (! w->isTopLevel()) { - w->setBackgroundMode(QWidget::X11ParentRelative); - w->setBackgroundOrigin(QWidget::WidgetOrigin); + w->setBackgroundMode(TQWidget::X11ParentRelative); + w->setBackgroundOrigin(TQWidget::WidgetOrigin); w->repaint(true); } } @@ -3342,14 +3342,14 @@ bool KLegacyStyle::eventFilter(QObject *obj, QEvent *e) { break; } - case QEvent::MouseMove: + case TQEvent::MouseMove: { - QMouseEvent *me = (QMouseEvent *) e; + TQMouseEvent *me = (TQMouseEvent *) e; priv->mousePos = me->pos(); - if (obj->inherits("QScrollBar") && + if (obj->inherits("TQScrollBar") && (! (me->state() & (LeftButton | MidButton | RightButton)))) { priv->hovering = true; - ((QWidget *) obj)->repaint(false); + ((TQWidget *) obj)->repaint(false); priv->hovering = false; } diff --git a/kstyles/klegacy/klegacystyle.h b/kstyles/klegacy/klegacystyle.h index c38e7ac80..ebe08e8db 100644 --- a/kstyles/klegacy/klegacystyle.h +++ b/kstyles/klegacy/klegacystyle.h @@ -39,99 +39,99 @@ public: virtual int defaultFrameWidth() const; - virtual void polish(QApplication *); - virtual void polish(QWidget *); - virtual void polishPopupMenu(QPopupMenu *); - virtual void unPolish(QWidget *); - virtual void unPolish(QApplication *); + virtual void polish(TQApplication *); + virtual void polish(TQWidget *); + virtual void polishPopupMenu(TQPopupMenu *); + virtual void unPolish(TQWidget *); + virtual void unPolish(TQApplication *); // combo box - virtual void drawComboButton(QPainter *, int, int, int, int, const QColorGroup &, + virtual void drawComboButton(TQPainter *, int, int, int, int, const TQColorGroup &, bool = false, bool = false, bool = true, - const QBrush * = 0); - virtual QRect comboButtonRect(int, int, int, int); - virtual QRect comboButtonFocusRect(int, int, int, int); + const TQBrush * = 0); + virtual TQRect comboButtonRect(int, int, int, int); + virtual TQRect comboButtonFocusRect(int, int, int, int); // menubar items - virtual void drawMenuBarItem(QPainter *, int, int, int, int, QMenuItem *, - QColorGroup &, bool, bool); - virtual void drawKMenuItem(QPainter *, int, int, int, int, const QColorGroup &, bool, - QMenuItem *, QBrush * = 0); + virtual void drawMenuBarItem(TQPainter *, int, int, int, int, TQMenuItem *, + TQColorGroup &, bool, bool); + virtual void drawKMenuItem(TQPainter *, int, int, int, int, const TQColorGroup &, bool, + TQMenuItem *, TQBrush * = 0); // toolbar stuffs - virtual void drawKBarHandle(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, KToolBarPos type, QBrush *fill = 0); - virtual void drawKickerHandle(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, QBrush *fill = 0); - virtual void drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, QBrush *fill = 0); - virtual void drawKickerTaskButton(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, const QString &title, bool active, - QPixmap *icon = 0, QBrush *fill = 0); + virtual void drawKBarHandle(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, KToolBarPos type, TQBrush *fill = 0); + virtual void drawKickerHandle(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, TQBrush *fill = 0); + virtual void drawKickerAppletHandle(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, TQBrush *fill = 0); + virtual void drawKickerTaskButton(TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, const TQString &title, bool active, + TQPixmap *icon = 0, TQBrush *fill = 0); // arrows - virtual void drawArrow(QPainter *, ArrowType, bool, int, int, int, int, - const QColorGroup &, bool, const QBrush * = 0); + virtual void drawArrow(TQPainter *, ArrowType, bool, int, int, int, int, + const TQColorGroup &, bool, const TQBrush * = 0); // button stuffs - virtual void drawButton(QPainter *, int, int, int, int, const QColorGroup &g, - bool = false, const QBrush * = 0); - virtual void drawPushButton(QPushButton *, QPainter *); - virtual void drawBevelButton(QPainter *, int, int, int, int, - const QColorGroup &, bool = false, - const QBrush * = 0); - - // indicators (QCheckBox) - virtual void drawCheckMark(QPainter *, int, int, int, int, const QColorGroup &, + virtual void drawButton(TQPainter *, int, int, int, int, const TQColorGroup &g, + bool = false, const TQBrush * = 0); + virtual void drawPushButton(TQPushButton *, TQPainter *); + virtual void drawBevelButton(TQPainter *, int, int, int, int, + const TQColorGroup &, bool = false, + const TQBrush * = 0); + + // indicators (TQCheckBox) + virtual void drawCheckMark(TQPainter *, int, int, int, int, const TQColorGroup &, bool = false, bool = true); - virtual void drawIndicator(QPainter *, int, int, int, int, const QColorGroup &, + virtual void drawIndicator(TQPainter *, int, int, int, int, const TQColorGroup &, int, bool = false, bool = true); - virtual void drawIndicatorMask(QPainter *, int, int, int, int, int); - virtual QSize indicatorSize(void) const; + virtual void drawIndicatorMask(TQPainter *, int, int, int, int, int); + virtual TQSize indicatorSize(void) const; - // exclusive indicators (QRadioButton) - virtual void drawExclusiveIndicator(QPainter *, int, int, int, int, - const QColorGroup &, bool, bool = false, + // exclusive indicators (TQRadioButton) + virtual void drawExclusiveIndicator(TQPainter *, int, int, int, int, + const TQColorGroup &, bool, bool = false, bool = true); - virtual void drawExclusiveIndicatorMask(QPainter *, int, int, int, int, bool); - virtual QSize exclusiveIndicatorSize(void) const; + virtual void drawExclusiveIndicatorMask(TQPainter *, int, int, int, int, bool); + virtual TQSize exclusiveIndicatorSize(void) const; // popup menus - virtual void drawPopupPanel(QPainter *, int, int, int, int, const QColorGroup &, - int = 2, const QBrush * = 0); - virtual void drawPopupMenuItem(QPainter *, bool, int, int, QMenuItem *, - const QPalette &, bool, bool, int, int, int, int); + virtual void drawPopupPanel(TQPainter *, int, int, int, int, const TQColorGroup &, + int = 2, const TQBrush * = 0); + virtual void drawPopupMenuItem(TQPainter *, bool, int, int, TQMenuItem *, + const TQPalette &, bool, bool, int, int, int, int); // scrollbars - virtual ScrollControl scrollBarPointOver(const QScrollBar *, int, const QPoint &); - virtual void scrollBarMetrics(const QScrollBar *, int &, int &, int &, int &); - virtual void drawScrollBarControls(QPainter *, const QScrollBar *, + virtual ScrollControl scrollBarPointOver(const TQScrollBar *, int, const TQPoint &); + virtual void scrollBarMetrics(const TQScrollBar *, int &, int &, int &, int &); + virtual void drawScrollBarControls(TQPainter *, const TQScrollBar *, int, uint, uint); // sliders - virtual void drawSlider(QPainter *, int , int , int , int , - const QColorGroup &, Orientation, bool, bool); - virtual void drawSliderGroove(QPainter *, int, int, int, int, const QColorGroup &, + virtual void drawSlider(TQPainter *, int , int , int , int , + const TQColorGroup &, Orientation, bool, bool); + virtual void drawSliderGroove(TQPainter *, int, int, int, int, const TQColorGroup &, QCOORD, Orientation); // panel - virtual void drawPanel(QPainter *, int, int, int, int, const QColorGroup &, - bool = false, int = 1, const QBrush * = 0); + virtual void drawPanel(TQPainter *, int, int, int, int, const TQColorGroup &, + bool = false, int = 1, const TQBrush * = 0); // splitters - virtual void drawSplitter(QPainter *, int, int, int, int, - const QColorGroup &, Orientation); + virtual void drawSplitter(TQPainter *, int, int, int, int, + const TQColorGroup &, Orientation); // tabs - virtual void drawTab(QPainter *, const QTabBar *, QTab *, bool); + virtual void drawTab(TQPainter *, const TQTabBar *, TQTab *, bool); protected: - bool eventFilter(QObject *, QEvent *); + bool eventFilter(TQObject *, TQEvent *); - void drawMenuArrow(QPainter *, ArrowType, bool, int, int, int, int, - const QColorGroup &, bool, const QBrush * = 0); + void drawMenuArrow(TQPainter *, ArrowType, bool, int, int, int, int, + const TQColorGroup &, bool, const TQBrush * = 0); private: diff --git a/kstyles/kthemestyle/kstyledirs.cpp b/kstyles/kthemestyle/kstyledirs.cpp index b77d4d56b..7e548d0d5 100644 --- a/kstyles/kthemestyle/kstyledirs.cpp +++ b/kstyles/kthemestyle/kstyledirs.cpp @@ -1,7 +1,7 @@ /* $Id$ - Simple helper routines for style's use of KStandardDirs with QSettings, etc. + Simple helper routines for style's use of KStandardDirs with TQSettings, etc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -21,7 +21,7 @@ This file is part of the KDE libraries */ -#include <qfile.h> +#include <tqfile.h> #include <kstandarddirs.h> #include "kstyledirs.h" @@ -37,12 +37,12 @@ KStyleDirs::~KStyleDirs() { } -void KStyleDirs::addToSearch( const char* type, QSettings& s ) const +void KStyleDirs::addToSearch( const char* type, TQSettings& s ) const { - const QStringList & dirs = resourceDirs(type); + const TQStringList & dirs = resourceDirs(type); for ( int c = dirs.size()-1; c >= 0 ; c-- ) { - s.insertSearchPath( QSettings::Unix, dirs[ c ]); + s.insertSearchPath( TQSettings::Unix, dirs[ c ]); } } diff --git a/kstyles/kthemestyle/kstyledirs.h b/kstyles/kthemestyle/kstyledirs.h index b23457a07..9d2635136 100644 --- a/kstyles/kthemestyle/kstyledirs.h +++ b/kstyles/kthemestyle/kstyledirs.h @@ -23,8 +23,8 @@ #define KSTYLE_DIRS_H -#include <qsettings.h> -#include <qstringlist.h> +#include <tqsettings.h> +#include <tqstringlist.h> #include <kstandarddirs.h> /** @@ -34,7 +34,7 @@ * @version $Id$ * * This class provides a this wrapper for styles around KStandardDirs, -* permitting integration with QSettings and easy loading of pixmaps +* permitting integration with TQSettings and easy loading of pixmaps * * It add share/apps/kstyle/themes as "themerc", * share/apps/kstyle/pixmaps "themepixmap" @@ -59,13 +59,13 @@ public: Adds all of KDE directories of type type to the seach path of q. For example, when one does the following: - QSettings settings; + TQSettings settings; KStyleDirs dirs; dirs.addToSearch("config",settings); The one can do settings.readEntry("kstyle/KDE/WidgetStyle") to access a settings in kstylerc. */ - void addToSearch( const char* type, QSettings& q) const; //Better name? + void addToSearch( const char* type, TQSettings& q) const; //Better name? protected: static KStyleDirs* instance; diff --git a/kstyles/kthemestyle/kthemebase.cpp b/kstyles/kthemestyle/kthemebase.cpp index bd463e28e..eb8bcc615 100644 --- a/kstyles/kthemestyle/kthemebase.cpp +++ b/kstyles/kthemestyle/kthemebase.cpp @@ -41,18 +41,18 @@ #include "kthemebase.h" #include <kpixmapeffect.h> -#include <qimage.h> -#include <qpainter.h> -#include <qbitmap.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <stdlib.h> -#include <qsettings.h> -#include <qapplication.h> -#include <qscrollbar.h> +#include <tqsettings.h> +#include <tqapplication.h> +#include <tqscrollbar.h> -typedef QMap<QString, QString> Prop; +typedef TQMap<TQString, TQString> Prop; -template class QIntCache<KThemePixmap> +template class TQIntCache<KThemePixmap> ; /* @@ -61,13 +61,13 @@ Can't delete old slider image when calculating the rotated one for some reason. */ //Shamelessly stolen from KConfigBase -static QColor readColorEntry( QSettings* s, const char *pKey, - const QColor* pDefault ) +static TQColor readColorEntry( TQSettings* s, const char *pKey, + const TQColor* pDefault ) { - QColor aRetColor; + TQColor aRetColor; int nRed = 0, nGreen = 0, nBlue = 0; - QString aValue = s->readEntry( pKey ); + TQString aValue = s->readEntry( pKey ); if ( !aValue.isEmpty() ) { if ( aValue.at( 0 ) == '#' ) @@ -156,36 +156,36 @@ public: /** * Colors to override defaults with.. */ - QColor overrideForegroundCol; - QColor overrideBackgroundCol; - QColor overrideSelectForegroundCol; - QColor overrideSelectBackgroundCol; - QColor overrideWindowForegroundCol; - QColor overrideWindowBackgroundCol; + TQColor overrideForegroundCol; + TQColor overrideBackgroundCol; + TQColor overrideSelectForegroundCol; + TQColor overrideSelectBackgroundCol; + TQColor overrideWindowForegroundCol; + TQColor overrideWindowBackgroundCol; int contrast; - QMap <QString, QMap<QString, QString> > props; + TQMap <TQString, TQMap<TQString, TQString> > props; - QMap<const QPixmap*, QColor> colorCache; + TQMap<const TQPixmap*, TQColor> colorCache; /* A heuristic routine that tries to determine the avergae color of the image Wouldn't work for things like sliders, etc. */ - QColor pixmapAveColor( const QPixmap* p ) + TQColor pixmapAveColor( const TQPixmap* p ) { if ( colorCache.contains( p ) ) return colorCache[ p ]; - QImage to_ave = p->convertToImage(); + TQImage to_ave = p->convertToImage(); double h = 0, s = 0, v = 0; int count = 0; int dh, ds, dv; for ( int x = 0; x < p->width(); x++ ) { - QColor pix( to_ave.pixel( x, p->height() / 2 ) ); + TQColor pix( to_ave.pixel( x, p->height() / 2 ) ); pix.hsv( &dh, &ds, &dv ); h += dh; s += ds; @@ -195,14 +195,14 @@ public: for ( int y = 0; y < p->height(); y++ ) { - QColor pix( to_ave.pixel( p->width() / 2, y ) ); + TQColor pix( to_ave.pixel( p->width() / 2, y ) ); pix.hsv( &dh, &ds, &dv ); h += dh; s += ds; v += dv; count++; } - colorCache[ p ] = QColor( int( h / count + 0.5 ), int( s / count + 0.5 ), int( v / count + 0.5 ), QColor::Hsv ); + colorCache[ p ] = TQColor( int( h / count + 0.5 ), int( s / count + 0.5 ), int( v / count + 0.5 ), TQColor::Hsv ); return colorCache[ p ]; } }; @@ -237,9 +237,9 @@ void KThemeBase::generateBorderPix( int i ) if ( pbPixmaps[ i ] ) { // evidently I have to do masks manually... - const QBitmap * srcMask = pbPixmaps[ i ] ->mask(); - QBitmap destMask( pbWidth[ i ], pbWidth[ i ] ); - QPixmap tmp( pbWidth[ i ], pbWidth[ i ] ); + const TQBitmap * srcMask = pbPixmaps[ i ] ->mask(); + TQBitmap destMask( pbWidth[ i ], pbWidth[ i ] ); + TQPixmap tmp( pbWidth[ i ], pbWidth[ i ] ); bitBlt( &tmp, 0, 0, pbPixmaps[ i ], 0, 0, pbWidth[ i ], pbWidth[ i ], Qt::CopyROP, false ); @@ -338,8 +338,8 @@ void KThemeBase::generateBorderPix( int i ) } -void KThemeBase::copyWidgetConfig( int sourceID, int destID, QString *pixnames, - QString *brdnames ) +void KThemeBase::copyWidgetConfig( int sourceID, int destID, TQString *pixnames, + TQString *brdnames ) { scaleHints[ destID ] = scaleHints[ sourceID ]; gradients[ destID ] = gradients[ sourceID ]; @@ -349,17 +349,17 @@ void KThemeBase::copyWidgetConfig( int sourceID, int destID, QString *pixnames, highlights[ destID ] = highlights[ sourceID ]; if ( grLowColors[ sourceID ] ) - grLowColors[ destID ] = new QColor( *grLowColors[ sourceID ] ); + grLowColors[ destID ] = new TQColor( *grLowColors[ sourceID ] ); else grLowColors[ destID ] = NULL; if ( grHighColors[ sourceID ] ) - grHighColors[ destID ] = new QColor( *grHighColors[ sourceID ] ); + grHighColors[ destID ] = new TQColor( *grHighColors[ sourceID ] ); else grHighColors[ destID ] = NULL; if ( colors[ sourceID ] ) - colors[ destID ] = new QColorGroup( *colors[ sourceID ] ); + colors[ destID ] = new TQColorGroup( *colors[ sourceID ] ); else colors[ destID ] = NULL; @@ -413,17 +413,17 @@ void KThemeBase::readConfig( Qt::GUIStyle /*style*/ ) }; int i; - QString tmpStr; - QString pixnames[ WIDGETS ]; // used for duplicate check - QString brdnames[ WIDGETS ]; + TQString tmpStr; + TQString pixnames[ WIDGETS ]; // used for duplicate check + TQString brdnames[ WIDGETS ]; bool loaded[ WIDGETS ]; // used for preloading for CopyWidget - QSettings config; + TQSettings config; if (configDirName.isEmpty() || configDirName == ".") { KStyleDirs::dirs()->addToSearch( "themerc", config ); } - else config.insertSearchPath( QSettings::Unix, configDirName ); + else config.insertSearchPath( TQSettings::Unix, configDirName ); applyConfigFile( config ); @@ -442,7 +442,7 @@ void KThemeBase::readConfig( Qt::GUIStyle /*style*/ ) else { Prop& copyProp = d->props[ widgetEntries[ i ] ]; - copyProp[ "CopyWidget" ] = QString( widgetEntries[ i - INHERIT_ITEMS ] ); + copyProp[ "CopyWidget" ] = TQString( widgetEntries[ i - INHERIT_ITEMS ] ); } #endif @@ -473,20 +473,20 @@ void KThemeBase::readConfig( Qt::GUIStyle /*style*/ ) if ( pixmaps[ RotSliderGroove ] ) { - QWMatrix r270; //TODO: 90 if reverse? + TQWMatrix r270; //TODO: 90 if reverse? r270.rotate( 270 ); KThemePixmap* bf = new KThemePixmap( pixmaps[ RotSliderGroove ], pixmaps[ RotSliderGroove ] ->xForm( r270 ) ); // pixmaps[ RotSliderGroove ] = bf; if ( images[ RotSliderGroove ] ) { delete images[ RotSliderGroove ]; - images[ RotSliderGroove ] = new QImage( bf->convertToImage() ); + images[ RotSliderGroove ] = new TQImage( bf->convertToImage() ); } } if ( pixmaps[ RotActiveTab ] ) { - QWMatrix r180; + TQWMatrix r180; r180.rotate( 180 ); KThemePixmap* bf = new KThemePixmap( pixmaps[ RotActiveTab ], pixmaps[ RotActiveTab ] ->xForm( r180 ) ); @@ -494,13 +494,13 @@ void KThemeBase::readConfig( Qt::GUIStyle /*style*/ ) if ( images[ RotActiveTab ] ) { delete images[ RotActiveTab ]; - images[ RotActiveTab ] = new QImage( bf->convertToImage() ); + images[ RotActiveTab ] = new TQImage( bf->convertToImage() ); } } if ( pixmaps[ RotInactiveTab ] ) { - QWMatrix r180; + TQWMatrix r180; r180.rotate( 180 ); KThemePixmap* bf = new KThemePixmap( pixmaps[ RotInactiveTab ], pixmaps[ RotInactiveTab ] ->xForm( r180 ) ); @@ -508,7 +508,7 @@ void KThemeBase::readConfig( Qt::GUIStyle /*style*/ ) if ( images[ RotInactiveTab ] ) { delete images[ RotInactiveTab ]; - images[ RotInactiveTab ] = new QImage( bf->convertToImage() ); + images[ RotInactiveTab ] = new TQImage( bf->convertToImage() ); } } @@ -522,7 +522,7 @@ void KThemeBase::readConfig( Qt::GUIStyle /*style*/ ) d->props.clear(); } -KThemeBase::KThemeBase( const QString& dir, const QString & configFile ) +KThemeBase::KThemeBase( const TQString& dir, const TQString & configFile ) : KStyle( FilledFrameWorkaround ), configFileName( configFile ) { d = new KThemeBasePrivate; @@ -559,9 +559,9 @@ KThemeBase::KThemeBase( const QString& dir, const QString & configFile ) ; } -void KThemeBase::applyConfigFile( QSettings& config ) +void KThemeBase::applyConfigFile( TQSettings& config ) { - QStringList keys = config.entryList( configFileName ); + TQStringList keys = config.entryList( configFileName ); if ( keys.contains( "foreground" ) ) { @@ -651,10 +651,10 @@ KThemeBase::~KThemeBase() delete d; } -QImage* KThemeBase::loadImage( const QString &name ) +TQImage* KThemeBase::loadImage( const TQString &name ) { - QImage * image = new QImage; - QString path = KStyleDirs::dirs()->findResource( "themepixmap",name ); + TQImage * image = new QImage; + TQString path = KStyleDirs::dirs()->findResource( "themepixmap",name ); image->load( path ); if ( !image->isNull() ) return ( image ); @@ -663,10 +663,10 @@ QImage* KThemeBase::loadImage( const QString &name ) return ( NULL ); } -KThemePixmap* KThemeBase::loadPixmap( const QString &name ) +KThemePixmap* KThemeBase::loadPixmap( const TQString &name ) { KThemePixmap * pixmap = new KThemePixmap( false ); - QString path = KStyleDirs::dirs()->findResource( "themepixmap", name ); + TQString path = KStyleDirs::dirs()->findResource( "themepixmap", name ); pixmap->load( path ); if ( !pixmap->isNull() ) return pixmap; @@ -697,7 +697,7 @@ KThemePixmap* KThemeBase::scale( int w, int h, WidgetType widget ) const else { cache->insert( pixmaps[ widget ], KThemeCache::FullScale, widget ); - QImage tmpImg = images[ widget ] ->smoothScale( w, h ); + TQImage tmpImg = images[ widget ] ->smoothScale( w, h ); pixmaps[ widget ] = new KThemePixmap; pixmaps[ widget ] ->convertFromImage( tmpImg ); if ( blends[ widget ] != 0.0 ) @@ -722,7 +722,7 @@ KThemePixmap* KThemeBase::scale( int w, int h, WidgetType widget ) const else { cache->insert( pixmaps[ widget ], KThemeCache::HorizontalScale, widget ); - QImage tmpImg = images[ widget ] -> + TQImage tmpImg = images[ widget ] -> smoothScale( w, images[ widget ] ->height() ); pixmaps[ widget ] = new KThemePixmap; pixmaps[ widget ] ->convertFromImage( tmpImg ); @@ -748,7 +748,7 @@ KThemePixmap* KThemeBase::scale( int w, int h, WidgetType widget ) const else { cache->insert( pixmaps[ widget ], KThemeCache::VerticalScale, widget ); - QImage tmpImg = + TQImage tmpImg = images[ widget ] ->smoothScale( images[ widget ] ->width(), h ); pixmaps[ widget ] = new KThemePixmap; pixmaps[ widget ] ->convertFromImage( tmpImg ); @@ -773,11 +773,11 @@ KThemePixmap* KThemeBase::scale( int w, int h, WidgetType widget ) const else { cache->insert( pixmaps[ widget ], KThemeCache::FullScale, widget ); - QPixmap tile; + TQPixmap tile; tile.convertFromImage( *images[ widget ] ); pixmaps[ widget ] = new KThemePixmap; pixmaps[ widget ] ->resize( w, h ); - QPainter p( pixmaps[ widget ] ); + TQPainter p( pixmaps[ widget ] ); p.drawTiledPixmap( 0, 0, w, h, tile ); if ( blends[ widget ] != 0.0 ) blend( widget ); @@ -801,14 +801,14 @@ KThemePixmap* KThemeBase::scaleBorder( int w, int h, WidgetType widget ) const { pixmap = new KThemePixmap(); pixmap->resize( w, h ); - QBitmap mask; + TQBitmap mask; mask.resize( w, h ); mask.fill( color0 ); - QPainter mPainter; + TQPainter mPainter; mPainter.begin( &mask ); - QPixmap *tmp = borderPixmap( widget ) ->border( KThemePixmap::TopLeft ); - const QBitmap *srcMask = tmp->mask(); + TQPixmap *tmp = borderPixmap( widget ) ->border( KThemePixmap::TopLeft ); + const TQBitmap *srcMask = tmp->mask(); int bdWidth = tmp->width(); bitBlt( pixmap, 0, 0, tmp, 0, 0, bdWidth, bdWidth, @@ -850,7 +850,7 @@ KThemePixmap* KThemeBase::scaleBorder( int w, int h, WidgetType widget ) const else mPainter.fillRect( w - bdWidth, h - bdWidth, bdWidth, bdWidth, color1 ); - QPainter p; + TQPainter p; p.begin( pixmap ); if ( w - bdWidth * 2 > 0 ) { @@ -1014,8 +1014,8 @@ KThemePixmap* KThemeBase::gradient( int w, int h, WidgetType widget ) const KPixmap s; int offset = decoWidth( widget ); s.resize( w - offset * 2, h - offset * 2 ); - QColor lc( *grLowColors[ widget ] ); - QColor hc( *grHighColors[ widget ] ); + TQColor lc( *grLowColors[ widget ] ); + TQColor hc( *grHighColors[ widget ] ); if ( bevelContrast( widget ) ) { int bc = bevelContrast( widget ); @@ -1088,7 +1088,7 @@ KThemePixmap* KThemeBase::scalePixmap( int w, int h, WidgetType widget ) const return ( scale( w, h, widget ) ); } -QColorGroup* KThemeBase::makeColorGroup( const QColor &fg, const QColor &bg, +TQColorGroup* KThemeBase::makeColorGroup( const TQColor &fg, const TQColor &bg, Qt::GUIStyle ) { if ( shading == Motif ) @@ -1096,82 +1096,82 @@ QColorGroup* KThemeBase::makeColorGroup( const QColor &fg, const QColor &bg, int highlightVal, lowlightVal; highlightVal = 100 + ( 2 * d->contrast + 4 ) * 16 / 10; lowlightVal = 100 + ( ( 2 * d->contrast + 4 ) * 10 ); - return ( new QColorGroup( fg, bg, bg.light( highlightVal ), + return ( new TQColorGroup( fg, bg, bg.light( highlightVal ), bg.dark( lowlightVal ), bg.dark( 120 ), - fg, QApplication::palette().active().base() ) ); + fg, TQApplication::palette().active().base() ) ); } else - return ( new QColorGroup( fg, bg, bg.light( 150 ), bg.dark(), + return ( new TQColorGroup( fg, bg, bg.light( 150 ), bg.dark(), bg.dark( 120 ), fg, - QApplication::palette().active().base() ) ); + TQApplication::palette().active().base() ) ); } -void KThemeBase::applyMiscResourceGroup( QSettings *config ) +void KThemeBase::applyMiscResourceGroup( TQSettings *config ) { #ifndef Q_WS_QWS //FIXME d->props.erase( "Misc" ); // clear the old property - QString base = configFileName + "Misc/"; + TQString base = configFileName + "Misc/"; Prop& prop = d->props[ "Misc" ]; - QString tmpStr; + TQString tmpStr; tmpStr = config->readEntry( base + "SButtonPosition" ); if ( tmpStr == "BottomLeft" ) - prop[ "SButtonPosition" ] = QString::number( ( int ) SBBottomLeft ); + prop[ "SButtonPosition" ] = TQString::number( ( int ) SBBottomLeft ); else if ( tmpStr == "BottomRight" ) - prop[ "SButtonPosition" ] = QString::number( ( int ) SBBottomRight ); + prop[ "SButtonPosition" ] = TQString::number( ( int ) SBBottomRight ); else { if ( tmpStr != "Opposite" && !tmpStr.isEmpty() ) qWarning( "KThemeBase: Unrecognized sb button option %s, using Opposite.\n", tmpStr.latin1() ); ; - prop[ "SButtonPosition" ] = QString::number( ( int ) SBOpposite ); + prop[ "SButtonPosition" ] = TQString::number( ( int ) SBOpposite ); } tmpStr = config->readEntry( base + "ArrowType" ); if ( tmpStr == "Small" ) - prop[ "ArrowType" ] = QString::number( ( int ) SmallArrow ); + prop[ "ArrowType" ] = TQString::number( ( int ) SmallArrow ); else if ( tmpStr == "3D" ) - prop[ "ArrowType" ] = QString::number( ( int ) MotifArrow ); + prop[ "ArrowType" ] = TQString::number( ( int ) MotifArrow ); else { if ( tmpStr != "Normal" && !tmpStr.isEmpty() ) qWarning( "KThemeBase: Unrecognized arrow option %s, using Normal.\n", tmpStr.latin1() ); - prop[ "ArrowType" ] = QString::number( ( int ) LargeArrow ); + prop[ "ArrowType" ] = TQString::number( ( int ) LargeArrow ); } tmpStr = config->readEntry( base + "ShadeStyle" ); if ( tmpStr == "Motif" ) - prop[ "ShadeStyle" ] = QString::number( ( int ) Motif ); + prop[ "ShadeStyle" ] = TQString::number( ( int ) Motif ); else if ( tmpStr == "Next" ) - prop[ "ShadeStyle" ] = QString::number( ( int ) Next ); + prop[ "ShadeStyle" ] = TQString::number( ( int ) Next ); else if ( tmpStr == "KDE" ) - prop[ "ShadeStyle" ] = QString::number( ( int ) KDE ); + prop[ "ShadeStyle" ] = TQString::number( ( int ) KDE ); else - prop[ "ShadeStyle" ] = QString::number( ( int ) Windows ); + prop[ "ShadeStyle" ] = TQString::number( ( int ) Windows ); - prop[ "FrameWidth" ] = QString::number( config->readNumEntry( base + "FrameWidth", 2 ) ); - prop[ "Cache" ] = QString::number( config->readNumEntry( base + "Cache", 1024 ) ); - prop[ "ScrollBarExtent" ] = QString::number( config->readNumEntry( base + "ScrollBarExtent", 16 ) ); + prop[ "FrameWidth" ] = TQString::number( config->readNumEntry( base + "FrameWidth", 2 ) ); + prop[ "Cache" ] = TQString::number( config->readNumEntry( base + "Cache", 1024 ) ); + prop[ "ScrollBarExtent" ] = TQString::number( config->readNumEntry( base + "ScrollBarExtent", 16 ) ); #endif } -static int readNumEntry( Prop& prop, QString setting, int def ) +static int readNumEntry( Prop& prop, TQString setting, int def ) { bool ok; - QString s_val = prop[ setting ]; + TQString s_val = prop[ setting ]; int val = s_val.toInt( &ok ); if ( ok ) return val; return def; } -static QColor readColorEntry( Prop& prop, QString setting, const QColor& def ) +static TQColor readColorEntry( Prop& prop, TQString setting, const TQColor& def ) { - QString s_val = prop[ setting ]; + TQString s_val = prop[ setting ]; if ( !s_val.isEmpty() ) { - QColor c( s_val ); + TQColor c( s_val ); return c; } return def; @@ -1194,16 +1194,16 @@ void KThemeBase::readMiscResourceGroup() } -void KThemeBase::applyResourceGroup( QSettings *config, int i ) +void KThemeBase::applyResourceGroup( TQSettings *config, int i ) { #ifndef Q_WS_QWS //FIXME - QString tmpStr; + TQString tmpStr; int tmpVal; // clear the old property d->props.erase( widgetEntries[ i ] ); - QString base = configFileName + widgetEntries[ i ] + "/"; + TQString base = configFileName + widgetEntries[ i ] + "/"; Prop& prop = d->props[ widgetEntries[ i ] ]; @@ -1227,7 +1227,7 @@ void KThemeBase::applyResourceGroup( QSettings *config, int i ) qWarning( "KThemeBase: Unrecognized scale option %s, using Tile.\n", tmpStr.latin1() ); tmpVal = ( int ) TileScale; } - prop[ "ScaleHint" ] = QString::number( tmpVal ); + prop[ "ScaleHint" ] = TQString::number( tmpVal ); // Gradient type tmpStr = config->readEntry( base + "Gradient" ); @@ -1251,41 +1251,41 @@ void KThemeBase::applyResourceGroup( QSettings *config, int i ) qWarning( "KThemeBase: Unrecognized gradient option %s, using None.\n", tmpStr.latin1() ); tmpVal = ( int ) GrNone; } - prop[ "Gradient" ] = QString::number( tmpVal ); + prop[ "Gradient" ] = TQString::number( tmpVal ); // Blend intensity tmpStr.setNum( config->readDoubleEntry( base + "BlendIntensity", 0.0 ) ); prop[ "Blend" ] = tmpStr; // Bevel contrast - prop[ "BContrast" ] = QString::number( config->readNumEntry( base + "BevelContrast", 0 ) ); + prop[ "BContrast" ] = TQString::number( config->readNumEntry( base + "BevelContrast", 0 ) ); // Border width - prop[ "Border" ] = QString::number( config->readNumEntry( base + "Border", 1 ) ); + prop[ "Border" ] = TQString::number( config->readNumEntry( base + "Border", 1 ) ); // Highlight width - prop[ "Highlight" ] = QString::number( config->readNumEntry( base + "Highlight", 1 ) ); + prop[ "Highlight" ] = TQString::number( config->readNumEntry( base + "Highlight", 1 ) ); - QStringList keys = config->entryList( base ); + TQStringList keys = config->entryList( base ); // Gradient low color or blend background if ( keys.contains( "GradientLow" ) ) - prop[ "GrLow" ] = readColorEntry( config, QString( base + "GradientLow" ).latin1(), - &QApplication::palette().active().background() ).name(); + prop[ "GrLow" ] = readColorEntry( config, TQString( base + "GradientLow" ).latin1(), + &TQApplication::palette().active().background() ).name(); // Gradient high color if ( keys.contains( "GradientHigh" ) ) - prop[ "GrHigh" ] = readColorEntry( config, QString( base + "GradientHigh" ).latin1(), - &QApplication::palette().active().foreground() ).name(); + prop[ "GrHigh" ] = readColorEntry( config, TQString( base + "GradientHigh" ).latin1(), + &TQApplication::palette().active().foreground() ).name(); // Extended color attributes if ( keys.contains( "Foreground" ) || keys.contains( "Background" ) ) { - QColor fg, bg; + TQColor fg, bg; if ( keys.contains( "Background" ) ) - bg = readColorEntry( config, QString( base + "Background" ).latin1(), &bg ); + bg = readColorEntry( config, TQString( base + "Background" ).latin1(), &bg ); if ( keys.contains( "Foreground" ) ) - fg = readColorEntry( config, QString( base + "Foreground" ).latin1(), &fg ); + fg = readColorEntry( config, TQString( base + "Foreground" ).latin1(), &fg ); prop[ "Foreground" ] = fg.name(); prop[ "Background" ] = bg.name(); @@ -1302,24 +1302,24 @@ void KThemeBase::applyResourceGroup( QSettings *config, int i ) if ( !tmpStr.isEmpty() ) { prop[ "PixmapBorder" ] = tmpStr; - prop[ "PixmapBWidth" ] = QString::number( + prop[ "PixmapBWidth" ] = TQString::number( config->readNumEntry( base + "PixmapBWidth", 0 ) ); } // Various widget specific settings. This was more efficient when bunched // together in the misc group, but this makes an easier to read config. if ( i == SliderGroove ) - prop[ "SmallGroove" ] = QString::number( + prop[ "SmallGroove" ] = TQString::number( config->readBoolEntry( base + "SmallGroove", false ) ); else if ( i == ActiveTab || i == InactiveTab ) - prop[ "BottomLine" ] = QString::number( + prop[ "BottomLine" ] = TQString::number( config->readBoolEntry( base + "BottomLine", true ) ); else if ( i == Splitter ) - prop[ "Width" ] = QString::number( config->readNumEntry( base + "Width", 10 ) ); + prop[ "Width" ] = TQString::number( config->readNumEntry( base + "Width", 10 ) ); else if ( i == ComboBox || i == ComboBoxDown ) { if ( keys.contains( "Round" ) ) - prop[ "Round" ] = QString::number( config->readBoolEntry( base + "Round", false ) ); + prop[ "Round" ] = TQString::number( config->readBoolEntry( base + "Round", false ) ); else prop[ "Round" ] = "5000"; // invalid, used w/multiple groups @@ -1327,32 +1327,32 @@ void KThemeBase::applyResourceGroup( QSettings *config, int i ) else if ( i == PushButton || i == PushButtonDown ) { if ( keys.contains( "XShift" ) ) - prop[ "XShift" ] = QString::number( config->readNumEntry( base + "XShift", 0 ) ); + prop[ "XShift" ] = TQString::number( config->readNumEntry( base + "XShift", 0 ) ); else prop[ "XShift" ] = "5000"; if ( keys.contains( "YShift" ) ) - prop[ "YShift" ] = QString::number( config->readNumEntry( base + "YShift", 0 ) ); + prop[ "YShift" ] = TQString::number( config->readNumEntry( base + "YShift", 0 ) ); else prop[ "YShift" ] = "5000"; if ( keys.contains( "3DFocusRect" ) ) - prop[ "3DFRect" ] = QString::number( config-> + prop[ "3DFRect" ] = TQString::number( config-> readBoolEntry( base + "3DFocusRect", false ) ); else prop[ "3DFRect" ] = "5000"; if ( keys.contains( "3DFocusOffset" ) ) - prop[ "3DFOffset" ] = QString::number( config-> + prop[ "3DFOffset" ] = TQString::number( config-> readBoolEntry( base + "3DFocusOffset", 0 ) ); else prop[ "3DFOffset" ] = "5000"; if ( keys.contains( "Round" ) ) - prop[ "Round" ] = QString::number( config->readBoolEntry( base + "Round", false ) ); + prop[ "Round" ] = TQString::number( config->readBoolEntry( base + "Round", false ) ); else prop[ "Round" ] = "5000"; } #endif } -void KThemeBase::readResourceGroup( int i, QString *pixnames, QString *brdnames, +void KThemeBase::readResourceGroup( int i, TQString *pixnames, TQString *brdnames, bool *loadArray ) { #ifndef Q_WS_QWS //FIXME @@ -1363,7 +1363,7 @@ void KThemeBase::readResourceGroup( int i, QString *pixnames, QString *brdnames, int tmpVal; Prop prop = d->props[ widgetEntries[ i ] ]; - QString tmpStr; + TQString tmpStr; tmpStr = prop[ "CopyWidget" ]; if ( !tmpStr.isEmpty() ) @@ -1411,7 +1411,7 @@ void KThemeBase::readResourceGroup( int i, QString *pixnames, QString *brdnames, // Blend intensity tmpStr = prop[ "Blend" ]; if ( tmpStr.isEmpty() ) - tmpStr = QString::fromLatin1( "0.0" ); + tmpStr = TQString::fromLatin1( "0.0" ); blends[ i ] = tmpStr.toFloat(); // Bevel contrast @@ -1426,8 +1426,8 @@ void KThemeBase::readResourceGroup( int i, QString *pixnames, QString *brdnames, // Gradient low color or blend background if ( gradients[ i ] != GrNone || blends[ i ] != 0.0 ) grLowColors[ i ] = - new QColor( readColorEntry( prop, "GrLow", - QApplication::palette().active(). + new TQColor( readColorEntry( prop, "GrLow", + TQApplication::palette().active(). background() ) ); else grLowColors[ i ] = NULL; @@ -1435,22 +1435,22 @@ void KThemeBase::readResourceGroup( int i, QString *pixnames, QString *brdnames, // Gradient high color if ( gradients[ i ] != GrNone ) grHighColors[ i ] = - new QColor( readColorEntry( prop, "GrHigh", - QApplication::palette().active(). + new TQColor( readColorEntry( prop, "GrHigh", + TQApplication::palette().active(). background() ) ); else grHighColors[ i ] = NULL; // Extended color attributes - QColor fg, bg; + TQColor fg, bg; fg = readColorEntry( prop, "Foreground", fg ); bg = readColorEntry( prop, "Background", bg ); if ( fg.isValid() || bg.isValid() ) { if ( !fg.isValid() ) - fg = QApplication::palette().active().foreground(); + fg = TQApplication::palette().active().foreground(); if ( !bg.isValid() ) - bg = QApplication::palette().active().background(); + bg = TQApplication::palette().active().background(); colors[ i ] = makeColorGroup( fg, bg, Qt::WindowsStyle ); } else @@ -1563,17 +1563,17 @@ void KThemeBase::readResourceGroup( int i, QString *pixnames, QString *brdnames, } -QPalette KThemeBase::overridePalette( const QPalette& pal ) +TQPalette KThemeBase::overridePalette( const TQPalette& pal ) { //Read current settings for colors.. - QColor background = pal.active().background(); - QColor foreground = pal.active().foreground(); - QColor button = background; //CHECKME - QColor highlight = pal.active().highlight(); - QColor highlightedText = pal.active().highlightedText(); //CHECKME - QColor base = pal.active().base(); //config->readColorEntry( "windowBackground", &white ); - QColor baseText = pal.active().text(); //CHECKME + TQColor background = pal.active().background(); + TQColor foreground = pal.active().foreground(); + TQColor button = background; //CHECKME + TQColor highlight = pal.active().highlight(); + TQColor highlightedText = pal.active().highlightedText(); //CHECKME + TQColor base = pal.active().base(); //config->readColorEntry( "windowBackground", &white ); + TQColor baseText = pal.active().text(); //CHECKME //See whether there are any immediate overrides. if ( d->overrideBackground ) @@ -1596,7 +1596,7 @@ QPalette KThemeBase::overridePalette( const QPalette& pal ) if ( uncached( Bevel ) ) button = d->pixmapAveColor( uncached( Bevel ) ); - QColor buttonText = foreground; + TQColor buttonText = foreground; int highlightVal, lowlightVal; highlightVal = 100 + ( 2 * d->contrast + 4 ) * 16 / 10; @@ -1616,14 +1616,14 @@ QPalette KThemeBase::overridePalette( const QPalette& pal ) } - QColorGroup pre( foreground, button, background.light( highlightVal ), + TQColorGroup pre( foreground, button, background.light( highlightVal ), background.dark( lowlightVal ), background.dark( 120 ), baseText, buttonText /*CHECKME: BrightText*/, base, background ); buttonText = colorGroup( pre, PushButton ) ->foreground(); } - QColor disfg = foreground; + TQColor disfg = foreground; int h, s, v; disfg.hsv( &h, &s, &v ); if ( v > 128 ) @@ -1637,31 +1637,31 @@ QPalette KThemeBase::overridePalette( const QPalette& pal ) disfg = Qt::darkGray; - QColorGroup disabledgrp( disfg, background, //TODO:Convert this to the new ctor. + TQColorGroup disabledgrp( disfg, background, //TODO:Convert this to the new ctor. background.light( highlightVal ), background.dark( lowlightVal ), background.dark( 120 ), background.dark( 120 ), base ); - QColorGroup colgrp( foreground, button, background.light( highlightVal ), + TQColorGroup colgrp( foreground, button, background.light( highlightVal ), background.dark( lowlightVal ), background.dark( 120 ), baseText, buttonText /*CHECKME: BrightText*/, base, background ); - colgrp.setColor( QColorGroup::Highlight, highlight ); - colgrp.setColor( QColorGroup::HighlightedText, highlightedText ); - colgrp.setColor( QColorGroup::ButtonText, buttonText ); - colgrp.setColor( QColorGroup::Midlight, button.light( 110 ) ); + colgrp.setColor( TQColorGroup::Highlight, highlight ); + colgrp.setColor( TQColorGroup::HighlightedText, highlightedText ); + colgrp.setColor( TQColorGroup::ButtonText, buttonText ); + colgrp.setColor( TQColorGroup::Midlight, button.light( 110 ) ); - disabledgrp.setColor( QColorGroup::Base, base ); - disabledgrp.setColor( QColorGroup::Button, button ); - disabledgrp.setColor( QColorGroup::ButtonText, buttonText ); - disabledgrp.setColor( QColorGroup::Midlight, button.light( 110 ) ); + disabledgrp.setColor( TQColorGroup::Base, base ); + disabledgrp.setColor( TQColorGroup::Button, button ); + disabledgrp.setColor( TQColorGroup::ButtonText, buttonText ); + disabledgrp.setColor( TQColorGroup::Midlight, button.light( 110 ) ); - QPalette newPal( colgrp, disabledgrp, colgrp ); + TQPalette newPal( colgrp, disabledgrp, colgrp ); return newPal; @@ -1695,12 +1695,12 @@ KThemePixmap::KThemePixmap( const KThemePixmap &p ) int i; for ( i = 0; i < 8; ++i ) if ( p.b[ i ] ) - b[ i ] = new QPixmap( *p.b[ i ] ); + b[ i ] = new TQPixmap( *p.b[ i ] ); else b[ i ] = NULL; } -KThemePixmap::KThemePixmap( const KThemePixmap &p, const QPixmap &p2 ) +KThemePixmap::KThemePixmap( const KThemePixmap &p, const TQPixmap &p2 ) : KPixmap( p2 ) { if ( p.t ) @@ -1713,7 +1713,7 @@ KThemePixmap::KThemePixmap( const KThemePixmap &p, const QPixmap &p2 ) int i; for ( i = 0; i < 8; ++i ) if ( p.b[ i ] ) - b[ i ] = new QPixmap( *p.b[ i ] ); + b[ i ] = new TQPixmap( *p.b[ i ] ); else b[ i ] = NULL; } @@ -1730,18 +1730,18 @@ KThemePixmap::~KThemePixmap() delete b[ i ]; } -KThemeCache::KThemeCache( int maxSize, QObject *parent, const char *name ) - : QObject( parent, name ) +KThemeCache::KThemeCache( int maxSize, TQObject *parent, const char *name ) + : TQObject( parent, name ) { cache.setMaxCost( maxSize * 1024 ); cache.setAutoDelete( true ); flushTimer.start( 300000 ); // 5 minutes - connect( &flushTimer, SIGNAL( timeout() ), SLOT( flushTimeout() ) ); + connect( &flushTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( flushTimeout() ) ); } void KThemeCache::flushTimeout() { - QIntCacheIterator<KThemePixmap> it( cache ); + TQIntCacheIterator<KThemePixmap> it( cache ); while ( it.current() ) { if ( it.current() ->isOld() ) diff --git a/kstyles/kthemestyle/kthemebase.h b/kstyles/kthemestyle/kthemebase.h index 8f8041464..b821e1c7c 100644 --- a/kstyles/kthemestyle/kthemebase.h +++ b/kstyles/kthemestyle/kthemebase.h @@ -29,16 +29,16 @@ Copyright (C) 1998, 1999, 2000 KDE Team #ifndef KTHEMEBASE_H #define KTHEMEBASE_H -#include <qtimer.h> -#include <qdatetime.h> +#include <tqtimer.h> +#include <tqdatetime.h> #include <kpixmap.h> -#include <qintcache.h> -#include <qstring.h> +#include <tqintcache.h> +#include <tqstring.h> #include <kstyle.h> -#include <qsettings.h> -#include <qpalette.h> // for QColorGroup +#include <tqsettings.h> +#include <tqpalette.h> // for QColorGroup #include "kstyledirs.h" -#include <qmap.h> +#include <tqmap.h> class QImage; @@ -58,34 +58,34 @@ public: KThemePixmap( bool timer = true ); KThemePixmap( const KThemePixmap &p ); - KThemePixmap( const KThemePixmap &p, const QPixmap& rp ); + KThemePixmap( const KThemePixmap &p, const TQPixmap& rp ); ~KThemePixmap(); - QPixmap* border( BorderType type ); - void setBorder( BorderType type, const QPixmap &p ); + TQPixmap* border( BorderType type ); + void setBorder( BorderType type, const TQPixmap &p ); void updateAccessed(); bool isOld(); protected: - QTime *t; - QPixmap *b[ 8 ]; + TQTime *t; + TQPixmap *b[ 8 ]; private: class KThemePixmapPrivate; KThemePixmapPrivate *d; }; -inline QPixmap* KThemePixmap::border( BorderType type ) +inline TQPixmap* KThemePixmap::border( BorderType type ) { return ( b[ type ] ); } -inline void KThemePixmap::setBorder( BorderType type, const QPixmap &p ) +inline void KThemePixmap::setBorder( BorderType type, const TQPixmap &p ) { if ( b[ type ] ) { qWarning( "KThemePixmap: Overwriting existing border!" ); delete( b[ type ] ); } - b[ type ] = new QPixmap( p ); + b[ type ] = new TQPixmap( p ); } inline void KThemePixmap::updateAccessed() @@ -100,14 +100,14 @@ inline bool KThemePixmap::isOld() } /** - * A very simple pixmap cache for theme plugins. QPixmapCache is not used - * since it uses QString keys which are not needed. All the information we - * need can be encoded in a numeric key. Using QIntCache instead allows us to + * A very simple pixmap cache for theme plugins. TQPixmapCache is not used + * since it uses TQString keys which are not needed. All the information we + * need can be encoded in a numeric key. Using TQIntCache instead allows us to * skip the string operations. * * This class is mostly just inline methods that do bit operations on a key * composed of the widget ID, width and/or height, and then calls - * QIntCache::find(). + * TQIntCache::find(). * * One other thing to note is that full, horizontal, and vertically scaled * pixmaps are not used interchangeably. For example, if you insert a fully @@ -136,7 +136,7 @@ public: * @param parent The parent object. * @param name The name of the object. */ - KThemeCache( int maxSize, QObject *parent = 0, const char *name = 0 ); + KThemeCache( int maxSize, TQObject *parent = 0, const char *name = 0 ); /** * Inserts a new pixmap into the cache. * @@ -188,8 +188,8 @@ public: protected slots: void flushTimeout(); protected: - QIntCache<KThemePixmap> cache; - QTimer flushTimer; + TQIntCache<KThemePixmap> cache; + TQTimer flushTimer; private: class KThemeCachePrivate; @@ -218,7 +218,7 @@ public: /** * Constructs a new KThemeBase object. */ - KThemeBase( const QString &dirs, const QString &configFile ); + KThemeBase( const TQString &dirs, const TQString &configFile ); ~KThemeBase(); /** * Describes if a pixmap should be scaled fully, horizontally, vertically, @@ -305,10 +305,10 @@ public: * @param widget The widget whose color group to retrieve. * */ - const QColorGroup* colorGroup( const QColorGroup &defaultGroup, + const TQColorGroup* colorGroup( const TQColorGroup &defaultGroup, WidgetType widget ) const; - QBrush pixmapBrush( const QColorGroup &group, QColorGroup::ColorRole role, + TQBrush pixmapBrush( const TQColorGroup &group, TQColorGroup::ColorRole role, int w, int h, WidgetType widget ); /** * True if the widget has a pixmap or gradient specified. @@ -424,7 +424,7 @@ public: * height. This will return NULL if no pixmap or gradient is specified. * It may also return a different sized pixmap if the scaling * is set to Tiled. When using this method, you should call it using - * the needed width and height then use QPainter::drawTiledPixmap to + * the needed width and height then use TQPainter::drawTiledPixmap to * paint it. Doing this, if the pixmap is scaled it will be the proper * size, otherwise it will be tiled. * @@ -443,29 +443,29 @@ protected: * * @param config The configuration file to apply. */ - void applyConfigFile( QSettings & config ); + void applyConfigFile( TQSettings & config ); /* * Generates a new palette based on the values for which have been specified explicitly * in the .themerc file. */ - QPalette overridePalette( const QPalette& pal ); + TQPalette overridePalette( const TQPalette& pal ); /** - * Returns a QImage for the given widget if the widget is scaled, NULL + * Returns a TQImage for the given widget if the widget is scaled, NULL * otherwise. QImages of the original pixmap are stored for scaled * widgets in order to facilitate fast and accurate smooth-scaling. This * also saves us a conversion from a pixmap to an image then back again. */ - QImage* image( WidgetType widget ) const; + TQImage* image( WidgetType widget ) const; /** * Returns the gradient high color if one is specified, NULL otherwise. */ - QColor* gradientHigh( WidgetType widget ) const; + TQColor* gradientHigh( WidgetType widget ) const; /** * Returns the gradient low color if one is specified, NULL otherwise. */ - QColor* gradientLow( WidgetType widget ) const; + TQColor* gradientLow( WidgetType widget ) const; /** * Reads in all the configuration file entries supported. * @@ -474,48 +474,48 @@ protected: * is obsolete. */ void readConfig( Qt::GUIStyle colorStyle = Qt::WindowsStyle ); - void readWidgetConfig( int i, QSettings *config, QString *pixnames, - QString *brdnames, bool *loadArray ); - void copyWidgetConfig( int sourceID, int destID, QString *pixnames, - QString *brdnames ); + void readWidgetConfig( int i, TQSettings *config, TQString *pixnames, + TQString *brdnames, bool *loadArray ); + void copyWidgetConfig( int sourceID, int destID, TQString *pixnames, + TQString *brdnames ); /** * Makes a full color group based on the given foreground and background * colors. This is the same code used by KDE (kapp.cpp) in previous * versions. */ - QColorGroup* makeColorGroup( const QColor &fg, const QColor &bg, + TQColorGroup* makeColorGroup( const TQColor &fg, const TQColor &bg, Qt::GUIStyle style = Qt::WindowsStyle ); KThemePixmap* scale( int w, int h, WidgetType widget ) const; KThemePixmap* scaleBorder( int w, int h, WidgetType type ) const; KThemePixmap* gradient( int w, int h, WidgetType widget ) const ; KThemePixmap* blend( WidgetType widget ) const; void generateBorderPix( int i ); - void applyResourceGroup( QSettings *config, int i ); - void applyMiscResourceGroup( QSettings *config ); - void readResourceGroup( int i, QString *pixnames, QString *brdnames, + void applyResourceGroup( TQSettings *config, int i ); + void applyMiscResourceGroup( TQSettings *config ); + void readResourceGroup( int i, TQString *pixnames, TQString *brdnames, bool *loadArray ); void readMiscResourceGroup(); /** * Attempts to load a pixmap from the default KThemeBase locations. */ - KThemePixmap* loadPixmap( const QString &name ); + KThemePixmap* loadPixmap( const TQString &name ); /** * Attempts to load a image from the default KThemeBase locations. */ - QImage* loadImage( const QString &name ); + TQImage* loadImage( const TQString &name ); /** These are included for fuuture extension purposes.. */ - virtual int pixelMetric ( PixelMetric metric, const QWidget * widget = 0 ) const + virtual int pixelMetric ( PixelMetric metric, const TQWidget * widget = 0 ) const { return KStyle::pixelMetric( metric, widget ); } - virtual void drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect & r, const QColorGroup & cg, + virtual void drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRect & r, const TQColorGroup & cg, SFlags flags = Style_Default, - const QStyleOption& option = QStyleOption::Default ) const + const TQStyleOption& option = TQStyleOption::Default ) const { KStyle::drawPrimitive ( pe, p, r, cg, flags, option ); @@ -523,48 +523,48 @@ protected: virtual void drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags how = Style_Default, - const QStyleOption& opt = QStyleOption::Default ) const + const TQStyleOption& opt = TQStyleOption::Default ) const { KStyle::drawControl( element, p, widget, r, cg, how, opt ); } virtual void drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt = QStyleOption::Default ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt = TQStyleOption::Default ) const { KStyle::drawControlMask( element, p, widget, r, opt ); } virtual void drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& opt = QStyleOption::Default ) const + const TQStyleOption& opt = TQStyleOption::Default ) const { KStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); } virtual void drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& opt = QStyleOption::Default ) const + const TQStyleOption& opt = TQStyleOption::Default ) const { KStyle::drawKStylePrimitive( kpe, p, widget, r, @@ -573,8 +573,8 @@ protected: virtual int styleHint( StyleHint sh, - const QWidget *widget = 0, - const QStyleOption& opt = QStyleOption::Default, + const TQWidget *widget = 0, + const TQStyleOption& opt = TQStyleOption::Default, QStyleHintReturn* returnData = 0 ) const { return KStyle::styleHint( sh, @@ -583,10 +583,10 @@ protected: returnData ); } - virtual QSize sizeFromContents( ContentsType contents, - const QWidget *widget, - const QSize &contentsSize, - const QStyleOption& opt = QStyleOption::Default ) const + virtual TQSize sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentsSize, + const TQStyleOption& opt = TQStyleOption::Default ) const { return KStyle::sizeFromContents( contents, widget, contentsSize, opt ); @@ -610,8 +610,8 @@ private: bool focus3D; KThemeCache *cache; int cacheSize; - QString configFileName; - QString configDirName; + TQString configFileName; + TQString configDirName; /** * The theme pixmaps. Many of these may be NULL if no pixmap is specified. @@ -625,7 +625,7 @@ private: * The theme images. These are for scaled images and are kept in order * to maintain fast smoothscaling. */ - mutable QImage *images[ WIDGETS ]; + mutable TQImage *images[ WIDGETS ]; /** * The border widths */ @@ -641,15 +641,15 @@ private: /** * All the color groups. */ - mutable QColorGroup *colors[ WIDGETS ]; + mutable TQColorGroup *colors[ WIDGETS ]; /** * Gradient low colors (or blend background). */ - mutable QColor *grLowColors[ WIDGETS ]; + mutable TQColor *grLowColors[ WIDGETS ]; /** * Gradient high colors. */ - mutable QColor *grHighColors[ WIDGETS ]; + mutable TQColor *grHighColors[ WIDGETS ]; /** * Gradient types. */ @@ -721,17 +721,17 @@ inline KThemePixmap* KThemeBase::uncached( WidgetType widget ) const return ( pixmaps[ widget ] ); } -inline QBrush KThemeBase::pixmapBrush( const QColorGroup &group, - QColorGroup::ColorRole role, +inline TQBrush KThemeBase::pixmapBrush( const TQColorGroup &group, + TQColorGroup::ColorRole role, int w, int h, WidgetType widget ) { if ( pixmaps[ widget ] || images[ widget ] ) - return ( QBrush( group.color( role ), *scalePixmap( w, h, widget ) ) ); + return ( TQBrush( group.color( role ), *scalePixmap( w, h, widget ) ) ); else return ( group.color( role ) ); } -inline const QColorGroup* KThemeBase::colorGroup( const QColorGroup &defaultGroup, +inline const TQColorGroup* KThemeBase::colorGroup( const TQColorGroup &defaultGroup, WidgetType widget ) const { return ( ( colors[ widget ] ) ? colors[ widget ] : &defaultGroup ); @@ -757,17 +757,17 @@ inline int KThemeBase::decoWidth( WidgetType widget ) const return ( pbWidth[ widget ] ? pbWidth[ widget ] : borders[ widget ] + highlights[ widget ] ); } -inline QColor* KThemeBase::gradientHigh( WidgetType widget ) const +inline TQColor* KThemeBase::gradientHigh( WidgetType widget ) const { return ( grHighColors[ widget ] ); } -inline QColor* KThemeBase::gradientLow( WidgetType widget ) const +inline TQColor* KThemeBase::gradientLow( WidgetType widget ) const { return ( grLowColors[ widget ] ); } -inline QImage* KThemeBase::image( WidgetType widget ) const +inline TQImage* KThemeBase::image( WidgetType widget ) const { return ( images[ widget ] ); } diff --git a/kstyles/kthemestyle/kthemestyle.cpp b/kstyles/kthemestyle/kthemestyle.cpp index cdb419772..5ed132eea 100644 --- a/kstyles/kthemestyle/kthemestyle.cpp +++ b/kstyles/kthemestyle/kthemestyle.cpp @@ -40,35 +40,35 @@ Port version 0.9.7 #include "kthemestyle.h" #include "kthemebase.h" -#include <qstyleplugin.h> -#include <qstylefactory.h> +#include <tqstyleplugin.h> +#include <tqstylefactory.h> #include <kimageeffect.h> -#include <qbitmap.h> -#include <qcheckbox.h> -#include <qlabel.h> +#include <tqbitmap.h> +#include <tqcheckbox.h> +#include <tqlabel.h> #define INCLUDE_MENUITEM_DEF -#include <qmenudata.h> -#include <qpopupmenu.h> -#include <qpalette.h> -#include <qtabbar.h> -#include <qtoolbutton.h> +#include <tqmenudata.h> +#include <tqpopupmenu.h> +#include <tqpalette.h> +#include <tqtabbar.h> +#include <tqtoolbutton.h> #include <kglobalsettings.h> #include <kdrawutil.h> -#include <qdrawutil.h> -#include <qprogressbar.h> -#include <qdir.h> -#include <qapplication.h> -#include <qmenubar.h> -#include <qrangecontrol.h> -#include <qslider.h> -#include <qtooltip.h> -#include <qobjectlist.h> -#include <qradiobutton.h> -#include <qstatusbar.h> +#include <tqdrawutil.h> +#include <tqprogressbar.h> +#include <tqdir.h> +#include <tqapplication.h> +#include <tqmenubar.h> +#include <tqrangecontrol.h> +#include <tqslider.h> +#include <tqtooltip.h> +#include <tqobjectlist.h> +#include <tqradiobutton.h> +#include <tqstatusbar.h> #include "kstyledirs.h" -#include <qimage.h> +#include <tqimage.h> #include <limits.h> @@ -127,12 +127,12 @@ public: ~KThemeStylePlugin() {} - QStringList keys() const + TQStringList keys() const { - QSettings cfg; + TQSettings cfg; KStyleDirs::dirs()->addToSearch( "config", cfg ); - QStringList keys; + TQStringList keys; bool ok; keys = cfg.readListEntry( "/kthemestyle/themes", &ok); @@ -142,15 +142,15 @@ public: return keys; } - QStyle* create( const QString& key ) + TQStyle* create( const TQString& key ) { - QSettings cfg; + TQSettings cfg; KStyleDirs::dirs()->addToSearch( "config", cfg ); - QString file = cfg.readEntry( "/kthemestyle/" + key + "/file" ); + TQString file = cfg.readEntry( "/kthemestyle/" + key + "/file" ); if ( !key.isEmpty() ) { - QFileInfo fi( file ); + TQFileInfo fi( file ); return new KThemeStyle( fi.dirPath(), fi.fileName() ); } @@ -161,22 +161,22 @@ public: KDE_Q_EXPORT_PLUGIN( KThemeStylePlugin ) -void kDrawWindowsArrow ( QPainter *p, const QStyle* style, QStyle::PrimitiveElement pe, bool down, +void kDrawWindowsArrow ( TQPainter *p, const TQStyle* style, TQStyle::PrimitiveElement pe, bool down, int x, int y, int w, int h, - const QColorGroup &cg, bool enabled ) + const TQColorGroup &cg, bool enabled ) { - QPointArray a; + TQPointArray a; switch ( pe ) { - case QStyle::PE_ArrowUp: + case TQStyle::PE_ArrowUp: a.setPoints( QCOORDARRLEN( win_style_u_arrow ), win_style_u_arrow ); break; - case QStyle::PE_ArrowDown: + case TQStyle::PE_ArrowDown: a.setPoints( QCOORDARRLEN( win_style_d_arrow ), win_style_d_arrow ); break; - case QStyle::PE_ArrowLeft: + case TQStyle::PE_ArrowLeft: a.setPoints( QCOORDARRLEN( win_style_l_arrow ), win_style_l_arrow ); break; default: @@ -186,8 +186,8 @@ void kDrawWindowsArrow ( QPainter *p, const QStyle* style, QStyle::PrimitiveElem p->save(); if ( down ) { - p->translate( style->pixelMetric( QStyle::PM_ButtonShiftHorizontal ), - style->pixelMetric( QStyle::PM_ButtonShiftVertical ) ); + p->translate( style->pixelMetric( TQStyle::PM_ButtonShiftHorizontal ), + style->pixelMetric( TQStyle::PM_ButtonShiftVertical ) ); } if ( enabled ) @@ -212,10 +212,10 @@ void kDrawWindowsArrow ( QPainter *p, const QStyle* style, QStyle::PrimitiveElem -QSize KThemeStyle::sizeFromContents( ContentsType contents, - const QWidget* widget, - const QSize &contentSize, - const QStyleOption& opt ) const +TQSize KThemeStyle::sizeFromContents( ContentsType contents, + const TQWidget* widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const { switch ( contents ) { @@ -223,7 +223,7 @@ QSize KThemeStyle::sizeFromContents( ContentsType contents, // ------------------------------------------------------------------ case CT_PushButton: { - const QPushButton * button = ( const QPushButton* ) widget; + const TQPushButton * button = ( const TQPushButton* ) widget; int w = contentSize.width(); int h = contentSize.height(); int bm = pixelMetric( PM_ButtonMargin, widget ); @@ -242,7 +242,7 @@ QSize KThemeStyle::sizeFromContents( ContentsType contents, if ( h < 22 ) h = 22; - return QSize( w, h ); + return TQSize( w, h ); } // POPUPMENU ITEM SIZE @@ -252,9 +252,9 @@ QSize KThemeStyle::sizeFromContents( ContentsType contents, if ( ! widget || opt.isDefault() ) return contentSize; - const QPopupMenu *popup = ( const QPopupMenu * ) widget; + const TQPopupMenu *popup = ( const TQPopupMenu * ) widget; bool checkable = popup->isCheckable(); - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = contentSize.width(), h = contentSize.height(); @@ -282,7 +282,7 @@ QSize KThemeStyle::sizeFromContents( ContentsType contents, if ( mi->iconSet() ) h = QMAX( h, mi->iconSet() ->pixmap( - QIconSet::Small, QIconSet::Normal ).height() + + TQIconSet::Small, TQIconSet::Normal ).height() + 2 * itemFrame ); } @@ -300,7 +300,7 @@ QSize KThemeStyle::sizeFromContents( ContentsType contents, w += rightBorder; - return QSize( w, h ); + return TQSize( w, h ); } default: @@ -309,21 +309,21 @@ QSize KThemeStyle::sizeFromContents( ContentsType contents, } -QRect KThemeStyle::subRect(SubRect sr, const QWidget* widget) const +TQRect KThemeStyle::subRect(SubRect sr, const TQWidget* widget) const { if (sr == SR_CheckBoxFocusRect) { - const QCheckBox* cb = static_cast<const QCheckBox*>(widget); + const TQCheckBox* cb = static_cast<const TQCheckBox*>(widget); //Only checkbox, no label if (cb->text().isEmpty() && (cb->pixmap() == 0) ) { - QRect bounding = cb->rect(); + TQRect bounding = cb->rect(); int cw = pixelMetric(PM_IndicatorWidth, widget); int ch = pixelMetric(PM_IndicatorHeight, widget); - QRect checkbox(bounding.x() + 2, bounding.y() + 2 + (bounding.height() - ch)/2, cw - 4, ch - 4); + TQRect checkbox(bounding.x() + 2, bounding.y() + 2 + (bounding.height() - ch)/2, cw - 4, ch - 4); return checkbox; } @@ -331,7 +331,7 @@ QRect KThemeStyle::subRect(SubRect sr, const QWidget* widget) const return KStyle::subRect(sr, widget); } -int KThemeStyle::pixelMetric ( PixelMetric metric, const QWidget * widget ) const +int KThemeStyle::pixelMetric ( PixelMetric metric, const TQWidget * widget ) const { switch ( metric ) { @@ -395,13 +395,13 @@ int KThemeStyle::pixelMetric ( PixelMetric metric, const QWidget * widget ) cons -KThemeStyle::KThemeStyle( const QString& configDir, const QString &configFile ) +KThemeStyle::KThemeStyle( const TQString& configDir, const TQString &configFile ) : KThemeBase( configDir, configFile ), paletteSaved( false ), polishLock( false ), menuCache( 0 ), vsliderCache( 0 ), brushHandle( 0 ), brushHandleSet( false ), kickerMode( false ) { - mtfstyle = QStyleFactory::create( "Motif" ); + mtfstyle = TQStyleFactory::create( "Motif" ); if ( !mtfstyle ) - mtfstyle = QStyleFactory::create( *( QStyleFactory::keys().begin() ) ); + mtfstyle = TQStyleFactory::create( *( TQStyleFactory::keys().begin() ) ); } KThemeStyle::~KThemeStyle() @@ -412,14 +412,14 @@ KThemeStyle::~KThemeStyle() } -void KThemeStyle::polish( QApplication * app ) +void KThemeStyle::polish( TQApplication * app ) { if (!qstrcmp(app->argv()[0], "kicker")) kickerMode = true; } -void KThemeStyle::polish( QPalette &p ) +void KThemeStyle::polish( TQPalette &p ) { if ( polishLock ) { @@ -438,41 +438,41 @@ void KThemeStyle::polish( QPalette &p ) if ( isPixmap( Background ) ) { - QBrush bgBrush( p.color( QPalette::Normal, - QColorGroup::Background ), + TQBrush bgBrush( p.color( TQPalette::Normal, + TQColorGroup::Background ), *uncached( Background ) ); brushHandle = uncached( Background )->handle(); brushHandleSet = true; - p.setBrush( QColorGroup::Background, bgBrush ); + p.setBrush( TQColorGroup::Background, bgBrush ); } } void KThemeStyle::paletteChanged() { - QPalette p = QApplication::palette(); + TQPalette p = TQApplication::palette(); polish( p ); - QApplication::setPalette( p ); + TQApplication::setPalette( p ); } -void KThemeStyle::unPolish( QApplication *app ) +void KThemeStyle::unPolish( TQApplication *app ) { app->setPalette( oldPalette, true ); } -bool KThemeStyle::eventFilter( QObject* object, QEvent* event ) +bool KThemeStyle::eventFilter( TQObject* object, TQEvent* event ) { if( object->inherits("KActiveLabel")) { - if(event->type() == QEvent::Move || event->type() == QEvent::Resize || - event->type() == QEvent::Show) + if(event->type() == TQEvent::Move || event->type() == TQEvent::Resize || + event->type() == TQEvent::Show) { - QWidget *w = static_cast<QWidget*>(object); - QPoint pos(0, 0); + TQWidget *w = static_cast<TQWidget*>(object); + TQPoint pos(0, 0); pos = w->mapTo(w->topLevelWidget(), pos); - QPixmap pix(uncached( Background )->size()); - QPainter p; + TQPixmap pix(uncached( Background )->size()); + TQPainter p; p.begin(&pix); p.drawTiledPixmap(0, 0, uncached( Background )->width(), @@ -480,17 +480,17 @@ bool KThemeStyle::eventFilter( QObject* object, QEvent* event ) *uncached( Background ), pos.x(), pos.y()); p.end(); - QPalette pal(w->palette()); - QBrush brush( pal.color( QPalette::Normal, - QColorGroup::Background), + TQPalette pal(w->palette()); + TQBrush brush( pal.color( TQPalette::Normal, + TQColorGroup::Background), pix ); - pal.setBrush(QColorGroup::Base, brush); + pal.setBrush(TQColorGroup::Base, brush); w->setPalette(pal); } } - if (!qstrcmp(object->name(), "kde toolbar widget") && object->inherits("QLabel")) + if (!qstrcmp(object->name(), "kde toolbar widget") && object->inherits("TQLabel")) { - QWidget* lb = static_cast<QWidget*>(object); + TQWidget* lb = static_cast<TQWidget*>(object); if (lb->backgroundMode() == Qt::PaletteButton) lb->setBackgroundMode(Qt::PaletteBackground); lb->removeEventFilter(this); @@ -499,12 +499,12 @@ bool KThemeStyle::eventFilter( QObject* object, QEvent* event ) return KStyle::eventFilter(object, event); } -void KThemeStyle::polish( QWidget *w ) +void KThemeStyle::polish( TQWidget *w ) { - if (::qt_cast<QStatusBar*>(w)) - w->setPaletteBackgroundColor(QApplication::palette().color(QPalette::Normal, QColorGroup::Background)); + if (::qt_cast<TQStatusBar*>(w)) + w->setPaletteBackgroundColor(TQApplication::palette().color(TQPalette::Normal, TQColorGroup::Background)); - if (::qt_cast<QLabel*>(w) && !qstrcmp(w->name(), "kde toolbar widget")) + if (::qt_cast<TQLabel*>(w) && !qstrcmp(w->name(), "kde toolbar widget")) w->installEventFilter(this); if (w->backgroundPixmap() && !w->isTopLevel() && @@ -514,7 +514,7 @@ void KThemeStyle::polish( QWidget *w ) //The brushHandle check verifies that the bg pixmap is actually the brush.. if (!brushHandleSet || brushHandle == w->backgroundPixmap()->handle()) { - w->setBackgroundOrigin( QWidget::WindowOrigin ); + w->setBackgroundOrigin( TQWidget::WindowOrigin ); } } @@ -528,12 +528,12 @@ void KThemeStyle::polish( QWidget *w ) { polishLock = true; - QColorGroup clrGroup( Qt::black, QColor( 255, 255, 220 ), - QColor( 96, 96, 96 ), Qt::black, Qt::black, - Qt::black, QColor( 255, 255, 220 ) ); - QPalette toolTip ( clrGroup, clrGroup, clrGroup ); + TQColorGroup clrGroup( Qt::black, TQColor( 255, 255, 220 ), + TQColor( 96, 96, 96 ), Qt::black, Qt::black, + Qt::black, TQColor( 255, 255, 220 ) ); + TQPalette toolTip ( clrGroup, clrGroup, clrGroup ); - QToolTip::setPalette( toolTip ); + TQToolTip::setPalette( toolTip ); polishLock = false; } @@ -543,20 +543,20 @@ void KThemeStyle::polish( QWidget *w ) return ; } - if ( ::qt_cast<QMenuBar*>(w) ) + if ( ::qt_cast<TQMenuBar*>(w) ) { - w->setBackgroundMode( QWidget::NoBackground ); + w->setBackgroundMode( TQWidget::NoBackground ); } else if ( w->inherits( "KToolBarSeparator" ) || w->inherits( "QToolBarSeparator" ) ) { - w->setBackgroundMode( QWidget::PaletteBackground ); + w->setBackgroundMode( TQWidget::PaletteBackground ); } - else if ( ::qt_cast<QPopupMenu*>(w) ) + else if ( ::qt_cast<TQPopupMenu*>(w) ) { popupPalette = w->palette(); if ( isColor( MenuItem ) || isColor( MenuItemDown ) ) { - QPalette newPal( w->palette() ); + TQPalette newPal( w->palette() ); if ( isColor( MenuItem ) ) { newPal.setActive( *colorGroup( newPal.active(), MenuItem ) ); @@ -569,13 +569,13 @@ void KThemeStyle::polish( QWidget *w ) w->setPalette( newPal ); } - w->setBackgroundMode( QWidget::NoBackground ); + w->setBackgroundMode( TQWidget::NoBackground ); } - else if ( ::qt_cast<QCheckBox*>(w) ) + else if ( ::qt_cast<TQCheckBox*>(w) ) { if ( isColor( IndicatorOff ) || isColor( IndicatorOn ) ) { - QPalette newPal( w->palette() ); + TQPalette newPal( w->palette() ); if ( isColor( IndicatorOff ) ) { newPal.setActive( *colorGroup( newPal.active(), IndicatorOff ) ); @@ -586,11 +586,11 @@ void KThemeStyle::polish( QWidget *w ) w->setPalette( newPal ); } } - else if ( ::qt_cast<QRadioButton*>(w) ) + else if ( ::qt_cast<TQRadioButton*>(w) ) { if ( isColor( ExIndicatorOff ) || isColor( ExIndicatorOn ) ) { - QPalette newPal( w->palette() ); + TQPalette newPal( w->palette() ); if ( isColor( ExIndicatorOff ) ) { newPal.setActive( *colorGroup( newPal.active(), ExIndicatorOff ) ); @@ -606,45 +606,45 @@ void KThemeStyle::polish( QWidget *w ) KStyle::polish( w ); } -void KThemeStyle::unPolish( QWidget* w ) +void KThemeStyle::unPolish( TQWidget* w ) { if (w->backgroundPixmap() && !w->isTopLevel()) { //The brushHandle check verifies that the bg pixmap is actually the brush.. if (!brushHandleSet || brushHandle ==w->backgroundPixmap()->handle()) { - w->setBackgroundOrigin( QWidget::WidgetOrigin ); + w->setBackgroundOrigin( TQWidget::WidgetOrigin ); } } //Toolbar labels should nornally be PaletteButton - if ( ::qt_cast<QLabel*>(w) && !qstrcmp(w->name(), "kde toolbar widget")) - w->setBackgroundMode( QWidget::PaletteButton ); + if ( ::qt_cast<TQLabel*>(w) && !qstrcmp(w->name(), "kde toolbar widget")) + w->setBackgroundMode( TQWidget::PaletteButton ); //The same for menu bars, popup menus - else if ( ::qt_cast<QMenuBar*>(w) || ::qt_cast<QPopupMenu*>(w) ) - w->setBackgroundMode( QWidget::PaletteButton ); + else if ( ::qt_cast<TQMenuBar*>(w) || ::qt_cast<TQPopupMenu*>(w) ) + w->setBackgroundMode( TQWidget::PaletteButton ); //For toolbar internal separators, return to button, too (can't use qt_cast here since don't have access to the class) else if ( w->inherits( "KToolBarSeparator" ) || w->inherits( "QToolBarSeparator" ) ) - w->setBackgroundMode( QWidget::PaletteButton ); + w->setBackgroundMode( TQWidget::PaletteButton ); //For scrollbars, we don't do much, since the widget queries the style on the switch //Drop some custom palettes. ### this really should check the serial number to be 100% correct. - if ( ::qt_cast<QPopupMenu*>(w) || ::qt_cast<QCheckBox*>(w) || ::qt_cast<QRadioButton*>(w) || ::qt_cast<QStatusBar*>(w) ) + if ( ::qt_cast<TQPopupMenu*>(w) || ::qt_cast<TQCheckBox*>(w) || ::qt_cast<TQRadioButton*>(w) || ::qt_cast<TQStatusBar*>(w) ) w->unsetPalette(); KStyle::unPolish( w ); } -void KThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, bool +void KThemeStyle::drawBaseButton( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, bool rounded, WidgetType type ) const { int offset = borderPixmap( type ) ? 0 : decoWidth( type ) ; //##### This is wrong, but the code relies on it.. - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); // handle reverse bevel here since it uses decowidth differently if ( gradientHint( type ) == GrReverseBevel ) @@ -666,7 +666,7 @@ void KThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, type ) ); else p->fillRect( x + 4, y + 4, w - 6, h - offset * 6, - g.brush( QColorGroup::Button ) ); + g.brush( TQColorGroup::Button ) ); } else @@ -685,7 +685,7 @@ void KThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, //Sometimes border covers the whole thing - in that case, avoid drawing the base. { p->fillRect( x + offset, y + offset, w - offset * 2, h - offset * 2, - g.brush( QColorGroup::Button ) ); + g.brush( TQColorGroup::Button ) ); } } if ( borderPixmap( type ) ) @@ -700,8 +700,8 @@ void KThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, p->setPen( oldPen ); } -void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect & r, const QColorGroup & g_base, - SFlags flags, const QStyleOption & opt ) const +void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRect & r, const TQColorGroup & g_base, + SFlags flags, const TQStyleOption & opt ) const { bool handled = false; int x, y, w, h; @@ -711,7 +711,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect bool enabled = ( flags & Style_Enabled ); bool down = ( flags & Style_Down ); bool on = flags & Style_On; - QColorGroup g = g_base; + TQColorGroup g = g_base; switch ( pe ) { @@ -720,7 +720,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect case PE_ArrowRight: case PE_ArrowLeft: { - QRect r( x, y, w, h ); + TQRect r( x, y, w, h ); if ( r.width() > 12 ) { r.setRect( r.x() + ( r.width() - 12 ) / 2, r.y(), 12, r.height() ); @@ -757,7 +757,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect return ; } - const QColorGroup *cg = colorGroup( g, widget ); + const TQColorGroup *cg = colorGroup( g, widget ); // Standard arrow types if ( arrowType() == MotifArrow ) { @@ -768,7 +768,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect else if ( arrowType() == SmallArrow ) { // #### FIXME: This should be like the Platinum style - uses HighColor look for now - QPointArray a; + TQPointArray a; switch ( pe ) { @@ -810,7 +810,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect } else { - QPointArray a; + TQPointArray a; int x2 = x + w - 1, y2 = y + h - 1; switch ( pe ) { @@ -827,9 +827,9 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect a.setPoints( 4, x, y, x, y2, x2, y + h / 2, x, y ); break; } - QBrush oldBrush = p->brush(); - QPen oldPen = p->pen(); - p->setBrush( cg->brush( QColorGroup::Shadow ) ); + TQBrush oldBrush = p->brush(); + TQPen oldPen = p->pen(); + p->setBrush( cg->brush( TQColorGroup::Shadow ) ); p->setPen( cg->shadow() ); p->drawPolygon( a ); p->setBrush( oldBrush ); @@ -876,7 +876,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect } else //Small hack to ensure the checkmark gets painter proper color.. { - g.setColor( QColorGroup::Text, g.buttonText() ); + g.setColor( TQColorGroup::Text, g.buttonText() ); } break; } @@ -895,14 +895,14 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect { if ( isPixmap( ( flags & Style_On || flags & Style_Down ) ? ExIndicatorOn : ExIndicatorOff ) ) { - const QBitmap * mask = uncached( ( flags & Style_On || flags & Style_Down ) ? ExIndicatorOn : ExIndicatorOff ) ->mask(); + const TQBitmap * mask = uncached( ( flags & Style_On || flags & Style_Down ) ? ExIndicatorOn : ExIndicatorOff ) ->mask(); if ( mask ) { p->setPen( Qt::color1 ); p->drawPixmap( x, y, *mask ); } else - p->fillRect( x, y, w, h, QBrush( color1, SolidPattern ) ); + p->fillRect( x, y, w, h, TQBrush( color1, SolidPattern ) ); handled = true; } break; @@ -912,7 +912,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect { if ( isPixmap( ( flags & Style_On ) ? IndicatorOn : IndicatorOff ) ) { - const QBitmap * mask = uncached( ( flags & Style_On ) ? IndicatorOn : + const TQBitmap * mask = uncached( ( flags & Style_On ) ? IndicatorOn : IndicatorOff ) ->mask(); if ( mask ) { @@ -920,7 +920,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect p->drawPixmap( x, y, *mask ); } else - p->fillRect( x, y, w, h, QBrush( color1, SolidPattern ) ); + p->fillRect( x, y, w, h, TQBrush( color1, SolidPattern ) ); handled = true; } break; @@ -965,7 +965,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect } case PE_PanelMenuBar: { - QPixmap* cache = makeMenuBarCache(w, h); + TQPixmap* cache = makeMenuBarCache(w, h); p->drawPixmap( x, y, *cache); handled = true; break; @@ -977,7 +977,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect if ( !isPixmap( widget ) ) { - p->fillRect( r, colorGroup( g, widget ) ->brush( QColorGroup::Background ) ); + p->fillRect( r, colorGroup( g, widget ) ->brush( TQColorGroup::Background ) ); // Do the borders and frame drawShade( p, r.x(), r.y(), r.width(), r.height(), *colorGroup( g, widget ), true, false, @@ -1006,7 +1006,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect down, false, down ? ScrollButtonDown : ScrollButton ); drawPrimitive( ( horizontal ) ? PE_ArrowRight : PE_ArrowDown, p , - QRect( r.x() + 3, r.y() + 3, r.width() - 6, r.height() - 6 ), + TQRect( r.x() + 3, r.y() + 3, r.width() - 6, r.height() - 6 ), *colorGroup( g, down ? ScrollButtonDown : ScrollButton ), flags ); @@ -1021,7 +1021,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect down, false, down ? ScrollButtonDown : ScrollButton ); drawPrimitive( ( horizontal ) ? PE_ArrowLeft : PE_ArrowUp, p , - QRect( r.x() + 3, r.y() + 3, r.width() - 6, r.height() - 6 ), + TQRect( r.x() + 3, r.y() + 3, r.width() - 6, r.height() - 6 ), *colorGroup( g, down ? ScrollButtonDown : ScrollButton ), flags ); handled = true; @@ -1029,7 +1029,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect } case PE_ScrollBarSlider: { - bool active = ( flags & Style_Active ) || ( flags & Style_Down ); //activeControl == QStyle::AddLine; + bool active = ( flags & Style_Active ) || ( flags & Style_Down ); //activeControl == TQStyle::AddLine; bool horizontal = ( flags & Style_Horizontal ); int offsetH = horizontal ? 0: decoWidth(VScrollGroove) ; int offsetV = horizontal ? decoWidth(HScrollGroove):0; @@ -1074,7 +1074,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect -QPixmap* KThemeStyle::makeMenuBarCache(int w, int h) const +TQPixmap* KThemeStyle::makeMenuBarCache(int w, int h) const { if (menuCache) { @@ -1086,10 +1086,10 @@ QPixmap* KThemeStyle::makeMenuBarCache(int w, int h) const return menuCache; } - const QColorGroup *g = colorGroup( QApplication::palette().active(), MenuBar); + const TQColorGroup *g = colorGroup( TQApplication::palette().active(), MenuBar); - menuCache = new QPixmap ( w, h ); - QPainter p(menuCache); + menuCache = new TQPixmap ( w, h ); + TQPainter p(menuCache); drawBaseButton( &p, 0, 0, w, h, *g, false, false, MenuBar ); p.end(); return menuCache; @@ -1097,12 +1097,12 @@ QPixmap* KThemeStyle::makeMenuBarCache(int w, int h) const void KThemeStyle::drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags how , - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { bool handled = false; int x, y, w, h; @@ -1113,7 +1113,7 @@ void KThemeStyle::drawControl( ControlElement element, { case CE_PushButton: { - const QPushButton * btn = ( const QPushButton* ) widget; + const TQPushButton * btn = ( const TQPushButton* ) widget; bool sunken = btn->isOn() || btn->isDown(); int diw = pixelMetric( PM_ButtonDefaultIndicator, btn ); drawBaseButton( p, diw, diw, w - 2 * diw, h - 2 * diw, @@ -1126,7 +1126,7 @@ void KThemeStyle::drawControl( ControlElement element, } case CE_PushButtonLabel: { - const QPushButton* button = ( const QPushButton* ) widget; + const TQPushButton* button = ( const TQPushButton* ) widget; bool active = button->isOn() || button->isDown(); int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1143,7 +1143,7 @@ void KThemeStyle::drawControl( ControlElement element, if ( button->isMenuButton() ) { int dx = pixelMetric( PM_MenuButtonIndicator, widget ); - drawPrimitive( PE_ArrowDown, p, QRect( x + w - dx - 2, y + 2, dx, h - 4 ), + drawPrimitive( PE_ArrowDown, p, TQRect( x + w - dx - 2, y + 2, dx, h - 4 ), cg, how, opt ); w -= dx; } @@ -1151,15 +1151,15 @@ void KThemeStyle::drawControl( ControlElement element, // Draw the icon if there is one if ( button->iconSet() && !button->iconSet() ->isNull() ) { - QIconSet::Mode mode = QIconSet::Disabled; - QIconSet::State state = QIconSet::Off; + TQIconSet::Mode mode = TQIconSet::Disabled; + TQIconSet::State state = TQIconSet::Off; if ( button->isEnabled() ) - mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + mode = button->hasFocus() ? TQIconSet::Active : TQIconSet::Normal; if ( button->isToggleButton() && button->isOn() ) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap pixmap = button->iconSet() ->pixmap( QIconSet::Small, mode, state ); + TQPixmap pixmap = button->iconSet() ->pixmap( TQIconSet::Small, mode, state ); // Center the iconset if there's no text or pixmap if (button->text().isEmpty() && !button->pixmap()) @@ -1177,20 +1177,20 @@ void KThemeStyle::drawControl( ControlElement element, if ( active || button->isDefault() && button->isEnabled() ) { // Draw "fake" bold text - this enables the font metrics to remain - // the same as computed in QPushButton::sizeHint(), but gives + // the same as computed in TQPushButton::sizeHint(), but gives // a reasonable bold effect. int i; // Text shadow for ( i = 0; i < 2; i++ ) - drawItem( p, QRect( x + i + 1, y + 1, w, h ), AlignCenter | ShowPrefix, + drawItem( p, TQRect( x + i + 1, y + 1, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), NULL, button->text(), -1, active ? &button->colorGroup().dark() : &button->colorGroup().mid() ); // Normal Text for ( i = 0; i < 2; i++ ) - drawItem( p, QRect( x + i, y, w, h ), AlignCenter | ShowPrefix, + drawItem( p, TQRect( x + i, y, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), true, i == 0 ? button->pixmap() : NULL, button->text(), -1, active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); @@ -1199,18 +1199,18 @@ void KThemeStyle::drawControl( ControlElement element, { if ( button->isEnabled() ) { - drawItem( p, QRect( x, y, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), + drawItem( p, TQRect( x, y, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), true, button->pixmap(), button->text(), -1, active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); } else { //TODO: Handle reversed - drawItem( p, QRect( x + 1, y + 1, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), + drawItem( p, TQRect( x + 1, y + 1, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), true, button->pixmap(), button->text(), -1, &button->colorGroup().light() ); - drawItem( p, QRect( x, y, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), + drawItem( p, TQRect( x, y, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), true, button->pixmap(), button->text(), -1, &button->colorGroup().buttonText() ); } @@ -1219,7 +1219,7 @@ void KThemeStyle::drawControl( ControlElement element, // Draw a focus rect if the button has focus if ( how & Style_HasFocus ) drawPrimitive( PE_FocusRect, p, - QStyle::visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ), + TQStyle::visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ), cg, how ); handled = true; break; @@ -1229,7 +1229,7 @@ void KThemeStyle::drawControl( ControlElement element, { //Expand to cover entire region drawPrimitive(PE_PanelMenuBar, p, - QRect(0,0,r.width()+r.x()*2, r.height()+r.y()*2), + TQRect(0,0,r.width()+r.x()*2, r.height()+r.y()*2), cg, Style_Default); handled = true; break; @@ -1237,22 +1237,22 @@ void KThemeStyle::drawControl( ControlElement element, case CE_TabBarTab: { - const QTabBar* tb = ( const QTabBar* ) widget; - QTabBar::Shape tbs = tb->shape(); + const TQTabBar* tb = ( const TQTabBar* ) widget; + TQTabBar::Shape tbs = tb->shape(); bool selected = how & Style_Selected; WidgetType widget = selected ? ActiveTab : InactiveTab; - const QColorGroup *cg = colorGroup( tb->colorGroup(), widget ); + const TQColorGroup *cg = colorGroup( tb->colorGroup(), widget ); int i; int x2 = x + w - 1, y2 = y + h - 1; int bWidth = borderWidth( widget ); int hWidth = highlightWidth( widget ); handled = true; - if ( tbs == QTabBar::RoundedAbove || tbs == QTabBar::TriangularAbove ) + if ( tbs == TQTabBar::RoundedAbove || tbs == TQTabBar::TriangularAbove ) { if ( !selected ) { p->fillRect( x, y, x2 - x + 1, 2, - tb->palette().active().brush( QColorGroup::Background ) ); + tb->palette().active().brush( TQColorGroup::Background ) ); y += 2; } p->setPen( cg->text() ); @@ -1314,8 +1314,8 @@ void KThemeStyle::drawControl( ControlElement element, else p->fillRect( x, y, x2 - x + 1, y2 - y + 1, cg->background() ); } - else if ( tb->shape() == QTabBar::RoundedBelow || - tb->shape() == QTabBar::TriangularBelow ) + else if ( tb->shape() == TQTabBar::RoundedBelow || + tb->shape() == TQTabBar::TriangularBelow ) { if ( widget == ActiveTab ) widget = RotActiveTab; @@ -1325,7 +1325,7 @@ void KThemeStyle::drawControl( ControlElement element, if ( !selected ) { p->fillRect( x, y2 - 2, x2 - x + 1, 2, - tb->palette().active().brush( QColorGroup::Background ) ); + tb->palette().active().brush( TQColorGroup::Background ) ); y2 -= 2; } p->setPen( cg->text() ); @@ -1392,20 +1392,20 @@ void KThemeStyle::drawControl( ControlElement element, { r.rect( &x, &y, &w, &h ); - QMenuItem *mi = opt.menuItem(); - QMenuBar *mb = ( QMenuBar* ) widget; - QRect pr = mb->rect(); + TQMenuItem *mi = opt.menuItem(); + TQMenuBar *mb = ( TQMenuBar* ) widget; + TQRect pr = mb->rect(); bool active = how & Style_Active; //bool focused = how & Style_HasFocus; - const QColorGroup *g = colorGroup( cg, active ? MenuBarItem : MenuBar ); - QColor btext = g->buttonText(); + const TQColorGroup *g = colorGroup( cg, active ? MenuBarItem : MenuBar ); + TQColor btext = g->buttonText(); - QPixmap* cache = makeMenuBarCache(pr.width(), pr.height()); + TQPixmap* cache = makeMenuBarCache(pr.width(), pr.height()); - QPixmap buf( w, pr.height() ); + TQPixmap buf( w, pr.height() ); bitBlt(&buf, 0, 0, cache, x, y, w, pr.height()); - QPainter p2( &buf ); + TQPainter p2( &buf ); if ( active ) { @@ -1415,7 +1415,7 @@ void KThemeStyle::drawControl( ControlElement element, p2.end(); p->drawPixmap( x, y, buf, 0, 0, w, h ); - drawItem( p, QRect(x,y,w,h), AlignCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, + drawItem( p, TQRect(x,y,w,h), AlignCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, *g, mi->isEnabled(), mi->pixmap(), mi->text(), -1, &btext ); handled = true; @@ -1427,8 +1427,8 @@ void KThemeStyle::drawControl( ControlElement element, int x, y, w, h; r.rect( &x, &y, &w, &h ); - const QPopupMenu *popupmenu = ( const QPopupMenu * ) widget; - QMenuItem *mi = opt.menuItem(); + const TQPopupMenu *popupmenu = ( const TQPopupMenu * ) widget; + TQMenuItem *mi = opt.menuItem(); if ( mi ) { separator = mi->isSeparator(); @@ -1440,10 +1440,10 @@ void KThemeStyle::drawControl( ControlElement element, bool checkable = popupmenu->isCheckable(); bool active = how & Style_Active; bool etchtext = styleHint( SH_EtchDisabledText, 0 ); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); - const QColorGroup& cg_ours = *colorGroup( cg, active ? MenuItemDown : MenuItem ); - //QColor btext = cg_ours.buttonText(); + const TQColorGroup& cg_ours = *colorGroup( cg, active ? MenuItemDown : MenuItem ); + //TQColor btext = cg_ours.buttonText(); if ( checkable ) @@ -1472,9 +1472,9 @@ void KThemeStyle::drawControl( ControlElement element, { p->fillRect( x + dw, y + dw, w - dw * 2, h - dw * 2, - cg_ours.brush( QColorGroup::Background ) ); - //cg.brush( QColorGroup::Background )); - //colorGroup( cg_ours, MenuItem ) ->brush( QColorGroup::Background ) ); + cg_ours.brush( TQColorGroup::Background ) ); + //cg.brush( TQColorGroup::Background )); + //colorGroup( cg_ours, MenuItem ) ->brush( TQColorGroup::Background ) ); } else { @@ -1491,14 +1491,14 @@ void KThemeStyle::drawControl( ControlElement element, // Do we have an icon? if ( mi->iconSet() ) { - QIconSet::Mode mode; - QRect cr = visualRect( QRect( x, y, checkcol, h ), r ); + TQIconSet::Mode mode; + TQRect cr = visualRect( TQRect( x, y, checkcol, h ), r ); // Select the correct icon from the iconset if ( active ) - mode = enabled ? QIconSet::Active : QIconSet::Disabled; + mode = enabled ? TQIconSet::Active : TQIconSet::Disabled; else - mode = enabled ? QIconSet::Normal : QIconSet::Disabled; + mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled; // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon @@ -1506,10 +1506,10 @@ void KThemeStyle::drawControl( ControlElement element, drawBaseButton( p, cr.x(), cr.y(), cr.width(), cr.height(), *colorGroup( cg_ours, BevelDown ), true, false, BevelDown ); // Draw the icon - QPixmap pixmap = mi->iconSet() ->pixmap( QIconSet::Small, mode ); + TQPixmap pixmap = mi->iconSet() ->pixmap( TQIconSet::Small, mode ); int pixw = pixmap.width(); int pixh = pixmap.height(); - QRect pmr( 0, 0, pixw, pixh ); + TQRect pmr( 0, 0, pixw, pixh ); pmr.moveCenter( cr.center() ); p->setPen( cg_ours.highlightedText() ); p->drawPixmap( pmr.topLeft(), pixmap ); @@ -1524,13 +1524,13 @@ void KThemeStyle::drawControl( ControlElement element, // if it's active the "pressed" background is already drawn //if ( ! active ) // qDrawShadePanel( p, cx, y, checkcol, h, cg_ours, true, 1, - // &cg_ours.brush(QColorGroup::Midlight) ); + // &cg_ours.brush(TQColorGroup::Midlight) ); // Draw the checkmark SFlags cflags = Style_Default; cflags |= active ? Style_Enabled : Style_On; - drawPrimitive( PE_CheckMark, p, QRect( cx + itemFrame, y + itemFrame, + drawPrimitive( PE_CheckMark, p, TQRect( cx + itemFrame, y + itemFrame, checkcol - itemFrame * 2, h - itemFrame * 2 ), cg_ours, cflags ); } @@ -1552,7 +1552,7 @@ void KThemeStyle::drawControl( ControlElement element, // This color will be used instead of the above if the menu item // is active and disabled at the same time. (etched text) - QColor discol = cg_ours.mid(); + TQColor discol = cg_ours.mid(); // Does the menu item draw it's own label? if ( mi->custom() ) @@ -1575,7 +1575,7 @@ void KThemeStyle::drawControl( ControlElement element, else { // The menu item doesn't draw it's own label - QString s = mi->text(); + TQString s = mi->text(); // Does the menu item have a text label? if ( !s.isNull() ) @@ -1623,7 +1623,7 @@ void KThemeStyle::drawControl( ControlElement element, // Check if it has a pixmap instead else if ( mi->pixmap() ) { - QPixmap * pixmap = mi->pixmap(); + TQPixmap * pixmap = mi->pixmap(); // Draw the pixmap if ( pixmap->depth() == 1 ) @@ -1643,7 +1643,7 @@ void KThemeStyle::drawControl( ControlElement element, { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; int dim = 10 - itemFrame; //We're not very useful to inherit off, so just hardcode.. - QRect vr = visualRect( QRect( x + w - arrowHMargin - itemFrame - dim, + TQRect vr = visualRect( TQRect( x + w - arrowHMargin - itemFrame - dim, y + h / 2 - dim / 2, dim, dim ), r ); // Draw an arrow at the far end of the menu item @@ -1652,7 +1652,7 @@ void KThemeStyle::drawControl( ControlElement element, if ( enabled ) discol = cg_ours.buttonText(); - QColorGroup g2( discol, cg_ours.highlight(), white, white, + TQColorGroup g2( discol, cg_ours.highlight(), white, white, enabled ? white : discol, discol, white ); drawPrimitive( arrow, p, vr, g2, Style_Enabled | Style_Down ); @@ -1666,10 +1666,10 @@ void KThemeStyle::drawControl( ControlElement element, } case CE_ProgressBarGroove: { - QBrush bg; - const QColorGroup * cg2 = colorGroup( cg, ProgressBg ); + TQBrush bg; + const TQColorGroup * cg2 = colorGroup( cg, ProgressBg ); qDrawWinPanel( p, r, *cg2, true ); - bg.setColor( cg2->color( QColorGroup::Background ) ); + bg.setColor( cg2->color( TQColorGroup::Background ) ); if ( isPixmap( ProgressBg ) ) bg.setPixmap( *uncached( ProgressBg ) ); p->fillRect( x + 2, y + 2, w - 4, h - 4, bg ); @@ -1679,10 +1679,10 @@ void KThemeStyle::drawControl( ControlElement element, } case CE_ProgressBarContents: { - const QProgressBar* pb = (const QProgressBar*)widget; - QRect cr = subRect(SR_ProgressBarContents, widget); + const TQProgressBar* pb = (const TQProgressBar*)widget; + TQRect cr = subRect(SR_ProgressBarContents, widget); double progress = pb->progress(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int steps = pb->totalSteps(); int pstep = 0; @@ -1718,11 +1718,11 @@ void KThemeStyle::drawControl( ControlElement element, else { //TODO:Optimize - QPixmap buf( width, h ); - QPainter p2( &buf ); + TQPixmap buf( width, h ); + TQPainter p2( &buf ); drawBaseButton( &p2, 0, 0, width, h, *colorGroup( cg, ProgressBar ), false, false, ProgressBar ); p2.end(); - QPixmap mirroredPix = QPixmap( buf.convertToImage().mirror( true, false ) ); + TQPixmap mirroredPix = TQPixmap( buf.convertToImage().mirror( true, false ) ); bitBlt( p->device(), x + w - width - pstep, y, &mirroredPix ); } } @@ -1741,10 +1741,10 @@ void KThemeStyle::drawControl( ControlElement element, void KThemeStyle::drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { bool handled = false; int x, y, w, h; @@ -1771,12 +1771,12 @@ void KThemeStyle::drawControlMask( ControlElement element, void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { bool handled = false; int x, y, w, h; @@ -1787,7 +1787,7 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, { if ( !roundSlider() ) { - const QSlider * slider = ( const QSlider* ) widget; + const TQSlider * slider = ( const TQSlider* ) widget; bool horizontal = slider->orientation() == Horizontal; if ( horizontal ) { @@ -1803,15 +1803,15 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, else { //This code is from HighColorDefault.. - const QSlider* slider = ( const QSlider* ) widget; + const TQSlider* slider = ( const TQSlider* ) widget; bool horizontal = slider->orientation() == Horizontal; int gcenter = ( horizontal ? r.height() : r.width() ) / 2; - QRect gr; + TQRect gr; if ( horizontal ) - gr = QRect( r.x(), r.y() + gcenter - 3, r.width(), 7 ); + gr = TQRect( r.x(), r.y() + gcenter - 3, r.width(), 7 ); else - gr = QRect( r.x() + gcenter - 3, r.y(), 7, r.height() ); + gr = TQRect( r.x() + gcenter - 3, r.y(), 7, r.height() ); int x, y, w, h; gr.rect( &x, &y, &w, &h ); @@ -1839,7 +1839,7 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, { if ( isPixmap( Slider ) ) { - const QSlider * slider = ( const QSlider* ) widget; + const TQSlider * slider = ( const TQSlider* ) widget; bool horizontal = slider->orientation() == Horizontal; if ( horizontal ) { @@ -1850,9 +1850,9 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, { if ( !vsliderCache ) { - QWMatrix r270; + TQWMatrix r270; r270.rotate( 270 ); - vsliderCache = new QPixmap( uncached( Slider ) ->xForm( r270 ) ); + vsliderCache = new TQPixmap( uncached( Slider ) ->xForm( r270 ) ); if ( uncached( Slider ) ->mask() ) vsliderCache->setMask( uncached( Slider ) ->mask() ->xForm( r270 ) ); } @@ -1864,7 +1864,7 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, { //This code again from HighColor.. //...except sans the gradient.. - const QSlider* slider = ( const QSlider* ) widget; + const TQSlider* slider = ( const TQSlider* ) widget; bool horizontal = slider->orientation() == Horizontal; int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1890,7 +1890,7 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, p->setPen( cg.mid() ); p->drawLine( x + 3, y2 - 2, x2 - 2, y2 - 2 ); p->drawLine( x2 - 2, y + 3, x2 - 2, y2 - 2 ); - p->fillRect( QRect( x + 3, y + 3, w - 6, h - 6 ), + p->fillRect( TQRect( x + 3, y + 3, w - 6, h - 6 ), cg.button() ); // Paint riffles @@ -1950,10 +1950,10 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, -void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, const QWidget * widget, - const QRect & r, const QColorGroup & g, SFlags how , +void KThemeStyle::drawComplexControl ( ComplexControl control, TQPainter * p, const TQWidget * widget, + const TQRect & r, const TQColorGroup & g, SFlags how , SCFlags controls, SCFlags active, - const QStyleOption & opt ) const + const TQStyleOption & opt ) const { bool handled = false; int x, y, w, h; @@ -1967,8 +1967,8 @@ void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, con { case CC_ToolButton: { - const QToolButton * toolbutton = ( const QToolButton * ) widget; - QRect button, menu; + const TQToolButton * toolbutton = ( const TQToolButton * ) widget; + TQRect button, menu; button = querySubControlMetrics( control, widget, SC_ToolButton, opt ); menu = querySubControlMetrics( control, widget, SC_ToolButtonMenu, opt ); @@ -1996,7 +1996,7 @@ void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, con if ( toolbutton->hasFocus() && !toolbutton->focusProxy() ) { - QRect fr = toolbutton->rect(); + TQRect fr = toolbutton->rect(); fr.addCoords( 3, 3, -3, -3 ); drawPrimitive( PE_FocusRect, p, fr, g ); } @@ -2022,7 +2022,7 @@ void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, con if ( controls & SC_ComboBoxArrow ) { bool sunken = ( active == SC_ComboBoxArrow ); - QRect ar = QStyle::visualRect( + TQRect ar = TQStyle::visualRect( querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxArrow ), widget ); ar.rect( &x, &y, &w, &h ); @@ -2041,7 +2041,7 @@ void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, con else { - mtfstyle->drawPrimitive( PE_ArrowDown, p, QRect( x, y, w, h ), *colorGroup( g, widget ), sunken ? ( how | Style_Sunken ) : how, opt ); + mtfstyle->drawPrimitive( PE_ArrowDown, p, TQRect( x, y, w, h ), *colorGroup( g, widget ), sunken ? ( how | Style_Sunken ) : how, opt ); qDrawShadeRect( p, x, y, w, h, *colorGroup( g, widget ) ); //w-14, y+7+(h-15), 10, 3, } controls ^= SC_ComboBoxArrow; @@ -2050,14 +2050,14 @@ void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, con } case CC_ScrollBar: { - const QScrollBar *sb = ( const QScrollBar* ) widget; + const TQScrollBar *sb = ( const TQScrollBar* ) widget; bool maxedOut = ( sb->minValue() == sb->maxValue() ); bool horizontal = ( sb->orientation() == Qt::Horizontal ); SFlags sflags = ( ( horizontal ? Style_Horizontal : Style_Default ) | ( maxedOut ? Style_Default : Style_Enabled ) ); //Here, we don't do add page, subpage, etc., - QRect addline, subline, subline2, groove, slider; + TQRect addline, subline, subline2, groove, slider; subline = querySubControlMetrics( control, widget, SC_ScrollBarSubLine, opt ); addline = querySubControlMetrics( control, widget, SC_ScrollBarAddLine, opt ); groove = querySubControlMetrics( control, widget, SC_ScrollBarGroove, opt ); @@ -2065,12 +2065,12 @@ void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, con slider = querySubControlMetrics( control, widget, SC_ScrollBarSlider, opt ); subline2 = addline; - QPixmap buf( sb->width(), sb->height() ); - QPainter p2( &buf ); + TQPixmap buf( sb->width(), sb->height() ); + TQPainter p2( &buf ); if ( groove.isValid() ) { - p2.fillRect( groove, QColor( 255, 0, 0 ) ); + p2.fillRect( groove, TQColor( 255, 0, 0 ) ); drawPrimitive( PE_ScrollBarSubPage, &p2, groove, g, sflags | ( ( active == SC_ScrollBarSubPage ) ? Style_Down : Style_Default ) ); @@ -2098,7 +2098,7 @@ void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, con // Draw focus rect if ( sb->hasFocus() ) { - QRect fr( slider.x() + 2, slider.y() + 2, + TQRect fr( slider.x() + 2, slider.y() + 2, slider.width() - 5, slider.height() - 5 ); drawPrimitive( PE_FocusRect, &p2, fr, g, Style_Default ); } @@ -2124,7 +2124,7 @@ void KThemeStyle::drawComplexControl ( ComplexControl control, QPainter * p, con } -void KThemeStyle::drawBaseMask( QPainter *p, int x, int y, int w, int h, +void KThemeStyle::drawBaseMask( TQPainter *p, int x, int y, int w, int h, bool round ) const { // round edge fills @@ -2152,13 +2152,13 @@ void KThemeStyle::drawBaseMask( QPainter *p, int x, int y, int w, int h, 3, 1, 3, 2, 3, 3, 3, 4, 3, 0, 4, 1, 4, 2, 4, 3, 4, 4, 4 }; - QBrush fillBrush( color1, SolidPattern ); + TQBrush fillBrush( color1, SolidPattern ); p->setPen( color1 ); if ( round && w > 19 && h > 19 ) { int x2 = x + w - 1; int y2 = y + h - 1; - QPointArray a( QCOORDARRLEN( top_left_fill ), top_left_fill ); + TQPointArray a( QCOORDARRLEN( top_left_fill ), top_left_fill ); a.translate( 1, 1 ); p->drawPoints( a ); a.setPoints( QCOORDARRLEN( btm_left_fill ), btm_left_fill ); @@ -2184,7 +2184,7 @@ void KThemeStyle::drawBaseMask( QPainter *p, int x, int y, int w, int h, p->fillRect( x, y, w, h, fillBrush ); } -int KThemeStyle::styleHint( StyleHint sh, const QWidget *w, const QStyleOption &opt, QStyleHintReturn *shr ) const +int KThemeStyle::styleHint( StyleHint sh, const TQWidget *w, const TQStyleOption &opt, QStyleHintReturn *shr ) const { switch ( sh ) { @@ -2220,12 +2220,12 @@ int KThemeStyle::styleHint( StyleHint sh, const QWidget *w, const QStyleOption & * about excessive cache misses. This is a memory/speed tradeoff that I * have to test. */ -void KThemeStyle::drawShade( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, bool rounded, +void KThemeStyle::drawShade( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, bool rounded, int hWidth, int bWidth, ShadeStyle style ) const { int i, sc, bc, x2, y2; - QPen highPen, lowPen; + TQPen highPen, lowPen; if ( style == Motif ) { @@ -2242,8 +2242,8 @@ void KThemeStyle::drawShade( QPainter *p, int x, int y, int w, int h, if ( rounded && w > 19 && h > 19 ) { x2 = x + w - 1, y2 = y + h - 1; - QPointArray bPntArray, hPntArray, lPntArray; - QPointArray bLineArray, hLineArray, lLineArray; + TQPointArray bPntArray, hPntArray, lPntArray; + TQPointArray bLineArray, hLineArray, lLineArray; // borders for ( i = 0, bc = 0; i < bWidth; ++i ) { @@ -2312,8 +2312,8 @@ void KThemeStyle::drawShade( QPainter *p, int x, int y, int w, int h, // Rectangular buttons else { - QPointArray highShade( hWidth * 4 ); - QPointArray lowShade( hWidth * 4 ); + TQPointArray highShade( hWidth * 4 ); + TQPointArray lowShade( hWidth * 4 ); p->setPen( g.shadow() ); for ( i = 0; i < bWidth && w > 2 && h > 2; ++i, ++x, ++y, w -= 2, h -= 2 ) @@ -2353,8 +2353,8 @@ void KThemeStyle::drawShade( QPainter *p, int x, int y, int w, int h, -int KThemeStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem *mi, - const QFontMetrics &fm ) +int KThemeStyle::popupMenuItemHeight( bool /*checkable*/, TQMenuItem *mi, + const TQFontMetrics &fm ) { int h2, h = 0; int offset = QMAX( decoWidth( MenuItemDown ), decoWidth( MenuItem ) ) + 4; @@ -2372,7 +2372,7 @@ int KThemeStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem *mi, if ( mi->iconSet() ) { h2 = mi->iconSet() -> - pixmap( QIconSet::Small, QIconSet::Normal ).height() + offset; + pixmap( TQIconSet::Small, TQIconSet::Normal ).height() + offset; h = h2 > h ? h2 : h; } h2 = fm.height() + offset; diff --git a/kstyles/kthemestyle/kthemestyle.h b/kstyles/kthemestyle/kthemestyle.h index 9b7d54b60..00d6256e7 100644 --- a/kstyles/kthemestyle/kthemestyle.h +++ b/kstyles/kthemestyle/kthemestyle.h @@ -40,18 +40,18 @@ Copyright (C) 2000 Daniel M. Duley <[email protected]> #ifndef KTHEMESTYLE_H #define KTHEMESTYLE_H -#include <qglobal.h> +#include <tqglobal.h> #include "kthemebase.h" -#include <qwindowdefs.h> -#include <qobject.h> -#include <qbutton.h> -#include <qpushbutton.h> -#include <qscrollbar.h> -#include <qtabbar.h> -#include <qstring.h> -#include <qintdict.h> -#include <qmap.h> +#include <tqwindowdefs.h> +#include <tqobject.h> +#include <tqbutton.h> +#include <tqpushbutton.h> +#include <tqscrollbar.h> +#include <tqtabbar.h> +#include <tqstring.h> +#include <tqintdict.h> +#include <tqmap.h> /** @@ -76,74 +76,74 @@ public: * @param configFile A KConfig file to use as the theme configuration. * Defaults to ~/.kderc. */ - KThemeStyle( const QString& configDir, const QString &configFile = QString::null ); + KThemeStyle( const TQString& configDir, const TQString &configFile = TQString::null ); ~KThemeStyle(); - virtual int pixelMetric ( PixelMetric metric, const QWidget * widget = 0 ) const; + virtual int pixelMetric ( PixelMetric metric, const TQWidget * widget = 0 ) const; - virtual void drawPrimitive ( PrimitiveElement pe, QPainter * p, const QRect & r, const QColorGroup & cg, + virtual void drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRect & r, const TQColorGroup & cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; virtual void drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags how = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; virtual void drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& = QStyleOption::Default ) const; + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& = TQStyleOption::Default ) const; virtual void drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; virtual void drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; virtual int styleHint( StyleHint sh, - const QWidget *widget = 0, - const QStyleOption& = QStyleOption::Default, + const TQWidget *widget = 0, + const TQStyleOption& = TQStyleOption::Default, QStyleHintReturn* returnData = 0 ) const; - virtual QSize sizeFromContents( ContentsType contents, - const QWidget *widget, - const QSize &contentsSize, - const QStyleOption& = QStyleOption::Default ) const; + virtual TQSize sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentsSize, + const TQStyleOption& = TQStyleOption::Default ) const; - virtual QRect subRect(SubRect, const QWidget *) const; + virtual TQRect subRect(SubRect, const TQWidget *) const; - virtual void polish( QWidget* ); - virtual void unPolish( QWidget* ); - virtual bool eventFilter( QObject* object, QEvent* event ); + virtual void polish( TQWidget* ); + virtual void unPolish( TQWidget* ); + virtual bool eventFilter( TQObject* object, TQEvent* event ); /** * By default this just sets the background brushes to the pixmapped * background. */ - virtual void polish( QApplication *app ); - virtual void unPolish( QApplication* ); + virtual void polish( TQApplication *app ); + virtual void unPolish( TQApplication* ); /** \internal */ // to make it possible for derived classes to overload this function - virtual void polish( QPalette& pal ); + virtual void polish( TQPalette& pal ); /** * This is a convenience method for drawing widgets with @@ -155,14 +155,14 @@ public: * @param y The y coordinate of the buttons' upper left hand corner. * @param w The button width. * @param h The button height. - * @param p The QPainter to draw on. + * @param p The TQPainter to draw on. * @param g The color group to use. * @param sunken The button is drawn with a sunken style if @p true * @param rounded @p true if the widget is rounded, @p false if rectangular. * @param type The widget type to paint. */ - virtual void drawBaseButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken = false, + virtual void drawBaseButton( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken = false, bool rounded = false, WidgetType type = Bevel ) const; /** * Draw a mask with for widgets that may be rounded. @@ -170,14 +170,14 @@ public: *Currently used * by pushbuttons and comboboxes. * - * @param p The QPainter to draw on. + * @param p The TQPainter to draw on. * @param x The x coordinate of the widget's upper left hand corner. * @param y The y coordinate of the widget's upper left hand corner. * @param w The widget width. * @param h The widget height. * @param rounded @p true if the widget is rounded, @p false if rectangular. */ - virtual void drawBaseMask( QPainter *p, int x, int y, int w, int h, + virtual void drawBaseMask( TQPainter *p, int x, int y, int w, int h, bool rounded ) const; @@ -198,22 +198,22 @@ public: * @param bWidth The border width. * @param style The shading style to use. */ - virtual void drawShade( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, bool rounded, + virtual void drawShade( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, bool rounded, int hWidth, int bWidth, ShadeStyle style ) const; - int popupMenuItemHeight( bool checkable, QMenuItem *mi, - const QFontMetrics &fm ); + int popupMenuItemHeight( bool checkable, TQMenuItem *mi, + const TQFontMetrics &fm ); protected: - QPalette oldPalette, popupPalette, indiPalette, exIndiPalette; + TQPalette oldPalette, popupPalette, indiPalette, exIndiPalette; bool paletteSaved; bool polishLock; - QStyle *mtfstyle; + TQStyle *mtfstyle; - QPixmap* makeMenuBarCache(int w, int h) const; + TQPixmap* makeMenuBarCache(int w, int h) const; - mutable QPixmap* menuCache; - mutable QPixmap* vsliderCache; + mutable TQPixmap* menuCache; + mutable TQPixmap* vsliderCache; Qt::HANDLE brushHandle; bool brushHandleSet; diff --git a/kstyles/light/light.cpp b/kstyles/light/light.cpp index 264bc5b3d..caa1d3e8f 100644 --- a/kstyles/light/light.cpp +++ b/kstyles/light/light.cpp @@ -20,7 +20,7 @@ DEALINGS IN THE SOFTWARE. */ -#include <qstyleplugin.h> +#include <tqstyleplugin.h> #include "lightstyle-v2.h" #include "lightstyle-v3.h" @@ -29,24 +29,24 @@ class LightStylePlugin : public QStylePlugin public: LightStylePlugin(); - QStringList keys() const; - QStyle *create(const QString &); + TQStringList keys() const; + TQStyle *create(const TQString &); }; LightStylePlugin::LightStylePlugin() - : QStylePlugin() + : TQStylePlugin() { } -QStringList LightStylePlugin::keys() const +TQStringList LightStylePlugin::keys() const { - QStringList list; + TQStringList list; list << "Light, 2nd revision"; list << "Light, 3rd revision"; return list; } -QStyle *LightStylePlugin::create(const QString &s) +TQStyle *LightStylePlugin::create(const TQString &s) { if (s.lower() == "light, 2nd revision") return new LightStyleV2; diff --git a/kstyles/light/lightstyle-v2.cpp b/kstyles/light/lightstyle-v2.cpp index a562c03c0..13569379b 100644 --- a/kstyles/light/lightstyle-v2.cpp +++ b/kstyles/light/lightstyle-v2.cpp @@ -22,23 +22,23 @@ #include "lightstyle-v2.h" -#include "qmenubar.h" -#include "qapplication.h" -#include "qpainter.h" -#include "qpalette.h" -#include "qframe.h" -#include "qpushbutton.h" -#include "qdrawutil.h" -#include "qprogressbar.h" -#include "qscrollbar.h" -#include "qtabbar.h" -#include "qguardedptr.h" -#include "qlayout.h" -#include "qlineedit.h" -#include "qimage.h" -#include "qcombobox.h" -#include "qslider.h" -#include "qstylefactory.h" +#include "tqmenubar.h" +#include "tqapplication.h" +#include "tqpainter.h" +#include "tqpalette.h" +#include "tqframe.h" +#include "tqpushbutton.h" +#include "tqdrawutil.h" +#include "tqprogressbar.h" +#include "tqscrollbar.h" +#include "tqtabbar.h" +#include "tqguardedptr.h" +#include "tqlayout.h" +#include "tqlineedit.h" +#include "tqimage.h" +#include "tqcombobox.h" +#include "tqslider.h" +#include "tqstylefactory.h" class LightStyleV2Private @@ -47,9 +47,9 @@ public: LightStyleV2Private() : ref(1) { - basestyle = QStyleFactory::create( "Windows" ); + basestyle = TQStyleFactory::create( "Windows" ); if ( ! basestyle ) - basestyle = QStyleFactory::create( QStyleFactory::keys().first() ); + basestyle = TQStyleFactory::create( TQStyleFactory::keys().first() ); if ( ! basestyle ) qFatal( "LightStyle: couldn't find a basestyle!" ); } @@ -59,7 +59,7 @@ public: delete basestyle; } - QStyle *basestyle; + TQStyle *basestyle; int ref; }; @@ -83,23 +83,23 @@ LightStyleV2::~LightStyleV2() } } -void LightStyleV2::polishPopupMenu( QPopupMenu * menu ) +void LightStyleV2::polishPopupMenu( TQPopupMenu * menu ) { KStyle::polishPopupMenu(menu); } -static void drawLightBevel(QPainter *p, const QRect &r, const QColorGroup &cg, - QStyle::SFlags flags, const QBrush *fill = 0) +static void drawLightBevel(TQPainter *p, const TQRect &r, const TQColorGroup &cg, + TQStyle::SFlags flags, const TQBrush *fill = 0) { - QRect br = r; - bool sunken = (flags & (QStyle::Style_Down | QStyle::Style_On | - QStyle::Style_Sunken)); + TQRect br = r; + bool sunken = (flags & (TQStyle::Style_Down | TQStyle::Style_On | + TQStyle::Style_Sunken)); p->setPen(cg.dark()); p->drawRect(r); - if (flags & (QStyle::Style_Down | QStyle::Style_On | - QStyle::Style_Sunken | QStyle::Style_Raised)) { + if (flags & (TQStyle::Style_Down | TQStyle::Style_On | + TQStyle::Style_Sunken | TQStyle::Style_Raised)) { // button bevel if (sunken) p->setPen(cg.mid()); @@ -130,19 +130,19 @@ static void drawLightBevel(QPainter *p, const QRect &r, const QColorGroup &cg, } void LightStyleV2::drawPrimitive( PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &data ) const + const TQStyleOption &data ) const { switch (pe) { case PE_HeaderSection: { flags = ((flags | Style_Sunken) ^ Style_Sunken) | Style_Raised; //Don't show pressed too often (as in light 3) - QBrush fill(cg.background()); - if (flags & QStyle::Style_Enabled) + TQBrush fill(cg.background()); + if (flags & TQStyle::Style_Enabled) fill.setColor(cg.button()); drawLightBevel(p, r, cg, flags, &fill); @@ -154,41 +154,41 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, case PE_ButtonBevel: case PE_ButtonTool: { - const QBrush *fill; - if (flags & QStyle::Style_Enabled) { - if (flags & (QStyle::Style_Down | - QStyle::Style_On | - QStyle::Style_Sunken)) - fill = &cg.brush(QColorGroup::Midlight); + const TQBrush *fill; + if (flags & TQStyle::Style_Enabled) { + if (flags & (TQStyle::Style_Down | + TQStyle::Style_On | + TQStyle::Style_Sunken)) + fill = &cg.brush(TQColorGroup::Midlight); else - fill = &cg.brush(QColorGroup::Button); + fill = &cg.brush(TQColorGroup::Button); } else - fill = &cg.brush(QColorGroup::Background); + fill = &cg.brush(TQColorGroup::Background); drawLightBevel(p, r, cg, flags, fill); break; } case PE_ButtonDropDown: { - QBrush thefill; + TQBrush thefill; bool sunken = - (flags & (QStyle::Style_Down | QStyle::Style_On | QStyle::Style_Sunken)); + (flags & (TQStyle::Style_Down | TQStyle::Style_On | TQStyle::Style_Sunken)); - if (flags & QStyle::Style_Enabled) { + if (flags & TQStyle::Style_Enabled) { if (sunken) - thefill = cg.brush(QColorGroup::Midlight); + thefill = cg.brush(TQColorGroup::Midlight); else - thefill = cg.brush(QColorGroup::Button); + thefill = cg.brush(TQColorGroup::Button); } else - thefill = cg.brush(QColorGroup::Background); + thefill = cg.brush(TQColorGroup::Background); p->setPen(cg.dark()); p->drawLine(r.topLeft(), r.topRight()); p->drawLine(r.topRight(), r.bottomRight()); p->drawLine(r.bottomRight(), r.bottomLeft()); - if (flags & (QStyle::Style_Down | QStyle::Style_On | - QStyle::Style_Sunken | QStyle::Style_Raised)) { + if (flags & (TQStyle::Style_Down | TQStyle::Style_On | + TQStyle::Style_Sunken | TQStyle::Style_Raised)) { // button bevel if (sunken) p->setPen(cg.mid()); @@ -222,13 +222,13 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, break; case PE_Indicator: - const QBrush *fill; + const TQBrush *fill; if (! (flags & Style_Enabled)) - fill = &cg.brush(QColorGroup::Background); + fill = &cg.brush(TQColorGroup::Background); else if (flags & Style_Down) - fill = &cg.brush(QColorGroup::Mid); + fill = &cg.brush(TQColorGroup::Mid); else - fill = &cg.brush(QColorGroup::Base); + fill = &cg.brush(TQColorGroup::Base); drawLightBevel(p, r, cg, flags | Style_Sunken, fill); p->setPen(cg.text()); @@ -258,14 +258,14 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, case PE_ExclusiveIndicator: { - QRect br = r, // bevel rect + TQRect br = r, // bevel rect cr = r, // contents rect ir = r; // indicator rect br.addCoords(1, 1, -1, -1); cr.addCoords(2, 2, -2, -2); ir.addCoords(3, 3, -3, -3); - p->fillRect(r, cg.brush(QColorGroup::Background)); + p->fillRect(r, cg.brush(TQColorGroup::Background)); p->setPen(cg.dark()); p->drawArc(r, 0, 16*360); @@ -290,12 +290,12 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, case PE_DockWindowHandle: { - QString title; + TQString title; bool drawTitle = false; - if ( p && p->device()->devType() == QInternal::Widget ) { - QWidget *w = (QWidget *) p->device(); - QWidget *p = w->parentWidget(); - if (p->inherits("QDockWindow") && ! p->inherits("QToolBar")) { + if ( p && p->device()->devType() == TQInternal::Widget ) { + TQWidget *w = (TQWidget *) p->device(); + TQWidget *p = w->parentWidget(); + if (p->inherits("TQDockWindow") && ! p->inherits("TQToolBar")) { drawTitle = true; title = p->caption(); } @@ -304,15 +304,15 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, flags |= Style_Raised; if (flags & Style_Horizontal) { if (drawTitle) { - QPixmap pm(r.height(), r.width()); - QPainter p2(&pm); + TQPixmap pm(r.height(), r.width()); + TQPainter p2(&pm); p2.fillRect(0, 0, pm.width(), pm.height(), - cg.brush(QColorGroup::Highlight)); + cg.brush(TQColorGroup::Highlight)); p2.setPen(cg.highlightedText()); p2.drawText(0, 0, pm.width(), pm.height(), AlignCenter, title); p2.end(); - QWMatrix m; + TQWMatrix m; m.rotate(270.0); pm = pm.xForm(m); p->drawPixmap(r.x(), r.y(), pm); @@ -331,7 +331,7 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, } } else { if (drawTitle) { - p->fillRect(r, cg.brush(QColorGroup::Highlight)); + p->fillRect(r, cg.brush(TQColorGroup::Highlight)); p->setPen(cg.highlightedText()); p->drawText(r, AlignCenter, title); } else { @@ -366,7 +366,7 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, p->drawLine(r.left() + 6, r.top() + 2, r.right() - 6, r.top() + 2); } } else - QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); + TQCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); break; } @@ -412,7 +412,7 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, if (lw == 2) drawLightBevel(p, r, cg, flags); else - QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); + TQCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); break; } @@ -423,9 +423,9 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, if (lw == 2) drawLightBevel(p, r, cg, flags | Style_Raised, - &cg.brush(QColorGroup::Button)); + &cg.brush(TQColorGroup::Button)); else - QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); + TQCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); break; } @@ -435,15 +435,15 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, pixelMetric(PM_MenuBarFrameWidth) : data.lineWidth(); if (lw == 2) - drawLightBevel(p, r, cg, flags, &cg.brush(QColorGroup::Button)); + drawLightBevel(p, r, cg, flags, &cg.brush(TQColorGroup::Button)); else - QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); + TQCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); break; } case PE_ScrollBarSubLine: { - QRect fr = r, ar = r; + TQRect fr = r, ar = r; PrimitiveElement pe; p->setPen(cg.dark()); @@ -460,15 +460,15 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, } p->fillRect(fr, cg.brush((flags & Style_Down) ? - QColorGroup::Midlight : - QColorGroup::Background)); + TQColorGroup::Midlight : + TQColorGroup::Background)); drawPrimitive(pe, p, ar, cg, flags); break; } case PE_ScrollBarAddLine: { - QRect fr = r, ar = r; + TQRect fr = r, ar = r; PrimitiveElement pe; p->setPen(cg.dark()); @@ -485,8 +485,8 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, } p->fillRect(fr, cg.brush((flags & Style_Down) ? - QColorGroup::Midlight : - QColorGroup::Background)); + TQColorGroup::Midlight : + TQColorGroup::Background)); drawPrimitive(pe, p, ar, cg, flags); break; } @@ -494,7 +494,7 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, case PE_ScrollBarSubPage: case PE_ScrollBarAddPage: { - QRect fr = r; + TQRect fr = r; p->setPen(cg.dark()); if (flags & Style_Horizontal) { @@ -510,14 +510,14 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, } p->fillRect(fr, cg.brush((flags & Style_Down) ? - QColorGroup::Midlight : - QColorGroup::Mid)); + TQColorGroup::Midlight : + TQColorGroup::Mid)); break; } case PE_ScrollBarSlider: { - QRect fr = r; + TQRect fr = r; p->setPen(cg.dark()); if (flags & Style_Horizontal) { @@ -534,7 +534,7 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, drawLightBevel(p, fr, cg, ((flags | Style_Down) ^ Style_Down) | ((flags & Style_Enabled) ? Style_Raised : Style_Default), - &cg.brush(QColorGroup::Button)); + &cg.brush(TQColorGroup::Button)); break; } @@ -563,7 +563,7 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, if (pe >= PE_ArrowUp && pe <= PE_ArrowLeft) { - QPointArray a; + TQPointArray a; switch ( pe ) { case PE_ArrowUp: @@ -607,31 +607,31 @@ void LightStyleV2::drawPrimitive( PrimitiveElement pe, } p->restore(); } else - QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); + TQCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); break; } } void LightStyleV2::drawControl( ControlElement control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &data ) const + const TQStyleOption &data ) const { switch (control) { case CE_TabBarTab: { - const QTabBar* tb = static_cast<const QTabBar*>(widget); + const TQTabBar* tb = static_cast<const TQTabBar*>(widget); bool below = false; - QRect tr(r); - QRect fr(r); + TQRect tr(r); + TQRect fr(r); tr.addCoords(0, 0, 0, -1); fr.addCoords(2, 2, -2, -2); - if ( tb->shape() == QTabBar::RoundedBelow || tb->shape() == QTabBar::TriangularBelow) { + if ( tb->shape() == TQTabBar::RoundedBelow || tb->shape() == TQTabBar::TriangularBelow) { tr = r; tr.addCoords(0, 1, 0, 0); fr = r; fr.addCoords(2, 2,-2, -4); below = true; @@ -776,8 +776,8 @@ void LightStyleV2::drawControl( ControlElement control, if (! widget || data.isDefault()) break; - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; - QMenuItem *mi = data.menuItem(); + const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; + TQMenuItem *mi = data.menuItem(); int tab = data.tabWidth(); int maxpmw = data.maxIconWidth(); @@ -786,7 +786,7 @@ void LightStyleV2::drawControl( ControlElement control, if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) p->drawPixmap( r.topLeft(), *widget->erasePixmap(), r ); else - p->fillRect(r, cg.brush(QColorGroup::Button)); + p->fillRect(r, cg.brush(TQColorGroup::Button)); p->setPen(cg.mid().dark(120)); p->drawLine(r.left() + 12, r.top() + 1, @@ -799,18 +799,18 @@ void LightStyleV2::drawControl( ControlElement control, if (flags & Style_Active) qDrawShadePanel(p, r, cg, true, 1, - &cg.brush(QColorGroup::Midlight)); + &cg.brush(TQColorGroup::Midlight)); else if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) p->drawPixmap( r.topLeft(), *widget->erasePixmap(), r ); else - p->fillRect(r, cg.brush(QColorGroup::Button)); + p->fillRect(r, cg.brush(TQColorGroup::Button)); if ( !mi ) break; maxpmw = QMAX(maxpmw, 16); - QRect cr, ir, tr, sr; + TQRect cr, ir, tr, sr; // check column cr.setRect(r.left(), r.top(), maxpmw, r.height()); // submenu indicator column @@ -820,7 +820,7 @@ void LightStyleV2::drawControl( ControlElement control, // item column ir.setCoords(cr.right() + 4, r.top(), tr.right() - 4, r.bottom()); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); if ( reverse ) { cr = visualRect( cr, r ); sr = visualRect( sr, r ); @@ -831,21 +831,21 @@ void LightStyleV2::drawControl( ControlElement control, if (mi->isChecked() && ! (flags & Style_Active) & (flags & Style_Enabled)) - qDrawShadePanel(p, cr, cg, true, 1, &cg.brush(QColorGroup::Midlight)); + qDrawShadePanel(p, cr, cg, true, 1, &cg.brush(TQColorGroup::Midlight)); if (mi->iconSet()) { - QIconSet::Mode mode = - (flags & Style_Enabled) ? QIconSet::Normal : QIconSet::Disabled; + TQIconSet::Mode mode = + (flags & Style_Enabled) ? TQIconSet::Normal : TQIconSet::Disabled; if ((flags & Style_Active) && (flags & Style_Enabled)) - mode = QIconSet::Active; - QPixmap pixmap; + mode = TQIconSet::Active; + TQPixmap pixmap; if (popupmenu->isCheckable() && mi->isChecked()) pixmap = - mi->iconSet()->pixmap( QIconSet::Small, mode, QIconSet::On ); + mi->iconSet()->pixmap( TQIconSet::Small, mode, TQIconSet::On ); else pixmap = - mi->iconSet()->pixmap( QIconSet::Small, mode ); - QRect pmr(QPoint(0, 0), pixmap.size()); + mi->iconSet()->pixmap( TQIconSet::Small, mode ); + TQRect pmr(TQPoint(0, 0), pixmap.size()); pmr.moveCenter(cr.center()); p->setPen(cg.text()); p->drawPixmap(pmr.topLeft(), pixmap); @@ -853,8 +853,8 @@ void LightStyleV2::drawControl( ControlElement control, drawPrimitive(PE_CheckMark, p, cr, cg, (flags & Style_Enabled) | Style_On); - QColor textcolor; - QColor embosscolor; + TQColor textcolor; + TQColor embosscolor; if (flags & Style_Active) { if (! (flags & Style_Enabled)) textcolor = cg.midlight().dark(); @@ -885,7 +885,7 @@ void LightStyleV2::drawControl( ControlElement control, p->restore(); } - QString text = mi->text(); + TQString text = mi->text(); if (! text.isNull()) { int t = text.find('\t'); @@ -917,7 +917,7 @@ void LightStyleV2::drawControl( ControlElement control, p->drawText(ir, alignFlag, text, t); } else if (mi->pixmap()) { - QPixmap pixmap = *mi->pixmap(); + TQPixmap pixmap = *mi->pixmap(); if (pixmap.depth() == 1) p->setBackgroundMode(OpaqueMode); p->drawPixmap(ir.x(), ir.y() + (ir.height() - pixmap.height()) / 2, pixmap); @@ -932,13 +932,13 @@ void LightStyleV2::drawControl( ControlElement control, case CE_MenuBarEmptyArea: { - p->fillRect(r, cg.brush(QColorGroup::Button)); + p->fillRect(r, cg.brush(TQColorGroup::Button)); break; } case CE_DockWindowEmptyArea: { - p->fillRect(r, cg.brush(QColorGroup::Button)); + p->fillRect(r, cg.brush(TQColorGroup::Button)); break; } @@ -946,14 +946,14 @@ void LightStyleV2::drawControl( ControlElement control, case CE_MenuBarItem: { if (flags & Style_Active) - qDrawShadePanel(p, r, cg, true, 1, &cg.brush(QColorGroup::Midlight)); + qDrawShadePanel(p, r, cg, true, 1, &cg.brush(TQColorGroup::Midlight)); else - p->fillRect(r, cg.brush(QColorGroup::Button)); + p->fillRect(r, cg.brush(TQColorGroup::Button)); if (data.isDefault()) break; - QMenuItem *mi = data.menuItem(); + TQMenuItem *mi = data.menuItem(); drawItem(p, r, AlignCenter | ShowPrefix | DontClip | SingleLine, cg, flags & Style_Enabled, mi->pixmap(), mi->text(), -1, &cg.buttonText()); @@ -961,20 +961,20 @@ void LightStyleV2::drawControl( ControlElement control, } case CE_ProgressBarGroove: - drawLightBevel(p, r, cg, Style_Sunken, &cg.brush(QColorGroup::Background)); + drawLightBevel(p, r, cg, Style_Sunken, &cg.brush(TQColorGroup::Background)); break; default: - QCommonStyle::drawControl(control, p, widget, r, cg, flags, data); + TQCommonStyle::drawControl(control, p, widget, r, cg, flags, data); break; } } void LightStyleV2::drawControlMask( ControlElement control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption &data ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption &data ) const { switch (control) { case CE_PushButton: @@ -982,19 +982,19 @@ void LightStyleV2::drawControlMask( ControlElement control, break; default: - QCommonStyle::drawControlMask(control, p, widget, r, data); + TQCommonStyle::drawControlMask(control, p, widget, r, data); break; } } -QRect LightStyleV2::subRect(SubRect subrect, const QWidget *widget) const +TQRect LightStyleV2::subRect(SubRect subrect, const TQWidget *widget) const { - QRect rect, wrect(widget->rect()); + TQRect rect, wrect(widget->rect()); switch (subrect) { case SR_PushButtonFocusRect: { - const QPushButton *button = (const QPushButton *) widget; + const TQPushButton *button = (const TQPushButton *) widget; int dbw1 = 0, dbw2 = 0; if (button->isDefault() || button->autoDefault()) { dbw1 = pixelMetric(PM_ButtonDefaultIndicator, widget); @@ -1009,47 +1009,47 @@ QRect LightStyleV2::subRect(SubRect subrect, const QWidget *widget) const } default: - rect = QCommonStyle::subRect(subrect, widget); + rect = TQCommonStyle::subRect(subrect, widget); } return rect; } void LightStyleV2::drawComplexControl( ComplexControl control, - QPainter* p, - const QWidget* widget, - const QRect& r, - const QColorGroup& cg, + TQPainter* p, + const TQWidget* widget, + const TQRect& r, + const TQColorGroup& cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption &data ) const + const TQStyleOption &data ) const { switch (control) { case CC_ComboBox: { - const QComboBox *combobox = (const QComboBox *) widget; - QRect frame, arrow, field; + const TQComboBox *combobox = (const TQComboBox *) widget; + TQRect frame, arrow, field; frame = - QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxFrame, data), widget); arrow = - QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow, data), widget); field = - QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxEditField, data), widget); if ((controls & SC_ComboBoxFrame) && frame.isValid()) drawLightBevel(p, frame, cg, flags | Style_Raised, - &cg.brush(QColorGroup::Button)); + &cg.brush(TQColorGroup::Button)); if ((controls & SC_ComboBoxArrow) && arrow.isValid()) { if (active == SC_ComboBoxArrow) - p->fillRect(arrow, cg.brush(QColorGroup::Mid)); + p->fillRect(arrow, cg.brush(TQColorGroup::Mid)); arrow.addCoords(4, 2, -2, -2); drawPrimitive(PE_ArrowDown, p, arrow, cg, flags); } @@ -1065,13 +1065,13 @@ void LightStyleV2::drawComplexControl( ComplexControl control, if (flags & Style_HasFocus) { if (! combobox->editable()) { - p->fillRect( field, cg.brush( QColorGroup::Highlight ) ); - QRect fr = - QStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ), + p->fillRect( field, cg.brush( TQColorGroup::Highlight ) ); + TQRect fr = + TQStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ), widget ); drawPrimitive( PE_FocusRect, p, fr, cg, flags | Style_FocusAtBorder, - QStyleOption(cg.highlight())); + TQStyleOption(cg.highlight())); } p->setPen(cg.highlightedText()); @@ -1084,8 +1084,8 @@ void LightStyleV2::drawComplexControl( ComplexControl control, case CC_SpinWidget: { - const QSpinWidget *spinwidget = (const QSpinWidget *) widget; - QRect frame, up, down; + const TQSpinWidget *spinwidget = (const TQSpinWidget *) widget; + TQRect frame, up, down; frame = querySubControlMetrics(CC_SpinWidget, widget, SC_SpinWidgetFrame, data); @@ -1094,18 +1094,18 @@ void LightStyleV2::drawComplexControl( ComplexControl control, if ((controls & SC_SpinWidgetFrame) && frame.isValid()) drawLightBevel(p, frame, cg, flags | Style_Sunken, - &cg.brush(QColorGroup::Base)); + &cg.brush(TQColorGroup::Base)); if ((controls & SC_SpinWidgetUp) && up.isValid()) { PrimitiveElement pe = PE_SpinWidgetUp; - if ( spinwidget->buttonSymbols() == QSpinWidget::PlusMinus ) + if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus ) pe = PE_SpinWidgetPlus; p->setPen(cg.dark()); p->drawLine(up.topLeft(), up.bottomLeft()); up.addCoords(1, 0, 0, 0); - p->fillRect(up, cg.brush(QColorGroup::Button)); + p->fillRect(up, cg.brush(TQColorGroup::Button)); if (active == SC_SpinWidgetUp) p->setPen(cg.mid()); else @@ -1131,14 +1131,14 @@ void LightStyleV2::drawComplexControl( ComplexControl control, if ((controls & SC_SpinWidgetDown) && down.isValid()) { PrimitiveElement pe = PE_SpinWidgetDown; - if ( spinwidget->buttonSymbols() == QSpinWidget::PlusMinus ) + if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus ) pe = PE_SpinWidgetMinus; p->setPen(cg.dark()); p->drawLine(down.topLeft(), down.bottomLeft()); down.addCoords(1, 0, 0, 0); - p->fillRect(down, cg.brush(QColorGroup::Button)); + p->fillRect(down, cg.brush(TQColorGroup::Button)); if (active == SC_SpinWidgetDown) p->setPen(cg.mid()); else @@ -1167,8 +1167,8 @@ void LightStyleV2::drawComplexControl( ComplexControl control, case CC_ScrollBar: { - const QScrollBar *scrollbar = (const QScrollBar *) widget; - QRect addline, subline, subline2, addpage, subpage, slider, first, last; + const TQScrollBar *scrollbar = (const TQScrollBar *) widget; + TQRect addline, subline, subline2, addpage, subpage, slider, first, last; bool maxedOut = (scrollbar->minValue() == scrollbar->maxValue()); subline = querySubControlMetrics(control, widget, SC_ScrollBarSubLine, data); @@ -1239,7 +1239,7 @@ void LightStyleV2::drawComplexControl( ComplexControl control, // ### perhaps this should not be able to accept focus if maxedOut? if (scrollbar->hasFocus()) { - QRect fr(slider.x() + 2, slider.y() + 2, + TQRect fr(slider.x() + 2, slider.y() + 2, slider.width() - 5, slider.height() - 5); drawPrimitive(PE_FocusRect, p, fr, cg, Style_Default); } @@ -1250,8 +1250,8 @@ void LightStyleV2::drawComplexControl( ComplexControl control, case CC_Slider: { - const QSlider *slider = (const QSlider *) widget; - QRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, + const TQSlider *slider = (const TQSlider *) widget; + TQRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, data), handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, data); @@ -1270,18 +1270,18 @@ void LightStyleV2::drawComplexControl( ComplexControl control, drawLightBevel(p, groove, cg, ((flags | Style_Raised) ^ Style_Raised) | ((flags & Style_Enabled) ? Style_Sunken : Style_Default), - &cg.brush(QColorGroup::Midlight)); + &cg.brush(TQColorGroup::Midlight)); } if ((controls & SC_SliderHandle) && handle.isValid()) { drawLightBevel(p, handle, cg, ((flags | Style_Down) ^ Style_Down) | ((flags & Style_Enabled) ? Style_Raised : Style_Default), - &cg.brush(QColorGroup::Button)); + &cg.brush(TQColorGroup::Button)); } if (controls & SC_SliderTickmarks) - QCommonStyle::drawComplexControl(control, p, widget, r, cg, flags, + TQCommonStyle::drawComplexControl(control, p, widget, r, cg, flags, SC_SliderTickmarks, active, data ); break; } @@ -1293,23 +1293,23 @@ void LightStyleV2::drawComplexControl( ComplexControl control, break; default: - QCommonStyle::drawComplexControl(control, p, widget, r, cg, flags, + TQCommonStyle::drawComplexControl(control, p, widget, r, cg, flags, controls, active, data); break; } } -QRect LightStyleV2::querySubControlMetrics( ComplexControl control, - const QWidget *widget, +TQRect LightStyleV2::querySubControlMetrics( ComplexControl control, + const TQWidget *widget, SubControl sc, - const QStyleOption &data ) const + const TQStyleOption &data ) const { - QRect ret; + TQRect ret; switch (control) { case CC_ScrollBar: { - const QScrollBar *scrollbar = (const QScrollBar *) widget; + const TQScrollBar *scrollbar = (const TQScrollBar *) widget; int sliderstart = scrollbar->sliderStart(); int sbextent = pixelMetric(PM_ScrollBarExtent, widget); int maxlen = ((scrollbar->orientation() == Qt::Horizontal) ? @@ -1386,19 +1386,19 @@ QRect LightStyleV2::querySubControlMetrics( ComplexControl control, } default: - ret = QCommonStyle::querySubControlMetrics(control, widget, sc, data); + ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, data); break; } return ret; } -QStyle::SubControl LightStyleV2::querySubControl( ComplexControl control, - const QWidget *widget, - const QPoint &pos, - const QStyleOption &data ) const +TQStyle::SubControl LightStyleV2::querySubControl( ComplexControl control, + const TQWidget *widget, + const TQPoint &pos, + const TQStyleOption &data ) const { - QStyle::SubControl ret = QCommonStyle::querySubControl(control, widget, pos, data); + TQStyle::SubControl ret = TQCommonStyle::querySubControl(control, widget, pos, data); // this is an ugly hack, but i really don't care, it's the quickest way to // enabled the third button @@ -1410,7 +1410,7 @@ QStyle::SubControl LightStyleV2::querySubControl( ComplexControl control, } int LightStyleV2::pixelMetric( PixelMetric metric, - const QWidget *widget ) const + const TQWidget *widget ) const { int ret; @@ -1472,25 +1472,25 @@ int LightStyleV2::pixelMetric( PixelMetric metric, break; default: - ret = QCommonStyle::pixelMetric(metric, widget); + ret = TQCommonStyle::pixelMetric(metric, widget); break; } return ret; } -QSize LightStyleV2::sizeFromContents( ContentsType contents, - const QWidget *widget, - const QSize &contentsSize, - const QStyleOption &data ) const +TQSize LightStyleV2::sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentsSize, + const TQStyleOption &data ) const { - QSize ret; + TQSize ret; switch (contents) { case CT_PushButton: { - const QPushButton *button = (const QPushButton *) widget; - ret = QCommonStyle::sizeFromContents( contents, widget, contentsSize, data ); + const TQPushButton *button = (const TQPushButton *) widget; + ret = TQCommonStyle::sizeFromContents( contents, widget, contentsSize, data ); int w = ret.width(), h = ret.height(); // only expand the button if we are displaying text... @@ -1510,7 +1510,7 @@ QSize LightStyleV2::sizeFromContents( ContentsType contents, } } - ret = QSize( w, h ); + ret = TQSize( w, h ); break; } @@ -1519,8 +1519,8 @@ QSize LightStyleV2::sizeFromContents( ContentsType contents, if (! widget || data.isDefault()) break; - QMenuItem *mi = data.menuItem(); - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; + TQMenuItem *mi = data.menuItem(); + const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; int maxpmw = data.maxIconWidth(); int w = contentsSize.width(), h = contentsSize.height(); @@ -1542,8 +1542,8 @@ QSize LightStyleV2::sizeFromContents( ContentsType contents, else if (! mi->text().isNull()) h = QMAX(h, popupmenu->fontMetrics().height() + 2); if (mi->iconSet() != 0) - h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small, - QIconSet::Normal).height()); + h = QMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, + TQIconSet::Normal).height()); h += 2; } @@ -1556,21 +1556,21 @@ QSize LightStyleV2::sizeFromContents( ContentsType contents, if (! mi->text().isNull() && mi->text().find('\t') >= 0) w += 8; - ret = QSize(w, h); + ret = TQSize(w, h); break; } case CT_ProgressBar: { - const QProgressBar* pb = static_cast<const QProgressBar*>(widget); + const TQProgressBar* pb = static_cast<const TQProgressBar*>(widget); //If we have to display the indicator, and we do it on RHS, give some more room //for it. This tries to match the logic and the spacing in SR_ProgressBarGroove/Contents - //sizing in QCommonStyle. + //sizing in TQCommonStyle. if (pb->percentageVisible() && (pb->indicatorFollowsStyle() || ! pb->centerIndicator())) { int addw = pb->fontMetrics().width("100%") + 6; - return QSize(contentsSize.width() + addw, contentsSize.height()); + return TQSize(contentsSize.width() + addw, contentsSize.height()); } else return contentsSize; //Otherwise leave unchanged @@ -1579,7 +1579,7 @@ QSize LightStyleV2::sizeFromContents( ContentsType contents, } default: - ret = QCommonStyle::sizeFromContents(contents, widget, contentsSize, data); + ret = TQCommonStyle::sizeFromContents(contents, widget, contentsSize, data); break; } @@ -1587,8 +1587,8 @@ QSize LightStyleV2::sizeFromContents( ContentsType contents, } int LightStyleV2::styleHint( StyleHint stylehint, - const QWidget *widget, - const QStyleOption &option, + const TQWidget *widget, + const TQStyleOption &option, QStyleHintReturn* returnData ) const { int ret; @@ -1611,16 +1611,16 @@ int LightStyleV2::styleHint( StyleHint stylehint, break; default: - ret = QCommonStyle::styleHint(stylehint, widget, option, returnData); + ret = TQCommonStyle::styleHint(stylehint, widget, option, returnData); break; } return ret; } -QPixmap LightStyleV2::stylePixmap( StylePixmap stylepixmap, - const QWidget *widget, - const QStyleOption &data ) const +TQPixmap LightStyleV2::stylePixmap( StylePixmap stylepixmap, + const TQWidget *widget, + const TQStyleOption &data ) const { return singleton->basestyle->stylePixmap( stylepixmap, widget, data ); } diff --git a/kstyles/light/lightstyle-v2.h b/kstyles/light/lightstyle-v2.h index 6a7befd0c..e5a3fffac 100644 --- a/kstyles/light/lightstyle-v2.h +++ b/kstyles/light/lightstyle-v2.h @@ -42,43 +42,43 @@ public: LightStyleV2(); virtual ~LightStyleV2(); - void polishPopupMenu( QPopupMenu * ); + void polishPopupMenu( TQPopupMenu * ); - void drawPrimitive(PrimitiveElement, QPainter *, const QRect &, const QColorGroup &, + void drawPrimitive(PrimitiveElement, TQPainter *, const TQRect &, const TQColorGroup &, SFlags = Style_Default, - const QStyleOption & = QStyleOption::Default ) const; + const TQStyleOption & = TQStyleOption::Default ) const; - void drawControl(ControlElement, QPainter *, const QWidget *, const QRect &, - const QColorGroup &, SFlags = Style_Default, - const QStyleOption & = QStyleOption::Default ) const; - void drawControlMask(ControlElement, QPainter *, const QWidget *, const QRect &, - const QStyleOption & = QStyleOption::Default) const; + void drawControl(ControlElement, TQPainter *, const TQWidget *, const TQRect &, + const TQColorGroup &, SFlags = Style_Default, + const TQStyleOption & = TQStyleOption::Default ) const; + void drawControlMask(ControlElement, TQPainter *, const TQWidget *, const TQRect &, + const TQStyleOption & = TQStyleOption::Default) const; - QRect subRect(SubRect, const QWidget *) const; + TQRect subRect(SubRect, const TQWidget *) const; - void drawComplexControl(ComplexControl, QPainter *, const QWidget *, const QRect &, - const QColorGroup &, SFlags = Style_Default, + void drawComplexControl(ComplexControl, TQPainter *, const TQWidget *, const TQRect &, + const TQColorGroup &, SFlags = Style_Default, SCFlags = SC_All, SCFlags = SC_None, - const QStyleOption & = QStyleOption::Default ) const; + const TQStyleOption & = TQStyleOption::Default ) const; - QRect querySubControlMetrics(ComplexControl, const QWidget *, SubControl, - const QStyleOption & = QStyleOption::Default ) const; + TQRect querySubControlMetrics(ComplexControl, const TQWidget *, SubControl, + const TQStyleOption & = TQStyleOption::Default ) const; - SubControl querySubControl(ComplexControl, const QWidget *, const QPoint &, - const QStyleOption &data = QStyleOption::Default ) const; + SubControl querySubControl(ComplexControl, const TQWidget *, const TQPoint &, + const TQStyleOption &data = TQStyleOption::Default ) const; - int pixelMetric(PixelMetric, const QWidget * = 0 ) const; + int pixelMetric(PixelMetric, const TQWidget * = 0 ) const; - QSize sizeFromContents(ContentsType, const QWidget *, const QSize &, - const QStyleOption & = QStyleOption::Default ) const; + TQSize sizeFromContents(ContentsType, const TQWidget *, const TQSize &, + const TQStyleOption & = TQStyleOption::Default ) const; - int styleHint(StyleHint, const QWidget * = 0, - const QStyleOption & = QStyleOption::Default, + int styleHint(StyleHint, const TQWidget * = 0, + const TQStyleOption & = TQStyleOption::Default, QStyleHintReturn * = 0 ) const; - QPixmap stylePixmap( StylePixmap stylepixmap, - const QWidget* widget = 0, - const QStyleOption& = QStyleOption::Default ) const; + TQPixmap stylePixmap( StylePixmap stylepixmap, + const TQWidget* widget = 0, + const TQStyleOption& = TQStyleOption::Default ) const; }; diff --git a/kstyles/light/lightstyle-v3.cpp b/kstyles/light/lightstyle-v3.cpp index fc9966b63..49900c8f5 100644 --- a/kstyles/light/lightstyle-v3.cpp +++ b/kstyles/light/lightstyle-v3.cpp @@ -22,24 +22,24 @@ #include "lightstyle-v3.h" -#include "qmenubar.h" -#include "qapplication.h" -#include "qcheckbox.h" -#include "qpainter.h" -#include "qpalette.h" -#include "qframe.h" -#include "qpushbutton.h" -#include "qdrawutil.h" -#include "qprogressbar.h" -#include "qscrollbar.h" -#include "qtabbar.h" -#include "qguardedptr.h" -#include "qlayout.h" -#include "qlineedit.h" -#include "qimage.h" -#include "qcombobox.h" -#include "qslider.h" -#include "qstylefactory.h" +#include "tqmenubar.h" +#include "tqapplication.h" +#include "tqcheckbox.h" +#include "tqpainter.h" +#include "tqpalette.h" +#include "tqframe.h" +#include "tqpushbutton.h" +#include "tqdrawutil.h" +#include "tqprogressbar.h" +#include "tqscrollbar.h" +#include "tqtabbar.h" +#include "tqguardedptr.h" +#include "tqlayout.h" +#include "tqlineedit.h" +#include "tqimage.h" +#include "tqcombobox.h" +#include "tqslider.h" +#include "tqstylefactory.h" // The Light Style, 3rd revision @@ -47,9 +47,9 @@ LightStyleV3::LightStyleV3() : KStyle(AllowMenuTransparency) { - basestyle = QStyleFactory::create( "Windows" ); + basestyle = TQStyleFactory::create( "Windows" ); if ( ! basestyle ) - basestyle = QStyleFactory::create( QStyleFactory::keys().first() ); + basestyle = TQStyleFactory::create( TQStyleFactory::keys().first() ); if ( ! basestyle ) qFatal( "LightStyle: couldn't find a basestyle!" ); } @@ -59,7 +59,7 @@ LightStyleV3::~LightStyleV3() delete basestyle; } -void LightStyleV3::polishPopupMenu( QPopupMenu * menu) +void LightStyleV3::polishPopupMenu( TQPopupMenu * menu) { KStyle::polishPopupMenu(menu); // empty to satisy pure virtual requirements @@ -101,12 +101,12 @@ void LightStyleV3::polishPopupMenu( QPopupMenu * menu) the etching and border ) F is the fill ( optional, not drawn by default ) */ -static void drawLightEtch( QPainter *p, - const QRect &rect, - const QColor &color, +static void drawLightEtch( TQPainter *p, + const TQRect &rect, + const TQColor &color, bool sunken ) { - QPointArray pts( 4 ); + TQPointArray pts( 4 ); pts.setPoint( 0, rect.left(), rect.bottom() - 1); pts.setPoint( 1, rect.left(), rect.top() ); @@ -123,20 +123,20 @@ static void drawLightEtch( QPainter *p, p->drawLineSegments( pts ); } -static void drawLightBevel( QPainter *p, - const QRect &rect, - const QColorGroup &cg, - QStyle::SFlags flags, +static void drawLightBevel( TQPainter *p, + const TQRect &rect, + const TQColorGroup &cg, + TQStyle::SFlags flags, int linewidth, bool etch = false, // light sunken bevel around border bool border = true, // rectangle around bevel - const QBrush *fill = 0 ) // contents fill + const TQBrush *fill = 0 ) // contents fill { - QRect br = rect; - bool bevel = ( flags & ( QStyle::Style_Down | QStyle::Style_On | - QStyle::Style_Sunken | QStyle::Style_Raised ) ); - bool sunken = (flags & (QStyle::Style_Down | QStyle::Style_On | - QStyle::Style_Sunken)); + TQRect br = rect; + bool bevel = ( flags & ( TQStyle::Style_Down | TQStyle::Style_On | + TQStyle::Style_Sunken | TQStyle::Style_Raised ) ); + bool sunken = (flags & (TQStyle::Style_Down | TQStyle::Style_On | + TQStyle::Style_Sunken)); if ( etch && linewidth > 0 ) { drawLightEtch( p, br, cg.background(), true ); @@ -161,7 +161,7 @@ static void drawLightBevel( QPainter *p, br.rect( &x, &y, &w, &h ); // copied form qDrawShadePanel - just changed the highlight colors... - QPointArray a( 4*linewidth ); + TQPointArray a( 4*linewidth ); if ( sunken ) p->setPen( border ? cg.mid() : cg.dark() ); else @@ -213,14 +213,14 @@ static void drawLightBevel( QPainter *p, } void LightStyleV3::drawPrimitive( PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &data ) const + const TQStyleOption &data ) const { - QRect br = r; - const QBrush *fill = 0; + TQRect br = r; + const TQBrush *fill = 0; switch (pe) { case PE_HeaderSection: @@ -249,7 +249,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, if ( ! br.isValid() ) break; p->fillRect( br, cg.brush( ( flags & Style_Down ) ? - QColorGroup::Midlight : QColorGroup::Button ) ); + TQColorGroup::Midlight : TQColorGroup::Button ) ); // the taskbuttons in kicker seem to allow the style to set the pencolor // here, which will be used to draw the text for focused window buttons... @@ -259,17 +259,17 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, case PE_ButtonCommand: { - QRect br = r; + TQRect br = r; - if (flags & QStyle::Style_Enabled) { - if (flags & (QStyle::Style_Down | - QStyle::Style_On | - QStyle::Style_Sunken)) - fill = &cg.brush(QColorGroup::Midlight); + if (flags & TQStyle::Style_Enabled) { + if (flags & (TQStyle::Style_Down | + TQStyle::Style_On | + TQStyle::Style_Sunken)) + fill = &cg.brush(TQColorGroup::Midlight); else - fill = &cg.brush(QColorGroup::Button); + fill = &cg.brush(TQColorGroup::Button); } else - fill = &cg.brush(QColorGroup::Background); + fill = &cg.brush(TQColorGroup::Background); bool etch = true; if ( flags & Style_ButtonDefault ) { @@ -284,40 +284,40 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, case PE_ButtonBevel: case PE_ButtonTool: - if (flags & QStyle::Style_Enabled) { - if (flags & (QStyle::Style_Down | - QStyle::Style_On | - QStyle::Style_Sunken)) - fill = &cg.brush(QColorGroup::Midlight); + if (flags & TQStyle::Style_Enabled) { + if (flags & (TQStyle::Style_Down | + TQStyle::Style_On | + TQStyle::Style_Sunken)) + fill = &cg.brush(TQColorGroup::Midlight); else - fill = &cg.brush(QColorGroup::Button); + fill = &cg.brush(TQColorGroup::Button); } else - fill = &cg.brush(QColorGroup::Background); + fill = &cg.brush(TQColorGroup::Background); drawLightBevel( p, r, cg, flags, pixelMetric( PM_DefaultFrameWidth ), false, true, fill ); break; case PE_ButtonDropDown: { - QBrush thefill; + TQBrush thefill; bool sunken = - (flags & (QStyle::Style_Down | QStyle::Style_On | QStyle::Style_Sunken)); + (flags & (TQStyle::Style_Down | TQStyle::Style_On | TQStyle::Style_Sunken)); - if (flags & QStyle::Style_Enabled) { + if (flags & TQStyle::Style_Enabled) { if (sunken) - thefill = cg.brush(QColorGroup::Midlight); + thefill = cg.brush(TQColorGroup::Midlight); else - thefill = cg.brush(QColorGroup::Button); + thefill = cg.brush(TQColorGroup::Button); } else - thefill = cg.brush(QColorGroup::Background); + thefill = cg.brush(TQColorGroup::Background); p->setPen( cg.dark() ); p->drawLine(r.topLeft(), r.topRight()); p->drawLine(r.topRight(), r.bottomRight()); p->drawLine(r.bottomRight(), r.bottomLeft()); - if (flags & (QStyle::Style_Down | QStyle::Style_On | - QStyle::Style_Sunken | QStyle::Style_Raised)) { + if (flags & (TQStyle::Style_Down | TQStyle::Style_On | + TQStyle::Style_Sunken | TQStyle::Style_Raised)) { // button bevel if (sunken) p->setPen(cg.mid()); @@ -350,13 +350,13 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, break; case PE_Indicator: - const QBrush *fill; + const TQBrush *fill; if (! (flags & Style_Enabled)) - fill = &cg.brush(QColorGroup::Background); + fill = &cg.brush(TQColorGroup::Background); else if (flags & Style_Down) - fill = &cg.brush(QColorGroup::Mid); + fill = &cg.brush(TQColorGroup::Mid); else - fill = &cg.brush(QColorGroup::Base); + fill = &cg.brush(TQColorGroup::Base); drawLightBevel( p, r, cg, flags | Style_Sunken, 2, true, true, fill ); p->setPen(cg.text()); @@ -386,7 +386,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, case PE_ExclusiveIndicator: { - QRect br = r, // bevel rect + TQRect br = r, // bevel rect lr = r, // outline rect cr = r, // contents rect ir = r; // indicator rect @@ -394,7 +394,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, cr.addCoords( 2, 2, -2, -2 ); ir.addCoords( 3, 3, -3, -3 ); - p->fillRect( r, cg.brush( QColorGroup::Background ) ); + p->fillRect( r, cg.brush( TQColorGroup::Background ) ); p->setPen( flags & Style_Down ? cg.mid() : ( flags & Style_Enabled ? cg.base() : cg.background() ) ); @@ -422,12 +422,12 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, case PE_DockWindowHandle: { - QString title; + TQString title; bool drawTitle = false; - if ( p && p->device()->devType() == QInternal::Widget ) { - QWidget *w = (QWidget *) p->device(); - QWidget *p = w->parentWidget(); - if (p->inherits("QDockWindow") && ! p->inherits("QToolBar")) { + if ( p && p->device()->devType() == TQInternal::Widget ) { + TQWidget *w = (TQWidget *) p->device(); + TQWidget *p = w->parentWidget(); + if (p->inherits("TQDockWindow") && ! p->inherits("TQToolBar")) { drawTitle = true; title = p->caption(); } @@ -436,15 +436,15 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, flags |= Style_Raised; if (flags & Style_Horizontal) { if (drawTitle) { - QPixmap pm(r.height(), r.width()); - QPainter p2(&pm); + TQPixmap pm(r.height(), r.width()); + TQPainter p2(&pm); p2.fillRect(0, 0, pm.width(), pm.height(), - cg.brush(QColorGroup::Highlight)); + cg.brush(TQColorGroup::Highlight)); p2.setPen(cg.highlightedText()); p2.drawText(0, 0, pm.width(), pm.height(), AlignCenter, title); p2.end(); - QWMatrix m; + TQWMatrix m; m.rotate(270.0); pm = pm.xForm(m); p->drawPixmap(r.x(), r.y(), pm); @@ -460,7 +460,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, } } else { if (drawTitle) { - p->fillRect(r, cg.brush(QColorGroup::Highlight)); + p->fillRect(r, cg.brush(TQColorGroup::Highlight)); p->setPen(cg.highlightedText()); p->drawText(r, AlignCenter, title); } else { @@ -505,7 +505,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, case PE_DockWindowResizeHandle: { - QRect br = r; + TQRect br = r; p->setPen( cg.shadow() ); p->drawRect( br ); @@ -525,7 +525,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, if ( ! br.isValid() ) break; - p->fillRect( br, cg.brush( QColorGroup::Button ) ); + p->fillRect( br, cg.brush( TQColorGroup::Button ) ); break; } @@ -540,7 +540,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, case PE_PanelTabWidget: case PE_WindowFrame: { - QRect br = r; + TQRect br = r; int cover = 0; int reallw = ( data.isDefault() ? @@ -553,7 +553,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, br.addCoords( 1, 1, -1, -1 ); while ( cover-- > 0 ) { - QPointArray pts( 8 ); + TQPointArray pts( 8 ); pts.setPoint( 0, br.left(), br.bottom() - 1); pts.setPoint( 1, br.left(), br.top() ); pts.setPoint( 2, br.left() + 1, br.top() ); @@ -574,19 +574,19 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, drawLightBevel( p, r, cg, flags, ( data.isDefault() ? pixelMetric(PM_DefaultFrameWidth) : data.lineWidth() ), false, false, - &cg.brush( QColorGroup::Button ) ); + &cg.brush( TQColorGroup::Button ) ); break; case PE_PanelMenuBar: drawLightBevel( p, r, cg, flags, ( data.isDefault() ? pixelMetric(PM_MenuBarFrameWidth) : data.lineWidth() ), false, false, - &cg.brush( QColorGroup::Button ) ); + &cg.brush( TQColorGroup::Button ) ); break; case PE_ScrollBarSubLine: { - QRect br = r; + TQRect br = r; PrimitiveElement pe; p->setPen( cg.background() ); @@ -608,8 +608,8 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, if ( ! br.isValid() ) break; p->fillRect( br, cg.brush( ( flags & Style_Down ) ? - QColorGroup::Midlight : - QColorGroup::Button ) ); + TQColorGroup::Midlight : + TQColorGroup::Button ) ); br.addCoords( 2, 2, -2, -2 ); if ( ! br.isValid() ) @@ -620,7 +620,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, case PE_ScrollBarAddLine: { - QRect br = r; + TQRect br = r; PrimitiveElement pe; p->setPen( cg.background() ); @@ -642,8 +642,8 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, if ( ! br.isValid() ) break; p->fillRect( br, cg.brush( ( flags & Style_Down ) ? - QColorGroup::Midlight : - QColorGroup::Button ) ); + TQColorGroup::Midlight : + TQColorGroup::Button ) ); br.addCoords( 2, 2, -2, -2 ); if ( ! br.isValid() ) @@ -654,7 +654,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, case PE_ScrollBarSubPage: { - QRect br = r; + TQRect br = r; p->setPen( cg.background() ); if (flags & Style_Horizontal) { @@ -673,14 +673,14 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, if ( ! br.isValid() ) break; p->fillRect( br, cg.brush( ( flags & Style_Down ) ? - QColorGroup::Midlight : - QColorGroup::Button ) ); + TQColorGroup::Midlight : + TQColorGroup::Button ) ); break; } case PE_ScrollBarAddPage: { - QRect br = r; + TQRect br = r; p->setPen( cg.background() ); if (flags & Style_Horizontal) { @@ -699,14 +699,14 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, if ( ! br.isValid() ) break; p->fillRect( br, cg.brush( ( flags & Style_Down ) ? - QColorGroup::Midlight : - QColorGroup::Button ) ); + TQColorGroup::Midlight : + TQColorGroup::Button ) ); break; } case PE_ScrollBarSlider: { - QRect br = r; + TQRect br = r; p->setPen( cg.background() ); if (flags & Style_Horizontal) { @@ -728,7 +728,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, p->drawLine( br.topRight(), br.bottomRight() ); br.addCoords( 1, 1, -1, -1 ); - p->fillRect( br, cg.brush( QColorGroup::Highlight ) ); + p->fillRect( br, cg.brush( TQColorGroup::Highlight ) ); break; } @@ -754,7 +754,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, } if (pe >= PE_ArrowUp && pe <= PE_ArrowLeft) { - QPointArray a; + TQPointArray a; switch ( pe ) { case PE_ArrowUp: @@ -798,26 +798,26 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe, } p->restore(); } else - QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); + TQCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); break; } } void LightStyleV3::drawControl( ControlElement control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &data ) const + const TQStyleOption &data ) const { switch (control) { case CE_TabBarTab: { - const QTabBar *tb = (const QTabBar *) widget; - QRect br = r; + const TQTabBar *tb = (const TQTabBar *) widget; + TQRect br = r; - if ( tb->shape() == QTabBar::RoundedAbove ) { + if ( tb->shape() == TQTabBar::RoundedAbove ) { if ( ! ( flags & Style_Selected ) ) { p->setPen( cg.background() ); p->drawLine( br.left(), br.bottom(), @@ -846,13 +846,13 @@ void LightStyleV3::drawControl( ControlElement control, if ( flags & Style_Selected ) { - p->fillRect( br.right() - 3, br.top() + 1, 3, br.height() - 1, cg.brush(QColorGroup::Highlight)); + p->fillRect( br.right() - 3, br.top() + 1, 3, br.height() - 1, cg.brush(TQColorGroup::Highlight)); br.addCoords( 1, 1, -4, 0 ); } else br.addCoords( 1, 1, -1, 0 ); p->fillRect( br, cg.background() ); - } else if ( tb->shape() == QTabBar::RoundedBelow ) { + } else if ( tb->shape() == TQTabBar::RoundedBelow ) { if ( ! ( flags & Style_Selected ) ) { p->setPen( cg.background() ); p->drawLine( br.left(), br.top(), @@ -884,7 +884,7 @@ void LightStyleV3::drawControl( ControlElement control, if ( flags & Style_Selected ) { - p->fillRect( br.right() - 2, br.top(), 3, br.height(), cg.brush(QColorGroup::Highlight)); + p->fillRect( br.right() - 2, br.top(), 3, br.height(), cg.brush(TQColorGroup::Highlight)); br.addCoords( 1, 0, -3, -1 ); } else @@ -892,7 +892,7 @@ void LightStyleV3::drawControl( ControlElement control, p->fillRect( br, cg.background() ); } else - QCommonStyle::drawControl( control, p, widget, r, cg, flags, data ); + TQCommonStyle::drawControl( control, p, widget, r, cg, flags, data ); break; } @@ -901,8 +901,8 @@ void LightStyleV3::drawControl( ControlElement control, if (! widget || data.isDefault()) break; - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; - QMenuItem *mi = data.menuItem(); + const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; + TQMenuItem *mi = data.menuItem(); int tab = data.tabWidth(); int maxpmw = data.maxIconWidth(); @@ -910,7 +910,7 @@ void LightStyleV3::drawControl( ControlElement control, if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) p->drawPixmap( r.topLeft(), *widget->erasePixmap(), r ); else - p->fillRect(r, cg.brush(QColorGroup::Button)); + p->fillRect(r, cg.brush(TQColorGroup::Button)); p->setPen( cg.mid() ); p->drawLine(r.left() + 12, r.top() + 1, r.right() - 12, r.top() + 1); @@ -922,18 +922,18 @@ void LightStyleV3::drawControl( ControlElement control, if (flags & Style_Active) qDrawShadePanel(p, r, cg, true, 1, - &cg.brush(QColorGroup::Midlight)); + &cg.brush(TQColorGroup::Midlight)); else if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) p->drawPixmap( r.topLeft(), *widget->erasePixmap(), r ); else - p->fillRect(r, cg.brush(QColorGroup::Button)); + p->fillRect(r, cg.brush(TQColorGroup::Button)); if ( !mi ) break; maxpmw = QMAX(maxpmw, 16); - QRect cr, ir, tr, sr; + TQRect cr, ir, tr, sr; // check column cr.setRect(r.left(), r.top(), maxpmw, r.height()); // submenu indicator column @@ -943,7 +943,7 @@ void LightStyleV3::drawControl( ControlElement control, // item column ir.setCoords(cr.right() + 4, r.top(), tr.right() - 4, r.bottom()); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); if ( reverse ) { cr = visualRect( cr, r ); sr = visualRect( sr, r ); @@ -954,21 +954,21 @@ void LightStyleV3::drawControl( ControlElement control, if (mi->isChecked() && ! (flags & Style_Active) & (flags & Style_Enabled)) - qDrawShadePanel(p, cr, cg, true, 1, &cg.brush(QColorGroup::Midlight)); + qDrawShadePanel(p, cr, cg, true, 1, &cg.brush(TQColorGroup::Midlight)); if (mi->iconSet()) { - QIconSet::Mode mode = - (flags & Style_Enabled) ? QIconSet::Normal : QIconSet::Disabled; + TQIconSet::Mode mode = + (flags & Style_Enabled) ? TQIconSet::Normal : TQIconSet::Disabled; if ((flags & Style_Active) && (flags & Style_Enabled)) - mode = QIconSet::Active; - QPixmap pixmap; + mode = TQIconSet::Active; + TQPixmap pixmap; if (popupmenu->isCheckable() && mi->isChecked()) pixmap = - mi->iconSet()->pixmap( QIconSet::Small, mode, QIconSet::On ); + mi->iconSet()->pixmap( TQIconSet::Small, mode, TQIconSet::On ); else pixmap = - mi->iconSet()->pixmap( QIconSet::Small, mode ); - QRect pmr(QPoint(0, 0), pixmap.size()); + mi->iconSet()->pixmap( TQIconSet::Small, mode ); + TQRect pmr(TQPoint(0, 0), pixmap.size()); pmr.moveCenter(cr.center()); p->setPen(cg.text()); p->drawPixmap(pmr.topLeft(), pixmap); @@ -976,8 +976,8 @@ void LightStyleV3::drawControl( ControlElement control, drawPrimitive(PE_CheckMark, p, cr, cg, (flags & Style_Enabled) | Style_On); - QColor textcolor; - QColor embosscolor; + TQColor textcolor; + TQColor embosscolor; if (flags & Style_Active) { if (! (flags & Style_Enabled)) textcolor = cg.midlight().dark(); @@ -1008,7 +1008,7 @@ void LightStyleV3::drawControl( ControlElement control, p->restore(); } - QString text = mi->text(); + TQString text = mi->text(); if (! text.isNull()) { int t = text.find('\t'); @@ -1040,7 +1040,7 @@ void LightStyleV3::drawControl( ControlElement control, p->drawText(ir, alignFlag, text, t); } else if (mi->pixmap()) { - QPixmap pixmap = *mi->pixmap(); + TQPixmap pixmap = *mi->pixmap(); if (pixmap.depth() == 1) p->setBackgroundMode(OpaqueMode); p->drawPixmap(ir.x(), ir.y() + (ir.height() - pixmap.height()) / 2, pixmap); @@ -1049,28 +1049,28 @@ void LightStyleV3::drawControl( ControlElement control, } if (mi->popup()) - drawPrimitive( (QApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight), + drawPrimitive( (TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight), p, sr, cg, flags); break; } case CE_MenuBarEmptyArea: { - p->fillRect(r, cg.brush(QColorGroup::Button)); + p->fillRect(r, cg.brush(TQColorGroup::Button)); break; } case CE_MenuBarItem: { if ( flags & Style_Active ) - qDrawShadePanel(p, r, cg, true, 1, &cg.brush(QColorGroup::Midlight)); + qDrawShadePanel(p, r, cg, true, 1, &cg.brush(TQColorGroup::Midlight)); else - p->fillRect( r, cg.brush( QColorGroup::Button ) ); + p->fillRect( r, cg.brush( TQColorGroup::Button ) ); if (data.isDefault()) break; - QMenuItem *mi = data.menuItem(); + TQMenuItem *mi = data.menuItem(); drawItem(p, r, AlignCenter | ShowPrefix | DontClip | SingleLine, cg, flags & Style_Enabled, mi->pixmap(), mi->text(), -1, &cg.buttonText()); @@ -1079,20 +1079,20 @@ void LightStyleV3::drawControl( ControlElement control, case CE_ProgressBarGroove: drawLightBevel( p, r, cg, Style_Sunken, pixelMetric( PM_DefaultFrameWidth ), - true, true, &cg.brush( QColorGroup::Background ) ); + true, true, &cg.brush( TQColorGroup::Background ) ); break; default: - QCommonStyle::drawControl(control, p, widget, r, cg, flags, data); + TQCommonStyle::drawControl(control, p, widget, r, cg, flags, data); break; } } void LightStyleV3::drawControlMask( ControlElement control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption &data ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption &data ) const { switch (control) { case CE_PushButton: @@ -1100,19 +1100,19 @@ void LightStyleV3::drawControlMask( ControlElement control, break; default: - QCommonStyle::drawControlMask(control, p, widget, r, data); + TQCommonStyle::drawControlMask(control, p, widget, r, data); break; } } -QRect LightStyleV3::subRect(SubRect subrect, const QWidget *widget) const +TQRect LightStyleV3::subRect(SubRect subrect, const TQWidget *widget) const { - QRect rect; + TQRect rect; switch (subrect) { case SR_PushButtonFocusRect: { - rect = QCommonStyle::subRect( SR_PushButtonContents, widget ); + rect = TQCommonStyle::subRect( SR_PushButtonContents, widget ); int bm = pixelMetric( PM_ButtonMargin, widget ), hbm = bm / 2; rect.addCoords( hbm, hbm, -hbm, -hbm ); break; @@ -1120,20 +1120,20 @@ QRect LightStyleV3::subRect(SubRect subrect, const QWidget *widget) const case SR_ComboBoxFocusRect: { - rect = QCommonStyle::subRect( SR_ComboBoxFocusRect, widget ); + rect = TQCommonStyle::subRect( SR_ComboBoxFocusRect, widget ); rect.addCoords( -1, -1, 1, 1 ); break; } case SR_CheckBoxFocusRect: { - const QCheckBox* cb = static_cast<const QCheckBox*>(widget); + const TQCheckBox* cb = static_cast<const TQCheckBox*>(widget); //Only checkbox, no label if (cb->text().isEmpty() && (cb->pixmap() == 0) ) { - QRect bounding = cb->rect(); - QRect checkbox(bounding.x(), bounding.y() + (bounding.height() - 13)/2, + TQRect bounding = cb->rect(); + TQRect checkbox(bounding.x(), bounding.y() + (bounding.height() - 13)/2, 13, 13); return checkbox; @@ -1143,7 +1143,7 @@ QRect LightStyleV3::subRect(SubRect subrect, const QWidget *widget) const default: - rect = QCommonStyle::subRect(subrect, widget); + rect = TQCommonStyle::subRect(subrect, widget); break; } @@ -1151,30 +1151,30 @@ QRect LightStyleV3::subRect(SubRect subrect, const QWidget *widget) const } void LightStyleV3::drawComplexControl( ComplexControl control, - QPainter* p, - const QWidget* widget, - const QRect& r, - const QColorGroup& cg, + TQPainter* p, + const TQWidget* widget, + const TQRect& r, + const TQColorGroup& cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption &data ) const + const TQStyleOption &data ) const { switch (control) { case CC_ComboBox: { - const QComboBox *combobox = (const QComboBox *) widget; - QRect frame, arrow, field; + const TQComboBox *combobox = (const TQComboBox *) widget; + TQRect frame, arrow, field; frame = - QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxFrame, data), widget); arrow = - QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow, data), widget); field = - QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxEditField, data), widget); @@ -1184,7 +1184,7 @@ void LightStyleV3::drawComplexControl( ComplexControl control, if ((controls & SC_ComboBoxArrow) && arrow.isValid()) { drawLightEtch( p, arrow, cg.button(), ( active == SC_ComboBoxArrow ) ); arrow.addCoords( 1, 1, -1, -1 ); - p->fillRect( arrow, cg.brush( QColorGroup::Button ) ); + p->fillRect( arrow, cg.brush( TQColorGroup::Button ) ); arrow.addCoords(3, 1, -1, -1); drawPrimitive(PE_ArrowDown, p, arrow, cg, flags); } @@ -1192,20 +1192,20 @@ void LightStyleV3::drawComplexControl( ComplexControl control, if ((controls & SC_ComboBoxEditField) && field.isValid()) { if (flags & Style_HasFocus) { if (! combobox->editable()) { - QRect fr = - QStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ), + TQRect fr = + TQStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ), widget ); - p->fillRect( fr, cg.brush( QColorGroup::Highlight ) ); + p->fillRect( fr, cg.brush( TQColorGroup::Highlight ) ); drawPrimitive( PE_FocusRect, p, fr, cg, flags | Style_FocusAtBorder, - QStyleOption(cg.highlight())); + TQStyleOption(cg.highlight())); } p->setPen(cg.highlightedText()); } else { p->fillRect( field, ( ( flags & Style_Enabled ) ? - cg.brush( QColorGroup::Base ) : - cg.brush( QColorGroup::Background ) ) ); + cg.brush( TQColorGroup::Base ) : + cg.brush( TQColorGroup::Background ) ) ); p->setPen( cg.text() ); } } @@ -1215,8 +1215,8 @@ void LightStyleV3::drawComplexControl( ComplexControl control, case CC_SpinWidget: { - const QSpinWidget *spinwidget = (const QSpinWidget *) widget; - QRect frame, up, down; + const TQSpinWidget *spinwidget = (const TQSpinWidget *) widget; + TQRect frame, up, down; frame = querySubControlMetrics(CC_SpinWidget, widget, SC_SpinWidgetFrame, data); @@ -1228,14 +1228,14 @@ void LightStyleV3::drawComplexControl( ComplexControl control, if ((controls & SC_SpinWidgetUp) && up.isValid()) { PrimitiveElement pe = PE_SpinWidgetUp; - if ( spinwidget->buttonSymbols() == QSpinWidget::PlusMinus ) + if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus ) pe = PE_SpinWidgetPlus; p->setPen( cg.background() ); p->drawLine( up.topLeft(), up.bottomLeft() ); up.addCoords( 1, 0, 0, 0 ); - p->fillRect( up, cg.brush( QColorGroup::Button ) ); + p->fillRect( up, cg.brush( TQColorGroup::Button ) ); drawLightEtch( p, up, cg.button(), ( active == SC_SpinWidgetUp ) ); up.addCoords( 1, 0, 0, 0 ); @@ -1246,14 +1246,14 @@ void LightStyleV3::drawComplexControl( ComplexControl control, if ((controls & SC_SpinWidgetDown) && down.isValid()) { PrimitiveElement pe = PE_SpinWidgetDown; - if ( spinwidget->buttonSymbols() == QSpinWidget::PlusMinus ) + if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus ) pe = PE_SpinWidgetMinus; p->setPen( cg.background() ); p->drawLine( down.topLeft(), down.bottomLeft() ); down.addCoords( 1, 0, 0, 0 ); - p->fillRect( down, cg.brush( QColorGroup::Button ) ); + p->fillRect( down, cg.brush( TQColorGroup::Button ) ); drawLightEtch( p, down, cg.button(), ( active == SC_SpinWidgetDown ) ); down.addCoords( 1, 0, 0, 0 ); @@ -1267,8 +1267,8 @@ void LightStyleV3::drawComplexControl( ComplexControl control, case CC_ScrollBar: { - const QScrollBar *scrollbar = (const QScrollBar *) widget; - QRect addline, subline, subline2, addpage, subpage, slider, first, last; + const TQScrollBar *scrollbar = (const TQScrollBar *) widget; + TQRect addline, subline, subline2, addpage, subpage, slider, first, last; bool maxedOut = (scrollbar->minValue() == scrollbar->maxValue()); subline = querySubControlMetrics(control, widget, SC_ScrollBarSubLine, data); @@ -1339,7 +1339,7 @@ void LightStyleV3::drawComplexControl( ComplexControl control, // ### perhaps this should not be able to accept focus if maxedOut? if (scrollbar->hasFocus()) { - QRect fr(slider.x() + 2, slider.y() + 2, + TQRect fr(slider.x() + 2, slider.y() + 2, slider.width() - 5, slider.height() - 5); drawPrimitive(PE_FocusRect, p, fr, cg, Style_Default); } @@ -1350,19 +1350,19 @@ void LightStyleV3::drawComplexControl( ComplexControl control, case CC_Slider: { - const QSlider *slider = (const QSlider *) widget; - QRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, + const TQSlider *slider = (const TQSlider *) widget; + TQRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, data), handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, data); if ((controls & SC_SliderGroove) && groove.isValid()) { - QColor grooveColor = cg.midlight(); + TQColor grooveColor = cg.midlight(); if (!(flags & Style_Enabled)) grooveColor = cg.background(); - QBrush brush(grooveColor); + TQBrush brush(grooveColor); drawLightBevel( p, groove, cg, ( ( flags | Style_Raised ) ^ Style_Raised ) | ( ( flags & Style_Enabled ) ? Style_Sunken : @@ -1378,7 +1378,7 @@ void LightStyleV3::drawComplexControl( ComplexControl control, } if ((controls & SC_SliderHandle) && handle.isValid()) { - QColor sliderColor = cg.highlight(); + TQColor sliderColor = cg.highlight(); if (!(flags & Style_Enabled)) sliderColor = cg.button(); @@ -1408,7 +1408,7 @@ void LightStyleV3::drawComplexControl( ComplexControl control, } if (controls & SC_SliderTickmarks) - QCommonStyle::drawComplexControl(control, p, widget, r, cg, flags, + TQCommonStyle::drawComplexControl(control, p, widget, r, cg, flags, SC_SliderTickmarks, active, data ); break; } @@ -1420,18 +1420,18 @@ void LightStyleV3::drawComplexControl( ComplexControl control, break; default: - QCommonStyle::drawComplexControl(control, p, widget, r, cg, flags, + TQCommonStyle::drawComplexControl(control, p, widget, r, cg, flags, controls, active, data); break; } } -QRect LightStyleV3::querySubControlMetrics( ComplexControl control, - const QWidget *widget, +TQRect LightStyleV3::querySubControlMetrics( ComplexControl control, + const TQWidget *widget, SubControl sc, - const QStyleOption &data ) const + const TQStyleOption &data ) const { - QRect ret; + TQRect ret; switch (control) { case CC_ComboBox: @@ -1460,7 +1460,7 @@ QRect LightStyleV3::querySubControlMetrics( ComplexControl control, case CC_ScrollBar: { - const QScrollBar *scrollbar = (const QScrollBar *) widget; + const TQScrollBar *scrollbar = (const TQScrollBar *) widget; int sliderstart = scrollbar->sliderStart(); int sbextent = pixelMetric(PM_ScrollBarExtent, widget); int maxlen = ((scrollbar->orientation() == Qt::Horizontal) ? @@ -1536,7 +1536,7 @@ QRect LightStyleV3::querySubControlMetrics( ComplexControl control, case CC_Slider: { - const QSlider *slider = (const QSlider *) widget; + const TQSlider *slider = (const TQSlider *) widget; int tickOffset = pixelMetric( PM_SliderTickmarkOffset, widget ); int thickness = pixelMetric( PM_SliderControlThickness, widget ); @@ -1561,7 +1561,7 @@ QRect LightStyleV3::querySubControlMetrics( ComplexControl control, } default: - ret = QCommonStyle::querySubControlMetrics(control, widget, sc, data); + ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, data); break; } @@ -1569,20 +1569,20 @@ QRect LightStyleV3::querySubControlMetrics( ComplexControl control, } default: - ret = QCommonStyle::querySubControlMetrics(control, widget, sc, data); + ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, data); break; } return ret; } -QStyle::SubControl LightStyleV3::querySubControl( ComplexControl control, - const QWidget *widget, - const QPoint &pos, - const QStyleOption &data ) const +TQStyle::SubControl LightStyleV3::querySubControl( ComplexControl control, + const TQWidget *widget, + const TQPoint &pos, + const TQStyleOption &data ) const { - QStyle::SubControl ret = - QCommonStyle::querySubControl(control, widget, pos, data); + TQStyle::SubControl ret = + TQCommonStyle::querySubControl(control, widget, pos, data); // this is an ugly hack, but i really don't care, it's the quickest way to // enabled the third button @@ -1594,7 +1594,7 @@ QStyle::SubControl LightStyleV3::querySubControl( ComplexControl control, } int LightStyleV3::pixelMetric( PixelMetric metric, - const QWidget *widget ) const + const TQWidget *widget ) const { int ret; @@ -1663,13 +1663,13 @@ int LightStyleV3::pixelMetric( PixelMetric metric, case PM_SliderControlThickness: { - const QSlider * sl = (const QSlider *) widget; + const TQSlider * sl = (const TQSlider *) widget; int space = (sl->orientation() == Horizontal) ? sl->height() : sl->width(); int ticks = sl->tickmarks(); int n = 0; - if ( ticks & QSlider::Above ) n++; - if ( ticks & QSlider::Below ) n++; + if ( ticks & TQSlider::Above ) n++; + if ( ticks & TQSlider::Below ) n++; if ( !n ) { ret = space; break; @@ -1690,19 +1690,19 @@ int LightStyleV3::pixelMetric( PixelMetric metric, break; default: - ret = QCommonStyle::pixelMetric(metric, widget); + ret = TQCommonStyle::pixelMetric(metric, widget); break; } return ret; } -QSize LightStyleV3::sizeFromContents( ContentsType contents, - const QWidget *widget, - const QSize &contentsSize, - const QStyleOption &data ) const +TQSize LightStyleV3::sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentsSize, + const TQStyleOption &data ) const { - QSize ret; + TQSize ret; switch (contents) { case CT_ComboBox: @@ -1719,14 +1719,14 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents, if ( h < 21 ) h = 21; - ret = QSize( w, h ); + ret = TQSize( w, h ); break; } case CT_PushButton: { - const QPushButton *button = (const QPushButton *) widget; - ret = QCommonStyle::sizeFromContents( contents, widget, contentsSize, data ); + const TQPushButton *button = (const TQPushButton *) widget; + ret = TQCommonStyle::sizeFromContents( contents, widget, contentsSize, data ); int w = ret.width(), h = ret.height(); int dbi = pixelMetric( PM_ButtonDefaultIndicator, widget ) * 2; int mw = 80 - dbi, mh = 25 - dbi; @@ -1740,7 +1740,7 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents, h = mh; } - ret = QSize( w, h ); + ret = TQSize( w, h ); break; } @@ -1749,8 +1749,8 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents, if (! widget || data.isDefault()) break; - QMenuItem *mi = data.menuItem(); - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; + TQMenuItem *mi = data.menuItem(); + const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; int maxpmw = data.maxIconWidth(); int w = contentsSize.width(), h = contentsSize.height(); @@ -1772,8 +1772,8 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents, else if (! mi->text().isNull()) h = QMAX(h, popupmenu->fontMetrics().height() + 2); if (mi->iconSet() != 0) - h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small, - QIconSet::Normal).height()); + h = QMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, + TQIconSet::Normal).height()); h += 2; } @@ -1786,22 +1786,22 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents, if (! mi->text().isNull() && mi->text().find('\t') >= 0) w += 8; - ret = QSize(w, h); + ret = TQSize(w, h); break; } case CT_ProgressBar: { - const QProgressBar* pb = static_cast<const QProgressBar*>(widget); + const TQProgressBar* pb = static_cast<const TQProgressBar*>(widget); //If we have to display the indicator, and we do it on RHS, give some more room //for it. This tries to match the logic and the spacing in SR_ProgressBarGroove/Contents - //sizing in QCommonStyle. + //sizing in TQCommonStyle. if (pb->percentageVisible() && (pb->indicatorFollowsStyle() || ! pb->centerIndicator())) { int addw = pb->fontMetrics().width("100%") + 6; - return QSize(contentsSize.width() + addw, contentsSize.height()); + return TQSize(contentsSize.width() + addw, contentsSize.height()); } else return contentsSize; //Otherwise leave unchanged @@ -1810,7 +1810,7 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents, } default: - ret = QCommonStyle::sizeFromContents(contents, widget, contentsSize, data); + ret = TQCommonStyle::sizeFromContents(contents, widget, contentsSize, data); break; } @@ -1818,8 +1818,8 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents, } int LightStyleV3::styleHint( StyleHint stylehint, - const QWidget *widget, - const QStyleOption &option, + const TQWidget *widget, + const TQStyleOption &option, QStyleHintReturn* returnData ) const { int ret; @@ -1846,16 +1846,16 @@ int LightStyleV3::styleHint( StyleHint stylehint, break; default: - ret = QCommonStyle::styleHint(stylehint, widget, option, returnData); + ret = TQCommonStyle::styleHint(stylehint, widget, option, returnData); break; } return ret; } -QPixmap LightStyleV3::stylePixmap( StylePixmap stylepixmap, - const QWidget *widget, - const QStyleOption &data ) const +TQPixmap LightStyleV3::stylePixmap( StylePixmap stylepixmap, + const TQWidget *widget, + const TQStyleOption &data ) const { return basestyle->stylePixmap( stylepixmap, widget, data ); } diff --git a/kstyles/light/lightstyle-v3.h b/kstyles/light/lightstyle-v3.h index b46010778..be8812b99 100644 --- a/kstyles/light/lightstyle-v3.h +++ b/kstyles/light/lightstyle-v3.h @@ -25,7 +25,7 @@ #ifndef QT_H -#include <qcommonstyle.h> +#include <tqcommonstyle.h> #endif // QT_H #include "kstyle.h" @@ -40,49 +40,49 @@ class Q_EXPORT_STYLE_LIGHT_V3 LightStyleV3 : public KStyle { Q_OBJECT - QStyle *basestyle; + TQStyle *basestyle; public: LightStyleV3(); virtual ~LightStyleV3(); - void polishPopupMenu( QPopupMenu * ); + void polishPopupMenu( TQPopupMenu * ); - void drawPrimitive(PrimitiveElement, QPainter *, const QRect &, const QColorGroup &, + void drawPrimitive(PrimitiveElement, TQPainter *, const TQRect &, const TQColorGroup &, SFlags = Style_Default, - const QStyleOption & = QStyleOption::Default ) const; + const TQStyleOption & = TQStyleOption::Default ) const; - void drawControl(ControlElement, QPainter *, const QWidget *, const QRect &, - const QColorGroup &, SFlags = Style_Default, - const QStyleOption & = QStyleOption::Default ) const; - void drawControlMask(ControlElement, QPainter *, const QWidget *, const QRect &, - const QStyleOption & = QStyleOption::Default) const; + void drawControl(ControlElement, TQPainter *, const TQWidget *, const TQRect &, + const TQColorGroup &, SFlags = Style_Default, + const TQStyleOption & = TQStyleOption::Default ) const; + void drawControlMask(ControlElement, TQPainter *, const TQWidget *, const TQRect &, + const TQStyleOption & = TQStyleOption::Default) const; - QRect subRect(SubRect, const QWidget *) const; + TQRect subRect(SubRect, const TQWidget *) const; - void drawComplexControl(ComplexControl, QPainter *, const QWidget *, const QRect &, - const QColorGroup &, SFlags = Style_Default, + void drawComplexControl(ComplexControl, TQPainter *, const TQWidget *, const TQRect &, + const TQColorGroup &, SFlags = Style_Default, SCFlags = SC_All, SCFlags = SC_None, - const QStyleOption & = QStyleOption::Default ) const; + const TQStyleOption & = TQStyleOption::Default ) const; - QRect querySubControlMetrics(ComplexControl, const QWidget *, SubControl, - const QStyleOption & = QStyleOption::Default ) const; + TQRect querySubControlMetrics(ComplexControl, const TQWidget *, SubControl, + const TQStyleOption & = TQStyleOption::Default ) const; - SubControl querySubControl(ComplexControl, const QWidget *, const QPoint &, - const QStyleOption &data = QStyleOption::Default ) const; + SubControl querySubControl(ComplexControl, const TQWidget *, const TQPoint &, + const TQStyleOption &data = TQStyleOption::Default ) const; - int pixelMetric(PixelMetric, const QWidget * = 0 ) const; + int pixelMetric(PixelMetric, const TQWidget * = 0 ) const; - QSize sizeFromContents(ContentsType, const QWidget *, const QSize &, - const QStyleOption & = QStyleOption::Default ) const; + TQSize sizeFromContents(ContentsType, const TQWidget *, const TQSize &, + const TQStyleOption & = TQStyleOption::Default ) const; - int styleHint(StyleHint, const QWidget * = 0, - const QStyleOption & = QStyleOption::Default, + int styleHint(StyleHint, const TQWidget * = 0, + const TQStyleOption & = TQStyleOption::Default, QStyleHintReturn * = 0 ) const; - QPixmap stylePixmap( StylePixmap stylepixmap, - const QWidget* widget = 0, - const QStyleOption& = QStyleOption::Default ) const; + TQPixmap stylePixmap( StylePixmap stylepixmap, + const TQWidget* widget = 0, + const TQStyleOption& = TQStyleOption::Default ) const; }; diff --git a/kstyles/plastik/config/plastikconf.cpp b/kstyles/plastik/config/plastikconf.cpp index b9c3ff8cf..70d4f6cfa 100644 --- a/kstyles/plastik/config/plastikconf.cpp +++ b/kstyles/plastik/config/plastikconf.cpp @@ -24,12 +24,12 @@ DEALINGS IN THE SOFTWARE. */ -#include <qcheckbox.h> -#include <qlayout.h> -#include <qhbox.h> -#include <qsettings.h> -#include <qcolor.h> -#include <qgroupbox.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqhbox.h> +#include <tqsettings.h> +#include <tqcolor.h> +#include <tqgroupbox.h> #include <kglobal.h> #include <klocale.h> #include <kcolorbutton.h> @@ -39,40 +39,40 @@ DEALINGS IN THE SOFTWARE. extern "C" { - KDE_EXPORT QWidget* allocate_kstyle_config(QWidget* parent) + KDE_EXPORT TQWidget* allocate_kstyle_config(TQWidget* parent) { KGlobal::locale()->insertCatalogue("kstyle_plastik_config"); return new PlastikStyleConfig(parent); } } -PlastikStyleConfig::PlastikStyleConfig(QWidget* parent): QWidget(parent) +PlastikStyleConfig::PlastikStyleConfig(TQWidget* parent): TQWidget(parent) { //Should have no margins here, the dialog provides them - QVBoxLayout* layout = new QVBoxLayout(this, 0, 0); + TQVBoxLayout* layout = new TQVBoxLayout(this, 0, 0); KGlobal::locale()->insertCatalogue("kstyle_plastik_config"); -// scrollBarLines = new QCheckBox(i18n("Scrollbar handle lines"), this); - animateProgressBar = new QCheckBox(i18n("Animate progress bars"), this); - drawToolBarSeparator = new QCheckBox(i18n("Draw toolbar separator"), this); - drawToolBarItemSeparator = new QCheckBox(i18n("Draw toolbar item separators"), this); -// drawFocusRect = new QCheckBox(i18n("Draw focus rectangles"), this); - drawTriangularExpander = new QCheckBox(i18n("Triangular tree expander"), this); - inputFocusHighlight = new QCheckBox(i18n("Highlight focused text input fields"), this); - - customFocusHighlightColor = new QCheckBox(i18n("Custom text input highlight color:"), this); - QHBox *hbox1 = new QHBox(this); - hbox1->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); +// scrollBarLines = new TQCheckBox(i18n("Scrollbar handle lines"), this); + animateProgressBar = new TQCheckBox(i18n("Animate progress bars"), this); + drawToolBarSeparator = new TQCheckBox(i18n("Draw toolbar separator"), this); + drawToolBarItemSeparator = new TQCheckBox(i18n("Draw toolbar item separators"), this); +// drawFocusRect = new TQCheckBox(i18n("Draw focus rectangles"), this); + drawTriangularExpander = new TQCheckBox(i18n("Triangular tree expander"), this); + inputFocusHighlight = new TQCheckBox(i18n("Highlight focused text input fields"), this); + + customFocusHighlightColor = new TQCheckBox(i18n("Custom text input highlight color:"), this); + TQHBox *hbox1 = new TQHBox(this); + hbox1->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); focusHighlightColor = new KColorButton(hbox1); - customOverHighlightColor = new QCheckBox(i18n("Custom mouseover highlight color:"), this); - QHBox *hbox2 = new QHBox(this); - hbox2->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + customOverHighlightColor = new TQCheckBox(i18n("Custom mouseover highlight color:"), this); + TQHBox *hbox2 = new TQHBox(this); + hbox2->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); overHighlightColor = new KColorButton(hbox2); - customCheckMarkColor = new QCheckBox(i18n("Custom checkmark color:"), this); - QHBox *hbox3 = new QHBox(this); - hbox3->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + customCheckMarkColor = new TQCheckBox(i18n("Custom checkmark color:"), this); + TQHBox *hbox3 = new TQHBox(this); + hbox3->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); checkMarkColor = new KColorButton(hbox3); // layout->add(scrollBarLines); @@ -90,7 +90,7 @@ PlastikStyleConfig::PlastikStyleConfig(QWidget* parent): QWidget(parent) layout->add(hbox3); layout->addStretch(1); - QSettings s; + TQSettings s; // origScrollBarLines = s.readBoolEntry("/plastikstyle/Settings/scrollBarLines", false); // scrollBarLines->setChecked(origScrollBarLines); origAnimProgressBar = s.readBoolEntry("/plastikstyle/Settings/animateProgressBar", false); @@ -118,19 +118,19 @@ PlastikStyleConfig::PlastikStyleConfig(QWidget* parent): QWidget(parent) origCheckMarkColor = s.readEntry("/plastikstyle/Settings/checkMarkColor", "black"); checkMarkColor->setColor(origCheckMarkColor); -// connect(scrollBarLines, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(animateProgressBar, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(drawToolBarSeparator, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(drawToolBarItemSeparator, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); -// connect(drawFocusRect, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(drawTriangularExpander, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(inputFocusHighlight, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(customOverHighlightColor, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(overHighlightColor, SIGNAL( changed(const QColor&) ), SLOT( updateChanged() ) ); - connect(customFocusHighlightColor, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(focusHighlightColor, SIGNAL( changed(const QColor&) ), SLOT( updateChanged() ) ); - connect(customCheckMarkColor, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) ); - connect(checkMarkColor, SIGNAL( changed(const QColor&) ), SLOT( updateChanged() ) ); +// connect(scrollBarLines, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(animateProgressBar, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(drawToolBarSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(drawToolBarItemSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); +// connect(drawFocusRect, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(drawTriangularExpander, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(inputFocusHighlight, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(customOverHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(overHighlightColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); + connect(customFocusHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(focusHighlightColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); + connect(customCheckMarkColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(checkMarkColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); if ( customOverHighlightColor->isChecked() ) overHighlightColor->setEnabled(true); else @@ -152,7 +152,7 @@ PlastikStyleConfig::~PlastikStyleConfig() void PlastikStyleConfig::save() { - QSettings s; + TQSettings s; // s.writeEntry("/plastikstyle/Settings/scrollBarLines", scrollBarLines->isChecked()); s.writeEntry("/plastikstyle/Settings/animateProgressBar", animateProgressBar->isChecked()); s.writeEntry("/plastikstyle/Settings/drawToolBarSeparator", drawToolBarSeparator->isChecked()); @@ -161,11 +161,11 @@ void PlastikStyleConfig::save() s.writeEntry("/plastikstyle/Settings/drawTriangularExpander", drawTriangularExpander->isChecked()); s.writeEntry("/plastikstyle/Settings/inputFocusHighlight", inputFocusHighlight->isChecked()); s.writeEntry("/plastikstyle/Settings/customOverHighlightColor", customOverHighlightColor->isChecked()); - s.writeEntry("/plastikstyle/Settings/overHighlightColor", QColor(overHighlightColor->color()).name()); + s.writeEntry("/plastikstyle/Settings/overHighlightColor", TQColor(overHighlightColor->color()).name()); s.writeEntry("/plastikstyle/Settings/customFocusHighlightColor", customFocusHighlightColor->isChecked()); - s.writeEntry("/plastikstyle/Settings/focusHighlightColor", QColor(focusHighlightColor->color()).name()); + s.writeEntry("/plastikstyle/Settings/focusHighlightColor", TQColor(focusHighlightColor->color()).name()); s.writeEntry("/plastikstyle/Settings/customCheckMarkColor", customCheckMarkColor->isChecked()); - s.writeEntry("/plastikstyle/Settings/checkMarkColor", QColor(checkMarkColor->color()).name()); + s.writeEntry("/plastikstyle/Settings/checkMarkColor", TQColor(checkMarkColor->color()).name()); } void PlastikStyleConfig::defaults() diff --git a/kstyles/plastik/config/plastikconf.h b/kstyles/plastik/config/plastikconf.h index 66106061e..b1af43b32 100644 --- a/kstyles/plastik/config/plastikconf.h +++ b/kstyles/plastik/config/plastikconf.h @@ -33,7 +33,7 @@ class PlastikStyleConfig: public QWidget { Q_OBJECT public: - PlastikStyleConfig(QWidget* parent); + PlastikStyleConfig(TQWidget* parent); ~PlastikStyleConfig(); //This signal and the next two slots are the plugin @@ -52,18 +52,18 @@ protected slots: protected: //We store settings directly in widgets to //avoid the hassle of sync'ing things -// QCheckBox* scrollBarLines; - QCheckBox* animateProgressBar; - QCheckBox* drawToolBarSeparator; - QCheckBox* drawToolBarItemSeparator; -// QCheckBox* drawFocusRect; - QCheckBox* drawTriangularExpander; - QCheckBox* inputFocusHighlight; - QCheckBox* customOverHighlightColor; +// TQCheckBox* scrollBarLines; + TQCheckBox* animateProgressBar; + TQCheckBox* drawToolBarSeparator; + TQCheckBox* drawToolBarItemSeparator; +// TQCheckBox* drawFocusRect; + TQCheckBox* drawTriangularExpander; + TQCheckBox* inputFocusHighlight; + TQCheckBox* customOverHighlightColor; KColorButton* overHighlightColor; - QCheckBox* customFocusHighlightColor; + TQCheckBox* customFocusHighlightColor; KColorButton* focusHighlightColor; - QCheckBox* customCheckMarkColor; + TQCheckBox* customCheckMarkColor; KColorButton* checkMarkColor; //Original settings, for accurate dirtiness tracking @@ -75,11 +75,11 @@ protected: bool origDrawTriangularExpander; bool origInputFocusHighlight; bool origCustomOverHighlightColor; - QColor origOverHighlightColor; + TQColor origOverHighlightColor; bool origCustomFocusHighlightColor; - QColor origFocusHighlightColor; + TQColor origFocusHighlightColor; bool origCustomCheckMarkColor; - QColor origCheckMarkColor; + TQColor origCheckMarkColor; }; #endif diff --git a/kstyles/plastik/misc.cpp b/kstyles/plastik/misc.cpp index 5eddf5ad2..e1fc2df79 100644 --- a/kstyles/plastik/misc.cpp +++ b/kstyles/plastik/misc.cpp @@ -16,10 +16,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qcolor.h> +#include <tqcolor.h> #include "misc.h" -QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a) +TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a) { // normal button... @@ -30,7 +30,7 @@ QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int if(alpha<0) alpha = 0; int inv_alpha = 255 - alpha; - QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255, + TQColor result = TQColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255, qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255, qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) ); diff --git a/kstyles/plastik/misc.h b/kstyles/plastik/misc.h index 65bb42534..c09ee87c8 100644 --- a/kstyles/plastik/misc.h +++ b/kstyles/plastik/misc.h @@ -19,6 +19,6 @@ #ifndef __MISC_H #define __MISC_H -QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha); +TQColor alphaBlendColors(const TQColor &backgroundColor, const TQColor &foregroundColor, const int alpha); #endif // __MISC_H diff --git a/kstyles/plastik/plastik.cpp b/kstyles/plastik/plastik.cpp index 98e7e6d49..dd7954cc9 100644 --- a/kstyles/plastik/plastik.cpp +++ b/kstyles/plastik/plastik.cpp @@ -38,34 +38,34 @@ Boston, MA 02110-1301, USA. */ -#include <qimage.h> -#include <qstylefactory.h> -#include <qpointarray.h> -#include <qpainter.h> -#include <qtabbar.h> -#include <qprogressbar.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qcleanuphandler.h> -#include <qheader.h> -#include <qlineedit.h> -#include <qlistbox.h> -#include <qscrollbar.h> -#include <qstyleplugin.h> -#include <qpushbutton.h> -#include <qtabwidget.h> -#include <qtimer.h> -#include <qtoolbutton.h> -#include <qtoolbar.h> -#include <qmenubar.h> -#include <qpopupmenu.h> -#include <qdrawutil.h> -#include <qapplication.h> -#include <qvariant.h> -#include <qradiobutton.h> -#include <qregion.h> -#include <qslider.h> -#include <qsettings.h> +#include <tqimage.h> +#include <tqstylefactory.h> +#include <tqpointarray.h> +#include <tqpainter.h> +#include <tqtabbar.h> +#include <tqprogressbar.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqcleanuphandler.h> +#include <tqheader.h> +#include <tqlineedit.h> +#include <tqlistbox.h> +#include <tqscrollbar.h> +#include <tqstyleplugin.h> +#include <tqpushbutton.h> +#include <tqtabwidget.h> +#include <tqtimer.h> +#include <tqtoolbutton.h> +#include <tqtoolbar.h> +#include <tqmenubar.h> +#include <tqpopupmenu.h> +#include <tqdrawutil.h> +#include <tqapplication.h> +#include <tqvariant.h> +#include <tqradiobutton.h> +#include <tqregion.h> +#include <tqslider.h> +#include <tqsettings.h> #include <kpixmap.h> #include "plastik.h" @@ -137,11 +137,11 @@ class PlastikStylePlugin : public QStylePlugin PlastikStylePlugin() {} ~PlastikStylePlugin() {} - QStringList keys() const { - return QStringList() << "Plastik"; + TQStringList keys() const { + return TQStringList() << "Plastik"; } - QStyle* create( const QString& key ) { + TQStyle* create( const TQString& key ) { if (key.lower() == "plastik") return new PlastikStyle; return 0; @@ -163,7 +163,7 @@ PlastikStyle::PlastikStyle() : KStyle( AllowMenuTransparency, ThreeButtonScrollB horizontalLine = 0; verticalLine = 0; - QSettings settings; + TQSettings settings; _contrast = settings.readNumEntry("/Qt/KDE/contrast", 6); settings.beginGroup("/plastikstyle/Settings"); _scrollBarLines = settings.readBoolEntry("/scrollBarLines", false); @@ -182,29 +182,29 @@ PlastikStyle::PlastikStyle() : KStyle( AllowMenuTransparency, ThreeButtonScrollB settings.endGroup(); // setup pixmap cache... - pixmapCache = new QIntCache<CacheEntry>(150000, 499); + pixmapCache = new TQIntCache<CacheEntry>(150000, 499); pixmapCache->setAutoDelete(true); if ( _animateProgressBar ) { - animationTimer = new QTimer( this ); - connect( animationTimer, SIGNAL(timeout()), this, SLOT(updateProgressPos()) ); + animationTimer = new TQTimer( this ); + connect( animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateProgressPos()) ); } } void PlastikStyle::updateProgressPos() { - QProgressBar* pb; + TQProgressBar* pb; //Update the registered progressbars. - QMap<QWidget*, int>::iterator iter; + TQMap<TQWidget*, int>::iterator iter; bool visible = false; for (iter = progAnimWidgets.begin(); iter != progAnimWidgets.end(); ++iter) { - if ( !::qt_cast<QProgressBar*>(iter.key()) ) + if ( !::qt_cast<TQProgressBar*>(iter.key()) ) continue; - pb = dynamic_cast<QProgressBar*>(iter.key()); + pb = dynamic_cast<TQProgressBar*>(iter.key()); if ( iter.key() -> isEnabled() && pb -> progress() != pb->totalSteps() ) { @@ -227,7 +227,7 @@ PlastikStyle::~PlastikStyle() delete verticalLine; } -void PlastikStyle::polish(QApplication* app) +void PlastikStyle::polish(TQApplication* app) { if (!qstrcmp(app->argv()[0], "kicker")) kickerMode = true; @@ -235,38 +235,38 @@ void PlastikStyle::polish(QApplication* app) kornMode = true; } -void PlastikStyle::polish(QWidget* widget) +void PlastikStyle::polish(TQWidget* widget) { if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...? khtmlWidgets[widget] = true; - connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(khtmlWidgetDestroyed(QObject*))); + connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(khtmlWidgetDestroyed(TQObject*))); } // use qt_cast where possible to check if the widget inheits one of the classes. might improve - // performance compared to QObject::inherits() - if ( ::qt_cast<QPushButton*>(widget) || ::qt_cast<QComboBox*>(widget) || - ::qt_cast<QSpinWidget*>(widget) || ::qt_cast<QSlider*>(widget) || - ::qt_cast<QCheckBox*>(widget) || ::qt_cast<QRadioButton*>(widget) || - ::qt_cast<QToolButton*>(widget) || widget->inherits("QSplitterHandle") ) + // performance compared to TQObject::inherits() + if ( ::qt_cast<TQPushButton*>(widget) || ::qt_cast<TQComboBox*>(widget) || + ::qt_cast<TQSpinWidget*>(widget) || ::qt_cast<TQSlider*>(widget) || + ::qt_cast<TQCheckBox*>(widget) || ::qt_cast<TQRadioButton*>(widget) || + ::qt_cast<TQToolButton*>(widget) || widget->inherits("QSplitterHandle") ) { // widget->setBackgroundMode(PaletteBackground); widget->installEventFilter(this); - } else if (::qt_cast<QLineEdit*>(widget)) { + } else if (::qt_cast<TQLineEdit*>(widget)) { widget->installEventFilter(this); - } else if (::qt_cast<QTabBar*>(widget)) { + } else if (::qt_cast<TQTabBar*>(widget)) { widget->setMouseTracking(true); widget->installEventFilter(this); - } else if (::qt_cast<QPopupMenu*>(widget)) { + } else if (::qt_cast<TQPopupMenu*>(widget)) { widget->setBackgroundMode( NoBackground ); } else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) { widget->installEventFilter(this); } - if( _animateProgressBar && ::qt_cast<QProgressBar*>(widget) ) + if( _animateProgressBar && ::qt_cast<TQProgressBar*>(widget) ) { widget->installEventFilter(this); progAnimWidgets[widget] = 0; - connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(progressBarDestroyed(QObject*))); + connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(progressBarDestroyed(TQObject*))); if (!animationTimer->isActive()) animationTimer->start( 50, false ); } @@ -274,31 +274,31 @@ void PlastikStyle::polish(QWidget* widget) KStyle::polish(widget); } -void PlastikStyle::unPolish(QWidget* widget) +void PlastikStyle::unPolish(TQWidget* widget) { if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...? khtmlWidgets.remove(widget); } // use qt_cast to check if the widget inheits one of the classes. - if ( ::qt_cast<QPushButton*>(widget) || ::qt_cast<QComboBox*>(widget) || - ::qt_cast<QSpinWidget*>(widget) || ::qt_cast<QSlider*>(widget) || - ::qt_cast<QCheckBox*>(widget) || ::qt_cast<QRadioButton*>(widget) || - ::qt_cast<QToolButton*>(widget) || ::qt_cast<QLineEdit*>(widget) || + if ( ::qt_cast<TQPushButton*>(widget) || ::qt_cast<TQComboBox*>(widget) || + ::qt_cast<TQSpinWidget*>(widget) || ::qt_cast<TQSlider*>(widget) || + ::qt_cast<TQCheckBox*>(widget) || ::qt_cast<TQRadioButton*>(widget) || + ::qt_cast<TQToolButton*>(widget) || ::qt_cast<TQLineEdit*>(widget) || widget->inherits("QSplitterHandle") ) { widget->removeEventFilter(this); } - else if (::qt_cast<QTabBar*>(widget)) { + else if (::qt_cast<TQTabBar*>(widget)) { widget->setMouseTracking(false); widget->removeEventFilter(this); - } else if (::qt_cast<QPopupMenu*>(widget)) { + } else if (::qt_cast<TQPopupMenu*>(widget)) { widget->setBackgroundMode( PaletteBackground ); } else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) { widget->removeEventFilter(this); } - if ( ::qt_cast<QProgressBar*>(widget) ) + if ( ::qt_cast<TQProgressBar*>(widget) ) { progAnimWidgets.remove(widget); } @@ -306,20 +306,20 @@ void PlastikStyle::unPolish(QWidget* widget) KStyle::unPolish(widget); } -void PlastikStyle::khtmlWidgetDestroyed(QObject* obj) +void PlastikStyle::khtmlWidgetDestroyed(TQObject* obj) { - khtmlWidgets.remove(static_cast<QWidget*>(obj)); + khtmlWidgets.remove(static_cast<TQWidget*>(obj)); } -void PlastikStyle::progressBarDestroyed(QObject* obj) +void PlastikStyle::progressBarDestroyed(TQObject* obj) { - progAnimWidgets.remove(static_cast<QWidget*>(obj)); + progAnimWidgets.remove(static_cast<TQWidget*>(obj)); } -void PlastikStyle::renderContour(QPainter *p, - const QRect &r, - const QColor &backgroundColor, - const QColor &contour, +void PlastikStyle::renderContour(TQPainter *p, + const TQRect &r, + const TQColor &backgroundColor, + const TQColor &contour, const uint flags) const { if((r.width() <= 0)||(r.height() <= 0)) @@ -332,7 +332,7 @@ void PlastikStyle::renderContour(QPainter *p, const bool disabled = flags&Is_Disabled; const bool alphaBlend = flags&Draw_AlphaBlend; - QColor contourColor; + TQColor contourColor; if (disabled) { contourColor = backgroundColor.dark(150); } else { @@ -417,49 +417,49 @@ void PlastikStyle::renderContour(QPainter *p, if(drawLeft && drawTop) { switch(flags&Round_UpperLeft) { case false: - renderPixel(p,QPoint(r.left(),r.top()),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.left(),r.top()),alphaAA,contourColor,backgroundColor,alphaBlend); break; default: - renderPixel(p,QPoint(r.left()+1,r.top()),alphaAA,contourColor,backgroundColor,alphaBlend); - renderPixel(p,QPoint(r.left(),r.top()+1),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.left()+1,r.top()),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.left(),r.top()+1),alphaAA,contourColor,backgroundColor,alphaBlend); } } if(drawLeft && drawBottom) { switch(flags&Round_BottomLeft) { case false: - renderPixel(p,QPoint(r.left(),r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.left(),r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend); break; default: - renderPixel(p,QPoint(r.left()+1,r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend); - renderPixel(p,QPoint(r.left(),r.bottom()-1),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.left()+1,r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.left(),r.bottom()-1),alphaAA,contourColor,backgroundColor,alphaBlend); } } if(drawRight && drawTop) { switch(flags&Round_UpperRight) { case false: - renderPixel(p,QPoint(r.right(),r.top()),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.right(),r.top()),alphaAA,contourColor,backgroundColor,alphaBlend); break; default: - renderPixel(p,QPoint(r.right()-1,r.top()),alphaAA,contourColor,backgroundColor,alphaBlend); - renderPixel(p,QPoint(r.right(),r.top()+1),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.right()-1,r.top()),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.right(),r.top()+1),alphaAA,contourColor,backgroundColor,alphaBlend); } } if(drawRight && drawBottom) { switch(flags&Round_BottomRight) { case false: - renderPixel(p,QPoint(r.right(),r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.right(),r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend); break; default: - renderPixel(p,QPoint(r.right()-1,r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend); - renderPixel(p,QPoint(r.right(),r.bottom()-1),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.right()-1,r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend); + renderPixel(p,TQPoint(r.right(),r.bottom()-1),alphaAA,contourColor,backgroundColor,alphaBlend); } } } -void PlastikStyle::renderMask(QPainter *p, - const QRect &r, - const QColor &color, +void PlastikStyle::renderMask(TQPainter *p, + const TQRect &r, + const TQColor &color, const uint flags) const { if((r.width() <= 0)||(r.height() <= 0)) @@ -471,7 +471,7 @@ void PlastikStyle::renderMask(QPainter *p, const bool roundBottomRight = flags&Round_BottomRight; - p->fillRect (QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2) , color); + p->fillRect (TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2) , color); p->setPen(color); // sides @@ -485,11 +485,11 @@ void PlastikStyle::renderMask(QPainter *p, r.right(), roundBottomLeft?r.bottom()-1:r.bottom() ); } -void PlastikStyle::renderSurface(QPainter *p, - const QRect &r, - const QColor &backgroundColor, - const QColor &buttonColor, - const QColor &highlightColor, +void PlastikStyle::renderSurface(TQPainter *p, + const TQRect &r, + const TQColor &backgroundColor, + const TQColor &buttonColor, + const TQColor &highlightColor, int intensity, const uint flags) const { @@ -522,7 +522,7 @@ void PlastikStyle::renderSurface(QPainter *p, highlightBottom = (flags&Highlight_Bottom); } - QColor baseColor = alphaBlendColors(backgroundColor, disabled?backgroundColor:buttonColor, 10); + TQColor baseColor = alphaBlendColors(backgroundColor, disabled?backgroundColor:buttonColor, 10); if (disabled) { intensity = 2; } else if (highlight) { @@ -535,13 +535,13 @@ void PlastikStyle::renderSurface(QPainter *p, } // some often needed colors... // 1 more intensive than 2 and 3. - const QColor colorTop1 = alphaBlendColors(baseColor, + const TQColor colorTop1 = alphaBlendColors(baseColor, sunken?baseColor.dark(100+intensity*2):baseColor.light(100+intensity*2), 80); - const QColor colorTop2 = alphaBlendColors(baseColor, + const TQColor colorTop2 = alphaBlendColors(baseColor, sunken?baseColor.dark(100+intensity):baseColor.light(100+intensity), 80); - const QColor colorBottom1 = alphaBlendColors(baseColor, + const TQColor colorBottom1 = alphaBlendColors(baseColor, sunken?baseColor.light(100+intensity*2):baseColor.dark(100+intensity*2), 80); - const QColor colorBottom2 = alphaBlendColors(baseColor, + const TQColor colorBottom2 = alphaBlendColors(baseColor, sunken?baseColor.light(100+intensity):baseColor.dark(100+intensity), 80); // sides @@ -550,7 +550,7 @@ void PlastikStyle::renderSurface(QPainter *p, int height = r.height(); if (roundUpperLeft || !drawTop) height--; if (roundBottomLeft || !drawBottom) height--; - renderGradient(p, QRect(r.left(), (roundUpperLeft&&drawTop)?r.top()+1:r.top(), 1, height), + renderGradient(p, TQRect(r.left(), (roundUpperLeft&&drawTop)?r.top()+1:r.top(), 1, height), colorTop1, baseColor); } else { p->setPen(colorTop1 ); @@ -565,7 +565,7 @@ void PlastikStyle::renderSurface(QPainter *p, // and we don't whant to draw the Top, we have a unpainted area if (roundUpperRight || !drawTop) height--; if (roundBottomRight || !drawBottom) height--; - renderGradient(p, QRect(r.right(), (roundUpperRight&&drawTop)?r.top()+1:r.top(), 1, height), + renderGradient(p, TQRect(r.right(), (roundUpperRight&&drawTop)?r.top()+1:r.top(), 1, height), baseColor, colorBottom1); } else { p->setPen(colorBottom1 ); @@ -582,7 +582,7 @@ void PlastikStyle::renderSurface(QPainter *p, int width = r.width(); if (roundUpperLeft || !drawLeft) width--; if (roundUpperRight || !drawRight) width--; - renderGradient(p, QRect((roundUpperLeft&&drawLeft)?r.left()+1:r.left(), r.top(), width, 1), + renderGradient(p, TQRect((roundUpperLeft&&drawLeft)?r.left()+1:r.left(), r.top(), width, 1), colorTop1, colorTop2); } } @@ -595,7 +595,7 @@ void PlastikStyle::renderSurface(QPainter *p, int width = r.width(); if (roundBottomLeft || !drawLeft) width--; if (roundBottomRight || !drawRight) width--; - renderGradient(p, QRect((roundBottomLeft&&drawLeft)?r.left()+1:r.left(), r.bottom(), width, 1), + renderGradient(p, TQRect((roundBottomLeft&&drawLeft)?r.left()+1:r.left(), r.bottom(), width, 1), colorBottom2, colorBottom1); } } @@ -607,7 +607,7 @@ void PlastikStyle::renderSurface(QPainter *p, if (drawRight) width--; if (drawTop) height--; if (drawBottom) height--; - renderGradient(p, QRect(drawLeft?r.left()+1:r.left(), drawTop?r.top()+1:r.top(), width, height), + renderGradient(p, TQRect(drawLeft?r.left()+1:r.left(), drawTop?r.top()+1:r.top(), width, height), colorTop2, colorBottom2, horizontal); @@ -646,11 +646,11 @@ void PlastikStyle::renderSurface(QPainter *p, } } -void PlastikStyle::renderPixel(QPainter *p, - const QPoint &pos, +void PlastikStyle::renderPixel(TQPainter *p, + const TQPoint &pos, const int alpha, - const QColor &color, - const QColor &background, + const TQColor &color, + const TQColor &background, bool fullAlphaBlend) const { if(fullAlphaBlend) @@ -673,10 +673,10 @@ void PlastikStyle::renderPixel(QPainter *p, } - QImage aImg(1,1,32); // 1x1 + TQImage aImg(1,1,32); // 1x1 aImg.setAlphaBuffer(true); aImg.setPixel(0,0,qRgba(qRed(rgb),qGreen(rgb),qBlue(rgb),alpha)); - QPixmap *result = new QPixmap(aImg); + TQPixmap *result = new TQPixmap(aImg); p->drawPixmap(pos, *result); @@ -696,7 +696,7 @@ void PlastikStyle::renderPixel(QPainter *p, if(a<0) a = 0; int a_inv = 255 - a; - QColor res = QColor( qRgb(qRed(rgb_b)*a_inv/255 + qRed(rgb_a)*a/255, + TQColor res = TQColor( qRgb(qRed(rgb_b)*a_inv/255 + qRed(rgb_a)*a/255, qGreen(rgb_b)*a_inv/255 + qGreen(rgb_a)*a/255, qBlue(rgb_b)*a_inv/255 + qBlue(rgb_a)*a/255) ); p->setPen(res); @@ -704,9 +704,9 @@ void PlastikStyle::renderPixel(QPainter *p, } } -void PlastikStyle::renderButton(QPainter *p, - const QRect &r, - const QColorGroup &g, +void PlastikStyle::renderButton(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool sunken, bool mouseOver, bool horizontal, @@ -716,7 +716,7 @@ void PlastikStyle::renderButton(QPainter *p, // small fix for the kicker buttons... if(kickerMode) enabled = true; - const QPen oldPen( p->pen() ); + const TQPen oldPen( p->pen() ); uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom; if(!enabled) contourFlags|=Is_Disabled; @@ -747,12 +747,12 @@ void PlastikStyle::renderButton(QPainter *p, renderContour(p, r, g.background(), getColor(g,ButtonContour), contourFlags); - renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), + renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), g.background(), g.button(), getColor(g,MouseOverHighlight), _contrast, surfaceFlags); } else { renderContour(p, r, g.background(), g.button().dark(105+_contrast*3), contourFlags); - renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), + renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), g.background(), g.button(), getColor(g,MouseOverHighlight), _contrast/2, surfaceFlags); flatMode = false; @@ -761,14 +761,14 @@ void PlastikStyle::renderButton(QPainter *p, p->setPen(oldPen); } -void PlastikStyle::renderDot(QPainter *p, - const QPoint &point, - const QColor &baseColor, +void PlastikStyle::renderDot(TQPainter *p, + const TQPoint &point, + const TQColor &baseColor, const bool thick, const bool sunken) const { - const QColor topColor = alphaBlendColors(baseColor, sunken?baseColor.dark(130):baseColor.light(150), 70); - const QColor bottomColor = alphaBlendColors(baseColor, sunken?baseColor.light(150):baseColor.dark(130), 70); + const TQColor topColor = alphaBlendColors(baseColor, sunken?baseColor.dark(130):baseColor.light(150), 70); + const TQColor bottomColor = alphaBlendColors(baseColor, sunken?baseColor.light(150):baseColor.dark(130), 70); p->setPen(topColor ); p->drawLine(point.x(), point.y(), point.x()+1, point.y()); p->drawPoint(point.x(), point.y()+1); @@ -781,10 +781,10 @@ void PlastikStyle::renderDot(QPainter *p, } } -void PlastikStyle::renderGradient(QPainter *painter, - const QRect &rect, - const QColor &c1, - const QColor &c2, +void PlastikStyle::renderGradient(TQPainter *painter, + const TQRect &rect, + const TQColor &c1, + const TQColor &c2, bool horizontal) const { if((rect.width() <= 0)||(rect.height() <= 0)) @@ -812,9 +812,9 @@ void PlastikStyle::renderGradient(QPainter *painter, } // there wasn't anything matching in the cache, create the pixmap now... - QPixmap *result = new QPixmap(horizontal ? 10 : rect.width(), + TQPixmap *result = new TQPixmap(horizontal ? 10 : rect.width(), horizontal ? rect.height() : 10); - QPainter p(result); + TQPainter p(result); int r_w = result->rect().width(); int r_h = result->rect().height(); @@ -846,7 +846,7 @@ void PlastikStyle::renderGradient(QPainter *painter, gl += gdelta; bl += bdelta; - p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.setPen(TQColor(rl>>16, gl>>16, bl>>16)); p.drawLine(r_x, r_y+y, r_x2, r_y+y); } } else { @@ -855,7 +855,7 @@ void PlastikStyle::renderGradient(QPainter *painter, gl += gdelta; bl += bdelta; - p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.setPen(TQColor(rl>>16, gl>>16, bl>>16)); p.drawLine(r_x+x, r_y, r_x+x, r_y2); } } @@ -874,9 +874,9 @@ void PlastikStyle::renderGradient(QPainter *painter, delete result; } -void PlastikStyle::renderPanel(QPainter *p, - const QRect &r, - const QColorGroup &g, +void PlastikStyle::renderPanel(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, const bool pseudo3d, const bool sunken) const { @@ -885,21 +885,21 @@ void PlastikStyle::renderPanel(QPainter *p, r.coords(&x, &y, &x2, &y2); if (kickerMode && - p->device() && p->device()->devType() == QInternal::Widget && - QCString(static_cast<QWidget*>(p->device())->className()) == "FittsLawFrame") { + p->device() && p->device()->devType() == TQInternal::Widget && + TQCString(static_cast<TQWidget*>(p->device())->className()) == "FittsLawFrame") { // Stolen wholesale from Keramik. I don't like it, but oh well. if (sunken) { const QCOORD corners[] = { x2, y, x2, y2, x, y2, x, y }; p->setPen(g.background().dark()); - p->drawConvexPolygon(QPointArray(4, corners)); + p->drawConvexPolygon(TQPointArray(4, corners)); p->setPen(g.background().light()); - p->drawPolyline(QPointArray(4, corners), 0, 3); + p->drawPolyline(TQPointArray(4, corners), 0, 3); } else { const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 }; p->setPen(g.background().dark()); - p->drawPolygon(QPointArray(4, corners)); + p->drawPolygon(TQPointArray(4, corners)); p->setPen(g.background().light()); - p->drawPolyline(QPointArray(4, corners), 0, 3); + p->drawPolyline(TQPointArray(4, corners), 0, 3); } } else { renderContour(p, r, g.background(), getColor(g, PanelContour) ); @@ -923,15 +923,15 @@ void PlastikStyle::renderPanel(QPainter *p, } } -void PlastikStyle::renderMenuBlendPixmap( KPixmap &pix, const QColorGroup &cg, - const QPopupMenu* /* popup */ ) const +void PlastikStyle::renderMenuBlendPixmap( KPixmap &pix, const TQColorGroup &cg, + const TQPopupMenu* /* popup */ ) const { pix.fill( cg.background().light(105) ); } -void PlastikStyle::renderTab(QPainter *p, - const QRect &r, - const QColorGroup &g, +void PlastikStyle::renderTab(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool mouseOver, const bool selected, const bool bottom, @@ -939,7 +939,7 @@ void PlastikStyle::renderTab(QPainter *p, const bool triangular, const bool cornerWidget) const { - const bool reverseLayout = QApplication::reverseLayout(); + const bool reverseLayout = TQApplication::reverseLayout(); const bool isFirst = (pos == First) || (pos == Single); const bool isLast = (pos == Last); @@ -949,27 +949,27 @@ void PlastikStyle::renderTab(QPainter *p, // is selected // the top part of the tab which is nearly the same for all positions - QRect Rc; // contour + TQRect Rc; // contour if (!bottom) { if (isFirst && !cornerWidget && !reverseLayout) { - Rc = QRect(r.x(), r.y(), r.width()-1, r.height()-3); + Rc = TQRect(r.x(), r.y(), r.width()-1, r.height()-3); } else if (isFirst && !cornerWidget && reverseLayout) { - Rc = QRect(r.x()+1, r.y(), r.width()-1, r.height()-3); + Rc = TQRect(r.x()+1, r.y(), r.width()-1, r.height()-3); } else { - Rc = QRect(r.x()+1, r.y(), r.width()-2, r.height()-3); + Rc = TQRect(r.x()+1, r.y(), r.width()-2, r.height()-3); } } else { if (isFirst && !cornerWidget && !reverseLayout) { - Rc = QRect(r.x(), r.y()+3, r.width()-1, r.height()-3); + Rc = TQRect(r.x(), r.y()+3, r.width()-1, r.height()-3); } else if (isFirst && !cornerWidget && reverseLayout) { - Rc = QRect(r.x()+1, r.y()+3, r.width()-1, r.height()-3); + Rc = TQRect(r.x()+1, r.y()+3, r.width()-1, r.height()-3); } else { - Rc = QRect(r.x()+1, r.y()+3, r.width()-2, r.height()-3); + Rc = TQRect(r.x()+1, r.y()+3, r.width()-2, r.height()-3); } } - const QRect Rs(Rc.x()+1, bottom?Rc.y():Rc.y()+1, Rc.width()-2, Rc.height()-1); // the resulting surface + const TQRect Rs(Rc.x()+1, bottom?Rc.y():Rc.y()+1, Rc.width()-2, Rc.height()-1); // the resulting surface // the area where the fake border shoudl appear - const QRect Rb(r.x(), bottom?r.top():Rc.bottom()+1, r.width(), r.height()-Rc.height() ); + const TQRect Rb(r.x(), bottom?r.top():Rc.bottom()+1, r.width(), r.height()-Rc.height() ); uint contourFlags = Draw_Left|Draw_Right; if(!bottom) { @@ -985,16 +985,16 @@ void PlastikStyle::renderTab(QPainter *p, if(!bottom) { p->setPen(getColor(g,PanelLight) ); p->drawLine(Rs.x()+1, Rs.y(), Rs.right()-1, Rs.y() ); - renderGradient(p, QRect(Rs.x(), Rs.y()+1, 1, Rs.height()-1), + renderGradient(p, TQRect(Rs.x(), Rs.y()+1, 1, Rs.height()-1), getColor(g,PanelLight), getColor(g,PanelLight2)); - renderGradient(p, QRect(Rs.right(), Rs.y()+1, 1, Rs.height()-1), + renderGradient(p, TQRect(Rs.right(), Rs.y()+1, 1, Rs.height()-1), getColor(g,PanelDark), getColor(g,PanelDark2)); } else { p->setPen(alphaBlendColors(g.background(), g.background().dark(160), 100) ); p->drawLine(Rs.x()+1, Rs.bottom(), Rs.right()-1, Rs.bottom() ); - renderGradient(p, QRect(Rs.x(), Rs.y(), 1, Rs.height()-1), + renderGradient(p, TQRect(Rs.x(), Rs.y(), 1, Rs.height()-1), getColor(g,PanelLight), getColor(g,PanelLight2)); - renderGradient(p, QRect(Rs.right(), Rs.y(), 1, Rs.height()-1), + renderGradient(p, TQRect(Rs.right(), Rs.y(), 1, Rs.height()-1), getColor(g,PanelDark), getColor(g,PanelDark2)); } @@ -1004,13 +1004,13 @@ void PlastikStyle::renderTab(QPainter *p, p->setPen(alphaBlendColors(g.background(), getColor(g, ButtonContour), 50) ); if( (!isFirst&&!reverseLayout) || (!isLast&&reverseLayout) ) { p->drawPoint(r.left(), bottom?(triangular?r.bottom()-2:r.bottom()-3):(triangular?r.top()+2:r.top()+3) ); - renderSurface(p, QRect(r.left(), bottom?r.top()+3:(triangular?r.top()+3:r.top()+4), 1, (triangular?r.height()-6:r.height()-7) ), + renderSurface(p, TQRect(r.left(), bottom?r.top()+3:(triangular?r.top()+3:r.top()+4), 1, (triangular?r.height()-6:r.height()-7) ), g.background(), g.button(), getColor(g,MouseOverHighlight), _contrast, Draw_Top|Draw_Bottom|Is_Horizontal); } if( (!isLast&&!reverseLayout) || (!isFirst&&reverseLayout) ) { p->drawPoint(r.right(), bottom?(triangular?r.bottom()-2:r.bottom()-3):(triangular?r.top()+2:r.top()+3) ); - renderSurface(p, QRect(r.right(), bottom?r.top()+3:(triangular?r.top()+3:r.top()+4), 1, (triangular?r.height()-6:r.height()-7) ), + renderSurface(p, TQRect(r.right(), bottom?r.top()+3:(triangular?r.top()+3:r.top()+4), 1, (triangular?r.height()-6:r.height()-7) ), g.background(), g.button(), getColor(g,MouseOverHighlight), _contrast, Draw_Top|Draw_Bottom|Is_Horizontal); } @@ -1068,20 +1068,20 @@ void PlastikStyle::renderTab(QPainter *p, // inactive tabs // the top part of the tab which is nearly the same for all positions - QRect Rc; // contour + TQRect Rc; // contour if (isFirst&&reverseLayout ) { - Rc = QRect(r.x()+1, (bottom?r.y()+2:(triangular?r.y()+2:r.y()+3)), r.width()-2, (triangular?r.height()-4:r.height()-5) ); + Rc = TQRect(r.x()+1, (bottom?r.y()+2:(triangular?r.y()+2:r.y()+3)), r.width()-2, (triangular?r.height()-4:r.height()-5) ); } else { - Rc = QRect(r.x()+1, (bottom?r.y()+2:(triangular?r.y()+2:r.y()+3)), r.width()-1, (triangular?r.height()-4:r.height()-5) ); + Rc = TQRect(r.x()+1, (bottom?r.y()+2:(triangular?r.y()+2:r.y()+3)), r.width()-1, (triangular?r.height()-4:r.height()-5) ); } - QRect Rs; // the resulting surface + TQRect Rs; // the resulting surface if ( (isFirst&&!reverseLayout) || (isLast&&reverseLayout) ) { - Rs = QRect(Rc.x()+1, bottom?Rc.y():Rc.y()+1, Rc.width()-2, Rc.height()-1); + Rs = TQRect(Rc.x()+1, bottom?Rc.y():Rc.y()+1, Rc.width()-2, Rc.height()-1); } else { - Rs = QRect(Rc.x(), bottom?Rc.y():Rc.y()+1, Rc.width()-1, Rc.height()-1); + Rs = TQRect(Rc.x(), bottom?Rc.y():Rc.y()+1, Rc.width()-1, Rc.height()-1); } // the area where the fake border shoudl appear - const QRect Rb(r.x(), bottom?r.y():Rc.bottom()+1, r.width(), 2 ); + const TQRect Rb(r.x(), bottom?r.y():Rc.bottom()+1, r.width(), 2 ); uint contourFlags; if(!bottom) { @@ -1191,12 +1191,12 @@ void PlastikStyle::renderTab(QPainter *p, } void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, - QPainter *p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt) const + const TQStyleOption& opt) const { // some "global" vars... const bool enabled = (flags & Style_Enabled); @@ -1205,17 +1205,17 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, // ------ switch( kpe ) { case KPE_SliderGroove: { - const QSlider* slider = (const QSlider*)widget; + const TQSlider* slider = (const TQSlider*)widget; bool horizontal = slider->orientation() == Horizontal; if (horizontal) { int center = r.y()+r.height()/2; - renderContour(p, QRect(r.left(), center-2, r.width(), 4), + renderContour(p, TQRect(r.left(), center-2, r.width(), 4), cg.background(), cg.background().dark(enabled?150:130), Draw_Left|Draw_Right|Draw_Top|Draw_Bottom); } else { int center = r.x()+r.width()/2; - renderContour(p, QRect(center-2, r.top(), 4, r.height()), + renderContour(p, TQRect(center-2, r.top(), 4, r.height()), cg.background(), cg.background().dark(enabled?150:130), Draw_Left|Draw_Right|Draw_Top|Draw_Bottom); } @@ -1223,19 +1223,19 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, } case KPE_SliderHandle: { - const QSlider* slider = (const QSlider*)widget; + const TQSlider* slider = (const TQSlider*)widget; bool horizontal = slider->orientation() == Horizontal; const bool pressed = (flags&Style_Active); const WidgetState s = enabled?(pressed?IsPressed:IsEnabled):IsDisabled; - const QColor contour = getColor(cg,DragButtonContour,s), + const TQColor contour = getColor(cg,DragButtonContour,s), surface = getColor(cg,DragButtonSurface,s); int xcenter = (r.left()+r.right()) / 2; int ycenter = (r.top()+r.bottom()) / 2; if (horizontal) { - renderContour(p, QRect(xcenter-5, ycenter-6, 11, 10), + renderContour(p, TQRect(xcenter-5, ycenter-6, 11, 10), cg.background(), contour, Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight); @@ -1266,27 +1266,27 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, p->drawPoint(xcenter+5-4, ycenter+8); - QRegion mask(xcenter-4, ycenter-5, 9, 13); - mask -= QRegion(xcenter-4, ycenter+4, 1, 4); - mask -= QRegion(xcenter-3, ycenter+5, 1, 3); - mask -= QRegion(xcenter-2, ycenter+6, 1, 2); - mask -= QRegion(xcenter-1, ycenter+7, 1, 1); - mask -= QRegion(xcenter+1, ycenter+7, 1, 1); - mask -= QRegion(xcenter+2, ycenter+6, 1, 2); - mask -= QRegion(xcenter+3, ycenter+5, 1, 3); - mask -= QRegion(xcenter+4, ycenter+4, 1, 4); + TQRegion mask(xcenter-4, ycenter-5, 9, 13); + mask -= TQRegion(xcenter-4, ycenter+4, 1, 4); + mask -= TQRegion(xcenter-3, ycenter+5, 1, 3); + mask -= TQRegion(xcenter-2, ycenter+6, 1, 2); + mask -= TQRegion(xcenter-1, ycenter+7, 1, 1); + mask -= TQRegion(xcenter+1, ycenter+7, 1, 1); + mask -= TQRegion(xcenter+2, ycenter+6, 1, 2); + mask -= TQRegion(xcenter+3, ycenter+5, 1, 3); + mask -= TQRegion(xcenter+4, ycenter+4, 1, 4); p->setClipRegion(mask); uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight|Is_Horizontal; if(!enabled) surfaceFlags |= Is_Disabled; - renderSurface(p, QRect(xcenter-4, ycenter-5, 9, 13), + renderSurface(p, TQRect(xcenter-4, ycenter-5, 9, 13), cg.background(), surface, getColor(cg,MouseOverHighlight), _contrast+3, surfaceFlags); - renderDot(p, QPoint(xcenter-3, ycenter-3), surface, false, true ); - renderDot(p, QPoint(xcenter+2, ycenter-3), surface, false, true ); + renderDot(p, TQPoint(xcenter-3, ycenter-3), surface, false, true ); + renderDot(p, TQPoint(xcenter+2, ycenter-3), surface, false, true ); p->setClipping(false); } else { - renderContour(p, QRect(xcenter-6, ycenter-5, 10, 11), + renderContour(p, TQRect(xcenter-6, ycenter-5, 10, 11), cg.background(), contour, Draw_Left|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_BottomLeft); @@ -1316,25 +1316,25 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, p->drawPoint(xcenter+8, ycenter-5+4); p->drawPoint(xcenter+8, ycenter+5-4); - QRegion mask(xcenter-5, ycenter-4, 13, 9); - mask -= QRegion(xcenter+4, ycenter-4, 4, 1); - mask -= QRegion(xcenter+5, ycenter-3, 3, 1); - mask -= QRegion(xcenter+6, ycenter-2, 2, 1); - mask -= QRegion(xcenter+7, ycenter-1, 1, 1); - mask -= QRegion(xcenter+7, ycenter+1, 1, 1); - mask -= QRegion(xcenter+6, ycenter+2, 2, 1); - mask -= QRegion(xcenter+5, ycenter+3, 3, 1); - mask -= QRegion(xcenter+4, ycenter+4, 4, 1); + TQRegion mask(xcenter-5, ycenter-4, 13, 9); + mask -= TQRegion(xcenter+4, ycenter-4, 4, 1); + mask -= TQRegion(xcenter+5, ycenter-3, 3, 1); + mask -= TQRegion(xcenter+6, ycenter-2, 2, 1); + mask -= TQRegion(xcenter+7, ycenter-1, 1, 1); + mask -= TQRegion(xcenter+7, ycenter+1, 1, 1); + mask -= TQRegion(xcenter+6, ycenter+2, 2, 1); + mask -= TQRegion(xcenter+5, ycenter+3, 3, 1); + mask -= TQRegion(xcenter+4, ycenter+4, 4, 1); p->setClipRegion(mask); uint surfaceFlags = Draw_Left|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_BottomLeft| Round_UpperRight|Is_Horizontal; if(!enabled) surfaceFlags |= Is_Disabled; - renderSurface(p, QRect(xcenter-5, ycenter-4, 13, 9), + renderSurface(p, TQRect(xcenter-5, ycenter-4, 13, 9), cg.background(), surface, getColor(cg,MouseOverHighlight), _contrast+3, surfaceFlags); - renderDot(p, QPoint(xcenter-3, ycenter-3), surface, false, true ); - renderDot(p, QPoint(xcenter-3, ycenter+2), surface, false, true ); + renderDot(p, TQPoint(xcenter-3, ycenter-3), surface, false, true ); + renderDot(p, TQPoint(xcenter-3, ycenter+2), surface, false, true ); p->setClipping(false); } @@ -1357,9 +1357,9 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, p->drawLine( centerx, centery - radius, centerx, centery + radius ); } else if(_drawTriangularExpander) { if( flags & Style_On ) - drawPrimitive(PE_ArrowRight, p, QRect(r.x()+1,r.y()+1,r.width(),r.height()), cg,ButtonContour, flags); + drawPrimitive(PE_ArrowRight, p, TQRect(r.x()+1,r.y()+1,r.width(),r.height()), cg,ButtonContour, flags); if( flags & Style_Off ) - drawPrimitive(PE_ArrowDown, p, QRect(r.x()+1,r.y()+1,r.width(),r.height()), cg,ButtonContour, flags); + drawPrimitive(PE_ArrowDown, p, TQRect(r.x()+1,r.y()+1,r.width(),r.height()), cg,ButtonContour, flags); } break; @@ -1374,10 +1374,10 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, { // make 128*1 and 1*128 bitmaps that can be used for // drawing the right sort of lines. - verticalLine = new QBitmap( 1, 129, true ); - horizontalLine = new QBitmap( 128, 1, true ); - QPointArray a( 64 ); - QPainter p2; + verticalLine = new TQBitmap( 1, 129, true ); + horizontalLine = new TQBitmap( 128, 1, true ); + TQPointArray a( 64 ); + TQPainter p2; p2.begin( verticalLine ); int i; @@ -1386,7 +1386,7 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, p2.setPen( color1 ); p2.drawPoints( a ); p2.end(); - QApplication::flushX(); + TQApplication::flushX(); verticalLine->setMask( *verticalLine ); p2.begin( horizontalLine ); @@ -1395,7 +1395,7 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, p2.setPen( color1 ); p2.drawPoints( a ); p2.end(); - QApplication::flushX(); + TQApplication::flushX(); horizontalLine->setMask( *horizontalLine ); } @@ -1444,11 +1444,11 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe, void PlastikStyle::drawPrimitive(PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { bool down = flags & Style_Down; bool on = flags & Style_On; @@ -1482,7 +1482,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, if(!kickerMode) { // detect if this is the left most header item bool isFirst = false; - QHeader *header = dynamic_cast<QHeader*>(p->device() ); + TQHeader *header = dynamic_cast<TQHeader*>(p->device() ); if (header) { isFirst = header->mapToIndex(header->sectionAt(r.x() ) ) == 0; } @@ -1504,7 +1504,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, } } } - renderSurface(p, QRect(isFirst?r.left()+1:r.left(), r.top()+1, isFirst?r.width()-2:r.width()-1, r.height()-2), + renderSurface(p, TQRect(isFirst?r.left()+1:r.left(), r.top()+1, isFirst?r.width()-2:r.width()-1, r.height()-2), cg.background(), cg.button(), getColor(cg,MouseOverHighlight), _contrast, surfaceFlags); @@ -1537,7 +1537,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, // make the length even so that we get a nice symmetric plus... if(l%2 != 0) --l; - QPoint c = r.center(); + TQPoint c = r.center(); p->drawLine( c.x()-l/2, c.y(), c.x()+l/2, c.y() ); if ( pe == PE_SpinWidgetPlus ) { @@ -1548,7 +1548,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, case PE_ScrollBarSlider: { const WidgetState s = enabled?(down?IsPressed:IsEnabled):IsDisabled; - const QColor surface = getColor(cg, DragButtonSurface, s); + const TQColor surface = getColor(cg, DragButtonSurface, s); uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom; if(!enabled) contourFlags|=Is_Disabled; @@ -1559,7 +1559,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, if(horiz) surfaceFlags|=Is_Horizontal; if(!enabled) surfaceFlags|=Is_Disabled; if(r.height() >= 4) - renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), + renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), cg.background(), surface, cg.background(), _contrast+3, surfaceFlags); @@ -1577,7 +1577,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, else { for(int k = 3; k <= 13; k+=4) { - renderDot(p, QPoint(k, yPos), surface, false, true ); + renderDot(p, TQPoint(k, yPos), surface, false, true ); } } } @@ -1589,7 +1589,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, else { for(int k = 3; k <= 13; k+=4) { - renderDot(p, QPoint(xPos, k), surface, false, true ); + renderDot(p, TQPoint(xPos, k), surface, false, true ); } } } @@ -1601,17 +1601,17 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, case PE_ScrollBarAddPage: case PE_ScrollBarSubPage: { // draw double buffered to avoid flicker... - QPixmap buffer; + TQPixmap buffer; if(flags & Style_Horizontal) { buffer.resize(2, r.height() ); } else { buffer.resize(r.width(), 2 ); } - QRect br(buffer.rect() ); - QPainter bp(&buffer); + TQRect br(buffer.rect() ); + TQPainter bp(&buffer); if (on || down) { - bp.fillRect(br, QBrush(cg.mid().dark())); + bp.fillRect(br, TQBrush(cg.mid().dark())); } else { if(flags & Style_Horizontal) { bp.setPen(cg.background().dark(106)); @@ -1628,11 +1628,11 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, } } - bp.fillRect(br, QBrush(cg.background().light(), Dense4Pattern)); + bp.fillRect(br, TQBrush(cg.background().light(), Dense4Pattern)); bp.end(); - p->drawTiledPixmap(r, buffer, QPoint(0, r.top()%2) ); + p->drawTiledPixmap(r, buffer, TQPoint(0, r.top()%2) ); break; } @@ -1655,7 +1655,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, } renderContour(p, r, cg.background(), getColor(cg, ButtonContour), contourFlags); - renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), + renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), cg.background(), cg.button(), getColor(cg,MouseOverHighlight), _contrast+3, surfaceFlags); @@ -1681,7 +1681,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, } renderContour(p, r, cg.background(), getColor(cg, ButtonContour), contourFlags); - renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), + renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2), cg.background(), cg.button(), getColor(cg,MouseOverHighlight), _contrast+3, surfaceFlags); @@ -1693,7 +1693,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, // CHECKBOXES // ---------- case PE_Indicator: { - QColor contentColor = enabled?cg.base():cg.background(); + TQColor contentColor = enabled?cg.base():cg.background(); uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom; if(!enabled) { @@ -1712,7 +1712,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, surfaceFlags |= Highlight_Left|Highlight_Right| Highlight_Top|Highlight_Bottom; } - renderSurface(p, QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2), + renderSurface(p, TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2), cg.background(), contentColor, getColor(cg,MouseOverHighlight), enabled?_contrast+3:(_contrast/2), surfaceFlags); drawPrimitive(PE_CheckMark, p, r, cg, flags); @@ -1728,11 +1728,11 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, // RADIOBUTTONS // ------------ case PE_ExclusiveIndicator: { - const QColor contourColor = getColor(cg, ButtonContour, enabled); - QColor contentColor = enabled?cg.base():cg.background(); + const TQColor contourColor = getColor(cg, ButtonContour, enabled); + TQColor contentColor = enabled?cg.base():cg.background(); - QBitmap bmp; - bmp = QBitmap(13, 13, radiobutton_mask_bits, true); + TQBitmap bmp; + bmp = TQBitmap(13, 13, radiobutton_mask_bits, true); // first the surface... uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Is_Horizontal; if(!enabled) { @@ -1747,28 +1747,28 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, // ...then contour, anti-alias, mouseOver... // contour - bmp = QBitmap(13, 13, radiobutton_contour_bits, true); + bmp = TQBitmap(13, 13, radiobutton_contour_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(cg.background(), contourColor, 50) ); p->drawPixmap(x, y, bmp); // anti-alias outside - bmp = QBitmap(13, 13, radiobutton_aa_outside_bits, true); + bmp = TQBitmap(13, 13, radiobutton_aa_outside_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(cg.background(), contourColor, 150) ); p->drawPixmap(x, y, bmp); // highlighting... if(mouseOver) { - bmp = QBitmap(13, 13, radiobutton_highlight1_bits, true); + bmp = TQBitmap(13, 13, radiobutton_highlight1_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, getColor(cg,MouseOverHighlight), 80) ); p->drawPixmap(x, y, bmp); - bmp = QBitmap(13, 13, radiobutton_highlight2_bits, true); + bmp = TQBitmap(13, 13, radiobutton_highlight2_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, getColor(cg,MouseOverHighlight), 150) ); p->drawPixmap(x, y, bmp); } // anti-alias inside, "above" the higlighting! - bmp = QBitmap(13, 13, radiobutton_aa_inside_bits, true); + bmp = TQBitmap(13, 13, radiobutton_aa_inside_bits, true); bmp.setMask(bmp); if(mouseOver) { p->setPen(alphaBlendColors(getColor(cg,MouseOverHighlight), contourColor, 180) ); @@ -1778,22 +1778,22 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, p->drawPixmap(x, y, bmp); - QColor checkmarkColor = enabled?getColor(cg,CheckMark):cg.background(); + TQColor checkmarkColor = enabled?getColor(cg,CheckMark):cg.background(); if(flags & Style_Down) { checkmarkColor = alphaBlendColors(contentColor, checkmarkColor, 150); } // draw the radio mark if (flags & Style_On || flags & Style_Down) { - bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_dark_bits, true); + bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_dark_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 50) ); p->drawPixmap(x+2, y+2, bmp); - bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_light_bits, true); + bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_light_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(125), 50) ); p->drawPixmap(x+2, y+2, bmp); - bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_aa_bits, true); + bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_aa_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 150) ); p->drawPixmap(x+2, y+2, bmp); @@ -1805,8 +1805,8 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, case PE_ExclusiveIndicatorMask: { p->fillRect(r, color0); - QBitmap bmp; - bmp = QBitmap(13, 13, radiobutton_mask_bits, true); + TQBitmap bmp; + bmp = TQBitmap(13, 13, radiobutton_mask_bits, true); bmp.setMask(bmp); p->setPen(color1); p->drawPixmap(x, y, bmp); @@ -1818,20 +1818,20 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, // -------------- case PE_Splitter: { // highlight on mouse over - QColor color = (hoverWidget == p->device())?cg.background().light(100+_contrast):cg.background(); + TQColor color = (hoverWidget == p->device())?cg.background().light(100+_contrast):cg.background(); p->fillRect(r, color); if (w > h) { if (h > 4) { int ycenter = r.height()/2; for(int k = 2*r.width()/10; k < 8*r.width()/10; k+=5) { - renderDot(p, QPoint(k, ycenter-1), color, false, true); + renderDot(p, TQPoint(k, ycenter-1), color, false, true); } } } else { if (w > 4) { int xcenter = r.width()/2; for(int k = 2*r.height()/10; k < 8*r.height()/10; k+=5) { - renderDot(p, QPoint(xcenter-1, k), color, false, true); + renderDot(p, TQPoint(xcenter-1, k), color, false, true); } } } @@ -1861,9 +1861,9 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, bool isEnabled = true; // panel is highlighted by default if it has focus, but if we have access to the // widget itself we can try to avoid highlighting in case it's readOnly or disabled. - if (p->device() && dynamic_cast<QLineEdit*>(p->device())) + if (p->device() && dynamic_cast<TQLineEdit*>(p->device())) { - QLineEdit* lineEdit = dynamic_cast<QLineEdit*>(p->device()); + TQLineEdit* lineEdit = dynamic_cast<TQLineEdit*>(p->device()); isReadOnly = lineEdit->isReadOnly(); isEnabled = lineEdit->isEnabled(); } @@ -1878,9 +1878,9 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, // // In this place there is no reliable way to detect if we are in khtml; the // only thing we know is that khtml buffers its widgets into a pixmap. So - // when the paint device is a QPixmap, chances are high that we are in khtml. + // when the paint device is a TQPixmap, chances are high that we are in khtml. // It's possible that this breaks other things, so let's see how it works... - if (p->device() && dynamic_cast<QPixmap*>(p->device() ) ) { + if (p->device() && dynamic_cast<TQPixmap*>(p->device() ) ) { contourFlags += Draw_AlphaBlend; } @@ -1894,7 +1894,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, renderContour(p, r, cg.background(), getColor(cg, ButtonContour, enabled), contourFlags ); } - const QColor contentColor = enabled?cg.base():cg.background(); + const TQColor contentColor = enabled?cg.base():cg.background(); if (_inputFocusHighlight && hasFocus && !isReadOnly && isEnabled) { p->setPen( getColor(cg,FocusHighlight).dark(130) ); @@ -1941,10 +1941,10 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, case PE_PanelMenuBar: case PE_PanelDockWindow: { // fix for toolbar lag (from Mosfet Liquid) - QWidget* w = dynamic_cast<QWidget*>(p->device()); + TQWidget* w = dynamic_cast<TQWidget*>(p->device()); if(w && w->backgroundMode() == PaletteButton) w->setBackgroundMode(PaletteBackground); - p->fillRect(r, cg.brush(QColorGroup::Background)); + p->fillRect(r, cg.brush(TQColorGroup::Background)); if ( _drawToolBarSeparator ) { if ( r.width() > r.height() ) { @@ -1979,9 +1979,9 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, int center = r.left()+r.width()/2; for(int j = r.top()+2; j <= r.bottom()-3; j+=3) { if(counter%2 == 0) { - renderDot(p, QPoint(center+1, j), cg.background(), true, true); + renderDot(p, TQPoint(center+1, j), cg.background(), true, true); } else { - renderDot(p, QPoint(center-2, j), cg.background(), true, true); + renderDot(p, TQPoint(center-2, j), cg.background(), true, true); } counter++; } @@ -1989,9 +1989,9 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, int center = r.top()+r.height()/2; for(int j = r.left()+2; j <= r.right()-3; j+=3) { if(counter%2 == 0) { - renderDot(p, QPoint(j, center+1), cg.background(), true, true); + renderDot(p, TQPoint(j, center+1), cg.background(), true, true); } else { - renderDot(p, QPoint(j, center-2), cg.background(), true, true); + renderDot(p, TQPoint(j, center-2), cg.background(), true, true); } counter++; } @@ -2024,31 +2024,31 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, } case PE_CheckMark: { - const QColor contentColor = enabled?cg.base():cg.background(); - QColor checkmarkColor = enabled?getColor(cg,CheckMark):cg.background(); + const TQColor contentColor = enabled?cg.base():cg.background(); + TQColor checkmarkColor = enabled?getColor(cg,CheckMark):cg.background(); if(flags & Style_Down) { checkmarkColor = alphaBlendColors(contentColor, checkmarkColor, 150); } int x = r.center().x() - 4, y = r.center().y() - 4; - QBitmap bmp; + TQBitmap bmp; if( flags & Style_On ) { - bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_dark_bits, true); + bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_dark_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 50) ); p->drawPixmap(x, y, bmp); - bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_light_bits, true); + bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_light_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(125), 50) ); p->drawPixmap(x, y, bmp); - bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_aa_bits, true); + bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_aa_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 150) ); p->drawPixmap(x, y, bmp); } else if ( flags & Style_Off ) { // empty } else { // tristate - bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_tristate_bits, true); + bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_tristate_bits, true); bmp.setMask(bmp); p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 50) ); p->drawPixmap(x, y, bmp); @@ -2064,7 +2064,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, case PE_ArrowDown: case PE_ArrowLeft: case PE_ArrowRight: { - QPointArray a; + TQPointArray a; switch (pe) { case PE_SpinWidgetUp: @@ -2094,7 +2094,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, } } - const QWMatrix oldMatrix( p->worldMatrix() ); + const TQWMatrix oldMatrix( p->worldMatrix() ); if (flags & Style_Down) { p->translate(pixelMetric(PM_ButtonShiftHorizontal), @@ -2116,7 +2116,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, a.translate(0, 0); } - if (p->pen() == QPen::NoPen) { + if (p->pen() == TQPen::NoPen) { if (flags & Style_Enabled) { p->setPen(cg.buttonText()); } else { @@ -2139,14 +2139,14 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe, void PlastikStyle::drawControl(ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt) const + const TQStyleOption& opt) const { - const bool reverseLayout = QApplication::reverseLayout(); + const bool reverseLayout = TQApplication::reverseLayout(); const bool enabled = (flags & Style_Enabled); @@ -2155,7 +2155,7 @@ void PlastikStyle::drawControl(ControlElement element, // PROGRESSBAR // ----------- case CE_ProgressBarGroove: { - const QColor content = enabled?cg.base():cg.background(); + const TQColor content = enabled?cg.base():cg.background(); renderContour(p, r, cg.background(), getColor(cg, ButtonContour, enabled) ); p->setPen(content.dark(105) ); p->drawLine(r.left()+2, r.top()+1, r.right()-2, r.top()+1 ); @@ -2167,11 +2167,11 @@ void PlastikStyle::drawControl(ControlElement element, } case CE_ProgressBarContents: { - const QProgressBar *pb = dynamic_cast<const QProgressBar*>(widget); + const TQProgressBar *pb = dynamic_cast<const TQProgressBar*>(widget); int steps = pb->totalSteps(); - const QColor bg = enabled?cg.base():cg.background(); // background - const QColor fg = enabled?cg.highlight():cg.background().dark(110); // foreground + const TQColor bg = enabled?cg.base():cg.background(); // background + const TQColor fg = enabled?cg.highlight():cg.background().dark(110); // foreground if( steps == 0 ) { // Busy indicator static const int barWidth = 10; @@ -2180,12 +2180,12 @@ void PlastikStyle::drawControl(ControlElement element, progress = 0; if( progress > r.width()-barWidth ) progress = (r.width()-barWidth)-(progress-(r.width()-barWidth)); - p->fillRect( QRect( r.x(), r.y(), r.width(), r.height() ), bg ); - renderContour( p, QRect( r.x()+progress, r.y(), barWidth, r.height() ), + p->fillRect( TQRect( r.x(), r.y(), r.width(), r.height() ), bg ); + renderContour( p, TQRect( r.x()+progress, r.y(), barWidth, r.height() ), bg, fg.dark(160), Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Round_UpperRight| Round_BottomRight|Round_UpperLeft|Round_BottomLeft ); - renderSurface(p, QRect( r.x()+progress+1, r.y()+1, barWidth-2, r.height()-2 ), + renderSurface(p, TQRect( r.x()+progress+1, r.y()+1, barWidth-2, r.height()-2 ), bg, fg, cg.highlight(), 2*(_contrast/3), Draw_Right|Draw_Left|Draw_Top|Draw_Bottom| @@ -2200,9 +2200,9 @@ void PlastikStyle::drawControl(ControlElement element, if(w<4) w = 4; int w2 = r.width()-(r.width()-w); - QRect Rempty(reverseLayout?r.left():r.left()+w-1, r.top(), r.width()-w+1, r.height() ); - QRect Rcontour(reverseLayout?r.right()-w2+1:r.left(), r.top(), w2, r.height() ); - QRect Rsurface(Rcontour.left()+1, Rcontour.top()+1, w2-2, Rcontour.height()-2); + TQRect Rempty(reverseLayout?r.left():r.left()+w-1, r.top(), r.width()-w+1, r.height() ); + TQRect Rcontour(reverseLayout?r.right()-w2+1:r.left(), r.top(), w2, r.height() ); + TQRect Rsurface(Rcontour.left()+1, Rcontour.top()+1, w2-2, Rcontour.height()-2); p->fillRect(Rempty, bg); @@ -2211,18 +2211,18 @@ void PlastikStyle::drawControl(ControlElement element, reverseLayout ? Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_BottomLeft : Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Round_UpperRight|Round_BottomRight); - QRegion mask(Rsurface); + TQRegion mask(Rsurface); if(reverseLayout) { - mask -= QRegion(Rsurface.left(), Rsurface.top(), 1, 1); - mask -= QRegion(Rsurface.left(), Rsurface.bottom(), 1, 1); + mask -= TQRegion(Rsurface.left(), Rsurface.top(), 1, 1); + mask -= TQRegion(Rsurface.left(), Rsurface.bottom(), 1, 1); } else { - mask -= QRegion(Rsurface.right(), Rsurface.top(), 1, 1); - mask -= QRegion(Rsurface.right(), Rsurface.bottom(), 1, 1); + mask -= TQRegion(Rsurface.right(), Rsurface.top(), 1, 1); + mask -= TQRegion(Rsurface.right(), Rsurface.bottom(), 1, 1); } p->setClipRegion(mask); int counter = 0; - QPixmap surfaceTile(21, r.height()-2); - QPainter surfacePainter(&surfaceTile); + TQPixmap surfaceTile(21, r.height()-2); + TQPainter surfacePainter(&surfaceTile); // - 21 pixel - // __________ // | ` `| <- 3 @@ -2234,7 +2234,7 @@ void PlastikStyle::drawControl(ControlElement element, const int tileHeight = surfaceTile.height(); // 3 renderSurface(&surfacePainter, - QRect(20, 0, 11, tileHeight), + TQRect(20, 0, 11, tileHeight), fg.light(105), fg, cg.highlight(), 2*(_contrast/3), reverseLayout ? Draw_Right|Draw_Left|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_BottomLeft|Is_Horizontal @@ -2242,7 +2242,7 @@ void PlastikStyle::drawControl(ControlElement element, Round_UpperRight|Round_BottomRight|Is_Horizontal); // 2 renderSurface(&surfacePainter, - QRect(10, 0, 11, tileHeight), + TQRect(10, 0, 11, tileHeight), fg, fg.light(105), cg.highlight(), 2*(_contrast/3), reverseLayout ? Draw_Right|Draw_Left|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_BottomLeft|Is_Horizontal @@ -2250,7 +2250,7 @@ void PlastikStyle::drawControl(ControlElement element, Round_UpperRight|Round_BottomRight|Is_Horizontal); // 1 renderSurface(&surfacePainter, - QRect(0, 0, 11, tileHeight), + TQRect(0, 0, 11, tileHeight), fg.light(105), fg, cg.highlight(), 2*(_contrast/3), reverseLayout ? Draw_Right|Draw_Left|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_BottomLeft|Is_Horizontal @@ -2264,8 +2264,8 @@ void PlastikStyle::drawControl(ControlElement element, staticShift = (reverseLayout ? Rsurface.left() : Rsurface.right()) % 40 - 40; } else { // find the animation Offset for the current Widget - QWidget* nonConstWidget = const_cast<QWidget*>(widget); - QMapConstIterator<QWidget*, int> iter = progAnimWidgets.find(nonConstWidget); + TQWidget* nonConstWidget = const_cast<TQWidget*>(widget); + TQMapConstIterator<TQWidget*, int> iter = progAnimWidgets.find(nonConstWidget); if (iter != progAnimWidgets.end()) animShift = iter.data(); } @@ -2291,16 +2291,16 @@ void PlastikStyle::drawControl(ControlElement element, // TABS // ---- case CE_TabBarTab: { - const QTabBar * tb = (const QTabBar *) widget; + const TQTabBar * tb = (const TQTabBar *) widget; bool cornerWidget = false; - if( ::qt_cast<QTabWidget*>(tb->parent()) ) { - const QTabWidget *tw = (const QTabWidget*)tb->parent(); + if( ::qt_cast<TQTabWidget*>(tb->parent()) ) { + const TQTabWidget *tw = (const TQTabWidget*)tb->parent(); // is there a corner widget in the (top) left edge? - QWidget *cw = tw->cornerWidget(Qt::TopLeft); + TQWidget *cw = tw->cornerWidget(Qt::TopLeft); if(cw) cornerWidget = true; } - QTabBar::Shape tbs = tb->shape(); + TQTabBar::Shape tbs = tb->shape(); bool selected = false; if (flags & Style_Selected) selected = true; TabPosition pos; @@ -2321,18 +2321,18 @@ void PlastikStyle::drawControl(ControlElement element, } switch (tbs) { - case QTabBar::TriangularAbove: + case TQTabBar::TriangularAbove: // renderTriangularTab(p, r, cg, (flags & Style_MouseOver), selected, false, pos); renderTab(p, r, cg, mouseOver, selected, false, pos, true, cornerWidget); break; - case QTabBar::RoundedAbove: + case TQTabBar::RoundedAbove: renderTab(p, r, cg, mouseOver, selected, false, pos, false, cornerWidget); break; - case QTabBar::TriangularBelow: + case TQTabBar::TriangularBelow: // renderTriangularTab(p, r, cg, (flags & Style_MouseOver), selected, true, pos); renderTab(p, r, cg, mouseOver, selected, true, pos, true, cornerWidget); break; - case QTabBar::RoundedBelow: + case TQTabBar::RoundedBelow: renderTab(p, r, cg, mouseOver, selected, true, pos, false, cornerWidget); break; default: @@ -2343,7 +2343,7 @@ void PlastikStyle::drawControl(ControlElement element, } case CE_PushButton: { - QPushButton *button = (QPushButton *)widget; + TQPushButton *button = (TQPushButton *)widget; const bool isDefault = enabled && button->isDefault(); @@ -2353,12 +2353,12 @@ void PlastikStyle::drawControl(ControlElement element, if (widget == hoverWidget) flags |= Style_MouseOver; - QColorGroup g2 = cg; + TQColorGroup g2 = cg; if (isDefault) - g2.setColor(QColorGroup::Background, cg.background().dark(120) ); + g2.setColor(TQColorGroup::Background, cg.background().dark(120) ); drawPrimitive(PE_ButtonBevel, p, - isDefault?QRect(r.x()+1,r.y()+1,r.width()-2,r.height()-2):r, - g2, flags, QStyleOption(button) ); + isDefault?TQRect(r.x()+1,r.y()+1,r.width()-2,r.height()-2):r, + g2, flags, TQStyleOption(button) ); if (isDefault ) { drawPrimitive(PE_ButtonDefault, p, r, cg, flags); @@ -2372,7 +2372,7 @@ void PlastikStyle::drawControl(ControlElement element, int x, y, w, h; r.rect( &x, &y, &w, &h ); - const QPushButton* button = static_cast<const QPushButton *>( widget ); + const TQPushButton* button = static_cast<const TQPushButton *>( widget ); bool active = button->isOn() || button->isDown(); bool cornArrow = false; @@ -2389,14 +2389,14 @@ void PlastikStyle::drawControl(ControlElement element, { int dx = pixelMetric( PM_MenuButtonIndicator, widget ); if ( button->iconSet() && !button->iconSet()->isNull() && - (dx + button->iconSet()->pixmap (QIconSet::Small, QIconSet::Normal, QIconSet::Off ).width()) >= w ) + (dx + button->iconSet()->pixmap (TQIconSet::Small, TQIconSet::Normal, TQIconSet::Off ).width()) >= w ) { cornArrow = true; //To little room. Draw the arrow in the corner, don't adjust the widget } else { p->setPen(cg.buttonText()); - drawPrimitive( PE_ArrowDown, p, visualRect( QRect(x + w - dx - 8, y + 2, dx, h - 4), r ), + drawPrimitive( PE_ArrowDown, p, visualRect( TQRect(x + w - dx - 8, y + 2, dx, h - 4), r ), cg, flags, opt ); w -= dx; } @@ -2405,15 +2405,15 @@ void PlastikStyle::drawControl(ControlElement element, // Draw the icon if there is one if ( button->iconSet() && !button->iconSet()->isNull() ) { - QIconSet::Mode mode = QIconSet::Disabled; - QIconSet::State state = QIconSet::Off; + TQIconSet::Mode mode = TQIconSet::Disabled; + TQIconSet::State state = TQIconSet::Off; if (button->isEnabled()) - mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + mode = button->hasFocus() ? TQIconSet::Active : TQIconSet::Normal; if (button->isToggleButton() && button->isOn()) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap pixmap = button->iconSet()->pixmap( QIconSet::Small, mode, state ); + TQPixmap pixmap = button->iconSet()->pixmap( TQIconSet::Small, mode, state ); if (button->text().isEmpty() && !button->pixmap()) p->drawPixmap( x + w/2 - pixmap.width()/2, y + h / 2 - pixmap.height() / 2, @@ -2422,7 +2422,7 @@ void PlastikStyle::drawControl(ControlElement element, p->drawPixmap( x + 4, y + h / 2 - pixmap.height() / 2, pixmap ); if (cornArrow) //Draw over the icon - drawPrimitive( PE_ArrowDown, p, visualRect( QRect(x + w - 6, x + h - 6, 7, 7), r ), + drawPrimitive( PE_ArrowDown, p, visualRect( TQRect(x + w - 6, x + h - 6, 7, 7), r ), cg, flags, opt ); @@ -2432,7 +2432,7 @@ void PlastikStyle::drawControl(ControlElement element, } // Make the label indicate if the button is a default button or not - drawItem( p, QRect(x, y, w, h), AlignCenter|ShowPrefix, button->colorGroup(), + drawItem( p, TQRect(x, y, w, h), AlignCenter|ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), button->text(), -1, &button->colorGroup().buttonText() ); @@ -2447,7 +2447,7 @@ void PlastikStyle::drawControl(ControlElement element, // MENUBAR ITEM (sunken panel on mouse over) // ----------------------------------------- case CE_MenuBarItem: { - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); bool active = flags & Style_Active; bool focused = flags & Style_HasFocus; bool down = flags & Style_Down; @@ -2472,12 +2472,12 @@ void PlastikStyle::drawControl(ControlElement element, // POPUPMENU ITEM (highlighted on mouseover) // ------------------------------------------ case CE_PopupMenuItem: { - const QPopupMenu *popupmenu = static_cast< const QPopupMenu * >( widget ); - QMenuItem *mi = opt.menuItem(); + const TQPopupMenu *popupmenu = static_cast< const TQPopupMenu * >( widget ); + TQMenuItem *mi = opt.menuItem(); if ( !mi ) { - // Don't leave blank holes if we set NoBackground for the QPopupMenu. + // Don't leave blank holes if we set NoBackground for the TQPopupMenu. // This only happens when the popupMenu spans more than one column. if (! ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) ) p->fillRect( r, cg.background().light( 105 ) ); @@ -2490,7 +2490,7 @@ void PlastikStyle::drawControl(ControlElement element, bool checkable = popupmenu->isCheckable(); bool active = flags & Style_Active; bool etchtext = styleHint( SH_EtchDisabledText ); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); if ( checkable ) checkcol = QMAX( checkcol, 20 ); @@ -2524,26 +2524,26 @@ void PlastikStyle::drawControl(ControlElement element, break; } - QRect cr = visualRect( QRect( r.x() + 2, r.y() + 2, checkcol - 1, r.height() - 4 ), r ); + TQRect cr = visualRect( TQRect( r.x() + 2, r.y() + 2, checkcol - 1, r.height() - 4 ), r ); // Do we have an icon? if ( mi->iconSet() ) { - QIconSet::Mode mode; + TQIconSet::Mode mode; // Select the correct icon from the iconset if (active) - mode = enabled?QIconSet::Active:QIconSet::Disabled; + mode = enabled?TQIconSet::Active:TQIconSet::Disabled; else - mode = enabled?QIconSet::Normal:QIconSet::Disabled; + mode = enabled?TQIconSet::Normal:TQIconSet::Disabled; // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon if ( checkable && /*!active &&*/ mi->isChecked() ) qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), - cg, true, 1, &cg.brush(QColorGroup::Midlight) ); + cg, true, 1, &cg.brush(TQColorGroup::Midlight) ); // Draw the icon - QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode); - QRect pmr( 0, 0, pixmap.width(), pixmap.height() ); + TQPixmap pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode); + TQRect pmr( 0, 0, pixmap.width(), pixmap.height() ); pmr.moveCenter( cr.center() ); p->drawPixmap( pmr.topLeft(), pixmap ); } @@ -2555,7 +2555,7 @@ void PlastikStyle::drawControl(ControlElement element, // if it's active the "pressed" background is already drawn // if ( ! active ) qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), cg, true, 1, - &cg.brush(QColorGroup::Midlight) ); + &cg.brush(TQColorGroup::Midlight) ); // Draw the checkmark SFlags cflags = Style_On; @@ -2582,7 +2582,7 @@ void PlastikStyle::drawControl(ControlElement element, // This color will be used instead of the above if the menu item // is active and disabled at the same time. (etched text) - QColor discol = cg.mid(); + TQColor discol = cg.mid(); // Does the menu item draw it's own label? if ( mi->custom() ) { @@ -2602,7 +2602,7 @@ void PlastikStyle::drawControl(ControlElement element, } else { // The menu item doesn't draw it's own label - QString s = mi->text(); + TQString s = mi->text(); // Does the menu item have a text label? if ( !s.isNull() ) { int t = s.find( '\t' ); @@ -2610,8 +2610,8 @@ void PlastikStyle::drawControl(ControlElement element, int text_flags = AlignVCenter | ShowPrefix | DontClip | SingleLine; text_flags |= reverse ? AlignRight : AlignLeft; - //QColor draw = cg.text(); - QColor draw = (active && enabled) ? cg.highlightedText () : cg.foreground(); + //TQColor draw = cg.text(); + TQColor draw = (active && enabled) ? cg.highlightedText () : cg.foreground(); p->setPen(draw); @@ -2650,7 +2650,7 @@ void PlastikStyle::drawControl(ControlElement element, // The menu item doesn't have a text label // Check if it has a pixmap instead else if ( mi->pixmap() ) { - QPixmap *pixmap = mi->pixmap(); + TQPixmap *pixmap = mi->pixmap(); // Draw the pixmap if ( pixmap->depth() == 1 ) @@ -2669,7 +2669,7 @@ void PlastikStyle::drawControl(ControlElement element, if ( mi->popup() ) { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; int dim = pixelMetric(PM_MenuButtonIndicator) - 1; - QRect vr = visualRect( QRect( r.x() + r.width() - 5 - 1 - dim, + TQRect vr = visualRect( TQRect( r.x() + r.width() - 5 - 1 - dim, r.y() + r.height() / 2 - dim / 2, dim, dim), r ); // Draw an arrow at the far end of the menu item @@ -2677,7 +2677,7 @@ void PlastikStyle::drawControl(ControlElement element, if ( enabled ) discol = cg.buttonText(); - QColorGroup g2( discol, cg.highlight(), white, white, + TQColorGroup g2( discol, cg.highlight(), white, white, enabled ? white : discol, discol, white ); drawPrimitive( arrow, p, vr, g2, Style_Enabled ); @@ -2710,10 +2710,10 @@ void PlastikStyle::drawControl(ControlElement element, } void PlastikStyle::drawControlMask(ControlElement element, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &opt) const + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &opt) const { switch (element) { case CE_PushButton: { @@ -2730,10 +2730,10 @@ void PlastikStyle::drawControlMask(ControlElement element, } void PlastikStyle::drawComplexControlMask(ComplexControl c, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &o) const + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &o) const { switch (c) { case CC_SpinWidget: @@ -2751,16 +2751,16 @@ void PlastikStyle::drawComplexControlMask(ComplexControl c, } void PlastikStyle::drawComplexControl(ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption& opt) const + const TQStyleOption& opt) const { - const bool reverseLayout = QApplication::reverseLayout(); + const bool reverseLayout = TQApplication::reverseLayout(); const bool enabled = (flags & Style_Enabled); @@ -2770,7 +2770,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, case CC_ComboBox: { static const unsigned int handleWidth = 15; - const QComboBox *cb = dynamic_cast<const QComboBox *>(widget); + const TQComboBox *cb = dynamic_cast<const TQComboBox *>(widget); // at the moment cb is only needed to check if the combo box is editable or not. // if cb doesn't exist, just assume false and the app (gideon! ;) ) at least doesn't crash. bool editable = false; @@ -2780,8 +2780,8 @@ void PlastikStyle::drawComplexControl(ComplexControl control, hasFocus = cb->hasFocus(); } - const QColor buttonColor = enabled?cg.button():cg.background(); - const QColor inputColor = enabled?(editable?cg.base():cg.button()) + const TQColor buttonColor = enabled?cg.button():cg.background(); + const TQColor inputColor = enabled?(editable?cg.base():cg.button()) :cg.background(); uint contourFlags = 0; @@ -2790,9 +2790,9 @@ void PlastikStyle::drawComplexControl(ComplexControl control, if (_inputFocusHighlight && hasFocus && editable && enabled) { - QRect editField = querySubControlMetrics(control, widget, SC_ComboBoxEditField); - QRect editFrame = r; - QRect buttonFrame = r; + TQRect editField = querySubControlMetrics(control, widget, SC_ComboBoxEditField); + TQRect editFrame = r; + TQRect buttonFrame = r; uint editFlags = contourFlags; uint buttonFlags = contourFlags; @@ -2833,9 +2833,9 @@ void PlastikStyle::drawComplexControl(ComplexControl control, p->drawLine(r.right()-handleWidth-1, r.top()+1, r.right()-handleWidth-1, r.bottom()-1); } - const QRect RbuttonSurface(reverseLayout?r.left()+1:r.right()-handleWidth, r.top()+1, + const TQRect RbuttonSurface(reverseLayout?r.left()+1:r.right()-handleWidth, r.top()+1, handleWidth, r.height()-2); - const QRect RcontentSurface(reverseLayout?r.left()+1+handleWidth+1:r.left()+1, r.top()+1, + const TQRect RcontentSurface(reverseLayout?r.left()+1+handleWidth+1:r.left()+1, r.top()+1, r.width()-handleWidth-3, r.height()-2); // handler @@ -2873,7 +2873,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, surfaceFlags); if (hasFocus) { drawPrimitive(PE_FocusRect, p, - QRect(RcontentSurface.x() + 2, + TQRect(RcontentSurface.x() + 2, RcontentSurface.y() + 2, RcontentSurface.width() - 4, RcontentSurface.height() - 4), cg); @@ -2913,7 +2913,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, p->setPen(cg.foreground()); drawPrimitive(PE_SpinWidgetDown, p, RbuttonSurface, cg, Style_Default|Style_Enabled|Style_Raised); - // QComboBox draws the text using cg.text(), we can override this + // TQComboBox draws the text using cg.text(), we can override this // from here p->setPen( cg.buttonText() ); p->setBackgroundColor( cg.button() ); @@ -2923,9 +2923,9 @@ void PlastikStyle::drawComplexControl(ComplexControl control, // TOOLBUTTON // ---------- case CC_ToolButton: { - const QToolButton *tb = (const QToolButton *) widget; + const TQToolButton *tb = (const TQToolButton *) widget; - QRect button, menuarea; + TQRect button, menuarea; button = querySubControlMetrics(control, widget, SC_ToolButton, opt); menuarea = querySubControlMetrics(control, widget, SC_ToolButtonMenu, opt); @@ -2954,7 +2954,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, } else if (tb->parentWidget() && tb->parentWidget()->backgroundPixmap() && !tb->parentWidget()->backgroundPixmap()->isNull()) { - QPixmap pixmap = *(tb->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(tb->parentWidget()->backgroundPixmap()); p->drawTiledPixmap( r, pixmap, tb->pos() ); } } @@ -2968,7 +2968,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, } if (tb->hasFocus() && !tb->focusProxy()) { - QRect fr = tb->rect(); + TQRect fr = tb->rect(); fr.addCoords(2, 2, -2, -2); drawPrimitive(PE_FocusRect, p, fr, cg); } @@ -2984,7 +2984,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, case CC_SpinWidget: { static const unsigned int handleWidth = 15; - const QSpinWidget *sw = dynamic_cast<const QSpinWidget *>(widget); + const TQSpinWidget *sw = dynamic_cast<const TQSpinWidget *>(widget); SFlags sflags = flags; PrimitiveElement pe; @@ -2992,16 +2992,16 @@ void PlastikStyle::drawComplexControl(ComplexControl control, if (sw) hasFocus = sw->hasFocus(); - const QColor buttonColor = enabled?cg.button():cg.background(); - const QColor inputColor = enabled?cg.base():cg.background(); + const TQColor buttonColor = enabled?cg.button():cg.background(); + const TQColor inputColor = enabled?cg.base():cg.background(); // contour const bool heightDividable = ((r.height()%2) == 0); if (_inputFocusHighlight && hasFocus && enabled) { - QRect editField = querySubControlMetrics(control, widget, SC_SpinWidgetEditField); - QRect editFrame = r; - QRect buttonFrame = r; + TQRect editField = querySubControlMetrics(control, widget, SC_SpinWidgetEditField); + TQRect editFrame = r; + TQRect buttonFrame = r; uint editFlags = 0; uint buttonFlags = 0; @@ -3043,14 +3043,14 @@ void PlastikStyle::drawComplexControl(ComplexControl control, reverseLayout?r.left()+handleWidth:r.right()-1, r.top()+1+(r.height()-2)/2-1); // surface - QRect upRect = QRect(reverseLayout?r.left()+1:r.right()-handleWidth, r.top()+1, + TQRect upRect = TQRect(reverseLayout?r.left()+1:r.right()-handleWidth, r.top()+1, handleWidth, (r.height()-2)/2); - QRect downRect = QRect(reverseLayout?r.left()+1:r.right()-handleWidth, + TQRect downRect = TQRect(reverseLayout?r.left()+1:r.right()-handleWidth, heightDividable?r.top()+1+((r.height()-2)/2):r.top()+1+((r.height()-2)/2)+1, handleWidth, ((r.height()-2)/2) ); if(heightDividable) { - upRect = QRect(upRect.left(), upRect.top(), upRect.width(), upRect.height()-1 ); - downRect = QRect(downRect.left(), downRect.top()+1, downRect.width(), downRect.height()-1 ); + upRect = TQRect(upRect.left(), upRect.top(), upRect.width(), upRect.height()-1 ); + downRect = TQRect(downRect.left(), downRect.top()+1, downRect.width(), downRect.height()-1 ); } uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Is_Horizontal; @@ -3089,7 +3089,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, sflags |= Style_Sunken; } else sflags |= Style_Raised; - if (sw->buttonSymbols() == QSpinWidget::PlusMinus) + if (sw->buttonSymbols() == TQSpinWidget::PlusMinus) pe = PE_SpinWidgetPlus; else pe = PE_SpinWidgetUp; @@ -3102,7 +3102,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, sflags |= Style_Sunken; } else sflags |= Style_Raised; - if (sw->buttonSymbols() == QSpinWidget::PlusMinus) + if (sw->buttonSymbols() == TQSpinWidget::PlusMinus) pe = PE_SpinWidgetMinus; else pe = PE_SpinWidgetDown; @@ -3110,7 +3110,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, drawPrimitive(pe, p, downRect, cg, sflags); // thin frame around the input area - const QRect Rcontent = QRect(reverseLayout?r.left()+1+handleWidth+1:r.left()+1, r.top()+1, + const TQRect Rcontent = TQRect(reverseLayout?r.left()+1+handleWidth+1:r.left()+1, r.top()+1, r.width()-1-2-handleWidth, r.height()-2); if (_inputFocusHighlight && hasFocus && enabled) { @@ -3148,7 +3148,7 @@ void PlastikStyle::drawComplexControl(ComplexControl control, } -QRect PlastikStyle::subRect(SubRect r, const QWidget *widget) const +TQRect PlastikStyle::subRect(SubRect r, const TQWidget *widget) const { switch (r) { case SR_ComboBoxFocusRect: { @@ -3158,12 +3158,12 @@ QRect PlastikStyle::subRect(SubRect r, const QWidget *widget) const // Don't use KStyles progressbar subrect // TODO: case SR_ProgressBarGroove: { - return QRect(widget->rect()); + return TQRect(widget->rect()); } case SR_ProgressBarContents: case SR_ProgressBarLabel: { - QRect rw = widget->rect(); - return QRect(rw.left()+2, rw.top()+2, rw.width()-4, rw.height()-4 ); + TQRect rw = widget->rect(); + return TQRect(rw.left()+2, rw.top()+2, rw.width()-4, rw.height()-4 ); } default: { @@ -3172,22 +3172,22 @@ QRect PlastikStyle::subRect(SubRect r, const QWidget *widget) const } } -QRect PlastikStyle::querySubControlMetrics(ComplexControl control, - const QWidget *widget, +TQRect PlastikStyle::querySubControlMetrics(ComplexControl control, + const TQWidget *widget, SubControl subcontrol, - const QStyleOption &opt) const + const TQStyleOption &opt) const { if (!widget) { - return QRect(); + return TQRect(); } - QRect r(widget->rect()); + TQRect r(widget->rect()); switch (control) { case CC_ComboBox: { switch (subcontrol) { case SC_ComboBoxEditField: { // TODO: is the handler width in pixelmetric? - return QRect(r.left()+2, r.top()+2, r.width()-4-15-1, r.height()-4); + return TQRect(r.left()+2, r.top()+2, r.width()-4-15-1, r.height()-4); } default: { return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); @@ -3200,7 +3200,7 @@ QRect PlastikStyle::querySubControlMetrics(ComplexControl control, const bool heightDividable = ((r.height()%2) == 0); - QSize bs; + TQSize bs; if(heightDividable) { bs.setHeight(QMAX(8, (r.height()-2)/2)); } else { @@ -3212,26 +3212,26 @@ QRect PlastikStyle::querySubControlMetrics(ComplexControl control, switch (subcontrol) { case SC_SpinWidgetUp: { - return QRect(buttonsLeft, r.top()+1, bs.width(), bs.height() ); + return TQRect(buttonsLeft, r.top()+1, bs.width(), bs.height() ); } case SC_SpinWidgetDown: { if(heightDividable) { - return QRect(buttonsLeft, r.top()+1+bs.height(), + return TQRect(buttonsLeft, r.top()+1+bs.height(), bs.width(), r.height()-(bs.height()+2) ); } else { - return QRect(buttonsLeft, r.top()+1+bs.height()+1, + return TQRect(buttonsLeft, r.top()+1+bs.height()+1, bs.width(), r.height()-(bs.height()+2+1) ); } } case SC_SpinWidgetFrame: { - return QRect(r.left(), r.top(), r.width(), r.height() ); + return TQRect(r.left(), r.top(), r.width(), r.height() ); } case SC_SpinWidgetEditField: { - return QRect(r.left()+fw, r.top()+fw, + return TQRect(r.left()+fw, r.top()+fw, r.width()-(bs.width()+1+2*fw), r.height()-2*fw); } case SC_SpinWidgetButtonField: { - return QRect(buttonsLeft, r.top()+1, bs.width(), r.height()-2); + return TQRect(buttonsLeft, r.top()+1, bs.width(), r.height()-2); } default: { return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); @@ -3245,15 +3245,15 @@ QRect PlastikStyle::querySubControlMetrics(ComplexControl control, } } -int PlastikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const +int PlastikStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const { switch(m) { // TABS // ---- case PM_TabBarTabVSpace: { - const QTabBar * tb = (const QTabBar *) widget; - if (tb->shape() == QTabBar::RoundedAbove || - tb->shape() == QTabBar::RoundedBelow) + const TQTabBar * tb = (const TQTabBar *) widget; + if (tb->shape() == TQTabBar::RoundedAbove || + tb->shape() == TQTabBar::RoundedBelow) return 12; else return 4; @@ -3322,7 +3322,7 @@ int PlastikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const return 1; case PM_DefaultFrameWidth: { - if(widget && ::qt_cast<QPopupMenu*>(widget)) + if(widget && ::qt_cast<TQPopupMenu*>(widget)) return 1; else return 2; @@ -3347,18 +3347,18 @@ int PlastikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const } -QSize PlastikStyle::sizeFromContents(ContentsType t, - const QWidget *widget, - const QSize &s, - const QStyleOption &opt) const +TQSize PlastikStyle::sizeFromContents(ContentsType t, + const TQWidget *widget, + const TQSize &s, + const TQStyleOption &opt) const { switch (t) { case CT_PopupMenuItem: { if (!widget || opt.isDefault()) return s; - const QPopupMenu *popup = dynamic_cast<const QPopupMenu *>(widget); - QMenuItem *mi = opt.menuItem(); + const TQPopupMenu *popup = dynamic_cast<const TQPopupMenu *>(widget); + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = s.width(), h = s.height(); bool checkable = popup->isCheckable(); @@ -3382,7 +3382,7 @@ QSize PlastikStyle::sizeFromContents(ContentsType t, } if (mi->iconSet()) { - h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal).height() + 2); + h = QMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height() + 2); } } @@ -3404,24 +3404,24 @@ QSize PlastikStyle::sizeFromContents(ContentsType t, w += rightBorder; - return QSize(w, h); + return TQSize(w, h); } case CT_PushButton: { - const QPushButton* btn = static_cast<const QPushButton*>(widget); + const TQPushButton* btn = static_cast<const TQPushButton*>(widget); int w = s.width() + 2 * pixelMetric(PM_ButtonMargin, widget); int h = s.height() + 2 * pixelMetric(PM_ButtonMargin, widget); - if ( btn->text().isEmpty() && s.width() < 32 ) return QSize(w, h); + if ( btn->text().isEmpty() && s.width() < 32 ) return TQSize(w, h); - return QSize( w+25, h+5 ); + return TQSize( w+25, h+5 ); } case CT_ToolButton: { - if(widget->parent() && ::qt_cast<QToolBar*>(widget->parent()) ) - return QSize( s.width()+2*4, s.height()+2*4 ); + if(widget->parent() && ::qt_cast<TQToolBar*>(widget->parent()) ) + return TQSize( s.width()+2*4, s.height()+2*4 ); else return KStyle::sizeFromContents (t, widget, s, opt); } @@ -3434,8 +3434,8 @@ QSize PlastikStyle::sizeFromContents(ContentsType t, } int PlastikStyle::styleHint( StyleHint stylehint, - const QWidget *widget, - const QStyleOption &option, + const TQWidget *widget, + const TQStyleOption &option, QStyleHintReturn* returnData ) const { switch (stylehint) { @@ -3447,7 +3447,7 @@ int PlastikStyle::styleHint( StyleHint stylehint, } } -bool PlastikStyle::eventFilter(QObject *obj, QEvent *ev) +bool PlastikStyle::eventFilter(TQObject *obj, TQEvent *ev) { if (KStyle::eventFilter(obj, ev) ) return true; @@ -3455,20 +3455,20 @@ bool PlastikStyle::eventFilter(QObject *obj, QEvent *ev) if (!obj->isWidgetType() ) return false; // focus highlight - if ( ::qt_cast<QLineEdit*>(obj) ) { - QWidget* widget = static_cast<QWidget*>(obj); + if ( ::qt_cast<TQLineEdit*>(obj) ) { + TQWidget* widget = static_cast<TQWidget*>(obj); - if ( ::qt_cast<QSpinWidget*>(widget->parentWidget()) ) + if ( ::qt_cast<TQSpinWidget*>(widget->parentWidget()) ) { - QWidget* spinbox = widget->parentWidget(); - if ((ev->type() == QEvent::FocusIn) || (ev->type() == QEvent::FocusOut)) + TQWidget* spinbox = widget->parentWidget(); + if ((ev->type() == TQEvent::FocusIn) || (ev->type() == TQEvent::FocusOut)) { spinbox->repaint(false); } return false; } - if ((ev->type() == QEvent::FocusIn) || (ev->type() == QEvent::FocusOut)) + if ((ev->type() == TQEvent::FocusIn) || (ev->type() == TQEvent::FocusOut)) { widget->repaint(false); } @@ -3476,36 +3476,36 @@ bool PlastikStyle::eventFilter(QObject *obj, QEvent *ev) } //Hover highlight... use qt_cast to check if the widget inheits one of the classes. - if ( ::qt_cast<QPushButton*>(obj) || ::qt_cast<QComboBox*>(obj) || - ::qt_cast<QSpinWidget*>(obj) || ::qt_cast<QCheckBox*>(obj) || - ::qt_cast<QRadioButton*>(obj) || ::qt_cast<QToolButton*>(obj) || obj->inherits("QSplitterHandle") ) + if ( ::qt_cast<TQPushButton*>(obj) || ::qt_cast<TQComboBox*>(obj) || + ::qt_cast<TQSpinWidget*>(obj) || ::qt_cast<TQCheckBox*>(obj) || + ::qt_cast<TQRadioButton*>(obj) || ::qt_cast<TQToolButton*>(obj) || obj->inherits("QSplitterHandle") ) { - if ((ev->type() == QEvent::Enter) && static_cast<QWidget*>(obj)->isEnabled()) + if ((ev->type() == TQEvent::Enter) && static_cast<TQWidget*>(obj)->isEnabled()) { - QWidget* button = static_cast<QWidget*>(obj); + TQWidget* button = static_cast<TQWidget*>(obj); hoverWidget = button; button->repaint(false); } - else if ((ev->type() == QEvent::Leave) && (obj == hoverWidget) ) + else if ((ev->type() == TQEvent::Leave) && (obj == hoverWidget) ) { - QWidget* button = static_cast<QWidget*>(obj); + TQWidget* button = static_cast<TQWidget*>(obj); hoverWidget = 0; button->repaint(false); } return false; } - if ( ::qt_cast<QTabBar*>(obj) ) { - if ((ev->type() == QEvent::Enter) && static_cast<QWidget*>(obj)->isEnabled()) + if ( ::qt_cast<TQTabBar*>(obj) ) { + if ((ev->type() == TQEvent::Enter) && static_cast<TQWidget*>(obj)->isEnabled()) { - QWidget* tabbar = static_cast<QWidget*>(obj); + TQWidget* tabbar = static_cast<TQWidget*>(obj); hoverWidget = tabbar; hoverTab = 0; tabbar->repaint(false); } - else if (ev->type() == QEvent::MouseMove) + else if (ev->type() == TQEvent::MouseMove) { - QTabBar *tabbar = dynamic_cast<QTabBar*>(obj); - QMouseEvent *me = dynamic_cast<QMouseEvent*>(ev); + TQTabBar *tabbar = dynamic_cast<TQTabBar*>(obj); + TQMouseEvent *me = dynamic_cast<TQMouseEvent*>(ev); if (tabbar && me) { // avoid unnecessary repaints (which otherwise would occour on every @@ -3513,7 +3513,7 @@ bool PlastikStyle::eventFilter(QObject *obj, QEvent *ev) bool repaint = true; - QTab *tab = tabbar->selectTab(me->pos() ); + TQTab *tab = tabbar->selectTab(me->pos() ); if (hoverTab == tab) repaint = false; hoverTab = tab; @@ -3522,9 +3522,9 @@ bool PlastikStyle::eventFilter(QObject *obj, QEvent *ev) tabbar->repaint(false); } } - else if (ev->type() == QEvent::Leave) + else if (ev->type() == TQEvent::Leave) { - QWidget* tabbar = static_cast<QWidget*>(obj); + TQWidget* tabbar = static_cast<TQWidget*>(obj); hoverWidget = 0; hoverTab = 0; tabbar->repaint(false); @@ -3532,16 +3532,16 @@ bool PlastikStyle::eventFilter(QObject *obj, QEvent *ev) return false; } // Track show events for progress bars - if ( _animateProgressBar && ::qt_cast<QProgressBar*>(obj) ) + if ( _animateProgressBar && ::qt_cast<TQProgressBar*>(obj) ) { - if ((ev->type() == QEvent::Show) && !animationTimer->isActive()) + if ((ev->type() == TQEvent::Show) && !animationTimer->isActive()) { animationTimer->start( 50, false ); } } if ( !qstrcmp(obj->name(), "kde toolbar widget") ) { - QWidget* lb = static_cast<QWidget*>(obj); + TQWidget* lb = static_cast<TQWidget*>(obj); if (lb->backgroundMode() == Qt::PaletteButton) lb->setBackgroundMode(Qt::PaletteBackground); lb->removeEventFilter(this); @@ -3550,12 +3550,12 @@ bool PlastikStyle::eventFilter(QObject *obj, QEvent *ev) return false; } -QColor PlastikStyle::getColor(const QColorGroup &cg, const ColorType t, const bool enabled)const +TQColor PlastikStyle::getColor(const TQColorGroup &cg, const ColorType t, const bool enabled)const { return getColor(cg, t, enabled?IsEnabled:IsDisabled); } -QColor PlastikStyle::getColor(const QColorGroup &cg, const ColorType t, const WidgetState s)const +TQColor PlastikStyle::getColor(const TQColorGroup &cg, const ColorType t, const WidgetState s)const { const bool enabled = (s != IsDisabled) && ((s == IsEnabled) || (s == IsPressed) || (s == IsHighlighted)); diff --git a/kstyles/plastik/plastik.h b/kstyles/plastik/plastik.h index 32a48ec96..2b5b70a71 100644 --- a/kstyles/plastik/plastik.h +++ b/kstyles/plastik/plastik.h @@ -40,8 +40,8 @@ #define __PLASTIK_H #include <kstyle.h> -#include <qbitmap.h> -#include <qintcache.h> +#include <tqbitmap.h> +#include <tqintcache.h> #define u_arrow -4,1, 2,1, -3,0, 1,0, -2,-1, 0,-1, -1,-2 #define d_arrow -4,-2, 2,-2, -3,-1, 1,-1, -2,0, 0,0, -1,1 @@ -62,69 +62,69 @@ public: PlastikStyle(); virtual ~PlastikStyle(); - void polish(QApplication* app ); - void polish(QWidget* widget ); - void unPolish(QWidget* widget ); + void polish(TQApplication* app ); + void polish(TQWidget* widget ); + void unPolish(TQWidget* widget ); void drawKStylePrimitive(KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawPrimitive(PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption &opt = QStyleOption::Default ) const; + const TQStyleOption &opt = TQStyleOption::Default ) const; void drawControl(ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; - void drawControlMask( ControlElement, QPainter *, const QWidget *, const QRect &, const QStyleOption &) const; + void drawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const; void drawComplexControl(ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; int pixelMetric(PixelMetric m, - const QWidget *widget = 0 ) const; + const TQWidget *widget = 0 ) const; - QRect subRect(SubRect r, - const QWidget *widget ) const; + TQRect subRect(SubRect r, + const TQWidget *widget ) const; - QRect querySubControlMetrics(ComplexControl control, - const QWidget *widget, + TQRect querySubControlMetrics(ComplexControl control, + const TQWidget *widget, SubControl subcontrol, - const QStyleOption &opt = QStyleOption::Default ) const; + const TQStyleOption &opt = TQStyleOption::Default ) const; - void drawComplexControlMask(QStyle::ComplexControl c, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &o=QStyleOption::Default) const; + void drawComplexControlMask(TQStyle::ComplexControl c, + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &o=TQStyleOption::Default) const; - QSize sizeFromContents(QStyle::ContentsType t, - const QWidget *w, - const QSize &s, - const QStyleOption &o) const; + TQSize sizeFromContents(TQStyle::ContentsType t, + const TQWidget *w, + const TQSize &s, + const TQStyleOption &o) const; - int styleHint(StyleHint, const QWidget * = 0, - const QStyleOption & = QStyleOption::Default, + int styleHint(StyleHint, const TQWidget * = 0, + const TQStyleOption & = TQStyleOption::Default, QStyleHintReturn * = 0 ) const; protected: @@ -182,66 +182,66 @@ protected: Draw_AlphaBlend = 0x00020000 }; - void renderContour(QPainter *p, - const QRect &r, - const QColor &backgroundColor, - const QColor &contourColor, + void renderContour(TQPainter *p, + const TQRect &r, + const TQColor &backgroundColor, + const TQColor &contourColor, const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight) const; - void renderMask(QPainter *p, - const QRect &r, - const QColor &color, + void renderMask(TQPainter *p, + const TQRect &r, + const TQColor &color, const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight) const; - void renderSurface(QPainter *p, - const QRect &r, - const QColor &backgroundColor, - const QColor &buttonColor, - const QColor &highlightColor, + void renderSurface(TQPainter *p, + const TQRect &r, + const TQColor &backgroundColor, + const TQColor &buttonColor, + const TQColor &highlightColor, int intensity = 5, const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight| Is_Horizontal) const; - inline void renderPixel(QPainter *p, - const QPoint &pos, + inline void renderPixel(TQPainter *p, + const TQPoint &pos, const int alpha, - const QColor &color, - const QColor &background = QColor(), + const TQColor &color, + const TQColor &background = TQColor(), bool fullAlphaBlend = true) const; - void renderButton(QPainter *p, - const QRect &r, - const QColorGroup &g, + void renderButton(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool sunken = false, bool mouseOver = false, bool horizontal = true, bool enabled = true, bool khtmlMode = false) const; - void renderPanel(QPainter *p, - const QRect &r, - const QColorGroup &g, + void renderPanel(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, const bool pseudo3d = true, const bool sunken = true) const; - void renderDot(QPainter *p, - const QPoint &point, - const QColor &baseColor, + void renderDot(TQPainter *p, + const TQPoint &point, + const TQColor &baseColor, const bool thick = false, const bool sunken = false) const; - void renderGradient(QPainter *p, - const QRect &r, - const QColor &c1, - const QColor &c2, + void renderGradient(TQPainter *p, + const TQRect &r, + const TQColor &c1, + const TQColor &c2, bool horizontal = true) const; - void renderTab(QPainter *p, - const QRect &r, - const QColorGroup &g, + void renderTab(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool mouseOver = false, const bool selected = false, const bool bottom = false, @@ -249,21 +249,21 @@ protected: const bool triangular = false, const bool cornerWidget = false) const; - virtual void renderMenuBlendPixmap( KPixmap& pix, const QColorGroup& cg, - const QPopupMenu* popup ) const; + virtual void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup& cg, + const TQPopupMenu* popup ) const; - bool eventFilter(QObject *, QEvent *); + bool eventFilter(TQObject *, TQEvent *); - QWidget* hoverWidget; + TQWidget* hoverWidget; protected slots: - void khtmlWidgetDestroyed(QObject* w); + void khtmlWidgetDestroyed(TQObject* w); //Animation slots. void updateProgressPos(); - void progressBarDestroyed(QObject* bar); + void progressBarDestroyed(TQObject* bar); - inline QColor getColor(const QColorGroup &cg, const ColorType t, const bool enabled = true)const; - inline QColor getColor(const QColorGroup &cg, const ColorType t, const WidgetState s)const; + inline TQColor getColor(const TQColorGroup &cg, const ColorType t, const bool enabled = true)const; + inline TQColor getColor(const TQColorGroup &cg, const ColorType t, const WidgetState s)const; private: // Disable copy constructor and = operator PlastikStyle( const PlastikStyle & ); @@ -283,17 +283,17 @@ private: bool _customOverHighlightColor; bool _customFocusHighlightColor; bool _customCheckMarkColor; - QColor _overHighlightColor; - QColor _focusHighlightColor; - QColor _checkMarkColor; + TQColor _overHighlightColor; + TQColor _focusHighlightColor; + TQColor _checkMarkColor; - QTab *hoverTab; + TQTab *hoverTab; // track khtml widgets. - QMap<const QWidget*,bool> khtmlWidgets; + TQMap<const TQWidget*,bool> khtmlWidgets; //Animation support. - QMap<QWidget*, int> progAnimWidgets; + TQMap<TQWidget*, int> progAnimWidgets; // pixmap cache. enum CacheEntryType { @@ -310,10 +310,10 @@ private: QRgb c2Rgb; bool horizontal; - QPixmap* pixmap; + TQPixmap* pixmap; CacheEntry(CacheEntryType t, int w, int h, QRgb c1, QRgb c2 = 0, - bool hor = false, QPixmap* p = 0 ): + bool hor = false, TQPixmap* p = 0 ): type(t), width(w), height(h), c1Rgb(c1), c2Rgb(c2), horizontal(hor), pixmap(p) {} @@ -324,7 +324,7 @@ private: int key() { - // create an int key from the properties which is used to refer to entries in the QIntCache. + // create an int key from the properties which is used to refer to entries in the TQIntCache. // the result may not be 100% correct as we don't have so much space in one integer -- use // == operator after find to make sure we got the right one. :) return horizontal ^ (type<<1) ^ (width<<5) ^ (height<<10) ^ (c1Rgb<<19) ^ (c2Rgb<<22); @@ -349,14 +349,14 @@ private: return match; } }; - QIntCache<CacheEntry> *pixmapCache; + TQIntCache<CacheEntry> *pixmapCache; // For KPE_ListViewBranch - mutable QBitmap *verticalLine; - mutable QBitmap *horizontalLine; + mutable TQBitmap *verticalLine; + mutable TQBitmap *horizontalLine; // For progress bar animation - QTimer *animationTimer; + TQTimer *animationTimer; }; #endif // __PLASTIK_H diff --git a/kstyles/utils/installtheme/main.cpp b/kstyles/utils/installtheme/main.cpp index 0569c74ef..5ddf8cd56 100644 --- a/kstyles/utils/installtheme/main.cpp +++ b/kstyles/utils/installtheme/main.cpp @@ -20,10 +20,10 @@ DEALINGS IN THE SOFTWARE. */ -#include <qfileinfo.h> -#include <qmap.h> -#include <qstringlist.h> -#include <qsettings.h> +#include <tqfileinfo.h> +#include <tqmap.h> +#include <tqstringlist.h> +#include <tqsettings.h> #include <kapplication.h> #include <kcmdlineargs.h> @@ -40,16 +40,16 @@ int main(int argc, char **argv) KCmdLineArgs::init(argc, argv, "kinstalltheme", I18N_NOOP("KInstalltheme"), desc, ver); KApplication qapp(false, false); //We don't allow styles.. Kind of ironic, isn't it? - KGlobal::dirs()->addResourceType("themercs", KGlobal::dirs()->kde_default("data")+QString("kstyle/themes")); - QStringList themercs = KGlobal::dirs()->findAllResources("themercs","*.themerc"); + KGlobal::dirs()->addResourceType("themercs", KGlobal::dirs()->kde_default("data")+TQString("kstyle/themes")); + TQStringList themercs = KGlobal::dirs()->findAllResources("themercs","*.themerc"); - QMap <QString, QString> themes; //Name->file mapping.. + TQMap <TQString, TQString> themes; //Name->file mapping.. - for (QStringList::iterator i = themercs.begin(); i!=themercs.end(); ++i) + for (TQStringList::iterator i = themercs.begin(); i!=themercs.end(); ++i) { - QString file=*i; + TQString file=*i; KSimpleConfig config(file, true); - QString name = QFileInfo(file).baseName(); //This is nice and static... + TQString name = TQFileInfo(file).baseName(); //This is nice and static... //So we don't have to worry about our key changing when the language does. config.setGroup( "KDE" ); @@ -66,20 +66,20 @@ int main(int argc, char **argv) #if 0 //Doesn't seem to work with present Qt.. - QStringList existing = cache.subkeyList("/kthemestyle"); - for (QStringList::iterator i = existing.begin(); i != existing.end(); i++) + TQStringList existing = cache.subkeyList("/kthemestyle"); + for (TQStringList::iterator i = existing.begin(); i != existing.end(); i++) { cout<<"Have:"<<(*i).latin1()<<"\n"; cache.removeEntry("/ktmthestyle"+(*i)); } #endif - QStringList themeNames; //A list of names, each occurring once - the keys of the themes map.. + TQStringList themeNames; //A list of names, each occurring once - the keys of the themes map.. - for (QMap<QString, QString>::Iterator i = themes.begin(); i!=themes.end(); ++i) + for (TQMap<TQString, TQString>::Iterator i = themes.begin(); i!=themes.end(); ++i) { cache.setGroup(i.key().lower()); - cache.writePathEntry("file",QFileInfo(i.data()).fileName()); + cache.writePathEntry("file",TQFileInfo(i.data()).fileName()); themeNames.push_back(i.key()); } diff --git a/kstyles/web/webstyle.cpp b/kstyles/web/webstyle.cpp index ec5f606d0..41cbd9339 100644 --- a/kstyles/web/webstyle.cpp +++ b/kstyles/web/webstyle.cpp @@ -21,16 +21,16 @@ #define INCLUDE_MENUITEM_DEF #endif -#include <qmenudata.h> -#include <qpalette.h> -#include <qbitmap.h> -#include <qtabbar.h> -#include <qpointarray.h> -#include <qscrollbar.h> -#include <qframe.h> -#include <qpushbutton.h> -#include <qdrawutil.h> -#include <qpainter.h> +#include <tqmenudata.h> +#include <tqpalette.h> +#include <tqbitmap.h> +#include <tqtabbar.h> +#include <tqpointarray.h> +#include <tqscrollbar.h> +#include <tqframe.h> +#include <tqpushbutton.h> +#include <tqdrawutil.h> +#include <tqpainter.h> #include <kapplication.h> #include <kdrawutil.h> @@ -41,15 +41,15 @@ #include "webstyle.h" static const int _indicatorSize = 13; -static QButton * _highlightedButton = 0; +static TQButton * _highlightedButton = 0; static const int _scrollBarExtent = 14; -static QFrame * _currentFrame = 0; +static TQFrame * _currentFrame = 0; static int _savedFrameLineWidth; static int _savedFrameMidLineWidth; static ulong _savedFrameStyle; -static QColor contrastingForeground(const QColor & fg, const QColor & bg) +static TQColor contrastingForeground(const TQColor & fg, const TQColor & bg) { int h, s, vbg, vfg; @@ -73,26 +73,26 @@ static QColor contrastingForeground(const QColor & fg, const QColor & bg) static void scrollBarControlsMetrics ( - const QScrollBar * sb, + const TQScrollBar * sb, int sliderStart, int /* sliderMin */, int sliderMax, int sliderLength, int buttonDim, - QRect & rSub, - QRect & rAdd, - QRect & rSubPage, - QRect & rAddPage, - QRect & rSlider + TQRect & rSub, + TQRect & rAdd, + TQRect & rSubPage, + TQRect & rAddPage, + TQRect & rSlider ) { - bool horizontal = sb->orientation() == QScrollBar::Horizontal; + bool horizontal = sb->orientation() == TQScrollBar::Horizontal; int len = horizontal ? sb->width() : sb->height(); int extent = horizontal ? sb->height() : sb->width(); - QColorGroup g = sb->colorGroup(); + TQColorGroup g = sb->colorGroup(); if (sliderStart > sliderMax) sliderStart = sliderMax; @@ -162,7 +162,7 @@ scrollBarControlsMetrics static void drawFunkyRect ( - QPainter * p, + TQPainter * p, int x, int y, int w, @@ -190,7 +190,7 @@ drawFunkyRect 1, h - 2 }; - p->drawPoints(QPointArray(4, pointList)); + p->drawPoints(TQPointArray(4, pointList)); } else { @@ -211,7 +211,7 @@ drawFunkyRect 1, h - 3 }; - p->drawPoints(QPointArray(8, pointList)); + p->drawPoints(TQPointArray(8, pointList)); } p->translate(-x, -y); @@ -230,34 +230,34 @@ WebStyle::~WebStyle() } void -WebStyle::polish(QApplication *) +WebStyle::polish(TQApplication *) { // Empty. } void -WebStyle::polish(QPalette &) +WebStyle::polish(TQPalette &) { // Empty. } void -WebStyle::unPolish(QApplication *) +WebStyle::unPolish(TQApplication *) { // Empty. } void -WebStyle::polish(QWidget * w) +WebStyle::polish(TQWidget * w) { - if (w->inherits("QPushButton")) + if (w->inherits("TQPushButton")) w->installEventFilter(this); - else if (w->inherits("QGroupBox") || w->inherits("QFrame")) + else if (w->inherits("TQGroupBox") || w->inherits("TQFrame")) { - QFrame * f(static_cast<QFrame *>(w)); + TQFrame * f(static_cast<TQFrame *>(w)); - if (f->frameStyle() != QFrame::NoFrame) + if (f->frameStyle() != TQFrame::NoFrame) { _currentFrame = f; @@ -265,29 +265,29 @@ WebStyle::polish(QWidget * w) _savedFrameMidLineWidth = f->midLineWidth(); _savedFrameStyle = f->frameStyle(); - if (f->frameShape() == QFrame::HLine || f->frameShape() == QFrame::VLine) + if (f->frameShape() == TQFrame::HLine || f->frameShape() == TQFrame::VLine) { f->setMidLineWidth(1); - f->setFrameStyle(f->frameShape() | QFrame::Plain); + f->setFrameStyle(f->frameShape() | TQFrame::Plain); } else { f->setLineWidth(1); - f->setFrameStyle(QFrame::Box | QFrame::Plain); + f->setFrameStyle(TQFrame::Box | TQFrame::Plain); } } } } void -WebStyle::unPolish(QWidget * w) +WebStyle::unPolish(TQWidget * w) { - if (w->inherits("QPushButton")) + if (w->inherits("TQPushButton")) w->removeEventFilter(this); else if (w == _currentFrame) { - QFrame * f(static_cast<QFrame *>(w)); + TQFrame * f(static_cast<TQFrame *>(w)); f->setLineWidth(_savedFrameLineWidth); f->setMidLineWidth(_savedFrameMidLineWidth); @@ -296,16 +296,16 @@ WebStyle::unPolish(QWidget * w) } bool -WebStyle::eventFilter(QObject * o, QEvent * e) +WebStyle::eventFilter(TQObject * o, TQEvent * e) { - QPushButton * pb(static_cast<QPushButton *>(o)); + TQPushButton * pb(static_cast<TQPushButton *>(o)); - if (e->type() == QEvent::Enter) + if (e->type() == TQEvent::Enter) { _highlightedButton = pb; pb->repaint(false); } - else if (e->type() == QEvent::Leave) + else if (e->type() == TQEvent::Leave) { _highlightedButton = 0; pb->repaint(false); @@ -317,14 +317,14 @@ WebStyle::eventFilter(QObject * o, QEvent * e) void WebStyle::drawButton ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool sunken, - const QBrush * fill + const TQBrush * fill ) { p->save(); @@ -344,41 +344,41 @@ WebStyle::drawButton QRect WebStyle::buttonRect(int x, int y, int w, int h) { - return QRect(x + 2, y + 2, w - 4, h - 4); + return TQRect(x + 2, y + 2, w - 4, h - 4); } void WebStyle::drawBevelButton ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool sunken, - const QBrush * fill + const TQBrush * fill ) { drawButton(p, x, y, w, h, g, sunken, fill); } void -WebStyle::drawPushButton(QPushButton * b, QPainter * p) +WebStyle::drawPushButton(TQPushButton * b, TQPainter * p) { // Note: painter is already translated for us. bool sunken(b->isDown() || b->isOn()); bool hl(_highlightedButton == b); - QColor bg(b->colorGroup().button()); + TQColor bg(b->colorGroup().button()); p->save(); - p->fillRect(b->rect(), b->colorGroup().brush(QColorGroup::Background)); + p->fillRect(b->rect(), b->colorGroup().brush(TQColorGroup::Background)); if (b->isDefault()) { - QColor c(hl ? b->colorGroup().highlight() : b->colorGroup().mid()); + TQColor c(hl ? b->colorGroup().highlight() : b->colorGroup().mid()); p->setPen(contrastingForeground(c, bg)); @@ -391,7 +391,7 @@ WebStyle::drawPushButton(QPushButton * b, QPainter * p) 4, b->width() - 8, b->height() - 8, - b->colorGroup().brush(QColorGroup::Button) + b->colorGroup().brush(TQColorGroup::Button) ); if (b->isEnabled()) @@ -419,7 +419,7 @@ WebStyle::drawPushButton(QPushButton * b, QPainter * p) } void -WebStyle::drawPushButtonLabel(QPushButton * b, QPainter * p) +WebStyle::drawPushButtonLabel(TQPushButton * b, TQPainter * p) { // This is complicated stuff and we don't really want to mess with it. @@ -429,8 +429,8 @@ WebStyle::drawPushButtonLabel(QPushButton * b, QPainter * p) void WebStyle::drawScrollBarControls ( - QPainter * p, - const QScrollBar * sb, + TQPainter * p, + const TQScrollBar * sb, int sliderStart, uint controls, uint activeControl @@ -442,7 +442,7 @@ WebStyle::drawScrollBarControls scrollBarMetrics(sb, sliderMin, sliderMax, sliderLength, buttonDim); - QRect rSub, rAdd, rSubPage, rAddPage, rSlider; + TQRect rSub, rAdd, rSubPage, rAddPage, rSlider; scrollBarControlsMetrics ( @@ -459,13 +459,13 @@ WebStyle::drawScrollBarControls rSlider ); - QColorGroup g(sb->colorGroup()); + TQColorGroup g(sb->colorGroup()); if (controls & AddLine && rAdd.isValid()) { bool active(activeControl & AddLine); - QColor c(active ? g.highlight() : g.dark()); + TQColor c(active ? g.highlight() : g.dark()); p->setPen(c); p->setBrush(g.button()); @@ -494,7 +494,7 @@ WebStyle::drawScrollBarControls { bool active(activeControl & SubLine); - QColor c(active ? g.highlight() : g.dark()); + TQColor c(active ? g.highlight() : g.dark()); p->setPen(c); p->setBrush(g.button()); @@ -551,7 +551,7 @@ WebStyle::drawScrollBarControls rSlider.width() - 4 ; - QPoint center(rSlider.center()); + TQPoint center(rSlider.center()); if (Horizontal == sb->orientation()) { @@ -575,12 +575,12 @@ WebStyle::drawScrollBarControls p->restore(); } - QStyle::ScrollControl + TQStyle::ScrollControl WebStyle::scrollBarPointOver ( - const QScrollBar * sb, + const TQScrollBar * sb, int sliderStart, - const QPoint & point + const TQPoint & point ) { if (!sb->rect().contains(point)) @@ -590,7 +590,7 @@ WebStyle::scrollBarPointOver scrollBarMetrics(sb, sliderMin, sliderMax, sliderLength, buttonDim); - if (sb->orientation() == QScrollBar::Horizontal) + if (sb->orientation() == TQScrollBar::Horizontal) { int x = point.x(); @@ -631,7 +631,7 @@ WebStyle::scrollBarPointOver void WebStyle::scrollBarMetrics ( - const QScrollBar * sb, + const TQScrollBar * sb, int & sliderMin, int & sliderMax, int & sliderLength, @@ -640,7 +640,7 @@ WebStyle::scrollBarMetrics { int maxlen; - bool horizontal = sb->orientation() == QScrollBar::Horizontal; + bool horizontal = sb->orientation() == TQScrollBar::Horizontal; int len = (horizontal) ? sb->width() : sb->height(); @@ -674,18 +674,18 @@ WebStyle::scrollBarMetrics QSize WebStyle::indicatorSize() const { - return QSize(_indicatorSize, _indicatorSize); + return TQSize(_indicatorSize, _indicatorSize); } void WebStyle::drawIndicator ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, int state, bool down, bool enabled @@ -706,11 +706,11 @@ WebStyle::drawIndicator p->drawRect(x, y, w, h); - if (state != QButton::Off) + if (state != TQButton::Off) { p->fillRect(x + 2, y + 2, w - 4, h - 4, enabled ? g.highlight() : g.mid()); - if (state == QButton::NoChange) + if (state == TQButton::NoChange) { p->fillRect(x + 4, y + 4, w - 8, h - 8, g.background()); } @@ -722,18 +722,18 @@ WebStyle::drawIndicator QSize WebStyle::exclusiveIndicatorSize() const { - return QSize(_indicatorSize, _indicatorSize); + return TQSize(_indicatorSize, _indicatorSize); } void WebStyle::drawExclusiveIndicator ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool on, bool down, bool enabled @@ -752,7 +752,7 @@ WebStyle::drawExclusiveIndicator p->setPen(g.mid()); } - p->setBrush(g.brush(QColorGroup::Background)); + p->setBrush(g.brush(TQColorGroup::Background)); // Avoid misshapen ellipses. Qt or X bug ? Who knows... @@ -777,7 +777,7 @@ WebStyle::drawExclusiveIndicator void WebStyle::drawIndicatorMask ( - QPainter * p, + TQPainter * p, int x, int y, int w, @@ -791,7 +791,7 @@ WebStyle::drawIndicatorMask void WebStyle::drawExclusiveIndicatorMask ( - QPainter * p, + TQPainter * p, int x, int y, int w, @@ -813,22 +813,22 @@ WebStyle::drawExclusiveIndicatorMask void WebStyle::drawComboButton ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool sunken, bool editable, bool enabled, - const QBrush * fill + const TQBrush * fill ) { p->save(); p->setPen(NoPen); - p->setBrush(0 == fill ? g.brush(QColorGroup::Background) : *fill); + p->setBrush(0 == fill ? g.brush(TQColorGroup::Background) : *fill); p->drawRect(x, y, w, h); if (enabled) @@ -874,13 +874,13 @@ WebStyle::drawComboButton QRect WebStyle::comboButtonRect(int x, int y, int w, int h) { - return QRect(x + 2, y + 2, w - 20, h - 4); + return TQRect(x + 2, y + 2, w - 20, h - 4); } QRect WebStyle::comboButtonFocusRect(int x, int y, int w, int h) { - return QRect(x + 2, y + 2, w - 20, h - 4); + return TQRect(x + 2, y + 2, w - 20, h - 4); } int @@ -892,19 +892,19 @@ WebStyle::sliderLength() const void WebStyle::drawSliderGroove ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, QCOORD /* c */, Orientation o ) { p->save(); - p->setPen(QPen(g.dark(), 0, Qt::DotLine)); + p->setPen(TQPen(g.dark(), 0, Qt::DotLine)); if( o == Qt::Horizontal ) p->drawLine(x, y + h / 2, w, y + h / 2); @@ -918,16 +918,16 @@ WebStyle::drawSliderGroove void WebStyle::drawArrow ( - QPainter * p, + TQPainter * p, Qt::ArrowType type, bool down, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool enabled, - const QBrush * fill + const TQBrush * fill ) { KStyle::drawArrow(p, type, down, x, y, w, h, g, enabled, fill); @@ -936,12 +936,12 @@ WebStyle::drawArrow void WebStyle::drawSlider ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, Orientation o, bool /* tickAbove */, bool /* tickBelow */ @@ -967,14 +967,14 @@ WebStyle::drawSlider void WebStyle::drawKToolBar ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, KToolBarPos /* pos */, - QBrush * /* fill */ + TQBrush * /* fill */ ) { p->save(); @@ -987,14 +987,14 @@ WebStyle::drawKToolBar void WebStyle::drawKBarHandle ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, KToolBarPos /* pos */, - QBrush * /* fill */ + TQBrush * /* fill */ ) { p->save(); @@ -1007,14 +1007,14 @@ WebStyle::drawKBarHandle void WebStyle::drawKMenuBar ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool /* macMode */, - QBrush * /* fill */ + TQBrush * /* fill */ ) { p->save(); @@ -1027,36 +1027,36 @@ WebStyle::drawKMenuBar void WebStyle::drawKToolBarButton ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool sunken, bool raised, bool enabled, bool popup, KToolButtonType type, - const QString & btext, - const QPixmap * pixmap, - QFont * font, - QWidget * button + const TQString & btext, + const TQPixmap * pixmap, + TQFont * font, + TQWidget * button ) { bool toggleAndOn = false; - if (button->inherits("QButton")) + if (button->inherits("TQButton")) { - QButton * b = static_cast<QButton *>(button); + TQButton * b = static_cast<TQButton *>(button); toggleAndOn = b->isToggleButton() && b->isOn(); } p->save(); - QColor borderColour; - QColor textColour; - QColor fillColour; + TQColor borderColour; + TQColor textColour; + TQColor fillColour; if (!enabled) { @@ -1249,29 +1249,29 @@ WebStyle::drawKToolBarButton void WebStyle::drawKMenuItem ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool active, - QMenuItem * mi, - QBrush * /* fill */ + TQMenuItem * mi, + TQBrush * /* fill */ ) { p->save(); - QColor bg(active ? g.highlight() : g.background()); + TQColor bg(active ? g.highlight() : g.background()); p->fillRect(x, y, w, h, bg); - QColor textColour = + TQColor textColour = active ? contrastingForeground(g.highlightedText(), bg) : contrastingForeground(g.text(), bg); - QApplication::style().drawItem + TQApplication::style().drawItem ( p, x, @@ -1293,12 +1293,12 @@ WebStyle::drawKMenuItem void WebStyle::drawPopupMenuItem ( - QPainter * p, + TQPainter * p, bool checkable, int maxpmw, int tab, - QMenuItem * mi, - const QPalette & pal, + TQMenuItem * mi, + const TQPalette & pal, bool act, bool enabled, int x, @@ -1314,13 +1314,13 @@ WebStyle::drawPopupMenuItem void WebStyle::drawKProgressBlock ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, - QBrush * fill + const TQColorGroup & g, + TQBrush * fill ) { p->save(); @@ -1335,10 +1335,10 @@ WebStyle::drawKProgressBlock void WebStyle::drawFocusRect ( - QPainter * p, - const QRect & r, - const QColorGroup & g, - const QColor * pen, + TQPainter * p, + const TQRect & r, + const TQColorGroup & g, + const TQColor * pen, bool atBorder ) { @@ -1350,7 +1350,7 @@ WebStyle::drawFocusRect if (atBorder) { - p->drawRect(QRect(r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2)); + p->drawRect(TQRect(r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2)); } else { @@ -1363,15 +1363,15 @@ WebStyle::drawFocusRect void WebStyle::drawPanel ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool /* sunken */, int /* lineWidth */, - const QBrush * fill + const TQBrush * fill ) { p->save(); @@ -1388,14 +1388,14 @@ WebStyle::drawPanel void WebStyle::drawPopupPanel ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, int /* lineWidth */, - const QBrush * fill + const TQBrush * fill ) { p->save(); @@ -1412,12 +1412,12 @@ WebStyle::drawPopupPanel void WebStyle::drawSeparator ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool /* sunken */, int /* lineWidth */, int /* midLineWidth */ @@ -1442,25 +1442,25 @@ WebStyle::drawSeparator void WebStyle::drawTab ( - QPainter * p, - const QTabBar * tabBar, - QTab * tab, + TQPainter * p, + const TQTabBar * tabBar, + TQTab * tab, bool selected ) { - QRect r(tab->rect()); + TQRect r(tab->rect()); - QColorGroup g(tabBar->colorGroup()); + TQColorGroup g(tabBar->colorGroup()); p->save(); p->setPen(selected ? g.dark() : g.mid()); - p->fillRect(r, g.brush(QColorGroup::Background)); + p->fillRect(r, g.brush(TQColorGroup::Background)); switch (tabBar->shape()) { - case QTabBar::RoundedAbove: - case QTabBar::TriangularAbove: + case TQTabBar::RoundedAbove: + case TQTabBar::TriangularAbove: p->drawLine(r.left(), r.top(), r.left(), r.bottom()); p->drawLine(r.left(), r.top(), r.right(), r.top()); p->drawLine(r.right(), r.top(), r.right(), r.bottom()); @@ -1470,8 +1470,8 @@ WebStyle::drawTab p->drawLine(r.left(), r.bottom(), r.right(), r.bottom()); } break; - case QTabBar::RoundedBelow: - case QTabBar::TriangularBelow: + case TQTabBar::RoundedBelow: + case TQTabBar::TriangularBelow: if (!selected) { p->setPen(g.dark()); @@ -1489,9 +1489,9 @@ WebStyle::drawTab void WebStyle::drawTabMask ( - QPainter * p, - const QTabBar *, - QTab * tab, + TQPainter * p, + const TQTabBar *, + TQTab * tab, bool ) { @@ -1501,13 +1501,13 @@ WebStyle::drawTabMask void WebStyle::drawKickerHandle ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, - QBrush * fill + const TQColorGroup & g, + TQBrush * fill ) { p->save(); @@ -1524,13 +1524,13 @@ WebStyle::drawKickerHandle void WebStyle::drawKickerAppletHandle ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, - QBrush * fill + const TQColorGroup & g, + TQBrush * fill ) { p->save(); @@ -1547,21 +1547,21 @@ WebStyle::drawKickerAppletHandle void WebStyle::drawKickerTaskButton ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, - const QString & text, + const TQColorGroup & g, + const TQString & text, bool active, - QPixmap * icon, - QBrush * /* fill */ + TQPixmap * icon, + TQBrush * /* fill */ ) { p->save(); - QColor bg; + TQColor bg; if (active) { @@ -1588,7 +1588,7 @@ WebStyle::drawKickerTaskButton int textPos = pxWidth; - QRect br(buttonRect(x, y, w, h)); + TQRect br(buttonRect(x, y, w, h)); if ((0 != icon) && !icon->isNull()) { @@ -1598,10 +1598,10 @@ WebStyle::drawKickerTaskButton p->drawPixmap(br.x() + dx, dy, *icon); } - QString s(text); + TQString s(text); - static QString modStr = - QString::fromUtf8("[") + i18n("modified") + QString::fromUtf8("]"); + static TQString modStr = + TQString::fromUtf8("[") + i18n("modified") + TQString::fromUtf8("]"); int modStrPos = s.find(modStr); @@ -1610,7 +1610,7 @@ WebStyle::drawKickerTaskButton // +1 because we include a space after the closing brace. s.remove(modStrPos, modStr.length() + 1); - QPixmap modPixmap = SmallIcon("modified"); + TQPixmap modPixmap = SmallIcon("modified"); int dx = (pxWidth - modPixmap.width()) / 2; int dy = (h - modPixmap.height()) / 2; @@ -1659,7 +1659,7 @@ WebStyle::drawKickerTaskButton } int -WebStyle::popupMenuItemHeight(bool, QMenuItem * i, const QFontMetrics & fm) +WebStyle::popupMenuItemHeight(bool, TQMenuItem * i, const TQFontMetrics & fm) { if (i->isSeparator()) return 1; @@ -1675,7 +1675,7 @@ WebStyle::popupMenuItemHeight(bool, QMenuItem * i, const QFontMetrics & fm) { h = QMAX ( - i->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal).height(), + i->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height(), h ); } diff --git a/kstyles/web/webstyle.h b/kstyles/web/webstyle.h index b0a6a7a87..d2219076d 100644 --- a/kstyles/web/webstyle.h +++ b/kstyles/web/webstyle.h @@ -21,7 +21,7 @@ #define WEB_STYLE_H #include <kstyle.h> -#include <qpalette.h> +#include <tqpalette.h> class QPainter; class QScrollBar; @@ -36,96 +36,96 @@ class WebStyle : public KStyle ~WebStyle(); - void polish(QApplication *); + void polish(TQApplication *); - void unPolish(QWidget *); + void unPolish(TQWidget *); - void polish(QWidget *); + void polish(TQWidget *); - void polish(QPalette &); + void polish(TQPalette &); - void unPolish(QApplication *); + void unPolish(TQApplication *); void drawButton ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool sunken = false, - const QBrush * fill = 0 + const TQBrush * fill = 0 ); - QRect buttonRect(int x, int y, int w, int h); + TQRect buttonRect(int x, int y, int w, int h); void drawBevelButton ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, bool sunken = false, - const QBrush * fill = 0 + const TQBrush * fill = 0 ); - void drawPushButton(QPushButton *, QPainter *); + void drawPushButton(TQPushButton *, TQPainter *); - virtual void drawPushButtonLabel(QPushButton *, QPainter *); + virtual void drawPushButtonLabel(TQPushButton *, TQPainter *); void drawScrollBarControls ( - QPainter *, - const QScrollBar *, + TQPainter *, + const TQScrollBar *, int sliderStart, uint controls, uint activeControl ); - QStyle::ScrollControl scrollBarPointOver + TQStyle::ScrollControl scrollBarPointOver ( - const QScrollBar *, + const TQScrollBar *, int sliderStart, - const QPoint & + const TQPoint & ); void scrollBarMetrics ( - const QScrollBar *, + const TQScrollBar *, int & sliderMin, int & sliderMax, int & sliderLength, int & buttonDim ); - QSize indicatorSize() const; + TQSize indicatorSize() const; void drawIndicator ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, int state, bool down = false, bool enabled = true ); - QSize exclusiveIndicatorSize() const; + TQSize exclusiveIndicatorSize() const; void drawExclusiveIndicator ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, bool on, bool down = false, bool enabled = true @@ -133,7 +133,7 @@ class WebStyle : public KStyle void drawIndicatorMask ( - QPainter *, + TQPainter *, int x, int y, int w, @@ -143,7 +143,7 @@ class WebStyle : public KStyle void drawExclusiveIndicatorMask ( - QPainter *, + TQPainter *, int x, int y, int w, @@ -153,58 +153,58 @@ class WebStyle : public KStyle void drawComboButton ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, bool sunken = false, bool editable = false, bool enabled = true, - const QBrush * fill = 0 + const TQBrush * fill = 0 ); - QRect comboButtonRect(int x, int y, int w, int h); + TQRect comboButtonRect(int x, int y, int w, int h); - QRect comboButtonFocusRect(int x, int y, int w, int h); + TQRect comboButtonFocusRect(int x, int y, int w, int h); int sliderLength() const; void drawSliderGroove ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, QCOORD, Orientation ); void drawArrow ( - QPainter *, + TQPainter *, Qt::ArrowType, bool down, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, bool enabled = true, - const QBrush * fill = 0 + const TQBrush * fill = 0 ); void drawSlider ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, Orientation, bool tickAbove, bool tickBelow @@ -212,80 +212,80 @@ class WebStyle : public KStyle void drawKToolBar ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, KToolBarPos, - QBrush * fill = 0 + TQBrush * fill = 0 ); void drawKBarHandle ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, KToolBarPos, - QBrush * fill = 0 + TQBrush * fill = 0 ); void drawKMenuBar ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, bool macMode, - QBrush * fill = 0 + TQBrush * fill = 0 ); void drawKToolBarButton ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, + const TQColorGroup & g, bool sunken = false, bool raised = true, bool enabled = true, bool popup = false, KToolButtonType = Icon, - const QString & btext = QString::null, - const QPixmap * = 0, - QFont * = 0, - QWidget * button = 0 + const TQString & btext = TQString::null, + const TQPixmap * = 0, + TQFont * = 0, + TQWidget * button = 0 ); void drawKMenuItem ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, bool active, - QMenuItem *, - QBrush * fill = 0 + TQMenuItem *, + TQBrush * fill = 0 ); void drawPopupMenuItem ( - QPainter *, + TQPainter *, bool checkable, int maxpmw, int tab, - QMenuItem *, - const QPalette &, + TQMenuItem *, + const TQPalette &, bool act, bool enabled, int x, @@ -296,57 +296,57 @@ class WebStyle : public KStyle void drawKProgressBlock ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, - QBrush * fill + const TQColorGroup &, + TQBrush * fill ); void drawFocusRect ( - QPainter *, - const QRect &, - const QColorGroup &, - const QColor * pen, + TQPainter *, + const TQRect &, + const TQColorGroup &, + const TQColor * pen, bool atBorder ); void drawPanel ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, bool sunken, int lineWidth = 1, - const QBrush * = 0 + const TQBrush * = 0 ); void drawPopupPanel ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, int lineWidth = 2, - const QBrush * = 0 + const TQBrush * = 0 ); void drawSeparator ( - QPainter *, + TQPainter *, int x, int y, int w, int h, - const QColorGroup &, + const TQColorGroup &, bool sunken = true, int lineWidth = 1, int midLineWidth = 0 @@ -354,61 +354,61 @@ class WebStyle : public KStyle void drawTab ( - QPainter * p, - const QTabBar * tabBar, - QTab * tab, + TQPainter * p, + const TQTabBar * tabBar, + TQTab * tab, bool selected ); void drawTabMask ( - QPainter * p, - const QTabBar *, - QTab * tab, + TQPainter * p, + const TQTabBar *, + TQTab * tab, bool ); void drawKickerHandle ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, - QBrush * + const TQColorGroup & g, + TQBrush * ); void drawKickerAppletHandle ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, - QBrush * + const TQColorGroup & g, + TQBrush * ); void drawKickerTaskButton ( - QPainter * p, + TQPainter * p, int x, int y, int w, int h, - const QColorGroup & g, - const QString & title, + const TQColorGroup & g, + const TQString & title, bool active, - QPixmap * icon, - QBrush * + TQPixmap * icon, + TQBrush * ); - int popupMenuItemHeight(bool, QMenuItem *, const QFontMetrics &); + int popupMenuItemHeight(bool, TQMenuItem *, const TQFontMetrics &); GUIStyle guiStyle() const { return Qt::MotifStyle; } - bool eventFilter(QObject *, QEvent *); + bool eventFilter(TQObject *, TQEvent *); }; #endif |