diff options
Diffstat (limited to 'kicker/libkicker')
-rw-r--r-- | kicker/libkicker/appletinfo.cpp | 12 | ||||
-rw-r--r-- | kicker/libkicker/appletinfo.h | 50 | ||||
-rw-r--r-- | kicker/libkicker/global.cpp | 108 | ||||
-rw-r--r-- | kicker/libkicker/global.h | 28 | ||||
-rw-r--r-- | kicker/libkicker/kickertip.cpp | 110 | ||||
-rw-r--r-- | kicker/libkicker/kickertip.h | 48 | ||||
-rw-r--r-- | kicker/libkicker/kshadowengine.cpp | 40 | ||||
-rw-r--r-- | kicker/libkicker/kshadowengine.h | 18 | ||||
-rw-r--r-- | kicker/libkicker/kshadowsettings.cpp | 10 | ||||
-rw-r--r-- | kicker/libkicker/kshadowsettings.h | 12 | ||||
-rw-r--r-- | kicker/libkicker/menuinfo.cpp | 16 | ||||
-rw-r--r-- | kicker/libkicker/menuinfo.h | 18 | ||||
-rw-r--r-- | kicker/libkicker/panelbutton.cpp | 250 | ||||
-rw-r--r-- | kicker/libkicker/panelbutton.h | 110 | ||||
-rw-r--r-- | kicker/libkicker/paneldrag.cpp | 52 | ||||
-rw-r--r-- | kicker/libkicker/paneldrag.h | 22 | ||||
-rw-r--r-- | kicker/libkicker/panner.cpp | 118 | ||||
-rw-r--r-- | kicker/libkicker/panner.h | 48 | ||||
-rw-r--r-- | kicker/libkicker/simplebutton.cpp | 84 | ||||
-rw-r--r-- | kicker/libkicker/simplebutton.h | 38 |
20 files changed, 596 insertions, 596 deletions
diff --git a/kicker/libkicker/appletinfo.cpp b/kicker/libkicker/appletinfo.cpp index cfb626fac..b0d36ba61 100644 --- a/kicker/libkicker/appletinfo.cpp +++ b/kicker/libkicker/appletinfo.cpp @@ -21,18 +21,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include <qfileinfo.h> +#include <tqfileinfo.h> #include <kdesktopfile.h> #include <kapplication.h> #include "appletinfo.h" -AppletInfo::AppletInfo( const QString& deskFile, const QString& configFile, const AppletInfo::AppletType type) +AppletInfo::AppletInfo( const TQString& deskFile, const TQString& configFile, const AppletInfo::AppletType type) : m_type (type), m_unique(true), m_hidden(false) { - QFileInfo fi(deskFile); + TQFileInfo fi(deskFile); m_desktopFile = fi.fileName(); const char* resource = "applets"; @@ -98,15 +98,15 @@ bool AppletInfo::operator!=( const AppletInfo& rhs) const bool AppletInfo::operator<( const AppletInfo& rhs ) const { - return ( QString::localeAwareCompare( name(), rhs.name() ) < 0 ); + return ( TQString::localeAwareCompare( name(), rhs.name() ) < 0 ); } bool AppletInfo::operator> ( const AppletInfo& rhs ) const { - return ( QString::localeAwareCompare( name(), rhs.name() ) > 0 ); + return ( TQString::localeAwareCompare( name(), rhs.name() ) > 0 ); } bool AppletInfo::operator<= ( const AppletInfo& rhs ) const { - return ( QString::localeAwareCompare( name(), rhs.name() ) <= 0 ); + return ( TQString::localeAwareCompare( name(), rhs.name() ) <= 0 ); } diff --git a/kicker/libkicker/appletinfo.h b/kicker/libkicker/appletinfo.h index b9ab187ba..f89bb6aea 100644 --- a/kicker/libkicker/appletinfo.h +++ b/kicker/libkicker/appletinfo.h @@ -24,18 +24,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __appletinfo_h__ #define __appletinfo_h__ -#include <qmap.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qvaluevector.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqvaluevector.h> #include <kdemacros.h> class KDE_EXPORT AppletInfo { public: - typedef QValueVector<AppletInfo> List; - typedef QMap<QObject*, AppletInfo*> Dict; + typedef TQValueVector<AppletInfo> List; + typedef TQMap<TQObject*, AppletInfo*> Dict; enum AppletType { Undefined = 0, Applet = 1, @@ -44,24 +44,24 @@ class KDE_EXPORT AppletInfo Extension = 8, Button = BuiltinButton | SpecialButton }; - AppletInfo(const QString& desktopFile = QString::null, - const QString& configFile = QString::null, + AppletInfo(const TQString& desktopFile = TQString::null, + const TQString& configFile = TQString::null, const AppletType type = Undefined); - QString name() const { return m_name; } - QString comment() const { return m_comment; } - QString icon() const { return m_icon; } + TQString name() const { return m_name; } + TQString comment() const { return m_comment; } + TQString icon() const { return m_icon; } AppletType type() const { return m_type; } - QString library() const { return m_lib; } - QString desktopFile() const { return m_desktopFile; } - QString configFile() const { return m_configFile; } + TQString library() const { return m_lib; } + TQString desktopFile() const { return m_desktopFile; } + TQString configFile() const { return m_configFile; } bool isUniqueApplet() const { return m_unique; } bool isHidden() const { return m_hidden; } - void setConfigFile(QString cf) { m_configFile = cf; } + void setConfigFile(TQString cf) { m_configFile = cf; } bool operator<(const AppletInfo& rhs) const; bool operator>(const AppletInfo& rhs) const; @@ -71,19 +71,19 @@ class KDE_EXPORT AppletInfo void setType(AppletType type) { m_type = type; } protected: - void setName(QString name) { m_name = name; } - void setComment(QString comment) { m_comment = comment; } - void setIcon(QString icon) { m_icon = icon; } - void setLibrary(QString lib) { m_lib = lib; } + void setName(TQString name) { m_name = name; } + void setComment(TQString comment) { m_comment = comment; } + void setIcon(TQString icon) { m_icon = icon; } + void setLibrary(TQString lib) { m_lib = lib; } void setIsUnique(bool u) { m_unique = u; } private: - QString m_name; - QString m_comment; - QString m_icon; - QString m_lib; - QString m_desktopFile; - QString m_configFile; + TQString m_name; + TQString m_comment; + TQString m_icon; + TQString m_lib; + TQString m_desktopFile; + TQString m_configFile; AppletType m_type; bool m_unique; bool m_hidden; diff --git a/kicker/libkicker/global.cpp b/kicker/libkicker/global.cpp index a0915bcd1..1e9025e5a 100644 --- a/kicker/libkicker/global.cpp +++ b/kicker/libkicker/global.cpp @@ -21,12 +21,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include <qapplication.h> -#include <qbitmap.h> -#include <qfile.h> -#include <qpopupmenu.h> -#include <qregexp.h> -#include <qpainter.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqfile.h> +#include <tqpopupmenu.h> +#include <tqregexp.h> +#include <tqpainter.h> #include <kiconeffect.h> #include <kiconloader.h> @@ -161,53 +161,53 @@ int maxButtonDim() int maxDim; //return (2 * KickerSettings::iconMargin()) + KIcon::SizeLarge; - KSimpleConfig *kickerconfig = new KSimpleConfig( QString::fromLatin1( "kickerrc" )); + KSimpleConfig *kickerconfig = new KSimpleConfig( TQString::fromLatin1( "kickerrc" )); kickerconfig->setGroup("General"); maxDim = (2 * KickerSettings::iconMargin()) + kickerconfig->readNumEntry("panelIconWidth", KIcon::SizeLarge);; delete kickerconfig; return maxDim; } -QString newDesktopFile(const KURL& url) +TQString newDesktopFile(const KURL& url) { - QString base = url.fileName(); + TQString base = url.fileName(); if (base.endsWith(".desktop")) base.truncate(base.length()-8); - QRegExp r("(.*)(?=-\\d+)"); + TQRegExp r("(.*)(?=-\\d+)"); if (r.search(base) > -1) base = r.cap(1); - QString file = base + ".desktop"; + TQString file = base + ".desktop"; for(int n = 1; ++n; ) { - QString path = locate("appdata", file); + TQString path = locate("appdata", file); if (path.isEmpty()) break; - file = QString("%2-%1.desktop").arg(n).arg(base); + file = TQString("%2-%1.desktop").arg(n).arg(base); } file = locateLocal("appdata", file); return file; } -QString copyDesktopFile(const KURL& url) +TQString copyDesktopFile(const KURL& url) { - QString file = newDesktopFile(url); + TQString file = newDesktopFile(url); KURL dest; dest.setPath(file); KIO::NetAccess::upload(url.path(), dest, 0); return file; } -QPopupMenu* reduceMenu(QPopupMenu *menu) +TQPopupMenu* reduceMenu(TQPopupMenu *menu) { if (menu->count() != 1) { return menu; } - QMenuItem *item = menu->findItem(menu->idAt(0)); + TQMenuItem *item = menu->findItem(menu->idAt(0)); if (item->popup()) { @@ -217,20 +217,20 @@ QPopupMenu* reduceMenu(QPopupMenu *menu) return menu; } -QPoint popupPosition(KPanelApplet::Direction d, - const QWidget* popup, - const QWidget* source, - const QPoint& offset) +TQPoint popupPosition(KPanelApplet::Direction d, + const TQWidget* popup, + const TQWidget* source, + const TQPoint& offset) { - QRect r; + TQRect r; if (source->isTopLevel()) { r = source->geometry(); } else { - r = QRect(source->mapToGlobal(QPoint(0, 0)), - source->mapToGlobal(QPoint(source->width(), source->height()))); + r = TQRect(source->mapToGlobal(TQPoint(0, 0)), + source->mapToGlobal(TQPoint(source->width(), source->height()))); switch (d) { @@ -252,8 +252,8 @@ QPoint popupPosition(KPanelApplet::Direction d, case KPanelApplet::Left: case KPanelApplet::Right: { - QDesktopWidget* desktop = QApplication::desktop(); - QRect screen = desktop->screenGeometry(desktop->screenNumber(const_cast<QWidget*>(source))); + TQDesktopWidget* desktop = TQApplication::desktop(); + TQRect screen = desktop->screenGeometry(desktop->screenNumber(const_cast<TQWidget*>(source))); int x = (d == KPanelApplet::Left) ? r.left() - popup->width() : r.right() + 1; int y = r.top() + offset.y(); @@ -274,7 +274,7 @@ QPoint popupPosition(KPanelApplet::Direction d, } } - return QPoint(x, y); + return TQPoint(x, y); } case KPanelApplet::Up: case KPanelApplet::Down: @@ -284,7 +284,7 @@ QPoint popupPosition(KPanelApplet::Direction d, int y = (d == KPanelApplet::Up) ? r.top() - popup->height() : r.bottom() + 1; - if (QApplication::reverseLayout()) + if (TQApplication::reverseLayout()) { x = r.right() - popup->width() + 1; @@ -299,12 +299,12 @@ QPoint popupPosition(KPanelApplet::Direction d, x = r.left(); } - return QPoint(x, y); + return TQPoint(x, y); } else { - QDesktopWidget* desktop = QApplication::desktop(); - QRect screen = desktop->screenGeometry(desktop->screenNumber(const_cast<QWidget*>(source))); + TQDesktopWidget* desktop = TQApplication::desktop(); + TQRect screen = desktop->screenGeometry(desktop->screenNumber(const_cast<TQWidget*>(source))); x = r.left() + offset.x(); // try to keep this on the screen @@ -319,24 +319,24 @@ QPoint popupPosition(KPanelApplet::Direction d, } } - return QPoint(x, y); + return TQPoint(x, y); } } } -void colorize(QImage& image) +void colorize(TQImage& image) { KConfig *config = KGlobal::config(); config->setGroup("WM"); - QColor color = QApplication::palette().active().highlight(); - QColor activeTitle = config->readColorEntry("activeBackground", &color); - QColor inactiveTitle = config->readColorEntry("inactiveBackground", &color); + TQColor color = TQApplication::palette().active().highlight(); + TQColor activeTitle = config->readColorEntry("activeBackground", &color); + TQColor inactiveTitle = config->readColorEntry("inactiveBackground", &color); // figure out which color is most suitable for recoloring to int h1, s1, v1, h2, s2, v2, h3, s3, v3; activeTitle.hsv(&h1, &s1, &v1); inactiveTitle.hsv(&h2, &s2, &v2); - QApplication::palette().active().background().hsv(&h3, &s3, &v3); + TQApplication::palette().active().background().hsv(&h3, &s3, &v3); if ( (kAbs(h1-h3)+kAbs(s1-s3)+kAbs(v1-v3) < kAbs(h2-h3)+kAbs(s2-s3)+kAbs(v2-v3)) && ((kAbs(h1-h3)+kAbs(s1-s3)+kAbs(v1-v3) < 32) || (s1 < 32)) && (s2 > s1)) @@ -361,7 +361,7 @@ void colorize(QImage& image) KIconEffect::colorize(image, color, 1.0); } -QColor blendColors(const QColor& c1, const QColor& c2) +TQColor blendColors(const TQColor& c1, const TQColor& c2) { int r1, g1, b1; int r2, g2, b2; @@ -373,10 +373,10 @@ QColor blendColors(const QColor& c1, const QColor& c2) g1 += (int) (.5 * (g2 - g1)); b1 += (int) (.5 * (b2 - b1)); - return QColor(r1, g1, b1); + return TQColor(r1, g1, b1); } -QColor shadowColor(const QColor& c) +TQColor shadowColor(const TQColor& c) { int r = c.red(); int g = c.green(); @@ -397,12 +397,12 @@ QColor shadowColor(const QColor& c) else b = 0; - return QColor( r, g, b ); + return TQColor( r, g, b ); } -QIconSet menuIconSet(const QString& icon) +TQIconSet menuIconSet(const TQString& icon) { - QIconSet iconset; + TQIconSet iconset; int iconSize = KickerSettings::menuEntryHeight(); if (iconSize < 0) @@ -420,14 +420,14 @@ QIconSet menuIconSet(const QString& icon) } else if (iconSize == 0) { - QPixmap normal = KGlobal::iconLoader()->loadIcon(icon, + TQPixmap normal = KGlobal::iconLoader()->loadIcon(icon, KIcon::Small, 0, KIcon::DefaultState, 0, true); - QPixmap active = KGlobal::iconLoader()->loadIcon(icon, + TQPixmap active = KGlobal::iconLoader()->loadIcon(icon, KIcon::Small, 0, KIcon::ActiveState, @@ -445,31 +445,31 @@ QIconSet menuIconSet(const QString& icon) active.convertFromImage(active.convertToImage().smoothScale(20,20)); } - iconset.setPixmap(normal, QIconSet::Small, QIconSet::Normal); - iconset.setPixmap(active, QIconSet::Small, QIconSet::Active); + iconset.setPixmap(normal, TQIconSet::Small, TQIconSet::Normal); + iconset.setPixmap(active, TQIconSet::Small, TQIconSet::Active); } } if (iconset.isNull()) { - QPixmap pix(iconSize, iconSize); - QBitmap map(iconSize, iconSize, true); + TQPixmap pix(iconSize, iconSize); + TQBitmap map(iconSize, iconSize, true); pix.setMask(map); - iconset = QIconSet(pix, pix); + iconset = TQIconSet(pix, pix); } return iconset; } -void drawBlendedRect(QPainter *p, const QRect &r, const QColor &color, int alpha) +void drawBlendedRect(TQPainter *p, const TQRect &r, const TQColor &color, int alpha) { - static QPixmap pix; - static QColor last_color = Qt::black; + static TQPixmap pix; + static TQColor last_color = Qt::black; static int last_alpha = 0; if (pix.isNull() || last_color != color || last_alpha != alpha) { - QImage img(16, 16, 32); + TQImage img(16, 16, 32); img.setAlphaBuffer(false); img.fill(((uint)(alpha & 0xFF) << 24) | (color.rgb() & 0xFFFFFF)); img.setAlphaBuffer(true); diff --git a/kicker/libkicker/global.h b/kicker/libkicker/global.h index 2b9449584..0a4677914 100644 --- a/kicker/libkicker/global.h +++ b/kicker/libkicker/global.h @@ -24,8 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __pglobal_h__ #define __pglobal_h__ -#include <qiconset.h> -#include <qmap.h> +#include <tqiconset.h> +#include <tqmap.h> #include <kpanelapplet.h> #include <kpanelextension.h> @@ -52,23 +52,23 @@ KDE_EXPORT int maxButtonDim(); * Tint the image to reflect the current color scheme * Used, for instance, by KMenu side bar */ -KDE_EXPORT void colorize(QImage& image); +KDE_EXPORT void colorize(TQImage& image); /** * Blend a color rectangle on a painter */ -KDE_EXPORT void drawBlendedRect(QPainter *p, const QRect &r, const QColor &color = Qt::black, int alpha = 0x40); +KDE_EXPORT void drawBlendedRect(TQPainter *p, const TQRect &r, const TQColor &color = Qt::black, int alpha = 0x40); /** * Blend two colours together to get a colour halfway in between */ -KDE_EXPORT QColor blendColors(const QColor& c1, const QColor& c2); +KDE_EXPORT TQColor blendColors(const TQColor& c1, const TQColor& c2); /** * Create or copy .desktop files for use in kicker safely and easily */ -KDE_EXPORT QString copyDesktopFile(const KURL&url); -KDE_EXPORT QString newDesktopFile(const KURL&url); +KDE_EXPORT TQString copyDesktopFile(const KURL&url); +KDE_EXPORT TQString newDesktopFile(const KURL&url); /** @@ -80,7 +80,7 @@ KDE_EXPORT QString newDesktopFile(const KURL&url); * This function checks whether that is the case and returns either the * original menu or the sub-menu when appropriate. */ -KDE_EXPORT QPopupMenu *reduceMenu(QPopupMenu *); +KDE_EXPORT TQPopupMenu *reduceMenu(TQPopupMenu *); /** @@ -88,16 +88,16 @@ KDE_EXPORT QPopupMenu *reduceMenu(QPopupMenu *); * direction, the size of the menu, the widget geometry, and a optional * point in the local coordinates of the widget. */ -KDE_EXPORT QPoint popupPosition(KPanelApplet::Direction d, - const QWidget* popup, - const QWidget* source, - const QPoint& offset = QPoint(0, 0)); +KDE_EXPORT TQPoint popupPosition(KPanelApplet::Direction d, + const TQWidget* popup, + const TQWidget* source, + const TQPoint& offset = TQPoint(0, 0)); /** * Calculate an acceptable inverse of the given color wich will be used * as the shadow color. */ -KDE_EXPORT QColor shadowColor(const QColor& c); +KDE_EXPORT TQColor shadowColor(const TQColor& c); /** * Get an appropriate for a menu in Plasma. As the user may set this size @@ -105,7 +105,7 @@ KDE_EXPORT QColor shadowColor(const QColor& c); * @param icon the name of icon requested * @return the icon set for the requested icon */ -KDE_EXPORT QIconSet menuIconSet(const QString& icon); +KDE_EXPORT TQIconSet menuIconSet(const TQString& icon); } diff --git a/kicker/libkicker/kickertip.cpp b/kicker/libkicker/kickertip.cpp index 403641443..34cf65c56 100644 --- a/kicker/libkicker/kickertip.cpp +++ b/kicker/libkicker/kickertip.cpp @@ -23,11 +23,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include <qapplication.h> -#include <qpainter.h> -#include <qsimplerichtext.h> -#include <qtimer.h> -#include <qtooltip.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqsimplerichtext.h> +#include <tqtimer.h> +#include <tqtooltip.h> #include <kdialog.h> @@ -46,7 +46,7 @@ int KickerTip::m_tippingEnabled = 1; void KickerTip::Client::updateKickerTip() const { - if (KickerTip::the()->isTippingFor(dynamic_cast<const QWidget*>(this)) && + if (KickerTip::the()->isTippingFor(dynamic_cast<const TQWidget*>(this)) && KickerTip::the()->isVisible()) { KickerTip::the()->display(); @@ -63,8 +63,8 @@ KickerTip* KickerTip::the() return m_self; } -KickerTip::KickerTip(QWidget * parent) - : QWidget(parent, "animtt",WX11BypassWM), +KickerTip::KickerTip(TQWidget * parent) + : TQWidget(parent, "animtt",WX11BypassWM), m_richText(0), m_mimeFactory(0), m_dissolveSize(0), @@ -78,7 +78,7 @@ KickerTip::KickerTip(QWidget * parent) setBackgroundMode(NoBackground); resize(0, 0); hide(); - connect(&m_frameTimer, SIGNAL(timeout()), SLOT(internalUpdate())); + connect(&m_frameTimer, TQT_SIGNAL(timeout()), TQT_SLOT(internalUpdate())); } KickerTip::~KickerTip() @@ -104,7 +104,7 @@ void KickerTip::display() } } - QWidget *widget = const_cast<QWidget*>(m_tippingFor); + TQWidget *widget = const_cast<TQWidget*>(m_tippingFor); KickerTip::Client *client = dynamic_cast<KickerTip::Client*>(widget); if (!client) @@ -116,7 +116,7 @@ void KickerTip::display() // richtext area are freed but the mimefactory is ready to be added to in // the call to updateKickerTip delete m_mimeFactory; - m_mimeFactory = new QMimeSourceFactory(); + m_mimeFactory = new TQMimeSourceFactory(); // Declare interchange object and define defaults. Data data; @@ -136,8 +136,8 @@ void KickerTip::display() } delete m_richText; - m_richText = new QSimpleRichText("<qt><h3>" + data.message + "</h3><p>" + - data.subtext + "</p></qt>", font(), QString::null, 0, + m_richText = new TQSimpleRichText("<qt><h3>" + data.message + "</h3><p>" + + data.subtext + "</p></qt>", font(), TQString::null, 0, m_mimeFactory); m_richText->setWidth(640); m_direction = data.direction; @@ -148,7 +148,7 @@ void KickerTip::display() } else if (KickerSettings::mouseOversShowText()) { - m_icon = QPixmap(); + m_icon = TQPixmap(); } else { @@ -167,8 +167,8 @@ void KickerTip::display() // close the message window after given mS if (data.duration > 0) { - disconnect(&m_timer, SIGNAL(timeout()), 0, 0); - connect(&m_timer, SIGNAL(timeout()), SLOT(hide())); + disconnect(&m_timer, TQT_SIGNAL(timeout()), 0, 0); + connect(&m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(hide())); m_timer.start(data.duration, true); } else @@ -180,7 +180,7 @@ void KickerTip::display() show(); } -void KickerTip::paintEvent(QPaintEvent * e) +void KickerTip::paintEvent(TQPaintEvent * e) { if (m_dirty) { @@ -188,23 +188,23 @@ void KickerTip::paintEvent(QPaintEvent * e) m_dirty = false; } - QPainter p(this); + TQPainter p(this); p.drawPixmap(e->rect().topLeft(), m_pixmap, e->rect()); } -void KickerTip::mousePressEvent(QMouseEvent * /*e*/) +void KickerTip::mousePressEvent(TQMouseEvent * /*e*/) { - QToolTip::setGloballyEnabled(m_toolTipsEnabled); + TQToolTip::setGloballyEnabled(m_toolTipsEnabled); hide(); } -static void drawRoundRect(QPainter &p, const QRect &r) +static void drawRoundRect(TQPainter &p, const TQRect &r) { static int line[8] = { 1, 3, 4, 5, 6, 7, 7, 8 }; static int border[8] = { 1, 2, 1, 1, 1, 1, 1, 1 }; int xl, xr, y1, y2; - QPen pen = p.pen(); - bool drawBorder = pen.style() != QPen::NoPen; + TQPen pen = p.pen(); + bool drawBorder = pen.style() != TQPen::NoPen; if (r.width() < 16 || r.height() < 16) { @@ -272,7 +272,7 @@ static void drawRoundRect(QPainter &p, const QRect &r) void KickerTip::plainMask() { - QPainter maskPainter(&m_mask); + TQPainter maskPainter(&m_mask); m_mask.fill(Qt::black); @@ -286,7 +286,7 @@ void KickerTip::plainMask() void KickerTip::dissolveMask() { - QPainter maskPainter(&m_mask); + TQPainter maskPainter(&m_mask); m_mask.fill(Qt::black); @@ -339,7 +339,7 @@ void KickerTip::displayInternal() } // determine text rectangle - QRect textRect(0, 0, 0, 0); + TQRect textRect(0, 0, 0, 0); if (KickerSettings::mouseOversShowText()) { textRect.setWidth(m_richText->widthUsed()); @@ -382,11 +382,11 @@ void KickerTip::displayInternal() } // draw background - QPainter bufferPainter(&m_pixmap); + TQPainter bufferPainter(&m_pixmap); bufferPainter.setPen(colorGroup().foreground()); bufferPainter.setBrush(colorGroup().background()); //bufferPainter.drawRoundRect(0, 0, width, height, 1600 / width, 1600 / height); - drawRoundRect(bufferPainter, QRect(0, 0, width, height)); + drawRoundRect(bufferPainter, TQRect(0, 0, width, height)); // draw icon if present if (!m_icon.isNull()) @@ -400,10 +400,10 @@ void KickerTip::displayInternal() if (KickerSettings::mouseOversShowText()) { // draw text shadow - QColorGroup cg = colorGroup(); - cg.setColor(QColorGroup::Text, cg.background().dark(115)); - int shadowOffset = QApplication::reverseLayout() ? -1 : 1; - m_richText->draw(&bufferPainter, textX + shadowOffset, textY + 1, QRect(), cg); + TQColorGroup cg = colorGroup(); + cg.setColor(TQColorGroup::Text, cg.background().dark(115)); + int shadowOffset = TQApplication::reverseLayout() ? -1 : 1; + m_richText->draw(&bufferPainter, textX + shadowOffset, textY + 1, TQRect(), cg); // draw text cg = colorGroup(); @@ -411,39 +411,39 @@ void KickerTip::displayInternal() } } -void KickerTip::tipFor(const QWidget* w) +void KickerTip::tipFor(const TQWidget* w) { if (m_tippingFor) { - disconnect(m_tippingFor, SIGNAL(destroyed(QObject*)), - this, SLOT(tipperDestroyed(QObject*))); + disconnect(m_tippingFor, TQT_SIGNAL(destroyed(TQObject*)), + this, TQT_SLOT(tipperDestroyed(TQObject*))); } m_tippingFor = w; if (m_tippingFor) { - connect(m_tippingFor, SIGNAL(destroyed(QObject*)), - this, SLOT(tipperDestroyed(QObject*))); + connect(m_tippingFor, TQT_SIGNAL(destroyed(TQObject*)), + this, TQT_SLOT(tipperDestroyed(TQObject*))); } } -void KickerTip::untipFor(const QWidget* w) +void KickerTip::untipFor(const TQWidget* w) { if (isTippingFor(w)) hide(); } -bool KickerTip::isTippingFor(const QWidget* w) const +bool KickerTip::isTippingFor(const TQWidget* w) const { return m_tippingFor == w; } -void KickerTip::tipperDestroyed(QObject* o) +void KickerTip::tipperDestroyed(TQObject* o) { // we can't do a dynamic cast because we are in the process of dieing // so static it is. - untipFor(static_cast<QWidget*>(o)); + untipFor(static_cast<TQWidget*>(o)); } void KickerTip::internalUpdate() @@ -479,10 +479,10 @@ void KickerTip::hide() tipFor(0); m_timer.stop(); m_frameTimer.stop(); - QWidget::hide(); + TQWidget::hide(); } -bool KickerTip::eventFilter(QObject *object, QEvent *event) +bool KickerTip::eventFilter(TQObject *object, TQEvent *event) { if (!tippingEnabled()) { @@ -494,11 +494,11 @@ bool KickerTip::eventFilter(QObject *object, QEvent *event) return false; } - QWidget *widget = static_cast<QWidget*>(object); + TQWidget *widget = static_cast<TQWidget*>(object); switch (event->type()) { - case QEvent::Enter: + case TQEvent::Enter: if (!KickerSettings::showMouseOverEffects()) { return false; @@ -508,13 +508,13 @@ bool KickerTip::eventFilter(QObject *object, QEvent *event) !qApp->activePopupWidget() && !isTippingFor(widget)) { - m_toolTipsEnabled = QToolTip::isGloballyEnabled(); - QToolTip::setGloballyEnabled(false); + m_toolTipsEnabled = TQToolTip::isGloballyEnabled(); + TQToolTip::setGloballyEnabled(false); tipFor(widget); m_timer.stop(); - disconnect(&m_timer, SIGNAL(timeout()), 0, 0); - connect(&m_timer, SIGNAL(timeout()), SLOT(display())); + disconnect(&m_timer, TQT_SIGNAL(timeout()), 0, 0); + connect(&m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(display())); // delay to avoid false starts // e.g. when the user quickly zooms their mouse over @@ -529,22 +529,22 @@ bool KickerTip::eventFilter(QObject *object, QEvent *event) } } break; - case QEvent::Leave: - QToolTip::setGloballyEnabled(m_toolTipsEnabled); + case TQEvent::Leave: + TQToolTip::setGloballyEnabled(m_toolTipsEnabled); m_timer.stop(); if (isTippingFor(widget) && isVisible()) { - disconnect(&m_timer, SIGNAL(timeout()), 0, 0); - connect(&m_timer, SIGNAL(timeout()), SLOT(hide())); + disconnect(&m_timer, TQT_SIGNAL(timeout()), 0, 0); + connect(&m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(hide())); m_timer.start(KickerSettings::mouseOversHideDelay(), true); } tipFor(0); break; - case QEvent::MouseButtonPress: - QToolTip::setGloballyEnabled(m_toolTipsEnabled); + case TQEvent::MouseButtonPress: + TQToolTip::setGloballyEnabled(m_toolTipsEnabled); hide(); default: break; diff --git a/kicker/libkicker/kickertip.h b/kicker/libkicker/kickertip.h index 7211012fb..e51fae4ac 100644 --- a/kicker/libkicker/kickertip.h +++ b/kicker/libkicker/kickertip.h @@ -26,10 +26,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef KICKER_TIP_H #define KICKER_TIP_H -#include <qbitmap.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qwidget.h> +#include <tqbitmap.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqwidget.h> #include <kpanelapplet.h> @@ -47,15 +47,15 @@ public: struct Data { - QString message; - QString subtext; - QPixmap icon; + TQString message; + TQString subtext; + TQPixmap icon; KickerTip::MaskEffect maskEffect; int duration; KPanelApplet::Direction direction; // do NOT delete this in the client! - QMimeSourceFactory* mimeFactory; + TQMimeSourceFactory* mimeFactory; }; class KDE_EXPORT Client @@ -69,15 +69,15 @@ public: static void enableTipping(bool tip); static bool tippingEnabled(); - void untipFor(const QWidget* w); - bool eventFilter(QObject *o, QEvent *e); + void untipFor(const TQWidget* w); + bool eventFilter(TQObject *o, TQEvent *e); protected: - KickerTip(QWidget * parent); + KickerTip(TQWidget * parent); ~KickerTip(); - void paintEvent(QPaintEvent * e); - void mousePressEvent(QMouseEvent * e); + void paintEvent(TQPaintEvent * e); + void mousePressEvent(TQMouseEvent * e); void plainMask(); void dissolveMask(); @@ -85,32 +85,32 @@ protected: void displayInternal(); void hide(); - void tipFor(const QWidget* w); - bool isTippingFor(const QWidget* w) const; + void tipFor(const TQWidget* w); + bool isTippingFor(const TQWidget* w) const; protected slots: - void tipperDestroyed(QObject* o); + void tipperDestroyed(TQObject* o); void internalUpdate(); void display(); private: - QBitmap m_mask; - QPixmap m_pixmap; - QPixmap m_icon; + TQBitmap m_mask; + TQPixmap m_pixmap; + TQPixmap m_icon; MaskEffect m_maskEffect; - QSimpleRichText* m_richText; - QMimeSourceFactory* m_mimeFactory; + TQSimpleRichText* m_richText; + TQMimeSourceFactory* m_mimeFactory; int m_dissolveSize; int m_dissolveDelta; KPanelApplet::Direction m_direction; - QTimer m_timer; - QTimer m_frameTimer; + TQTimer m_timer; + TQTimer m_frameTimer; bool m_dirty; bool m_toolTipsEnabled; - const QWidget* m_tippingFor; + const TQWidget* m_tippingFor; static KickerTip* m_self; static int m_tippingEnabled; diff --git a/kicker/libkicker/kshadowengine.cpp b/kicker/libkicker/kshadowengine.cpp index 32008883e..19ccc669d 100644 --- a/kicker/libkicker/kshadowengine.cpp +++ b/kicker/libkicker/kshadowengine.cpp @@ -21,10 +21,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qcolor.h> -#include <qpainter.h> -#include <qbitmap.h> -#include <qpixmap.h> +#include <tqcolor.h> +#include <tqpainter.h> +#include <tqbitmap.h> +#include <tqpixmap.h> #include "kshadowsettings.h" #include "kshadowengine.h" @@ -58,9 +58,9 @@ KShadowSettings *KShadowEngine::shadowSettings() return m_shadowSettings; } -QImage KShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColor) +TQImage KShadowEngine::makeShadow(const TQPixmap& textPixmap, const TQColor &bgColor) { - QImage result; + TQImage result; // create a new image for for the shaddow int w = textPixmap.width(); @@ -78,7 +78,7 @@ QImage KShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColo /* * This is the source pixmap */ - QImage img = textPixmap.convertToImage().convertDepth(32); + TQImage img = textPixmap.convertToImage().convertDepth(32); /* * Resize the image if necessary @@ -125,7 +125,7 @@ QImage KShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColo // Multiplication factor for pixels diagonal to the text #define DIAGONAL_FACTOR 1.0 -double KShadowEngine::defaultDecay(QImage& source, int i, int j) +double KShadowEngine::defaultDecay(TQImage& source, int i, int j) { if ((i < 1) || (j < 1) || (i > source.width() - 2) || (j > source.height() - 2)) return 0; @@ -144,19 +144,19 @@ double KShadowEngine::defaultDecay(QImage& source, int i, int j) return alphaShadow; } -double KShadowEngine::doubleLinearDecay(QImage& source, int i, int j) +double KShadowEngine::doubleLinearDecay(TQImage& source, int i, int j) { //printf("img: %p, %d %d\n", (char *) &source, i, j); return defaultDecay( source, i, j ); // for now } -double KShadowEngine::radialDecay(QImage& source, int i, int j) +double KShadowEngine::radialDecay(TQImage& source, int i, int j) { //printf("img: %p, %d %d\n", (char *) &source, i, j); return defaultDecay( source, i, j ); // for now } -double KShadowEngine::noDecay(QImage& source, int i, int j) +double KShadowEngine::noDecay(TQImage& source, int i, int j) { // create a new image for for the shaddow int w = source.width(); @@ -210,28 +210,28 @@ KTextShadowEngine::KTextShadowEngine() : KShadowEngine() } // taken from mtaskbar, by Sebastian Wolff -void KTextShadowEngine::drawText(QPainter &p, const QRect &tr, int tf, const QString &str, const QSize &size) +void KTextShadowEngine::drawText(TQPainter &p, const TQRect &tr, int tf, const TQString &str, const TQSize &size) { // get the color of the shadow: white for dark text, black for bright text - QPen textPen = p.pen(); - QColor shadCol = textPen.color(); + TQPen textPen = p.pen(); + TQColor shadCol = textPen.color(); if (shadCol.red() + shadCol.green() + shadCol.blue() <= 3*256/2-1) { - shadCol = QColor(255,255,255); + shadCol = TQColor(255,255,255); } else { - shadCol = QColor(0,0,0); + shadCol = TQColor(0,0,0); } // get a transparent pixmap - QPainter pixPainter; - QPixmap textPixmap(size); + TQPainter pixPainter; + TQPixmap textPixmap(size); - textPixmap.fill(QColor(0,0,0)); + textPixmap.fill(TQColor(0,0,0)); textPixmap.setMask(textPixmap.createHeuristicMask(true)); // draw text @@ -242,7 +242,7 @@ void KTextShadowEngine::drawText(QPainter &p, const QRect &tr, int tf, const QSt pixPainter.end(); // draw shadow - QImage img = makeShadow(textPixmap, shadCol); + TQImage img = makeShadow(textPixmap, shadCol); // return p.drawImage(0, 0, img); diff --git a/kicker/libkicker/kshadowengine.h b/kicker/libkicker/kshadowengine.h index 0fc4877fa..041e8faf6 100644 --- a/kicker/libkicker/kshadowengine.h +++ b/kicker/libkicker/kshadowengine.h @@ -24,9 +24,9 @@ #ifndef __FX_SHADOW #define __FX_SHADOW -#include <qpixmap.h> -#include <qimage.h> -#include <qcolor.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqcolor.h> #include <kdemacros.h> @@ -79,7 +79,7 @@ public: * @param bgColor the background color * @return the resulting image */ - QImage makeShadow(const QPixmap& textPixmap, const QColor &bgColor); + TQImage makeShadow(const TQPixmap& textPixmap, const TQColor &bgColor); private: // No static objects in libs, and no static deleters in kdefx... @@ -90,24 +90,24 @@ private: /* * a simple algorithm with 3 pixels thickness */ - double defaultDecay(QImage& source, int x, int y); + double defaultDecay(TQImage& source, int x, int y); /* * a slower algorithm where the influence of a pixel * is qGray(px)/(abs(dx) + abs(dy) +1). */ - double doubleLinearDecay(QImage& source, int x, int y); + double doubleLinearDecay(TQImage& source, int x, int y); /* * a very slow algorithm where the influence of a pixel * is qGray(px)/(sqrt(sqr(dx) + sqr(dy)) +1). */ - double radialDecay(QImage& source, int x, int y); + double radialDecay(TQImage& source, int x, int y); /* * a nice/fast algorithm proposed by Bernardo Hung */ - double noDecay(QImage& source, int x, int y); + double noDecay(TQImage& source, int x, int y); void *d; }; @@ -117,7 +117,7 @@ class KDE_EXPORT KTextShadowEngine : public KShadowEngine public: KTextShadowEngine(); - void drawText(QPainter &p, const QRect &tr, int tf, const QString &str, const QSize &size); + void drawText(TQPainter &p, const TQRect &tr, int tf, const TQString &str, const TQSize &size); }; #endif diff --git a/kicker/libkicker/kshadowsettings.cpp b/kicker/libkicker/kshadowsettings.cpp index 9c935d30f..4d6bce5c3 100644 --- a/kicker/libkicker/kshadowsettings.cpp +++ b/kicker/libkicker/kshadowsettings.cpp @@ -19,8 +19,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include "kshadowsettings.h" KShadowSettings::KShadowSettings() @@ -30,7 +30,7 @@ KShadowSettings::KShadowSettings() } // load/save methods -void KShadowSettings::fromString(const QString &val) +void KShadowSettings::fromString(const TQString &val) { setOffsetX(val.section(',', OFFSET_X, OFFSET_X).toInt()); setOffsetY(val.section(',', OFFSET_Y, OFFSET_Y).toInt()); @@ -41,9 +41,9 @@ void KShadowSettings::fromString(const QString &val) setSelectionType((SelectionType)val.section(',', SELECTION_TYPE, SELECTION_TYPE).toInt()); } -QString KShadowSettings::toString() const +TQString KShadowSettings::toString() const { - QString result; + TQString result; result.sprintf("%d,%d,%f,%f,%d,%d,%d", offsetX(), offsetY(), diff --git a/kicker/libkicker/kshadowsettings.h b/kicker/libkicker/kshadowsettings.h index 9a91f1c15..e222b964d 100644 --- a/kicker/libkicker/kshadowsettings.h +++ b/kicker/libkicker/kshadowsettings.h @@ -24,12 +24,12 @@ #include <kdemacros.h> -#define SHADOW_CONFIG_ENTRY QString("ShadowParameters") -#define SHADOW_TEXT_COLOR QString("ShadowTextColor") -#define SHADOW_TEXT_BACKGROUND QString("ShadowTextBackground") +#define SHADOW_CONFIG_ENTRY TQString("ShadowParameters") +#define SHADOW_TEXT_COLOR TQString("ShadowTextColor") +#define SHADOW_TEXT_BACKGROUND TQString("ShadowTextBackground") // fallback configuration string -#define DEFAULT_SHADOW_CONFIGURATION QString("0,0,4.0,120.0,2,1,1,0,0,0") +#define DEFAULT_SHADOW_CONFIGURATION TQString("0,0,4.0,120.0,2,1,1,0,0,0") /** * This class is the implementation of a structure for the @@ -92,13 +92,13 @@ class KDE_EXPORT KShadowSettings * @param the string to load from (comma-separated values) * @see ConfigurationOrder */ - virtual void fromString(const QString &s); + virtual void fromString(const TQString &s); /** * Saves the configuration to a string. * @return the configuration (comma-separated values) * @see ConfigurationOrder */ - virtual QString toString() const; + virtual TQString toString() const; // get methods /** diff --git a/kicker/libkicker/menuinfo.cpp b/kicker/libkicker/menuinfo.cpp index 740d44d95..0c36ffea0 100644 --- a/kicker/libkicker/menuinfo.cpp +++ b/kicker/libkicker/menuinfo.cpp @@ -23,8 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "menuinfo.h" -#include <qfile.h> -#include <qwidget.h> +#include <tqfile.h> +#include <tqwidget.h> #include <kapplication.h> #include <ksimpleconfig.h> @@ -33,15 +33,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <kpanelmenu.h> #include <kparts/componentfactory.h> -MenuInfo::MenuInfo(const QString& desktopFile) +MenuInfo::MenuInfo(const TQString& desktopFile) { - KSimpleConfig df(locate("data", QString::fromLatin1("kicker/menuext/%1").arg(desktopFile))); + KSimpleConfig df(locate("data", TQString::fromLatin1("kicker/menuext/%1").arg(desktopFile))); df.setGroup("Desktop Entry"); - QStringList list = df.readListEntry("X-KDE-AuthorizeAction"); + TQStringList list = df.readListEntry("X-KDE-AuthorizeAction"); if (kapp && !list.isEmpty()) { - for(QStringList::ConstIterator it = list.begin(); + for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { @@ -57,12 +57,12 @@ MenuInfo::MenuInfo(const QString& desktopFile) desktopfile_ = desktopFile; } -KPanelMenu* MenuInfo::load(QWidget *parent, const char *name) +KPanelMenu* MenuInfo::load(TQWidget *parent, const char *name) { if (library_.isEmpty()) return 0; return KParts::ComponentFactory::createInstanceFromLibrary<KPanelMenu>( - QFile::encodeName( library_ ), + TQFile::encodeName( library_ ), parent, name ); } diff --git a/kicker/libkicker/menuinfo.h b/kicker/libkicker/menuinfo.h index 0d324538e..4a2074830 100644 --- a/kicker/libkicker/menuinfo.h +++ b/kicker/libkicker/menuinfo.h @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _menuinfo_h_ #define _menuinfo_h_ -#include <qstring.h> +#include <tqstring.h> #include <kdemacros.h> @@ -34,19 +34,19 @@ class QWidget; class KDE_EXPORT MenuInfo { public: - MenuInfo(const QString& desktopFile); + MenuInfo(const TQString& desktopFile); - QString name() const { return name_; } - QString comment() const { return comment_; } - QString icon() const { return icon_; } - QString library() const { return library_; } - QString desktopFile() const { return desktopfile_; } + TQString name() const { return name_; } + TQString comment() const { return comment_; } + TQString icon() const { return icon_; } + TQString library() const { return library_; } + TQString desktopFile() const { return desktopfile_; } bool isValid() const { return !name_.isEmpty(); } - KPanelMenu* load(QWidget *parent = 0, const char *name = 0); + KPanelMenu* load(TQWidget *parent = 0, const char *name = 0); private: - QString name_, comment_, icon_, library_, desktopfile_; + TQString name_, comment_, icon_, library_, desktopfile_; }; #endif diff --git a/kicker/libkicker/panelbutton.cpp b/kicker/libkicker/panelbutton.cpp index 407a78ca6..972e5195e 100644 --- a/kicker/libkicker/panelbutton.cpp +++ b/kicker/libkicker/panelbutton.cpp @@ -21,15 +21,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include <qcursor.h> -#include <qfile.h> -#include <qfontmetrics.h> -#include <qpainter.h> -#include <qpopupmenu.h> -#include <qstyle.h> -#include <qstylesheet.h> -#include <qtooltip.h> -#include <qpixmap.h> +#include <tqcursor.h> +#include <tqfile.h> +#include <tqfontmetrics.h> +#include <tqpainter.h> +#include <tqpopupmenu.h> +#include <tqstyle.h> +#include <tqstylesheet.h> +#include <tqtooltip.h> +#include <tqpixmap.h> #include <kapplication.h> #include <kconfig.h> @@ -57,8 +57,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // init static variable KShadowEngine* PanelButton::s_textShadowEngine = 0L; -PanelButton::PanelButton( QWidget* parent, const char* name ) - : QButton(parent, name), +PanelButton::PanelButton( TQWidget* parent, const char* name ) + : TQButton(parent, name), m_valid(true), m_isLeftMouseButtonDown(false), m_drawArrow(false), @@ -85,41 +85,41 @@ PanelButton::PanelButton( QWidget* parent, const char* name ) installEventFilter(KickerTip::the()); - connect(kapp, SIGNAL(settingsChanged(int)), SLOT(updateSettings(int))); - connect(kapp, SIGNAL(iconChanged(int)), SLOT(updateIcon(int))); + connect(kapp, TQT_SIGNAL(settingsChanged(int)), TQT_SLOT(updateSettings(int))); + connect(kapp, TQT_SIGNAL(iconChanged(int)), TQT_SLOT(updateIcon(int))); } void PanelButton::configure() { - QString name = tileName(); + TQString name = tileName(); if( name.isEmpty() ) return; if (!KickerSettings::enableTileBackground()) { - setTile(QString::null); + setTile(TQString::null); return; } KConfigGroup tilesGroup( KGlobal::config(), "button_tiles" ); if( !tilesGroup.readBoolEntry( "Enable" + name + "Tiles", true ) ) { - setTile( QString::null ); + setTile( TQString::null ); return; } - QString tile = tilesGroup.readEntry( name + "Tile" ); - QColor color = QColor(); + TQString tile = tilesGroup.readEntry( name + "Tile" ); + TQColor color = TQColor(); if (tile == "Colorize") { color = tilesGroup.readColorEntry( name + "TileColor" ); - tile = QString::null; + tile = TQString::null; } setTile( tile, color ); } -void PanelButton::setTile(const QString& tile, const QColor& color) +void PanelButton::setTile(const TQString& tile, const TQColor& color) { if (tile == m_tile && m_tileColor == color) { @@ -143,11 +143,11 @@ void PanelButton::setDrawArrow(bool drawArrow) update(); } -QImage PanelButton::loadTile(const QString& tile, - const QSize& size, - const QString& state) +TQImage PanelButton::loadTile(const TQString& tile, + const TQSize& size, + const TQString& state) { - QString name = tile; + TQString name = tile; if (size.height() < 42) { @@ -164,7 +164,7 @@ QImage PanelButton::loadTile(const QString& tile, name += state + ".png"; - QImage tileImg(KGlobal::dirs()->findResource("tiles", name)); + TQImage tileImg(KGlobal::dirs()->findResource("tiles", name)); // scale if size does not match exactly if (!tileImg.isNull() && tileImg.size() != size) @@ -177,7 +177,7 @@ QImage PanelButton::loadTile(const QString& tile, void PanelButton::setEnabled(bool enable) { - QButton::setEnabled(enable); + TQButton::setEnabled(enable); loadIcons(); update(); } @@ -223,18 +223,18 @@ void PanelButton::updateSettings(int category) } } -void PanelButton::checkForDeletion(const QString& path) +void PanelButton::checkForDeletion(const TQString& path) { if (path == m_backingFile) { setEnabled(false); - QTimer::singleShot(1000, this, SLOT(scheduleForRemoval())); + TQTimer::singleShot(1000, this, TQT_SLOT(scheduleForRemoval())); } } bool PanelButton::checkForBackingFile() { - return QFile::exists(m_backingFile); + return TQFile::exists(m_backingFile); } void PanelButton::scheduleForRemoval() @@ -261,7 +261,7 @@ void PanelButton::scheduleForRemoval() } timelapse *= 2; - QTimer::singleShot(timelapse, this, SLOT(scheduleForRemoval())); + TQTimer::singleShot(timelapse, this, TQT_SLOT(scheduleForRemoval())); } } @@ -290,9 +290,9 @@ int PanelButton::widthForHeight(int height) const // before adding the text in here if (orientation() == Horizontal && !m_buttonText.isEmpty()) { - QFont f(font()); + TQFont f(font()); //f.setPixelSize(KMIN(height, KMAX(int(float(height) * m_fontPercent), 16))); - QFontMetrics fm(f); + TQFontMetrics fm(f); //rc += fm.width(m_buttonText) + KMIN(25, KMAX(5, fm.width('m') / 2)); rc += fm.width(m_buttonText); @@ -306,12 +306,12 @@ int PanelButton::heightForWidth(int width) const return preferredDimension(width); } -const QPixmap& PanelButton::labelIcon() const +const TQPixmap& PanelButton::labelIcon() const { return m_highlight ? m_iconh : m_icon; } -const QPixmap& PanelButton::zoomIcon() const +const TQPixmap& PanelButton::zoomIcon() const { return m_iconz; } @@ -321,12 +321,12 @@ bool PanelButton::isValid() const return m_valid; } -void PanelButton::setTitle(const QString& t) +void PanelButton::setTitle(const TQString& t) { m_title = t; } -void PanelButton::setIcon(const QString& icon) +void PanelButton::setIcon(const TQString& icon) { if (icon == m_iconName) { @@ -339,7 +339,7 @@ void PanelButton::setIcon(const QString& icon) emit iconChanged(); } -QString PanelButton::icon() const +TQString PanelButton::icon() const { return m_iconName; } @@ -349,23 +349,23 @@ bool PanelButton::hasText() const return !m_buttonText.isEmpty(); } -void PanelButton::setButtonText(const QString& text) +void PanelButton::setButtonText(const TQString& text) { m_buttonText = " " + text; update(); } -QString PanelButton::buttonText() const +TQString PanelButton::buttonText() const { return m_buttonText; } -void PanelButton::setTextColor(const QColor& c) +void PanelButton::setTextColor(const TQColor& c) { m_textColor = c; } -QColor PanelButton::textColor() const +TQColor PanelButton::textColor() const { return m_textColor; } @@ -390,12 +390,12 @@ KPanelApplet::Direction PanelButton::popupDirection() const return m_popupDirection; } -QPoint PanelButton::center() const +TQPoint PanelButton::center() const { return mapToGlobal(rect().center()); } -QString PanelButton::title() const +TQString PanelButton::title() const { return m_title; } @@ -412,7 +412,7 @@ void PanelButton::startDrag() emit dragme(m_icon); } -void PanelButton::enterEvent(QEvent* e) +void PanelButton::enterEvent(TQEvent* e) { if (!m_highlight) { @@ -420,10 +420,10 @@ void PanelButton::enterEvent(QEvent* e) repaint(false); } - QButton::enterEvent(e); + TQButton::enterEvent(e); } -void PanelButton::leaveEvent(QEvent* e) +void PanelButton::leaveEvent(TQEvent* e) { if (m_highlight) { @@ -431,10 +431,10 @@ void PanelButton::leaveEvent(QEvent* e) repaint(false); } - QButton::leaveEvent(e); + TQButton::leaveEvent(e); } -void PanelButton::dragEnterEvent(QDragEnterEvent* e) +void PanelButton::dragEnterEvent(TQDragEnterEvent* e) { if (e->isAccepted()) { @@ -442,31 +442,31 @@ void PanelButton::dragEnterEvent(QDragEnterEvent* e) } update(); - QButton::dragEnterEvent( e ); + TQButton::dragEnterEvent( e ); } -void PanelButton::dragLeaveEvent(QDragLeaveEvent* e) +void PanelButton::dragLeaveEvent(TQDragLeaveEvent* e) { m_hasAcceptedDrag = false; update(); - QButton::dragLeaveEvent( e ); + TQButton::dragLeaveEvent( e ); } -void PanelButton::dropEvent(QDropEvent* e) +void PanelButton::dropEvent(TQDropEvent* e) { m_hasAcceptedDrag = false; update(); - QButton::dropEvent( e ); + TQButton::dropEvent( e ); } -void PanelButton::mouseMoveEvent(QMouseEvent *e) +void PanelButton::mouseMoveEvent(TQMouseEvent *e) { if (!m_isLeftMouseButtonDown || (e->state() & LeftButton) == 0) { return; } - QPoint p(e->pos() - m_lastLeftMouseButtonPress); + TQPoint p(e->pos() - m_lastLeftMouseButtonPress); if (p.manhattanLength() <= 16) { // KGlobalSettings::dndEventDelay() is not enough! @@ -477,29 +477,29 @@ void PanelButton::mouseMoveEvent(QMouseEvent *e) triggerDrag(); } -void PanelButton::mousePressEvent(QMouseEvent *e) +void PanelButton::mousePressEvent(TQMouseEvent *e) { if (e->button() == LeftButton) { m_lastLeftMouseButtonPress = e->pos(); m_isLeftMouseButtonDown = true; } - QButton::mousePressEvent(e); + TQButton::mousePressEvent(e); } -void PanelButton::mouseReleaseEvent(QMouseEvent *e) +void PanelButton::mouseReleaseEvent(TQMouseEvent *e) { if (e->button() == LeftButton) { m_isLeftMouseButtonDown = false; - QPixmap pix = labelIcon(); + TQPixmap pix = labelIcon(); KIconEffect::visualActivate(this, this->geometry(), &pix); } - QButton::mouseReleaseEvent(e); + TQButton::mouseReleaseEvent(e); } -void PanelButton::resizeEvent(QResizeEvent*) +void PanelButton::resizeEvent(TQResizeEvent*) { loadTiles(); @@ -509,20 +509,20 @@ void PanelButton::resizeEvent(QResizeEvent*) } } -void PanelButton::drawButton(QPainter *p) +void PanelButton::drawButton(TQPainter *p) { - const QPixmap& tile = (isDown() || isOn()) ? m_down : m_up; + const TQPixmap& tile = (isDown() || isOn()) ? m_down : m_up; if (m_tileColor.isValid()) { p->fillRect(rect(), m_tileColor); - style().drawPrimitive(QStyle::PE_Panel, p, rect(), colorGroup()); + style().drawPrimitive(TQStyle::PE_Panel, p, rect(), colorGroup()); } else if (paletteBackgroundPixmap()) { // Draw the background. This is always needed, even when using tiles, // because they don't have to cover the entire button. - QPoint offset = backgroundOffset(); + TQPoint offset = backgroundOffset(); int ox = offset.x(); int oy = offset.y(); p->drawTiledPixmap( 0, 0, width(), height(),*paletteBackgroundPixmap(), ox, oy); @@ -536,7 +536,7 @@ void PanelButton::drawButton(QPainter *p) else if (isDown() || isOn()) { // Draw shapes to indicate the down state. - style().drawPrimitive(QStyle::PE_Panel, p, rect(), colorGroup(), QStyle::Style_Sunken); + style().drawPrimitive(TQStyle::PE_Panel, p, rect(), colorGroup(), TQStyle::Style_Sunken); } drawButtonLabel(p); @@ -545,15 +545,15 @@ void PanelButton::drawButton(QPainter *p) { int x1, y1, x2, y2; rect().coords(&x1, &y1, &x2, &y2); - QRect r(x1+2, y1+2, x2-x1-3, y2-y1-3); - style().drawPrimitive(QStyle::PE_FocusRect, p, r, colorGroup(), - QStyle::Style_Default, colorGroup().button()); + TQRect r(x1+2, y1+2, x2-x1-3, y2-y1-3); + style().drawPrimitive(TQStyle::PE_FocusRect, p, r, colorGroup(), + TQStyle::Style_Default, colorGroup().button()); } } -void PanelButton::drawButtonLabel(QPainter *p) +void PanelButton::drawButtonLabel(TQPainter *p) { - QPixmap icon = labelIcon(); + TQPixmap icon = labelIcon(); bool active = isDown() || isOn(); if (active) @@ -568,7 +568,7 @@ void PanelButton::drawButtonLabel(QPainter *p) int w = width(); int y = (h - icon.height())/2; p->save(); - QFont f = font(); + TQFont f = font(); double fontPercent = m_fontPercent; if (active) @@ -576,12 +576,12 @@ void PanelButton::drawButtonLabel(QPainter *p) fontPercent *= .8; } //f.setPixelSize(KMIN(h, KMAX(int(float(h) * m_fontPercent), 16))); - QFontMetrics fm(f); + TQFontMetrics fm(f); p->setFont(f); /* Draw shadowed text */ - bool reverse = QApplication::reverseLayout(); - QPainter::TextDirection rtl = reverse ? QPainter::RTL : QPainter::LTR; + bool reverse = TQApplication::reverseLayout(); + TQPainter::TextDirection rtl = reverse ? TQPainter::RTL : TQPainter::LTR; if (!reverse && !icon.isNull()) { @@ -592,13 +592,13 @@ void PanelButton::drawButtonLabel(QPainter *p) int tX = reverse ? 3 : icon.width() + KMIN(25, KMAX(5, fm.width('m') / 2)); int tY = fm.ascent() + ((h - fm.height()) / 2); - QColor shadCol = KickerLib::shadowColor(m_textColor); + TQColor shadCol = KickerLib::shadowColor(m_textColor); // get a transparent pixmap - QPainter pixPainter; - QPixmap textPixmap(w, h); + TQPainter pixPainter; + TQPixmap textPixmap(w, h); - textPixmap.fill(QColor(0,0,0)); + textPixmap.fill(TQColor(0,0,0)); textPixmap.setMask(textPixmap.createHeuristicMask(true)); // draw text @@ -619,7 +619,7 @@ void PanelButton::drawButtonLabel(QPainter *p) } // draw shadow - QImage img = s_textShadowEngine->makeShadow(textPixmap, shadCol); + TQImage img = s_textShadowEngine->makeShadow(textPixmap, shadCol); p->drawImage(0, 0, img); p->save(); p->setPen(m_textColor); @@ -642,50 +642,50 @@ void PanelButton::drawButtonLabel(QPainter *p) if (m_drawArrow && (m_highlight || active)) { - QStyle::PrimitiveElement e = QStyle::PE_ArrowUp; - int arrowSize = style().pixelMetric(QStyle::PM_MenuButtonIndicator); - QRect r((width() - arrowSize)/2, 0, arrowSize, arrowSize); + TQStyle::PrimitiveElement e = TQStyle::PE_ArrowUp; + int arrowSize = style().pixelMetric(TQStyle::PM_MenuButtonIndicator); + TQRect r((width() - arrowSize)/2, 0, arrowSize, arrowSize); switch (m_arrowDirection) { case KPanelExtension::Top: - e = QStyle::PE_ArrowUp; + e = TQStyle::PE_ArrowUp; break; case KPanelExtension::Bottom: - e = QStyle::PE_ArrowDown; + e = TQStyle::PE_ArrowDown; r.moveBy(0, height() - arrowSize); break; case KPanelExtension::Right: - e = QStyle::PE_ArrowRight; - r = QRect(width() - arrowSize, (height() - arrowSize)/2, arrowSize, arrowSize); + e = TQStyle::PE_ArrowRight; + r = TQRect(width() - arrowSize, (height() - arrowSize)/2, arrowSize, arrowSize); break; case KPanelExtension::Left: - e = QStyle::PE_ArrowLeft; - r = QRect(0, (height() - arrowSize)/2, arrowSize, arrowSize); + e = TQStyle::PE_ArrowLeft; + r = TQRect(0, (height() - arrowSize)/2, arrowSize, arrowSize); break; case KPanelExtension::Floating: if (orientation() == Horizontal) { - e = QStyle::PE_ArrowDown; + e = TQStyle::PE_ArrowDown; r.moveBy(0, height() - arrowSize); } - else if (QApplication::reverseLayout()) + else if (TQApplication::reverseLayout()) { - e = QStyle::PE_ArrowLeft; - r = QRect(0, (height() - arrowSize)/2, arrowSize, arrowSize); + e = TQStyle::PE_ArrowLeft; + r = TQRect(0, (height() - arrowSize)/2, arrowSize, arrowSize); } else { - e = QStyle::PE_ArrowRight; - r = QRect(width() - arrowSize, (height() - arrowSize)/2, arrowSize, arrowSize); + e = TQStyle::PE_ArrowRight; + r = TQRect(width() - arrowSize, (height() - arrowSize)/2, arrowSize, arrowSize); } break; } - int flags = QStyle::Style_Enabled; + int flags = TQStyle::Style_Enabled; if (active) { - flags |= QStyle::Style_Down; + flags |= TQStyle::Style_Down; } style().drawPrimitive(e, p, r, colorGroup(), flags); } @@ -704,7 +704,7 @@ int PanelButton::preferredIconSize(int proposed_size) const return -1; // unknown icon size } - QValueList<int> sizes = ith->querySizes(KIcon::Panel); + TQValueList<int> sizes = ith->querySizes(KIcon::Panel); int sz = ith->defaultSize(KIcon::Panel); @@ -723,7 +723,7 @@ int PanelButton::preferredIconSize(int proposed_size) const } //kdDebug()<<endl<<endl<<flush; - QValueListConstIterator<int> i = sizes.constBegin(); + TQValueListConstIterator<int> i = sizes.constBegin(); while (i != sizes.constEnd()) { if ((*i) + (2 * KickerSettings::iconMargin()) > upperLimit) @@ -738,7 +738,7 @@ int PanelButton::preferredIconSize(int proposed_size) const return sz; } -void PanelButton::backedByFile(const QString& localFilePath) +void PanelButton::backedByFile(const TQString& localFilePath) { m_backingFile = localFilePath; @@ -748,16 +748,16 @@ void PanelButton::backedByFile(const QString& localFilePath) } // avoid multiple connections - disconnect(KDirWatch::self(), SIGNAL(deleted(const QString&)), - this, SLOT(checkForDeletion(const QString&))); + disconnect(KDirWatch::self(), TQT_SIGNAL(deleted(const TQString&)), + this, TQT_SLOT(checkForDeletion(const TQString&))); if (!KDirWatch::self()->contains(m_backingFile)) { KDirWatch::self()->addFile(m_backingFile); } - connect(KDirWatch::self(), SIGNAL(deleted(const QString&)), - this, SLOT(checkForDeletion(const QString&))); + connect(KDirWatch::self(), TQT_SIGNAL(deleted(const TQString&)), + this, TQT_SLOT(checkForDeletion(const TQString&))); } @@ -775,27 +775,27 @@ void PanelButton::loadTiles() if (m_tileColor.isValid()) { setBackgroundOrigin(WidgetOrigin); - m_up = m_down = QPixmap(); + m_up = m_down = TQPixmap(); } else if (m_tile.isNull()) { setBackgroundOrigin(AncestorOrigin); - m_up = m_down = QPixmap(); + m_up = m_down = TQPixmap(); } else { setBackgroundOrigin(WidgetOrigin); // If only the tiles were named a bit smarter we wouldn't have // to pass the up or down argument. - m_up = QPixmap(loadTile(m_tile, size(), "up")); - m_down = QPixmap(loadTile(m_tile, size(), "down")); + m_up = TQPixmap(loadTile(m_tile, size(), "up")); + m_down = TQPixmap(loadTile(m_tile, size(), "down")); } } void PanelButton::loadIcons() { KIconLoader * ldr = KGlobal::iconLoader(); - QString nm = m_iconName; + TQString nm = m_iconName; KIcon::States defaultState = isEnabled() ? KIcon::DefaultState : KIcon::DisabledState; m_icon = ldr->loadIcon(nm, KIcon::Panel, m_size, defaultState, 0L, true); @@ -844,8 +844,8 @@ bool PanelButton::calculateIconSize() void PanelButton::updateKickerTip(KickerTip::Data& data) { - data.message = QStyleSheet::escape(title()); - data.subtext = QStyleSheet::escape(QToolTip::textFor(this)); + data.message = TQStyleSheet::escape(title()); + data.subtext = TQStyleSheet::escape(TQToolTip::textFor(this)); data.icon = zoomIcon(); data.direction = popupDirection(); } @@ -854,21 +854,21 @@ void PanelButton::updateKickerTip(KickerTip::Data& data) // PanelPopupButton class // -PanelPopupButton::PanelPopupButton(QWidget *parent, const char *name) +PanelPopupButton::PanelPopupButton(TQWidget *parent, const char *name) : PanelButton(parent, name), m_popup(0), m_pressedDuringPopup(false), m_initialized(false) { - connect(this, SIGNAL(pressed()), SLOT(slotExecMenu())); + connect(this, TQT_SIGNAL(pressed()), TQT_SLOT(slotExecMenu())); } -void PanelPopupButton::setPopup(QPopupMenu *popup) +void PanelPopupButton::setPopup(TQPopupMenu *popup) { if (m_popup) { m_popup->removeEventFilter(this); - disconnect(m_popup, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); + disconnect(m_popup, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(menuAboutToHide())); } m_popup = popup; @@ -877,20 +877,20 @@ void PanelPopupButton::setPopup(QPopupMenu *popup) if (m_popup) { m_popup->installEventFilter(this); - connect(m_popup, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); + connect(m_popup, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(menuAboutToHide())); } } -QPopupMenu *PanelPopupButton::popup() const +TQPopupMenu *PanelPopupButton::popup() const { return m_popup; } -bool PanelPopupButton::eventFilter(QObject *, QEvent *e) +bool PanelPopupButton::eventFilter(TQObject *, TQEvent *e) { - if (e->type() == QEvent::MouseMove) + if (e->type() == TQEvent::MouseMove) { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); if (rect().contains(mapFromGlobal(me->globalPos())) && ((me->state() & ControlButton) != 0 || (me->state() & ShiftButton) != 0)) @@ -899,19 +899,19 @@ bool PanelPopupButton::eventFilter(QObject *, QEvent *e) return true; } } - else if (e->type() == QEvent::MouseButtonPress || - e->type() == QEvent::MouseButtonDblClick) + else if (e->type() == TQEvent::MouseButtonPress || + e->type() == TQEvent::MouseButtonDblClick) { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); if (rect().contains(mapFromGlobal(me->globalPos()))) { m_pressedDuringPopup = true; return true; } } - else if (e->type() == QEvent::MouseButtonRelease) + else if (e->type() == TQEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); if (rect().contains(mapFromGlobal(me->globalPos()))) { if (m_pressedDuringPopup && m_popup) diff --git a/kicker/libkicker/panelbutton.h b/kicker/libkicker/panelbutton.h index f71865c77..5a7b6d197 100644 --- a/kicker/libkicker/panelbutton.h +++ b/kicker/libkicker/panelbutton.h @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <algorithm> -#include <qbutton.h> +#include <tqbutton.h> #include <kpanelapplet.h> #include <kpanelextension.h> @@ -40,10 +40,10 @@ class KShadowEngine; /** * PanelButton is the base class for all buttons to be - * placed in Kicker's panels. It inherits QButton, and + * placed in Kicker's panels. It inherits TQButton, and * KickerTip::Client. */ -class KDE_EXPORT PanelButton: public QButton, public KickerTip::Client +class KDE_EXPORT PanelButton: public TQButton, public KickerTip::Client { Q_OBJECT @@ -53,7 +53,7 @@ public: * @param parent the parent widget * @param name the widget's name */ - PanelButton( QWidget* parent, const char* name ); + PanelButton( TQWidget* parent, const char* name ); /** * Configures this button according to the user's preferences for @@ -90,12 +90,12 @@ public: /** * @return the button's current icon */ - virtual const QPixmap& labelIcon() const; + virtual const TQPixmap& labelIcon() const; /** * @return the button's zoom icon */ - virtual const QPixmap& zoomIcon() const; + virtual const TQPixmap& zoomIcon() const; /** * @return true if this button is valid. @@ -106,12 +106,12 @@ public: * Changes the title for the panel button. * @param t the button's title */ - void setTitle(const QString& t); + void setTitle(const TQString& t); /** * @return the title of the button. */ - QString title() const; + TQString title() const; /** * Changes the name of the panel button's tile, with @@ -119,7 +119,7 @@ public: * @param tile the button's tile name * @param color the button's tile color */ - void setTile(const QString& tile, const QColor& color = QColor()); + void setTile(const TQString& tile, const TQColor& color = TQColor()); /** * Set to true to draw an arrow on the button. @@ -130,12 +130,12 @@ public: * Used to set the icon for this panel button. * @param icon the path to the button's icon */ - void setIcon(const QString& icon); + void setIcon(const TQString& icon); /** * @return the button's icon */ - QString icon() const; + TQString icon() const; /** * @return whether this button has a text label or not @@ -146,23 +146,23 @@ public: * Change the button's text label * @param text text for button's label */ - void setButtonText(const QString& text); + void setButtonText(const TQString& text); /** * @return button's text label */ - QString buttonText() const; + TQString buttonText() const; /** * Change the button's text label color * @param c the new text label color */ - void setTextColor(const QColor& c); + void setTextColor(const TQColor& c); /** * @return the button's text label color */ - QColor textColor() const; + TQColor textColor() const; /** * Change the button's text scale @@ -188,7 +188,7 @@ public: /** * @return global position of the center of the button */ - QPoint center() const; + TQPoint center() const; /** * Used to load the graphical tile of the button @@ -196,8 +196,8 @@ public: * @param size size of the tile * @param state used if button has multiple states (null by default) */ - static QImage loadTile(const QString& name, const QSize&, - const QString& state = QString::null); + static TQImage loadTile(const TQString& name, const TQSize&, + const TQString& state = TQString::null); /** * Update the contents of the button's KickerTip @@ -233,12 +233,12 @@ signals: /** * Emitted when button initiates a drag */ - void dragme(const QPixmap); + void dragme(const TQPixmap); /** * Overloads dragme to support panel button's with a list of KURL's ([url/servicemenu/browser]button) */ - void dragme(const KURL::List, const QPixmap); + void dragme(const KURL::List, const TQPixmap); public slots: /** @@ -263,12 +263,12 @@ protected: * to the subclass, should not be i18n'd and is never made user visible. * KDE4: remove this and use the classname directly instead. */ - virtual QString tileName() = 0; + virtual TQString tileName() = 0; /** * @return the default icon for the button */ - virtual QString defaultIcon() const { return "unknown"; }; + virtual TQString defaultIcon() const { return "unknown"; }; /** * Called right before drag occurs. @@ -277,22 +277,22 @@ protected: /** * Emits a signal to drag the button. Reimplement this if, for example, - * if you need the button to call dragme(KURL::List, const QPixmap) - * instead of dragme(const QPixmap) + * if you need the button to call dragme(KURL::List, const TQPixmap) + * instead of dragme(const TQPixmap) */ virtual void startDrag(); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); - virtual void dragEnterEvent(QDragEnterEvent *); - virtual void dragLeaveEvent(QDragLeaveEvent *); - virtual void dropEvent(QDropEvent *); - virtual void mouseMoveEvent(QMouseEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void mouseReleaseEvent(QMouseEvent *); - virtual void resizeEvent(QResizeEvent*); - virtual void drawButton(QPainter *); - virtual void drawButtonLabel(QPainter *); + virtual void enterEvent(TQEvent *); + virtual void leaveEvent(TQEvent *); + virtual void dragEnterEvent(TQDragEnterEvent *); + virtual void dragLeaveEvent(TQDragLeaveEvent *); + virtual void dropEvent(TQDropEvent *); + virtual void mouseMoveEvent(TQMouseEvent *); + virtual void mousePressEvent(TQMouseEvent *); + virtual void mouseReleaseEvent(TQMouseEvent *); + virtual void resizeEvent(TQResizeEvent*); + virtual void drawButton(TQPainter *); + virtual void drawButtonLabel(TQPainter *); /** * @return the preferred icon size. @@ -320,7 +320,7 @@ protected: * Set the file backing this button (See @ref checkForBackingFile()), * you shouldn't need to use this, currently it's only used in [url/service]button */ - void backedByFile(const QString& localFilePath); + void backedByFile(const TQString& localFilePath); /** * Sets the button's arrow direction. @@ -344,7 +344,7 @@ protected: bool calculateIconSize(); bool m_valid; - QPixmap m_icon; + TQPixmap m_icon; protected slots: /** @@ -364,7 +364,7 @@ protected slots: * has been deleted. * @param path path to backing file */ - void checkForDeletion(const QString& path); + void checkForDeletion(const TQString& path); /** * Called to prepare the button for removal from the Kicker @@ -372,23 +372,23 @@ protected slots: void scheduleForRemoval(); private: - QPoint m_lastLeftMouseButtonPress; + TQPoint m_lastLeftMouseButtonPress; bool m_isLeftMouseButtonDown; bool m_drawArrow; bool m_highlight; bool m_changeCursorOverItem; bool m_hasAcceptedDrag; - QColor m_textColor; - QColor m_tileColor; - QString m_buttonText; - QString m_tile; - QString m_title; - QString m_iconName; - QString m_backingFile; - QPixmap m_up; - QPixmap m_down; - QPixmap m_iconh; // hover - QPixmap m_iconz; // mouse over + TQColor m_textColor; + TQColor m_tileColor; + TQString m_buttonText; + TQString m_tile; + TQString m_title; + TQString m_iconName; + TQString m_backingFile; + TQPixmap m_up; + TQPixmap m_down; + TQPixmap m_iconh; // hover + TQPixmap m_iconz; // mouse over KPanelExtension::Position m_arrowDirection; KPanelApplet::Direction m_popupDirection; Orientation m_orientation; @@ -413,20 +413,20 @@ public: * @param parent the parent widget * @param name the widget's name */ - PanelPopupButton(QWidget *parent=0, const char *name=0); + PanelPopupButton(TQWidget *parent=0, const char *name=0); /** * Sets the button's popup menu. * @param popup the menu to pop up */ - void setPopup(QPopupMenu *popup); + void setPopup(TQPopupMenu *popup); /** * @return the button's popup menu */ - QPopupMenu *popup() const; + TQPopupMenu *popup() const; - bool eventFilter(QObject *, QEvent *); + bool eventFilter(TQObject *, TQEvent *); virtual void showMenu(); protected: @@ -460,7 +460,7 @@ private slots: void menuAboutToHide(); private: - QPopupMenu *m_popup; + TQPopupMenu *m_popup; bool m_pressedDuringPopup; bool m_initialized; diff --git a/kicker/libkicker/paneldrag.cpp b/kicker/libkicker/paneldrag.cpp index 871ac1d96..1fb6b9ce6 100644 --- a/kicker/libkicker/paneldrag.cpp +++ b/kicker/libkicker/paneldrag.cpp @@ -24,14 +24,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <sys/types.h> #include <unistd.h> -#include <qbuffer.h> +#include <tqbuffer.h> #include "paneldrag.h" #define PANELDRAG_BUFSIZE sizeof(BaseContainer*) + sizeof(pid_t) -PanelDrag::PanelDrag(BaseContainer* container, QWidget* dragSource) - : QDragObject(dragSource, 0) +PanelDrag::PanelDrag(BaseContainer* container, TQWidget* dragSource) + : TQDragObject(dragSource, 0) { pid_t source_pid = getpid(); @@ -44,9 +44,9 @@ PanelDrag::~PanelDrag() { } -bool PanelDrag::decode(const QMimeSource* e, BaseContainer** container) +bool PanelDrag::decode(const TQMimeSource* e, BaseContainer** container) { - QByteArray a = e->encodedData("application/basecontainerptr"); + TQByteArray a = e->encodedData("application/basecontainerptr"); if (a.size() != PANELDRAG_BUFSIZE) { @@ -55,25 +55,25 @@ bool PanelDrag::decode(const QMimeSource* e, BaseContainer** container) pid_t target_pid = getpid(); pid_t source_pid; - memcpy(&source_pid, a.data() + sizeof(QObject*), sizeof(pid_t)); + memcpy(&source_pid, a.data() + sizeof(TQObject*), sizeof(pid_t)); if (source_pid == target_pid) { - memcpy(container, a.data(), sizeof(QObject*)); + memcpy(container, a.data(), sizeof(TQObject*)); return true; } return false; } -bool PanelDrag::canDecode(const QMimeSource *e) +bool PanelDrag::canDecode(const TQMimeSource *e) { if (!e->provides("application/basecontainerptr")) { return false; } - QByteArray a = e->encodedData("application/basecontainerptr"); + TQByteArray a = e->encodedData("application/basecontainerptr"); if (a.size() != PANELDRAG_BUFSIZE) { return false; @@ -91,15 +91,15 @@ bool PanelDrag::canDecode(const QMimeSource *e) return true; } -QByteArray PanelDrag::encodedData(const char * mimeType) const +TQByteArray PanelDrag::encodedData(const char * mimeType) const { - if (QString("application/basecontainerptr") == mimeType && + if (TQString("application/basecontainerptr") == mimeType && a.size() == PANELDRAG_BUFSIZE) { return a; } - return QByteArray(); + return TQByteArray(); } const char * PanelDrag::format(int i) const @@ -113,12 +113,12 @@ const char * PanelDrag::format(int i) const } -AppletInfoDrag::AppletInfoDrag(const AppletInfo& info, QWidget *dragSource) - : QDragObject(dragSource, 0) +AppletInfoDrag::AppletInfoDrag(const AppletInfo& info, TQWidget *dragSource) + : TQDragObject(dragSource, 0) { - QBuffer buff(a); + TQBuffer buff(a); buff.open(IO_WriteOnly); - QDataStream s(&buff); + TQDataStream s(&buff); s << info.desktopFile() << info.configFile() << info.type(); } @@ -136,17 +136,17 @@ const char * AppletInfoDrag::format(int i) const return 0; } -QByteArray AppletInfoDrag::encodedData(const char* mimeType) const +TQByteArray AppletInfoDrag::encodedData(const char* mimeType) const { - if (QString("application/appletinfo") == mimeType) + if (TQString("application/appletinfo") == mimeType) { return a; } - return QByteArray(); + return TQByteArray(); } -bool AppletInfoDrag::canDecode(const QMimeSource * e) +bool AppletInfoDrag::canDecode(const TQMimeSource * e) { if (!e->provides("application/appletinfo")) { @@ -156,21 +156,21 @@ bool AppletInfoDrag::canDecode(const QMimeSource * e) return true; } -bool AppletInfoDrag::decode(const QMimeSource* e, AppletInfo& container) +bool AppletInfoDrag::decode(const TQMimeSource* e, AppletInfo& container) { - QByteArray a = e->encodedData("application/appletinfo"); + TQByteArray a = e->encodedData("application/appletinfo"); if (a.isEmpty()) { return false; } - QBuffer buff(a); + TQBuffer buff(a); buff.open(IO_ReadOnly); - QDataStream s(&buff); + TQDataStream s(&buff); - QString desktopFile; - QString configFile; + TQString desktopFile; + TQString configFile; int type; s >> desktopFile >> configFile >> type; AppletInfo info(desktopFile, configFile, (AppletInfo::AppletType)type); diff --git a/kicker/libkicker/paneldrag.h b/kicker/libkicker/paneldrag.h index ba85ad375..3d7cbf858 100644 --- a/kicker/libkicker/paneldrag.h +++ b/kicker/libkicker/paneldrag.h @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _paneldrag_h_ #define _paneldrag_h_ -#include <qdragobject.h> +#include <tqdragobject.h> #include <kdemacros.h> @@ -35,33 +35,33 @@ class BaseContainer; class KDE_EXPORT PanelDrag : public QDragObject { public: - PanelDrag(BaseContainer* container, QWidget *dragSource); + PanelDrag(BaseContainer* container, TQWidget *dragSource); ~PanelDrag(); virtual const char * format(int i = 0) const; - virtual QByteArray encodedData(const char *) const; + virtual TQByteArray encodedData(const char *) const; - static bool canDecode(const QMimeSource * e); - static bool decode(const QMimeSource* e, BaseContainer** container); + static bool canDecode(const TQMimeSource * e); + static bool decode(const TQMimeSource* e, BaseContainer** container); private: - QByteArray a; + TQByteArray a; }; class KDE_EXPORT AppletInfoDrag : public QDragObject { public: - AppletInfoDrag(const AppletInfo& container, QWidget *dragSource); + AppletInfoDrag(const AppletInfo& container, TQWidget *dragSource); ~AppletInfoDrag(); virtual const char * format(int i = 0) const; - virtual QByteArray encodedData(const char *) const; + virtual TQByteArray encodedData(const char *) const; - static bool canDecode(const QMimeSource * e); - static bool decode(const QMimeSource* e, AppletInfo& container); + static bool canDecode(const TQMimeSource * e); + static bool decode(const TQMimeSource* e, AppletInfo& container); private: - QByteArray a; + TQByteArray a; }; #endif diff --git a/kicker/libkicker/panner.cpp b/kicker/libkicker/panner.cpp index 43dd67a41..7d11a429e 100644 --- a/kicker/libkicker/panner.cpp +++ b/kicker/libkicker/panner.cpp @@ -21,11 +21,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include <qlayout.h> -#include <qtooltip.h> -#include <qtimer.h> -#include <qpainter.h> -#include <qstyle.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqtimer.h> +#include <tqpainter.h> +#include <tqstyle.h> #include <kglobal.h> #include <klocale.h> @@ -35,8 +35,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "panner.h" #include "panner.moc" -Panner::Panner( QWidget* parent, const char* name ) - : QWidget( parent, name ), +Panner::Panner( TQWidget* parent, const char* name ) + : TQWidget( parent, name ), _luSB(0), _rdSB(0), _cwidth(0), _cheight(0), @@ -45,17 +45,17 @@ Panner::Panner( QWidget* parent, const char* name ) KGlobal::locale()->insertCatalogue("libkicker"); setBackgroundOrigin( AncestorOrigin ); - _updateScrollButtonsTimer = new QTimer(this); - connect(_updateScrollButtonsTimer, SIGNAL(timeout()), this, SLOT(reallyUpdateScrollButtons())); + _updateScrollButtonsTimer = new TQTimer(this); + connect(_updateScrollButtonsTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(reallyUpdateScrollButtons())); - _clipper = new QWidget(this); + _clipper = new TQWidget(this); _clipper->setBackgroundOrigin(AncestorOrigin); _clipper->installEventFilter( this ); - _viewport = new QWidget(_clipper); + _viewport = new TQWidget(_clipper); _viewport->setBackgroundOrigin(AncestorOrigin); // layout - _layout = new QBoxLayout(this, QBoxLayout::LeftToRight); + _layout = new TQBoxLayout(this, TQBoxLayout::LeftToRight); _layout->addWidget(_clipper, 1); setOrientation(Horizontal); } @@ -78,8 +78,8 @@ void Panner::createScrollButtons() _luSB->setMinimumSize(12, 12); _luSB->hide(); _layout->addWidget(_luSB); - connect(_luSB, SIGNAL(pressed()), SLOT(startScrollLeftUp())); - connect(_luSB, SIGNAL(released()), SLOT(stopScroll())); + connect(_luSB, TQT_SIGNAL(pressed()), TQT_SLOT(startScrollLeftUp())); + connect(_luSB, TQT_SIGNAL(released()), TQT_SLOT(stopScroll())); // right/down scroll button _rdSB = new SimpleArrowButton(this); @@ -88,8 +88,8 @@ void Panner::createScrollButtons() _rdSB->setMinimumSize(12, 12); _rdSB->hide(); _layout->addWidget(_rdSB); - connect(_rdSB, SIGNAL(pressed()), SLOT(startScrollRightDown())); - connect(_rdSB, SIGNAL(released()), SLOT(stopScroll())); + connect(_rdSB, TQT_SIGNAL(pressed()), TQT_SLOT(startScrollRightDown())); + connect(_rdSB, TQT_SIGNAL(released()), TQT_SLOT(stopScroll())); // set up the buttons setupButtons(); @@ -103,13 +103,13 @@ void Panner::setupButtons() { _luSB->setArrowType(Qt::LeftArrow); _rdSB->setArrowType(Qt::RightArrow); - _luSB->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding)); - _rdSB->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding)); - QToolTip::add(_luSB, i18n("Scroll left")); - QToolTip::add(_rdSB, i18n("Scroll right")); + _luSB->setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Expanding)); + _rdSB->setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Expanding)); + TQToolTip::add(_luSB, i18n("Scroll left")); + TQToolTip::add(_rdSB, i18n("Scroll right")); setMinimumSize(24, 0); } - _layout->setDirection(QBoxLayout::LeftToRight); + _layout->setDirection(TQBoxLayout::LeftToRight); } else { @@ -117,13 +117,13 @@ void Panner::setupButtons() { _luSB->setArrowType(Qt::UpArrow); _rdSB->setArrowType(Qt::DownArrow); - _luSB->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); - _rdSB->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); - QToolTip::add(_luSB, i18n("Scroll up")); - QToolTip::add(_rdSB, i18n("Scroll down")); + _luSB->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Minimum)); + _rdSB->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Minimum)); + TQToolTip::add(_luSB, i18n("Scroll up")); + TQToolTip::add(_rdSB, i18n("Scroll down")); setMinimumSize(0, 24); } - _layout->setDirection(QBoxLayout::TopToBottom); + _layout->setDirection(TQBoxLayout::TopToBottom); } if (isVisible()) @@ -141,9 +141,9 @@ void Panner::setOrientation(Orientation o) reallyUpdateScrollButtons(); } -void Panner::resizeEvent( QResizeEvent* ) +void Panner::resizeEvent( TQResizeEvent* ) { - //QScrollView::resizeEvent( e ); + //TQScrollView::resizeEvent( e ); //updateScrollButtons(); } @@ -169,8 +169,8 @@ void Panner::scrollLeftUp() void Panner::startScrollRightDown() { - _scrollTimer = new QTimer(this); - connect(_scrollTimer, SIGNAL(timeout()), SLOT(scrollRightDown())); + _scrollTimer = new TQTimer(this); + connect(_scrollTimer, TQT_SIGNAL(timeout()), TQT_SLOT(scrollRightDown())); _scrollTimer->start(50); _step = 8; scrollRightDown(); @@ -178,8 +178,8 @@ void Panner::startScrollRightDown() void Panner::startScrollLeftUp() { - _scrollTimer = new QTimer(this); - connect(_scrollTimer, SIGNAL(timeout()), SLOT(scrollLeftUp())); + _scrollTimer = new TQTimer(this); + connect(_scrollTimer, TQT_SIGNAL(timeout()), TQT_SLOT(scrollLeftUp())); _scrollTimer->start(50); _step = 8; scrollLeftUp(); @@ -258,26 +258,26 @@ void Panner::resizeContents( int w, int h ) updateScrollButtons(); } -QPoint Panner::contentsToViewport( const QPoint& p ) const +TQPoint Panner::contentsToViewport( const TQPoint& p ) const { - return QPoint(p.x() - contentsX() - _clipper->x(), p.y() - contentsY() - _clipper->y()); + return TQPoint(p.x() - contentsX() - _clipper->x(), p.y() - contentsY() - _clipper->y()); } -QPoint Panner::viewportToContents( const QPoint& vp ) const +TQPoint Panner::viewportToContents( const TQPoint& vp ) const { - return QPoint(vp.x() + contentsX() + _clipper->x(), vp.y() + contentsY() + _clipper->y()); + return TQPoint(vp.x() + contentsX() + _clipper->x(), vp.y() + contentsY() + _clipper->y()); } void Panner::contentsToViewport( int x, int y, int& vx, int& vy ) const { - const QPoint v = contentsToViewport(QPoint(x,y)); + const TQPoint v = contentsToViewport(TQPoint(x,y)); vx = v.x(); vy = v.y(); } void Panner::viewportToContents( int vx, int vy, int& x, int& y ) const { - const QPoint c = viewportToContents(QPoint(vx,vy)); + const TQPoint c = viewportToContents(TQPoint(vx,vy)); x = c.x(); y = c.y(); } @@ -334,33 +334,33 @@ void Panner::ensureVisible( int x, int y, int xmargin, int ymargin ) setContentsPos( -cx, -cy ); } -bool Panner::eventFilter( QObject *obj, QEvent *e ) +bool Panner::eventFilter( TQObject *obj, TQEvent *e ) { if ( obj == _viewport || obj == _clipper ) { switch ( e->type() ) { - case QEvent::Resize: - viewportResizeEvent((QResizeEvent *)e); + case TQEvent::Resize: + viewportResizeEvent((TQResizeEvent *)e); break; - case QEvent::MouseButtonPress: - viewportMousePressEvent( (QMouseEvent*)e ); - if ( ((QMouseEvent*)e)->isAccepted() ) + case TQEvent::MouseButtonPress: + viewportMousePressEvent( (TQMouseEvent*)e ); + if ( ((TQMouseEvent*)e)->isAccepted() ) return true; break; - case QEvent::MouseButtonRelease: - viewportMouseReleaseEvent( (QMouseEvent*)e ); - if ( ((QMouseEvent*)e)->isAccepted() ) + case TQEvent::MouseButtonRelease: + viewportMouseReleaseEvent( (TQMouseEvent*)e ); + if ( ((TQMouseEvent*)e)->isAccepted() ) return true; break; - case QEvent::MouseButtonDblClick: - viewportMouseDoubleClickEvent( (QMouseEvent*)e ); - if ( ((QMouseEvent*)e)->isAccepted() ) + case TQEvent::MouseButtonDblClick: + viewportMouseDoubleClickEvent( (TQMouseEvent*)e ); + if ( ((TQMouseEvent*)e)->isAccepted() ) return true; break; - case QEvent::MouseMove: - viewportMouseMoveEvent( (QMouseEvent*)e ); - if ( ((QMouseEvent*)e)->isAccepted() ) + case TQEvent::MouseMove: + viewportMouseMoveEvent( (TQMouseEvent*)e ); + if ( ((TQMouseEvent*)e)->isAccepted() ) return true; break; default: @@ -368,29 +368,29 @@ bool Panner::eventFilter( QObject *obj, QEvent *e ) } } - return QWidget::eventFilter( obj, e ); // always continue with standard event processing + return TQWidget::eventFilter( obj, e ); // always continue with standard event processing } -void Panner::viewportResizeEvent( QResizeEvent* ) +void Panner::viewportResizeEvent( TQResizeEvent* ) { } -void Panner::viewportMousePressEvent( QMouseEvent* e) +void Panner::viewportMousePressEvent( TQMouseEvent* e) { e->ignore(); } -void Panner::viewportMouseReleaseEvent( QMouseEvent* e ) +void Panner::viewportMouseReleaseEvent( TQMouseEvent* e ) { e->ignore(); } -void Panner::viewportMouseDoubleClickEvent( QMouseEvent* e ) +void Panner::viewportMouseDoubleClickEvent( TQMouseEvent* e ) { e->ignore(); } -void Panner::viewportMouseMoveEvent( QMouseEvent* e ) +void Panner::viewportMouseMoveEvent( TQMouseEvent* e ) { e->ignore(); } diff --git a/kicker/libkicker/panner.h b/kicker/libkicker/panner.h index 6657c9a76..ee1bc026a 100644 --- a/kicker/libkicker/panner.h +++ b/kicker/libkicker/panner.h @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __panner_h__ #define __panner_h__ -#include <qwidget.h> +#include <tqwidget.h> #include "simplebutton.h" @@ -36,17 +36,17 @@ class KDE_EXPORT Panner : public QWidget Q_OBJECT public: - Panner( QWidget* parent, const char* name = 0 ); + Panner( TQWidget* parent, const char* name = 0 ); ~Panner(); - QSize minimumSizeHint() const { return QWidget::minimumSizeHint(); } + TQSize minimumSizeHint() const { return TQWidget::minimumSizeHint(); } Qt::Orientation orientation() const { return _orient; } virtual void setOrientation(Orientation orientation); - QWidget *viewport() const { return _viewport; } + TQWidget *viewport() const { return _viewport; } - QRect contentsRect() const { return QRect(0, 0, width(), height()); } + TQRect contentsRect() const { return TQRect(0, 0, width(), height()); } int contentsX() const { return _viewport ? -_viewport->x() : 0; } int contentsY() const { return _viewport ? -_viewport->y() : 0; } @@ -59,14 +59,14 @@ public: void contentsToViewport( int x, int y, int& vx, int& vy ) const; void viewportToContents( int vx, int vy, int& x, int& y ) const; - QPoint contentsToViewport( const QPoint& ) const; - QPoint viewportToContents( const QPoint& ) const; + QPoint contentsToViewport( const TQPoint& ) const; + QPoint viewportToContents( const TQPoint& ) const; - void addChild(QWidget *child) { child->show(); } - void removeChild(QWidget *child) { child->hide(); } - int childX(QWidget *child) const { return child->x(); } - int childY(QWidget *child) const { return child->y(); } - void moveChild(QWidget *child, int x, int y) { child->move(x, y); } + void addChild(TQWidget *child) { child->show(); } + void removeChild(TQWidget *child) { child->hide(); } + int childX(TQWidget *child) const { return child->x(); } + int childY(TQWidget *child) const { return child->y(); } + void moveChild(TQWidget *child, int x, int y) { child->move(x, y); } void ensureVisible( int x, int y ); void ensureVisible( int x, int y, int xmargin, int ymargin ); @@ -85,13 +85,13 @@ signals: void contentsMoving(int x, int y); protected: - virtual bool eventFilter( QObject *obj, QEvent *e ); - virtual void resizeEvent(QResizeEvent *ev); - virtual void viewportResizeEvent( QResizeEvent* ); - virtual void viewportMousePressEvent( QMouseEvent* ); - virtual void viewportMouseReleaseEvent( QMouseEvent* ); - virtual void viewportMouseDoubleClickEvent( QMouseEvent* ); - virtual void viewportMouseMoveEvent( QMouseEvent* ); + virtual bool eventFilter( TQObject *obj, TQEvent *e ); + virtual void resizeEvent(TQResizeEvent *ev); + virtual void viewportResizeEvent( TQResizeEvent* ); + virtual void viewportMousePressEvent( TQMouseEvent* ); + virtual void viewportMouseReleaseEvent( TQMouseEvent* ); + virtual void viewportMouseDoubleClickEvent( TQMouseEvent* ); + virtual void viewportMouseMoveEvent( TQMouseEvent* ); private: void setupButtons(); @@ -99,14 +99,14 @@ private: void updateScrollButtons(); Orientation _orient; - QBoxLayout *_layout; + TQBoxLayout *_layout; SimpleArrowButton *_luSB; // Left Scroll Button SimpleArrowButton *_rdSB; // Right Scroll Button - QTimer *_updateScrollButtonsTimer; - QTimer *_scrollTimer; + TQTimer *_updateScrollButtonsTimer; + TQTimer *_scrollTimer; - QWidget *_clipper; - QWidget *_viewport; + TQWidget *_clipper; + TQWidget *_viewport; int _cwidth, _cheight; int _cx, _cy; int _step; diff --git a/kicker/libkicker/simplebutton.cpp b/kicker/libkicker/simplebutton.cpp index 223e71982..4c28b2101 100644 --- a/kicker/libkicker/simplebutton.cpp +++ b/kicker/libkicker/simplebutton.cpp @@ -20,8 +20,8 @@ #include "simplebutton.h" -#include <qpainter.h> -#include <qstyle.h> +#include <tqpainter.h> +#include <tqstyle.h> #include <kapplication.h> #include <kcursor.h> @@ -34,17 +34,17 @@ #define BUTTON_MARGIN KDialog::spacingHint() -SimpleButton::SimpleButton(QWidget *parent, const char *name) - : QButton(parent, name), +SimpleButton::SimpleButton(TQWidget *parent, const char *name) + : TQButton(parent, name), m_highlight(false), m_orientation(Qt::Horizontal) { setBackgroundOrigin( AncestorOrigin ); - connect( kapp, SIGNAL( settingsChanged( int ) ), - SLOT( slotSettingsChanged( int ) ) ); - connect( kapp, SIGNAL( iconChanged( int ) ), - SLOT( slotIconChanged( int ) ) ); + connect( kapp, TQT_SIGNAL( settingsChanged( int ) ), + TQT_SLOT( slotSettingsChanged( int ) ) ); + connect( kapp, TQT_SIGNAL( iconChanged( int ) ), + TQT_SLOT( slotIconChanged( int ) ) ); kapp->addKipcEventMask( KIPC::SettingsChanged ); kapp->addKipcEventMask( KIPC::IconChanged ); @@ -52,9 +52,9 @@ SimpleButton::SimpleButton(QWidget *parent, const char *name) slotSettingsChanged( KApplication::SETTINGS_MOUSE ); } -void SimpleButton::setPixmap(const QPixmap &pix) +void SimpleButton::setPixmap(const TQPixmap &pix) { - QButton::setPixmap(pix); + TQButton::setPixmap(pix); generateIcons(); update(); } @@ -65,39 +65,39 @@ void SimpleButton::setOrientation(Qt::Orientation orientation) update(); } -QSize SimpleButton::sizeHint() const +TQSize SimpleButton::sizeHint() const { - const QPixmap* pm = pixmap(); + const TQPixmap* pm = pixmap(); if (!pm) - return QButton::sizeHint(); + return TQButton::sizeHint(); else - return QSize(pm->width() + BUTTON_MARGIN, pm->height() + BUTTON_MARGIN); + return TQSize(pm->width() + BUTTON_MARGIN, pm->height() + BUTTON_MARGIN); } -QSize SimpleButton::minimumSizeHint() const +TQSize SimpleButton::minimumSizeHint() const { - const QPixmap* pm = pixmap(); + const TQPixmap* pm = pixmap(); if (!pm) - return QButton::minimumSizeHint(); + return TQButton::minimumSizeHint(); else - return QSize(pm->width(), pm->height()); + return TQSize(pm->width(), pm->height()); } -void SimpleButton::drawButton( QPainter *p ) +void SimpleButton::drawButton( TQPainter *p ) { drawButtonLabel(p); } -void SimpleButton::drawButtonLabel( QPainter *p ) +void SimpleButton::drawButtonLabel( TQPainter *p ) { if (!pixmap()) { return; } - QPixmap pix = isEnabled() ? (m_highlight? m_activeIcon : m_normalIcon) : m_disabledIcon; + TQPixmap pix = isEnabled() ? (m_highlight? m_activeIcon : m_normalIcon) : m_disabledIcon; if (isOn() || isDown()) { @@ -110,7 +110,7 @@ void SimpleButton::drawButtonLabel( QPainter *p ) int ph = pix.height(); int pw = pix.width(); int margin = BUTTON_MARGIN; - QPoint origin(margin / 2, margin / 2); + TQPoint origin(margin / 2, margin / 2); if (ph < (h - margin)) { @@ -132,7 +132,7 @@ void SimpleButton::generateIcons() return; } - QImage image = pixmap()->convertToImage(); + TQImage image = pixmap()->convertToImage(); KIconEffect effect; m_normalIcon = effect.apply(image, KIcon::Panel, KIcon::DefaultState); @@ -172,29 +172,29 @@ void SimpleButton::slotIconChanged( int group ) update(); } -void SimpleButton::enterEvent( QEvent *e ) +void SimpleButton::enterEvent( TQEvent *e ) { m_highlight = true; repaint( false ); - QButton::enterEvent( e ); + TQButton::enterEvent( e ); } -void SimpleButton::leaveEvent( QEvent *e ) +void SimpleButton::leaveEvent( TQEvent *e ) { m_highlight = false; repaint( false ); - QButton::enterEvent( e ); + TQButton::enterEvent( e ); } -void SimpleButton::resizeEvent( QResizeEvent * ) +void SimpleButton::resizeEvent( TQResizeEvent * ) { generateIcons(); } -SimpleArrowButton::SimpleArrowButton(QWidget *parent, Qt::ArrowType arrow, const char *name) +SimpleArrowButton::SimpleArrowButton(TQWidget *parent, Qt::ArrowType arrow, const char *name) : SimpleButton(parent, name) { setBackgroundOrigin(AncestorOrigin); @@ -202,9 +202,9 @@ SimpleArrowButton::SimpleArrowButton(QWidget *parent, Qt::ArrowType arrow, const _inside = false; } -QSize SimpleArrowButton::sizeHint() const +TQSize SimpleArrowButton::sizeHint() const { - return QSize( 12, 12 ); + return TQSize( 12, 12 ); } void SimpleArrowButton::setArrowType(Qt::ArrowType a) @@ -221,32 +221,32 @@ Qt::ArrowType SimpleArrowButton::arrowType() const return _arrow; } -void SimpleArrowButton::drawButton( QPainter *p ) +void SimpleArrowButton::drawButton( TQPainter *p ) { - QRect r(1, 1, width() - 2, height() - 2); + TQRect r(1, 1, width() - 2, height() - 2); - QStyle::PrimitiveElement pe = QStyle::PE_ArrowLeft; + TQStyle::PrimitiveElement pe = TQStyle::PE_ArrowLeft; switch (_arrow) { - case Qt::LeftArrow: pe = QStyle::PE_ArrowLeft; break; - case Qt::RightArrow: pe = QStyle::PE_ArrowRight; break; - case Qt::UpArrow: pe = QStyle::PE_ArrowUp; break; - case Qt::DownArrow: pe = QStyle::PE_ArrowDown; break; + case Qt::LeftArrow: pe = TQStyle::PE_ArrowLeft; break; + case Qt::RightArrow: pe = TQStyle::PE_ArrowRight; break; + case Qt::UpArrow: pe = TQStyle::PE_ArrowUp; break; + case Qt::DownArrow: pe = TQStyle::PE_ArrowDown; break; } - int flags = QStyle::Style_Default | QStyle::Style_Enabled; - if (isDown() || isOn()) flags |= QStyle::Style_Down; + int flags = TQStyle::Style_Default | TQStyle::Style_Enabled; + if (isDown() || isOn()) flags |= TQStyle::Style_Down; style().drawPrimitive(pe, p, r, colorGroup(), flags); } -void SimpleArrowButton::enterEvent( QEvent *e ) +void SimpleArrowButton::enterEvent( TQEvent *e ) { _inside = true; SimpleButton::enterEvent( e ); update(); } -void SimpleArrowButton::leaveEvent( QEvent *e ) +void SimpleArrowButton::leaveEvent( TQEvent *e ) { _inside = false; SimpleButton::enterEvent( e ); diff --git a/kicker/libkicker/simplebutton.h b/kicker/libkicker/simplebutton.h index 5423dff6b..1ea5c7a44 100644 --- a/kicker/libkicker/simplebutton.h +++ b/kicker/libkicker/simplebutton.h @@ -21,8 +21,8 @@ #ifndef SIMPLEBUTTON_H #define SIMPLEBUTTON_H -#include <qbutton.h> -#include <qpixmap.h> +#include <tqbutton.h> +#include <tqpixmap.h> #include <kdemacros.h> @@ -31,20 +31,20 @@ class KDE_EXPORT SimpleButton : public QButton Q_OBJECT public: - SimpleButton(QWidget *parent, const char *name = 0); - void setPixmap(const QPixmap &pix); + SimpleButton(TQWidget *parent, const char *name = 0); + void setPixmap(const TQPixmap &pix); void setOrientation(Qt::Orientation orientaton); - QSize sizeHint() const; - QSize minimumSizeHint() const; + TQSize sizeHint() const; + TQSize minimumSizeHint() const; protected: - void drawButton( QPainter *p ); - void drawButtonLabel( QPainter *p ); + void drawButton( TQPainter *p ); + void drawButtonLabel( TQPainter *p ); void generateIcons(); - void enterEvent( QEvent *e ); - void leaveEvent( QEvent *e ); - void resizeEvent( QResizeEvent *e ); + void enterEvent( TQEvent *e ); + void leaveEvent( TQEvent *e ); + void resizeEvent( TQResizeEvent *e ); protected slots: virtual void slotSettingsChanged( int category ); @@ -52,9 +52,9 @@ class KDE_EXPORT SimpleButton : public QButton private: bool m_highlight; - QPixmap m_normalIcon; - QPixmap m_activeIcon; - QPixmap m_disabledIcon; + TQPixmap m_normalIcon; + TQPixmap m_activeIcon; + TQPixmap m_disabledIcon; Qt::Orientation m_orientation; class SimpleButtonPrivate; SimpleButtonPrivate* d; @@ -65,14 +65,14 @@ class KDE_EXPORT SimpleArrowButton: public SimpleButton Q_OBJECT public: - SimpleArrowButton(QWidget *parent = 0, Qt::ArrowType arrow = Qt::UpArrow, const char *name = 0); + SimpleArrowButton(TQWidget *parent = 0, Qt::ArrowType arrow = Qt::UpArrow, const char *name = 0); virtual ~SimpleArrowButton() {}; - QSize sizeHint() const; + TQSize sizeHint() const; protected: - virtual void enterEvent( QEvent *e ); - virtual void leaveEvent( QEvent *e ); - virtual void drawButton(QPainter *p); + virtual void enterEvent( TQEvent *e ); + virtual void leaveEvent( TQEvent *e ); + virtual void drawButton(TQPainter *p); Qt::ArrowType arrowType() const; public slots: |