Conversion qt3 -> tqt3

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/1/head
gregory guy 4 years ago
parent 38eaf7209a
commit 2c9bc9b806
No known key found for this signature in database
GPG Key ID: 3BCCA0F7AB4536F4

@ -16,7 +16,7 @@ def generate( env ):
if 'configure' in env['TARGS']: if 'configure' in env['TARGS']:
xine_lib_test_source_file = """ xine_lib_test_source_file = """
#include <qstring.h> #include <ntqstring.h>
#include <xine.h> #include <xine.h>
int main( int argc, char **argv ) int main( int argc, char **argv )
@ -58,7 +58,7 @@ def generate( env ):
# this seems to import the user's CXXFLAGS, etc., which may break # this seems to import the user's CXXFLAGS, etc., which may break
confenv = env.Copy() confenv = env.Copy()
configure = confenv.Configure(custom_tests = {'CheckXineLib' : CheckXineLib, 'CheckKdeLibs' : CheckKdeLibs}, log_file='configure.log') configure = confenv.Configure(custom_tests = {'CheckXineLib' : CheckXineLib, 'CheckKdeLibs' : CheckKdeLibs}, log_file='configure.log')
confenv.AppendUnique(LIBS = 'qt-mt') confenv.AppendUnique(LIBS = 'tqt-mt')
confenv.AppendUnique(LINKFLAGS = '-L/usr/X11R6/lib') confenv.AppendUnique(LINKFLAGS = '-L/usr/X11R6/lib')
if not configure.CheckKdeLibs(): if not configure.CheckKdeLibs():

@ -146,15 +146,15 @@ def detect_kde(env):
## check for the qt and kde includes ## check for the qt and kde includes
print "Checking for the qt includes : ", print "Checking for the qt includes : ",
if qtincludes and os.path.isfile(qtincludes + "/qlayout.h"): if qtincludes and os.path.isfile(qtincludes + "/ntqlayout.h"):
# The user told where to look for and it looks valid # The user told where to look for and it looks valid
print GREEN + "ok " + qtincludes + NORMAL print GREEN + "ok " + qtincludes + NORMAL
else: else:
if os.path.isfile(qtdir + "/include/qlayout.h"): if os.path.isfile(qtdir + "/include/ntqlayout.h"):
# Automatic detection # Automatic detection
print GREEN + "ok " + qtdir + "/include/ " + NORMAL print GREEN + "ok " + qtdir + "/include/ " + NORMAL
qtincludes = qtdir + "/include/" qtincludes = qtdir + "/include/"
elif os.path.isfile("/usr/include/qt3/qlayout.h"): elif os.path.isfile("/usr/include/qt3/ntqlayout.h"):
# Debian probably # Debian probably
print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL
qtincludes = "/usr/include/qt3" qtincludes = "/usr/include/qt3"
@ -448,7 +448,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
env['QT_UIC_HFLAGS'] = '-L $QTPLUGINS -nounload' env['QT_UIC_HFLAGS'] = '-L $QTPLUGINS -nounload'
env['QT_UIC_CFLAGS'] = '$QT_UIC_HFLAGS -tr tr2i18n' env['QT_UIC_CFLAGS'] = '$QT_UIC_HFLAGS -tr tr2i18n'
env['QT_LIBS'] = 'qt-mt' env['QT_LIBS'] = 'tqt-mt'
env['LIBTOOL_FLAGS'] = '--silent --mode=compile --tag=CXX' env['LIBTOOL_FLAGS'] = '--silent --mode=compile --tag=CXX'

@ -50,7 +50,7 @@ KDEprogram( "codeine", app_sources, myenv )
KDEaddpaths( ['./', '../', '../../'], myenv ) KDEaddpaths( ['./', '../', '../../'], myenv )
## Necessary libraries to link against ## Necessary libraries to link against
KDEaddlibs( ['qt-mt', 'kio', 'kdecore', 'kdeui', 'xine', 'Xtst'], myenv ) KDEaddlibs( ['tqt-mt', 'kio', 'kdecore', 'kdeui', 'xine', 'Xtst'], myenv )
## This shows how to add other link flags to the program ## This shows how to add other link flags to the program
myenv['LINKFLAGS'].append('-L/usr/X11R6/lib') myenv['LINKFLAGS'].append('-L/usr/X11R6/lib')

@ -4,22 +4,22 @@
#include "actions.h" #include "actions.h"
#include "debug.h" #include "debug.h"
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qtoolbutton.h> #include <ntqtoolbutton.h>
#include "xineEngine.h" #include "xineEngine.h"
namespace Codeine namespace Codeine
{ {
PlayAction::PlayAction( QObject *receiver, const char *slot, KActionCollection *ac ) PlayAction::PlayAction( TQObject *receiver, const char *slot, KActionCollection *ac )
: KToggleAction( i18n("Play"), "player_play", Qt::Key_Space, receiver, slot, ac, "play" ) : KToggleAction( i18n("Play"), "player_play", TQt::Key_Space, receiver, slot, ac, "play" )
{} {}
void void
PlayAction::setChecked( bool b ) PlayAction::setChecked( bool b )
{ {
if( videoWindow()->state() == Engine::Empty && sender() && QCString(sender()->className()) == "KToolBarButton" ) { if( videoWindow()->state() == Engine::Empty && sender() && TQCString(sender()->className()) == "KToolBarButton" ) {
// clicking play when empty means open PlayMediaDialog, but we have to uncheck the toolbar button // clicking play when empty means open PlayMediaDialog, but we have to uncheck the toolbar button
// as KDElibs sets that checked automatically.. // as KDElibs sets that checked automatically..
((QToolButton*)sender())->setOn( false ); ((TQToolButton*)sender())->setOn( false );
} }
else else
KToggleAction::setChecked( b ); KToggleAction::setChecked( b );

@ -16,7 +16,7 @@ namespace Codeine
class PlayAction : public KToggleAction class PlayAction : public KToggleAction
{ {
public: public:
PlayAction( QObject *receiver, const char *slot, KActionCollection* ); PlayAction( TQObject *receiver, const char *slot, KActionCollection* );
protected: protected:
virtual void setChecked( bool ); virtual void setChecked( bool );

@ -4,50 +4,50 @@
#include "adjustSizeButton.h" #include "adjustSizeButton.h"
#include "extern.h" #include "extern.h"
#include <kpushbutton.h> #include <kpushbutton.h>
#include <qapplication.h> #include <ntqapplication.h>
#include <qevent.h> #include <ntqevent.h>
#include <qlabel.h> #include <ntqlabel.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qpainter.h> #include <ntqpainter.h>
#include "theStream.h" #include "theStream.h"
#include "xineEngine.h" //videoWindow() #include "xineEngine.h" //videoWindow()
QString i18n( const char *text ); TQString i18n( const char *text );
namespace Codeine namespace Codeine
{ {
AdjustSizeButton::AdjustSizeButton( QWidget *parent ) AdjustSizeButton::AdjustSizeButton( TQWidget *parent )
: QFrame( parent ) : TQFrame( parent )
, m_counter( 0 ) , m_counter( 0 )
, m_stage( 1 ) , m_stage( 1 )
, m_offset( 0 ) , m_offset( 0 )
{ {
parent->installEventFilter( this ); parent->installEventFilter( this );
setPalette( QApplication::palette() ); //videoWindow has different palette setPalette( TQApplication::palette() ); //videoWindow has different palette
setFrameStyle( QFrame::Plain | QFrame::Box ); setFrameStyle( TQFrame::Plain | TQFrame::Box );
m_preferred = new KPushButton( KGuiItem( i18n("Preferred Scale"), "viewmag" ), this ); m_preferred = new KPushButton( KGuiItem( i18n("Preferred Scale"), "viewmag" ), this );
connect( m_preferred, SIGNAL(clicked()), qApp->mainWidget(), SLOT(adjustSize()) ); connect( m_preferred, SIGNAL(clicked()), tqApp->mainWidget(), SLOT(adjustSize()) );
connect( m_preferred, SIGNAL(clicked()), SLOT(deleteLater()) ); connect( m_preferred, SIGNAL(clicked()), SLOT(deleteLater()) );
m_oneToOne = new KPushButton( KGuiItem( i18n("Scale 100%"), "viewmag1" ), this ); m_oneToOne = new KPushButton( KGuiItem( i18n("Scale 100%"), "viewmag1" ), this );
connect( m_oneToOne, SIGNAL(clicked()), (QObject*)videoWindow(), SLOT(resetZoom()) ); connect( m_oneToOne, SIGNAL(clicked()), (TQObject*)videoWindow(), SLOT(resetZoom()) );
connect( m_oneToOne, SIGNAL(clicked()), SLOT(deleteLater()) ); connect( m_oneToOne, SIGNAL(clicked()), SLOT(deleteLater()) );
QBoxLayout *hbox = new QHBoxLayout( this, 8, 6 ); TQBoxLayout *hbox = new TQHBoxLayout( this, 8, 6 );
QBoxLayout *vbox = new QVBoxLayout( hbox ); TQBoxLayout *vbox = new TQVBoxLayout( hbox );
vbox->addWidget( new QLabel( i18n( "<b>Adjust video scale?" ), this ) ); vbox->addWidget( new TQLabel( i18n( "<b>Adjust video scale?" ), this ) );
vbox->addWidget( m_preferred ); vbox->addWidget( m_preferred );
vbox->addWidget( m_oneToOne ); vbox->addWidget( m_oneToOne );
hbox->addWidget( m_thingy = new QFrame( this ) ); hbox->addWidget( m_thingy = new TQFrame( this ) );
m_thingy->setFixedWidth( fontMetrics().width( "X" ) ); m_thingy->setFixedWidth( fontMetrics().width( "X" ) );
m_thingy->setFrameStyle( QFrame::Plain | QFrame::Box ); m_thingy->setFrameStyle( TQFrame::Plain | TQFrame::Box );
m_thingy->setPaletteForegroundColor( paletteBackgroundColor().dark() ); m_thingy->setPaletteForegroundColor( paletteBackgroundColor().dark() );
QEvent e( QEvent::Resize ); TQEvent e( TQEvent::Resize );
eventFilter( 0, &e ); eventFilter( 0, &e );
adjustSize(); adjustSize();
@ -57,9 +57,9 @@ namespace Codeine
} }
void void
AdjustSizeButton::timerEvent( QTimerEvent* ) AdjustSizeButton::timerEvent( TQTimerEvent* )
{ {
QFrame *&h = m_thingy; TQFrame *&h = m_thingy;
switch( m_stage ) switch( m_stage )
{ {
@ -76,7 +76,7 @@ namespace Codeine
case 2: //fill in pause timer bar case 2: //fill in pause timer bar
if( m_counter < h->height() - 3 ) if( m_counter < h->height() - 3 )
QPainter( h ).fillRect( 2, 2, h->width() - 4, m_counter, palette().active().highlight() ); TQPainter( h ).fillRect( 2, 2, h->width() - 4, m_counter, palette().active().highlight() );
if( !hasMouse() ) if( !hasMouse() )
m_counter++; m_counter++;
@ -104,12 +104,12 @@ namespace Codeine
} }
bool bool
AdjustSizeButton::eventFilter( QObject *o, QEvent *e ) AdjustSizeButton::eventFilter( TQObject *o, TQEvent *e )
{ {
if( e->type() == QEvent::Resize ) { if( e->type() == TQEvent::Resize ) {
const QSize preferredSize = TheStream::profile()->readSizeEntry( "Preferred Size" ); const TQSize preferredSize = TheStream::profile()->readSizeEntry( "Preferred Size" );
const QSize defaultSize = TheStream::defaultVideoSize(); const TQSize defaultSize = TheStream::defaultVideoSize();
const QSize parentSize = parentWidget()->size(); const TQSize parentSize = parentWidget()->size();
m_preferred->setEnabled( preferredSize.isValid() && parentSize != preferredSize && defaultSize != preferredSize ); m_preferred->setEnabled( preferredSize.isValid() && parentSize != preferredSize && defaultSize != preferredSize );
m_oneToOne->setEnabled( defaultSize != parentSize ); m_oneToOne->setEnabled( defaultSize != parentSize );

@ -4,32 +4,32 @@
#ifndef CODEINE_ADJUST_SIZE_BUTTON_H #ifndef CODEINE_ADJUST_SIZE_BUTTON_H
#define CODEINE_ADJUST_SIZE_BUTTON_H #define CODEINE_ADJUST_SIZE_BUTTON_H
#include <qframe.h> #include <ntqframe.h>
namespace Codeine namespace Codeine
{ {
class AdjustSizeButton : public QFrame class AdjustSizeButton : public TQFrame
{ {
int m_counter; int m_counter;
int m_stage; int m_stage;
int m_offset; int m_offset;
int m_timerId; int m_timerId;
QWidget *m_preferred; TQWidget *m_preferred;
QWidget *m_oneToOne; TQWidget *m_oneToOne;
QFrame *m_thingy; TQFrame *m_thingy;
public: public:
AdjustSizeButton( QWidget *parent ); AdjustSizeButton( TQWidget *parent );
private: private:
virtual void timerEvent( QTimerEvent* ); virtual void timerEvent( TQTimerEvent* );
virtual bool eventFilter( QObject*, QEvent* ); virtual bool eventFilter( TQObject*, TQEvent* );
inline void move() inline void move()
{ {
QWidget::move( parentWidget()->width() - width(), parentWidget()->height() - m_offset ); TQWidget::move( parentWidget()->width() - width(), parentWidget()->height() - m_offset );
} }
}; };
} }

@ -5,26 +5,26 @@
#include "codeine.h" #include "codeine.h"
#include "debug.h" #include "debug.h"
#include <math.h> //interpolate() #include <math.h> //interpolate()
#include <qevent.h> //event() #include <ntqevent.h> //event()
#include "xineEngine.h" #include "xineEngine.h"
#include "fht.cpp" #include "fht.cpp"
template<class W> template<class W>
Analyzer::Base<W>::Base( QWidget *parent, uint timeout ) Analyzer::Base<W>::Base( TQWidget *parent, uint timeout )
: W( parent, "Analyzer" ) : W( parent, "Analyzer" )
, m_timeout( timeout ) , m_timeout( timeout )
{} {}
template<class W> bool template<class W> bool
Analyzer::Base<W>::event( QEvent *e ) Analyzer::Base<W>::event( TQEvent *e )
{ {
switch( e->type() ) { switch( e->type() ) {
case QEvent::Hide: case TQEvent::Hide:
m_timer.stop(); m_timer.stop();
break; break;
case QEvent::Show: case TQEvent::Show:
m_timer.start( timeout() ); m_timer.start( timeout() );
break; break;
@ -32,14 +32,14 @@ Analyzer::Base<W>::event( QEvent *e )
; ;
} }
return QWidget::event( e ); return TQWidget::event( e );
} }
Analyzer::Base2D::Base2D( QWidget *parent, uint timeout ) Analyzer::Base2D::Base2D( TQWidget *parent, uint timeout )
: Base<QWidget>( parent, timeout ) : Base<TQWidget>( parent, timeout )
{ {
setWFlags( Qt::WNoAutoErase ); //no flicker setWFlags( TQt::WNoAutoErase ); //no flicker
connect( &m_timer, SIGNAL(timeout()), SLOT(draw()) ); connect( &m_timer, SIGNAL(timeout()), SLOT(draw()) );
} }
@ -72,7 +72,7 @@ Analyzer::Base2D::draw()
} }
void void
Analyzer::Base2D::resizeEvent( QResizeEvent* ) Analyzer::Base2D::resizeEvent( TQResizeEvent* )
{ {
m_canvas.resize( size() ); m_canvas.resize( size() );
m_canvas.fill( colorGroup().background() ); m_canvas.fill( colorGroup().background() );
@ -83,9 +83,9 @@ Analyzer::Base2D::resizeEvent( QResizeEvent* )
// Author: Max Howell <max.howell@methylblue.com>, (C) 2003 // Author: Max Howell <max.howell@methylblue.com>, (C) 2003
// Copyright: See COPYING file that comes with this distribution // Copyright: See COPYING file that comes with this distribution
#include <qpainter.h> #include <ntqpainter.h>
Analyzer::Block::Block( QWidget *parent ) Analyzer::Block::Block( TQWidget *parent )
: Analyzer::Base2D( parent, 20 ) : Analyzer::Base2D( parent, 20 )
{ {
setMinimumWidth( 64 ); //-1 is padding, no drawing takes place there setMinimumWidth( 64 ); //-1 is padding, no drawing takes place there
@ -114,7 +114,7 @@ Analyzer::Block::analyze( const Analyzer::Scope &s )
{ {
canvas()->fill( colorGroup().foreground().light() ); canvas()->fill( colorGroup().foreground().light() );
QPainter p( canvas() ); TQPainter p( canvas() );
p.setPen( colorGroup().background() ); p.setPen( colorGroup().background() );
const double F = double(height()) / (log10( 256 ) * 1.1 /*<- max. amplitude*/); const double F = double(height()) / (log10( 256 ) * 1.1 /*<- max. amplitude*/);

@ -8,9 +8,9 @@
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#include <qpixmap.h> //stack allocated and convenience #include <ntqpixmap.h> //stack allocated and convenience
#include <qtimer.h> //stack allocated #include <ntqtimer.h> //stack allocated
#include <qwidget.h> //baseclass #include <ntqwidget.h> //baseclass
#include <vector> //included for convenience #include <vector> //included for convenience
namespace Analyzer namespace Analyzer
@ -23,44 +23,44 @@ namespace Analyzer
uint timeout() const { return m_timeout; } uint timeout() const { return m_timeout; }
protected: protected:
Base( QWidget*, uint ); Base( TQWidget*, uint );
virtual void transform( Scope& ) = 0; virtual void transform( Scope& ) = 0;
virtual void analyze( const Scope& ) = 0; virtual void analyze( const Scope& ) = 0;
private: private:
virtual bool event( QEvent* ); virtual bool event( TQEvent* );
protected: protected:
QTimer m_timer; TQTimer m_timer;
uint m_timeout; uint m_timeout;
}; };
class Base2D : public Base<QWidget> class Base2D : public Base<TQWidget>
{ {
Q_OBJECT Q_OBJECT
public: public:
const QPixmap *canvas() const { return &m_canvas; } const TQPixmap *canvas() const { return &m_canvas; }
private slots: private slots:
void draw(); void draw();
protected: protected:
Base2D( QWidget*, uint timeout ); Base2D( TQWidget*, uint timeout );
QPixmap *canvas() { return &m_canvas; } TQPixmap *canvas() { return &m_canvas; }
void paintEvent( QPaintEvent* ) { if( !m_canvas.isNull() ) bitBlt( this, 0, 0, canvas() ); } void paintEvent( TQPaintEvent* ) { if( !m_canvas.isNull() ) bitBlt( this, 0, 0, canvas() ); }
void resizeEvent( QResizeEvent* ); void resizeEvent( TQResizeEvent* );
private: private:
QPixmap m_canvas; TQPixmap m_canvas;
}; };
class Block : public Analyzer::Base2D class Block : public Analyzer::Base2D
{ {
public: public:
Block( QWidget* ); Block( TQWidget* );
protected: protected:
virtual void transform( Analyzer::Scope& ); virtual void transform( Analyzer::Scope& );

@ -9,13 +9,13 @@
#include <kstdguiitem.h> #include <kstdguiitem.h>
#include "mainWindow.h" #include "mainWindow.h"
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qdialog.h> #include <ntqdialog.h>
#include <qhbox.h> #include <ntqhbox.h>
#include <qlabel.h> #include <ntqlabel.h>
#include <qimage.h> #include <ntqimage.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qpainter.h> #include <ntqpainter.h>
#include <qstringlist.h> #include <ntqstringlist.h>
#include "theStream.h" #include "theStream.h"
#include "xineEngine.h" #include "xineEngine.h"
#include <xine.h> #include <xine.h>
@ -25,26 +25,26 @@ namespace Codeine {
class FrameCapturePreview : public KPreviewWidgetBase class FrameCapturePreview : public KPreviewWidgetBase
{ {
QImage m_frame; TQImage m_frame;
virtual void showPreview( const KURL& ) {} virtual void showPreview( const KURL& ) {}
virtual void clearPreview() {} virtual void clearPreview() {}
virtual void paintEvent( QPaintEvent* ) virtual void paintEvent( TQPaintEvent* )
{ {
QPainter painter( this ); TQPainter painter( this );
const uint h = int( double(m_frame.height()) / m_frame.width() * (width()-5) ); const uint h = int( double(m_frame.height()) / m_frame.width() * (width()-5) );
const uint y = (height() - h) / 2; const uint y = (height() - h) / 2;
painter.drawImage( QRect( 5, y, width(), h ), m_frame ); painter.drawImage( TQRect( 5, y, width(), h ), m_frame );
const QString text = QString("%1x%2").arg( m_frame.width() ).arg( m_frame.height() ); const TQString text = TQString("%1x%2").arg( m_frame.width() ).arg( m_frame.height() );
const uint x = (width() - fontMetrics().width( text ))/2; const uint x = (width() - fontMetrics().width( text ))/2;
painter.drawText( x, y + h + fontMetrics().height() + 5, text ); painter.drawText( x, y + h + fontMetrics().height() + 5, text );
} }
public: public:
FrameCapturePreview( const QImage& frame, QWidget *parent ) FrameCapturePreview( const TQImage& frame, TQWidget *parent )
: KPreviewWidgetBase( parent ) : KPreviewWidgetBase( parent )
, m_frame( frame ) , m_frame( frame )
{ {
@ -53,25 +53,25 @@ public:
}; };
class FrameCaptureDialog : public QDialog class FrameCaptureDialog : public TQDialog
{ {
const QImage m_frame; const TQImage m_frame;
const QString m_time; const TQString m_time;
const QString m_title; const TQString m_title;
void message( const QString &text ) { ((MainWindow*)parentWidget())->statusBar()->message( text, 4000 ); } void message( const TQString &text ) { ((MainWindow*)parentWidget())->statusBar()->message( text, 4000 ); }
public: public:
FrameCaptureDialog( const QImage &frame, const QString &time, MainWindow *parent ) FrameCaptureDialog( const TQImage &frame, const TQString &time, MainWindow *parent )
: QDialog( parent, 0, false /*modal*/, Qt::WDestructiveClose ) : TQDialog( parent, 0, false /*modal*/, TQt::WDestructiveClose )
, m_frame( frame ) , m_frame( frame )
, m_time( time ) , m_time( time )
, m_title( TheStream::prettyTitle() ) , m_title( TheStream::prettyTitle() )
{ {
(new QVBoxLayout( this ))->setAutoAdd( true ); (new TQVBoxLayout( this ))->setAutoAdd( true );
(new QLabel( this ))->setPixmap( frame ); (new TQLabel( this ))->setPixmap( frame );
QHBox *box = new QHBox( this ); TQHBox *box = new TQHBox( this );
KPushButton *o = new KPushButton( KStdGuiItem::save(), box ); KPushButton *o = new KPushButton( KStdGuiItem::save(), box );
connect( o, SIGNAL(clicked()), SLOT(accept()) ); connect( o, SIGNAL(clicked()), SLOT(accept()) );
@ -102,11 +102,11 @@ public:
dialog.setPreviewWidget( new FrameCapturePreview( m_frame, &dialog ) ); dialog.setPreviewWidget( new FrameCapturePreview( m_frame, &dialog ) );
if( dialog.exec() == Accepted ) { if( dialog.exec() == Accepted ) {
const QString fileName = dialog.selectedFile(); const TQString fileName = dialog.selectedFile();
if( fileName.isEmpty() ) if( fileName.isEmpty() )
return; return;
const QString type = dialog.currentFilter().remove( 0, 2 ).upper(); const TQString type = dialog.currentFilter().remove( 0, 2 ).upper();
if( m_frame.save( fileName, type ) ) if( m_frame.save( fileName, type ) )
message( i18n("%1 saved successfully").arg( fileName ) ); message( i18n("%1 saved successfully").arg( fileName ) );
else else
@ -235,19 +235,19 @@ yv12ToRgb( uint8_t *src_y, uint8_t *src_u, uint8_t *src_v, const int w, const in
/************************************************************/ /************************************************************/
QImage TQImage
VideoWindow::captureFrame() const VideoWindow::captureFrame() const
{ {
DEBUG_BLOCK DEBUG_BLOCK
int ratio, format, w, h; int ratio, format, w, h;
if( !xine_get_current_frame( *engine(), &w, &h, &ratio, &format, NULL ) ) if( !xine_get_current_frame( *engine(), &w, &h, &ratio, &format, NULL ) )
return QImage(); return TQImage();
uint8_t *yuv = new uint8_t[((w+8) * (h+1) * 2)]; uint8_t *yuv = new uint8_t[((w+8) * (h+1) * 2)];
if( yuv == 0 ) { if( yuv == 0 ) {
Debug::error() << "Not enough memory to make screenframe!\n"; Debug::error() << "Not enough memory to make screenframe!\n";
return QImage(); } return TQImage(); }
xine_get_current_frame( *engine(), &w, &h, &ratio, &format, yuv ); xine_get_current_frame( *engine(), &w, &h, &ratio, &format, yuv );
@ -262,7 +262,7 @@ VideoWindow::captureFrame() const
if( yuv == 0 ) { if( yuv == 0 ) {
Debug::error() << "Not enough memory to make screenframe!\n"; Debug::error() << "Not enough memory to make screenframe!\n";
delete [] yuy2; delete [] yuy2;
return QImage(); } return TQImage(); }
y = yuv; y = yuv;
u = yuv + w * h; u = yuv + w * h;
@ -282,12 +282,12 @@ VideoWindow::captureFrame() const
default: default:
Debug::warning() << "Format " << format << " not supported!\n"; Debug::warning() << "Format " << format << " not supported!\n";
delete [] yuv; delete [] yuv;
return QImage(); return TQImage();
} }
// convert to rgb // convert to rgb
uchar *rgb = yv12ToRgb( y, u, v, w, h ); uchar *rgb = yv12ToRgb( y, u, v, w, h );
QImage frame( rgb, w, h, 32, 0, 0, QImage::IgnoreEndian ); TQImage frame( rgb, w, h, 32, 0, 0, TQImage::IgnoreEndian );
delete [] yuv; delete [] yuv;
return frame; return frame;

@ -9,7 +9,7 @@
namespace Codeine namespace Codeine
{ {
static inline KConfig *config( const QString &group ) static inline KConfig *config( const TQString &group )
{ {
KConfig* const instance = KGlobal::config(); KConfig* const instance = KGlobal::config();
instance->setGroup( group ); instance->setGroup( group );

@ -9,8 +9,8 @@ extern "C"
typedef struct xine_s xine_t; typedef struct xine_s xine_t;
} }
class QPopupMenu; class TQPopupMenu;
class QWidget; class TQWidget;
namespace Codeine namespace Codeine
{ {
@ -20,9 +20,9 @@ namespace Codeine
VideoWindow* const engine(); //defined in xineEngine.h VideoWindow* const engine(); //defined in xineEngine.h
VideoWindow* const videoWindow(); //defined in xineEngine.h VideoWindow* const videoWindow(); //defined in xineEngine.h
void showVideoSettingsDialog( QWidget* ); void showVideoSettingsDialog( TQWidget* );
void showXineConfigurationDialog( QWidget*, xine_t* ); void showXineConfigurationDialog( TQWidget*, xine_t* );
void insertAspectRatioMenuItems( QPopupMenu* ); void insertAspectRatioMenuItems( TQPopupMenu* );
} }
#endif #endif

@ -5,12 +5,12 @@
#include "fullScreenAction.h" #include "fullScreenAction.h"
#include <klocale.h> #include <klocale.h>
#include <kwin.h> #include <kwin.h>
#include <qwidget.h> #include <ntqwidget.h>
#include "xineEngine.h" //videoWindow() #include "xineEngine.h" //videoWindow()
FullScreenAction::FullScreenAction( QWidget* window, KActionCollection *parent ) FullScreenAction::FullScreenAction( TQWidget* window, KActionCollection *parent )
: KToggleAction( QString::null, Key_F, 0, 0, parent, "fullscreen" ) : KToggleAction( TQString::null, Key_F, 0, 0, parent, "fullscreen" )
, m_window( window ) , m_window( window )
, m_shouldBeDisabled( false ) , m_shouldBeDisabled( false )
, m_state( 0 ) , m_state( 0 )
@ -57,7 +57,7 @@ FullScreenAction::setEnabled( bool setEnabled )
//FIXME Codeine specific (because videoWindow isn't the window we control, we control the KMainWindow) //FIXME Codeine specific (because videoWindow isn't the window we control, we control the KMainWindow)
//NOTE also if the videoWindow is hidden at some point, this is broken.. //NOTE also if the videoWindow is hidden at some point, this is broken..
//TODO new type of actionclass that event filters and is always correct state //TODO new type of actionclass that event filters and is always correct state
if( setEnabled && reinterpret_cast<QWidget*>(Codeine::videoWindow())->isHidden() ) if( setEnabled && reinterpret_cast<TQWidget*>(Codeine::videoWindow())->isHidden() )
setEnabled = false; setEnabled = false;
m_shouldBeDisabled = false; m_shouldBeDisabled = false;
@ -66,17 +66,17 @@ FullScreenAction::setEnabled( bool setEnabled )
} }
bool bool
FullScreenAction::eventFilter( QObject *o, QEvent *e ) FullScreenAction::eventFilter( TQObject *o, TQEvent *e )
{ {
if( o == m_window ) if( o == m_window )
switch( e->type() ) { switch( e->type() ) {
#if QT_VERSION >= 0x030300 #if TQT_VERSION >= 0x030300
case QEvent::WindowStateChange: case TQEvent::WindowStateChange:
#else #else
case QEvent::ShowFullScreen: case TQEvent::ShowFullScreen:
case QEvent::ShowNormal: case TQEvent::ShowNormal:
case QEvent::ShowMaximized: case TQEvent::ShowMaximized:
case QEvent::ShowMinimized: case TQEvent::ShowMinimized:
#endif #endif
if (m_window->isFullScreen() != isChecked()) if (m_window->isFullScreen() != isChecked())
slotActivated(); // setChecked( window->isFullScreen()) wouldn't emit signals slotActivated(); // setChecked( window->isFullScreen()) wouldn't emit signals

@ -12,16 +12,16 @@
class FullScreenAction : public KToggleAction class FullScreenAction : public KToggleAction
{ {
public: public:
FullScreenAction( QWidget *window, KActionCollection* ); FullScreenAction( TQWidget *window, KActionCollection* );
virtual void setChecked( bool ); virtual void setChecked( bool );
virtual void setEnabled( bool ); virtual void setEnabled( bool );
protected: protected:
virtual bool eventFilter( QObject* o, QEvent* e ); virtual bool eventFilter( TQObject* o, TQEvent* e );
private: private:
QWidget *m_window; TQWidget *m_window;
bool m_shouldBeDisabled; bool m_shouldBeDisabled;
unsigned long m_state; unsigned long m_state;
}; };

@ -1,16 +1,16 @@
// Copyright 2005 Max Howell (max.howell@methylblue.com) // Copyright 2005 Max Howell (max.howell@methylblue.com)
// See COPYING file for licensing information // See COPYING file for licensing information
#include <qpopupmenu.h> #include <ntqpopupmenu.h>
#include <xine.h> #include <xine.h>
QString i18n( const char *text ); TQString i18n( const char *text );
namespace Codeine namespace Codeine
{ {
void void
insertAspectRatioMenuItems( QPopupMenu *menu ) insertAspectRatioMenuItems( TQPopupMenu *menu )
{ {
menu->insertItem( i18n( "Determine &Automatically" ), XINE_VO_ASPECT_AUTO ); menu->insertItem( i18n( "Determine &Automatically" ), XINE_VO_ASPECT_AUTO );
menu->insertSeparator(); menu->insertSeparator();

@ -11,27 +11,27 @@ namespace Codeine
class ListView : public KListView class ListView : public KListView
{ {
public: public:
ListView( QWidget *parent ) : KListView( parent ) ListView( TQWidget *parent ) : KListView( parent )
{ {
addColumn( QString::null, 0 ); addColumn( TQString::null, 0 );
addColumn( QString::null ); addColumn( TQString::null );
setResizeMode( LastColumn ); setResizeMode( LastColumn );
setMargin( 2 ); setMargin( 2 );
setSorting( -1 ); setSorting( -1 );
setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum );
setAllColumnsShowFocus( true ); setAllColumnsShowFocus( true );
setItemMargin( 3 ); setItemMargin( 3 );
} }
virtual QSize sizeHint() const virtual TQSize sizeHint() const
{ {
const QSize sh = KListView::sizeHint(); const TQSize sh = KListView::sizeHint();
return QSize( sh.width(), return TQSize( sh.width(),
childCount() == 0 childCount() == 0
? 50 ? 50
: QMIN( sh.height(), childCount() * (firstChild()->height()) + margin() * 2 + 4 + reinterpret_cast<QWidget*>(header())->height() ) ); : TQMIN( sh.height(), childCount() * (firstChild()->height()) + margin() * 2 + 4 + reinterpret_cast<TQWidget*>(header())->height() ) );
} }
}; };
} }

@ -24,12 +24,12 @@
#include "playDialog.h" //::play() #include "playDialog.h" //::play()
#include "playlistFile.h" #include "playlistFile.h"
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qcstring.h> #include <ntqcstring.h>
#include <qdesktopwidget.h> #include <ntqdesktopwidget.h>
#include <qevent.h> //::stateChanged() #include <ntqevent.h> //::stateChanged()
#include <qlayout.h> //ctor #include <ntqlayout.h> //ctor
#include <qpopupmenu.h> //because XMLGUI is poorly designed #include <ntqpopupmenu.h> //because XMLGUI is poorly designed
#include <qobjectlist.h> #include <ntqobjectlist.h>
#include "slider.h" #include "slider.h"
#include "theStream.h" #include "theStream.h"
#include "volumeAction.h" #include "volumeAction.h"
@ -48,13 +48,13 @@ namespace Codeine {
/// @see codeine.h /// @see codeine.h
QWidget *mainWindow() { return kapp->mainWidget(); } TQWidget *mainWindow() { return kapp->mainWidget(); }
MainWindow::MainWindow() MainWindow::MainWindow()
: KMainWindow() : KMainWindow()
, m_positionSlider( new Slider( this, 65535 ) ) , m_positionSlider( new Slider( this, 65535 ) )
, m_timeLabel( new QLabel( " 0:00:00 ", this ) ) , m_timeLabel( new TQLabel( " 0:00:00 ", this ) )
, m_titleLabel( new KSqueezedTextLabel( this ) ) , m_titleLabel( new KSqueezedTextLabel( this ) )
{ {
DEBUG_BLOCK DEBUG_BLOCK
@ -65,11 +65,11 @@ MainWindow::MainWindow()
new VideoWindow( this ); new VideoWindow( this );
setCentralWidget( videoWindow() ); setCentralWidget( videoWindow() );
setFocusProxy( videoWindow() ); // essential! See VideoWindow::event(), QEvent::FocusOut setFocusProxy( videoWindow() ); // essential! See VideoWindow::event(), TQEvent::FocusOut
// these have no affect beccause "KDE Knows Best" FFS // these have no affect beccause "KDE Knows Best" FFS
setDockEnabled( toolBar(), Qt::DockRight, false ); //doesn't make sense due to our large horizontal slider setDockEnabled( toolBar(), TQt::DockRight, false ); //doesn't make sense due to our large horizontal slider
setDockEnabled( toolBar(), Qt::DockLeft, false ); //as above setDockEnabled( toolBar(), TQt::DockLeft, false ); //as above
m_titleLabel->setMargin( 2 ); m_titleLabel->setMargin( 2 );
m_timeLabel->setFont( KGlobalSettings::fixedFont() ); m_timeLabel->setFont( KGlobalSettings::fixedFont() );
@ -78,7 +78,7 @@ MainWindow::MainWindow()
// work around a bug in KStatusBar // work around a bug in KStatusBar
// sizeHint width of statusbar seems to get stupidly large quickly // sizeHint width of statusbar seems to get stupidly large quickly
statusBar()->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Maximum ); statusBar()->setSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Maximum );
statusBar()->addWidget( m_titleLabel, 1, false ); statusBar()->addWidget( m_titleLabel, 1, false );
statusBar()->addWidget( m_analyzer = new Analyzer::Block( this ), 0, true ); statusBar()->addWidget( m_analyzer = new Analyzer::Block( this ), 0, true );
@ -90,16 +90,16 @@ MainWindow::MainWindow()
// only show dvd button when playing a dvd // only show dvd button when playing a dvd
{ {
struct KdeIsTehSuck : public QObject struct KdeIsTehSuck : public TQObject
{ {
virtual bool eventFilter( QObject*, QEvent *e ) virtual bool eventFilter( TQObject*, TQEvent *e )
{ {
if (e->type() != QEvent::LayoutHint) if (e->type() != TQEvent::LayoutHint)
return false; return false;
// basically, KDE shows all tool-buttons, even if they are // basically, KDE shows all tool-buttons, even if they are
// hidden after it does any layout operation. Yay for KDE. Yay. // hidden after it does any layout operation. Yay for KDE. Yay.
QWidget *button = (QWidget*)((KMainWindow*)mainWindow())->toolBar()->child( "toolbutton_toggle_dvd_menu" ); TQWidget *button = (TQWidget*)((KMainWindow*)mainWindow())->toolBar()->child( "toolbutton_toggle_dvd_menu" );
if (button) if (button)
button->setShown( TheStream::url().protocol() == "dvd" ); button->setShown( TheStream::url().protocol() == "dvd" );
return false; return false;
@ -111,11 +111,11 @@ MainWindow::MainWindow()
} }
{ {
QPopupMenu *menu = 0, *settings = static_cast<QPopupMenu*>(factory()->container( "settings", this )); TQPopupMenu *menu = 0, *settings = static_cast<TQPopupMenu*>(factory()->container( "settings", this ));
int id = SubtitleChannelsMenuItemId, index = 0; int id = SubtitleChannelsMenuItemId, index = 0;
#define make_menu( name, text ) \ #define make_menu( name, text ) \
menu = new QPopupMenu( this, name ); \ menu = new TQPopupMenu( this, name ); \
menu->setCheckable( true ); \ menu->setCheckable( true ); \
connect( menu, SIGNAL(activated( int )), engine(), SLOT(setStreamParameter( int )) ); \ connect( menu, SIGNAL(activated( int )), engine(), SLOT(setStreamParameter( int )) ); \
connect( menu, SIGNAL(aboutToShow()), SLOT(aboutToShowMenu()) ); \ connect( menu, SIGNAL(aboutToShow()), SLOT(aboutToShowMenu()) ); \
@ -133,7 +133,7 @@ MainWindow::MainWindow()
settings->insertSeparator( index ); settings->insertSeparator( index );
} }
QObjectList *list = toolBar()->queryList( "KToolBarButton" ); TQObjectList *list = toolBar()->queryList( "KToolBarButton" );
if (list->isEmpty()) { if (list->isEmpty()) {
MessageBox::error( i18n( MessageBox::error( i18n(
"<qt>" PRETTY_NAME " could not load its interface, this probably means that " PRETTY_NAME " is not " "<qt>" PRETTY_NAME " could not load its interface, this probably means that " PRETTY_NAME " is not "
@ -154,8 +154,8 @@ MainWindow::MainWindow()
else { else {
//"faster" startup //"faster" startup
//TODO if we have a size stored for this video, do the "faster" route //TODO if we have a size stored for this video, do the "faster" route
QTimer::singleShot( 0, this, SLOT(init()) ); TQTimer::singleShot( 0, this, SLOT(init()) );
QApplication::setOverrideCursor( KCursor::waitCursor() ); } TQApplication::setOverrideCursor( KCursor::waitCursor() ); }
} }
void void
@ -163,10 +163,10 @@ MainWindow::init()
{ {
DEBUG_BLOCK DEBUG_BLOCK
connect( engine(), SIGNAL(statusMessage( const QString& )), this, SLOT(engineMessage( const QString& )) ); connect( engine(), SIGNAL(statusMessage( const TQString& )), this, SLOT(engineMessage( const TQString& )) );
connect( engine(), SIGNAL(stateChanged( Engine::State )), this, SLOT(engineStateChanged( Engine::State )) ); connect( engine(), SIGNAL(stateChanged( Engine::State )), this, SLOT(engineStateChanged( Engine::State )) );
connect( engine(), SIGNAL(channelsChanged( const QStringList& )), this, SLOT(setChannels( const QStringList& )) ); connect( engine(), SIGNAL(channelsChanged( const TQStringList& )), this, SLOT(setChannels( const TQStringList& )) );
connect( engine(), SIGNAL(titleChanged( const QString& )), m_titleLabel, SLOT(setText( const QString& )) ); connect( engine(), SIGNAL(titleChanged( const TQString& )), m_titleLabel, SLOT(setText( const TQString& )) );
connect( m_positionSlider, SIGNAL(valueChanged( int )), this, SLOT(showTime( int )) ); connect( m_positionSlider, SIGNAL(valueChanged( int )), this, SLOT(showTime( int )) );
if( !engine()->init() ) { if( !engine()->init() ) {
@ -179,9 +179,9 @@ MainWindow::init()
//would be dangerous for these to65535 happen before the videoWindow() is initialised //would be dangerous for these to65535 happen before the videoWindow() is initialised
setAcceptDrops( true ); setAcceptDrops( true );
connect( m_positionSlider, SIGNAL(sliderReleased( uint )), engine(), SLOT(seek( uint )) ); connect( m_positionSlider, SIGNAL(sliderReleased( uint )), engine(), SLOT(seek( uint )) );
connect( statusBar(), SIGNAL(messageChanged( const QString& )), engine(), SLOT(showOSD( const QString& )) ); connect( statusBar(), SIGNAL(messageChanged( const TQString& )), engine(), SLOT(showOSD( const TQString& )) );
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
if( !kapp->isRestored() ) { if( !kapp->isRestored() ) {
KCmdLineArgs &args = *KCmdLineArgs::parsedArgs(); KCmdLineArgs &args = *KCmdLineArgs::parsedArgs();
@ -221,10 +221,10 @@ MainWindow::queryExit()
// saving the window state without any controls // saving the window state without any controls
fullScreenToggled( false ); fullScreenToggled( false );
showNormal(); showNormal();
QApplication::sendPostedEvents( this, 0 ); TQApplication::sendPostedEvents( this, 0 );
// otherwise KMainWindow saves the screensize as maximised // otherwise KMainWindow saves the screensize as maximised
Codeine::MessageBox::sorry( Codeine::MessageBox::sorry(
"This annoying messagebox is to get round a bug in either KDE or Qt. " "This annoying messagebox is to get round a bug in either KDE or TQt. "
"Just press OK and Codeine will quit." ); "Just press OK and Codeine will quit." );
//NOTE not actually needed //NOTE not actually needed
saveAutoSaveSettings(); saveAutoSaveSettings();
@ -278,7 +278,7 @@ MainWindow::readProperties( KConfig *config )
} }
void void
MainWindow::timerEvent( QTimerEvent* ) MainWindow::timerEvent( TQTimerEvent* )
{ {
static int counter = 0; static int counter = 0;
@ -310,24 +310,24 @@ MainWindow::timerEvent( QTimerEvent* )
void void
MainWindow::showTime( int pos ) MainWindow::showTime( int pos )
{ {
#define zeroPad( n ) n < 10 ? QString("0%1").arg( n ) : QString::number( n ) #define zeroPad( n ) n < 10 ? TQString("0%1").arg( n ) : TQString::number( n )
const int ms = (pos == -1) ? engine()->time() : int(engine()->length() * (pos / 65535.0)); const int ms = (pos == -1) ? engine()->time() : int(engine()->length() * (pos / 65535.0));
const int s = ms / 1000; const int s = ms / 1000;
const int m = s / 60; const int m = s / 60;
const int h = m / 60; const int h = m / 60;
QString time = zeroPad( s % 60 ); //seconds TQString time = zeroPad( s % 60 ); //seconds
time.prepend( ':' ); time.prepend( ':' );
time.prepend( zeroPad( m % 60 ) ); //minutes time.prepend( zeroPad( m % 60 ) ); //minutes
time.prepend( ':' ); time.prepend( ':' );
time.prepend( QString::number( h ) ); //hours time.prepend( TQString::number( h ) ); //hours
m_timeLabel->setText( time ); m_timeLabel->setText( time );
} }
void void
MainWindow::engineMessage( const QString &message ) MainWindow::engineMessage( const TQString &message )
{ {
statusBar()->message( message, 3500 ); statusBar()->message( message, 3500 );
} }
@ -418,7 +418,7 @@ MainWindow::playMedia( bool show_welcome_dialog )
switch( dialog.exec() ) { switch( dialog.exec() ) {
case PlayDialog::FILE: { case PlayDialog::FILE: {
const QString filter = engine()->fileFilter() + '|' + i18n("Supported Media Formats") + "\n*|" + i18n("All Files"); const TQString filter = engine()->fileFilter() + '|' + i18n("Supported Media Formats") + "\n*|" + i18n("All Files");
const KURL url = KFileDialog::getOpenURL( ":default", filter, this, i18n("Select A File To Play") ); const KURL url = KFileDialog::getOpenURL( ":default", filter, this, i18n("Select A File To Play") );
open( url ); open( url );
} break; } break;
@ -437,16 +437,16 @@ MainWindow::playMedia( bool show_welcome_dialog )
} }
} }
class FullScreenToolBarHandler : QObject class FullScreenToolBarHandler : TQObject
{ {
KToolBar *m_toolbar; KToolBar *m_toolbar;
int m_timer_id; int m_timer_id;
bool m_stay_hidden_for_a_bit; bool m_stay_hidden_for_a_bit;
QPoint m_home; TQPoint m_home;
public: public:
FullScreenToolBarHandler( KMainWindow *parent ) FullScreenToolBarHandler( KMainWindow *parent )
: QObject( parent ) : TQObject( parent )
, m_toolbar( parent->toolBar() ) , m_toolbar( parent->toolBar() )
, m_timer_id( 0 ) , m_timer_id( 0 )
, m_stay_hidden_for_a_bit( false ) , m_stay_hidden_for_a_bit( false )
@ -457,12 +457,12 @@ public:
m_toolbar->installEventFilter( this ); m_toolbar->installEventFilter( this );
} }
bool eventFilter( QObject *o, QEvent *e ) bool eventFilter( TQObject *o, TQEvent *e )
{ {
if (o == parent() && e->type() == QEvent::MouseMove) { if (o == parent() && e->type() == TQEvent::MouseMove) {
killTimer( m_timer_id ); killTimer( m_timer_id );
QMouseEvent const * const me = (QMouseEvent*)e; TQMouseEvent const * const me = (TQMouseEvent*)e;
if (m_stay_hidden_for_a_bit) { if (m_stay_hidden_for_a_bit) {
// wait for a small pause before showing the toolbar again // wait for a small pause before showing the toolbar again
// usage = user removes mouse from toolbar after using it // usage = user removes mouse from toolbar after using it
@ -485,7 +485,7 @@ public:
// then cursor has moved far enough to trigger show toolbar // then cursor has moved far enough to trigger show toolbar
show_toolbar: show_toolbar:
m_toolbar->show(), m_toolbar->show(),
m_home = QPoint(); m_home = TQPoint();
else else
// cursor hasn't moved far enough yet // cursor hasn't moved far enough yet
// don't reset timer below, return instead // don't reset timer below, return instead
@ -497,22 +497,22 @@ show_toolbar:
} }
} }
if (o == parent() && e->type() == QEvent::Resize) if (o == parent() && e->type() == TQEvent::Resize)
{ {
//we aren't managed by mainWindow when at FullScreen //we aren't managed by mainWindow when at FullScreen
videoWindow()->move( 0, 0 ); videoWindow()->move( 0, 0 );
videoWindow()->resize( ((QWidget*)o)->size() ); videoWindow()->resize( ((TQWidget*)o)->size() );
videoWindow()->lower(); videoWindow()->lower();
} }
if (o == m_toolbar) if (o == m_toolbar)
switch (e->type()) { switch (e->type()) {
case QEvent::Enter: case TQEvent::Enter:
m_stay_hidden_for_a_bit = false; m_stay_hidden_for_a_bit = false;
killTimer( m_timer_id ); killTimer( m_timer_id );
break; break;
case QEvent::Leave: case TQEvent::Leave:
m_toolbar->hide(); m_toolbar->hide();
m_stay_hidden_for_a_bit = true; m_stay_hidden_for_a_bit = true;
killTimer( m_timer_id ); killTimer( m_timer_id );
@ -525,7 +525,7 @@ show_toolbar:
return false; return false;
} }
void timerEvent( QTimerEvent* ) void timerEvent( TQTimerEvent* )
{ {
if (m_stay_hidden_for_a_bit) if (m_stay_hidden_for_a_bit)
; ;
@ -546,8 +546,8 @@ MainWindow::fullScreenToggled( bool isFullScreen )
DEBUG_FUNC_INFO DEBUG_FUNC_INFO
if( isFullScreen ) if( isFullScreen )
toolBar()->setPalette( palette() ), // due to 2px spacing in QMainWindow :( toolBar()->setPalette( palette() ), // due to 2px spacing in TQMainWindow :(
setPaletteBackgroundColor( Qt::black ); // due to 2px spacing setPaletteBackgroundColor( TQt::black ); // due to 2px spacing
else else
toolBar()->unsetPalette(), toolBar()->unsetPalette(),
unsetPalette(); unsetPalette();
@ -555,7 +555,7 @@ MainWindow::fullScreenToggled( bool isFullScreen )
toolBar()->setMovingEnabled( !isFullScreen ); toolBar()->setMovingEnabled( !isFullScreen );
toolBar()->setHidden( isFullScreen && engine()->state() == Engine::Playing ); toolBar()->setHidden( isFullScreen && engine()->state() == Engine::Playing );
reinterpret_cast<QWidget*>(menuBar())->setHidden( isFullScreen ); reinterpret_cast<TQWidget*>(menuBar())->setHidden( isFullScreen );
statusBar()->setHidden( isFullScreen ); statusBar()->setHidden( isFullScreen );
setMouseTracking( isFullScreen ); /// @see mouseMoveEvent() setMouseTracking( isFullScreen ); /// @see mouseMoveEvent()
@ -572,7 +572,7 @@ MainWindow::fullScreenToggled( bool isFullScreen )
void void
MainWindow::configure() MainWindow::configure()
{ {
const QCString sender = this->sender()->name(); const TQCString sender = this->sender()->name();
if( sender == "video_settings" ) if( sender == "video_settings" )
Codeine::showVideoSettingsDialog( this ); Codeine::showVideoSettingsDialog( this );
@ -588,15 +588,15 @@ MainWindow::streamInformation()
} }
void void
MainWindow::setChannels( const QStringList &channels ) MainWindow::setChannels( const TQStringList &channels )
{ {
DEBUG_FUNC_INFO DEBUG_FUNC_INFO
//TODO -1 = auto //TODO -1 = auto
QStringList::ConstIterator it = channels.begin(); TQStringList::ConstIterator it = channels.begin();
QPopupMenu *menu = (QPopupMenu*)child( (*it).latin1() ); TQPopupMenu *menu = (TQPopupMenu*)child( (*it).latin1() );
menu->clear(); menu->clear();
menu->insertItem( i18n("&Determine Automatically"), 1 ); menu->insertItem( i18n("&Determine Automatically"), 1 );
@ -604,10 +604,10 @@ MainWindow::setChannels( const QStringList &channels )
//the id is crucial, since the slot this menu is connected to requires //the id is crucial, since the slot this menu is connected to requires
//that information to set the correct channel //that information to set the correct channel
//NOTE we subtract 2 in xineEngine because QMenuData doesn't allow negative id //NOTE we subtract 2 in xineEngine because TQMenuData doesn't allow negative id
int id = 2; int id = 2;
++it; ++it;
for( QStringList::ConstIterator const end = channels.end(); it != end; ++it, ++id ) for( TQStringList::ConstIterator const end = channels.end(); it != end; ++it, ++id )
menu->insertItem( *it, id ); menu->insertItem( *it, id );
menu->insertSeparator(); menu->insertSeparator();
@ -620,8 +620,8 @@ MainWindow::setChannels( const QStringList &channels )
void void
MainWindow::aboutToShowMenu() MainWindow::aboutToShowMenu()
{ {
QPopupMenu *menu = (QPopupMenu*)sender(); TQPopupMenu *menu = (TQPopupMenu*)sender();
QCString name( sender() ? sender()->name() : 0 ); TQCString name( sender() ? sender()->name() : 0 );
// uncheck all items first // uncheck all items first
for( uint x = 0; x < menu->count(); ++x ) for( uint x = 0; x < menu->count(); ++x )
@ -639,13 +639,13 @@ MainWindow::aboutToShowMenu()
} }
void void
MainWindow::dragEnterEvent( QDragEnterEvent *e ) MainWindow::dragEnterEvent( TQDragEnterEvent *e )
{ {
e->accept( KURLDrag::canDecode( e ) ); e->accept( KURLDrag::canDecode( e ) );
} }
void void
MainWindow::dropEvent( QDropEvent *e ) MainWindow::dropEvent( TQDropEvent *e )
{ {
KURL::List list; KURL::List list;
KURLDrag::decode( e, list ); KURLDrag::decode( e, list );
@ -657,7 +657,7 @@ MainWindow::dropEvent( QDropEvent *e )
} }
void void
MainWindow::keyPressEvent( QKeyEvent *e ) MainWindow::keyPressEvent( TQKeyEvent *e )
{ {
#define seek( step ) { \ #define seek( step ) { \
const int new_pos = m_positionSlider->value() step; \ const int new_pos = m_positionSlider->value() step; \
@ -666,8 +666,8 @@ MainWindow::keyPressEvent( QKeyEvent *e )
switch( e->key() ) switch( e->key() )
{ {
case Qt::Key_Left: seek( -500 ); break; case TQt::Key_Left: seek( -500 ); break;
case Qt::Key_Right: seek( +500 ); break; case TQt::Key_Right: seek( +500 ); break;
case Key_Escape: KWin::clearState( winId(), NET::FullScreen ); case Key_Escape: KWin::clearState( winId(), NET::FullScreen );
default: ; default: ;
} }
@ -675,11 +675,11 @@ MainWindow::keyPressEvent( QKeyEvent *e )
#undef seek #undef seek
} }
QPopupMenu* TQPopupMenu*
MainWindow::menu( const char *name ) MainWindow::menu( const char *name )
{ {
// KXMLGUI is "really good". // KXMLGUI is "really good".
return static_cast<QPopupMenu*>(factory()->container( name, this )); return static_cast<TQPopupMenu*>(factory()->container( name, this ));
} }

@ -8,9 +8,9 @@
#include <kmainwindow.h> #include <kmainwindow.h>
class KURL; class KURL;
class QLabel; class TQLabel;
class QPopupMenu; class TQPopupMenu;
class QSlider; class TQSlider;
namespace Codeine namespace Codeine
@ -35,11 +35,11 @@ namespace Codeine
void captureFrame(); void captureFrame();
private slots: private slots:
void engineMessage( const QString& ); void engineMessage( const TQString& );
void engineStateChanged( Engine::State ); void engineStateChanged( Engine::State );
void init(); void init();
void showTime( int = -1 ); void showTime( int = -1 );
void setChannels( const QStringList& ); void setChannels( const TQStringList& );
void aboutToShowMenu(); void aboutToShowMenu();
void fullScreenToggled( bool ); void fullScreenToggled( bool );
@ -49,22 +49,22 @@ namespace Codeine
bool load( const KURL& ); bool load( const KURL& );
bool open( const KURL& ); bool open( const KURL& );
QPopupMenu *menu( const char *name ); TQPopupMenu *menu( const char *name );
virtual void timerEvent( QTimerEvent* ); virtual void timerEvent( TQTimerEvent* );
virtual void dragEnterEvent( QDragEnterEvent* ); virtual void dragEnterEvent( TQDragEnterEvent* );
virtual void dropEvent( QDropEvent* ); virtual void dropEvent( TQDropEvent* );
virtual void keyPressEvent( QKeyEvent* ); virtual void keyPressEvent( TQKeyEvent* );
virtual void saveProperties( KConfig* ); virtual void saveProperties( KConfig* );
virtual void readProperties( KConfig* ); virtual void readProperties( KConfig* );
virtual bool queryExit(); virtual bool queryExit();
QSlider *m_positionSlider; TQSlider *m_positionSlider;
QLabel *m_timeLabel; TQLabel *m_timeLabel;
QLabel *m_titleLabel; TQLabel *m_titleLabel;
QWidget *m_analyzer; TQWidget *m_analyzer;
//undefined //undefined
MainWindow( const MainWindow& ); MainWindow( const MainWindow& );

@ -11,53 +11,53 @@
#include <kstdguiitem.h> #include <kstdguiitem.h>
#include "playDialog.h" #include "playDialog.h"
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qfile.h> #include <ntqfile.h>
#include <qlabel.h> #include <ntqlabel.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qsignalmapper.h> #include <ntqsignalmapper.h>
QString i18n( const char *text ); TQString i18n( const char *text );
namespace Codeine { namespace Codeine {
PlayDialog::PlayDialog( QWidget *parent, bool be_welcome_dialog ) PlayDialog::PlayDialog( TQWidget *parent, bool be_welcome_dialog )
: QDialog( parent ) : TQDialog( parent )
{ {
setCaption( kapp->makeStdCaption( i18n("Play Media") ) ); setCaption( kapp->makeStdCaption( i18n("Play Media") ) );
QSignalMapper *mapper = new QSignalMapper( this ); TQSignalMapper *mapper = new TQSignalMapper( this );
QWidget *o, *closeButton = new KPushButton( KStdGuiItem::close(), this ); TQWidget *o, *closeButton = new KPushButton( KStdGuiItem::close(), this );
QBoxLayout *hbox, *vbox = new QVBoxLayout( this, 15, 20 ); TQBoxLayout *hbox, *vbox = new TQVBoxLayout( this, 15, 20 );
vbox->addWidget( new QLabel( i18n( "What media would you like to play?" ), this ) ); vbox->addWidget( new TQLabel( i18n( "What media would you like to play?" ), this ) );
QGridLayout *grid = new QGridLayout( vbox, 1, 3, 20 ); TQGridLayout *grid = new TQGridLayout( vbox, 1, 3, 20 );
//TODO use the kguiItems from the actions //TODO use the kguiItems from the actions
mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play File..."), "fileopen" ), this ), FILE ); mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play File..."), "fileopen" ), this ), FILE );
connect( o, SIGNAL(clicked()), mapper, SLOT(map()) ); connect( o, SIGNAL(clicked()), mapper, SLOT(map()) );
grid->QLayout::add( o ); grid->TQLayout::add( o );
mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play VCD"), "cdaudio_unmount" ), this ), VCD ); mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play VCD"), "cdaudio_unmount" ), this ), VCD );
connect( o, SIGNAL(clicked()), mapper, SLOT(map()) ); connect( o, SIGNAL(clicked()), mapper, SLOT(map()) );
grid->QLayout::add( o ); grid->TQLayout::add( o );
mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play DVD"), "dvd_unmount" ), this ), DVD ); mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play DVD"), "dvd_unmount" ), this ), DVD );
connect( o, SIGNAL(clicked()), mapper, SLOT(map()) ); connect( o, SIGNAL(clicked()), mapper, SLOT(map()) );
grid->QLayout::add( o ); grid->TQLayout::add( o );
mapper->setMapping( closeButton, QDialog::Rejected ); mapper->setMapping( closeButton, TQDialog::Rejected );
connect( closeButton, SIGNAL(clicked()), mapper, SLOT(map()) ); connect( closeButton, SIGNAL(clicked()), mapper, SLOT(map()) );
createRecentFileWidget( vbox ); createRecentFileWidget( vbox );
hbox = new QHBoxLayout( vbox ); hbox = new TQHBoxLayout( vbox );
hbox->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding ) ); hbox->addItem( new TQSpacerItem( 10, 10, TQSizePolicy::Expanding ) );
if( be_welcome_dialog ) { if( be_welcome_dialog ) {
QWidget *w = new KPushButton( KStdGuiItem::quit(), this ); TQWidget *w = new KPushButton( KStdGuiItem::quit(), this );
hbox->addWidget( w ); hbox->addWidget( w );
connect( w, SIGNAL(clicked()), kapp, SLOT(quit()) ); connect( w, SIGNAL(clicked()), kapp, SLOT(quit()) );
} }
@ -68,13 +68,13 @@ PlayDialog::PlayDialog( QWidget *parent, bool be_welcome_dialog )
} }
void void
PlayDialog::createRecentFileWidget( QBoxLayout *layout ) PlayDialog::createRecentFileWidget( TQBoxLayout *layout )
{ {
KListView *lv; KListView *lv;
lv = new Codeine::ListView( this ); lv = new Codeine::ListView( this );
lv->setColumnText( 1, i18n("Recently Played Media") ); lv->setColumnText( 1, i18n("Recently Played Media") );
const QStringList list1 = Codeine::config( "General" )->readPathListEntry( "Recent Urls" ); const TQStringList list1 = Codeine::config( "General" )->readPathListEntry( "Recent Urls" );
KURL::List urls; KURL::List urls;
foreach( list1 ) foreach( list1 )
@ -84,7 +84,7 @@ PlayDialog::createRecentFileWidget( QBoxLayout *layout )
if( urls.contains( *it ) > 1 ) if( urls.contains( *it ) > 1 )
//remove duplicates //remove duplicates
it = urls.remove( it ); it = urls.remove( it );
else if( (*it).protocol() == "file" && !QFile::exists( (*it).path() ) ) else if( (*it).protocol() == "file" && !TQFile::exists( (*it).path() ) )
//remove stale entries //remove stale entries
it = urls.remove( it ); it = urls.remove( it );
else else
@ -92,23 +92,23 @@ PlayDialog::createRecentFileWidget( QBoxLayout *layout )
} }
for( KURL::List::ConstIterator it = urls.begin(), end = urls.end(); it != end; ++it ) { for( KURL::List::ConstIterator it = urls.begin(), end = urls.end(); it != end; ++it ) {
const QString fileName = (*it).fileName(); const TQString fileName = (*it).fileName();
new KListViewItem( lv, 0, (*it).url(), fileName.isEmpty() ? (*it).prettyURL() : fileName ); new KListViewItem( lv, 0, (*it).url(), fileName.isEmpty() ? (*it).prettyURL() : fileName );
} }
if( lv->childCount() ) { if( lv->childCount() ) {
layout->addWidget( lv, 1 ); layout->addWidget( lv, 1 );
connect( lv, SIGNAL(executed( QListViewItem* )), SLOT(done( QListViewItem* )) ); connect( lv, SIGNAL(executed( TQListViewItem* )), SLOT(done( TQListViewItem* )) );
} }
else else
delete lv; delete lv;
} }
void void
PlayDialog::done( QListViewItem *item ) PlayDialog::done( TQListViewItem *item )
{ {
m_url = item->text( 0 ); m_url = item->text( 0 );
QDialog::done( RECENT_FILE ); TQDialog::done( RECENT_FILE );
} }
} }

@ -5,29 +5,29 @@
#define CODEINEPLAYDIALOG_H #define CODEINEPLAYDIALOG_H
#include <kurl.h> #include <kurl.h>
#include <qdialog.h> #include <ntqdialog.h>
class KListView; class KListView;
class QBoxLayout; class TQBoxLayout;
class QListViewItem; class TQListViewItem;
namespace Codeine namespace Codeine
{ {
class PlayDialog : public QDialog class PlayDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
PlayDialog( QWidget*, bool show_welcome_dialog = false ); PlayDialog( TQWidget*, bool show_welcome_dialog = false );
const KURL &url() const { return m_url; } const KURL &url() const { return m_url; }
enum DialogCode { FILE = QDialog::Accepted + 2, VCD, CDDA, DVD, RECENT_FILE }; enum DialogCode { FILE = TQDialog::Accepted + 2, VCD, CDDA, DVD, RECENT_FILE };
private slots: private slots:
void done( QListViewItem* ); void done( TQListViewItem* );
private: private:
void createRecentFileWidget( QBoxLayout* ); void createRecentFileWidget( TQBoxLayout* );
KURL m_url; KURL m_url;
}; };

@ -9,8 +9,8 @@
#include "debug.h" #include "debug.h"
#include <kio/netaccess.h> #include <kio/netaccess.h>
#include "playlistFile.h" #include "playlistFile.h"
#include <qfile.h> #include <ntqfile.h>
#include <qtextstream.h> #include <ntqtextstream.h>
#include <mxcl.library.h> #include <mxcl.library.h>
@ -21,7 +21,7 @@ PlaylistFile::PlaylistFile( const KURL &url )
{ {
mxcl::WaitCursor allocateOnStack; mxcl::WaitCursor allocateOnStack;
QString &path = m_path = url.path(); TQString &path = m_path = url.path();
if( path.endsWith( ".pls", false ) ) if( path.endsWith( ".pls", false ) )
m_type = PLS; else m_type = PLS; else
@ -34,16 +34,16 @@ PlaylistFile::PlaylistFile( const KURL &url )
} }
if( m_isRemoteFile ) { if( m_isRemoteFile ) {
path = QString(); path = TQString();
if( !KIO::NetAccess::download( url, path, Codeine::mainWindow() ) ) { if( !KIO::NetAccess::download( url, path, Codeine::mainWindow() ) ) {
m_error = i18n( "Codeine could not download the remote playlist: %1" ).arg( url.prettyURL() ); m_error = i18n( "Codeine could not download the remote playlist: %1" ).arg( url.prettyURL() );
return; return;
} }
} }
QFile file( path ); TQFile file( path );
if( file.open( IO_ReadOnly ) ) { if( file.open( IO_ReadOnly ) ) {
QTextStream stream( &file ); TQTextStream stream( &file );
switch( m_type ) { switch( m_type ) {
case M3U: parseM3uFile( stream ); break; case M3U: parseM3uFile( stream ); break;
case PLS: parsePlsFile( stream ); break; case PLS: parsePlsFile( stream ); break;
@ -67,15 +67,15 @@ PlaylistFile::~PlaylistFile()
void void
PlaylistFile::parsePlsFile( QTextStream &stream ) PlaylistFile::parsePlsFile( TQTextStream &stream )
{ {
DEBUG_BLOCK DEBUG_BLOCK
for( QString line = stream.readLine(); !line.isNull(); ) for( TQString line = stream.readLine(); !line.isNull(); )
{ {
if( line.startsWith( "File" ) ) { if( line.startsWith( "File" ) ) {
const KURL url = line.section( '=', -1 ); const KURL url = line.section( '=', -1 );
const QString title = stream.readLine().section( '=', -1 ); const TQString title = stream.readLine().section( '=', -1 );
debug() << url << endl << title << endl; debug() << url << endl << title << endl;
@ -90,11 +90,11 @@ PlaylistFile::parsePlsFile( QTextStream &stream )
void void
PlaylistFile::parseM3uFile( QTextStream &stream ) PlaylistFile::parseM3uFile( TQTextStream &stream )
{ {
DEBUG_BLOCK DEBUG_BLOCK
for( QString line; !stream.atEnd(); ) for( TQString line; !stream.atEnd(); )
{ {
line = stream.readLine(); line = stream.readLine();

@ -17,19 +17,19 @@ public:
bool isPlaylist() const { return m_type != Unknown; } bool isPlaylist() const { return m_type != Unknown; }
bool isValid() const { return m_isValid; } bool isValid() const { return m_isValid; }
KURL firstUrl() const { return m_contents.isEmpty() ? KURL() : m_contents.first(); } KURL firstUrl() const { return m_contents.isEmpty() ? KURL() : m_contents.first(); }
QString error() const { return m_error; } TQString error() const { return m_error; }
private: private:
/// both only return first url currently /// both only return first url currently
void parsePlsFile( QTextStream& ); void parsePlsFile( TQTextStream& );
void parseM3uFile( QTextStream& ); void parseM3uFile( TQTextStream& );
KURL m_url; KURL m_url;
bool m_isRemoteFile; bool m_isRemoteFile;
bool m_isValid; bool m_isValid;
QString m_error; TQString m_error;
FileFormat m_type; FileFormat m_type;
QString m_path; TQString m_path;
KURL::List m_contents; KURL::List m_contents;
}; };

@ -3,12 +3,12 @@
#include "debug.h" #include "debug.h"
#include "slider.h" #include "slider.h"
#include <qapplication.h> #include <ntqapplication.h>
#include <qlabel.h> #include <ntqlabel.h>
#include <qsize.h> #include <ntqsize.h>
#include <qtooltip.h> #include <ntqtooltip.h>
#include <qpainter.h> #include <ntqpainter.h>
#include "xineEngine.h" #include "xineEngine.h"
using Codeine::Slider; using Codeine::Slider;
@ -17,8 +17,8 @@ using Codeine::Slider;
Slider *Slider::s_instance = 0; Slider *Slider::s_instance = 0;
Slider::Slider( QWidget *parent, uint max ) Slider::Slider( TQWidget *parent, uint max )
: QSlider( Qt::Horizontal, parent ) : TQSlider( TQt::Horizontal, parent )
, m_sliding( false ) , m_sliding( false )
, m_outside( false ) , m_outside( false )
, m_prevValue( 0 ) , m_prevValue( 0 )
@ -27,34 +27,34 @@ Slider::Slider( QWidget *parent, uint max )
setRange( 0, max ); setRange( 0, max );
setFocusPolicy( NoFocus ); setFocusPolicy( NoFocus );
setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ); setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding );
} }
void void
Slider::wheelEvent( QWheelEvent *e ) Slider::wheelEvent( TQWheelEvent *e )
{ {
//if you use this class elsewhere, NOTE this is Codeine specific //if you use this class elsewhere, NOTE this is Codeine specific
e->ignore(); //pass to VideoWindow e->ignore(); //pass to VideoWindow
} }
void void
Slider::mouseMoveEvent( QMouseEvent *e ) Slider::mouseMoveEvent( TQMouseEvent *e )
{ {
if( m_sliding ) if( m_sliding )
{ {
//feels better, but using set value of 20 is bad of course //feels better, but using set value of 20 is bad of course
QRect rect = this->rect(); TQRect rect = this->rect();
rect.addCoords( -20, -20, 20, 20 ); rect.addCoords( -20, -20, 20, 20 );
if( !rect.contains( e->pos() ) ) { if( !rect.contains( e->pos() ) ) {
if( !m_outside ) if( !m_outside )
QSlider::setValue( m_prevValue ); TQSlider::setValue( m_prevValue );
m_outside = true; m_outside = true;
} else { } else {
m_outside = false; m_outside = false;
QSlider::setValue( TQSlider::setValue(
QRangeControl::valueFromPosition( TQRangeControl::valueFromPosition(
e->pos().x() - sliderRect().width()/2, e->pos().x() - sliderRect().width()/2,
width() - sliderRect().width() ) ); width() - sliderRect().width() ) );
@ -62,43 +62,43 @@ Slider::mouseMoveEvent( QMouseEvent *e )
} }
} }
else else
QSlider::mouseMoveEvent( e ); TQSlider::mouseMoveEvent( e );
} }
void void
Slider::mousePressEvent( QMouseEvent *e ) Slider::mousePressEvent( TQMouseEvent *e )
{ {
m_sliding = true; m_sliding = true;
m_prevValue = QSlider::value(); m_prevValue = TQSlider::value();
if( !sliderRect().contains( e->pos() ) ) if( !sliderRect().contains( e->pos() ) )
mouseMoveEvent( e ); mouseMoveEvent( e );
} }
void void
Slider::mouseReleaseEvent( QMouseEvent* ) Slider::mouseReleaseEvent( TQMouseEvent* )
{ {
if( !m_outside && QSlider::value() != m_prevValue ) if( !m_outside && TQSlider::value() != m_prevValue )
emit sliderReleased( value() ); emit sliderReleased( value() );
m_sliding = false; m_sliding = false;
m_outside = false; m_outside = false;
} }
static inline QString timeAsString( const int s ) static inline TQString timeAsString( const int s )
{ {
#define zeroPad( n ) n < 10 ? QString("0%1").arg( n ) : QString::number( n ) #define zeroPad( n ) n < 10 ? TQString("0%1").arg( n ) : TQString::number( n )
using Codeine::engine; using Codeine::engine;
const int m = s / 60; const int m = s / 60;
const int h = m / 60; const int h = m / 60;
QString time; TQString time;
time.prepend( zeroPad( s % 60 ) ); //seconds time.prepend( zeroPad( s % 60 ) ); //seconds
time.prepend( ':' ); time.prepend( ':' );
time.prepend( zeroPad( m % 60 ) ); //minutes time.prepend( zeroPad( m % 60 ) ); //minutes
time.prepend( ':' ); time.prepend( ':' );
time.prepend( QString::number( h ) ); //hours time.prepend( TQString::number( h ) ); //hours
return time; return time;
} }
@ -106,17 +106,17 @@ static inline QString timeAsString( const int s )
void void
Slider::setValue( int newValue ) Slider::setValue( int newValue )
{ {
static QLabel *w1 = 0; static TQLabel *w1 = 0;
static QLabel *w2 = 0; static TQLabel *w2 = 0;
if (!w1) { if (!w1) {
w1 = new QLabel( this ); w1 = new TQLabel( this );
w1->setPalette( QToolTip::palette() ); w1->setPalette( TQToolTip::palette() );
w1->setFrameStyle( QFrame::Plain | QFrame::Box ); w1->setFrameStyle( TQFrame::Plain | TQFrame::Box );
w2 = new QLabel( this ); w2 = new TQLabel( this );
w2->setPalette( QToolTip::palette() ); w2->setPalette( TQToolTip::palette() );
w2->setFrameStyle( QFrame::Plain | QFrame::Box ); w2->setFrameStyle( TQFrame::Plain | TQFrame::Box );
} }
//TODO stupidly inefficeint! :) //TODO stupidly inefficeint! :)
@ -131,7 +131,7 @@ Slider::setValue( int newValue )
const int left = int(l * (newValue / 65535.0)); const int left = int(l * (newValue / 65535.0));
const int right = l - left; const int right = l - left;
QSlider::setValue( newValue ); TQSlider::setValue( newValue );
w1->move( 0, height() - w1->height() - 1 ); w1->move( 0, height() - w1->height() - 1 );
w1->setText( timeAsString( left ) + ' ' ); w1->setText( timeAsString( left ) + ' ' );
w1->adjustSize(); w1->adjustSize();

@ -4,11 +4,11 @@
#ifndef CODEINESLIDER_H #ifndef CODEINESLIDER_H
#define CODEINESLIDER_H #define CODEINESLIDER_H
#include <qslider.h> #include <ntqslider.h>
namespace Codeine namespace Codeine
{ {
class Slider : public QSlider class Slider : public TQSlider
{ {
Q_OBJECT Q_OBJECT
@ -16,25 +16,25 @@ namespace Codeine
static Slider *instance() { return s_instance; } static Slider *instance() { return s_instance; }
public: public:
Slider( QWidget*, uint max = 0 ); Slider( TQWidget*, uint max = 0 );
virtual void setValue( int ); virtual void setValue( int );
signals: signals:
//we emit this when the user has specifically changed the slider //we emit this when the user has specifically changed the slider
//so connect to it if valueChanged() is too generic //so connect to it if valueChanged() is too generic
//Qt also emits valueChanged( int ) //TQt also emits valueChanged( int )
void sliderReleased( uint ); void sliderReleased( uint );
protected: protected:
virtual void wheelEvent( QWheelEvent* ); virtual void wheelEvent( TQWheelEvent* );
virtual void mouseMoveEvent( QMouseEvent* ); virtual void mouseMoveEvent( TQMouseEvent* );
virtual void mouseReleaseEvent( QMouseEvent* ); virtual void mouseReleaseEvent( TQMouseEvent* );
virtual void mousePressEvent( QMouseEvent* ); virtual void mousePressEvent( TQMouseEvent* );
virtual void keyPressEvent( QKeyEvent *e ) { e->ignore(); } //so that MainWindow gets the keypress virtual void keyPressEvent( TQKeyEvent *e ) { e->ignore(); } //so that MainWindow gets the keypress
virtual QSize sizeHint() const { return QSlider::sizeHint() + QSize( 0, 6 ); } virtual TQSize sizeHint() const { return TQSlider::sizeHint() + TQSize( 0, 6 ); }
virtual QSize minimumSizeHint() const { return sizeHint(); } virtual TQSize minimumSizeHint() const { return sizeHint(); }
bool m_sliding; bool m_sliding;

@ -8,11 +8,11 @@
#include <kconfig.h> #include <kconfig.h>
#include <kglobal.h> #include <kglobal.h>
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qapplication.h> #include <ntqapplication.h>
#include <qevent.h> #include <ntqevent.h>
#include <qlabel.h> #include <ntqlabel.h>
#include <qpopupmenu.h> #include <ntqpopupmenu.h>
#include <qslider.h> #include <ntqslider.h>
#include "theStream.h" #include "theStream.h"
#include "videoSettings.h" //FIXME unfortunate #include "videoSettings.h" //FIXME unfortunate
#include "xineEngine.h" #include "xineEngine.h"
@ -36,7 +36,7 @@ MainWindow::engineStateChanged( Engine::State state )
KURL const &url = TheStream::url(); KURL const &url = TheStream::url();
bool const isFullScreen = toggleAction("fullscreen")->isChecked(); bool const isFullScreen = toggleAction("fullscreen")->isChecked();
QWidget *const toolbar = reinterpret_cast<QWidget*>(toolBar()); TQWidget *const toolbar = reinterpret_cast<TQWidget*>(toolBar());
Debug::Block block( state == Engine::Empty Debug::Block block( state == Engine::Empty
? "State: Empty" : state == Engine::Loaded ? "State: Empty" : state == Engine::Loaded
@ -62,7 +62,7 @@ MainWindow::engineStateChanged( Engine::State state )
toggleAction( "play" )->setChecked( state == Playing ); toggleAction( "play" )->setChecked( state == Playing );
//FIXME bad design to do this way //FIXME bad design to do this way
QSlider *volume = (QSlider*)toolBar()->child( "volume" ); TQSlider *volume = (TQSlider*)toolBar()->child( "volume" );
if (volume) if (volume)
volume->setValue( engine()->volume() ); volume->setValue( engine()->volume() );
} }
@ -78,8 +78,8 @@ MainWindow::engineStateChanged( Engine::State state )
// the toolbar play button is always enabled, but the menu item // the toolbar play button is always enabled, but the menu item
// is disabled if we are empty, this looks more sensible // is disabled if we are empty, this looks more sensible
QPopupMenu * const file_menu = menu( "file" ); TQPopupMenu * const file_menu = menu( "file" );
QPopupMenu * const settings_menu = menu( "settings" ); TQPopupMenu * const settings_menu = menu( "settings" );
const int play_id = file_menu->idAt( 2 ); const int play_id = file_menu->idAt( 2 );
file_menu->setItemEnabled( play_id, state != Empty ); file_menu->setItemEnabled( play_id, state != Empty );
@ -95,7 +95,7 @@ MainWindow::engineStateChanged( Engine::State state )
// set correct aspect ratio // set correct aspect ratio
if( state == Loaded ) if( state == Loaded )
static_cast<QPopupMenu*>(child( "aspect_ratio_menu" ))->setItemChecked( TheStream::aspectRatio(), true ); static_cast<TQPopupMenu*>(child( "aspect_ratio_menu" ))->setItemChecked( TheStream::aspectRatio(), true );
} }
@ -130,20 +130,20 @@ MainWindow::engineStateChanged( Engine::State state )
#ifndef NO_SKIP_PR0N #ifndef NO_SKIP_PR0N
// ;-) // ;-)
const QString url_string = url.url(); const TQString url_string = url.url();
if( !(url_string.contains( "porn", false ) || url_string.contains( "pr0n", false )) ) if( !(url_string.contains( "porn", false ) || url_string.contains( "pr0n", false )) )
#endif #endif
if( url.protocol() != "dvd" && url.protocol() != "vcd" ) { if( url.protocol() != "dvd" && url.protocol() != "vcd" ) {
KConfig *config = Codeine::config( "General" ); KConfig *config = Codeine::config( "General" );
const QString prettyUrl = url.prettyURL(); const TQString prettyUrl = url.prettyURL();
QStringList urls = config->readPathListEntry( "Recent Urls" ); TQStringList urls = config->readPathListEntry( "Recent Urls" );
urls.remove( prettyUrl ); urls.remove( prettyUrl );
config->writePathEntry( "Recent Urls", urls << prettyUrl ); config->writePathEntry( "Recent Urls", urls << prettyUrl );
} }
if( TheStream::hasVideo() && !isFullScreen ) if( TheStream::hasVideo() && !isFullScreen )
new AdjustSizeButton( reinterpret_cast<QWidget*>(videoWindow()) ); new AdjustSizeButton( reinterpret_cast<TQWidget*>(videoWindow()) );
} }
@ -165,7 +165,7 @@ MainWindow::engineStateChanged( Engine::State state )
/// set toolbar states /// set toolbar states
QWidget *dvd_button = (QWidget*)toolBar()->child( "toolbutton_toggle_dvd_menu" ); TQWidget *dvd_button = (TQWidget*)toolBar()->child( "toolbutton_toggle_dvd_menu" );
if (dvd_button) if (dvd_button)
dvd_button->setShown( state != Engine::Empty && url.protocol() == "dvd" ); dvd_button->setShown( state != Engine::Empty && url.protocol() == "dvd" );
@ -176,8 +176,8 @@ MainWindow::engineStateChanged( Engine::State state )
if( videoWindow()->isActiveWindow() ) { if( videoWindow()->isActiveWindow() ) {
//FIXME dual-screen this seems to still show //FIXME dual-screen this seems to still show
QContextMenuEvent e( QContextMenuEvent::Other, QPoint(), Qt::MetaButton ); TQContextMenuEvent e( TQContextMenuEvent::Other, TQPoint(), TQt::MetaButton );
QApplication::sendEvent( videoWindow(), &e ); TQApplication::sendEvent( videoWindow(), &e );
} }
break; break;
case Engine::Empty: case Engine::Empty:

@ -16,7 +16,7 @@ namespace Codeine
{ {
//TODO a unique id for discs, and then even to also record chapters etc. //TODO a unique id for discs, and then even to also record chapters etc.
// if( url().protocol() == "dvd" ) // if( url().protocol() == "dvd" )
// return Codeine::config( QString( "dvd:/" ) + prettyTitle() ); // return Codeine::config( TQString( "dvd:/" ) + prettyTitle() );
// else // else
return Codeine::config( url().prettyURL() ); return Codeine::config( url().prettyURL() );
} }
@ -38,12 +38,12 @@ namespace Codeine
TheStream::hasVideo() TheStream::hasVideo()
{ return xine_get_stream_info( e->m_stream, XINE_STREAM_INFO_HAS_VIDEO ); } { return xine_get_stream_info( e->m_stream, XINE_STREAM_INFO_HAS_VIDEO ); }
QSize TQSize
TheStream::defaultVideoSize() TheStream::defaultVideoSize()
{ {
return !e->m_stream return !e->m_stream
? QSize() ? TQSize()
: QSize( : TQSize(
xine_get_stream_info( e->m_stream, XINE_STREAM_INFO_VIDEO_WIDTH ), xine_get_stream_info( e->m_stream, XINE_STREAM_INFO_VIDEO_WIDTH ),
xine_get_stream_info( e->m_stream, XINE_STREAM_INFO_VIDEO_HEIGHT ) ); xine_get_stream_info( e->m_stream, XINE_STREAM_INFO_VIDEO_HEIGHT ) );
} }
@ -57,35 +57,35 @@ namespace Codeine
int TheStream::audioChannel() int TheStream::audioChannel()
{ return xine_get_param( e->m_stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL ); } { return xine_get_param( e->m_stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL ); }
QString TQString
TheStream::prettyTitle() TheStream::prettyTitle()
{ {
const KURL &url = e->m_url; const KURL &url = e->m_url;
const QString artist = QString::fromUtf8( xine_get_meta_info( e->m_stream, XINE_META_INFO_ARTIST ) ); const TQString artist = TQString::fromUtf8( xine_get_meta_info( e->m_stream, XINE_META_INFO_ARTIST ) );
const QString title = QString::fromUtf8( xine_get_meta_info( e->m_stream, XINE_META_INFO_TITLE ) ); const TQString title = TQString::fromUtf8( xine_get_meta_info( e->m_stream, XINE_META_INFO_TITLE ) );
if (hasVideo() && !title.isEmpty()) if (hasVideo() && !title.isEmpty())
return title; return title;
else if (!title.isEmpty() && !artist.isEmpty()) else if (!title.isEmpty() && !artist.isEmpty())
return artist + " - " + title; return artist + " - " + title;
else if (url.protocol() != "http" && !url.fileName().isEmpty()) { else if (url.protocol() != "http" && !url.fileName().isEmpty()) {
const QString n = url.fileName(); const TQString n = url.fileName();
return KURL::decode_string( n.left( n.findRev( '.' ) ).replace( '_', ' ' ) ); } return KURL::decode_string( n.left( n.findRev( '.' ) ).replace( '_', ' ' ) ); }
else else
return url.prettyURL(); return url.prettyURL();
} }
static inline QString static inline TQString
entryHelper( const QString &plate, const QString &s1, const QString &s2 ) entryHelper( const TQString &plate, const TQString &s1, const TQString &s2 )
{ {
return s2.isEmpty() ? s2 : plate.arg( s1 ).arg( s2 ); return s2.isEmpty() ? s2 : plate.arg( s1 ).arg( s2 );
} }
static inline QString static inline TQString
sectionHelper( const QString &sectionTitle, const QStringList &entries ) sectionHelper( const TQString &sectionTitle, const TQStringList &entries )
{ {
QString s; TQString s;
foreach( entries ) foreach( entries )
if( !(*it).isEmpty() ) if( !(*it).isEmpty() )
@ -94,18 +94,18 @@ namespace Codeine
return s.isEmpty() ? s : "<h2>" + sectionTitle + "</h2>" + s; return s.isEmpty() ? s : "<h2>" + sectionTitle + "</h2>" + s;
} }
QString TQString
TheStream::information() TheStream::information()
{ {
#define meta( x ) xine_get_meta_info( e->m_stream, x ) #define meta( x ) xine_get_meta_info( e->m_stream, x )
#define info( x, y ) x.arg( xine_get_stream_info( e->m_stream, y ) ) #define info( x, y ) x.arg( xine_get_stream_info( e->m_stream, y ) )
#define simple( x ) QString::number( xine_get_stream_info( e->m_stream, x ) ) #define simple( x ) TQString::number( xine_get_stream_info( e->m_stream, x ) )
const QString plate = "<p><b>%1</b>: %2</p>"; const TQString plate = "<p><b>%1</b>: %2</p>";
QString s; TQString s;
s += sectionHelper( i18n("Metadata"), s += sectionHelper( i18n("Metadata"),
QStringList() TQStringList()
<< entryHelper( plate, i18n("Title"), meta( XINE_META_INFO_TITLE ) ) << entryHelper( plate, i18n("Title"), meta( XINE_META_INFO_TITLE ) )
<< entryHelper( plate, i18n("Comment"), meta( XINE_META_INFO_COMMENT ) ) << entryHelper( plate, i18n("Comment"), meta( XINE_META_INFO_COMMENT ) )
<< entryHelper( plate, i18n("Artist"), meta( XINE_META_INFO_ARTIST ) ) << entryHelper( plate, i18n("Artist"), meta( XINE_META_INFO_ARTIST ) )
@ -114,19 +114,19 @@ namespace Codeine
<< entryHelper( plate, i18n("Year"), meta( XINE_META_INFO_YEAR ) ) ); << entryHelper( plate, i18n("Year"), meta( XINE_META_INFO_YEAR ) ) );
s += sectionHelper( i18n("Audio Properties"), s += sectionHelper( i18n("Audio Properties"),
QStringList() TQStringList()
<< entryHelper( plate, i18n("Bitrate"), info( i18n("%1 bps"), XINE_STREAM_INFO_AUDIO_BITRATE ) ) << entryHelper( plate, i18n("Bitrate"), info( i18n("%1 bps"), XINE_STREAM_INFO_AUDIO_BITRATE ) )
<< entryHelper( plate, i18n("Sample-rate"), info( i18n("%1 Hz"), XINE_STREAM_INFO_AUDIO_SAMPLERATE ) ) ); << entryHelper( plate, i18n("Sample-rate"), info( i18n("%1 Hz"), XINE_STREAM_INFO_AUDIO_SAMPLERATE ) ) );
s += sectionHelper( i18n("Technical Information"), s += sectionHelper( i18n("Technical Information"),
QStringList() TQStringList()
<< entryHelper( plate, i18n("Video Codec"), meta( XINE_META_INFO_VIDEOCODEC ) ) << entryHelper( plate, i18n("Video Codec"), meta( XINE_META_INFO_VIDEOCODEC ) )
<< entryHelper( plate, i18n("Audio Codec"), meta( XINE_META_INFO_AUDIOCODEC ) ) << entryHelper( plate, i18n("Audio Codec"), meta( XINE_META_INFO_AUDIOCODEC ) )
<< entryHelper( plate, i18n("System Layer"), meta( XINE_META_INFO_SYSTEMLAYER ) ) << entryHelper( plate, i18n("System Layer"), meta( XINE_META_INFO_SYSTEMLAYER ) )
<< entryHelper( plate, i18n("Input Plugin"), meta( XINE_META_INFO_INPUT_PLUGIN )) << entryHelper( plate, i18n("Input Plugin"), meta( XINE_META_INFO_INPUT_PLUGIN ))
<< entryHelper( plate, i18n("CDINDEX_DISCID"), meta( XINE_META_INFO_CDINDEX_DISCID ) ) ); << entryHelper( plate, i18n("CDINDEX_DISCID"), meta( XINE_META_INFO_CDINDEX_DISCID ) ) );
QStringList texts; TQStringList texts;
texts << "BITRATE" << "SEEKABLE" << "VIDEO_WIDTH" << "VIDEO_HEIGHT" << "VIDEO_RATIO" << "VIDEO_CHANNELS" << "VIDEO_STREAMS" << "VIDEO_BITRATE" << "VIDEO_FOURCC" << "VIDEO_HANDLED" << "FRAME_DURATION" << "AUDIO_CHANNELS" << "AUDIO_BITS" << "-AUDIO_SAMPLERATE" << "-AUDIO_BITRATE" << "AUDIO_FOURCC" << "AUDIO_HANDLED" << "HAS_CHAPTERS" << "HAS_VIDEO" << "HAS_AUDIO" << "-IGNORE_VIDEO" << "-IGNORE_AUDIO" << "-IGNORE_SPU" << "VIDEO_HAS_STILL" << "MAX_AUDIO_CHANNEL" << "MAX_SPU_CHANNEL" << "AUDIO_MODE" << "SKIPPED_FRAMES" << "DISCARDED_FRAMES"; texts << "BITRATE" << "SEEKABLE" << "VIDEO_WIDTH" << "VIDEO_HEIGHT" << "VIDEO_RATIO" << "VIDEO_CHANNELS" << "VIDEO_STREAMS" << "VIDEO_BITRATE" << "VIDEO_FOURCC" << "VIDEO_HANDLED" << "FRAME_DURATION" << "AUDIO_CHANNELS" << "AUDIO_BITS" << "-AUDIO_SAMPLERATE" << "-AUDIO_BITRATE" << "AUDIO_FOURCC" << "AUDIO_HANDLED" << "HAS_CHAPTERS" << "HAS_VIDEO" << "HAS_AUDIO" << "-IGNORE_VIDEO" << "-IGNORE_AUDIO" << "-IGNORE_SPU" << "VIDEO_HAS_STILL" << "MAX_AUDIO_CHANNEL" << "MAX_SPU_CHANNEL" << "AUDIO_MODE" << "SKIPPED_FRAMES" << "DISCARDED_FRAMES";
s += "<h2>Other</h2>"; s += "<h2>Other</h2>";

@ -6,8 +6,8 @@
#include "config.h" // needed for inline functions #include "config.h" // needed for inline functions
#include <kurl.h> // larger :( but no macros at least #include <kurl.h> // larger :( but no macros at least
#include <qsize.h> // small header #include <ntqsize.h> // small header
#include <qstring.h> // small header #include <ntqstring.h> // small header
/// for purely static classes /// for purely static classes
#define CODEINE_NO_EXPORT( T ) \ #define CODEINE_NO_EXPORT( T ) \
@ -31,14 +31,14 @@ namespace Codeine
static bool hasAudio(); static bool hasAudio();
static bool hasVideo(); static bool hasVideo();
static QSize defaultVideoSize(); static TQSize defaultVideoSize();
static int aspectRatio(); static int aspectRatio();
static int subtitleChannel(); static int subtitleChannel();
static int audioChannel(); static int audioChannel();
static QString prettyTitle(); static TQString prettyTitle();
static QString information(); static TQString information();
static inline bool hasProfile() static inline bool hasProfile()
{ return KGlobal::config()->hasGroup( url().prettyURL() ); } { return KGlobal::config()->hasGroup( url().prettyURL() ); }

@ -3,9 +3,9 @@
#include <kwin.h> #include <kwin.h>
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qlabel.h> #include <ntqlabel.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qslider.h> #include <ntqslider.h>
#include "videoSettings.h" #include "videoSettings.h"
#include <xine.h> #include <xine.h>
#include "xineEngine.h" #include "xineEngine.h"
@ -13,7 +13,7 @@
extern "C" extern "C"
{ {
// #include <X11/Xlib.h> is just dangerous! Here, there is a macro for Below that conflicts // #include <X11/Xlib.h> is just dangerous! Here, there is a macro for Below that conflicts
// with QSlider::Below. Stupid X11 people. // with TQSlider::Below. Stupid X11 people.
typedef unsigned long XID; typedef unsigned long XID;
typedef XID Window; typedef XID Window;
extern int XSetTransientForHint( Display*, Window, Window ); extern int XSetTransientForHint( Display*, Window, Window );
@ -24,61 +24,61 @@ extern "C"
//TODO show a warning that when paused the changes aren't updated to the display, show an unpause button too //TODO show a warning that when paused the changes aren't updated to the display, show an unpause button too
class SnapSlider : public QSlider class SnapSlider : public TQSlider
{ {
int m_offset; int m_offset;
public: public:
SnapSlider( const int value, QWidget *parent, const char *name ) SnapSlider( const int value, TQWidget *parent, const char *name )
: QSlider( (65536/4)-1, (3*(65536/4))-1, 1000, value, Qt::Horizontal, parent, name ) : TQSlider( (65536/4)-1, (3*(65536/4))-1, 1000, value, TQt::Horizontal, parent, name )
, m_offset( 0 ) , m_offset( 0 )
{ {
setTickmarks( QSlider::Below ); setTickmarks( TQSlider::Below );
setTickInterval( 65536 / 4 ); setTickInterval( 65536 / 4 );
setMinimumWidth( fontMetrics().width( name ) * 3 ); setMinimumWidth( fontMetrics().width( name ) * 3 );
connect( this, SIGNAL(valueChanged( int )), Codeine::engine(), SLOT(setStreamParameter( int )) ); connect( this, SIGNAL(valueChanged( int )), Codeine::engine(), SLOT(setStreamParameter( int )) );
} }
virtual void mousePressEvent( QMouseEvent *e ) virtual void mousePressEvent( TQMouseEvent *e )
{ {
m_offset = e->pos().x() - (sliderStart() + (sliderRect().width()/2)); m_offset = e->pos().x() - (sliderStart() + (sliderRect().width()/2));
QSlider::mousePressEvent( e ); TQSlider::mousePressEvent( e );
} }
virtual void mouseMoveEvent( QMouseEvent *e ) virtual void mouseMoveEvent( TQMouseEvent *e )
{ {
const int MIDDLE = width() / 2; const int MIDDLE = width() / 2;
const int x = e->pos().x() - m_offset; const int x = e->pos().x() - m_offset;
const int F = sliderRect().width() / 2; const int F = sliderRect().width() / 2;
if( x > MIDDLE - F && x < MIDDLE + F ) { if( x > MIDDLE - F && x < MIDDLE + F ) {
QMouseEvent e2( e->type(), QPoint( MIDDLE + m_offset, e->pos().y() ), e->button(), e->state() ); TQMouseEvent e2( e->type(), TQPoint( MIDDLE + m_offset, e->pos().y() ), e->button(), e->state() );
QSlider::mouseMoveEvent( &e2 ); TQSlider::mouseMoveEvent( &e2 );
QRangeControl::setValue( 65536 / 2 - 1 ); // to ensure we are absolutely exact TQRangeControl::setValue( 65536 / 2 - 1 ); // to ensure we are absolutely exact
} }
else else
QSlider::mouseMoveEvent( e ); TQSlider::mouseMoveEvent( e );
} }
}; };
Codeine::VideoSettingsDialog::VideoSettingsDialog( QWidget *parent ) Codeine::VideoSettingsDialog::VideoSettingsDialog( TQWidget *parent )
: KDialog( parent, "video_settings_dialog", false, WType_TopLevel | WDestructiveClose ) : KDialog( parent, "video_settings_dialog", false, WType_TopLevel | WDestructiveClose )
{ {
XSetTransientForHint( x11Display(), winId(), parent->winId() ); XSetTransientForHint( x11Display(), winId(), parent->winId() );
KWin::setType( winId(), NET::Utility ); KWin::setType( winId(), NET::Utility );
KWin::setState( winId(), NET::SkipTaskbar ); KWin::setState( winId(), NET::SkipTaskbar );
QFrame *frame = new QFrame( this ); TQFrame *frame = new TQFrame( this );
(new QVBoxLayout( this, 10 ))->addWidget( frame ); (new TQVBoxLayout( this, 10 ))->addWidget( frame );
frame->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); frame->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
frame->setPaletteBackgroundColor( backgroundColor().dark( 102 ) ); frame->setPaletteBackgroundColor( backgroundColor().dark( 102 ) );
QGridLayout *grid = new QGridLayout( frame, 4, 2, 15, 10 ); TQGridLayout *grid = new TQGridLayout( frame, 4, 2, 15, 10 );
grid->setAutoAdd( true ); grid->setAutoAdd( true );
#define makeSlider( PARAM, name ) \ #define makeSlider( PARAM, name ) \
new QLabel( name, frame ); \ new TQLabel( name, frame ); \
new SnapSlider( xine_get_param( *Codeine::engine(), PARAM ), frame, name ); new SnapSlider( xine_get_param( *Codeine::engine(), PARAM ), frame, name );
makeSlider( XINE_PARAM_VO_BRIGHTNESS, "brightness" ); makeSlider( XINE_PARAM_VO_BRIGHTNESS, "brightness" );
@ -95,9 +95,9 @@ Codeine::VideoSettingsDialog::VideoSettingsDialog( QWidget *parent )
} }
void void
Codeine::VideoSettingsDialog::stateChanged( QWidget *parent, Engine::State state ) //static Codeine::VideoSettingsDialog::stateChanged( TQWidget *parent, Engine::State state ) //static
{ {
QWidget *me = (QWidget*)parent->child( "video_settings_dialog" ); TQWidget *me = (TQWidget*)parent->child( "video_settings_dialog" );
if( !me ) if( !me )
return; return;
@ -110,7 +110,7 @@ Codeine::VideoSettingsDialog::stateChanged( QWidget *parent, Engine::State state
break; break;
case Engine::Loaded: case Engine::Loaded:
#define update( param, name ) static_cast<QSlider*>(me->child( name ))->setValue( xine_get_param( *Codeine::engine(), param ) ); #define update( param, name ) static_cast<TQSlider*>(me->child( name ))->setValue( xine_get_param( *Codeine::engine(), param ) );
update( XINE_PARAM_VO_BRIGHTNESS, "brightness" ); update( XINE_PARAM_VO_BRIGHTNESS, "brightness" );
update( XINE_PARAM_VO_CONTRAST, "contrast" ); update( XINE_PARAM_VO_CONTRAST, "contrast" );
update( XINE_PARAM_VO_SATURATION, "saturation" ); update( XINE_PARAM_VO_SATURATION, "saturation" );
@ -125,7 +125,7 @@ Codeine::VideoSettingsDialog::stateChanged( QWidget *parent, Engine::State state
namespace Codeine namespace Codeine
{ {
void showVideoSettingsDialog( QWidget *parent ) void showVideoSettingsDialog( TQWidget *parent )
{ {
// ensure that the dialog is shown by deleting the old one // ensure that the dialog is shown by deleting the old one
delete parent->child( "video_settings_dialog" ); delete parent->child( "video_settings_dialog" );

@ -17,9 +17,9 @@ namespace Codeine
VideoSettingsDialog &operator=( const VideoSettingsDialog& ); //disable VideoSettingsDialog &operator=( const VideoSettingsDialog& ); //disable
public: public:
VideoSettingsDialog( QWidget *parent ); VideoSettingsDialog( TQWidget *parent );
static void stateChanged( QWidget *parent, Engine::State ); static void stateChanged( TQWidget *parent, Engine::State );
}; };
} }

@ -13,8 +13,8 @@
#include <kpopupmenu.h> #include <kpopupmenu.h>
#include <kwin.h> #include <kwin.h>
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qcursor.h> #include <ntqcursor.h>
#include <qevent.h> #include <ntqevent.h>
#include "slider.h" #include "slider.h"
#include "theStream.h" #include "theStream.h"
#include <X11/Xlib.h> #include <X11/Xlib.h>
@ -125,7 +125,7 @@ VideoWindow::frameOutputCallBack(
} }
void void
VideoWindow::contextMenuEvent( QContextMenuEvent *e ) VideoWindow::contextMenuEvent( TQContextMenuEvent *e )
{ {
e->accept(); e->accept();
@ -150,7 +150,7 @@ VideoWindow::contextMenuEvent( QContextMenuEvent *e )
action( "fullscreen" )->plug( &popup ); action( "fullscreen" )->plug( &popup );
//show zoom information? //show zoom information?
if( e->state() & Qt::MetaButton ) { //only on track end, or for special users if( e->state() & TQt::MetaButton ) { //only on track end, or for special users
popup.insertSeparator(); popup.insertSeparator();
action( "file_quit" )->plug( &popup ); action( "file_quit" )->plug( &popup );
} }
@ -162,7 +162,7 @@ VideoWindow::contextMenuEvent( QContextMenuEvent *e )
} }
bool bool
VideoWindow::event( QEvent *e ) VideoWindow::event( TQEvent *e )
{ {
//TODO it would perhaps make things more responsive to //TODO it would perhaps make things more responsive to
// deactivate mouse tracking and use the x11Event() function to transfer mouse move events? // deactivate mouse tracking and use the x11Event() function to transfer mouse move events?
@ -170,14 +170,14 @@ VideoWindow::event( QEvent *e )
switch( e->type() ) switch( e->type() )
{ {
case QEvent::DragEnter: case TQEvent::DragEnter:
case QEvent::Drop: case TQEvent::Drop:
//FIXME why don't we just ignore the event? It should propogate down //FIXME why don't we just ignore the event? It should propogate down
return QApplication::sendEvent( qApp->mainWidget(), e ); return TQApplication::sendEvent( tqApp->mainWidget(), e );
case QEvent::Resize: case TQEvent::Resize:
if( !TheStream::url().isEmpty() ) { if( !TheStream::url().isEmpty() ) {
const QSize defaultSize = TheStream::defaultVideoSize(); const TQSize defaultSize = TheStream::defaultVideoSize();
const bool notDefaultSize = width() != defaultSize.width() && height() != defaultSize.height(); const bool notDefaultSize = width() != defaultSize.width() && height() != defaultSize.height();
Codeine::action( "reset_zoom" )->setEnabled( notDefaultSize ); Codeine::action( "reset_zoom" )->setEnabled( notDefaultSize );
@ -186,27 +186,27 @@ VideoWindow::event( QEvent *e )
} }
break; break;
case QEvent::Leave: case TQEvent::Leave:
m_timer.stop(); m_timer.stop();
break; break;
// Xlib.h sucks fucking balls!!!!11!!1! // Xlib.h sucks fucking balls!!!!11!!1!
#undef FocusOut #undef FocusOut
case QEvent::FocusOut: case TQEvent::FocusOut:
// if the user summons some dialog via a shortcut or whatever we need to ensure // if the user summons some dialog via a shortcut or whatever we need to ensure
// the mouse gets shown, because if it is modal, we won't get mouse events after // the mouse gets shown, because if it is modal, we won't get mouse events after
// it is shown! This works because we are always the focus widget. // it is shown! This works because we are always the focus widget.
// @see MainWindow::MainWindow where we setFocusProxy() // @see MainWindow::MainWindow where we setFocusProxy()
case QEvent::Enter: case TQEvent::Enter:
case QEvent::MouseMove: case TQEvent::MouseMove:
case QEvent::MouseButtonPress: case TQEvent::MouseButtonPress:
unsetCursor(); unsetCursor();
if( hasFocus() ) if( hasFocus() )
// see above comment // see above comment
m_timer.start( CURSOR_HIDE_TIMEOUT, true ); m_timer.start( CURSOR_HIDE_TIMEOUT, true );
break; break;
case QEvent::MouseButtonDblClick: case TQEvent::MouseButtonDblClick:
Codeine::action( "fullscreen" )->activate(); Codeine::action( "fullscreen" )->activate();
break; break;
@ -214,11 +214,11 @@ VideoWindow::event( QEvent *e )
} }
if( !m_xine ) if( !m_xine )
return QWidget::event( e ); return TQWidget::event( e );
switch( e->type() ) switch( e->type() )
{ {
case QEvent::Close: case TQEvent::Close:
stop(); stop();
return false; return false;
@ -229,10 +229,10 @@ VideoWindow::event( QEvent *e )
// Xlib.h sucks fucking balls!!!!11!!1! // Xlib.h sucks fucking balls!!!!11!!1!
#undef KeyPress #undef KeyPress
case QEvent::KeyPress: { case TQEvent::KeyPress: {
if( m_url.protocol() != "dvd" ) if( m_url.protocol() != "dvd" )
// let MainWindow handle this // let MainWindow handle this
return QWidget::event( e ); return TQWidget::event( e );
//FIXME left and right keys don't work during DVDs //FIXME left and right keys don't work during DVDs
@ -244,7 +244,7 @@ VideoWindow::event( QEvent *e )
//#define XINE_EVENT_INPUT_RIGHT 113 //#define XINE_EVENT_INPUT_RIGHT 113
//#define XINE_EVENT_INPUT_SELECT 114 //#define XINE_EVENT_INPUT_SELECT 114
switch( static_cast<QKeyEvent*>(e)->key() ) { switch( static_cast<TQKeyEvent*>(e)->key() ) {
case Key_Return: case Key_Return:
case Key_Enter: keyCode++; case Key_Enter: keyCode++;
case Key_Right: keyCode++; case Key_Right: keyCode++;
@ -270,18 +270,18 @@ VideoWindow::event( QEvent *e )
} }
} }
case QEvent::MouseButtonPress: case TQEvent::MouseButtonPress:
#define mouseEvent static_cast<QMouseEvent*>(e) #define mouseEvent static_cast<TQMouseEvent*>(e)
if( mouseEvent->button() != Qt::LeftButton ) if( mouseEvent->button() != TQt::LeftButton )
return false; return false;
mouseEvent->accept(); mouseEvent->accept();
//FALL THROUGH //FALL THROUGH
case QEvent::MouseMove: case TQEvent::MouseMove:
{ {
x11_rectangle_t x11Rect; x11_rectangle_t x11Rect;
xine_event_t xineEvent; xine_event_t xineEvent;
@ -294,27 +294,27 @@ VideoWindow::event( QEvent *e )
xine_gui_send_vo_data( m_stream, XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO, (void*)&x11Rect ); xine_gui_send_vo_data( m_stream, XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO, (void*)&x11Rect );
xineEvent.type = e->type() == QEvent::MouseMove ? XINE_EVENT_INPUT_MOUSE_MOVE : XINE_EVENT_INPUT_MOUSE_BUTTON; xineEvent.type = e->type() == TQEvent::MouseMove ? XINE_EVENT_INPUT_MOUSE_MOVE : XINE_EVENT_INPUT_MOUSE_BUTTON;
xineEvent.data = &xineInput; xineEvent.data = &xineInput;
xineEvent.data_length = sizeof( xine_input_data_t ); xineEvent.data_length = sizeof( xine_input_data_t );
xineInput.button = 1; //HACK e->type() == QEvent::MouseMove ? 0 : 1; xineInput.button = 1; //HACK e->type() == TQEvent::MouseMove ? 0 : 1;
xineInput.x = x11Rect.x; xineInput.x = x11Rect.x;
xineInput.y = x11Rect.y; xineInput.y = x11Rect.y;
xine_event_send( m_stream, &xineEvent ); xine_event_send( m_stream, &xineEvent );
return e->type() == QEvent::MouseMove ? false : true; return e->type() == TQEvent::MouseMove ? false : true;
#undef mouseEvent #undef mouseEvent
} }
case QEvent::Wheel: case TQEvent::Wheel:
{ {
//TODO seek amount should depend on the length, basically seek at most say 30s, and at least 0.5s //TODO seek amount should depend on the length, basically seek at most say 30s, and at least 0.5s
//TODO this is replicated (somewhat) in MainWindow::keyPressEvent //TODO this is replicated (somewhat) in MainWindow::keyPressEvent
int pos, time, length; int pos, time, length;
xine_get_pos_length( m_stream, &pos, &time, &length ); xine_get_pos_length( m_stream, &pos, &time, &length );
pos += int(std::log10( (double)length ) * static_cast<QWheelEvent*>(e)->delta()); pos += int(std::log10( (double)length ) * static_cast<TQWheelEvent*>(e)->delta());
seek( pos > 0 ? (uint)pos : 0 ); seek( pos > 0 ? (uint)pos : 0 );
@ -324,7 +324,7 @@ VideoWindow::event( QEvent *e )
default: ; default: ;
} }
return QWidget::event( e ); return TQWidget::event( e );
} }
bool bool
@ -345,13 +345,13 @@ VideoWindow::x11Event( XEvent *e )
void void
VideoWindow::hideCursor() VideoWindow::hideCursor()
{ {
setCursor( Qt::BlankCursor ); setCursor( TQt::BlankCursor );
} }
QSize TQSize
VideoWindow::sizeHint() const //virtual VideoWindow::sizeHint() const //virtual
{ {
QSize s = TheStream::profile()->readSizeEntry( "Preferred Size" ); TQSize s = TheStream::profile()->readSizeEntry( "Preferred Size" );
if( !s.isValid() ) if( !s.isValid() )
s = TheStream::defaultVideoSize(); s = TheStream::defaultVideoSize();
@ -362,12 +362,12 @@ VideoWindow::sizeHint() const //virtual
return minimumSizeHint(); return minimumSizeHint();
} }
QSize TQSize
VideoWindow::minimumSizeHint() const //virtual VideoWindow::minimumSizeHint() const //virtual
{ {
const int x = fontMetrics().width( "x" ) * 4; const int x = fontMetrics().width( "x" ) * 4;
return QSize( x * 12, x * 4 ); //FIXME return TQSize( x * 12, x * 4 ); //FIXME
} }
void void

@ -3,10 +3,10 @@
#include <klocale.h> #include <klocale.h>
#include <ktoolbar.h> #include <ktoolbar.h>
#include <qevent.h> #include <ntqevent.h>
#include <qlabel.h> #include <ntqlabel.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qslider.h> #include <ntqslider.h>
#include "debug.h" #include "debug.h"
#include "volumeAction.h" #include "volumeAction.h"
@ -14,35 +14,35 @@
#include "xineEngine.h" #include "xineEngine.h"
class VolumeSlider : public QFrame class VolumeSlider : public TQFrame
{ {
public: public:
VolumeSlider( QWidget *parent ) VolumeSlider( TQWidget *parent )
: QFrame( parent ) : TQFrame( parent )
{ {
slider = new QSlider( Qt::Vertical, this, "volume" ); slider = new TQSlider( TQt::Vertical, this, "volume" );
label = new QLabel( this ); label = new TQLabel( this );
QBoxLayout *lay = new QVBoxLayout( this ); TQBoxLayout *lay = new TQVBoxLayout( this );
lay->addWidget( slider, 0, Qt::AlignHCenter ); lay->addWidget( slider, 0, TQt::AlignHCenter );
lay->addWidget( label, 0, Qt::AlignHCenter ); lay->addWidget( label, 0, TQt::AlignHCenter );
lay->setMargin( 4 ); lay->setMargin( 4 );
slider->setRange( 0, 100 ); slider->setRange( 0, 100 );
setFrameStyle( QFrame::Plain | QFrame::Box ); setFrameStyle( TQFrame::Plain | TQFrame::Box );
setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
hide(); hide();
} }
QLabel *label; TQLabel *label;
QSlider *slider; TQSlider *slider;
}; };
VolumeAction::VolumeAction( KToolBar *bar, KActionCollection *ac ) VolumeAction::VolumeAction( KToolBar *bar, KActionCollection *ac )
: KToggleAction( i18n("Volume"), "volume", Qt::Key_1, 0, 0, ac, "volume" ) : KToggleAction( i18n("Volume"), "volume", TQt::Key_1, 0, 0, ac, "volume" )
, m_anchor( 0 ) , m_anchor( 0 )
{ {
m_widget = new VolumeSlider( bar->topLevelWidget() ); m_widget = new VolumeSlider( bar->topLevelWidget() );
@ -54,13 +54,13 @@ VolumeAction::VolumeAction( KToolBar *bar, KActionCollection *ac )
} }
int int
VolumeAction::plug( QWidget *bar, int index ) VolumeAction::plug( TQWidget *bar, int index )
{ {
DEBUG_BLOCK DEBUG_BLOCK
int const id = KAction::plug( bar, index ); int const id = KAction::plug( bar, index );
m_anchor = (QWidget*)bar->child( "toolbutton_volume" ); //KAction creates it with this name m_anchor = (TQWidget*)bar->child( "toolbutton_volume" ); //KAction creates it with this name
m_anchor->installEventFilter( this ); //so we can keep m_widget anchored m_anchor->installEventFilter( this ); //so we can keep m_widget anchored
return id; return id;
@ -78,33 +78,33 @@ VolumeAction::toggled( bool const b )
void void
VolumeAction::sliderMoved( int v ) VolumeAction::sliderMoved( int v )
{ {
v = 100 - v; //Qt sliders are wrong way round when vertical v = 100 - v; //TQt sliders are wrong way round when vertical
QString const t = QString::number( v ) + '%'; TQString const t = TQString::number( v ) + '%';
setToolTip( i18n( "Volume: %1" ).arg( t ) ); setToolTip( i18n( "Volume: %1" ).arg( t ) );
m_widget->label->setText( t ); m_widget->label->setText( t );
} }
bool bool
VolumeAction::eventFilter( QObject *o, QEvent *e ) VolumeAction::eventFilter( TQObject *o, TQEvent *e )
{ {
switch (e->type()) { switch (e->type()) {
case QEvent::Move: case TQEvent::Move:
case QEvent::Resize: { case TQEvent::Resize: {
QWidget const * const &a = m_anchor; TQWidget const * const &a = m_anchor;
m_widget->move( a->mapTo( m_widget->parentWidget(), QPoint( 0, a->height() ) ) ); m_widget->move( a->mapTo( m_widget->parentWidget(), TQPoint( 0, a->height() ) ) );
m_widget->resize( a->width(), m_widget->sizeHint().height() ); m_widget->resize( a->width(), m_widget->sizeHint().height() );
return false; return false;
} }
//TODO one click method, flawed currently in fullscreen mode by palette change in mainwindow.cpp //TODO one click method, flawed currently in fullscreen mode by palette change in mainwindow.cpp
/* case QEvent::MouseButtonPress: /* case TQEvent::MouseButtonPress:
m_widget->show(); m_widget->show();
break; break;
case QEvent::MouseButtonRelease: case TQEvent::MouseButtonRelease:
m_widget->hide(); m_widget->hide();
break;*/ break;*/

@ -10,12 +10,12 @@ class VolumeAction : public KToggleAction
{ {
Q_OBJECT Q_OBJECT
QWidget *m_anchor; TQWidget *m_anchor;
class VolumeSlider *m_widget; class VolumeSlider *m_widget;
virtual bool eventFilter( QObject *o, QEvent *e ); virtual bool eventFilter( TQObject *o, TQEvent *e );
virtual int plug( QWidget*, int ); virtual int plug( TQWidget*, int );
private slots: private slots:
void toggled( bool ); void toggled( bool );

@ -8,18 +8,18 @@
#include <klineedit.h> #include <klineedit.h>
#include <kseparator.h> #include <kseparator.h>
#include <kstdguiitem.h> #include <kstdguiitem.h>
#include <qcheckbox.h> #include <ntqcheckbox.h>
#include <qlabel.h> #include <ntqlabel.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qscrollview.h> #include <ntqscrollview.h>
#include <qspinbox.h> #include <ntqspinbox.h>
#include <qtabwidget.h> #include <ntqtabwidget.h>
#include <qtooltip.h> #include <ntqtooltip.h>
#include <qvbox.h> #include <ntqvbox.h>
#include <xine.h> #include <xine.h>
#include "xineConfig.h" #include "xineConfig.h"
QString i18n(const char *text); TQString i18n(const char *text);
KDialogBase *XineConfigDialog::s_instance = 0; KDialogBase *XineConfigDialog::s_instance = 0;
@ -28,33 +28,33 @@ KDialogBase *XineConfigDialog::s_instance = 0;
namespace Codeine namespace Codeine
{ {
void void
showXineConfigurationDialog( QWidget *parent, xine_t *xine ) showXineConfigurationDialog( TQWidget *parent, xine_t *xine )
{ {
XineConfigDialog d( xine, parent ); XineConfigDialog d( xine, parent );
if( d.exec() == QDialog::Accepted ) if( d.exec() == TQDialog::Accepted )
d.saveSettings(); d.saveSettings();
} }
} }
class TabWidget : public QTabWidget class TabWidget : public TQTabWidget
{ {
public: public:
TabWidget( QWidget *parent ) : QTabWidget( parent ) {} TabWidget( TQWidget *parent ) : TQTabWidget( parent ) {}
virtual QSize sizeHint() const virtual TQSize sizeHint() const
{ {
// Qt gives a stupid default sizeHint for this widget // TQt gives a stupid default sizeHint for this widget
return QSize( return TQSize(
reinterpret_cast<QWidget*>(tabBar())->sizeHint().width() + 5, reinterpret_cast<TQWidget*>(tabBar())->sizeHint().width() + 5,
QTabWidget::sizeHint().height() ); TQTabWidget::sizeHint().height() );
} }
}; };
///@class XineConfigDialog ///@class XineConfigDialog
XineConfigDialog::XineConfigDialog( xine_t *xine, QWidget *parent ) XineConfigDialog::XineConfigDialog( xine_t *xine, TQWidget *parent )
: KDialogBase( parent, "xine_config_dialog", : KDialogBase( parent, "xine_config_dialog",
true, //modal true, //modal
i18n("Configure xine"), User1 | Stretch | Ok | Cancel, i18n("Configure xine"), User1 | Stretch | Ok | Cancel,
@ -69,22 +69,22 @@ XineConfigDialog::XineConfigDialog( xine_t *xine, QWidget *parent )
const int METRIC = fontMetrics().width( 'x' ); const int METRIC = fontMetrics().width( 'x' );
const int METRIC_3B2 = (3*METRIC)/2; const int METRIC_3B2 = (3*METRIC)/2;
QVBox *box = new QVBox( this ); TQVBox *box = new TQVBox( this );
box->setSpacing( METRIC ); box->setSpacing( METRIC );
setMainWidget( box ); setMainWidget( box );
{ {
QHBox *hbox = new QHBox( box ); TQHBox *hbox = new TQHBox( box );
hbox->setSpacing( METRIC_3B2 ); hbox->setSpacing( METRIC_3B2 );
hbox->setMargin( METRIC_3B2 ); hbox->setMargin( METRIC_3B2 );
QPixmap info = kapp->iconLoader()->loadIcon( "messagebox_info", KIcon::NoGroup, KIcon::SizeMedium, KIcon::DefaultState, 0, true ); TQPixmap info = kapp->iconLoader()->loadIcon( "messagebox_info", KIcon::NoGroup, KIcon::SizeMedium, KIcon::DefaultState, 0, true );
QLabel *label = new QLabel( hbox ); TQLabel *label = new TQLabel( hbox );
label->setPixmap( info ); label->setPixmap( info );
label->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); label->setSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Maximum );
label = new QLabel( i18n( label = new TQLabel( i18n(
"xine's defaults are usually sensible and should not require modification. " "xine's defaults are usually sensible and should not require modification. "
"However, full configurability is provided for your pleasure ;-)." ), hbox ); "However, full configurability is provided for your pleasure ;-)." ), hbox );
label->setAlignment( QLabel::WordBreak | QLabel::AlignVCenter ); label->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter );
} }
//FIXME after many hours I have discovered that this //FIXME after many hours I have discovered that this
@ -104,16 +104,16 @@ XineConfigDialog::XineConfigDialog( xine_t *xine, QWidget *parent )
}; };
QGridLayout *grid = 0; TQGridLayout *grid = 0;
QString currentPage; TQString currentPage;
QScrollView *view = 0; TQScrollView *view = 0;
parent = 0; parent = 0;
for( XineConfigEntryIterator it( m_xine ); *it; ++it ) for( XineConfigEntryIterator it( m_xine ); *it; ++it )
{ {
const QString pageName = QString::fromUtf8( (*it)->key ).section( '.', 0, 0 ); const TQString pageName = TQString::fromUtf8( (*it)->key ).section( '.', 0, 0 );
if( (QStringList() << "ui" << "effects" << "subtitles").contains( pageName ) ) if( (TQStringList() << "ui" << "effects" << "subtitles").contains( pageName ) )
continue; continue;
if( pageName != currentPage ) { if( pageName != currentPage ) {
@ -121,21 +121,21 @@ XineConfigDialog::XineConfigDialog( xine_t *xine, QWidget *parent )
//NOTE won't be executed for last tab //NOTE won't be executed for last tab
view->viewport()->setMinimumWidth( grid->sizeHint().width() ); // seems necessary view->viewport()->setMinimumWidth( grid->sizeHint().width() ); // seems necessary
QString pageTitle = pageName; TQString pageTitle = pageName;
pageTitle[0] = pageTitle[0].upper(); pageTitle[0] = pageTitle[0].upper();
tabs->addTab( view = new QScrollView, pageTitle ); tabs->addTab( view = new TQScrollView, pageTitle );
view->setResizePolicy( QScrollView::AutoOneFit ); view->setResizePolicy( TQScrollView::AutoOneFit );
view->setHScrollBarMode( QScrollView::AlwaysOff ); view->setHScrollBarMode( TQScrollView::AlwaysOff );
view->setFrameShape( QFrame::NoFrame ); view->setFrameShape( TQFrame::NoFrame );
view->addChild( parent = new QWidget( view->viewport() ) ); view->addChild( parent = new TQWidget( view->viewport() ) );
QBoxLayout *layout = new QVBoxLayout( parent, /*margin*/METRIC_3B2, /*spacing*/0 ); TQBoxLayout *layout = new TQVBoxLayout( parent, /*margin*/METRIC_3B2, /*spacing*/0 );
parent = new QFrame( parent ); parent = new TQFrame( parent );
static_cast<QFrame*>(parent)->setFrameStyle( QFrame::Panel | QFrame::Raised ); static_cast<TQFrame*>(parent)->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
static_cast<QFrame*>(parent)->setLineWidth( 2 ); static_cast<TQFrame*>(parent)->setLineWidth( 2 );
grid = new QGridLayout( parent, /*rows*/0, /*cols*/2, /*margin*/20, /*spacing*/int(METRIC*2.5) ); grid = new TQGridLayout( parent, /*rows*/0, /*cols*/2, /*margin*/20, /*spacing*/int(METRIC*2.5) );
grid->setColStretch( 0, 3 ); grid->setColStretch( 0, 3 );
grid->setColStretch( 1, 2 ); grid->setColStretch( 1, 2 );
@ -169,7 +169,7 @@ XineConfigDialog::slotHelp()
void void
XineConfigDialog::slotUser1() XineConfigDialog::slotUser1()
{ {
for( QPtrListIterator<XineConfigEntry> it( m_entrys ); *it != 0; ++it ) for( TQPtrListIterator<XineConfigEntry> it( m_entrys ); *it != 0; ++it )
(*it)->reset(); (*it)->reset();
slotHelp(); slotHelp();
@ -178,14 +178,14 @@ XineConfigDialog::slotUser1()
bool bool
XineConfigDialog::isUnsavedSettings() const XineConfigDialog::isUnsavedSettings() const
{ {
for( QPtrListIterator<XineConfigEntry> it( m_entrys ); *it != 0; ++it ) for( TQPtrListIterator<XineConfigEntry> it( m_entrys ); *it != 0; ++it )
if( (*it)->isChanged() ) if( (*it)->isChanged() )
return true; return true;
return false; return false;
} }
#include <qdir.h> #include <ntqdir.h>
void void
XineConfigDialog::saveSettings() XineConfigDialog::saveSettings()
{ {
@ -193,56 +193,56 @@ XineConfigDialog::saveSettings()
if( entry->isChanged() ) if( entry->isChanged() )
entry->save( m_xine ); entry->save( m_xine );
xine_config_save( m_xine, QFile::encodeName( QDir::homeDirPath() + "/.xine/config" ) ); xine_config_save( m_xine, TQFile::encodeName( TQDir::homeDirPath() + "/.xine/config" ) );
} }
///@class XineConfigEntry ///@class XineConfigEntry
XineConfigEntry::XineConfigEntry( QWidget *parent, QGridLayout *grid, xine_cfg_entry_t *entry ) XineConfigEntry::XineConfigEntry( TQWidget *parent, TQGridLayout *grid, xine_cfg_entry_t *entry )
: m_widget( 0 ) : m_widget( 0 )
, m_key( entry->key ) , m_key( entry->key )
, m_string( entry->str_value ) , m_string( entry->str_value )
, m_number( entry->num_value ) , m_number( entry->num_value )
{ {
QWidget *&w = m_widget; TQWidget *&w = m_widget;
const char *signal = 0; const char *signal = 0;
const int row = grid->numRows(); const int row = grid->numRows();
QString description_text = QString::fromUtf8( entry->description ); TQString description_text = TQString::fromUtf8( entry->description );
description_text[0] = description_text[0].upper(); description_text[0] = description_text[0].upper();
switch( entry->type ) switch( entry->type )
{ {
case XINE_CONFIG_TYPE_STRING: { case XINE_CONFIG_TYPE_STRING: {
w = new KLineEdit( m_string, parent ); w = new KLineEdit( m_string, parent );
signal = SIGNAL(textChanged( const QString& )); signal = SIGNAL(textChanged( const TQString& ));
break; break;
} }
case XINE_CONFIG_TYPE_ENUM: { case XINE_CONFIG_TYPE_ENUM: {
w = new KComboBox( parent ); w = new KComboBox( parent );
for( int i = 0; entry->enum_values[i]; ++i ) for( int i = 0; entry->enum_values[i]; ++i )
((KComboBox*)w)->insertItem( QString::fromUtf8( entry->enum_values[i] ) ); ((KComboBox*)w)->insertItem( TQString::fromUtf8( entry->enum_values[i] ) );
((KComboBox*)w)->setCurrentItem( m_number ); ((KComboBox*)w)->setCurrentItem( m_number );
signal = SIGNAL(activated( int )); signal = SIGNAL(activated( int ));
break; break;
} }
case XINE_CONFIG_TYPE_RANGE: case XINE_CONFIG_TYPE_RANGE:
case XINE_CONFIG_TYPE_NUM: { case XINE_CONFIG_TYPE_NUM: {
w = new QSpinBox( w = new TQSpinBox(
QMIN( m_number, entry->range_min ), // xine bug, sometimes the min and max ranges TQMIN( m_number, entry->range_min ), // xine bug, sometimes the min and max ranges
QMAX( m_number, entry->range_max ), // are both 0 even though this is bullshit TQMAX( m_number, entry->range_max ), // are both 0 even though this is bullshit
1, parent ); 1, parent );
((QSpinBox*)w)->setValue( m_number ); ((TQSpinBox*)w)->setValue( m_number );
signal = SIGNAL(valueChanged( int )); signal = SIGNAL(valueChanged( int ));
break; break;
} }
case XINE_CONFIG_TYPE_BOOL: { case XINE_CONFIG_TYPE_BOOL: {
w = new QCheckBox( description_text, parent ); w = new TQCheckBox( description_text, parent );
((QCheckBox*)w)->setChecked( m_number ); ((TQCheckBox*)w)->setChecked( m_number );
connect( w, SIGNAL(toggled( bool )), XineConfigDialog::instance(), SLOT(slotHelp()) ); connect( w, SIGNAL(toggled( bool )), XineConfigDialog::instance(), SLOT(slotHelp()) );
QToolTip::add( w, "<qt>" + QString::fromUtf8( entry->help ) ); TQToolTip::add( w, "<qt>" + TQString::fromUtf8( entry->help ) );
grid->addMultiCellWidget( w, row, row, 0, 1 ); grid->addMultiCellWidget( w, row, row, 0, 1 );
return; //no need for a description label return; //no need for a description label
} }
@ -252,15 +252,15 @@ XineConfigEntry::XineConfigEntry( QWidget *parent, QGridLayout *grid, xine_cfg_e
connect( w, signal, XineConfigDialog::instance(), SLOT(slotHelp()) ); connect( w, signal, XineConfigDialog::instance(), SLOT(slotHelp()) );
QLabel *description = new QLabel( description_text + ':', parent ); TQLabel *description = new TQLabel( description_text + ':', parent );
description->setAlignment( QLabel::WordBreak | QLabel::AlignVCenter ); description->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter );
const QString tip = "<qt>" + QString::fromUtf8( entry->help ); const TQString tip = "<qt>" + TQString::fromUtf8( entry->help );
QToolTip::add( w, tip ); TQToolTip::add( w, tip );
QToolTip::add( description, tip ); TQToolTip::add( description, tip );
// grid->addWidget( description, row, 0, Qt::AlignVCenter ); // grid->addWidget( description, row, 0, TQt::AlignVCenter );
grid->addWidget( w, row, 1, Qt::AlignTop ); grid->addWidget( w, row, 1, TQt::AlignTop );
} }
bool bool
@ -271,8 +271,8 @@ XineConfigEntry::isChanged() const
switch( classType( m_widget->className() ) ) { switch( classType( m_widget->className() ) ) {
case LineEdit: return _(KLineEdit)->text().utf8() != m_string; case LineEdit: return _(KLineEdit)->text().utf8() != m_string;
case ComboBox: return _(KComboBox)->currentItem() != m_number; case ComboBox: return _(KComboBox)->currentItem() != m_number;
case SpinBox: return _(QSpinBox)->value() != m_number; case SpinBox: return _(TQSpinBox)->value() != m_number;
case CheckBox: return _(QCheckBox)->isChecked() != m_number; case CheckBox: return _(TQCheckBox)->isChecked() != m_number;
} }
return false; return false;
} }
@ -288,8 +288,8 @@ XineConfigEntry::reset()
switch( classType( m_widget->className() ) ) { switch( classType( m_widget->className() ) ) {
case LineEdit: _(KLineEdit)->setText( m_string ); break; case LineEdit: _(KLineEdit)->setText( m_string ); break;
case ComboBox: _(KComboBox)->setCurrentItem( m_number ); break; case ComboBox: _(KComboBox)->setCurrentItem( m_number ); break;
case SpinBox: _(QSpinBox)->setValue( m_number ); break; case SpinBox: _(TQSpinBox)->setValue( m_number ); break;
case CheckBox: _(QCheckBox)->setChecked( (bool)m_number ); break; case CheckBox: _(TQCheckBox)->setChecked( (bool)m_number ); break;
} }
m_widget->blockSignals( false ); m_widget->blockSignals( false );
} }
@ -304,11 +304,11 @@ XineConfigEntry::save( xine_t *xine )
switch( classType( m_widget->className() ) ) { switch( classType( m_widget->className() ) ) {
case LineEdit: m_string = _(KLineEdit)->text().utf8(); break; case LineEdit: m_string = _(KLineEdit)->text().utf8(); break;
case ComboBox: m_number = _(KComboBox)->currentItem(); break; case ComboBox: m_number = _(KComboBox)->currentItem(); break;
case SpinBox: m_number = _(QSpinBox)->value(); break; case SpinBox: m_number = _(TQSpinBox)->value(); break;
case CheckBox: m_number = _(QCheckBox)->isChecked(); break; case CheckBox: m_number = _(TQCheckBox)->isChecked(); break;
} }
ent.str_value = qstrdup( m_string ); ent.str_value = tqstrdup( m_string );
ent.num_value = m_number; ent.num_value = m_number;
debug() << "Saving setting: " << key() << endl; debug() << "Saving setting: " << key() << endl;

@ -5,13 +5,13 @@
#define XINECONFIG_H #define XINECONFIG_H
#include <kdialogbase.h> #include <kdialogbase.h>
#include <qptrlist.h> #include <ntqptrlist.h>
class KComboBox; class KComboBox;
class KLineEdit; class KLineEdit;
class QCheckBox; class TQCheckBox;
class QGridLayout; class TQGridLayout;
class QSpinBox; class TQSpinBox;
typedef struct xine_s xine_t; typedef struct xine_s xine_t;
typedef struct xine_cfg_entry_s xine_cfg_entry_t; typedef struct xine_cfg_entry_s xine_cfg_entry_t;
@ -19,30 +19,30 @@ typedef struct xine_cfg_entry_s xine_cfg_entry_t;
///stores a single config entry of the config file ///stores a single config entry of the config file
class XineConfigEntry : public QObject class XineConfigEntry : public TQObject
{ {
enum ClassType { LineEdit, ComboBox, SpinBox, CheckBox }; enum ClassType { LineEdit, ComboBox, SpinBox, CheckBox };
QWidget *m_widget; TQWidget *m_widget;
QCString m_key; TQCString m_key;
QCString m_string; TQCString m_string;
int m_number; int m_number;
static inline ClassType classType( const QCString &name ) static inline ClassType classType( const TQCString &name )
{ {
return name == "KLineEdit" ? LineEdit return name == "KLineEdit" ? LineEdit
: name == "KComboBox" ? ComboBox : name == "KComboBox" ? ComboBox
: name == "QSpinBox" ? SpinBox : CheckBox; : name == "TQSpinBox" ? SpinBox : CheckBox;
} }
public: public:
XineConfigEntry( QWidget *parent, QGridLayout*, xine_cfg_entry_t* ); XineConfigEntry( TQWidget *parent, TQGridLayout*, xine_cfg_entry_t* );
bool isChanged() const; bool isChanged() const;
void save( xine_t* ); void save( xine_t* );
void reset(); void reset();
inline const QCString &key() const { return m_key; } inline const TQCString &key() const { return m_key; }
}; };
@ -50,11 +50,11 @@ class XineConfigDialog : public KDialogBase
{ {
static KDialogBase *s_instance; static KDialogBase *s_instance;
QPtrList<XineConfigEntry> m_entrys; TQPtrList<XineConfigEntry> m_entrys;
xine_t *m_xine; xine_t *m_xine;
public: public:
XineConfigDialog( xine_t *xine, QWidget *parent ); XineConfigDialog( xine_t *xine, TQWidget *parent );
bool isUnsavedSettings() const; bool isUnsavedSettings() const;
void saveSettings(); void saveSettings();

@ -10,9 +10,9 @@
#include <limits> #include <limits>
#include <klocale.h> #include <klocale.h>
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qapplication.h> //::sendEvent() #include <ntqapplication.h> //::sendEvent()
#include <qdatetime.h> //record() #include <ntqdatetime.h> //record()
#include <qdir.h> //::exists() #include <ntqdir.h> //::exists()
#include "slider.h" #include "slider.h"
#include "theStream.h" #include "theStream.h"
#include <xine.h> #include <xine.h>
@ -33,8 +33,8 @@ namespace Codeine {
VideoWindow *VideoWindow::s_instance = 0; VideoWindow *VideoWindow::s_instance = 0;
VideoWindow::VideoWindow( QWidget *parent ) VideoWindow::VideoWindow( TQWidget *parent )
: QWidget( parent, "VideoWindow" ) : TQWidget( parent, "VideoWindow" )
, m_osd( 0 ) , m_osd( 0 )
, m_stream( 0 ) , m_stream( 0 )
, m_eventQueue( 0 ) , m_eventQueue( 0 )
@ -48,11 +48,11 @@ VideoWindow::VideoWindow( QWidget *parent )
s_instance = this; s_instance = this;
setWFlags( Qt::WNoAutoErase ); setWFlags( TQt::WNoAutoErase );
setMouseTracking( true ); setMouseTracking( true );
setAcceptDrops( true ); setAcceptDrops( true );
setUpdatesEnabled( false ); //to stop Qt drawing over us setUpdatesEnabled( false ); //to stop TQt drawing over us
setPaletteBackgroundColor( Qt::black ); setPaletteBackgroundColor( TQt::black );
setFocusPolicy( ClickFocus ); setFocusPolicy( ClickFocus );
//TODO sucks //TODO sucks
@ -116,7 +116,7 @@ VideoWindow::init()
#endif #endif
debug() << "xine_config_load()\n"; debug() << "xine_config_load()\n";
xine_config_load( m_xine, QFile::encodeName( QDir::homeDirPath() + "/.xine/config" ) ); xine_config_load( m_xine, TQFile::encodeName( TQDir::homeDirPath() + "/.xine/config" ) );
debug() << "xine_init()\n"; debug() << "xine_init()\n";
xine_init( m_xine ); xine_init( m_xine );
@ -160,7 +160,7 @@ VideoWindow::init()
{ {
typedef QValueList<int> List; typedef TQValueList<int> List;
List params( List() List params( List()
<< XINE_PARAM_VO_HUE << XINE_PARAM_VO_SATURATION << XINE_PARAM_VO_CONTRAST << XINE_PARAM_VO_BRIGHTNESS << XINE_PARAM_VO_HUE << XINE_PARAM_VO_SATURATION << XINE_PARAM_VO_CONTRAST << XINE_PARAM_VO_BRIGHTNESS
<< XINE_PARAM_SPU_CHANNEL << XINE_PARAM_AUDIO_CHANNEL_LOGICAL << XINE_PARAM_VO_ASPECT_RATIO ); << XINE_PARAM_SPU_CHANNEL << XINE_PARAM_AUDIO_CHANNEL_LOGICAL << XINE_PARAM_VO_ASPECT_RATIO );
@ -193,7 +193,7 @@ VideoWindow::eject()
#define writeParameter( param, default ) { \ #define writeParameter( param, default ) { \
const int value = xine_get_param( m_stream, param ); \ const int value = xine_get_param( m_stream, param ); \
const QString key = QString::number( param ); \ const TQString key = TQString::number( param ); \
if( value != default ) \ if( value != default ) \
profile->writeEntry( key, value ); \ profile->writeEntry( key, value ); \
else \ else \
@ -216,8 +216,8 @@ VideoWindow::eject()
else else
profile->deleteEntry( "Position" ); profile->deleteEntry( "Position" );
const QSize s = videoWindow()->size(); const TQSize s = videoWindow()->size();
const QSize defaultSize = TheStream::defaultVideoSize(); const TQSize defaultSize = TheStream::defaultVideoSize();
if( s.width() == defaultSize.width() || s.height() == defaultSize.height() ) if( s.width() == defaultSize.width() || s.height() == defaultSize.height() )
profile->deleteEntry( "Preferred Size" ); profile->deleteEntry( "Preferred Size" );
else else
@ -246,7 +246,7 @@ VideoWindow::load( const KURL &url )
if( xine_open( m_stream, url.url().local8Bit() ) ) if( xine_open( m_stream, url.url().local8Bit() ) )
{ {
KConfig *profile = TheStream::profile(); KConfig *profile = TheStream::profile();
#define setParameter( param, default ) xine_set_param( m_stream, param, profile->readNumEntry( QString::number( param ), default ) ); #define setParameter( param, default ) xine_set_param( m_stream, param, profile->readNumEntry( TQString::number( param ), default ) );
setParameter( XINE_PARAM_VO_HUE, 32768 ); setParameter( XINE_PARAM_VO_HUE, 32768 );
setParameter( XINE_PARAM_VO_SATURATION, 32772 ); setParameter( XINE_PARAM_VO_SATURATION, 32772 );
setParameter( XINE_PARAM_VO_CONTRAST, 32772 ); setParameter( XINE_PARAM_VO_CONTRAST, 32772 );
@ -327,20 +327,20 @@ VideoWindow::record()
if( xine_config_lookup_entry( m_xine, "misc.save_dir", &config ) ) if( xine_config_lookup_entry( m_xine, "misc.save_dir", &config ) )
{ {
//TODO which fricking KDE function tells me this? Who can tell, stupid KDE API //TODO which fricking KDE function tells me this? Who can tell, stupid KDE API
QDir d( QDir::home().filePath( "Desktop" ) ); TQDir d( TQDir::home().filePath( "Desktop" ) );
config.str_value = qstrdup( d.exists() //FIXME tiny-mem-leak, *shrug* config.str_value = tqstrdup( d.exists() //FIXME tiny-mem-leak, *shrug*
? d.path().utf8() ? d.path().utf8()
: QDir::homeDirPath().utf8() ); : TQDir::homeDirPath().utf8() );
xine_config_update_entry( m_xine, &config ); xine_config_update_entry( m_xine, &config );
const QString fileName = m_url.filename(); const TQString fileName = m_url.filename();
QString TQString
url = m_url.url(); url = m_url.url();
url += "#save:"; url += "#save:";
url += m_url.host(); url += m_url.host();
url += " ["; url += " [";
url += QDate::currentDate().toString(); url += TQDate::currentDate().toString();
url += ']'; url += ']';
url += fileName.mid( fileName.findRev( '.' ) + 1 ).lower(); url += fileName.mid( fileName.findRev( '.' ) + 1 ).lower();
@ -390,7 +390,7 @@ VideoWindow::pause()
void void
VideoWindow::showErrorMessage() VideoWindow::showErrorMessage()
{ {
const QString name = m_url.fileName(); const TQString name = m_url.fileName();
debug() << "xine_get_error()\n"; debug() << "xine_get_error()\n";
switch( xine_get_error( m_stream ) ) switch( xine_get_error( m_stream ) )
@ -501,14 +501,14 @@ VideoWindow::seek( uint pos )
//better feedback //better feedback
//NOTE doesn't work! I can't tell why.. //NOTE doesn't work! I can't tell why..
Slider::instance()->QSlider::setValue( pos ); Slider::instance()->TQSlider::setValue( pos );
Slider::instance()->repaint( false ); Slider::instance()->repaint( false );
const bool fullscreen = toggleAction("fullscreen")->isChecked(); const bool fullscreen = toggleAction("fullscreen")->isChecked();
if( fullscreen ) { if( fullscreen ) {
//TODO don't use OSD (sucks) show slider widget instead //TODO don't use OSD (sucks) show slider widget instead
QString osd = "["; TQString osd = "[";
QChar separator = '|'; TQChar separator = '|';
for( uint x = 0, y = int(pos / (65535.0/20.0)); x < 20; x++ ) { for( uint x = 0, y = int(pos / (65535.0/20.0)); x < 20; x++ ) {
if( x > y ) if( x > y )
@ -536,7 +536,7 @@ VideoWindow::seek( uint pos )
void void
VideoWindow::setStreamParameter( int value ) VideoWindow::setStreamParameter( int value )
{ {
QCString sender = this->sender()->name(); TQCString sender = this->sender()->name();
int parameter; int parameter;
if( sender == "hue" ) if( sender == "hue" )
@ -624,7 +624,7 @@ VideoWindow::scope()
} }
void void
VideoWindow::timerEvent( QTimerEvent* ) VideoWindow::timerEvent( TQTimerEvent* )
{ {
/// here we prune the buffer list regularly /// here we prune the buffer list regularly
#ifndef XINE_SAFE_MODE #ifndef XINE_SAFE_MODE
@ -654,7 +654,7 @@ VideoWindow::timerEvent( QTimerEvent* )
} }
void void
VideoWindow::customEvent( QCustomEvent *e ) VideoWindow::customEvent( TQCustomEvent *e )
{ {
switch( e->type() - 2000 ) { switch( e->type() - 2000 ) {
case XINE_EVENT_UI_PLAYBACK_FINISHED: case XINE_EVENT_UI_PLAYBACK_FINISHED:
@ -671,7 +671,7 @@ VideoWindow::customEvent( QCustomEvent *e )
char s[128]; //apparently sufficient char s[128]; //apparently sufficient
{ {
QStringList languages( "subtitle_channels_menu" ); TQStringList languages( "subtitle_channels_menu" );
int channels = xine_get_stream_info( m_stream, XINE_STREAM_INFO_MAX_SPU_CHANNEL ); int channels = xine_get_stream_info( m_stream, XINE_STREAM_INFO_MAX_SPU_CHANNEL );
for( int j = 0; j < channels; j++ ) for( int j = 0; j < channels; j++ )
languages += xine_get_spu_lang( m_stream, j, s ) ? s : i18n("Channel %1").arg( j+1 ); languages += xine_get_spu_lang( m_stream, j, s ) ? s : i18n("Channel %1").arg( j+1 );
@ -679,7 +679,7 @@ VideoWindow::customEvent( QCustomEvent *e )
} }
{ {
QStringList languages( "audio_channels_menu" ); TQStringList languages( "audio_channels_menu" );
int channels = xine_get_stream_info( m_stream, XINE_STREAM_INFO_MAX_AUDIO_CHANNEL ); int channels = xine_get_stream_info( m_stream, XINE_STREAM_INFO_MAX_AUDIO_CHANNEL );
for( int j = 0; j < channels; j++ ) for( int j = 0; j < channels; j++ )
languages += xine_get_audio_lang( m_stream, j, s ) ? s : i18n("Channel %1").arg( j+1 ); languages += xine_get_audio_lang( m_stream, j, s ) ? s : i18n("Channel %1").arg( j+1 );
@ -689,7 +689,7 @@ VideoWindow::customEvent( QCustomEvent *e )
} }
case 1000: case 1000:
#define message static_cast<QString*>(e->data()) #define message static_cast<TQString*>(e->data())
emit statusMessage( *message ); emit statusMessage( *message );
delete message; delete message;
break; break;
@ -723,8 +723,8 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
case XINE_EVENT_MRL_REFERENCE: { case XINE_EVENT_MRL_REFERENCE: {
//FIXME this is not the right way, it will have bugs //FIXME this is not the right way, it will have bugs
debug() << "XINE_EVENT_MRL_REFERENCE\n"; debug() << "XINE_EVENT_MRL_REFERENCE\n";
engine->m_url = QString::fromUtf8( ((xine_mrl_reference_data_t*)xineEvent->data)->mrl ); engine->m_url = TQString::fromUtf8( ((xine_mrl_reference_data_t*)xineEvent->data)->mrl );
QTimer::singleShot( 0, engine, SLOT(play()) ); TQTimer::singleShot( 0, engine, SLOT(play()) );
break; break;
} }
case XINE_EVENT_DROPPED_FRAMES: debug() << "XINE_EVENT_DROPPED_FRAMES\n"; break; case XINE_EVENT_DROPPED_FRAMES: debug() << "XINE_EVENT_DROPPED_FRAMES\n"; break;
@ -733,29 +733,29 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
case XINE_EVENT_FRAME_FORMAT_CHANGE: case XINE_EVENT_FRAME_FORMAT_CHANGE:
case XINE_EVENT_UI_CHANNELS_CHANGED: case XINE_EVENT_UI_CHANNELS_CHANGED:
{ {
QCustomEvent *ce; TQCustomEvent *ce;
ce = new QCustomEvent( 2000 + xineEvent->type ); ce = new TQCustomEvent( 2000 + xineEvent->type );
ce->setData( const_cast<xine_event_t*>(xineEvent) ); ce->setData( const_cast<xine_event_t*>(xineEvent) );
QApplication::postEvent( engine, ce ); TQApplication::postEvent( engine, ce );
break; break;
} }
case XINE_EVENT_UI_SET_TITLE: case XINE_EVENT_UI_SET_TITLE:
QApplication::postEvent( engine, new QCustomEvent( TQApplication::postEvent( engine, new TQCustomEvent(
QEvent::Type(3002), TQEvent::Type(3002),
new QString( QString::fromUtf8( static_cast<xine_ui_data_t*>(xineEvent->data)->str ) ) ) ); new TQString( TQString::fromUtf8( static_cast<xine_ui_data_t*>(xineEvent->data)->str ) ) ) );
break; break;
case XINE_EVENT_PROGRESS: case XINE_EVENT_PROGRESS:
{ {
xine_progress_data_t* pd = (xine_progress_data_t*)xineEvent->data; xine_progress_data_t* pd = (xine_progress_data_t*)xineEvent->data;
QString TQString
msg = "%1 %2%"; msg = "%1 %2%";
msg = msg.arg( QString::fromUtf8( pd->description ) ) msg = msg.arg( TQString::fromUtf8( pd->description ) )
.arg( KGlobal::locale()->formatNumber( pd->percent, 0 ) ); .arg( KGlobal::locale()->formatNumber( pd->percent, 0 ) );
QApplication::postEvent( engine, new QCustomEvent( QEvent::Type(3000), new QString( msg ) ) ); TQApplication::postEvent( engine, new TQCustomEvent( TQEvent::Type(3000), new TQString( msg ) ) );
break; break;
} }
case XINE_EVENT_UI_MESSAGE: case XINE_EVENT_UI_MESSAGE:
@ -763,7 +763,7 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
debug() << "message received from xine\n"; debug() << "message received from xine\n";
xine_ui_message_data_t *data = (xine_ui_message_data_t *)xineEvent->data; xine_ui_message_data_t *data = (xine_ui_message_data_t *)xineEvent->data;
QString message; TQString message;
switch( data->type ) { switch( data->type ) {
case XINE_MSG_NO_ERROR: case XINE_MSG_NO_ERROR:
@ -808,7 +808,7 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
if(data->explanation) if(data->explanation)
{ {
message += "<b>"; message += "<b>";
message += QString::fromUtf8( (char*) data + data->explanation ); message += TQString::fromUtf8( (char*) data + data->explanation );
message += "</b>"; message += "</b>";
} }
else break; //if no explanation then why bother! else break; //if no explanation then why bother!
@ -823,12 +823,12 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
if(data->parameters) if(data->parameters)
{ {
message += "xine says: <i>"; message += "xine says: <i>";
message += QString::fromUtf8( (char*) data + data->parameters); message += TQString::fromUtf8( (char*) data + data->parameters);
message += "</i>"; message += "</i>";
} }
else message += i18n("Sorry, no additional information is available."); else message += i18n("Sorry, no additional information is available.");
QApplication::postEvent( engine, new QCustomEvent(QEvent::Type(3001), new QString(message)) ); TQApplication::postEvent( engine, new TQCustomEvent(TQEvent::Type(3001), new TQString(message)) );
} }
} //case } //case
@ -849,7 +849,7 @@ VideoWindow::toggleDVDMenu()
} }
void void
VideoWindow::showOSD( const QString &message ) VideoWindow::showOSD( const TQString &message )
{ {
if( m_osd ) { if( m_osd ) {
xine_osd_clear( m_osd ); xine_osd_clear( m_osd );
@ -859,12 +859,12 @@ VideoWindow::showOSD( const QString &message )
} }
} }
QString TQString
VideoWindow::fileFilter() const VideoWindow::fileFilter() const
{ {
char *supportedExtensions = xine_get_file_extensions( m_xine ); char *supportedExtensions = xine_get_file_extensions( m_xine );
QString filter( "*." ); TQString filter( "*." );
filter.append( supportedExtensions ); filter.append( supportedExtensions );
filter.remove( "txt" ); filter.remove( "txt" );
filter.remove( "png" ); filter.remove( "png" );

@ -5,8 +5,8 @@
#define CODEINE_VIDEOWINDOW_H #define CODEINE_VIDEOWINDOW_H
#include "codeine.h" #include "codeine.h"
#include <qtimer.h> #include <ntqtimer.h>
#include <qwidget.h> #include <ntqwidget.h>
#include <kurl.h> #include <kurl.h>
#include <stdint.h> #include <stdint.h>
#include <vector> #include <vector>
@ -30,7 +30,7 @@ namespace Codeine
* xineEngine.cpp * xineEngine.cpp
* videoWindow.cpp * videoWindow.cpp
*/ */
class VideoWindow : public QWidget class VideoWindow : public TQWidget
{ {
Q_OBJECT Q_OBJECT
@ -46,7 +46,7 @@ namespace Codeine
friend VideoWindow* const videoWindow(); friend VideoWindow* const videoWindow();
public: public:
VideoWindow( QWidget *parent ); VideoWindow( TQWidget *parent );
~VideoWindow(); ~VideoWindow();
bool init(); bool init();
@ -78,9 +78,9 @@ namespace Codeine
signals: signals:
void stateChanged( Engine::State ); void stateChanged( Engine::State );
void statusMessage( const QString& ); void statusMessage( const TQString& );
void titleChanged( const QString& ); void titleChanged( const TQString& );
void channelsChanged( const QStringList& ); void channelsChanged( const TQStringList& );
private: private:
#ifdef HAVE_XINE_H #ifdef HAVE_XINE_H
@ -90,8 +90,8 @@ namespace Codeine
uint posTimeLength( PosTimeLength ) const; uint posTimeLength( PosTimeLength ) const;
void showErrorMessage(); void showErrorMessage();
virtual void customEvent( QCustomEvent* ); virtual void customEvent( TQCustomEvent* );
virtual void timerEvent( QTimerEvent* ); virtual void timerEvent( TQTimerEvent* );
void eject(); void eject();
@ -110,11 +110,11 @@ namespace Codeine
KURL m_url; KURL m_url;
public: public:
QString fileFilter() const; TQString fileFilter() const;
public slots: public slots:
void toggleDVDMenu(); void toggleDVDMenu();
void showOSD( const QString& ); void showOSD( const TQString& );
/// Stuff to do with video and the video window/widget /// Stuff to do with video and the video window/widget
private: private:
@ -127,12 +127,12 @@ namespace Codeine
public: public:
static const uint CURSOR_HIDE_TIMEOUT = 2000; static const uint CURSOR_HIDE_TIMEOUT = 2000;
virtual QSize sizeHint() const; virtual TQSize sizeHint() const;
virtual QSize minimumSizeHint() const; virtual TQSize minimumSizeHint() const;
void *x11Visual() const; void *x11Visual() const;
void becomePreferredSize(); void becomePreferredSize();
QImage captureFrame() const; TQImage captureFrame() const;
enum { ExposeEvent = 3000 }; enum { ExposeEvent = 3000 };
@ -143,12 +143,12 @@ namespace Codeine
void hideCursor(); void hideCursor();
private: private:
virtual void contextMenuEvent( QContextMenuEvent* ); virtual void contextMenuEvent( TQContextMenuEvent* );
virtual bool event( QEvent* ); virtual bool event( TQEvent* );
virtual bool x11Event( XEvent* ); virtual bool x11Event( XEvent* );
double m_displayRatio; double m_displayRatio;
QTimer m_timer; TQTimer m_timer;
}; };
//global function for general use by Codeine //global function for general use by Codeine

@ -20,7 +20,7 @@ namespace Engine
}; };
} }
class QWidget; class TQWidget;
namespace Analyzer namespace Analyzer
{ {
@ -30,7 +30,7 @@ namespace Analyzer
namespace Codeine namespace Codeine
{ {
QWidget *mainWindow(); //defined in mainWindow.cpp TQWidget *mainWindow(); //defined in mainWindow.cpp
} }
/// used by mainWindow.h and xineEngine.h /// used by mainWindow.h and xineEngine.h

@ -6,12 +6,12 @@
#define CODEINE_DEBUG_H #define CODEINE_DEBUG_H
#include <kdebug.h> #include <kdebug.h>
#include <qcstring.h> #include <ntqcstring.h>
#include <qvariant.h> #include <ntqvariant.h>
#include <sys/time.h> #include <sys/time.h>
class QApplication; ///@see Debug::Indent class TQApplication; ///@see Debug::Indent
extern QApplication *qApp; extern TQApplication *tqApp;
/** /**
@ -47,9 +47,9 @@ extern QApplication *qApp;
namespace Debug namespace Debug
{ {
inline QCString &indent() inline TQCString &indent()
{ {
static QCString indent; static TQCString indent;
return indent; return indent;
#if 0 #if 0
static timeval *stamp = 0; static timeval *stamp = 0;
@ -62,7 +62,7 @@ namespace Debug
gettimeofday( &now, 0 ); gettimeofday( &now, 0 );
now.tv_sec -= stamp->tv_sec; now.tv_sec -= stamp->tv_sec;
QString time( "[%1:%2]" ); TQString time( "[%1:%2]" );
return time.arg( now.tv_sec / 60, 2 ).arg( now.tv_sec % 60, 2 ).latin1() + indent; return time.arg( now.tv_sec / 60, 2 ).arg( now.tv_sec % 60, 2 ).latin1() + indent;
#endif #endif
@ -74,7 +74,7 @@ namespace Debug
static inline kndbgstream error() { return kndbgstream(); } static inline kndbgstream error() { return kndbgstream(); }
static inline kndbgstream fatal() { return kndbgstream(); } static inline kndbgstream fatal() { return kndbgstream(); }
static inline void debug1( QVariant v ) {} static inline void debug1( TQVariant v ) {}
typedef kndbgstream Stream; typedef kndbgstream Stream;
#else #else
@ -98,7 +98,7 @@ namespace Debug
static inline kdbgstream fatal() { return kdbgstream( indent(), 0, KDEBUG_FATAL ) << AMK_PREFIX; } static inline kdbgstream fatal() { return kdbgstream( indent(), 0, KDEBUG_FATAL ) << AMK_PREFIX; }
/// convenience function /// convenience function
static inline void debug1( QVariant v ) { kdbgstream( indent(), 0, KDEBUG_INFO ) << v << endl; } static inline void debug1( TQVariant v ) { kdbgstream( indent(), 0, KDEBUG_INFO ) << v << endl; }
typedef kdbgstream Stream; typedef kdbgstream Stream;
@ -121,7 +121,7 @@ using Debug::debug1;
#define DEBUG_BLOCK Debug::Block uniquelyNamedStackAllocatedStandardBlock( __PRETTY_FUNCTION__ ); #define DEBUG_BLOCK Debug::Block uniquelyNamedStackAllocatedStandardBlock( __PRETTY_FUNCTION__ );
#define DEBUG_INDENT Debug::indent() += " "; #define DEBUG_INDENT Debug::indent() += " ";
#define DEBUG_UNINDENT { QCString &s = Debug::indent(); s.truncate( s.length() - 2 ); } #define DEBUG_UNINDENT { TQCString &s = Debug::indent(); s.truncate( s.length() - 2 ); }
/// Use this to remind yourself to finish the implementation of a function /// Use this to remind yourself to finish the implementation of a function
#define DEBUG_NOTIMPLEMENTED warning() << "NOT-IMPLEMENTED: " << __PRETTY_FUNCTION__ << endl; #define DEBUG_NOTIMPLEMENTED warning() << "NOT-IMPLEMENTED: " << __PRETTY_FUNCTION__ << endl;
@ -187,7 +187,7 @@ namespace Debug
DEBUG_UNINDENT DEBUG_UNINDENT
kdDebug() << indent() << "END__: " << m_label kdDebug() << indent() << "END__: " << m_label
<< " - Took " << QString::number( duration, 'g', 3 ) << "s\n"; << " - Took " << TQString::number( duration, 'g', 3 ) << "s\n";
} }
}; };
@ -227,10 +227,10 @@ namespace Debug
* @class Debug::List * @class Debug::List
* @short You can pass anything to this and it will output it as a list * @short You can pass anything to this and it will output it as a list
* *
* debug() << (Debug::List() << anInt << aString << aQStringList << aDouble) << endl; * debug() << (Debug::List() << anInt << aString << aTQStringList << aDouble) << endl;
*/ */
typedef QValueList<QVariant> List; typedef TQValueList<TQVariant> List;
} }
@ -243,19 +243,19 @@ namespace Codeine
namespace MessageBox namespace MessageBox
{ {
static inline void error( const QString &message ) static inline void error( const TQString &message )
{ {
KMessageBox::error( (QWidget*)videoWindow(), message ); KMessageBox::error( (TQWidget*)videoWindow(), message );
} }
static inline void sorry( const QString &message ) static inline void sorry( const TQString &message )
{ {
KMessageBox::error( (QWidget*)videoWindow(), message ); KMessageBox::error( (TQWidget*)videoWindow(), message );
} }
static inline void information( const QString &message, const QString &title ) static inline void information( const TQString &message, const TQString &title )
{ {
KMessageBox::information( (QWidget*)videoWindow(), message, title ); KMessageBox::information( (TQWidget*)videoWindow(), message, title );
} }
} }
} }

@ -2,18 +2,18 @@
// See COPYING file for licensing information // See COPYING file for licensing information
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qapplication.h> #include <ntqapplication.h>
#include <kcursor.h> #include <kcursor.h>
namespace mxcl namespace mxcl
{ {
WaitCursor::WaitCursor() WaitCursor::WaitCursor()
{ {
QApplication::setOverrideCursor( KCursor::waitCursor() ); TQApplication::setOverrideCursor( KCursor::waitCursor() );
} }
WaitCursor::~WaitCursor() WaitCursor::~WaitCursor()
{ {
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
} }
} }

@ -17,12 +17,12 @@ namespace mxcl
/// almost always negates the need to #include <klocale.h> in implementations /// almost always negates the need to #include <klocale.h> in implementations
#include <qstring.h> #include <ntqstring.h>
QString i18n( const char *text ); TQString i18n( const char *text );
/// very useful for QStringLists /// very useful for TQStringLists
#define foreach( x ) \ #define foreach( x ) \
for( QStringList::ConstIterator it = x.constBegin(), end = x.constEnd(); it != end; ++it ) for( TQStringList::ConstIterator it = x.constBegin(), end = x.constEnd(); it != end; ++it )
#endif #endif

@ -7,6 +7,6 @@ myenv=env.Copy()
## Always add '../' (top-level directory) because moc makes code that needs it ## Always add '../' (top-level directory) because moc makes code that needs it
KDEaddpaths( ['./', '../', '../../'], myenv ) KDEaddpaths( ['./', '../', '../../'], myenv )
KDEaddlibs( ['qt-mt', 'kdecore', 'kdeui', 'kparts', 'xine'], myenv ) KDEaddlibs( ['tqt-mt', 'kdecore', 'kdeui', 'kparts', 'xine'], myenv )
KDEshlib( "libcodeine", Split( "part.cpp xineEngine.cpp videoWindow.cpp toolbar.cpp ../mxcl.library.cpp" ), myenv ) KDEshlib( "libcodeine", Split( "part.cpp xineEngine.cpp videoWindow.cpp toolbar.cpp ../mxcl.library.cpp" ), myenv )

@ -6,12 +6,12 @@
#include <kaboutdata.h> #include <kaboutdata.h>
#include <kparts/genericfactory.h> #include <kparts/genericfactory.h>
#include "part.h" #include "part.h"
#include <qtimer.h> #include <ntqtimer.h>
#include "toolbar.h" #include "toolbar.h"
#include "videoWindow.h" #include "videoWindow.h"
#include <kaction.h> #include <kaction.h>
#include <qslider.h> #include <ntqslider.h>
namespace Codeine namespace Codeine
{ {
@ -24,7 +24,7 @@ K_EXPORT_COMPONENT_FACTORY( libcodeine, Codeine::Factory )
namespace Codeine namespace Codeine
{ {
Part::Part( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const QStringList& ) Part::Part( TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList& )
: ReadOnlyPart( parent, name ) : ReadOnlyPart( parent, name )
, m_statusBarExtension( new KParts::StatusBarExtension( this ) ) , m_statusBarExtension( new KParts::StatusBarExtension( this ) )
{ {
@ -35,19 +35,19 @@ namespace Codeine
//FIXME this will terminate the host, eg Konqueror //FIXME this will terminate the host, eg Konqueror
Debug::fatal() << "Couldn't init xine!\n"; Debug::fatal() << "Couldn't init xine!\n";
KAction *play = new KToggleAction( i18n("Play"), "player_play", Qt::Key_Space, videoWindow(), SLOT(togglePlay()), actionCollection(), "play" ); KAction *play = new KToggleAction( i18n("Play"), "player_play", TQt::Key_Space, videoWindow(), SLOT(togglePlay()), actionCollection(), "play" );
KAction *mute = new KToggleAction( i18n("Mute"), "player_mute", Qt::Key_M, videoWindow(), SLOT(toggleMute()), actionCollection(), "mute" ); KAction *mute = new KToggleAction( i18n("Mute"), "player_mute", TQt::Key_M, videoWindow(), SLOT(toggleMute()), actionCollection(), "mute" );
KToolBar *toolBar = new MouseOverToolBar( widget() ); KToolBar *toolBar = new MouseOverToolBar( widget() );
play->plug( toolBar ); play->plug( toolBar );
mute->plug( toolBar ); mute->plug( toolBar );
m_slider = new QSlider( Qt::Horizontal, toolBar, "slider" ); m_slider = new TQSlider( TQt::Horizontal, toolBar, "slider" );
m_slider->setMaxValue( 65535 ); m_slider->setMaxValue( 65535 );
toolBar->setStretchableWidget( m_slider ); toolBar->setStretchableWidget( m_slider );
toolBar->addSeparator(); //FIXME ugly toolBar->addSeparator(); //FIXME ugly
QObject *o = (QObject*)statusBar(); TQObject *o = (TQObject*)statusBar();
connect( videoWindow(), SIGNAL(statusMessage( const QString& )), o, SLOT(message( const QString& )) ); connect( videoWindow(), SIGNAL(statusMessage( const TQString& )), o, SLOT(message( const TQString& )) );
connect( videoWindow(), SIGNAL(titleChanged( const QString& )), o, SLOT(message( const QString& )) ); //FIXME connect( videoWindow(), SIGNAL(titleChanged( const TQString& )), o, SLOT(message( const TQString& )) ); //FIXME
} }
bool bool
@ -76,7 +76,7 @@ namespace Codeine
} }
void void
Part::timerEvent( QTimerEvent* ) Part::timerEvent( TQTimerEvent* )
{ {
m_slider->setValue( videoWindow()->position() ); m_slider->setValue( videoWindow()->position() );
} }

@ -9,7 +9,7 @@
#include <kurl.h> #include <kurl.h>
class KAboutData; class KAboutData;
class QSlider; class TQSlider;
namespace Codeine namespace Codeine
@ -17,7 +17,7 @@ namespace Codeine
class Part : public KParts::ReadOnlyPart class Part : public KParts::ReadOnlyPart
{ {
public: public:
Part( QWidget*, const char*, QObject*, const char*, const QStringList& ); Part( TQWidget*, const char*, TQObject*, const char*, const TQStringList& );
virtual bool openFile() { return false; } //pure virtual in base class virtual bool openFile() { return false; } //pure virtual in base class
virtual bool openURL( const KURL& ); virtual bool openURL( const KURL& );
@ -27,11 +27,11 @@ namespace Codeine
private: private:
KParts::StatusBarExtension *m_statusBarExtension; KParts::StatusBarExtension *m_statusBarExtension;
QSlider *m_slider; TQSlider *m_slider;
KStatusBar *statusBar() { return m_statusBarExtension->statusBar(); } KStatusBar *statusBar() { return m_statusBarExtension->statusBar(); }
virtual void timerEvent( QTimerEvent* ); virtual void timerEvent( TQTimerEvent* );
}; };
} }

@ -2,37 +2,37 @@
// See COPYING file for licensing information // See COPYING file for licensing information
#include <kpushbutton.h> #include <kpushbutton.h>
#include <qapplication.h> #include <ntqapplication.h>
#include <qevent.h> #include <ntqevent.h>
#include "toolbar.h" #include "toolbar.h"
MouseOverToolBar::MouseOverToolBar( QWidget *parent ) MouseOverToolBar::MouseOverToolBar( TQWidget *parent )
: KToolBar( parent ) : KToolBar( parent )
{ {
parent->installEventFilter( this ); parent->installEventFilter( this );
move( 0, 0 ); //TODO necessary? move( 0, 0 ); //TODO necessary?
hide(); hide();
setPalette( QApplication::palette() ); //videoWindow palette has a black background setPalette( TQApplication::palette() ); //videoWindow palette has a black background
} }
bool bool
MouseOverToolBar::eventFilter( QObject *o, QEvent *e ) MouseOverToolBar::eventFilter( TQObject *o, TQEvent *e )
{ {
Q_ASSERT( o == parent() ); Q_ASSERT( o == parent() );
switch( e->type() ) switch( e->type() )
{ {
case QEvent::Resize: case TQEvent::Resize:
resize( static_cast<QResizeEvent*>(e)->size().width(), sizeHint().height() ); resize( static_cast<TQResizeEvent*>(e)->size().width(), sizeHint().height() );
break; break;
case QEvent::Enter: case TQEvent::Enter:
show(); show();
break; break;
case QEvent::Leave: case TQEvent::Leave:
hide(); hide();
break; break;

@ -9,10 +9,10 @@
class MouseOverToolBar : public KToolBar class MouseOverToolBar : public KToolBar
{ {
virtual bool eventFilter( QObject*, QEvent* ); virtual bool eventFilter( TQObject*, TQEvent* );
public: public:
MouseOverToolBar( QWidget *parent ); MouseOverToolBar( TQWidget *parent );
}; };
#endif #endif

@ -5,9 +5,9 @@
#include <cstdlib> #include <cstdlib>
#include "debug.h" #include "debug.h"
#include <qapplication.h> //sendEvent() #include <ntqapplication.h> //sendEvent()
#include <qcursor.h> #include <ntqcursor.h>
#include <qevent.h> #include <ntqevent.h>
#include "videoWindow.h" #include "videoWindow.h"
#include <X11/Xlib.h> //TODO this breaks compile for lots of people due to excessive macro content #include <X11/Xlib.h> //TODO this breaks compile for lots of people due to excessive macro content
#include <xine.h> //x11_visual_t #include <xine.h> //x11_visual_t
@ -26,8 +26,8 @@ namespace X
} }
VideoWindow::VideoWindow( QWidget *parent, const char *name ) VideoWindow::VideoWindow( TQWidget *parent, const char *name )
: QWidget( parent, name ) : TQWidget( parent, name )
, m_osd( 0 ) , m_osd( 0 )
, m_stream( 0 ) , m_stream( 0 )
, m_eventQueue( 0 ) , m_eventQueue( 0 )
@ -44,11 +44,11 @@ VideoWindow::VideoWindow( QWidget *parent, const char *name )
show(); show();
setWFlags( Qt::WNoAutoErase ); setWFlags( TQt::WNoAutoErase );
setMouseTracking( true ); setMouseTracking( true );
setAcceptDrops( true ); setAcceptDrops( true );
setUpdatesEnabled( false ); //to stop Qt drawing over us setUpdatesEnabled( false ); //to stop TQt drawing over us
setPaletteBackgroundColor( Qt::black ); setPaletteBackgroundColor( TQt::black );
X::d = XOpenDisplay( std::getenv("DISPLAY") ); X::d = XOpenDisplay( std::getenv("DISPLAY") );
X::s = DefaultScreen( X::d ); X::s = DefaultScreen( X::d );
@ -146,22 +146,22 @@ VideoWindow::frameOutputCallBack(
} }
bool bool
VideoWindow::event( QEvent *e ) VideoWindow::event( TQEvent *e )
{ {
switch( e->type() ) switch( e->type() )
{ {
case QEvent::MouseMove: case TQEvent::MouseMove:
case QEvent::MouseButtonPress: case TQEvent::MouseButtonPress:
unsetCursor(); unsetCursor();
m_timer.start( CURSOR_HIDE_TIMEOUT, true ); m_timer.start( CURSOR_HIDE_TIMEOUT, true );
break; break;
case QEvent::Close: case TQEvent::Close:
case QEvent::Hide: case TQEvent::Hide:
xine_stop( m_stream ); xine_stop( m_stream );
break; break;
case QEvent::Leave: case TQEvent::Leave:
m_timer.stop(); m_timer.stop();
break; break;
@ -169,7 +169,7 @@ VideoWindow::event( QEvent *e )
; ;
} }
return QWidget::event( e ); return TQWidget::event( e );
} }
bool bool
@ -186,7 +186,7 @@ VideoWindow::x11Event( XEvent *e )
void void
VideoWindow::hideCursor() VideoWindow::hideCursor()
{ {
setCursor( Qt::BlankCursor ); setCursor( TQt::BlankCursor );
} }
} //namespace Codeine } //namespace Codeine

@ -5,8 +5,8 @@
#define CODEINE_VIDEO_WINDOW_H #define CODEINE_VIDEO_WINDOW_H
#include "../codeine.h" #include "../codeine.h"
#include <qtimer.h> #include <ntqtimer.h>
#include <qwidget.h> #include <ntqwidget.h>
#include <kurl.h> #include <kurl.h>
typedef struct xine_s xine_t; typedef struct xine_s xine_t;
@ -20,7 +20,7 @@ typedef struct xine_osd_s xine_osd_t;
namespace Codeine namespace Codeine
{ {
class VideoWindow : public QWidget class VideoWindow : public TQWidget
{ {
Q_OBJECT Q_OBJECT
@ -30,7 +30,7 @@ namespace Codeine
friend VideoWindow* const videoWindow(); friend VideoWindow* const videoWindow();
public: public:
VideoWindow( QWidget *parent, const char *name ); VideoWindow( TQWidget *parent, const char *name );
~VideoWindow(); ~VideoWindow();
bool init(); bool init();
@ -41,8 +41,8 @@ namespace Codeine
int position(); int position();
signals: signals:
void statusMessage( const QString& ); void statusMessage( const TQString& );
void titleChanged( const QString& ); void titleChanged( const TQString& );
private: private:
/// @see xineEngine.cpp /// @see xineEngine.cpp
@ -52,9 +52,9 @@ namespace Codeine
void showErrorMessage(); //TODO don't use this, just show delayed message void showErrorMessage(); //TODO don't use this, just show delayed message
virtual void customEvent( QCustomEvent* ); virtual void customEvent( TQCustomEvent* );
virtual bool x11Event( XEvent* ); virtual bool x11Event( XEvent* );
virtual bool event( QEvent* ); virtual bool event( TQEvent* );
xine_osd_t *m_osd; xine_osd_t *m_osd;
xine_stream_t *m_stream; xine_stream_t *m_stream;
@ -72,7 +72,7 @@ namespace Codeine
static void frameOutputCallBack( void*, int, int, double, int*, int*, int*, int*, double*, int*, int* ); static void frameOutputCallBack( void*, int, int, double, int*, int*, int*, int*, double*, int*, int* );
double m_displayRatio; double m_displayRatio;
QTimer m_timer; TQTimer m_timer;
public slots: public slots:
void togglePlay(); void togglePlay();

@ -7,9 +7,9 @@
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <klocale.h> #include <klocale.h>
#include "mxcl.library.h" #include "mxcl.library.h"
#include <qapplication.h> //::sendEvent() #include <ntqapplication.h> //::sendEvent()
#include <qdatetime.h> //::play() #include <ntqdatetime.h> //::play()
#include <qdir.h> //QDir::homeDir() #include <ntqdir.h> //TQDir::homeDir()
#include <xine.h> #include <xine.h>
#include "videoWindow.h" #include "videoWindow.h"
@ -28,7 +28,7 @@ VideoWindow::init()
return false; return false;
debug() << "xine_config_load()\n"; debug() << "xine_config_load()\n";
xine_config_load( m_xine, QFile::encodeName( QDir::homeDirPath() + "/.xine/config" ) ); xine_config_load( m_xine, TQFile::encodeName( TQDir::homeDirPath() + "/.xine/config" ) );
debug() << "xine_init()\n"; debug() << "xine_init()\n";
xine_init( m_xine ); xine_init( m_xine );
@ -65,8 +65,8 @@ VideoWindow::init()
xine_cfg_entry_t config; xine_cfg_entry_t config;
if( xine_config_lookup_entry( m_xine, "misc.save_dir", &config ) ) { if( xine_config_lookup_entry( m_xine, "misc.save_dir", &config ) ) {
const QCString dir = KGlobalSettings::desktopPath().local8Bit(); const TQCString dir = KGlobalSettings::desktopPath().local8Bit();
config.str_value = qstrdup( dir ); config.str_value = tqstrdup( dir );
xine_config_update_entry( m_xine, &config ); xine_config_update_entry( m_xine, &config );
} }
} }
@ -87,14 +87,14 @@ VideoWindow::play( KURL url )
if( url.protocol() == "http" ) { if( url.protocol() == "http" ) {
/// automatically save http streams to Desktop folder /// automatically save http streams to Desktop folder
const QString fileName = url.filename(); const TQString fileName = url.filename();
QString TQString
u = url.url(); u = url.url();
u += "#save:"; u += "#save:";
u += url.host(); u += url.host();
u += " ["; u += " [";
u += QDate::currentDate().toString(); u += TQDate::currentDate().toString();
u += ']'; u += ']';
u += fileName.mid( fileName.findRev( '.' ) + 1 ).lower(); u += fileName.mid( fileName.findRev( '.' ) + 1 ).lower();
@ -151,7 +151,7 @@ VideoWindow::position()
void void
VideoWindow::showErrorMessage() VideoWindow::showErrorMessage()
{ {
const QString filename = m_url.fileName(); const TQString filename = m_url.fileName();
debug() << "xine_get_error()\n"; debug() << "xine_get_error()\n";
@ -180,7 +180,7 @@ VideoWindow::showErrorMessage()
} }
void void
VideoWindow::customEvent( QCustomEvent *e ) VideoWindow::customEvent( TQCustomEvent *e )
{ {
switch( e->type() - 2000 ) { switch( e->type() - 2000 ) {
case XINE_EVENT_UI_PLAYBACK_FINISHED: case XINE_EVENT_UI_PLAYBACK_FINISHED:
@ -188,7 +188,7 @@ VideoWindow::customEvent( QCustomEvent *e )
break; break;
case 1000: case 1000:
#define message static_cast<QString*>(e->data()) #define message static_cast<TQString*>(e->data())
emit statusMessage( *message ); emit statusMessage( *message );
delete message; delete message;
break; break;
@ -238,29 +238,29 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
case XINE_EVENT_FRAME_FORMAT_CHANGE: case XINE_EVENT_FRAME_FORMAT_CHANGE:
case XINE_EVENT_UI_CHANNELS_CHANGED: case XINE_EVENT_UI_CHANNELS_CHANGED:
{ {
QCustomEvent *ce; TQCustomEvent *ce;
ce = new QCustomEvent( 2000 + xineEvent->type ); ce = new TQCustomEvent( 2000 + xineEvent->type );
ce->setData( const_cast<xine_event_t*>(xineEvent) ); ce->setData( const_cast<xine_event_t*>(xineEvent) );
QApplication::postEvent( engine, ce ); TQApplication::postEvent( engine, ce );
break; break;
} }
case XINE_EVENT_UI_SET_TITLE: case XINE_EVENT_UI_SET_TITLE:
QApplication::postEvent( engine, new QCustomEvent( TQApplication::postEvent( engine, new TQCustomEvent(
QEvent::Type(3002), TQEvent::Type(3002),
new QString( QString::fromUtf8( static_cast<xine_ui_data_t*>(xineEvent->data)->str ) ) ) ); new TQString( TQString::fromUtf8( static_cast<xine_ui_data_t*>(xineEvent->data)->str ) ) ) );
break; break;
case XINE_EVENT_PROGRESS: case XINE_EVENT_PROGRESS:
{ {
xine_progress_data_t* pd = (xine_progress_data_t*)xineEvent->data; xine_progress_data_t* pd = (xine_progress_data_t*)xineEvent->data;
QString TQString
msg = "%1 %2%"; msg = "%1 %2%";
msg = msg.arg( QString::fromUtf8( pd->description ) ) msg = msg.arg( TQString::fromUtf8( pd->description ) )
.arg( KGlobal::locale()->formatNumber( pd->percent, 0 ) ); .arg( KGlobal::locale()->formatNumber( pd->percent, 0 ) );
QApplication::postEvent( engine, new QCustomEvent( QEvent::Type(3000), new QString( msg ) ) ); TQApplication::postEvent( engine, new TQCustomEvent( TQEvent::Type(3000), new TQString( msg ) ) );
break; break;
} }
case XINE_EVENT_UI_MESSAGE: case XINE_EVENT_UI_MESSAGE:
@ -268,7 +268,7 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
debug() << "Message received from xine\n"; debug() << "Message received from xine\n";
xine_ui_message_data_t *data = (xine_ui_message_data_t *)xineEvent->data; xine_ui_message_data_t *data = (xine_ui_message_data_t *)xineEvent->data;
QString message; TQString message;
switch( data->type ) { switch( data->type ) {
case XINE_MSG_NO_ERROR: case XINE_MSG_NO_ERROR:
@ -313,7 +313,7 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
if(data->explanation) if(data->explanation)
{ {
message += "<b>"; message += "<b>";
message += QString::fromUtf8( (char*) data + data->explanation ); message += TQString::fromUtf8( (char*) data + data->explanation );
message += "</b>"; message += "</b>";
} }
else break; //if no explanation then why bother! else break; //if no explanation then why bother!
@ -328,12 +328,12 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
if(data->parameters) if(data->parameters)
{ {
message += "xine says: <i>"; message += "xine says: <i>";
message += QString::fromUtf8( (char*) data + data->parameters); message += TQString::fromUtf8( (char*) data + data->parameters);
message += "</i>"; message += "</i>";
} }
else message += i18n("Sorry, no additional information is available."); else message += i18n("Sorry, no additional information is available.");
QApplication::postEvent( engine, new QCustomEvent(QEvent::Type(3001), new QString(message)) ); TQApplication::postEvent( engine, new TQCustomEvent(TQEvent::Type(3001), new TQString(message)) );
} }
} //case } //case

Loading…
Cancel
Save