summaryrefslogtreecommitdiffstats
path: root/ksirc/KSTicker/ksticker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ksirc/KSTicker/ksticker.cpp')
-rw-r--r--ksirc/KSTicker/ksticker.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/ksirc/KSTicker/ksticker.cpp b/ksirc/KSTicker/ksticker.cpp
index dc65118a..e6199427 100644
--- a/ksirc/KSTicker/ksticker.cpp
+++ b/ksirc/KSTicker/ksticker.cpp
@@ -1,10 +1,10 @@
#include <stdlib.h>
-#include <qpainter.h>
-#include <qframe.h>
-#include <qpaintdevice.h>
-#include <qcursor.h>
-#include <qtooltip.h>
-#include <qregexp.h>
+#include <tqpainter.h>
+#include <tqframe.h>
+#include <tqpaintdevice.h>
+#include <tqcursor.h>
+#include <tqtooltip.h>
+#include <tqregexp.h>
#include <kapplication.h>
#include <kfontdialog.h>
@@ -21,13 +21,13 @@
#include <kwin.h>
#include <kdebug.h>
-KSTicker::KSTicker(QWidget * parent, const char * name, WFlags f)
-: QFrame(parent, name, f)
+KSTicker::KSTicker(TQWidget * parent, const char * name, WFlags f)
+: TQFrame(parent, name, f)
{
pHeight = 1;
- pic = new QPixmap(); // create pic map here, resize it later though.
+ pic = new TQPixmap(); // create pic map here, resize it later though.
// pic->setBackgroundMode(TransparentMode);
KConfig *conf = kapp->config();
@@ -36,7 +36,7 @@ KSTicker::KSTicker(QWidget * parent, const char * name, WFlags f)
bAtEnd = FALSE;
setFont(conf->readFontEntry("Font", &ksopts->defaultFont));
- ourFont = font(); //QFont("Courier");
+ ourFont = font(); //TQFont("Courier");
setFont(ourFont);
setMinimumSize(100, 10);
setFixedHeight((fontMetrics().height()+fontMetrics().descent()*2)*pHeight);
@@ -54,13 +54,13 @@ KSTicker::KSTicker(QWidget * parent, const char * name, WFlags f)
currentChar = 0;
chars = this->width() / onechar;
- popup = new QPopupMenu();
- popup->insertItem(i18n( "Font..." ), this, SLOT(fontSelector()));
- popup->insertItem(i18n( "Scroll Rate..." ), this, SLOT(scrollRate()));
- iScrollItem = popup->insertItem(i18n( "Scroll Constantly" ), this, SLOT(scrollConstantly()));
+ popup = new TQPopupMenu();
+ popup->insertItem(i18n( "Font..." ), this, TQT_SLOT(fontSelector()));
+ popup->insertItem(i18n( "Scroll Rate..." ), this, TQT_SLOT(scrollRate()));
+ iScrollItem = popup->insertItem(i18n( "Scroll Constantly" ), this, TQT_SLOT(scrollConstantly()));
popup->setItemChecked(iScrollItem, bScrollConstantly);
popup->insertSeparator();
- popup->insertItem(i18n( "Return to Normal Mode" ), this, SIGNAL(doubleClick()));
+ popup->insertItem(i18n( "Return to Normal Mode" ), this, TQT_SIGNAL(doubleClick()));
currentStr = "";
@@ -101,12 +101,12 @@ void KSTicker::show()
*/
// ### FIXME: port to kwin
//KWM::setDecoration(winId(), KWM::tinyDecoration);
- QSize size = this->size();
- size.setHeight(QFontMetrics(font()).height()+10);
- setFixedHeight(QFontMetrics(font()).height()+10);
+ TQSize size = this->size();
+ size.setHeight(TQFontMetrics(font()).height()+10);
+ setFixedHeight(TQFontMetrics(font()).height()+10);
resize(size);
- QFrame::show();
+ TQFrame::show();
if(currentStr.length() != 0)
startTicker();
currentChar = 0;
@@ -116,16 +116,16 @@ void KSTicker::show()
void KSTicker::hide()
{
killTimers();
- QFrame::hide();
+ TQFrame::hide();
}
void KSTicker::iconify()
{
- QFrame::showMinimized();
+ TQFrame::showMinimized();
killTimers();
}
-void KSTicker::setString(QString str)
+void KSTicker::setString(TQString str)
{
strlist.clear();
strlist.append(str);
@@ -133,24 +133,24 @@ void KSTicker::setString(QString str)
startTicker();
}
-void KSTicker::mergeString(QString str, QColor c)
+void KSTicker::mergeString(TQString str, TQColor c)
{
int num = KSPainter::colour2num(c);
if(num != -1){
- str.prepend(QString("~%1").arg(num));
+ str.prepend(TQString("~%1").arg(num));
}
mergeString(str);
}
-void KSTicker::mergeString(QString str)
+void KSTicker::mergeString(TQString str)
{
- QRegExp rx("~n(\\S+)~n");
+ TQRegExp rx("~n(\\S+)~n");
if(rx.search(str) >= 0){
int value = nickColourMaker::colourMaker()->findIdx(rx.cap(1));
if(value >= 0){
- QString newText = QString("~%1\\1~c").arg(value);
+ TQString newText = TQString("~%1\\1~c").arg(value);
str.replace(rx, newText);
}
}
@@ -160,7 +160,7 @@ void KSTicker::mergeString(QString str)
if(strlist.count() > 5){
int found = 0;
- QStringList::Iterator it = strlist.begin();
+ TQStringList::Iterator it = strlist.begin();
for(; it != strlist.end(); it++){
if(((*it).find(ksopts->server["global"].nick, 0, FALSE) == -1) &&
((*it).find(ksopts->server["global"].altNick, 0, FALSE) == -1)){
@@ -179,10 +179,10 @@ void KSTicker::mergeString(QString str)
if(bScrollConstantly == FALSE)
startTicker();
- QStringList sep = QStringList::split(" ", stripCols(str));
+ TQStringList sep = TQStringList::split(" ", stripCols(str));
int len = 0;
- QString brok;
- QStringList::Iterator it = sep.begin();
+ TQString brok;
+ TQStringList::Iterator it = sep.begin();
for(; it != sep.end(); ++it) {
brok += *it + " ";
len += (*it).length();
@@ -197,15 +197,15 @@ void KSTicker::mergeString(QString str)
tipbuffer.append(brok);
while(tipbuffer.count() > 10)
tipbuffer.pop_front();
- QString tip = tipbuffer.join("\n");
+ TQString tip = tipbuffer.join("\n");
-// QToolTip::remove(this);
- QToolTip::add(this, tip);
+// TQToolTip::remove(this);
+ TQToolTip::add(this, tip);
}
-void KSTicker::timerEvent(QTimerEvent *)
+void KSTicker::timerEvent(TQTimerEvent *)
{
if((uint)currentChar >= currentStr.length()){
if(strlist.isEmpty()){
@@ -234,7 +234,7 @@ void KSTicker::timerEvent(QTimerEvent *)
static BGMode bgmode = TransparentMode;
bitBlt(pic, -tickStep, 0, pic);
- QPainter p(pic);
+ TQPainter p(pic);
cOffset += tickStep;
if(cOffset >= onechar){
@@ -243,8 +243,8 @@ void KSTicker::timerEvent(QTimerEvent *)
while(((currentStr[currentChar] == '~') || (currentStr[currentChar] == 0x03))
&& (step > 0)){
step = 1; // reset in case it's our second, or more loop.
- QString text = currentStr.mid(currentChar);
- QString buf = "";
+ TQString text = currentStr.mid(currentChar);
+ TQString buf = "";
if((text[step] >= '0') &&
(text[step] <= '9')) {
@@ -344,7 +344,7 @@ void KSTicker::timerEvent(QTimerEvent *)
}
- QFont fnt = font();
+ TQFont fnt = font();
fnt.setBold(bold);
fnt.setUnderline(underline);
fnt.setItalic(italics);
@@ -364,20 +364,20 @@ void KSTicker::timerEvent(QTimerEvent *)
bitBlt(this, 0, descent, pic);
}
-void KSTicker::paintEvent( QPaintEvent *)
+void KSTicker::paintEvent( TQPaintEvent *)
{
if(isVisible() == FALSE)
return;
bitBlt(this, 0, descent, pic);
}
-void KSTicker::resizeEvent( QResizeEvent *e)
+void KSTicker::resizeEvent( TQResizeEvent *e)
{
- QFrame::resizeEvent(e);
+ TQFrame::resizeEvent(e);
onechar = fontMetrics().width("X");
chars = this->width() / onechar;
killTimers();
- QPixmap *new_pic = new QPixmap(width() + onechar, height());
+ TQPixmap *new_pic = new TQPixmap(width() + onechar, height());
new_pic->fill(backgroundColor());
bitBlt(new_pic,
new_pic->width() - pic->width(), 0,
@@ -390,7 +390,7 @@ void KSTicker::resizeEvent( QResizeEvent *e)
startTicker();
}
-void KSTicker::closeEvent( QCloseEvent *)
+void KSTicker::closeEvent( TQCloseEvent *)
{
emit closing();
killTimers();
@@ -408,18 +408,18 @@ void KSTicker::stopTicker()
killTimers();
}
-void KSTicker::mouseDoubleClickEvent( QMouseEvent * )
+void KSTicker::mouseDoubleClickEvent( TQMouseEvent * )
{
emit doubleClick();
}
-void KSTicker::mousePressEvent( QMouseEvent *e)
+void KSTicker::mousePressEvent( TQMouseEvent *e)
{
if(e->button() == RightButton){
popup->popup(this->cursor().pos());
}
else{
- QFrame::mousePressEvent(e);
+ TQFrame::mousePressEvent(e);
}
}
void KSTicker::fontSelector()
@@ -434,8 +434,8 @@ void KSTicker::scrollRate()
{
SpeedDialog *sd = new SpeedDialog(tickRate, tickStep);
sd->setLimit(5, 200, 1, onechar);
- connect(sd, SIGNAL(stateChange(int, int)),
- this, SLOT(setSpeed(int, int)));
+ connect(sd, TQT_SIGNAL(stateChange(int, int)),
+ this, TQT_SLOT(setSpeed(int, int)));
sd->show();
}
@@ -451,7 +451,7 @@ void KSTicker::scrollConstantly()
conf->sync();
}
-void KSTicker::updateFont(const QFont &font){
+void KSTicker::updateFont(const TQFont &font){
setFont(font);
setFixedHeight((fontMetrics().height()+fontMetrics().descent()*2)*pHeight);
resize(fontMetrics().width("X")*chars,
@@ -474,18 +474,18 @@ void KSTicker::speed(int *_tickRate, int *_tickStep){
*_tickStep = tickStep;
}
-void KSTicker::setBackgroundColor ( const QColor &c )
+void KSTicker::setBackgroundColor ( const TQColor &c )
{
- QFrame::setBackgroundColor(c);
+ TQFrame::setBackgroundColor(c);
pic->fill(c);
bitBlt(this, 0,0, pic);
defbg = backgroundColor();
bg = backgroundColor();
}
-void KSTicker::setPalette ( const QPalette & p )
+void KSTicker::setPalette ( const TQPalette & p )
{
- QFrame::setPalette(p);
+ TQFrame::setPalette(p);
pic->fill(backgroundColor());
bitBlt(this, 0,0, pic);
@@ -495,10 +495,10 @@ void KSTicker::setPalette ( const QPalette & p )
fg = foregroundColor();
}
-QString KSTicker::stripCols( QString str )
+TQString KSTicker::stripCols( TQString str )
{
uint i = 0;
- QString ret;
+ TQString ret;
for(i = 0; i < str.length(); i++){
if(((str[i] == '~') || (str[i] == 0x03))){
if((str[i+1] >= '0') &&