summaryrefslogtreecommitdiffstats
path: root/noatun/modules/winskin/waSkinModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'noatun/modules/winskin/waSkinModel.cpp')
-rw-r--r--noatun/modules/winskin/waSkinModel.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/noatun/modules/winskin/waSkinModel.cpp b/noatun/modules/winskin/waSkinModel.cpp
index ff53b4e6..bbe20a39 100644
--- a/noatun/modules/winskin/waSkinModel.cpp
+++ b/noatun/modules/winskin/waSkinModel.cpp
@@ -13,9 +13,9 @@
#include <config.h>
-#include <qdir.h>
-#include <qstringlist.h>
-#include <qbitmap.h>
+#include <tqdir.h>
+#include <tqstringlist.h>
+#include <tqbitmap.h>
#include <kdebug.h>
#include <kstandarddirs.h>
@@ -39,7 +39,7 @@ int digit_height;
struct WaPixmapEntry {
const char *filename;
- QPixmap *pixmap;
+ TQPixmap *pixmap;
};
WaPixmapEntry waPixmapEntries[11] = {
@@ -74,15 +74,15 @@ WaSkinModel::~WaSkinModel()
delete colorScheme;
}
-bool WaSkinModel::load(QString skinDir)
+bool WaSkinModel::load(TQString skinDir)
{
bool success = true;
- QDir dir(skinDir);
+ TQDir dir(skinDir);
if (findFile(dir, "main.bmp").isEmpty()) {
// Ack, our skin dir doesn't exist, fall back to the default
- dir = QDir(KGlobal::dirs()->findDirs("data", "noatun/skins/winamp/" + WaSkin::defaultSkin())[0]);
+ dir = TQDir(KGlobal::dirs()->findDirs("data", "noatun/skins/winamp/" + WaSkin::defaultSkin())[0]);
success = false;
}
@@ -105,27 +105,27 @@ bool WaSkinModel::load(QString skinDir)
// Filename -must- be lowercase, which is an nice optimization, since
// this is a private API, and all our filenames are internally lowercase
// anyway
-QString WaSkinModel::findFile(const QDir &dir, const QString &filename) {
- QFileInfo fileInfo;
- QString ret = "";
+TQString WaSkinModel::findFile(const TQDir &dir, const TQString &filename) {
+ TQFileInfo fileInfo;
+ TQString ret = "";
- QStringList strList = dir.entryList();
+ TQStringList strList = dir.entryList();
- for (QStringList::iterator file = strList.begin(); file != strList.end(); file++) {
- QFileInfo fileInfo(*file);
+ for (TQStringList::iterator file = strList.begin(); file != strList.end(); file++) {
+ TQFileInfo fileInfo(*file);
if (fileInfo.isDir())
continue;
if (fileInfo.filePath().lower() == filename)
- return dir.absPath() + "/" + QString(fileInfo.filePath());
+ return dir.absPath() + "/" + TQString(fileInfo.filePath());
}
return "";
}
-void WaSkinModel::loadColors(const QDir &dir) {
- QString colorFile = findFile(dir, "viscolor.txt");
+void WaSkinModel::loadColors(const TQDir &dir) {
+ TQString colorFile = findFile(dir, "viscolor.txt");
if (colorScheme) {
delete colorScheme;
@@ -134,8 +134,8 @@ void WaSkinModel::loadColors(const QDir &dir) {
colorScheme = new WaColor(colorFile);
}
-void WaSkinModel::loadRegion(const QDir &dir) {
- QString regionFile = findFile(dir, "region.txt");
+void WaSkinModel::loadRegion(const TQDir &dir) {
+ TQString regionFile = findFile(dir, "region.txt");
if (windowRegion) {
delete windowRegion;
@@ -145,12 +145,12 @@ void WaSkinModel::loadRegion(const QDir &dir) {
windowRegion = new WaRegion(regionFile);
}
-int WaSkinModel::getPixmap(const QDir &dir, QString fname,
- QPixmap *target)
+int WaSkinModel::getPixmap(const TQDir &dir, TQString fname,
+ TQPixmap *target)
{
- QFileInfo fileInfo;
- QStringList strList = dir.entryList();
- QString abspath;
+ TQFileInfo fileInfo;
+ TQStringList strList = dir.entryList();
+ TQString abspath;
abspath = findFile(dir, fname);
@@ -161,46 +161,46 @@ int WaSkinModel::getPixmap(const QDir &dir, QString fname,
// now the filename mapping 1.8x -> 2.0
if (fname == "volume.bmp")
- return WaSkinModel::getPixmap(dir, QString("volbar.bmp"), target);
+ return WaSkinModel::getPixmap(dir, TQString("volbar.bmp"), target);
if (fname == "numbers.bmp")
- return WaSkinModel::getPixmap(dir, QString("nums_ex.bmp"), target);
+ return WaSkinModel::getPixmap(dir, TQString("nums_ex.bmp"), target);
// Even 2.x themes can omit BALANCE, in which case we use VOLUME
if (fname == "balance.bmp")
- return WaSkinModel::getPixmap(dir, QString("volume.bmp"), target);
+ return WaSkinModel::getPixmap(dir, TQString("volume.bmp"), target);
return false;
}
-QRect WaSkinModel::getGeometry(int id) {
+TQRect WaSkinModel::getGeometry(int id) {
if ( (id < 0) || (id >= _WA_SKIN_ENTRIES) ) {
kdDebug() << "Array index out of range. WaSkinModel::getGeometry"<<endl;
exit(-1);
}
- return QRect(mapFromFile[id].x, mapFromFile[id].y,
+ return TQRect(mapFromFile[id].x, mapFromFile[id].y,
mapFromFile[id].width, mapFromFile[id].height);
}
-QRect WaSkinModel::getMapGeometry(int id) {
+TQRect WaSkinModel::getMapGeometry(int id) {
if ( (id < 0) || (id >= _WA_MAPPING_ENTRIES) ) {
kdDebug() << "Array index out of range. WaSkinModel::getMapGeometry"<<endl;
exit(-1);
}
- return QRect(mapToGui[id].x, mapToGui[id].y,
+ return TQRect(mapToGui[id].x, mapToGui[id].y,
mapToGui[id].width, mapToGui[id].height);
}
-void WaSkinModel::bltTo(int id, QPaintDevice *dest, int x, int y) {
+void WaSkinModel::bltTo(int id, TQPaintDevice *dest, int x, int y) {
bitBlt(dest, x, y, waPixmapEntries[mapFromFile[id].fileId].pixmap,
mapFromFile[id].x, mapFromFile[id].y,
mapFromFile[id].width, mapFromFile[id].height);
}
-void WaSkinModel::bltTo(int id, QPaintDevice *dest, int x, int y, int argument) {
+void WaSkinModel::bltTo(int id, TQPaintDevice *dest, int x, int y, int argument) {
if (id == _WA_SKIN_VOLUME_BAR) {
- QPixmap *pix = waPixmapEntries[_WA_FILE_VOLUME].pixmap;
+ TQPixmap *pix = waPixmapEntries[_WA_FILE_VOLUME].pixmap;
int nBar = int((float)argument * 27.0 / 100.0);
bitBlt(dest, x, y, pix, 0, 15 * nBar, 68, 13);
@@ -209,7 +209,7 @@ void WaSkinModel::bltTo(int id, QPaintDevice *dest, int x, int y, int argument)
}
if (id == _WA_SKIN_BALANCE_BAR) {
- QPixmap *pix = waPixmapEntries[_WA_FILE_BALANCE].pixmap;
+ TQPixmap *pix = waPixmapEntries[_WA_FILE_BALANCE].pixmap;
argument = abs(argument);
@@ -222,7 +222,7 @@ void WaSkinModel::bltTo(int id, QPaintDevice *dest, int x, int y, int argument)
bltTo(id, dest, x, y);
}
-void WaSkinModel::getDigit(char number, QPaintDevice *dest, int x, int y) {
+void WaSkinModel::getDigit(char number, TQPaintDevice *dest, int x, int y) {
if (number=='-') {
bltTo(_WA_SKIN_NUMBERS_MINUS, dest, x, y);
return;
@@ -235,7 +235,7 @@ void WaSkinModel::getDigit(char number, QPaintDevice *dest, int x, int y) {
}
// number
- QPixmap *pix = waPixmapEntries[mapFromFile[_WA_SKIN_NUMBERS].fileId].pixmap;
+ TQPixmap *pix = waPixmapEntries[mapFromFile[_WA_SKIN_NUMBERS].fileId].pixmap;
// ordinary number:
int index = number - '0';
@@ -247,8 +247,8 @@ void WaSkinModel::getDigit(char number, QPaintDevice *dest, int x, int y) {
return;
}
-void WaSkinModel::getText(char text, QPaintDevice * dest, int x, int y) {
- QPixmap *pix = waPixmapEntries[_WA_FILE_TEXT].pixmap;
+void WaSkinModel::getText(char text, TQPaintDevice * dest, int x, int y) {
+ TQPixmap *pix = waPixmapEntries[_WA_FILE_TEXT].pixmap;
text = deaccent(text);
@@ -378,11 +378,11 @@ void WaSkinModel::getText(char text, QPaintDevice * dest, int x, int y) {
bitBlt(dest, x, y,pix,(10*5),12,5,6);
}
-void WaSkinModel::paintBackgroundTo(int mapping, QPaintDevice *dest, int x, int y)
+void WaSkinModel::paintBackgroundTo(int mapping, TQPaintDevice *dest, int x, int y)
{
- QPixmap *pix = waPixmapEntries[mapFromFile[_WA_SKIN_MAIN].fileId].pixmap;
- QRect main_rect = getGeometry(_WA_SKIN_MAIN);
- QRect dest_rect = getMapGeometry(mapping);
+ TQPixmap *pix = waPixmapEntries[mapFromFile[_WA_SKIN_MAIN].fileId].pixmap;
+ TQRect main_rect = getGeometry(_WA_SKIN_MAIN);
+ TQRect dest_rect = getMapGeometry(mapping);
int source_x = main_rect.x() + dest_rect.x() + x;
int source_y = main_rect.y() + dest_rect.y() + y;
@@ -418,38 +418,38 @@ void WaSkinModel::resetSkinModel() {
}
-QChar WaSkinModel::deaccent(QChar input) {
- if (QString("Á").contains(input))
+TQChar WaSkinModel::deaccent(TQChar input) {
+ if (TQString("Á").contains(input))
return 'A';
- if (QString("ÉË").contains(input))
+ if (TQString("ÉË").contains(input))
return 'E';
- if (QString("ÍÎ").contains(input))
+ if (TQString("ÍÎ").contains(input))
return 'I';
- if (QString("ÔÓ").contains(input))
+ if (TQString("ÔÓ").contains(input))
return 'O';
- if (QString("ÚÜ").contains(input))
+ if (TQString("ÚÜ").contains(input))
return 'U';
if (input == 'Ý')
return 'Y';
- if (QString("áâ").contains(input))
+ if (TQString("áâ").contains(input))
return 'a';
- if (QString("éë").contains(input))
+ if (TQString("éë").contains(input))
return 'e';
- if (QString("îí").contains(input))
+ if (TQString("îí").contains(input))
return 'i';
- if (QString("ôó").contains(input))
+ if (TQString("ôó").contains(input))
return 'o';
- if (QString("úü").contains(input))
+ if (TQString("úü").contains(input))
return 'u';
return input;