summaryrefslogtreecommitdiffstats
path: root/arts/builder/module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'arts/builder/module.cpp')
-rw-r--r--arts/builder/module.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/arts/builder/module.cpp b/arts/builder/module.cpp
index 94f56591..5432492e 100644
--- a/arts/builder/module.cpp
+++ b/arts/builder/module.cpp
@@ -24,8 +24,8 @@
#include <stdio.h>
#include <arts/debug.h>
-#include <qpalette.h>
-#include <qdrawutil.h>
+#include <tqpalette.h>
+#include <tqdrawutil.h>
#include <kiconloader.h>
#include <algorithm>
@@ -56,20 +56,20 @@ bool ModulePort::down()
return (PortDesc.isConnected() || PortDesc.hasValue() || selected);
}
-QColor ModulePort::color(bool isInterface)
+TQColor ModulePort::color(bool isInterface)
{
- if(selected) return QColor(255, 165, 0);
+ if(selected) return TQColor(255, 165, 0);
if(PortDesc.hasValue())
{
- if(isinitarg) return QColor(180, 180, 180);
- return QColor(100, 100, 255);
+ if(isinitarg) return TQColor(180, 180, 180);
+ return TQColor(100, 100, 255);
}
- if(isinitarg) return QColor(128, 128, 128);
+ if(isinitarg) return TQColor(128, 128, 128);
- if(isInterface) return QColor(100, 100, 100);
- return QColor(43, 43, 168);
+ if(isInterface) return TQColor(100, 100, 100);
+ return TQColor(43, 43, 168);
}
Module::Module(Arts::ModuleDesc module, Arts::StructureDesc structuredesc,
@@ -94,7 +94,7 @@ Module::Module(const Arts::ModuleInfo& minfo, Arts::StructureDesc structuredesc,
void Module::initModule()
{
- QString iconname;
+ TQString iconname;
KIconLoader iconloader;
_selected = false;
@@ -107,12 +107,12 @@ void Module::initModule()
iconname = _name + ".xpm";
- _pixmap = new QPixmap(iconloader.loadIcon(iconname, KIcon::User));
+ _pixmap = new TQPixmap(iconloader.loadIcon(iconname, KIcon::User));
if(!_pixmap->height())
{
iconname = _name + ".png";
delete _pixmap;
- _pixmap = new QPixmap( iconloader.loadIcon( iconname, KIcon::User ) );
+ _pixmap = new TQPixmap( iconloader.loadIcon( iconname, KIcon::User ) );
if( !_pixmap->height() )
{
delete _pixmap;
@@ -125,12 +125,12 @@ void Module::initModule()
{
iconname = iconname.mid(6);
- _pixmap = new QPixmap(iconloader.loadIcon(iconname, KIcon::User));
+ _pixmap = new TQPixmap(iconloader.loadIcon(iconname, KIcon::User));
if(!_pixmap->height())
{
iconname.replace( iconname.length() - 4, 3, "png" );
delete _pixmap;
- _pixmap = new QPixmap(iconloader.loadIcon(iconname, KIcon::User));
+ _pixmap = new TQPixmap(iconloader.loadIcon(iconname, KIcon::User));
if( !_pixmap->height() )
{
delete _pixmap;
@@ -139,10 +139,10 @@ void Module::initModule()
}
}
/*
- FILE *test = fopen(QFile::encodeName(iconname), "r");
+ FILE *test = fopen(TQFile::encodeName(iconname), "r");
if(test)
{
- pixmap = new QPixmap(iconname);
+ pixmap = new TQPixmap(iconname);
fclose(test);
}
*/
@@ -229,24 +229,24 @@ bool Module::drawNeedsBackground(int segment)
return (segment == 0);
}
-void Module::drawSegment(QPainter *p, int cellsize, int segment)
+void Module::drawSegment(TQPainter *p, int cellsize, int segment)
{
int border = cellsize / 10; // for the logo
int ltop = (cellsize - border)/2;
int lbot = (cellsize + border)/2;
- QColor mcolor(43, 43, 168);
- QColor mcolorlight(164, 176, 242);
+ TQColor mcolor(43, 43, 168);
+ TQColor mcolorlight(164, 176, 242);
if(isInterface)
{
- mcolor = QColor(100, 100, 100);
- mcolorlight = QColor(160, 160, 160);
+ mcolor = TQColor(100, 100, 100);
+ mcolorlight = TQColor(160, 160, 160);
}
- QColorGroup g( Qt::white, Qt::blue, mcolorlight, mcolor.dark(), mcolor,
+ TQColorGroup g( Qt::white, Qt::blue, mcolorlight, mcolor.dark(), mcolor,
Qt::black, Qt::black );
- QBrush fill( mcolor );
- QPen textpen(QColor(255, 255, 180), 1);
+ TQBrush fill( mcolor );
+ TQPen textpen(TQColor(255, 255, 180), 1);
if(segment == 0)
{
@@ -263,9 +263,9 @@ void Module::drawSegment(QPainter *p, int cellsize, int segment)
float sx = (float)destsize/(float)_pixmap->width();
float sy = (float)destsize/(float)_pixmap->height();
- QWMatrix matrix;
+ TQWMatrix matrix;
matrix.scale(sx, sy);
- QPixmap pmscaled = _pixmap->xForm(matrix);
+ TQPixmap pmscaled = _pixmap->xForm(matrix);
p->drawPixmap(border*2, border*2, pmscaled);
}
return;
@@ -300,25 +300,25 @@ void Module::drawSegment(QPainter *p, int cellsize, int segment)
{
int border = cellsize/7;
int textwidth;
- QString label = DrawUtils::cropText(p, port->description,
+ TQString label = DrawUtils::cropText(p, port->description,
cellsize/2, textwidth);
- QBrush pbrush(port->color(isInterface));
+ TQBrush pbrush(port->color(isInterface));
- port->clickrect = QRect(border, direction * cellsize/2 + border,
+ port->clickrect = TQRect(border, direction * cellsize/2 + border,
cellsize/2 - 2*border, cellsize/2 - 2*border);
qDrawShadePanel(p, port->clickrect, g, port->down(), 2, &pbrush);
#if 0
- QBrush fillport(fill);
+ TQBrush fillport(fill);
if(port->isinitarg)
{
- fillport = QColor(128, 128, 128);
+ fillport = TQColor(128, 128, 128);
}
if(port->selected)
{
- QBrush fillorange(QColor(255, 165, 0));
+ TQBrush fillorange(TQColor(255, 165, 0));
qDrawShadePanel(p, port->clickrect, g, true, 2, &fillorange);
}
else
@@ -329,10 +329,10 @@ void Module::drawSegment(QPainter *p, int cellsize, int segment)
}
else if(port->PortDesc->hasValue())
{
- QBrush fillp(QColor(100, 100, 255));
+ TQBrush fillp(TQColor(100, 100, 255));
if(port->isinitarg)
{
- fillp = QColor(180, 180, 180);
+ fillp = TQColor(180, 180, 180);
}
qDrawShadePanel(p, port->clickrect, g, true, 2, &fillp);
}
@@ -356,10 +356,10 @@ void Module::drawSegment(QPainter *p, int cellsize, int segment)
{
// object type label
int textwidth;
- QString label = DrawUtils::cropText(p, _name, cellsize - 4, textwidth);
+ TQString label = DrawUtils::cropText(p, _name, cellsize - 4, textwidth);
p->setPen(textpen);
- p->fillRect(1, cellsize - 16, textwidth + 7, 15, QBrush(g.dark()));
+ p->fillRect(1, cellsize - 16, textwidth + 7, 15, TQBrush(g.dark()));
p->drawText(4, cellsize - 5, label);
// logo connection
@@ -373,7 +373,7 @@ void Module::drawSegment(QPainter *p, int cellsize, int segment)
if(selected())
{
- QPen pen(Qt::white, 1, Qt::DotLine);
+ TQPen pen(Qt::white, 1, Qt::DotLine);
p->setPen(pen);
p->drawLine(0, 0, cellsize - 1, 0);
@@ -412,7 +412,7 @@ ModulePort *Module::portAt(int segment, int x, int y)
ModulePort *port = findPort(segment, direction);
if(port)
{
- QPoint clickpoint(x, y);
+ TQPoint clickpoint(x, y);
if(port->clickrect.contains(clickpoint)) return port;
}
}
@@ -426,12 +426,12 @@ void Module::dumpPorts(list<ModulePort *>& ports)
for(i = outports.begin(); i != outports.end(); ++i) ports.push_back(*i);
}
-QPixmap *Module::pixmap()
+TQPixmap *Module::pixmap()
{
return _pixmap;
}
-QString Module::name()
+TQString Module::name()
{
return _name;
}