summaryrefslogtreecommitdiffstats
path: root/client/myrootpixmap.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-01 21:17:46 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-01 21:17:46 +0000
commit21a1d3cffb820b001b0901f8e82d4c8bfc5e1683 (patch)
treead9d08bc725d963acafab219a33699ae2d6e723c /client/myrootpixmap.cc
parent424422475d6f30da2b84041dcb2b13b425126f04 (diff)
downloadtwin-style-crystal-21a1d3cffb820b001b0901f8e82d4c8bfc5e1683.tar.gz
twin-style-crystal-21a1d3cffb820b001b0901f8e82d4c8bfc5e1683.zip
TQt4 port kwin-style-crystal
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kwin-style-crystal@1239032 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'client/myrootpixmap.cc')
-rw-r--r--client/myrootpixmap.cc66
1 files changed, 33 insertions, 33 deletions
diff --git a/client/myrootpixmap.cc b/client/myrootpixmap.cc
index 9412256..792e474 100644
--- a/client/myrootpixmap.cc
+++ b/client/myrootpixmap.cc
@@ -12,12 +12,12 @@
/* Modified by Sascha Hlusiak */
-#include <qwidget.h>
-#include <qtimer.h>
-#include <qrect.h>
-#include <qimage.h>
+#include <tqwidget.h>
+#include <tqtimer.h>
+#include <tqrect.h>
+#include <tqimage.h>
-#ifndef Q_WS_QWS //FIXME
+#ifndef TQ_WS_TQWS //FIXME
#include <kapplication.h>
#include <kimageeffect.h>
#include <kpixmapio.h>
@@ -25,21 +25,21 @@
#include <kdebug.h>
#include <netwm.h>
#include <dcopclient.h>
-#include <qpainter.h>
+#include <tqpainter.h>
#include <ksharedpixmap.h>
#include "myrootpixmap.h"
-KMyRootPixmap::KMyRootPixmap( QWidget * widget, const char *name )
- : QObject(widget, name ? name : "KMyRootPixmap" )
+KMyRootPixmap::KMyRootPixmap( TQWidget * widget, const char *name )
+ : TQObject(widget, name ? name : "KMyRootPixmap" )
{
init();
}
-KMyRootPixmap::KMyRootPixmap( QWidget *, QObject *parent, const char *name )
- : QObject( parent, name ? name : "KMyRootPixmap" )
+KMyRootPixmap::KMyRootPixmap( TQWidget *, TQObject *tqparent, const char *name )
+ : TQObject( tqparent, name ? name : "KMyRootPixmap" )
{
init();
}
@@ -49,17 +49,17 @@ void KMyRootPixmap::init()
// d = new KMyRootPixmapData;
// m_Fade = 0;
m_pPixmap = new KSharedPixmap;
-// m_pTimer = new QTimer( this );
+// m_pTimer = new TQTimer( this );
m_bInit = false;
m_bActive = false;
m_Desk=-1;
// m_bCustomPaint = false;
-// connect(kapp, SIGNAL(backgroundChanged(int)), SLOT(slotBackgroundChanged(int)));
- connect(m_pPixmap, SIGNAL(done(bool)), SLOT(slotDone(bool)));
-// connect(m_pTimer, SIGNAL(timeout()), SLOT(repaint()));
+// connect(kapp, TQT_SIGNAL(backgroundChanged(int)), TQT_SLOT(slotBackgroundChanged(int)));
+ connect(m_pPixmap, TQT_SIGNAL(done(bool)), TQT_SLOT(slotDone(bool)));
+// connect(m_pTimer, TQT_SIGNAL(timeout()), TQT_SLOT(tqrepaint()));
-// d->toplevel = m_pWidget->topLevelWidget();
+// d->toplevel = m_pWidget->tqtopLevelWidget();
// d->toplevel->installEventFilter(this);
}
@@ -85,7 +85,7 @@ void KMyRootPixmap::start()
enableExports();
return;
// if (m_bInit)
-// repaint(true);
+// tqrepaint(true);
}
void KMyRootPixmap::stop()
@@ -95,14 +95,14 @@ void KMyRootPixmap::stop()
}
-void KMyRootPixmap::repaint()
+void KMyRootPixmap::tqrepaint()
{
- repaint(false);
+ tqrepaint(false);
}
-void KMyRootPixmap::repaint(bool force)
+void KMyRootPixmap::tqrepaint(bool force)
{
-// printf("KMyRootPixmap::repaint(%s)\n",force?"true":"false");
+// printf("KMyRootPixmap::tqrepaint(%s)\n",force?"true":"false");
if ((!force) && (m_Desk==currentDesktop()))return;
m_Desk = currentDesktop();
@@ -122,14 +122,14 @@ bool KMyRootPixmap::isAvailable()
return m_pPixmap->isAvailable(pixmapName(m_Desk));
}
-QString KMyRootPixmap::pixmapName(int desk)
+TQString KMyRootPixmap::pixmapName(int desk)
{
- QString pattern = QString("DESKTOP%1");
+ TQString pattern = TQString("DESKTOP%1");
int screen_number = DefaultScreen(qt_xdisplay());
if (screen_number) {
- pattern = QString("SCREEN%1-DESKTOP").arg(screen_number) + "%1";
+ pattern = TQString("SCREEN%1-DESKTOP").tqarg(screen_number) + "%1";
}
- return pattern.arg( desk );
+ return pattern.tqarg( desk );
}
@@ -139,11 +139,11 @@ void KMyRootPixmap::enableExports()
DCOPClient *client = kapp->dcopClient();
if (!client->isAttached())
client->attach();
- QByteArray data;
- QDataStream args( data, IO_WriteOnly );
+ TQByteArray data;
+ TQDataStream args( data, IO_WriteOnly );
args << 1;
- QCString appname( "kdesktop" );
+ TQCString appname( "kdesktop" );
int screen_number = DefaultScreen(qt_xdisplay());
if ( screen_number )
appname.sprintf("kdesktop-screen-%d", screen_number );
@@ -169,29 +169,29 @@ void KMyRootPixmap::slotDone(bool success)
void KMyRootPixmap::updateBackground( KSharedPixmap *spm )
{
// printf("KMyRootPixmap::updateBackground(%p)\n",spm);
- QPixmap *px=spm;
+ TQPixmap *px=spm;
if (px->isNull() || px->width()==0 || px->height()==0)
{ // This is NOT an image, something went wrong, update to plain
emit backgroundUpdated(NULL);
return;
}
KPixmapIO io;
- QSize desktopsize(QApplication::desktop()->width(),QApplication::desktop()->height());
+ TQSize desktopsize(TQApplication::desktop()->width(),TQApplication::desktop()->height());
if (px->rect().size()==desktopsize)
{ // Image has already the right dimension, make a quick update
- QImage img = io.convertToImage(*spm);
+ TQImage img = io.convertToImage(*spm);
emit backgroundUpdated(&img);
return;
}else{ // we need to create a tiled pixmap and then the image to update
- QPixmap pix(desktopsize,spm->depth());
- QPainter pufferPainter(&pix);
+ TQPixmap pix(desktopsize,spm->TQPixmap::depth());
+ TQPainter pufferPainter(&pix);
pufferPainter.drawTiledPixmap(pix.rect(),*spm);
pufferPainter.end();
- QImage img=io.convertToImage(pix);
+ TQImage img=io.convertToImage(pix);
emit backgroundUpdated(&img);
}
}