summaryrefslogtreecommitdiffstats
path: root/kjsembed/bindings/painter_imp.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
commit9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch)
treec81c34dae2b3b1ea73801bf18a960265dc4207f7 /kjsembed/bindings/painter_imp.cpp
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'kjsembed/bindings/painter_imp.cpp')
-rw-r--r--kjsembed/bindings/painter_imp.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/kjsembed/bindings/painter_imp.cpp b/kjsembed/bindings/painter_imp.cpp
index df6673e8..184529df 100644
--- a/kjsembed/bindings/painter_imp.cpp
+++ b/kjsembed/bindings/painter_imp.cpp
@@ -38,15 +38,15 @@ namespace Bindings {
{
PainterRef * p = new PainterRef();
/*
- TQWidget *w = extractQWidget(exec, args, 0);
- TQPixmap pix = extractQPixmap(exec, args, 0);
+ TTQWidget *w = extractTQWidget(exec, args, 0);
+ TTQPixmap pix = extractTQPixmap(exec, args, 0);
if( w )
{
p->setDevice(w);
p->setCanDelete(false);
}
else if( !pix.isNull() )
- p->setDevice( new TQPixmap(pix) );
+ p->setDevice( new TTQPixmap(pix) );
*/
JSOpaqueProxy *prx = new JSOpaqueProxy( p, "Painter" );
prx->setOwner( JSProxy::JavaScript );
@@ -63,7 +63,7 @@ namespace Bindings {
PainterRef::PainterRef()
{
m_device = 0L;
- m_painter = new TQPainter;
+ m_painter = new TTQPainter;
m_canDelete = true;
}
PainterRef::~PainterRef()
@@ -74,17 +74,17 @@ PainterRef::~PainterRef()
delete m_painter;
}
-TQPainter *PainterRef::painter()
+TTQPainter *PainterRef::painter()
{
return m_painter;
}
-TQPaintDevice *PainterRef::device()
+TTQPaintDevice *PainterRef::device()
{
return m_device;
}
-void PainterRef::setDevice(TQPaintDevice *d)
+void PainterRef::setDevice(TTQPaintDevice *d)
{
if( m_device && m_canDelete)
{
@@ -162,17 +162,17 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li
}
else
{
- TQString msg = i18n( "Paintdevice was not a valid widget." );
+ TTQString msg = i18n( "Paintdevice was not a valid widget." );
throwError(exec,msg);
retValue = KJS::Boolean(false);
}
}
else if ( vp )
{
- TQPixmap *p = new TQPixmap(vp->toVariant().toPixmap());
+ TTQPixmap *p = new TTQPixmap(vp->toVariant().toPixmap());
if( p->isNull() )
{
- TQString msg = i18n( "Cannto paint to a null pixmap." ).arg( op->typeName() );
+ TTQString 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() == "TQPaintDevice" )
+ else if ( op && op->typeName() == "TTQPaintDevice" )
{
- pr->setDevice( op->toNative<TQPaintDevice>() );
+ pr->setDevice( op->toNative<TTQPaintDevice>() );
pr->setCanDelete(false);
retValue = KJS::Boolean( begin() );
}
else
{
- TQString msg = i18n( "Paintdevice of type '%1' is not supported." ).arg( op->typeName() );
+ TTQString msg = i18n( "Paintdevice of type '%1' is not supported." ).arg( op->typeName() );
throwError(exec,msg);
retValue = KJS::Boolean(false);
}
}
else
{
- TQString msg = i18n( "Incorrect number of arguements '%1'." ).arg( args.size() );
+ TTQString 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:
{
- TQPen pn = extractQPen(exec, args, 0);
+ TTQPen pn = extractTQPen(exec, args, 0);
setPen(pn);
break;
}
@@ -227,7 +227,7 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li
}
case MethodtextBox:
{
- retValue = convertToValue(exec, textBox(extractQString(exec, args, 0)));
+ retValue = convertToValue(exec, textBox(extractTQString(exec, args, 0)));
break;
}
case MethodmoveTo:
@@ -267,7 +267,7 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li
}
case MethoddrawText:
{
- drawText(extractInt(exec, args, 0), extractInt(exec, args, 1), extractQString(exec, args, 2));
+ drawText(extractInt(exec, args, 0), extractInt(exec, args, 1), extractTQString(exec, args, 2));
break;
}
case MethoddrawArc:
@@ -282,17 +282,17 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li
}
case MethoddrawPixmap:
{
- drawPixmap(extractInt(exec, args, 0), extractInt(exec, args, 1), extractQPixmap(exec, args, 2), extractInt(exec, args, 3), extractInt(exec, args, 4), extractInt(exec, args, 5), extractInt(exec, args, 6));
+ drawPixmap(extractInt(exec, args, 0), extractInt(exec, args, 1), extractTQPixmap(exec, args, 2), extractInt(exec, args, 3), extractInt(exec, args, 4), extractInt(exec, args, 5), extractInt(exec, args, 6));
break;
}
case MethoddrawImage:
{
- drawImage( extractInt(exec, args, 0), extractInt(exec, args, 1), extractQImage(exec, args, 2), extractInt(exec, args, 3), extractInt(exec, args, 4), extractInt(exec, args, 5), extractInt(exec, args, 6), extractInt(exec, args, 7) );
+ drawImage( extractInt(exec, args, 0), extractInt(exec, args, 1), extractTQImage(exec, args, 2), extractInt(exec, args, 3), extractInt(exec, args, 4), extractInt(exec, args, 5), extractInt(exec, args, 6), extractInt(exec, args, 7) );
break;
}
case MethoddrawTiledPixmap:
{
- drawTiledPixmap(extractInt(exec, args, 0), extractInt(exec, args, 1), extractInt(exec, args, 2), extractInt(exec, args, 3), extractQPixmap(exec, args, 4), extractInt(exec, args, 5), extractInt(exec, args, 6));
+ drawTiledPixmap(extractInt(exec, args, 0), extractInt(exec, args, 1), extractInt(exec, args, 2), extractInt(exec, args, 3), extractTQPixmap(exec, args, 4), extractInt(exec, args, 5), extractInt(exec, args, 6));
break;
}
case Methodscale:
@@ -317,7 +317,7 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li
}
case MethodsetFont:
{
- setFont(extractQFont(exec, args, 0));
+ setFont(extractTQFont(exec, args, 0));
break;
}
case Methodfont:
@@ -327,7 +327,7 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li
}
case MethodsetBrush:
{
- pr->painter()->setBrush(extractQBrush(exec, args, 0));
+ pr->painter()->setBrush(extractTQBrush(exec, args, 0));
break;
}
case Methodbrush:
@@ -342,7 +342,7 @@ KJS::Value Painter::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li
}
case MethodsetBackgroundColor:
{
- setBackgroundColor(extractQColor(exec, args, 0));
+ setBackgroundColor(extractTQColor(exec, args, 0));
break;
}
default:
@@ -367,7 +367,7 @@ bool Painter::begin()
{
return pr->painter()->begin(pr->device());
}
-bool Painter::begin(TQPaintDevice *dev)
+bool Painter::begin(TTQPaintDevice *dev)
{
return pr->painter()->begin(dev);
}
@@ -377,29 +377,29 @@ bool Painter::end()
return pr->painter()->end();
}
-TQPixmap Painter::pixmap() const
+TTQPixmap Painter::pixmap() const
{
- TQPixmap *pix = dynamic_cast<TQPixmap *>(pr->device());
+ TTQPixmap *pix = dynamic_cast<TTQPixmap *>(pr->device());
if( pix )
{
return *pix;
}
- return TQPixmap();
+ return TTQPixmap();
}
-void Painter::setPen( const TQPen& pn )
+void Painter::setPen( const TTQPen& pn )
{
pr->painter()->setPen(pn);
}
-TQPen Painter::pen() const
+TTQPen Painter::pen() const
{
return pr->painter()->pen();
}
-TQRect Painter::textBox(const TQString &text)
+TTQRect Painter::textBox(const TTQString &text)
{
- TQFontMetrics fnt = pr->painter()->fontMetrics();
+ TTQFontMetrics 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 TQString &txt )
+void Painter::drawText( int x, int y, const TTQString &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 TQPixmap & pixmap, int sx, int sy, int sw, int sh )
+void Painter::drawPixmap ( int x, int y, const TTQPixmap & 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 TQImage &image, int sx , int sy, int sw , int sh, int conversionFlags)
+void Painter::drawImage ( int x, int y, const TTQImage &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 TQPixmap & pixmap, int sx, int sy )
+void Painter::drawTiledPixmap ( int x, int y, int w, int h, const TTQPixmap & 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 TQFont & font )
+void KJSEmbed::Bindings::Painter::setFont( const TTQFont & font )
{
pr->painter()->setFont(font);
}
-TQFont KJSEmbed::Bindings::Painter::font( ) const
+TTQFont KJSEmbed::Bindings::Painter::font( ) const
{
return pr->painter()->font();
}
-TQColor KJSEmbed::Bindings::Painter::backgroundColor( ) const
+TTQColor KJSEmbed::Bindings::Painter::backgroundColor( ) const
{
return pr->painter()->backgroundColor();
}
-void KJSEmbed::Bindings::Painter::setBackgroundColor( const TQColor & color )
+void KJSEmbed::Bindings::Painter::setBackgroundColor( const TTQColor & color )
{
pr->painter()->setBackgroundColor(color);
}
@@ -505,12 +505,12 @@ void KJSEmbed::Bindings::Painter::setBackgroundColor( const TQColor & color )
} // namespace KJSEmbed
-void KJSEmbed::Bindings::Painter::setBrush( const TQColor & brush )
+void KJSEmbed::Bindings::Painter::setBrush( const TTQColor & brush )
{
pr->painter()->setBrush(brush);
}
-TQColor KJSEmbed::Bindings::Painter::brush( ) const
+TTQColor KJSEmbed::Bindings::Painter::brush( ) const
{
return pr->painter()->brush().color();
}