From 479f5f799523bffbcc83dff581a2299c047c6fff Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:44:01 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kjsembed/bindings/painter_imp.cpp | 72 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'kjsembed/bindings/painter_imp.cpp') diff --git a/kjsembed/bindings/painter_imp.cpp b/kjsembed/bindings/painter_imp.cpp index 8fa77de0..ef2f9ddd 100644 --- a/kjsembed/bindings/painter_imp.cpp +++ b/kjsembed/bindings/painter_imp.cpp @@ -19,14 +19,14 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include +#include +#include +#include #include #include #include #include -#include +#include #include #include "painter_imp.h" @@ -38,15 +38,15 @@ namespace Bindings { { PainterRef * p = new PainterRef(); /* - QWidget *w = extractQWidget(exec, args, 0); - QPixmap pix = extractQPixmap(exec, args, 0); + TQWidget *w = extractQWidget(exec, args, 0); + TQPixmap pix = extractQPixmap(exec, args, 0); if( w ) { p->setDevice(w); p->setCanDelete(false); } else if( !pix.isNull() ) - p->setDevice( new QPixmap(pix) ); + p->setDevice( new TQPixmap(pix) ); */ JSOpaqueProxy *prx = new JSOpaqueProxy( p, "Painter" ); prx->setOwner( JSProxy::JavaScript ); @@ -74,17 +74,17 @@ PainterRef::~PainterRef() delete m_painter; } -QPainter *PainterRef::painter() +TQPainter *PainterRef::painter() { return m_painter; } -QPaintDevice *PainterRef::device() +TQPaintDevice *PainterRef::device() { return m_device; } -void PainterRef::setDevice(QPaintDevice *d) +void PainterRef::setDevice(TQPaintDevice *d) { if( m_device && m_canDelete) { @@ -162,17 +162,17 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li } else { - QString msg = i18n( "Paintdevice was not a valid widget." ); + TQString msg = i18n( "Paintdevice was not a valid widget." ); throwError(exec,msg); retValue = KJS::Boolean(false); } } else if ( vp ) { - QPixmap *p = new QPixmap(vp->toVariant().toPixmap()); + TQPixmap *p = new TQPixmap(vp->toVariant().toPixmap()); if( p->isNull() ) { - QString msg = i18n( "Cannto paint to a null pixmap." ).arg( op->typeName() ); + TQString msg = i18n( "Cannto paint to a null pixmap." ).arg( op->typeName() ); throwError(exec,msg); retValue = KJS::Boolean(false); } @@ -183,22 +183,22 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li retValue = KJS::Boolean( begin() ); } } - else if ( op && op->typeName() == "QPaintDevice" ) + else if ( op && op->typeName() == "TQPaintDevice" ) { - pr->setDevice( op->toNative() ); + pr->setDevice( op->toNative() ); pr->setCanDelete(false); retValue = KJS::Boolean( begin() ); } else { - QString msg = i18n( "Paintdevice of type '%1' is not supported." ).arg( op->typeName() ); + TQString msg = i18n( "Paintdevice of type '%1' is not supported." ).arg( op->typeName() ); throwError(exec,msg); retValue = KJS::Boolean(false); } } else { - QString msg = i18n( "Incorrect number of arguements '%1'." ).arg( args.size() ); + TQString msg = i18n( "Incorrect number of arguements '%1'." ).arg( args.size() ); throwError(exec,msg); retValue = KJS::Boolean(false); } @@ -216,7 +216,7 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li break; case MethodsetPen: { - QPen pn = extractQPen(exec, args, 0); + TQPen pn = extractQPen(exec, args, 0); setPen(pn); break; } @@ -367,7 +367,7 @@ bool Painter::begin() { return pr->painter()->begin(pr->device()); } -bool Painter::begin(QPaintDevice *dev) +bool Painter::begin(TQPaintDevice *dev) { return pr->painter()->begin(dev); } @@ -377,29 +377,29 @@ bool Painter::end() return pr->painter()->end(); } -QPixmap Painter::pixmap() const +TQPixmap Painter::pixmap() const { - QPixmap *pix = dynamic_cast(pr->device()); + TQPixmap *pix = dynamic_cast(pr->device()); if( pix ) { return *pix; } - return QPixmap(); + return TQPixmap(); } -void Painter::setPen( const QPen& pn ) +void Painter::setPen( const TQPen& pn ) { pr->painter()->setPen(pn); } -QPen Painter::pen() const +TQPen Painter::pen() const { return pr->painter()->pen(); } -QRect Painter::textBox(const QString &text) +TQRect Painter::textBox(const TQString &text) { - QFontMetrics fnt = pr->painter()->fontMetrics(); + TQFontMetrics fnt = pr->painter()->fontMetrics(); return fnt.boundingRect(text); } @@ -438,7 +438,7 @@ void Painter::drawEllipse( int x, int y, int w, int h ) pr->painter()->drawEllipse( x, y, w, h ); } -void Painter::drawText( int x, int y, const QString &txt ) +void Painter::drawText( int x, int y, const TQString &txt ) { pr->painter()->drawText( x, y, txt ); } @@ -451,15 +451,15 @@ void Painter::drawPie ( int x, int y, int w, int h, int a, int alen ) { pr->painter()->drawPie( x, y, w, h, a, alen); } -void Painter::drawPixmap ( int x, int y, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) +void Painter::drawPixmap ( int x, int y, const TQPixmap & pixmap, int sx, int sy, int sw, int sh ) { pr->painter()->drawPixmap( x, y, pixmap, sx, sy, sw, sh ); } -void Painter::drawImage ( int x, int y, const QImage &image, int sx , int sy, int sw , int sh, int conversionFlags) +void Painter::drawImage ( int x, int y, const TQImage &image, int sx , int sy, int sw , int sh, int conversionFlags) { pr->painter()->drawImage( x, y, image, sx, sy, sw, sh, conversionFlags ); } -void Painter::drawTiledPixmap ( int x, int y, int w, int h, const QPixmap & pixmap, int sx, int sy ) +void Painter::drawTiledPixmap ( int x, int y, int w, int h, const TQPixmap & pixmap, int sx, int sy ) { pr->painter()->drawTiledPixmap( x, y, w, h, pixmap, sx, sy ); } @@ -481,22 +481,22 @@ void Painter::translate ( double dx, double dy ) pr->painter()->translate( dx, dy ); } -void KJSEmbed::Bindings::Painter::setFont( const QFont & font ) +void KJSEmbed::Bindings::Painter::setFont( const TQFont & font ) { pr->painter()->setFont(font); } -QFont KJSEmbed::Bindings::Painter::font( ) const +TQFont KJSEmbed::Bindings::Painter::font( ) const { return pr->painter()->font(); } -QColor KJSEmbed::Bindings::Painter::backgroundColor( ) const +TQColor KJSEmbed::Bindings::Painter::backgroundColor( ) const { return pr->painter()->backgroundColor(); } -void KJSEmbed::Bindings::Painter::setBackgroundColor( const QColor & color ) +void KJSEmbed::Bindings::Painter::setBackgroundColor( const TQColor & color ) { pr->painter()->setBackgroundColor(color); } @@ -505,12 +505,12 @@ void KJSEmbed::Bindings::Painter::setBackgroundColor( const QColor & color ) } // namespace KJSEmbed -void KJSEmbed::Bindings::Painter::setBrush( const QColor & brush ) +void KJSEmbed::Bindings::Painter::setBrush( const TQColor & brush ) { pr->painter()->setBrush(brush); } -QColor KJSEmbed::Bindings::Painter::brush( ) const +TQColor KJSEmbed::Bindings::Painter::brush( ) const { return pr->painter()->brush().color(); } -- cgit v1.2.1