diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-27 23:37:00 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-27 23:37:00 +0000 |
commit | b0e912c8b3d02a518fedda28c3180eb4794a7520 (patch) | |
tree | 07d344862562fab58cbe2df39d13d16f2e4d2bea /k9author/k9menu.cpp | |
parent | 4d695ec81fe4d4335ee82c7a9346ad9c9e144ecc (diff) | |
download | k9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.tar.gz k9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.zip |
TQt4 convert k9copy
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1233843 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'k9author/k9menu.cpp')
-rw-r--r-- | k9author/k9menu.cpp | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/k9author/k9menu.cpp b/k9author/k9menu.cpp index b219ba3..a911e97 100644 --- a/k9author/k9menu.cpp +++ b/k9author/k9menu.cpp @@ -12,20 +12,20 @@ #include "k9menu.h" #include "k9menubutton.h" #include "k9process.h" -#include <qpainter.h> -#include <qbitmap.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <kapplication.h> -#include <qfile.h> -#include <qdom.h> +#include <tqfile.h> +#include <tqdom.h> #include "k9tools.h" -k9Menu::k9Menu(QObject *parent, const char *name) - : QObject(parent, name),m_format(PAL) { +k9Menu::k9Menu(TQObject *tqparent, const char *name) + : TQObject(tqparent, name),m_format(PAL) { m_buttons.setAutoDelete(false); - m_canvas=new QCanvas(this); - QPixmap pix(720,576); - pix.fill(Qt::black); - m_canvas->setBackgroundPixmap(pix); + m_canvas=new TQCanvas(this); + TQPixmap pix(720,576); + pix.fill(TQt::black); + m_canvas->tqsetBackgroundPixmap(pix); m_startScript=m_startScript2=m_endScript=""; } @@ -46,48 +46,48 @@ k9MenuButton *k9Menu::addButton() { -void k9Menu::createMenus(QDomElement *_rootNode) { +void k9Menu::createMenus(TQDomElement *_rootNode) { m_config=new k9Config(); int height=m_format==PAL?576:480; - QImage img; + TQImage img; //create menu image - QCanvasItemList l=m_canvas->allItems(); - for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { - if ( (*it)->rtti() > 1001 || (*it)->rtti()==QCanvasItem::Rtti_Rectangle ) + TQCanvasItemList l=m_canvas->allItems(); + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + if ( (*it)->rtti() > 1001 || (*it)->rtti()==TQCanvasItem::Rtti_Rectangle ) (*it)->hide(); } - QPixmap pixbg(720,height); - QPainter pbg(&pixbg); + TQPixmap pixbg(720,height); + TQPainter pbg(&pixbg); m_canvas->resize(720,height); m_canvas->update(); - m_canvas->drawArea(QRect(0,0,720,height),&pbg); + m_canvas->drawArea(TQRect(0,0,720,height),&pbg); //create the hilite picture int lineWidth=2; - img.create(720,height,8,3,QImage::IgnoreEndian); - QPixmap pixhi; + img.create(720,height,8,3,TQImage::IgnoreEndian); + TQPixmap pixhi; pixhi.convertFromImage(img,0); - pixhi.fill(Qt::white); - QPainter phi(&pixhi); - QPen penhi; + pixhi.fill(TQt::white); + TQPainter phi(&pixhi); + TQPen penhi; penhi.setColor(m_config->getPrefButtonHiliteColor()); penhi.setWidth(lineWidth*2); phi.setPen(penhi); - phi.setBrush(Qt::NoBrush); - //create the hilite mask - QBitmap mask(720,height); - mask.fill(Qt::color0); - QPainter pmk(&mask); - QPen penmk; - penmk.setColor(Qt::color1); + phi.setBrush(TQt::NoBrush); + //create the hilite tqmask + TQBitmap tqmask(720,height); + tqmask.fill(TQt::color0); + TQPainter pmk(&tqmask); + TQPen penmk; + penmk.setColor(TQt::color1); penmk.setWidth(lineWidth*2); pmk.setPen(penmk); - pmk.setBrush(Qt::NoBrush); + pmk.setBrush(TQt::NoBrush); //draw buttons for (k9MenuButton *button=m_buttons.first();button;button=m_buttons.next()) { @@ -99,14 +99,14 @@ void k9Menu::createMenus(QDomElement *_rootNode) { pbg.end(); phi.end(); pmk.end(); - pixhi.setMask(mask); + pixhi.setMask(tqmask); //save menu image - QString bgFileName=m_workDir+KApplication::randomString(8)+".jpg"; - QString hiFileName=m_workDir+KApplication::randomString(8)+".png"; - QString m2vFileName= m_workDir+KApplication::randomString(8)+".m2v"; - QString mpaFileName= m_workDir+KApplication::randomString(8)+".m2v"; - QString mpgFileName= m_workDir+KApplication::randomString(8)+".mpg"; + TQString bgFileName=m_workDir+KApplication::randomString(8)+".jpg"; + TQString hiFileName=m_workDir+KApplication::randomString(8)+".png"; + TQString m2vFileName= m_workDir+KApplication::randomString(8)+".m2v"; + TQString mpaFileName= m_workDir+KApplication::randomString(8)+".m2v"; + TQString mpgFileName= m_workDir+KApplication::randomString(8)+".mpg"; pixbg.save(bgFileName,"JPEG",-1); pixhi.save(hiFileName,"PNG",-1); @@ -117,17 +117,17 @@ void k9Menu::createMenus(QDomElement *_rootNode) { spumux(hiFileName,mpgFileName); appendMenu(_rootNode); -// mask.save(m_workDir+"/mask.bmp","BMP",-1); +// tqmask.save(m_workDir+"/tqmask.bmp","BMP",-1); - QFile::remove(bgFileName); - QFile::remove(m2vFileName); - QFile::remove(mpaFileName); - QFile::remove(mpgFileName); - QFile::remove(hiFileName); + TQFile::remove(bgFileName); + TQFile::remove(m2vFileName); + TQFile::remove(mpaFileName); + TQFile::remove(mpgFileName); + TQFile::remove(hiFileName); delete m_config; } -void k9Menu::convertJpegToMpeg(const QString &_imageJpg,const QString &_imageMpg) { +void k9Menu::convertJpegToMpeg(const TQString &_imageJpg,const TQString &_imageMpg) { k9Process *process=new k9Process(0,0); process->setWorkingDirectory(m_workDir); process->setUseShell(true); @@ -146,7 +146,7 @@ void k9Menu::convertJpegToMpeg(const QString &_imageJpg,const QString &_imageMpg qDebug(process->debug().latin1()); } -void k9Menu::createAudio(const QString & _audioFile) { +void k9Menu::createAudio(const TQString & _audioFile) { k9Process *process=new k9Process(0,0); process->setWorkingDirectory(m_workDir); process->setUseShell(true); @@ -161,7 +161,7 @@ void k9Menu::createAudio(const QString & _audioFile) { qDebug("error creating audio stream"); } } -void k9Menu::multiplex(const QString &_audio, const QString &_video, const QString _result) { +void k9Menu::multiplex(const TQString &_audio, const TQString &_video, const TQString _result) { k9Process *process=new k9Process(0,0); process->setWorkingDirectory(m_workDir); process->setUseShell(true); @@ -173,12 +173,12 @@ void k9Menu::multiplex(const QString &_audio, const QString &_video, const QStri } } -void k9Menu::spumux(const QString &_hiFileName,const QString &_mpgFileName) { - QDomElement stream,spu; +void k9Menu::spumux(const TQString &_hiFileName,const TQString &_mpgFileName) { + TQDomElement stream,spu; - QDomDocument xml; + TQDomDocument xml; - QDomElement root = xml.createElement( "subpictures" ); + TQDomElement root = xml.createElement( "subpictures" ); xml.appendChild( root ); stream=xml.createElement("stream"); @@ -200,20 +200,20 @@ void k9Menu::spumux(const QString &_hiFileName,const QString &_mpgFileName) { int i=1; for (k9MenuButton *button=m_buttons.first();button;button=m_buttons.next()) { - QDomElement eButton = xml.createElement("button"); + TQDomElement eButton = xml.createElement("button"); spu.appendChild(eButton); - eButton.setAttribute("name",QString("button%1").arg(i)); - eButton.setAttribute("x0", QString::number(button->getLeft())); - eButton.setAttribute("y0",QString::number(button->getTop())); - eButton.setAttribute("x1",QString::number(button->getLeft()+button->getWidth())); - eButton.setAttribute("y1",QString::number(button->getTop()+button->getHeight())); + eButton.setAttribute("name",TQString("button%1").tqarg(i)); + eButton.setAttribute("x0", TQString::number(button->getLeft())); + eButton.setAttribute("y0",TQString::number(button->getTop())); + eButton.setAttribute("x1",TQString::number(button->getLeft()+button->getWidth())); + eButton.setAttribute("y1",TQString::number(button->getTop()+button->getHeight())); i++; } - QString spuFileName(m_workDir + KApplication::randomString(8)+ ".xml"); - QFile file( spuFileName ); + TQString spuFileName(m_workDir + KApplication::randomString(8)+ ".xml"); + TQFile file( spuFileName ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); xml.save(stream,1); file.close(); } @@ -233,10 +233,10 @@ void k9Menu::spumux(const QString &_hiFileName,const QString &_mpgFileName) { file.remove(); } -void k9Menu::appendMenu(QDomElement *_rootNode) { - QDomDocument doc=_rootNode->ownerDocument(); - QDomNodeList l=_rootNode->elementsByTagName("menus"); - QDomNode menus; +void k9Menu::appendMenu(TQDomElement *_rootNode) { + TQDomDocument doc=_rootNode->ownerDocument(); + TQDomNodeList l=_rootNode->elementsByTagName("menus"); + TQDomNode menus; if (l.count()==0) { menus=doc.createElement("menus"); _rootNode->appendChild(menus); @@ -244,36 +244,36 @@ void k9Menu::appendMenu(QDomElement *_rootNode) { menus=l.item(0); } - QDomElement pgc=doc.createElement("pgc"); + TQDomElement pgc=doc.createElement("pgc"); menus.appendChild(pgc); - QDomElement pre=doc.createElement("pre"); + TQDomElement pre=doc.createElement("pre"); pgc.appendChild(pre); - QDomText txt=doc.createTextNode(m_startScript +m_startScript2); + TQDomText txt=doc.createTextNode(m_startScript +m_startScript2); pre.appendChild(txt); - QDomElement vob=doc.createElement("vob"); + TQDomElement vob=doc.createElement("vob"); pgc.appendChild(vob); vob.setAttribute("file",m_menuFileName); vob.setAttribute("pause","inf"); int i=1; for (k9MenuButton *button=m_buttons.first();button;button=m_buttons.next()) { - QDomElement eButton = doc.createElement("button"); + TQDomElement eButton = doc.createElement("button"); pgc.appendChild(eButton); - QDomText eButtonTxt=doc.createTextNode(button->getScript()); + TQDomText eButtonTxt=doc.createTextNode(button->getScript()); eButton.appendChild(eButtonTxt); - eButton.setAttribute("name",QString("button%1").arg(i)); + eButton.setAttribute("name",TQString("button%1").tqarg(i)); i++; } } -QString k9Menu::getWorkDir() const { +TQString k9Menu::getWorkDir() const { return m_workDir; } -void k9Menu::setWorkDir(const QString& _value) { +void k9Menu::setWorkDir(const TQString& _value) { m_workDir = _value; } @@ -283,51 +283,51 @@ void k9Menu::setFormat(const eFormat& _value) { } -QString k9Menu::getMenuFileName() const { +TQString k9Menu::getMenuFileName() const { return m_menuFileName; } -void k9Menu::setMenuFileName(const QString& _value) { +void k9Menu::setMenuFileName(const TQString& _value) { m_menuFileName = _value; } -QCanvas* k9Menu::getCanvas() const { +TQCanvas* k9Menu::getCanvas() const { return m_canvas; } -void k9Menu::setCanvas(QCanvas* _value) { +void k9Menu::setCanvas(TQCanvas* _value) { m_canvas = _value; } -void k9Menu::setStartScript(const QString &_value) { +void k9Menu::setStartScript(const TQString &_value) { m_startScript=_value; } -QString k9Menu::getStartScript() const { +TQString k9Menu::getStartScript() const { return m_startScript; } -void k9Menu::setStartScript2(const QString &_value) { +void k9Menu::setStartScript2(const TQString &_value) { m_startScript2=_value; } -QString k9Menu::getStartScript2() const { +TQString k9Menu::getStartScript2() const { return m_startScript2; } -QString k9Menu::getEndScript() const { +TQString k9Menu::getEndScript() const { return m_endScript; } -void k9Menu::setEndScript(const QString& _value) { +void k9Menu::setEndScript(const TQString& _value) { m_endScript = _value; } |