TQt4 port kmplayer

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1238840 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 0a8af92185
commit 769e63d24a

@ -219,7 +219,7 @@ if test "$buildnpp" = "yes"; then
if test "x$have_dbus" = "xyes"; then if test "x$have_dbus" = "xyes"; then
have_nspr=yes have_nspr=yes
AC_DEFINE(HAVE_DBUS, 1, [have DBus]) AC_DEFINE(HAVE_DBUS, 1, [have DBus])
LIBQTDBUS="`$PKG_CONFIG --libs dbus-1` -ldbus-qt-1" LIBQTDBUS="`$PKG_CONFIG --libs dbus-1` -ldbus-tqt-1"
LIBDBUS_CFLAGS="`$PKG_CONFIG --cflags dbus-1`" LIBDBUS_CFLAGS="`$PKG_CONFIG --cflags dbus-1`"
AC_DEFINE(HAVE_NSPR, 1, [build Netscape plugin loader]) AC_DEFINE(HAVE_NSPR, 1, [build Netscape plugin loader])
LIBNSPR_LIBS="`$PKG_CONFIG --libs gtk+-x11-2.0` `$PKG_CONFIG --libs dbus-glib-1` `$PKG_CONFIG --libs gthread-2.0`" LIBNSPR_LIBS="`$PKG_CONFIG --libs gtk+-x11-2.0` `$PKG_CONFIG --libs dbus-glib-1` `$PKG_CONFIG --libs gthread-2.0`"

@ -154,7 +154,7 @@ if test "$buildnpp" = "yes"; then
if test "x$have_dbus" = "xyes"; then if test "x$have_dbus" = "xyes"; then
have_nspr=yes have_nspr=yes
AC_DEFINE(HAVE_DBUS, 1, [have DBus]) AC_DEFINE(HAVE_DBUS, 1, [have DBus])
LIBQTDBUS="`$PKG_CONFIG --libs dbus-1` -ldbus-qt-1" LIBQTDBUS="`$PKG_CONFIG --libs dbus-1` -ldbus-tqt-1"
LIBDBUS_CFLAGS="`$PKG_CONFIG --cflags dbus-1`" LIBDBUS_CFLAGS="`$PKG_CONFIG --cflags dbus-1`"
AC_DEFINE(HAVE_NSPR, 1, [build Netscape plugin loader]) AC_DEFINE(HAVE_NSPR, 1, [build Netscape plugin loader])
LIBNSPR_LIBS="`$PKG_CONFIG --libs gtk+-x11-2.0` `$PKG_CONFIG --libs dbus-glib-1` `$PKG_CONFIG --libs gthread-2.0`" LIBNSPR_LIBS="`$PKG_CONFIG --libs gtk+-x11-2.0` `$PKG_CONFIG --libs dbus-glib-1` `$PKG_CONFIG --libs gthread-2.0`"

@ -26,7 +26,7 @@ libkmplayerkofficepart_la_LIBADD= libkmplayercommon.la $(LIB_KOFFICE)
kdeinit_LTLIBRARIES=kmplayer.la kdeinit_LTLIBRARIES=kmplayer.la
kmplayer_la_SOURCES= main.cpp kmplayerapp.cpp kmplayertvsource.cpp kmplayerbroadcast.cpp kmplayervdr.cpp kmplayer_la_SOURCES= main.cpp kmplayerapp.cpp kmplayertvsource.cpp kmplayerbroadcast.cpp kmplayervdr.cpp
kmplayer_la_LIBADD= libkmplayercommon.la kmplayer_la_LIBADD= libkmplayercommon.la
kmplayer_la_LDFLAGS= -module $(KDE_PLUGIN) kmplayer_la_LDFLAGS= -module $(KDE_PLUGIN) $(LIB_QT)
EXTRA_PROGRAMS = kxineplayer kxvplayer kgstplayer EXTRA_PROGRAMS = kxineplayer kxvplayer kgstplayer
if include_kxineplayer if include_kxineplayer

@ -22,13 +22,13 @@
#include <math.h> #include <math.h>
#include <config.h> #include <config.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <qcstring.h> #include <tqcstring.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qfile.h> #include <tqfile.h>
#include <qurl.h> #include <tqurl.h>
#include <qthread.h> #include <tqthread.h>
#include <qmutex.h> #include <tqmutex.h>
#include <qdom.h> #include <tqdom.h>
#include "kmplayer_backend.h" #include "kmplayer_backend.h"
#include "kmplayer_callback_stub.h" #include "kmplayer_callback_stub.h"
#include "kmplayer_callback.h" #include "kmplayer_callback.h"
@ -48,7 +48,7 @@ static Display *display;
static KGStreamerPlayer *gstapp; static KGStreamerPlayer *gstapp;
static KMPlayer::Callback_stub * callback; static KMPlayer::Callback_stub * callback;
static Window wid; static Window wid;
static QMutex mutex (true); static TQMutex mutex (true);
static bool window_created = true; static bool window_created = true;
static bool wants_config; static bool wants_config;
static bool verbose; static bool verbose;
@ -59,15 +59,15 @@ static int movie_height;
static int movie_length; static int movie_length;
static int repeat_count; static int repeat_count;
static int screen; static int screen;
static const int event_finished = QEvent::User; static const int event_finished = TQEvent::User;
static const int event_playing = QEvent::User + 1; static const int event_playing = TQEvent::User + 1;
static const int event_size = QEvent::User + 2; static const int event_size = TQEvent::User + 2;
static const int event_eos = QEvent::User + 3; static const int event_eos = TQEvent::User + 3;
static const int event_progress = QEvent::User + 4; static const int event_progress = TQEvent::User + 4;
static const int event_error = QEvent::User + 5; static const int event_error = TQEvent::User + 5;
static const int event_video = QEvent::User + 6; static const int event_video = TQEvent::User + 6;
static QString mrl; static TQString mrl;
static QString sub_mrl; static TQString sub_mrl;
static const char *ao_driver; static const char *ao_driver;
static const char *vo_driver; static const char *vo_driver;
static const char *playbin_name = "player"; static const char *playbin_name = "player";
@ -75,24 +75,24 @@ static const char *dvd_device;
static const char *vcd_device; static const char *vcd_device;
static GstElement *gst_elm_play; static GstElement *gst_elm_play;
static GstBus *gst_bus; static GstBus *gst_bus;
static unsigned int /*GstMessageType*/ ignore_messages_mask; static unsigned int /*GstMessageType*/ ignore_messages_tqmask;
static GstXOverlay *xoverlay; static GstXOverlay *xoverlay;
static GstColorBalance *color_balance; static GstColorBalance *color_balance;
static gulong gst_bus_sync; static gulong gst_bus_sync;
static gulong gst_bus_async; static gulong gst_bus_async;
static QString elmentry ("entry"); static TQString elmentry ("entry");
static QString elmitem ("item"); static TQString elmitem ("item");
static QString attname ("NAME"); static TQString attname ("NAME");
static QString atttype ("TYPE"); static TQString atttype ("TYPE");
static QString attdefault ("DEFAULT"); static TQString attdefault ("DEFAULT");
static QString attvalue ("VALUE"); static TQString attvalue ("VALUE");
static QString attstart ("START"); static TQString attstart ("START");
static QString attend ("END"); static TQString attend ("END");
static QString valrange ("range"); static TQString valrange ("range");
static QString valnum ("num"); static TQString valnum ("num");
static QString valbool ("bool"); static TQString valbool ("bool");
static QString valenum ("enum"); static TQString valenum ("enum");
static QString valstring ("string"); static TQString valstring ("string");
extern "C" { extern "C" {
// nothing yet // nothing yet
@ -111,7 +111,7 @@ cb_error (GstElement * play,
fprintf (stderr, "cb_error: %s %s\n", err->message, debug); fprintf (stderr, "cb_error: %s %s\n", err->message, debug);
if (GST_STATE (play) == GST_STATE_PLAYING) if (GST_STATE (play) == GST_STATE_PLAYING)
gst_element_set_state (play, GST_STATE_READY); gst_element_set_state (play, GST_STATE_READY);
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type)event_finished)); TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type)event_finished));
} }
// NULL -> READY -> PAUSED -> PLAYING // NULL -> READY -> PAUSED -> PLAYING
@ -124,7 +124,7 @@ gstCapsSet (GstPad *pad,
GstCaps *caps = gst_pad_get_negotiated_caps (pad); GstCaps *caps = gst_pad_get_negotiated_caps (pad);
if (!caps) if (!caps)
return; return;
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_video)); TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_video));
const GstStructure * s = gst_caps_get_structure (caps, 0); const GstStructure * s = gst_caps_get_structure (caps, 0);
if (s) { if (s) {
const GValue *par; const GValue *par;
@ -140,7 +140,7 @@ gstCapsSet (GstPad *pad,
else else
movie_height = (int) ((float) den * movie_height / num); movie_height = (int) ((float) den * movie_height / num);
} }
QApplication::postEvent (gstapp, new GstSizeEvent (movie_length, movie_width, movie_height)); TQApplication::postEvent (gstapp, new GstSizeEvent (movie_length, movie_width, movie_height));
} }
gst_caps_unref (caps); gst_caps_unref (caps);
} }
@ -204,7 +204,7 @@ static void gstGetDuration () {
if (movie_length != len / (GST_MSECOND * 100)) { if (movie_length != len / (GST_MSECOND * 100)) {
movie_length = len / (GST_MSECOND * 100); movie_length = len / (GST_MSECOND * 100);
fprintf (stderr, "new length %d\n", movie_length); fprintf (stderr, "new length %d\n", movie_length);
QApplication::postEvent (gstapp, new GstSizeEvent (movie_length, movie_width, movie_height)); TQApplication::postEvent (gstapp, new GstSizeEvent (movie_length, movie_width, movie_height));
} }
} }
@ -217,12 +217,12 @@ static void gstTag (const GstTagList *, const gchar *tag, gpointer) {
static void gstBusMessage (GstBus *, GstMessage * message, gpointer) { static void gstBusMessage (GstBus *, GstMessage * message, gpointer) {
GstMessageType msg_type = GST_MESSAGE_TYPE (message); GstMessageType msg_type = GST_MESSAGE_TYPE (message);
/* somebody else is handling the message, probably in gstPolForStateChange*/ /* somebody else is handling the message, probably in gstPolForStateChange*/
if (ignore_messages_mask & msg_type) if (ignore_messages_tqmask & msg_type)
return; return;
switch (msg_type) { switch (msg_type) {
case GST_MESSAGE_ERROR: case GST_MESSAGE_ERROR:
fprintf (stderr, "error msg\n"); fprintf (stderr, "error msg\n");
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_error)); TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_error));
if (gst_elm_play) { if (gst_elm_play) {
gst_element_set_state (gst_elm_play, GST_STATE_NULL); gst_element_set_state (gst_elm_play, GST_STATE_NULL);
//gstPollForStateChange (gst_elm_play, GST_STATE_NULL); //gstPollForStateChange (gst_elm_play, GST_STATE_NULL);
@ -246,7 +246,7 @@ static void gstBusMessage (GstBus *, GstMessage * message, gpointer) {
case GST_MESSAGE_BUFFERING: { case GST_MESSAGE_BUFFERING: {
gint percent = 0; gint percent = 0;
gst_structure_get_int (message->structure, "buffer-percent", &percent); gst_structure_get_int (message->structure, "buffer-percent", &percent);
QApplication::postEvent (gstapp, new GstProgressEvent (percent)); TQApplication::postEvent (gstapp, new GstProgressEvent (percent));
//fprintf (stderr, "Buffering message (%u%%)\n", percent); //fprintf (stderr, "Buffering message (%u%%)\n", percent);
break; break;
} }
@ -266,7 +266,7 @@ static void gstBusMessage (GstBus *, GstMessage * message, gpointer) {
if (old_state == GST_STATE_PAUSED && if (old_state == GST_STATE_PAUSED &&
new_state >= GST_STATE_PLAYING) { new_state >= GST_STATE_PLAYING) {
gstGetDuration (); gstGetDuration ();
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_playing)); TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_playing));
} else if (old_state >= GST_STATE_PAUSED && } else if (old_state >= GST_STATE_PAUSED &&
new_state <= GST_STATE_READY) { new_state <= GST_STATE_READY) {
if (repeat_count-- > 0 && if (repeat_count-- > 0 &&
@ -274,8 +274,8 @@ static void gstBusMessage (GstBus *, GstMessage * message, gpointer) {
gstPollForStateChange(gst_elm_play, GST_STATE_PAUSED))) gstPollForStateChange(gst_elm_play, GST_STATE_PAUSED)))
gst_element_set_state(gst_elm_play, GST_STATE_PLAYING); gst_element_set_state(gst_elm_play, GST_STATE_PLAYING);
else else
QApplication::postEvent (gstapp, TQApplication::postEvent (gstapp,
new QEvent ((QEvent::Type) event_finished)); new TQEvent ((TQEvent::Type) event_finished));
} }
} }
//g_free (src_name); //g_free (src_name);
@ -310,14 +310,14 @@ static bool gstPollForStateChange (GstElement *element, GstState state, gint64 t
GError **error = 0L; GError **error = 0L;
events = GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_ERROR | GST_MESSAGE_EOS; events = GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_ERROR | GST_MESSAGE_EOS;
saved_events = ignore_messages_mask; saved_events = ignore_messages_tqmask;
if (element && element == gst_elm_play) { if (element && element == gst_elm_play) {
/* we do want the main handler to process state changed messages for /* we do want the main handler to process state changed messages for
* playbin as well, otherwise it won't hook up the timeout etc. */ * playbin as well, otherwise it won't hook up the timeout etc. */
ignore_messages_mask |= (events ^ GST_MESSAGE_STATE_CHANGED); ignore_messages_tqmask |= (events ^ GST_MESSAGE_STATE_CHANGED);
} else { } else {
ignore_messages_mask |= events; ignore_messages_tqmask |= events;
} }
while (true) { while (true) {
@ -367,14 +367,14 @@ static bool gstPollForStateChange (GstElement *element, GstState state, gint64 t
success: success:
/* state change succeeded */ /* state change succeeded */
fprintf (stderr, "state change to %s succeeded\n", gst_element_state_get_name (state)); fprintf (stderr, "state change to %s succeeded\n", gst_element_state_get_name (state));
ignore_messages_mask = saved_events; ignore_messages_tqmask = saved_events;
return true; return true;
timed_out: timed_out:
/* it's taking a long time to open -- just tell totem it was ok, this allows /* it's taking a long time to open -- just tell totem it was ok, this allows
* the user to stop the loading process with the normal stop button */ * the user to stop the loading process with the normal stop button */
fprintf (stderr, "state change to %s timed out, returning success and handling errors asynchroneously\n", gst_element_state_get_name (state)); fprintf (stderr, "state change to %s timed out, returning success and handling errors asynchroneously\n", gst_element_state_get_name (state));
ignore_messages_mask = saved_events; ignore_messages_tqmask = saved_events;
return true; return true;
error: error:
@ -382,20 +382,20 @@ error:
gst_element_state_get_name (state), gst_element_state_get_name (state),
(error && *error) ? (*error)->message : "unknown"); (error && *error) ? (*error)->message : "unknown");
/* already set *error */ /* already set *error */
ignore_messages_mask = saved_events; ignore_messages_tqmask = saved_events;
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_error)); TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_error));
return false; return false;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
GstSizeEvent::GstSizeEvent (int l, int w, int h) GstSizeEvent::GstSizeEvent (int l, int w, int h)
: QEvent ((QEvent::Type) event_size), : TQEvent ((TQEvent::Type) event_size),
length (l), width (w), height (h) length (l), width (w), height (h)
{} {}
GstProgressEvent::GstProgressEvent (const int p) GstProgressEvent::GstProgressEvent (const int p)
: QEvent ((QEvent::Type) event_progress), progress (p) : TQEvent ((TQEvent::Type) event_progress), progress (p)
{} {}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -403,16 +403,16 @@ GstProgressEvent::GstProgressEvent (const int p)
using namespace KMPlayer; using namespace KMPlayer;
Backend::Backend () Backend::Backend ()
: DCOPObject (QCString ("Backend")) { : DCOPObject (TQCString ("Backend")) {
} }
Backend::~Backend () {} Backend::~Backend () {}
void Backend::setURL (QString url) { void Backend::setURL (TQString url) {
mrl = url; mrl = url;
} }
void Backend::setSubTitleURL (QString url) { void Backend::setSubTitleURL (TQString url) {
sub_mrl = url; sub_mrl = url;
} }
@ -421,7 +421,7 @@ void Backend::play (int repeat) {
} }
void Backend::stop () { void Backend::stop () {
QTimer::singleShot (0, gstapp, SLOT (stop ())); TQTimer::singleShot (0, gstapp, TQT_SLOT (stop ()));
} }
void Backend::pause () { void Backend::pause () {
@ -455,10 +455,10 @@ void Backend::volume (int v, bool) {
void Backend::frequency (int) { void Backend::frequency (int) {
} }
void Backend::setAudioLang (int, QString) { void Backend::setAudioLang (int, TQString) {
} }
void Backend::setSubtitle (int, QString) { void Backend::setSubtitle (int, TQString) {
} }
void Backend::quit () { void Backend::quit () {
@ -467,29 +467,29 @@ void Backend::quit () {
if (running) if (running)
stop (); stop ();
else else
QTimer::singleShot (0, qApp, SLOT (quit ())); TQTimer::singleShot (0, tqApp, TQT_SLOT (quit ()));
} }
bool updateConfigEntry (const QString & name, const QString & value) { bool updateConfigEntry (const TQString & name, const TQString & value) {
fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ()); fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ());
return true; return true;
} }
void Backend::setConfig (QByteArray /*data*/) { void Backend::setConfig (TQByteArray /*data*/) {
/*QString err; /*TQString err;
int line, column; int line, column;
QDomDocument dom; TQDomDocument dom;
if (dom.setContent (data, false, &err, &line, &column)) { if (dom.setContent (data, false, &err, &line, &column)) {
if (dom.childNodes().length() == 1) { if (dom.childNodes().length() == 1) {
for (QDomNode node = dom.firstChild().firstChild(); for (TQDomNode node = dom.firstChild().firstChild();
!node.isNull (); !node.isNull ();
node = node.nextSibling ()) { node = node.nextSibling ()) {
QDomNamedNodeMap attr = node.attributes (); TQDomNamedNodeMap attr = node.attributes ();
updateConfigEntry (attr.namedItem (attname).nodeValue (), updateConfigEntry (attr.namedItem (attname).nodeValue (),
attr.namedItem (attvalue).nodeValue ()); attr.namedItem (attvalue).nodeValue ());
} }
} else } else
err = QString ("invalid data"); err = TQString ("invalid data");
} }
if (callback) if (callback)
callback->errorMessage (0, err);*/ callback->errorMessage (0, err);*/
@ -503,7 +503,7 @@ bool Backend::isPlaying () {
} }
KGStreamerPlayer::KGStreamerPlayer (int _argc, char ** _argv) KGStreamerPlayer::KGStreamerPlayer (int _argc, char ** _argv)
: QApplication (_argc, _argv, false) { : TQApplication (_argc, _argv, false) {
} }
void KGStreamerPlayer::init () { void KGStreamerPlayer::init () {
@ -540,11 +540,11 @@ KGStreamerPlayer::~KGStreamerPlayer () {
gstapp = 0L; gstapp = 0L;
} }
void getConfigEntries (QByteArray & buf) { void getConfigEntries (TQByteArray & buf) {
QDomDocument doc; TQDomDocument doc;
QDomElement root = doc.createElement (QString ("document")); TQDomElement root = doc.createElement (TQString ("document"));
doc.appendChild (root); doc.appendChild (root);
QCString exp = doc.toCString (); TQCString exp = doc.toCString ();
buf = exp; buf = exp;
buf.resize (exp.length ()); // strip terminating \0 buf.resize (exp.length ()); // strip terminating \0
} }
@ -573,7 +573,7 @@ void KGStreamerPlayer::play (int repeat) {
fprintf (stderr, "couldn't create playbin\n"); fprintf (stderr, "couldn't create playbin\n");
goto fail; goto fail;
} }
ignore_messages_mask = 0; ignore_messages_tqmask = 0;
gst_bus = gst_element_get_bus (gst_elm_play); gst_bus = gst_element_get_bus (gst_elm_play);
gst_bus_add_signal_watch (gst_bus); gst_bus_add_signal_watch (gst_bus);
@ -634,13 +634,13 @@ void KGStreamerPlayer::play (int repeat) {
if (GST_STATE (gst_elm_play) > GST_STATE_READY) if (GST_STATE (gst_elm_play) > GST_STATE_READY)
gst_element_set_state (gst_elm_play, GST_STATE_READY); gst_element_set_state (gst_elm_play, GST_STATE_READY);
if (mrl.startsWith (QChar ('/'))) if (mrl.startsWith (TQChar ('/')))
mrl = QString ("file://") + mrl; mrl = TQString ("file://") + mrl;
uri = g_strdup (mrl.local8Bit ()); uri = g_strdup (mrl.local8Bit ());
g_object_set (gst_elm_play, "uri", uri, NULL); g_object_set (gst_elm_play, "uri", uri, NULL);
if (!sub_mrl.isEmpty ()) { if (!sub_mrl.isEmpty ()) {
if (sub_mrl.startsWith (QChar ('/'))) if (sub_mrl.startsWith (TQChar ('/')))
sub_mrl = QString ("file://") + sub_mrl; sub_mrl = TQString ("file://") + sub_mrl;
sub_uri = g_strdup (sub_mrl.local8Bit ()); sub_uri = g_strdup (sub_mrl.local8Bit ());
g_object_set (gst_elm_play, "suburi", sub_uri, NULL); g_object_set (gst_elm_play, "suburi", sub_uri, NULL);
g_free (sub_uri); g_free (sub_uri);
@ -653,7 +653,7 @@ void KGStreamerPlayer::play (int repeat) {
gstPollForStateChange (gst_elm_play, GST_STATE_PLAYING); gstPollForStateChange (gst_elm_play, GST_STATE_PLAYING);
} }
g_free (uri); g_free (uri);
QTimer::singleShot (500, this, SLOT (updatePosition ())); TQTimer::singleShot (500, this, TQT_SLOT (updatePosition ()));
return; return;
fail: fail:
if (videosink) { if (videosink) {
@ -665,7 +665,7 @@ fail:
gst_object_unref (audiosink); gst_object_unref (audiosink);
} }
mutex.unlock (); mutex.unlock ();
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type)event_finished)); TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type)event_finished));
} }
void KGStreamerPlayer::pause () { void KGStreamerPlayer::pause () {
@ -697,11 +697,11 @@ void KGStreamerPlayer::stop () {
} }
mutex.unlock (); mutex.unlock ();
if (!gst_elm_play || (gst_elm_play && !notified_playing)) if (!gst_elm_play || (gst_elm_play && !notified_playing))
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_finished)); TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_finished));
} }
void KGStreamerPlayer::finished () { void KGStreamerPlayer::finished () {
QTimer::singleShot (10, this, SLOT (stop ())); TQTimer::singleShot (10, this, TQT_SLOT (stop ()));
} }
static void adjustColorSetting (const char * channel, int val) { static void adjustColorSetting (const char * channel, int val) {
@ -770,11 +770,11 @@ void KGStreamerPlayer::updatePosition () {
callback->moviePosition (int (val / (GST_MSECOND * 100))); callback->moviePosition (int (val / (GST_MSECOND * 100)));
} }
mutex.unlock (); mutex.unlock ();
QTimer::singleShot (500, this, SLOT (updatePosition ())); TQTimer::singleShot (500, this, TQT_SLOT (updatePosition ()));
} }
} }
bool KGStreamerPlayer::event (QEvent * e) { bool KGStreamerPlayer::event (TQEvent * e) {
switch (e->type()) { switch (e->type()) {
case event_finished: { case event_finished: {
fprintf (stderr, "event_finished\n"); fprintf (stderr, "event_finished\n");
@ -797,7 +797,7 @@ bool KGStreamerPlayer::event (QEvent * e) {
if (callback) if (callback)
callback->finished (); callback->finished ();
else else
QTimer::singleShot (0, this, SLOT (quit ())); TQTimer::singleShot (0, this, TQT_SLOT (quit ()));
break; break;
} }
//callback->movieParams (se->length/100, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0); //callback->movieParams (se->length/100, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0);
@ -806,7 +806,7 @@ bool KGStreamerPlayer::event (QEvent * e) {
fprintf (stderr, "movie parms: %d %d %d\n", se->length, se->width, se->height); fprintf (stderr, "movie parms: %d %d %d\n", se->length, se->width, se->height);
if (callback) { if (callback) {
if (se->length < 0) se->length = 0; if (se->length < 0) se->length = 0;
callback->movieParams (se->length, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0, QStringList (), QStringList ()); callback->movieParams (se->length, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0, TQStringList (), TQStringList ());
} }
if (window_created && movie_width > 0 && movie_height > 0) { if (window_created && movie_width > 0 && movie_height > 0) {
XLockDisplay (display); XLockDisplay (display);
@ -832,7 +832,7 @@ bool KGStreamerPlayer::event (QEvent * e) {
break; break;
case event_video: case event_video:
if (callback) if (callback)
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, QString ()); callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, TQString ());
break; break;
default: default:
return false; return false;
@ -840,12 +840,12 @@ bool KGStreamerPlayer::event (QEvent * e) {
return true; return true;
} }
void KGStreamerPlayer::saveState (QSessionManager & sm) { void KGStreamerPlayer::saveState (TQSessionManager & sm) {
if (callback) if (callback)
sm.setRestartHint (QSessionManager::RestartNever); sm.setRestartHint (TQSessionManager::RestartNever);
} }
class XEventThread : public QThread { class XEventThread : public TQThread {
protected: protected:
void run () { void run () {
Time prev_click_time = 0; Time prev_click_time = 0;
@ -967,8 +967,8 @@ int main(int argc, char **argv) {
} else if (!strcmp (argv [i], "-loop") && i < argc - 1) { } else if (!strcmp (argv [i], "-loop") && i < argc - 1) {
repeat_count = atol (argv [++i]); repeat_count = atol (argv [++i]);
} else if (!strcmp (argv [i], "-cb")) { } else if (!strcmp (argv [i], "-cb")) {
QString str = argv [++i]; TQString str = argv [++i];
int pos = str.find ('/'); int pos = str.tqfind ('/');
if (pos > -1) { if (pos > -1) {
fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ()); fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ());
callback = new KMPlayer::Callback_stub callback = new KMPlayer::Callback_stub
@ -979,7 +979,7 @@ int main(int argc, char **argv) {
delete gstapp; delete gstapp;
return 1; return 1;
} else { } else {
mrl = QString::fromLocal8Bit (argv[i]); mrl = TQString::fromLocal8Bit (argv[i]);
} }
} }
@ -993,12 +993,12 @@ int main(int argc, char **argv) {
gstapp->init (); gstapp->init ();
if (callback) { if (callback) {
QByteArray buf; TQByteArray buf;
if (wants_config) if (wants_config)
getConfigEntries (buf); getConfigEntries (buf);
callback->started (dcopclient.appId (), buf); callback->started (dcopclient.appId (), buf);
} else } else
QTimer::singleShot (10, gstapp, SLOT (play (int))); TQTimer::singleShot (10, gstapp, TQT_SLOT (play (int)));
gstapp->exec (); gstapp->exec ();

@ -20,24 +20,25 @@
#ifndef _K_GST_PLAYER_H_ #ifndef _K_GST_PLAYER_H_
#define _K_GST_PLAYER_H_ #define _K_GST_PLAYER_H_
#include <qapplication.h> #include <tqapplication.h>
#include <qstring.h> #include <tqstring.h>
#include <qsessionmanager.h> #include <tqsessionmanager.h>
struct GstSizeEvent : public QEvent { struct GstSizeEvent : public TQEvent {
GstSizeEvent (int l, int w, int h); GstSizeEvent (int l, int w, int h);
int length; int length;
int width; int width;
int height; int height;
}; };
struct GstProgressEvent : public QEvent { struct GstProgressEvent : public TQEvent {
GstProgressEvent (int p); GstProgressEvent (int p);
int progress; int progress;
}; };
class KGStreamerPlayer : public QApplication { class KGStreamerPlayer : public TQApplication {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KGStreamerPlayer (int argc, char ** argv); KGStreamerPlayer (int argc, char ** argv);
~KGStreamerPlayer (); ~KGStreamerPlayer ();
@ -50,7 +51,7 @@ public:
void brightness (int val); void brightness (int val);
void volume (int val); void volume (int val);
void seek (int val); void seek (int val);
bool event (QEvent * e); bool event (TQEvent * e);
public slots: public slots:
void play (int repeat_count); void play (int repeat_count);
void stop (); void stop ();
@ -58,7 +59,7 @@ public slots:
void updatePosition (); void updatePosition ();
//void postFinished (); //void postFinished ();
protected: protected:
void saveState (QSessionManager & sm); void saveState (TQSessionManager & sm);
}; };
#endif //_K_GST_PLAYER_H_ #endif //_K_GST_PLAYER_H_

@ -33,9 +33,9 @@
static const int id_status_msg = 1; static const int id_status_msg = 1;
static const int id_status_timer = 2; static const int id_status_timer = 2;
class QPopupMenu; class TQPopupMenu;
class QMenuItem; class TQMenuItem;
class QListViewItem; class TQListViewItem;
class KProcess; class KProcess;
class KMPlayerBroadcastConfig; class KMPlayerBroadcastConfig;
class KMPlayerFFServerConfig; class KMPlayerFFServerConfig;
@ -58,9 +58,10 @@ namespace KMPlayer {
class KMPlayerApp : public KMainWindow class KMPlayerApp : public KMainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerApp (QWidget* parent=0, const char* name=0); KMPlayerApp (TQWidget* tqparent=0, const char* name=0);
~KMPlayerApp (); ~KMPlayerApp ();
void openDocumentFile (const KURL& url=KURL()); void openDocumentFile (const KURL& url=KURL());
void addURL (const KURL& url); void addURL (const KURL& url);
@ -97,7 +98,7 @@ public slots:
void slotViewToolBar (); void slotViewToolBar ();
void slotViewStatusBar (); void slotViewStatusBar ();
void slotViewMenuBar (); void slotViewMenuBar ();
void slotStatusMsg (const QString &text); void slotStatusMsg (const TQString &text);
void slotSourceChanged (KMPlayer::Source *, KMPlayer::Source *); void slotSourceChanged (KMPlayer::Source *, KMPlayer::Source *);
private slots: private slots:
void dvdNav (); void dvdNav ();
@ -126,8 +127,8 @@ private slots:
void slotConfigureToolbars (); void slotConfigureToolbars ();
void slotClearHistory (); void slotClearHistory ();
void windowVideoConsoleToggled (int wt); void windowVideoConsoleToggled (int wt);
void playListItemSelected (QListViewItem *); void playListItemSelected (TQListViewItem *);
void playListItemDropped (QDropEvent * e, QListViewItem * after); void playListItemDropped (TQDropEvent * e, TQListViewItem * after);
void playListItemMoved (); void playListItemMoved ();
void menuDropInList (); void menuDropInList ();
void menuDropInGroup (); void menuDropInGroup ();
@ -135,10 +136,10 @@ private slots:
void menuDeleteNode (); void menuDeleteNode ();
void menuMoveUpNode (); void menuMoveUpNode ();
void menuMoveDownNode (); void menuMoveDownNode ();
void preparePlaylistMenu (KMPlayer::PlayListItem *, QPopupMenu *); void preparePlaylistMenu (KMPlayer::PlayListItem *, TQPopupMenu *);
private: private:
void menuItemClicked (QPopupMenu * menu, int id); void menuItemClicked (TQPopupMenu * menu, int id);
void minimalMode (bool deco=true); void minimalMode (bool deco=true);
KConfig * config; KConfig * config;
KSystemTray * m_systray; KSystemTray * m_systray;
@ -167,18 +168,18 @@ private:
KToggleAction * viewStatusBar; KToggleAction * viewStatusBar;
KToggleAction * viewMenuBar; KToggleAction * viewMenuBar;
KToggleAction * viewKeepRatio; KToggleAction * viewKeepRatio;
QMenuItem * m_sourcemenu; TQMenuItem * m_sourcemenu;
QPopupMenu * m_dvdmenu; TQPopupMenu * m_dvdmenu;
QPopupMenu * m_dvdnavmenu; TQPopupMenu * m_dvdnavmenu;
QPopupMenu * m_vcdmenu; TQPopupMenu * m_vcdmenu;
QPopupMenu * m_audiocdmenu; TQPopupMenu * m_audiocdmenu;
QPopupMenu * m_tvmenu; TQPopupMenu * m_tvmenu;
QPopupMenu * m_dropmenu; TQPopupMenu * m_dropmenu;
KMPlayerFFServerConfig * m_ffserverconfig; KMPlayerFFServerConfig * m_ffserverconfig;
KMPlayerBroadcastConfig * m_broadcastconfig; KMPlayerBroadcastConfig * m_broadcastconfig;
QCString m_dcopName; TQCString m_dcopName;
KURL::List m_drop_list; KURL::List m_drop_list;
QListViewItem * m_drop_after; TQListViewItem * m_drop_after;
int edit_tree_id; int edit_tree_id;
int manip_tree_id; int manip_tree_id;
int last_time_left; int last_time_left;
@ -195,10 +196,10 @@ private:
class KMPLAYER_NO_EXPORT FileDocument : public KMPlayer::Document { class KMPLAYER_NO_EXPORT FileDocument : public KMPlayer::Document {
public: public:
FileDocument (short id, const QString &, KMPlayer::PlayListNotify * notify = 0L); FileDocument (short id, const TQString &, KMPlayer::PlayListNotify * notify = 0L);
KMPlayer::NodePtr childFromTag (const QString & tag); KMPlayer::NodePtr childFromTag (const TQString & tag);
void readFromFile (const QString & file); void readFromFile (const TQString & file);
void writeToFile (const QString & file); void writeToFile (const TQString & file);
}; };
#endif // KMPLAYER_H #endif // KMPLAYER_H

@ -24,14 +24,14 @@
using namespace KMPlayer; using namespace KMPlayer;
static QString getAsxAttribute (Element * e, const QString & attr) { static TQString getAsxAttribute (Element * e, const TQString & attr) {
for (AttributePtr a = e->attributes ()->first (); a; a = a->nextSibling ()) for (AttributePtr a = e->attributes ()->first (); a; a = a->nextSibling ())
if (attr == a->name ().toString ().lower ()) if (attr == a->name ().toString ().lower ())
return a->value (); return a->value ();
return QString (); return TQString ();
} }
KDE_NO_EXPORT NodePtr ASX::Asx::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr ASX::Asx::childFromTag (const TQString & tag) {
const char * name = tag.latin1 (); const char * name = tag.latin1 ();
if (!strcasecmp (name, "entry")) if (!strcasecmp (name, "entry"))
return new ASX::Entry (m_doc); return new ASX::Entry (m_doc);
@ -59,7 +59,7 @@ KDE_NO_EXPORT Node::PlayType ASX::Asx::playType () {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_EXPORT NodePtr ASX::Entry::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr ASX::Entry::childFromTag (const TQString & tag) {
const char * name = tag.latin1 (); const char * name = tag.latin1 ();
if (!strcasecmp (name, "ref")) if (!strcasecmp (name, "ref"))
return new ASX::Ref (m_doc); return new ASX::Ref (m_doc);
@ -105,7 +105,7 @@ KDE_NO_EXPORT void ASX::Entry::activate () {
for (NodePtr e = firstChild (); e; e = e->nextSibling ()) for (NodePtr e = firstChild (); e; e = e->nextSibling ())
if (e->id == id_node_param) { if (e->id == id_node_param) {
Element * elm = convertNode <Element> (e); Element * elm = convertNode <Element> (e);
if (getAsxAttribute(elm,"name").lower() == QString("clipsummary")) { if (getAsxAttribute(elm,"name").lower() == TQString("clipsummary")) {
PlayListNotify * n = document ()->notify_listener; PlayListNotify * n = document ()->notify_listener;
if (n) if (n)
n->setInfoMessage (KURL::decode_string ( n->setInfoMessage (KURL::decode_string (
@ -119,7 +119,7 @@ KDE_NO_EXPORT void ASX::Entry::activate () {
KDE_NO_EXPORT void ASX::Entry::deactivate () { KDE_NO_EXPORT void ASX::Entry::deactivate () {
PlayListNotify * n = document ()->notify_listener; PlayListNotify * n = document ()->notify_listener;
if (n) if (n)
n->setInfoMessage (QString ()); n->setInfoMessage (TQString ());
} }
KDE_NO_EXPORT bool ASX::Entry::expose () const { KDE_NO_EXPORT bool ASX::Entry::expose () const {

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_ASX_H_ #ifndef _KMPLAYER_ASX_H_
#define _KMPLAYER_ASX_H_ #define _KMPLAYER_ASX_H_
#include <qstring.h> #include <tqstring.h>
#include "kmplayerplaylist.h" #include "kmplayerplaylist.h"
@ -45,7 +45,7 @@ const short id_node_duration = 408;
class KMPLAYER_NO_EXPORT Asx : public Mrl { class KMPLAYER_NO_EXPORT Asx : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Asx (NodePtr & d) : Mrl (d, id_node_asx) {} KDE_NO_CDTOR_EXPORT Asx (NodePtr & d) : Mrl (d, id_node_asx) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "ASX"; } KDE_NO_EXPORT const char * nodeName () const { return "ASX"; }
bool expose () const { return !pretty_name.isEmpty (); } bool expose () const { return !pretty_name.isEmpty (); }
PlayType playType (); PlayType playType ();
@ -58,7 +58,7 @@ class KMPLAYER_NO_EXPORT Entry : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Entry (NodePtr & d) KDE_NO_CDTOR_EXPORT Entry (NodePtr & d)
: Mrl (d, id_node_entry), ref_child_count (0) {} : Mrl (d, id_node_entry), ref_child_count (0) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "Entry"; } KDE_NO_EXPORT const char * nodeName () const { return "Entry"; }
/** /**
* False, but since we might have a 'base' child, we can have a rel. src * False, but since we might have a 'base' child, we can have a rel. src
@ -76,7 +76,7 @@ public:
class KMPLAYER_NO_EXPORT Ref : public Mrl { class KMPLAYER_NO_EXPORT Ref : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Ref (NodePtr & d) : Mrl (d, id_node_ref) {} KDE_NO_CDTOR_EXPORT Ref (NodePtr & d) : Mrl (d, id_node_ref) {}
//NodePtr childFromTag (const QString & tag); //NodePtr childFromTag (const TQString & tag);
void opened (); void opened ();
KDE_NO_EXPORT const char * nodeName () const { return "Ref"; } KDE_NO_EXPORT const char * nodeName () const { return "Ref"; }
bool expose () const; bool expose () const;
@ -88,7 +88,7 @@ public:
class KMPLAYER_NO_EXPORT EntryRef : public Mrl { class KMPLAYER_NO_EXPORT EntryRef : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT EntryRef (NodePtr & d) : Mrl (d, id_node_entryref) {} KDE_NO_CDTOR_EXPORT EntryRef (NodePtr & d) : Mrl (d, id_node_entryref) {}
//NodePtr childFromTag (const QString & tag); //NodePtr childFromTag (const TQString & tag);
void opened (); void opened ();
KDE_NO_EXPORT const char * nodeName () const { return "EntryRef"; } KDE_NO_EXPORT const char * nodeName () const { return "EntryRef"; }
}; };

@ -22,7 +22,7 @@
using namespace KMPlayer; using namespace KMPlayer;
NodePtr ATOM::Feed::childFromTag (const QString & tag) { NodePtr ATOM::Feed::childFromTag (const TQString & tag) {
if (!strcmp (tag.latin1 (), "entry")) if (!strcmp (tag.latin1 (), "entry"))
return new ATOM::Entry (m_doc); return new ATOM::Entry (m_doc);
else if (!strcmp (tag.latin1 (), "link")) else if (!strcmp (tag.latin1 (), "link"))
@ -40,7 +40,7 @@ void ATOM::Feed::closed () {
} }
} }
NodePtr ATOM::Entry::childFromTag (const QString & tag) { NodePtr ATOM::Entry::childFromTag (const TQString & tag) {
if (!strcmp (tag.latin1 (), "link")) if (!strcmp (tag.latin1 (), "link"))
return new ATOM::Link (m_doc); return new ATOM::Link (m_doc);
else if (!strcmp (tag.latin1 (), "content")) else if (!strcmp (tag.latin1 (), "content"))
@ -65,8 +65,8 @@ Node::PlayType ATOM::Link::playType () {
} }
void ATOM::Link::closed () { void ATOM::Link::closed () {
QString href; TQString href;
QString rel; TQString rel;
for (AttributePtr a = attributes ()->first (); a; a = a->nextSibling ()) { for (AttributePtr a = attributes ()->first (); a; a = a->nextSibling ()) {
if (a->name () == StringPool::attr_href) if (a->name () == StringPool::attr_href)
href = a->value (); href = a->value ();
@ -75,7 +75,7 @@ void ATOM::Link::closed () {
else if (a->name () == "rel") else if (a->name () == "rel")
rel = a->value (); rel = a->value ();
} }
if (!href.isEmpty () && rel == QString::fromLatin1 ("enclosure")) if (!href.isEmpty () && rel == TQString::tqfromLatin1 ("enclosure"))
src = href; src = href;
else if (pretty_name.isEmpty ()) else if (pretty_name.isEmpty ())
pretty_name = href; pretty_name = href;
@ -86,13 +86,13 @@ void ATOM::Content::closed () {
if (a->name () == StringPool::attr_src) if (a->name () == StringPool::attr_src)
src = a->value (); src = a->value ();
else if (a->name () == StringPool::attr_type) { else if (a->name () == StringPool::attr_type) {
QString v = a->value ().lower (); TQString v = a->value ().lower ();
if (v == QString::fromLatin1 ("text")) if (v == TQString::tqfromLatin1 ("text"))
mimetype = QString::fromLatin1 ("text/plain"); mimetype = TQString::tqfromLatin1 ("text/plain");
else if (v == QString::fromLatin1 ("html")) else if (v == TQString::tqfromLatin1 ("html"))
mimetype = QString::fromLatin1 ("text/html"); mimetype = TQString::tqfromLatin1 ("text/html");
else if (v == QString::fromLatin1 ("xhtml")) else if (v == TQString::tqfromLatin1 ("xhtml"))
mimetype = QString::fromLatin1 ("application/xhtml+xml"); mimetype = TQString::tqfromLatin1 ("application/xhtml+xml");
else else
mimetype = v; mimetype = v;
} }

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_ATOM_H_ #ifndef _KMPLAYER_ATOM_H_
#define _KMPLAYER_ATOM_H_ #define _KMPLAYER_ATOM_H_
#include <qstringlist.h> #include <tqstringlist.h>
#include "kmplayerplaylist.h" #include "kmplayerplaylist.h"
@ -42,7 +42,7 @@ const short id_node_content = 305;
class KMPLAYER_NO_EXPORT Feed : public Mrl { class KMPLAYER_NO_EXPORT Feed : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Feed (NodePtr & d) : Mrl (d, id_node_feed) {} KDE_NO_CDTOR_EXPORT Feed (NodePtr & d) : Mrl (d, id_node_feed) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "feed"; } KDE_NO_EXPORT const char * nodeName () const { return "feed"; }
void closed (); void closed ();
bool expose () const { return !pretty_name.isEmpty (); } bool expose () const { return !pretty_name.isEmpty (); }
@ -51,7 +51,7 @@ public:
class KMPLAYER_NO_EXPORT Entry : public Mrl { class KMPLAYER_NO_EXPORT Entry : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Entry (NodePtr & d) : Mrl (d, id_node_entry) {} KDE_NO_CDTOR_EXPORT Entry (NodePtr & d) : Mrl (d, id_node_entry) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "entry"; } KDE_NO_EXPORT const char * nodeName () const { return "entry"; }
PlayType playType () { return play_type_none; } PlayType playType () { return play_type_none; }
void closed (); void closed ();

@ -31,8 +31,8 @@ public:
Backend (); Backend ();
virtual ~Backend (); virtual ~Backend ();
k_dcop: k_dcop:
virtual ASYNC setURL (QString url); virtual ASYNC setURL (TQString url);
virtual ASYNC setSubTitleURL (QString url); virtual ASYNC setSubTitleURL (TQString url);
virtual ASYNC play (int repeat_count); virtual ASYNC play (int repeat_count);
virtual ASYNC stop (); virtual ASYNC stop ();
virtual ASYNC pause (); virtual ASYNC pause ();
@ -45,9 +45,9 @@ k_dcop:
virtual ASYNC volume (int v, bool absolute); virtual ASYNC volume (int v, bool absolute);
virtual ASYNC frequency (int f); virtual ASYNC frequency (int f);
virtual ASYNC quit (); virtual ASYNC quit ();
virtual ASYNC setConfig (QByteArray); virtual ASYNC setConfig (TQByteArray);
virtual ASYNC setAudioLang (int, QString); virtual ASYNC setAudioLang (int, TQString);
virtual ASYNC setSubtitle (int, QString); virtual ASYNC setSubtitle (int, TQString);
virtual bool isPlaying (); virtual bool isPlaying ();
private: private:
BackendPrivate * d; BackendPrivate * d;

@ -20,7 +20,7 @@
#define _KMPLAYER_CALLBACK_H_ #define _KMPLAYER_CALLBACK_H_
#include <dcopobject.h> #include <dcopobject.h>
#include <qstringlist.h> #include <tqstringlist.h>
namespace KMPlayer { namespace KMPlayer {
@ -32,13 +32,13 @@ public:
enum StatusCode { stat_addurl = 0, stat_newtitle, stat_hasvideo }; enum StatusCode { stat_addurl = 0, stat_newtitle, stat_hasvideo };
Callback (CallbackProcess *); Callback (CallbackProcess *);
k_dcop: k_dcop:
ASYNC statusMessage (int code, QString msg); ASYNC statusMessage (int code, TQString msg);
ASYNC errorMessage (int code, QString msg); ASYNC errorMessage (int code, TQString msg);
ASYNC subMrl (QString mrl, QString title); ASYNC subMrl (TQString mrl, TQString title);
ASYNC finished (); ASYNC finished ();
ASYNC playing (); ASYNC playing ();
ASYNC started (QCString dcopname, QByteArray data); ASYNC started (TQCString dcopname, TQByteArray data);
ASYNC movieParams (int length, int width, int height, float aspect, QStringList alang, QStringList slang); ASYNC movieParams (int length, int width, int height, float aspect, TQStringList alang, TQStringList slang);
ASYNC moviePosition (int position); ASYNC moviePosition (int position);
ASYNC loadingProgress (int percentage); ASYNC loadingProgress (int percentage);
ASYNC toggleFullScreen (); ASYNC toggleFullScreen ();

@ -23,14 +23,14 @@
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qcstring.h> #include <tqcstring.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qmultilineedit.h> #include <tqmultilineedit.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qslider.h> #include <tqslider.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
#include <kprocess.h> #include <kprocess.h>
#include <kmessagebox.h> #include <kmessagebox.h>
@ -48,11 +48,11 @@
#ifdef HAVE_KOFFICE #ifdef HAVE_KOFFICE
#include <qdom.h> #include <tqdom.h>
//#include <qmetaobject.h> //#include <tqmetaobject.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include <qpainter.h> #include <tqpainter.h>
#include <koFrame.h> #include <koFrame.h>
class KMPlayerFactory : public KParts::Factory { class KMPlayerFactory : public KParts::Factory {
@ -60,8 +60,8 @@ public:
KMPlayerFactory (); KMPlayerFactory ();
virtual ~KMPlayerFactory (); virtual ~KMPlayerFactory ();
virtual KParts::Part *createPartObject virtual KParts::Part *createPartObject
(QWidget *wparent, const char *wname, QObject *parent, const char *name, (TQWidget *wtqparent, const char *wname, TQObject *tqparent, const char *name,
const char *className, const QStringList &args); const char *className, const TQStringList &args);
static KInstance * instance () { return s_instance; } static KInstance * instance () { return s_instance; }
private: private:
static KInstance * s_instance; static KInstance * s_instance;
@ -80,21 +80,21 @@ KMPlayerFactory::~KMPlayerFactory () {
} }
KParts::Part *KMPlayerFactory::createPartObject KParts::Part *KMPlayerFactory::createPartObject
(QWidget *wparent, const char *wname, (TQWidget *wtqparent, const char *wname,
QObject *parent, const char * name, TQObject *tqparent, const char * name,
const char * cls, const QStringList & args) { const char * cls, const TQStringList & args) {
if (strstr (cls, "KoDocument")) if (strstr (cls, "KoDocument"))
return new KOfficeMPlayer (wparent, wname, parent, name); return new KOfficeMPlayer (wtqparent, wname, tqparent, name);
return 0L; return 0L;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KOfficeMPlayer::KOfficeMPlayer (QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode) KOfficeMPlayer::KOfficeMPlayer (TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, bool singleViewMode)
: KoDocument (parentWidget, widgetName, parent, name, singleViewMode), : KoDocument (tqparentWidget, widgetName, tqparent, name, singleViewMode),
m_config (new KConfig ("kmplayerrc")), m_config (new KConfig ("kmplayerrc")),
m_player (new KMPlayer (parentWidget, 0L, 0L, 0L, m_config)) m_player (new KMPlayer (tqparentWidget, 0L, 0L, 0L, m_config))
{ {
setInstance (KMPlayerFactory::instance (), false); setInstance (KMPlayerFactory::instance (), false);
setReadWrite (false); setReadWrite (false);
@ -107,8 +107,8 @@ KOfficeMPlayer::~KOfficeMPlayer () {
kdDebug() << "KOfficeMPlayer::~KOfficeMPlayer" << /*kdBacktrace() <<*/ endl; kdDebug() << "KOfficeMPlayer::~KOfficeMPlayer" << /*kdBacktrace() <<*/ endl;
} }
void KOfficeMPlayer::paintContent (QPainter& p, const QRect& r, bool, double, double) { void KOfficeMPlayer::paintContent (TQPainter& p, const TQRect& r, bool, double, double) {
p.fillRect (r, QBrush (QColor (0, 0, 0))); p.fillRect (r, TQBrush (TQColor (0, 0, 0)));
} }
bool KOfficeMPlayer::initDoc() { bool KOfficeMPlayer::initDoc() {
@ -116,8 +116,8 @@ bool KOfficeMPlayer::initDoc() {
return true; return true;
} }
bool KOfficeMPlayer::loadXML (QIODevice *, const QDomDocument & doc) { bool KOfficeMPlayer::loadXML (TQIODevice *, const TQDomDocument & doc) {
QDomNode node = doc.firstChild (); TQDomNode node = doc.firstChild ();
if (node.isNull ()) return true; if (node.isNull ()) return true;
kdDebug() << "KOfficeMPlayer::loadXML " << node.nodeName () << endl; kdDebug() << "KOfficeMPlayer::loadXML " << node.nodeName () << endl;
node = node.firstChild (); node = node.firstChild ();
@ -129,39 +129,39 @@ bool KOfficeMPlayer::loadXML (QIODevice *, const QDomDocument & doc) {
return true; return true;
} }
bool KOfficeMPlayer::loadOasis (const QDomDocument &, KoOasisStyles &, const QDomDocument &, KoStore *) { bool KOfficeMPlayer::loadOasis (const TQDomDocument &, KoOasisStyles &, const TQDomDocument &, KoStore *) {
return true; return true;
} }
QDomDocument KOfficeMPlayer::saveXML() { TQDomDocument KOfficeMPlayer::saveXML() {
QDomDocument doc = createDomDocument ("kmplayer", QString::number(1.0)); TQDomDocument doc = createDomDocument ("kmplayer", TQString::number(1.0));
QDomElement docelm = doc.documentElement(); TQDomElement docelm = doc.documentElement();
docelm.setAttribute ("editor", "KMPlayer"); docelm.setAttribute ("editor", "KMPlayer");
docelm.setAttribute ("mime", "application/x-kmplayer"); docelm.setAttribute ("mime", "application/x-kmplayer");
QDomElement url = doc.createElement ("url"); TQDomElement url = doc.createElement ("url");
url.appendChild (doc.createTextNode (m_player->url ().url ())); url.appendChild (doc.createTextNode (m_player->url ().url ()));
doc.appendChild (url); doc.appendChild (url);
return doc; return doc;
} }
KoView* KOfficeMPlayer::createViewInstance (QWidget* parent, const char* name) { KoView* KOfficeMPlayer::createViewInstance (TQWidget* tqparent, const char* name) {
kdDebug() << "KOfficeMPlayer::createViewInstance" << endl; kdDebug() << "KOfficeMPlayer::createViewInstance" << endl;
return new KOfficeMPlayerView (this, parent); return new KOfficeMPlayerView (this, tqparent);
} }
KOfficeMPlayerView::KOfficeMPlayerView (KOfficeMPlayer* part, QWidget* parent, const char* name) KOfficeMPlayerView::KOfficeMPlayerView (KOfficeMPlayer* part, TQWidget* tqparent, const char* name)
: KoView (part, parent, name), : KoView (part, tqparent, name),
m_view (static_cast <KMPlayer::View*> (part->player ()->view ())) { m_view (static_cast <KMPlayer::View*> (part->player ()->view ())) {
kdDebug() << "KOfficeMPlayerView::KOfficeMPlayerView this:" << this << " parent:" << parent << endl; kdDebug() << "KOfficeMPlayerView::KOfficeMPlayerView this:" << this << " tqparent:" << tqparent << endl;
m_oldparent = static_cast <QWidget*> (m_view->parent()); m_oldtqparent = static_cast <TQWidget*> (m_view->tqparent());
m_view->reparent (this, QPoint (0, 0)); m_view->reparent (this, TQPoint (0, 0));
QVBoxLayout * box = new QVBoxLayout (this, 0, 0); TQVBoxLayout * box = new TQVBoxLayout (this, 0, 0);
box->addWidget (m_view); box->addWidget (m_view);
} }
KOfficeMPlayerView::~KOfficeMPlayerView () { KOfficeMPlayerView::~KOfficeMPlayerView () {
kdDebug() << "KOfficeMPlayerView::~KOfficeMPlayerView this:" << this << endl; kdDebug() << "KOfficeMPlayerView::~KOfficeMPlayerView this:" << this << endl;
m_view->reparent (m_oldparent, QPoint (0, 0)); m_view->reparent (m_oldtqparent, TQPoint (0, 0));
} }
#include "kmplayer_koffice_part.moc" #include "kmplayer_koffice_part.moc"

@ -28,11 +28,11 @@
#include <koDocument.h> #include <koDocument.h>
#include <koView.h> #include <koView.h>
#endif //HAVE_KOFFICE #endif //HAVE_KOFFICE
#include <qobject.h> #include <tqobject.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qguardedptr.h> #include <tqguardedptr.h>
#include <qregexp.h> #include <tqregexp.h>
#include "kmplayerview.h" #include "kmplayerview.h"
#include "kmplayersource.h" #include "kmplayersource.h"
@ -42,39 +42,41 @@ class KAboutData;
class KMPlayer; class KMPlayer;
class KInstance; class KInstance;
class KConfig; class KConfig;
class QIODevice; class TQIODevice;
#ifdef HAVE_KOFFICE #ifdef HAVE_KOFFICE
class KOfficeMPlayer; class KOfficeMPlayer;
class KOfficeMPlayerView : public KoView { class KOfficeMPlayerView : public KoView {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KOfficeMPlayerView (KOfficeMPlayer* part, QWidget* parent, const char* name = 0 ); KOfficeMPlayerView (KOfficeMPlayer* part, TQWidget* tqparent, const char* name = 0 );
~KOfficeMPlayerView (); ~KOfficeMPlayerView ();
void updateReadWrite(bool) {} void updateReadWrite(bool) {}
private: private:
KMPlayer::View * m_view; KMPlayer::View * m_view;
QGuardedPtr <QWidget> m_oldparent; TQGuardedPtr <TQWidget> m_oldtqparent;
}; };
class KOfficeMPlayer : public KoDocument { class KOfficeMPlayer : public KoDocument {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KOfficeMPlayer (QWidget *parentWidget = 0, const char *widgetName = 0, QObject* parent = 0, const char* name = 0, bool singleViewMode = false); KOfficeMPlayer (TQWidget *tqparentWidget = 0, const char *widgetName = 0, TQObject* tqparent = 0, const char* name = 0, bool singleViewMode = false);
~KOfficeMPlayer (); ~KOfficeMPlayer ();
virtual void paintContent (QPainter& painter, const QRect& rect, virtual void paintContent (TQPainter& painter, const TQRect& rect,
bool transparent = false, double zoomX = 1.0, double zoomY = 1.0); bool transparent = false, double zoomX = 1.0, double zoomY = 1.0);
virtual bool initDoc (); virtual bool initDoc ();
virtual bool loadXML (QIODevice *, const QDomDocument &); virtual bool loadXML (TQIODevice *, const TQDomDocument &);
virtual bool loadOasis (const QDomDocument &, KoOasisStyles &, const QDomDocument &, KoStore *); virtual bool loadOasis (const TQDomDocument &, KoOasisStyles &, const TQDomDocument &, KoStore *);
virtual QDomDocument saveXML (); virtual TQDomDocument saveXML ();
virtual QCString mimeType() const { return "application/x-kmplayer"; } virtual TQCString mimeType() const { return "application/x-kmplayer"; }
KMPlayer * player () const { return m_player; } KMPlayer * player () const { return m_player; }
protected: protected:
virtual KoView* createViewInstance (QWidget* parent, const char* name); virtual KoView* createViewInstance (TQWidget* tqparent, const char* name);
private: private:
KConfig * m_config; KConfig * m_config;
KMPlayer * m_player; KMPlayer * m_player;

@ -23,10 +23,10 @@
#include <algorithm> #include <algorithm>
#include <config.h> #include <config.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qslider.h> #include <tqslider.h>
class KXMLGUIClient; // workaround for kde3.3 on sarge with gcc4, kactioncollection.h does not forward declare KXMLGUIClient class KXMLGUIClient; // workaround for kde3.3 on sarge with gcc4, kactioncollection.h does not forward declare KXMLGUIClient
#include <klibloader.h> #include <klibloader.h>
@ -72,17 +72,17 @@ KDE_NO_CDTOR_EXPORT KMPlayerPartStatic::~KMPlayerPartStatic () {
struct KMPLAYER_NO_EXPORT GroupPredicate { struct KMPLAYER_NO_EXPORT GroupPredicate {
const KMPlayerPart * m_part; const KMPlayerPart * m_part;
const QString & m_group; const TQString & m_group;
bool m_get_any; bool m_get_any;
GroupPredicate(const KMPlayerPart *part, const QString &group, bool b=false) GroupPredicate(const KMPlayerPart *part, const TQString &group, bool b=false)
: m_part (part), m_group (group), m_get_any (b) {} : m_part (part), m_group (group), m_get_any (b) {}
bool operator () (const KMPlayerPart * part) const { bool operator () (const KMPlayerPart * part) const {
return ((m_get_any && part != m_part && return ((m_get_any && part != m_part &&
!part->master () && !part->url ().isEmpty ()) || !part->master () && !part->url ().isEmpty ()) ||
(m_part->allowRedir (part->m_docbase) && (m_part->allowRedir (part->m_docbase) &&
(part->m_group == m_group || (part->m_group == m_group ||
part->m_group == QString::fromLatin1("_master") || part->m_group == TQString::tqfromLatin1("_master") ||
m_group == QString::fromLatin1("_master")) && m_group == TQString::tqfromLatin1("_master")) &&
(part->m_features & KMPlayerPart::Feat_Viewer) != (part->m_features & KMPlayerPart::Feat_Viewer) !=
(m_part->m_features & KMPlayerPart::Feat_Viewer))); (m_part->m_features & KMPlayerPart::Feat_Viewer)));
} }
@ -97,9 +97,9 @@ public:
KMPlayerFactory (); KMPlayerFactory ();
virtual ~KMPlayerFactory (); virtual ~KMPlayerFactory ();
virtual KParts::Part *createPartObject virtual KParts::Part *createPartObject
(QWidget *wparent, const char *wname, (TQWidget *wtqparent, const char *wname,
QObject *parent, const char *name, TQObject *tqparent, const char *name,
const char *className, const QStringList &args); const char *className, const TQStringList &args);
static KInstance * instance () { return s_instance; } static KInstance * instance () { return s_instance; }
private: private:
static KInstance * s_instance; static KInstance * s_instance;
@ -118,27 +118,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerFactory::~KMPlayerFactory () {
} }
KDE_NO_EXPORT KParts::Part *KMPlayerFactory::createPartObject KDE_NO_EXPORT KParts::Part *KMPlayerFactory::createPartObject
(QWidget *wparent, const char *wname, (TQWidget *wtqparent, const char *wname,
QObject *parent, const char * name, TQObject *tqparent, const char * name,
const char * cls, const QStringList & args) { const char * cls, const TQStringList & args) {
kdDebug() << "KMPlayerFactory::createPartObject " << cls << endl; kdDebug() << "KMPlayerFactory::createPartObject " << cls << endl;
return new KMPlayerPart (wparent, wname, parent, name, args); return new KMPlayerPart (wtqparent, wname, tqparent, name, args);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static bool getBoolValue (const QString & value) { static bool getBoolValue (const TQString & value) {
return (value.lower() != QString::fromLatin1("false") && return (value.lower() != TQString::tqfromLatin1("false") &&
value.lower() != QString::fromLatin1("off") && value.lower() != TQString::tqfromLatin1("off") &&
value.lower() != QString::fromLatin1("0")); value.lower() != TQString::tqfromLatin1("0"));
} }
#define SET_FEAT_ON(f) { m_features |= f; turned_off_features &= ~f; } #define SET_FEAT_ON(f) { m_features |= f; turned_off_features &= ~f; }
#define SET_FEAT_OFF(f) { m_features &= ~f; turned_off_features |= f; } #define SET_FEAT_OFF(f) { m_features &= ~f; turned_off_features |= f; }
KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *wname, KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (TQWidget * wtqparent, const char *wname,
QObject * parent, const char *name, const QStringList &args) TQObject * tqparent, const char *name, const TQStringList &args)
: PartBase (wparent, wname, parent, name, new KConfig ("kmplayerrc")), : PartBase (wtqparent, wname, tqparent, name, new KConfig ("kmplayerrc")),
m_master (0L), m_master (0L),
m_browserextension (new KMPlayerBrowserExtension (this)), m_browserextension (new KMPlayerBrowserExtension (this)),
m_liveconnectextension (new KMPlayerLiveConnectExtension (this)), m_liveconnectextension (new KMPlayerLiveConnectExtension (this)),
@ -154,27 +154,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
m_sources ["hrefsource"] = (new KMPlayerHRefSource (this)); m_sources ["hrefsource"] = (new KMPlayerHRefSource (this));
#ifdef HAVE_NSPR #ifdef HAVE_NSPR
KMPlayer::NpPlayer *npp = (KMPlayer::NpPlayer *) players () ["npp"]; KMPlayer::NpPlayer *npp = (KMPlayer::NpPlayer *) players () ["npp"];
connect (npp, SIGNAL (evaluate (const QString &, QString &)), connect (npp, TQT_SIGNAL (evaluate (const TQString &, TQString &)),
m_liveconnectextension, SLOT (evaluate (const QString &, QString &))); m_liveconnectextension, TQT_SLOT (evaluate (const TQString &, TQString &)));
connect (npp, SIGNAL (openUrl (const KURL &, const QString &)), connect (npp, TQT_SIGNAL (openUrl (const KURL &, const TQString &)),
m_browserextension, m_browserextension,
SLOT (slotRequestOpenURL (const KURL &, const QString &))); TQT_SLOT (slotRequestOpenURL (const KURL &, const TQString &)));
#endif #endif
/*KAction *playact =*/ new KAction(i18n("P&lay"), QString ("player_play"), KShortcut (), this, SLOT(play ()), actionCollection (), "play"); /*KAction *playact =*/ new KAction(i18n("P&lay"), TQString ("player_play"), KShortcut (), this, TQT_SLOT(play ()), actionCollection (), "play");
/*KAction *pauseact =*/ new KAction(i18n("&Pause"), QString ("player_pause"), KShortcut (), this, SLOT(pause ()), actionCollection (), "pause"); /*KAction *pauseact =*/ new KAction(i18n("&Pause"), TQString ("player_pause"), KShortcut (), this, TQT_SLOT(pause ()), actionCollection (), "pause");
/*KAction *stopact =*/ new KAction(i18n("&Stop"), QString ("player_stop"), KShortcut (), this, SLOT(stop ()), actionCollection (), "stop"); /*KAction *stopact =*/ new KAction(i18n("&Stop"), TQString ("player_stop"), KShortcut (), this, TQT_SLOT(stop ()), actionCollection (), "stop");
new KAction (i18n ("Increase Volume"), QString ("player_volume"), KShortcut (), this, SLOT (increaseVolume ()), actionCollection (), "edit_volume_up"); new KAction (i18n ("Increase Volume"), TQString ("player_volume"), KShortcut (), this, TQT_SLOT (increaseVolume ()), actionCollection (), "edit_volume_up");
new KAction (i18n ("Decrease Volume"), QString ("player_volume"), KShortcut (), this, SLOT (decreaseVolume ()), actionCollection (), "edit_volume_down"); new KAction (i18n ("Decrease Volume"), TQString ("player_volume"), KShortcut (), this, TQT_SLOT (decreaseVolume ()), actionCollection (), "edit_volume_down");
Source * urlsource = m_sources ["urlsource"]; Source * urlsource = m_sources ["urlsource"];
KMPlayer::ControlPanel * panel = m_view->controlPanel (); KMPlayer::ControlPanel * panel = m_view->controlPanel ();
QStringList::const_iterator it = args.begin (); TQStringList::const_iterator it = args.begin ();
QStringList::const_iterator end = args.end (); TQStringList::const_iterator end = args.end ();
int turned_off_features = 0; int turned_off_features = 0;
for ( ; it != end; ++it) { for ( ; it != end; ++it) {
int equalPos = (*it).find("="); int equalPos = (*it).tqfind("=");
if (equalPos > 0) { if (equalPos > 0) {
QString name = (*it).left (equalPos).lower (); TQString name = (*it).left (equalPos).lower ();
QString value = (*it).right ((*it).length () - equalPos - 1); TQString value = (*it).right ((*it).length () - equalPos - 1);
if (value.at(0)=='\"') if (value.at(0)=='\"')
value = value.right (value.length () - 1); value = value.right (value.length () - 1);
if (value.at (value.length () - 1) == '\"') if (value.at (value.length () - 1) == '\"')
@ -184,121 +184,121 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
urlsource->setURL (KURL (value)); urlsource->setURL (KURL (value));
urlsource->setIdentified (false); urlsource->setIdentified (false);
m_havehref = true; m_havehref = true;
} else if (name == QString::fromLatin1("width")) { } else if (name == TQString::tqfromLatin1("width")) {
m_noresize = true; m_noresize = true;
} else if (name == QString::fromLatin1("height")) { } else if (name == TQString::tqfromLatin1("height")) {
m_noresize = true; m_noresize = true;
} else if (name == QString::fromLatin1("type")) { } else if (name == TQString::tqfromLatin1("type")) {
urlsource->document ()->mrl ()->mimetype = value; urlsource->document ()->mrl ()->mimetype = value;
} else if (name == QString::fromLatin1("controls")) { } else if (name == TQString::tqfromLatin1("controls")) {
//http://service.real.com/help/library/guides/production8/realpgd.htm?src=noref,rnhmpg_080301,rnhmtn,nosrc //http://service.real.com/help/library/guides/production8/realpgd.htm?src=noref,rnhmpg_080301,rnhmtn,nosrc
//http://service.real.com/help/library/guides/production8/htmfiles/control.htm //http://service.real.com/help/library/guides/production8/htmfiles/control.htm
QStringList sl = QStringList::split (QChar (','), value); TQStringList sl = TQStringList::split (TQChar (','), value);
QStringList::const_iterator it = sl.begin (); TQStringList::const_iterator it = sl.begin ();
const QStringList::const_iterator e = sl.end (); const TQStringList::const_iterator e = sl.end ();
for (QStringList::const_iterator i = sl.begin (); i != e; ++i) { for (TQStringList::const_iterator i = sl.begin (); i != e; ++i) {
QString val_lower ((*i).lower ()); TQString val_lower ((*i).lower ());
if (val_lower == QString::fromLatin1("imagewindow")) { if (val_lower == TQString::tqfromLatin1("imagewindow")) {
SET_FEAT_ON (Feat_ImageWindow | Feat_Viewer) SET_FEAT_ON (Feat_ImageWindow | Feat_Viewer)
} else if (val_lower == QString::fromLatin1("all")) { } else if (val_lower == TQString::tqfromLatin1("all")) {
m_features = (Feat_Controls | Feat_StatusBar); m_features = (Feat_Controls | Feat_StatusBar);
} else if (val_lower == QString::fromLatin1("tacctrl")) { } else if (val_lower == TQString::tqfromLatin1("tacctrl")) {
SET_FEAT_ON (Feat_Label) SET_FEAT_ON (Feat_Label)
} else if (val_lower == QString::fromLatin1("controlpanel")) { } else if (val_lower == TQString::tqfromLatin1("controlpanel")) {
SET_FEAT_ON (Feat_Controls) SET_FEAT_ON (Feat_Controls)
} else if (val_lower == QString::fromLatin1("infovolumepanel")){ } else if (val_lower == TQString::tqfromLatin1("infovolumepanel")){
SET_FEAT_ON (Feat_Controls) // TODO SET_FEAT_ON (Feat_Controls) // TODO
} else if (val_lower == QString::fromLatin1("positionfield") || } else if (val_lower == TQString::tqfromLatin1("positionfield") ||
val_lower == QString::fromLatin1("positionslider")) { val_lower == TQString::tqfromLatin1("positionslider")) {
setAutoControls (false); setAutoControls (false);
panel->positionSlider ()->show (); panel->positionSlider ()->show ();
SET_FEAT_ON (Feat_Controls) SET_FEAT_ON (Feat_Controls)
} else if ( val_lower == QString::fromLatin1("homectrl")) { } else if ( val_lower == TQString::tqfromLatin1("homectrl")) {
setAutoControls (false); setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_config)->show(); panel->button (KMPlayer::ControlPanel::button_config)->show();
} else if (val_lower == QString::fromLatin1("mutectrl") || } else if (val_lower == TQString::tqfromLatin1("mutectrl") ||
val_lower == QString::fromLatin1("mutevolume")) { val_lower == TQString::tqfromLatin1("mutevolume")) {
setAutoControls (false); setAutoControls (false);
panel->volumeBar()->setMinimumSize (QSize (20, panel->volumeBar()->minimumSize ().height ())); panel->volumeBar()->setMinimumSize (TQSize (20, panel->volumeBar()->tqminimumSize ().height ()));
panel->volumeBar()->show (); panel->volumeBar()->show ();
SET_FEAT_ON (Feat_Controls) SET_FEAT_ON (Feat_Controls)
} else if (val_lower == QString::fromLatin1("rwctrl")) { } else if (val_lower == TQString::tqfromLatin1("rwctrl")) {
setAutoControls (false); setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_back)->show (); // rewind ? panel->button (KMPlayer::ControlPanel::button_back)->show (); // rewind ?
SET_FEAT_ON (Feat_Controls) SET_FEAT_ON (Feat_Controls)
} else if ( val_lower == QString::fromLatin1("ffctrl")) { } else if ( val_lower == TQString::tqfromLatin1("ffctrl")) {
setAutoControls (false); setAutoControls (false);
panel->button(KMPlayer::ControlPanel::button_forward)->show(); panel->button(KMPlayer::ControlPanel::button_forward)->show();
m_features = Feat_Controls; m_features = Feat_Controls;
} else if ( val_lower ==QString::fromLatin1("stopbutton")) { } else if ( val_lower ==TQString::tqfromLatin1("stopbutton")) {
setAutoControls (false); setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_stop)->show (); panel->button (KMPlayer::ControlPanel::button_stop)->show ();
SET_FEAT_ON (Feat_Controls) SET_FEAT_ON (Feat_Controls)
} else if (val_lower == QString::fromLatin1("playbutton") || } else if (val_lower == TQString::tqfromLatin1("playbutton") ||
val_lower ==QString::fromLatin1("playonlybutton")) { val_lower ==TQString::tqfromLatin1("playonlybutton")) {
setAutoControls (false); setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_play)->show (); panel->button (KMPlayer::ControlPanel::button_play)->show ();
SET_FEAT_ON (Feat_Controls) SET_FEAT_ON (Feat_Controls)
} else if (val_lower ==QString::fromLatin1("pausebutton")) { } else if (val_lower ==TQString::tqfromLatin1("pausebutton")) {
setAutoControls (false); setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_pause)->show (); panel->button (KMPlayer::ControlPanel::button_pause)->show ();
SET_FEAT_ON (Feat_Controls) SET_FEAT_ON (Feat_Controls)
} else if (val_lower == QString::fromLatin1("statusbar") || } else if (val_lower == TQString::tqfromLatin1("statusbar") ||
val_lower == QString::fromLatin1("statusfield")) { val_lower == TQString::tqfromLatin1("statusfield")) {
SET_FEAT_ON (Feat_StatusBar) SET_FEAT_ON (Feat_StatusBar)
} else if (val_lower == QString::fromLatin1("infopanel")) { } else if (val_lower == TQString::tqfromLatin1("infopanel")) {
SET_FEAT_ON (Feat_InfoPanel) SET_FEAT_ON (Feat_InfoPanel)
} else if (val_lower == QString::fromLatin1("playlist")) { } else if (val_lower == TQString::tqfromLatin1("playlist")) {
SET_FEAT_ON (Feat_PlayList) SET_FEAT_ON (Feat_PlayList)
} else if (val_lower==QString::fromLatin1("volumeslider")) { } else if (val_lower==TQString::tqfromLatin1("volumeslider")) {
SET_FEAT_ON (Feat_VolumeSlider) SET_FEAT_ON (Feat_VolumeSlider)
setAutoControls (false); setAutoControls (false);
panel->volumeBar()->show (); panel->volumeBar()->show ();
panel->volumeBar()->setMinimumSize (QSize (20, panel->volumeBar()->minimumSize ().height ())); panel->volumeBar()->setMinimumSize (TQSize (20, panel->volumeBar()->tqminimumSize ().height ()));
} }
} }
} else if (name == QString::fromLatin1("uimode")) { } else if (name == TQString::tqfromLatin1("uimode")) {
QString val_lower (value.lower ()); TQString val_lower (value.lower ());
if (val_lower == QString::fromLatin1("full")) if (val_lower == TQString::tqfromLatin1("full"))
SET_FEAT_ON (Feat_All & ~(Feat_PlayList | Feat_ImageWindow)) SET_FEAT_ON (Feat_All & ~(Feat_PlayList | Feat_ImageWindow))
// TODO: invisible, none, mini // TODO: invisible, none, mini
} else if (name == QString::fromLatin1("nolabels")) { } else if (name == TQString::tqfromLatin1("nolabels")) {
SET_FEAT_OFF (Feat_Label) SET_FEAT_OFF (Feat_Label)
} else if (name == QString::fromLatin1("nocontrols")) { } else if (name == TQString::tqfromLatin1("nocontrols")) {
SET_FEAT_OFF (Feat_Controls | Feat_VolumeSlider) SET_FEAT_OFF (Feat_Controls | Feat_VolumeSlider)
} else if (name == QString::fromLatin1("showdisplay")) { } else if (name == TQString::tqfromLatin1("showdisplay")) {
// the author name, the clip name, and the copyright information // the author name, the clip name, and the copyright information
if (getBoolValue (value)) if (getBoolValue (value))
SET_FEAT_ON (Feat_InfoPanel) SET_FEAT_ON (Feat_InfoPanel)
else else
SET_FEAT_OFF (Feat_InfoPanel) SET_FEAT_OFF (Feat_InfoPanel)
} else if (name == QString::fromLatin1("showcontrols")) { } else if (name == TQString::tqfromLatin1("showcontrols")) {
if (getBoolValue (value)) if (getBoolValue (value))
SET_FEAT_ON (Feat_Viewer | Feat_Controls) SET_FEAT_ON (Feat_Viewer | Feat_Controls)
else else
SET_FEAT_OFF (Feat_Controls | Feat_VolumeSlider) SET_FEAT_OFF (Feat_Controls | Feat_VolumeSlider)
} else if (name == QString::fromLatin1("showstatusbar")) { } else if (name == TQString::tqfromLatin1("showstatusbar")) {
if (getBoolValue (value)) if (getBoolValue (value))
SET_FEAT_ON (Feat_Viewer | Feat_StatusBar) SET_FEAT_ON (Feat_Viewer | Feat_StatusBar)
else else
SET_FEAT_OFF (Feat_StatusBar) SET_FEAT_OFF (Feat_StatusBar)
// else showcaptioning/showgotobar/showpositioncontrols/showtracker // else showcaptioning/showgotobar/showpositioncontrols/showtracker
} else if (name == QString::fromLatin1("console")) { } else if (name == TQString::tqfromLatin1("console")) {
m_group = value.isEmpty() ? QString::fromLatin1("_anonymous") : value; m_group = value.isEmpty() ? TQString::tqfromLatin1("_anonymous") : value;
} else if (name == QString::fromLatin1("__khtml__pluginbaseurl")) { } else if (name == TQString::tqfromLatin1("__khtml__pluginbaseurl")) {
m_docbase = KURL (value); m_docbase = KURL (value);
} else if (name == QString::fromLatin1("src")) { } else if (name == TQString::tqfromLatin1("src")) {
m_src_url = value; m_src_url = value;
} else if (name == QString::fromLatin1("filename")) { } else if (name == TQString::tqfromLatin1("filename")) {
m_file_name = value; m_file_name = value;
} else if (name == QString::fromLatin1 ("fullscreenmode")) { } else if (name == TQString::tqfromLatin1 ("fullscreenmode")) {
show_fullscreen = getBoolValue (value); show_fullscreen = getBoolValue (value);
} else if (name == QString::fromLatin1 ("autostart")) { } else if (name == TQString::tqfromLatin1 ("autostart")) {
urlsource->setAutoPlay (getBoolValue (value)); urlsource->setAutoPlay (getBoolValue (value));
} }
// volume/clicktoplay/transparentatstart/animationatstart // volume/clicktoplay/transparentatstart/animationatstart
// autorewind/displaysize/border // autorewind/displaysize/border
if (name.startsWith (QString::fromLatin1 ("__khtml__"))) if (name.startsWith (TQString::tqfromLatin1 ("__khtml__")))
name = name.mid (9); name = name.mid (9);
convertNode <KMPlayer::Element> (urlsource->document ())->setAttribute (name, value); convertNode <KMPlayer::Element> (urlsource->document ())->setAttribute (name, value);
} }
@ -311,11 +311,11 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
//KParts::Part::setWidget (m_view); //KParts::Part::setWidget (m_view);
setXMLFile("kmplayerpartui.rc"); setXMLFile("kmplayerpartui.rc");
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom50, panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom50,
this, SLOT (setMenuZoom (int))); this, TQT_SLOT (setMenuZoom (int)));
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom100, panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom100,
this, SLOT (setMenuZoom (int))); this, TQT_SLOT (setMenuZoom (int)));
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom150, panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom150,
this, SLOT (setMenuZoom (int))); this, TQT_SLOT (setMenuZoom (int)));
m_view->setNoInfoMessages (m_features != Feat_InfoPanel); m_view->setNoInfoMessages (m_features != Feat_InfoPanel);
if (m_features == Feat_InfoPanel) if (m_features == Feat_InfoPanel)
@ -332,7 +332,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
else else
m_view->setControlPanelMode (KMPlayer::View::CP_AutoHide); m_view->setControlPanelMode (KMPlayer::View::CP_AutoHide);
} }
bool group_member = !m_group.isEmpty () && m_group != QString::fromLatin1("_unique") && m_features != Feat_Unknown; bool group_member = !m_group.isEmpty () && m_group != TQString::tqfromLatin1("_unique") && m_features != Feat_Unknown;
if (!group_member || m_features & Feat_Viewer) { if (!group_member || m_features & Feat_Viewer) {
// not part of a group or we're the viewer // not part of a group or we're the viewer
setProcess ("mplayer"); setProcess ("mplayer");
@ -340,9 +340,9 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
connectPanel (m_view->controlPanel ()); connectPanel (m_view->controlPanel ());
if (m_features & Feat_StatusBar) { if (m_features & Feat_StatusBar) {
last_time_left = 0; last_time_left = 0;
connect (this, SIGNAL (positioned (int, int)), connect (this, TQT_SIGNAL (positioned (int, int)),
this, SLOT (statusPosition (int, int))); this, TQT_SLOT (statusPosition (int, int)));
m_view->statusBar ()->insertItem (QString ("--:--"), 1, 0, true); m_view->statusBar ()->insertItem (TQString ("--:--"), 1, 0, true);
} }
} }
if (group_member) { if (group_member) {
@ -362,7 +362,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
m_group.truncate (0); m_group.truncate (0);
kmplayerpart_static->partlist.push_back (this); kmplayerpart_static->partlist.push_back (this);
QWidget *pwidget = view ()->parentWidget (); TQWidget *pwidget = view ()->tqparentWidget ();
if (pwidget) { if (pwidget) {
m_view->viewArea()->setPaletteBackgroundColor(pwidget->paletteBackgroundColor ()); m_view->viewArea()->setPaletteBackgroundColor(pwidget->paletteBackgroundColor ());
m_view->viewer()->setBackgroundColor(pwidget->paletteBackgroundColor()); m_view->viewer()->setBackgroundColor(pwidget->paletteBackgroundColor());
@ -397,7 +397,7 @@ KDE_NO_EXPORT void KMPlayerPart::setAutoControls (bool b) {
m_view->controlPanel ()->setAutoControls (b); m_view->controlPanel ()->setAutoControls (b);
} }
KDE_NO_EXPORT void KMPlayerPart::viewerPartDestroyed (QObject * o) { KDE_NO_EXPORT void KMPlayerPart::viewerPartDestroyed (TQObject * o) {
if (o == m_master) if (o == m_master)
m_master = 0L; m_master = 0L;
kdDebug () << "KMPlayerPart(" << this << ")::viewerPartDestroyed" << endl; kdDebug () << "KMPlayerPart(" << this << ")::viewerPartDestroyed" << endl;
@ -434,16 +434,16 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
url = KURL (m_docbase, m_file_name); // fix misdetected SRC attr url = KURL (m_docbase, m_file_name); // fix misdetected SRC attr
else if (_url != m_docbase) { else if (_url != m_docbase) {
url = _url; url = _url;
if (!m_file_name.isEmpty () && _url.url ().find (m_file_name) < 0) { if (!m_file_name.isEmpty () && _url.url ().tqfind (m_file_name) < 0) {
KURL u (m_file_name); KURL u (m_file_name);
if ((u.protocol () == QString ("mms")) || if ((u.protocol () == TQString ("mms")) ||
_url.protocol ().isEmpty ()) { _url.protocol ().isEmpty ()) {
// see if we somehow have to merge these // see if we somehow have to merge these
int p = _url.port (); int p = _url.port ();
if (p > 0) if (p > 0)
u.setPort (p); u.setPort (p);
if (u.path ().isEmpty ()) if (u.path ().isEmpty ())
u.setPath (QChar ('/') + _url.host ()); u.setPath (TQChar ('/') + _url.host ());
if (allowRedir (u)) { if (allowRedir (u)) {
url = u; url = u;
kdDebug () << "KMPlayerPart::openURL compose " << m_file_name << " " << _url.url() << " ->" << u.url() << endl; kdDebug () << "KMPlayerPart::openURL compose " << m_file_name << " " << _url.url() << " ->" << u.url() << endl;
@ -469,7 +469,7 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
if (url.isEmpty ()) { if (url.isEmpty ()) {
if (!m_master && !(m_features & Feat_Viewer)) if (!m_master && !(m_features & Feat_Viewer))
// no master set, wait for a viewer to attach or timeout // no master set, wait for a viewer to attach or timeout
QTimer::singleShot (50, this, SLOT (waitForImageWindowTimeOut ())); TQTimer::singleShot (50, this, TQT_SLOT (waitForImageWindowTimeOut ()));
return true; return true;
} }
if (!m_group.isEmpty () && !(m_features & Feat_Viewer)) { if (!m_group.isEmpty () && !(m_features & Feat_Viewer)) {
@ -479,7 +479,7 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
i = std::find_if (++i, e, pred)) i = std::find_if (++i, e, pred))
if ((*i)->url ().isEmpty ()) // image window created w/o url if ((*i)->url ().isEmpty ()) // image window created w/o url
return (*i)->openURL (_url); return (*i)->openURL (_url);
QTimer::singleShot (50, this, SLOT (waitForImageWindowTimeOut ())); TQTimer::singleShot (50, this, TQT_SLOT (waitForImageWindowTimeOut ()));
//kdError () << "Not the ImageWindow and no ImageWindow found" << endl; //kdError () << "Not the ImageWindow and no ImageWindow found" << endl;
return true; return true;
} }
@ -549,17 +549,17 @@ KDE_NO_EXPORT void KMPlayerPart::connectToPart (KMPlayerPart * m) {
if (m_features & Feat_InfoPanel) if (m_features & Feat_InfoPanel)
m->connectInfoPanel (m_view->infoPanel ()); m->connectInfoPanel (m_view->infoPanel ());
connectSource (m_source, m->source ()); connectSource (m_source, m->source ());
connect (m, SIGNAL (destroyed (QObject *)), connect (m, TQT_SIGNAL (destroyed (TQObject *)),
this, SLOT (viewerPartDestroyed (QObject *))); this, TQT_SLOT (viewerPartDestroyed (TQObject *)));
connect (m, SIGNAL (processChanged (const char *)), connect (m, TQT_SIGNAL (processChanged (const char *)),
this, SLOT (viewerPartProcessChanged (const char *))); this, TQT_SLOT (viewerPartProcessChanged (const char *)));
connect (m, SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)), connect (m, TQT_SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)),
this, SLOT (viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *))); this, TQT_SLOT (viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *)));
if (m_features & Feat_StatusBar) { if (m_features & Feat_StatusBar) {
last_time_left = 0; last_time_left = 0;
connect (m, SIGNAL (positioned (int, int)), connect (m, TQT_SIGNAL (positioned (int, int)),
this, SLOT (statusPosition (int, int))); this, TQT_SLOT (statusPosition (int, int)));
m_view->statusBar ()->insertItem (QString ("--:--"), 1, 0, true); m_view->statusBar ()->insertItem (TQString ("--:--"), 1, 0, true);
} }
} }
@ -568,7 +568,7 @@ KDE_NO_EXPORT void KMPlayerPart::setLoaded (int percentage) {
if (percentage < 100) { if (percentage < 100) {
m_browserextension->setLoadingProgress (percentage); m_browserextension->setLoadingProgress (percentage);
m_browserextension->infoMessage m_browserextension->infoMessage
(QString::number (percentage) + i18n ("% Cache fill")); (TQString::number (percentage) + i18n ("% Cache fill"));
} }
} }
@ -631,7 +631,7 @@ KDE_NO_EXPORT void KMPlayerPart::statusPosition (int pos, int length) {
int left = (length - pos) / 10; int left = (length - pos) / 10;
if (left != last_time_left) { if (left != last_time_left) {
last_time_left = left; last_time_left = left;
QString text ("--:--"); TQString text ("--:--");
if (left > 0) { if (left > 0) {
int h = left / 3600; int h = left / 3600;
int m = (left % 3600) / 60; int m = (left % 3600) / 60;
@ -647,11 +647,11 @@ KDE_NO_EXPORT void KMPlayerPart::statusPosition (int pos, int length) {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerBrowserExtension::KMPlayerBrowserExtension (KMPlayerPart * parent) KDE_NO_CDTOR_EXPORT KMPlayerBrowserExtension::KMPlayerBrowserExtension (KMPlayerPart * tqparent)
: KParts::BrowserExtension (parent, "KMPlayer Browser Extension") { : KParts::BrowserExtension (tqparent, "KMPlayer Browser Extension") {
} }
KDE_NO_EXPORT void KMPlayerBrowserExtension::urlChanged (const QString & url) { KDE_NO_EXPORT void KMPlayerBrowserExtension::urlChanged (const TQString & url) {
emit setLocationBarURL (url); emit setLocationBarURL (url);
} }
@ -659,25 +659,25 @@ KDE_NO_EXPORT void KMPlayerBrowserExtension::setLoadingProgress (int percentage)
emit loadingProgress (percentage); emit loadingProgress (percentage);
} }
KDE_NO_EXPORT void KMPlayerBrowserExtension::saveState (QDataStream & stream) { KDE_NO_EXPORT void KMPlayerBrowserExtension::saveState (TQDataStream & stream) {
stream << static_cast <PartBase *> (parent ())->url ().url (); stream << static_cast <PartBase *> (tqparent ())->url ().url ();
} }
KDE_NO_EXPORT void KMPlayerBrowserExtension::restoreState (QDataStream & stream) { KDE_NO_EXPORT void KMPlayerBrowserExtension::restoreState (TQDataStream & stream) {
QString url; TQString url;
stream >> url; stream >> url;
static_cast <PartBase *> (parent ())->openURL (KURL(url)); static_cast <PartBase *> (tqparent ())->openURL (KURL(url));
} }
KDE_NO_EXPORT void KMPlayerBrowserExtension::requestOpenURL (const KURL & url, const QString & target, const QString & service) { KDE_NO_EXPORT void KMPlayerBrowserExtension::requestOpenURL (const KURL & url, const TQString & target, const TQString & service) {
KParts::URLArgs args; KParts::URLArgs args;
args.frameName = target; args.frameName = target;
args.serviceType = service; args.serviceType = service;
emit openURLRequest (url, args); emit openURLRequest (url, args);
} }
KDE_NO_EXPORT void KMPlayerBrowserExtension::slotRequestOpenURL (const KURL &url, const QString &target) { KDE_NO_EXPORT void KMPlayerBrowserExtension::slotRequestOpenURL (const KURL &url, const TQString &target) {
requestOpenURL (url, target, QString ()); requestOpenURL (url, target, TQString ());
} }
//--------------------------------------------------------------------- //---------------------------------------------------------------------
@ -746,14 +746,14 @@ static const JSCommandEntry JSCommandList [] = {
{ "GetEntryCopyright", notsupported, "(c)", KParts::LiveConnectExtension::TypeString }, { "GetEntryCopyright", notsupported, "(c)", KParts::LiveConnectExtension::TypeString },
{ "GetEntryTitle", notsupported, "title", KParts::LiveConnectExtension::TypeString }, { "GetEntryTitle", notsupported, "title", KParts::LiveConnectExtension::TypeString },
{ "GetFullScreen", isfullscreen, 0L, KParts::LiveConnectExtension::TypeBool }, { "GetFullScreen", isfullscreen, 0L, KParts::LiveConnectExtension::TypeBool },
{ "GetImageStatus", notsupported, "false", KParts::LiveConnectExtension::TypeBool }, { "GetImagetqStatus", notsupported, "false", KParts::LiveConnectExtension::TypeBool },
{ "GetLastErrorMoreInfoURL", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, { "GetLastErrorMoreInfoURL", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLastErrorRMACode", notsupported, "0", KParts::LiveConnectExtension::TypeNumber }, { "GetLastErrorRMACode", notsupported, "0", KParts::LiveConnectExtension::TypeNumber },
{ "GetLastErrorSeverity", notsupported, "6", KParts::LiveConnectExtension::TypeNumber }, { "GetLastErrorSeverity", notsupported, "6", KParts::LiveConnectExtension::TypeNumber },
{ "GetLastErrorUserCode", notsupported, "0", KParts::LiveConnectExtension::TypeNumber }, { "GetLastErrorUserCode", notsupported, "0", KParts::LiveConnectExtension::TypeNumber },
{ "GetLastErrorUserString", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, { "GetLastErrorUserString", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLastMessage", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, { "GetLastMessage", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLastStatus", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, { "GetLasttqStatus", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLength", length, 0L, KParts::LiveConnectExtension::TypeNumber }, { "GetLength", length, 0L, KParts::LiveConnectExtension::TypeNumber },
{ "GetLiveState", notsupported, "false", KParts::LiveConnectExtension::TypeBool }, { "GetLiveState", notsupported, "false", KParts::LiveConnectExtension::TypeBool },
{ "GetLoop", isloop, 0L, KParts::LiveConnectExtension::TypeBool }, { "GetLoop", isloop, 0L, KParts::LiveConnectExtension::TypeBool },
@ -802,7 +802,7 @@ static const JSCommandEntry JSCommandList [] = {
{ "SetDoubleSize", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetDoubleSize", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetFileName", setsource, 0L, KParts::LiveConnectExtension::TypeBool }, { "SetFileName", setsource, 0L, KParts::LiveConnectExtension::TypeBool },
{ "SetFullScreen", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetFullScreen", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetImageStatus", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetImagetqStatus", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetLoop", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetLoop", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetMaintainAspect", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetMaintainAspect", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetMute", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetMute", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
@ -847,13 +847,13 @@ static const JSCommandEntry * getJSCommandEntry (const char * name, int start =
return &JSCommandList[mid]; return &JSCommandList[mid];
} }
KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::KMPlayerLiveConnectExtension (KMPlayerPart * parent) KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::KMPlayerLiveConnectExtension (KMPlayerPart * tqparent)
: KParts::LiveConnectExtension (parent), player (parent), : KParts::LiveConnectExtension (tqparent), player (tqparent),
lastJSCommandEntry (0L), lastJSCommandEntry (0L),
m_started (false), m_started (false),
m_enablefinish (false), m_enablefinish (false),
m_evaluating (false) { m_evaluating (false) {
connect (parent, SIGNAL (started (KIO::Job *)), this, SLOT (started ())); connect (tqparent, TQT_SIGNAL (started (KIO::Job *)), this, TQT_SLOT (started ()));
} }
KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::~KMPlayerLiveConnectExtension() { KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::~KMPlayerLiveConnectExtension() {
@ -867,7 +867,7 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::started () {
KDE_NO_EXPORT void KMPlayerLiveConnectExtension::finished () { KDE_NO_EXPORT void KMPlayerLiveConnectExtension::finished () {
if (m_started && m_enablefinish) { if (m_started && m_enablefinish) {
KParts::LiveConnectExtension::ArgList args; KParts::LiveConnectExtension::ArgList args;
args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, QString("if (window.onFinished) onFinished();"))); args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, TQString("if (window.onFinished) onFinished();")));
emit partEvent (0, "eval", args); emit partEvent (0, "eval", args);
m_started = true; m_started = true;
m_enablefinish = false; m_enablefinish = false;
@ -875,14 +875,14 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::finished () {
} }
KDE_NO_EXPORT void KMPlayerLiveConnectExtension::evaluate ( KDE_NO_EXPORT void KMPlayerLiveConnectExtension::evaluate (
const QString & scr, QString & result) { const TQString & scr, TQString & result) {
QString script (scr); TQString script (scr);
KParts::LiveConnectExtension::ArgList args; KParts::LiveConnectExtension::ArgList args;
script = script.replace ('\\', "\\\\"); script = script.tqreplace ('\\', "\\\\");
script = script.replace ('\n', "\\n"); script = script.tqreplace ('\n', "\\n");
script = script.replace ('\r', ""); script = script.tqreplace ('\r', "");
script = script.replace ('"', "\\\""); script = script.tqreplace ('"', "\\\"");
script = QString ("this.__kmplayer__res=eval(\"%1\")").arg (script); script = TQString ("this.__kmplayer__res=eval(\"%1\")").arg (script);
args.push_back(qMakePair(KParts::LiveConnectExtension::TypeString, script)); args.push_back(qMakePair(KParts::LiveConnectExtension::TypeString, script));
script_result = "undefined"; script_result = "undefined";
@ -893,9 +893,9 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::evaluate (
} }
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get
(const unsigned long id, const QString & name, (const unsigned long id, const TQString & name,
KParts::LiveConnectExtension::Type & type, KParts::LiveConnectExtension::Type & type,
unsigned long & rid, QString & rval) unsigned long & rid, TQString & rval)
{ {
if (name.startsWith ("__kmplayer__obj_")) { if (name.startsWith ("__kmplayer__obj_")) {
if (m_evaluating) if (m_evaluating)
@ -919,11 +919,11 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get
break; break;
case prop_volume: case prop_volume:
if (player->view ()) if (player->view ())
rval = QString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value()); rval = TQString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value());
break; break;
case prop_error: case prop_error:
type = KParts::LiveConnectExtension::TypeNumber; type = KParts::LiveConnectExtension::TypeNumber;
rval = QString::number (0); rval = TQString::number (0);
break; break;
default: default:
lastJSCommandEntry = entry; lastJSCommandEntry = entry;
@ -933,7 +933,7 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get
} }
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::put KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::put
(const unsigned long, const QString & name, const QString & val) { (const unsigned long, const TQString & name, const TQString & val) {
if (name == "__kmplayer__res") { if (name == "__kmplayer__res") {
script_result = val; script_result = val;
return true; return true;
@ -964,9 +964,9 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::put
} }
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call
(const unsigned long id, const QString & name, (const unsigned long id, const TQString & name,
const QStringList & args, KParts::LiveConnectExtension::Type & type, const TQStringList & args, KParts::LiveConnectExtension::Type & type,
unsigned long & rid, QString & rval) { unsigned long & rid, TQString & rval) {
const JSCommandEntry * entry = lastJSCommandEntry; const JSCommandEntry * entry = lastJSCommandEntry;
const char * str = name.ascii (); const char * str = name.ascii ();
if (!entry || strcmp (entry->name, str)) if (!entry || strcmp (entry->name, str))
@ -1017,8 +1017,8 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call
break; break;
case showcontrolpanel: case showcontrolpanel:
if (args.size () && if (args.size () &&
(args.first () == QString::fromLatin1 ("0") || (args.first () == TQString::tqfromLatin1 ("0") ||
args.first () == QString::fromLatin1 ("false"))) args.first () == TQString::tqfromLatin1 ("false")))
static_cast <KMPlayer::View*> (player->view ())->setControlPanelMode (KMPlayer::View::CP_Hide); static_cast <KMPlayer::View*> (player->view ())->setControlPanelMode (KMPlayer::View::CP_Hide);
else else
static_cast <KMPlayer::View*> (player->view ())->setControlPanelMode (KMPlayer::View::CP_Show); static_cast <KMPlayer::View*> (player->view ())->setControlPanelMode (KMPlayer::View::CP_Show);
@ -1073,7 +1073,7 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call
break; break;
case volume: case volume:
if (player->view ()) if (player->view ())
rval = QString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value()); rval = TQString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value());
break; break;
default: default:
return false; return false;
@ -1088,7 +1088,7 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::setSize (int w, int h) {
KMPlayer::View * view = static_cast <KMPlayer::View*> (player->view ()); KMPlayer::View * view = static_cast <KMPlayer::View*> (player->view ());
if (view->controlPanelMode () == KMPlayer::View::CP_Show) if (view->controlPanelMode () == KMPlayer::View::CP_Show)
h += view->controlPanel()->height(); h += view->controlPanel()->height();
QString jscode; TQString jscode;
jscode.sprintf("try { eval(\"this.setAttribute('WIDTH',%d);this.setAttribute('HEIGHT',%d)\"); } catch(e){}", w, h); jscode.sprintf("try { eval(\"this.setAttribute('WIDTH',%d);this.setAttribute('HEIGHT',%d)\"); } catch(e){}", w, h);
KParts::LiveConnectExtension::ArgList args; KParts::LiveConnectExtension::ArgList args;
args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, jscode)); args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, jscode));
@ -1115,7 +1115,7 @@ KDE_NO_EXPORT bool KMPlayerHRefSource::hasLength () {
return false; return false;
} }
KDE_NO_EXPORT bool KMPlayerHRefSource::processOutput (const QString & /*str*/) { KDE_NO_EXPORT bool KMPlayerHRefSource::processOutput (const TQString & /*str*/) {
//return Source::processOutput (str); //return Source::processOutput (str);
return true; return true;
} }
@ -1131,7 +1131,7 @@ KDE_NO_EXPORT void KMPlayerHRefSource::setURL (const KURL & url) {
KDE_NO_EXPORT void KMPlayerHRefSource::play () { KDE_NO_EXPORT void KMPlayerHRefSource::play () {
kdDebug () << "KMPlayerHRefSource::play " << m_url.url() << endl; kdDebug () << "KMPlayerHRefSource::play " << m_url.url() << endl;
Source * src = m_player->sources () ["urlsource"]; Source * src = m_player->sources () ["urlsource"];
QString target = src->document ()->document ()-> TQString target = src->document ()->document ()->
getAttribute (StringPool::attr_target); getAttribute (StringPool::attr_target);
if (!target.isEmpty ()) { if (!target.isEmpty ()) {
KMPlayer::Mrl * mrl = src->document ()->mrl (); KMPlayer::Mrl * mrl = src->document ()->mrl ();
@ -1143,17 +1143,17 @@ KDE_NO_EXPORT void KMPlayerHRefSource::play () {
KDE_NO_EXPORT void KMPlayerHRefSource::activate () { KDE_NO_EXPORT void KMPlayerHRefSource::activate () {
m_player->stop (); m_player->stop ();
if (m_finished) { if (m_finished) {
QTimer::singleShot (0, this, SLOT (finished ())); TQTimer::singleShot (0, this, TQT_SLOT (finished ()));
return; return;
} }
init (); init ();
m_player->setProcess ("mplayer"); m_player->setProcess ("mplayer");
if (m_player->process ()->grabPicture (m_url, 0)) if (m_player->process ()->grabPicture (m_url, 0))
connect (m_player->process (), SIGNAL (grabReady (const QString &)), connect (m_player->process (), TQT_SIGNAL (grabReady (const TQString &)),
this, SLOT (grabReady (const QString &))); this, TQT_SLOT (grabReady (const TQString &)));
else { else {
setURL (KURL ()); setURL (KURL ());
QTimer::singleShot (0, this, SLOT (play ())); TQTimer::singleShot (0, this, TQT_SLOT (play ()));
} }
} }
@ -1161,7 +1161,7 @@ KDE_NO_EXPORT void KMPlayerHRefSource::clear () {
setURL (KURL ()); setURL (KURL ());
} }
KDE_NO_EXPORT void KMPlayerHRefSource::grabReady (const QString & path) { KDE_NO_EXPORT void KMPlayerHRefSource::grabReady (const TQString & path) {
kdDebug () << "KMPlayerHRefSource::grabReady(" << path << ")" << endl; kdDebug () << "KMPlayerHRefSource::grabReady(" << path << ")" << endl;
m_finished = true; m_finished = true;
m_grabfile = path; m_grabfile = path;
@ -1174,23 +1174,23 @@ KDE_NO_EXPORT void KMPlayerHRefSource::finished () {
if (!view) return; if (!view) return;
if (!view->setPicture (m_grabfile)) { if (!view->setPicture (m_grabfile)) {
clear (); clear ();
QTimer::singleShot (0, this, SLOT (play ())); TQTimer::singleShot (0, this, TQT_SLOT (play ()));
return; return;
} }
if (view->viewer ()) if (view->viewer ())
connect (view, SIGNAL (pictureClicked ()), this, SLOT (play ())); connect (view, TQT_SIGNAL (pictureClicked ()), this, TQT_SLOT (play ()));
} }
KDE_NO_EXPORT void KMPlayerHRefSource::deactivate () { KDE_NO_EXPORT void KMPlayerHRefSource::deactivate () {
kdDebug () << "KMPlayerHRefSource::deactivate()" << endl; kdDebug () << "KMPlayerHRefSource::deactivate()" << endl;
KMPlayer::View * view = static_cast <KMPlayer::View*> (m_player->view ()); KMPlayer::View * view = static_cast <KMPlayer::View*> (m_player->view ());
if (!view) return; if (!view) return;
view->setPicture (QString ()); view->setPicture (TQString ());
if (view->viewer ()) if (view->viewer ())
disconnect (view, SIGNAL (pictureClicked ()), this, SLOT (play ())); disconnect (view, TQT_SIGNAL (pictureClicked ()), this, TQT_SLOT (play ()));
} }
KDE_NO_EXPORT QString KMPlayerHRefSource::prettyName () { KDE_NO_EXPORT TQString KMPlayerHRefSource::prettyName () {
return i18n ("WEB"); return i18n ("WEB");
} }

@ -34,25 +34,26 @@ class JSCommandEntry;
*/ */
class KMPLAYER_NO_EXPORT KMPlayerHRefSource : public KMPlayer::Source { class KMPLAYER_NO_EXPORT KMPlayerHRefSource : public KMPlayer::Source {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerHRefSource (KMPlayer::PartBase * player); KMPlayerHRefSource (KMPlayer::PartBase * player);
virtual ~KMPlayerHRefSource (); virtual ~KMPlayerHRefSource ();
virtual bool processOutput (const QString & line); virtual bool processOutput (const TQString & line);
virtual bool hasLength (); virtual bool hasLength ();
void setURL (const KURL &); void setURL (const KURL &);
void clear (); void clear ();
virtual QString prettyName (); virtual TQString prettyName ();
public slots: public slots:
virtual void init (); virtual void init ();
virtual void activate (); virtual void activate ();
virtual void deactivate (); virtual void deactivate ();
void finished (); void finished ();
private slots: private slots:
void grabReady (const QString & path); void grabReady (const TQString & path);
void play (); void play ();
private: private:
QString m_grabfile; TQString m_grabfile;
bool m_finished; bool m_finished;
}; };
@ -62,17 +63,18 @@ private:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerBrowserExtension : public KParts::BrowserExtension { class KMPLAYER_NO_EXPORT KMPlayerBrowserExtension : public KParts::BrowserExtension {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerBrowserExtension(KMPlayerPart *parent); KMPlayerBrowserExtension(KMPlayerPart *tqparent);
KDE_NO_CDTOR_EXPORT ~KMPlayerBrowserExtension () {} KDE_NO_CDTOR_EXPORT ~KMPlayerBrowserExtension () {}
void urlChanged (const QString & url); void urlChanged (const TQString & url);
void setLoadingProgress (int percentage); void setLoadingProgress (int percentage);
void saveState (QDataStream & stream); void saveState (TQDataStream & stream);
void restoreState (QDataStream & stream); void restoreState (TQDataStream & stream);
void requestOpenURL (const KURL & url, const QString & target, const QString & service); void requestOpenURL (const KURL & url, const TQString & target, const TQString & service);
public slots: public slots:
void slotRequestOpenURL (const KURL & url, const QString & target); void slotRequestOpenURL (const KURL & url, const TQString & target);
}; };
/* /*
@ -80,34 +82,35 @@ public slots:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerLiveConnectExtension : public KParts::LiveConnectExtension { class KMPLAYER_NO_EXPORT KMPlayerLiveConnectExtension : public KParts::LiveConnectExtension {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerLiveConnectExtension (KMPlayerPart * parent); KMPlayerLiveConnectExtension (KMPlayerPart * tqparent);
~KMPlayerLiveConnectExtension (); ~KMPlayerLiveConnectExtension ();
// LiveConnect interface // LiveConnect interface
bool get (const unsigned long, const QString &, bool get (const unsigned long, const TQString &,
KParts::LiveConnectExtension::Type &, unsigned long &, QString &); KParts::LiveConnectExtension::Type &, unsigned long &, TQString &);
bool put (const unsigned long, const QString &, const QString &); bool put (const unsigned long, const TQString &, const TQString &);
bool call (const unsigned long, const QString &, bool call (const unsigned long, const TQString &,
const QStringList &, KParts::LiveConnectExtension::Type &, const TQStringList &, KParts::LiveConnectExtension::Type &,
unsigned long &, QString &); unsigned long &, TQString &);
void unregister (const unsigned long); void unregister (const unsigned long);
void sendEvent(const unsigned long objid, const QString & event, const KParts::LiveConnectExtension::ArgList & args ) { void sendEvent(const unsigned long objid, const TQString & event, const KParts::LiveConnectExtension::ArgList & args ) {
emit partEvent(objid, event, args); emit partEvent(objid, event, args);
} }
void enableFinishEvent (bool b = true) { m_enablefinish = b; } void enableFinishEvent (bool b = true) { m_enablefinish = b; }
signals: signals:
void partEvent (const unsigned long, const QString &, void partEvent (const unsigned long, const TQString &,
const KParts::LiveConnectExtension::ArgList &); const KParts::LiveConnectExtension::ArgList &);
public slots: public slots:
void setSize (int w, int h); void setSize (int w, int h);
void started (); void started ();
void finished (); void finished ();
void evaluate (const QString & script, QString & result); void evaluate (const TQString & script, TQString & result);
private: private:
KMPlayerPart * player; KMPlayerPart * player;
QString script_result; TQString script_result;
const JSCommandEntry * lastJSCommandEntry; const JSCommandEntry * lastJSCommandEntry;
bool m_started; bool m_started;
bool m_enablefinish; bool m_enablefinish;
@ -120,6 +123,7 @@ private:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerPart : public KMPlayer::PartBase { class KMPLAYER_NO_EXPORT KMPlayerPart : public KMPlayer::PartBase {
Q_OBJECT Q_OBJECT
TQ_OBJECT
friend struct GroupPredicate; friend struct GroupPredicate;
public: public:
enum Features { enum Features {
@ -129,8 +133,8 @@ public:
Feat_InfoPanel = 0x10, Feat_VolumeSlider = 0x20, Feat_PlayList = 0x40, Feat_InfoPanel = 0x10, Feat_VolumeSlider = 0x20, Feat_PlayList = 0x40,
Feat_ImageWindow = 0x80, Feat_All = 0xff Feat_ImageWindow = 0x80, Feat_All = 0xff
}; };
KMPlayerPart (QWidget * wparent, const char * wname, KMPlayerPart (TQWidget * wtqparent, const char * wname,
QObject * parent, const char * name, const QStringList &args); TQObject * tqparent, const char * name, const TQStringList &args);
~KMPlayerPart (); ~KMPlayerPart ();
KDE_NO_EXPORT KMPlayerBrowserExtension * browserextension() const KDE_NO_EXPORT KMPlayerBrowserExtension * browserextension() const
@ -151,7 +155,7 @@ public slots:
protected slots: protected slots:
virtual void playingStarted (); virtual void playingStarted ();
virtual void playingStopped (); virtual void playingStopped ();
void viewerPartDestroyed (QObject *); void viewerPartDestroyed (TQObject *);
void viewerPartProcessChanged (const char *); void viewerPartProcessChanged (const char *);
void viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *); void viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *);
void waitForImageWindowTimeOut (); void waitForImageWindowTimeOut ();
@ -161,10 +165,10 @@ private:
KMPlayerPart * m_master; KMPlayerPart * m_master;
KMPlayerBrowserExtension * m_browserextension; KMPlayerBrowserExtension * m_browserextension;
KMPlayerLiveConnectExtension * m_liveconnectextension; KMPlayerLiveConnectExtension * m_liveconnectextension;
QString m_group; TQString m_group;
KURL m_docbase; KURL m_docbase;
QString m_src_url; TQString m_src_url;
QString m_file_name; TQString m_file_name;
int m_features; int m_features;
int last_time_left; int last_time_left;
bool m_started_emited : 1; bool m_started_emited : 1;

@ -18,9 +18,9 @@
#include <config.h> #include <config.h>
#include <qcolor.h> #include <tqcolor.h>
#include <qimage.h> #include <tqimage.h>
#include <qtimer.h> #include <tqtimer.h>
#include <kdebug.h> #include <kdebug.h>
@ -162,7 +162,7 @@ KDE_NO_EXPORT Surface *RP::Imfl::surface () {
return rp_surface.ptr (); return rp_surface.ptr ();
} }
KDE_NO_EXPORT NodePtr RP::Imfl::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr RP::Imfl::childFromTag (const TQString & tag) {
const char * ctag = tag.latin1 (); const char * ctag = tag.latin1 ();
if (!strcmp (ctag, "head")) if (!strcmp (ctag, "head"))
return new DarkNode (m_doc, "head", RP::id_node_head); return new DarkNode (m_doc, "head", RP::id_node_head);
@ -183,11 +183,11 @@ KDE_NO_EXPORT NodePtr RP::Imfl::childFromTag (const QString & tag) {
return 0L; return 0L;
} }
KDE_NO_EXPORT void RP::Imfl::repaint () { KDE_NO_EXPORT void RP::Imfl::tqrepaint () {
if (!active ()) if (!active ())
kdWarning () << "Spurious Imfl repaint" << endl; kdWarning () << "Spurious Imfl tqrepaint" << endl;
else if (surface () && width > 0 && height > 0) else if (surface () && width > 0 && height > 0)
rp_surface->repaint (SRect (0, 0, width, height)); rp_surface->tqrepaint (SRect (0, 0, width, height));
} }
KDE_NO_CDTOR_EXPORT RP::Image::Image (NodePtr & doc) KDE_NO_CDTOR_EXPORT RP::Image::Image (NodePtr & doc)
@ -219,7 +219,7 @@ KDE_NO_EXPORT void RP::Image::begin () {
} }
KDE_NO_EXPORT void RP::Image::deactivate () { KDE_NO_EXPORT void RP::Image::deactivate () {
cached_img.setUrl (QString ()); cached_img.setUrl (TQString ());
if (img_surface) { if (img_surface) {
img_surface->remove (); img_surface->remove ();
img_surface = NULL; img_surface = NULL;
@ -229,10 +229,10 @@ KDE_NO_EXPORT void RP::Image::deactivate () {
} }
KDE_NO_EXPORT void RP::Image::remoteReady (QByteArray & data) { KDE_NO_EXPORT void RP::Image::remoteReady (TQByteArray & data) {
kdDebug () << "RP::Image::remoteReady" << endl; kdDebug () << "RP::Image::remoteReady" << endl;
if (!data.isEmpty () && cached_img.isEmpty ()) { if (!data.isEmpty () && cached_img.isEmpty ()) {
QImage * img = new QImage (data); TQImage * img = new TQImage (data);
if (!img->isNull ()) { if (!img->isNull ()) {
cached_img.data->image = img; cached_img.data->image = img;
width = img->width (); width = img->width ();
@ -252,7 +252,7 @@ KDE_NO_EXPORT bool RP::Image::isReady (bool postpone_if_not) {
KDE_NO_EXPORT Surface *RP::Image::surface () { KDE_NO_EXPORT Surface *RP::Image::surface () {
if (!img_surface && !cached_img.isEmpty ()) { if (!img_surface && !cached_img.isEmpty ()) {
Node * p = parentNode ().ptr (); Node * p = tqparentNode ().ptr ();
if (p && p->id == RP::id_node_imfl) { if (p && p->id == RP::id_node_imfl) {
Surface *ps = static_cast <RP::Imfl *> (p)->surface (); Surface *ps = static_cast <RP::Imfl *> (p)->surface ();
if (ps) if (ps)
@ -272,7 +272,7 @@ KDE_NO_EXPORT void RP::TimingsBase::activate () {
srcx = srcy = srcw = srch = 0; srcx = srcy = srcw = srch = 0;
for (Attribute * a= attributes ()->first ().ptr (); a; a = a->nextSibling ().ptr ()) { for (Attribute * a= attributes ()->first ().ptr (); a; a = a->nextSibling ().ptr ()) {
if (a->name () == StringPool::attr_target) { if (a->name () == StringPool::attr_target) {
for (NodePtr n = parentNode()->firstChild(); n; n= n->nextSibling()) for (NodePtr n = tqparentNode()->firstChild(); n; n= n->nextSibling())
if (convertNode <Element> (n)-> if (convertNode <Element> (n)->
getAttribute ("handle") == a->value ()) getAttribute ("handle") == a->value ())
target = n; target = n;
@ -351,9 +351,9 @@ KDE_NO_EXPORT void RP::TimingsBase::begin () {
KDE_NO_EXPORT void RP::TimingsBase::update (int percentage) { KDE_NO_EXPORT void RP::TimingsBase::update (int percentage) {
progress = percentage; progress = percentage;
Node * p = parentNode ().ptr (); Node * p = tqparentNode ().ptr ();
if (p->id == RP::id_node_imfl) if (p->id == RP::id_node_imfl)
static_cast <RP::Imfl *> (p)->repaint (); static_cast <RP::Imfl *> (p)->tqrepaint ();
} }
KDE_NO_EXPORT void RP::TimingsBase::finish () { KDE_NO_EXPORT void RP::TimingsBase::finish () {
@ -416,7 +416,7 @@ KDE_NO_EXPORT void RP::Fadein::accept (Visitor * v) {
} }
KDE_NO_EXPORT void RP::Fadeout::activate () { KDE_NO_EXPORT void RP::Fadeout::activate () {
to_color = QColor (getAttribute ("color")).rgb (); to_color = TQColor (getAttribute ("color")).rgb ();
TimingsBase::activate (); TimingsBase::activate ();
} }
@ -430,7 +430,7 @@ KDE_NO_EXPORT void RP::Fadeout::accept (Visitor * v) {
} }
KDE_NO_EXPORT void RP::Fill::activate () { KDE_NO_EXPORT void RP::Fill::activate () {
color = QColor (getAttribute ("color")).rgb (); color = TQColor (getAttribute ("color")).rgb ();
TimingsBase::activate (); TimingsBase::activate ();
} }
@ -445,13 +445,13 @@ KDE_NO_EXPORT void RP::Fill::accept (Visitor * v) {
KDE_NO_EXPORT void RP::Wipe::activate () { KDE_NO_EXPORT void RP::Wipe::activate () {
//TODO implement 'type="push"' //TODO implement 'type="push"'
QString dir = getAttribute ("direction").lower (); TQString dir = getAttribute ("direction").lower ();
direction = dir_right; direction = dir_right;
if (dir == QString::fromLatin1 ("left")) if (dir == TQString::tqfromLatin1 ("left"))
direction = dir_left; direction = dir_left;
else if (dir == QString::fromLatin1 ("up")) else if (dir == TQString::tqfromLatin1 ("up"))
direction = dir_up; direction = dir_up;
else if (dir == QString::fromLatin1 ("down")) else if (dir == TQString::tqfromLatin1 ("down"))
direction = dir_down; direction = dir_down;
TimingsBase::activate (); TimingsBase::activate ();
} }
@ -479,14 +479,14 @@ KDE_NO_EXPORT void RP::ViewChange::activate () {
KDE_NO_EXPORT void RP::ViewChange::begin () { KDE_NO_EXPORT void RP::ViewChange::begin () {
kdDebug () << "RP::ViewChange::begin" << endl; kdDebug () << "RP::ViewChange::begin" << endl;
setState (state_began); setState (state_began);
Node * p = parentNode ().ptr (); Node * p = tqparentNode ().ptr ();
if (p->id == RP::id_node_imfl) if (p->id == RP::id_node_imfl)
static_cast <RP::Imfl *> (p)->needs_scene_img++; static_cast <RP::Imfl *> (p)->needs_scene_img++;
update (0); update (0);
} }
KDE_NO_EXPORT void RP::ViewChange::finish () { KDE_NO_EXPORT void RP::ViewChange::finish () {
Node * p = parentNode ().ptr (); Node * p = tqparentNode ().ptr ();
if (p && p->id == RP::id_node_imfl) if (p && p->id == RP::id_node_imfl)
static_cast <RP::Imfl *> (p)->needs_scene_img--; static_cast <RP::Imfl *> (p)->needs_scene_img--;
TimingsBase::finish (); TimingsBase::finish ();

@ -21,8 +21,8 @@
#ifndef _KMPLAYER_RP_H_ #ifndef _KMPLAYER_RP_H_
#define _KMPLAYER_RP_H_ #define _KMPLAYER_RP_H_
#include <qobject.h> #include <tqobject.h>
#include <qstring.h> #include <tqstring.h>
#include "kmplayerplaylist.h" #include "kmplayerplaylist.h"
#include "kmplayer_smil.h" #include "kmplayer_smil.h"
@ -54,7 +54,7 @@ public:
Imfl (NodePtr & d); Imfl (NodePtr & d);
~Imfl (); ~Imfl ();
KDE_NO_EXPORT virtual const char * nodeName () const { return "imfl"; } KDE_NO_EXPORT virtual const char * nodeName () const { return "imfl"; }
virtual NodePtr childFromTag (const QString & tag); virtual NodePtr childFromTag (const TQString & tag);
virtual void closed (); virtual void closed ();
virtual void defer (); // start loading the images if not yet done virtual void defer (); // start loading the images if not yet done
virtual void activate (); // start timings, handle paint events virtual void activate (); // start timings, handle paint events
@ -66,8 +66,8 @@ public:
virtual bool handleEvent (EventPtr event); virtual bool handleEvent (EventPtr event);
virtual void accept (Visitor *); virtual void accept (Visitor *);
Surface *surface (); Surface *surface ();
void repaint (); // called whenever something changes on image void tqrepaint (); // called whenever something changes on image
Fit fit; // how to layout images Fit fit; // how to tqlayout images
unsigned int duration; // cached attributes of head unsigned int duration; // cached attributes of head
TimerInfoPtrW duration_timer; TimerInfoPtrW duration_timer;
SurfacePtrW rp_surface; SurfacePtrW rp_surface;
@ -182,7 +182,7 @@ public:
CachedImage cached_img; CachedImage cached_img;
bool expose () const { return false; } bool expose () const { return false; }
protected: protected:
virtual void remoteReady (QByteArray & data); virtual void remoteReady (TQByteArray & data);
}; };
} // RP namespace } // RP namespace

@ -22,13 +22,13 @@
using namespace KMPlayer; using namespace KMPlayer;
KDE_NO_EXPORT NodePtr RSS::Rss::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr RSS::Rss::childFromTag (const TQString & tag) {
if (!strcmp (tag.latin1 (), "channel")) if (!strcmp (tag.latin1 (), "channel"))
return new RSS::Channel (m_doc); return new RSS::Channel (m_doc);
return 0L; return 0L;
} }
KDE_NO_EXPORT NodePtr RSS::Channel::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr RSS::Channel::childFromTag (const TQString & tag) {
const char *ctag = tag.ascii (); const char *ctag = tag.ascii ();
if (!strcmp (ctag, "item")) if (!strcmp (ctag, "item"))
return new RSS::Item (m_doc); return new RSS::Item (m_doc);
@ -50,7 +50,7 @@ KDE_NO_EXPORT bool RSS::Channel::expose () const {
previousSibling () || nextSibling (); previousSibling () || nextSibling ();
} }
KDE_NO_EXPORT NodePtr RSS::Item::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr RSS::Item::childFromTag (const TQString & tag) {
const char *ctag = tag.ascii (); const char *ctag = tag.ascii ();
if (!strcmp (ctag, "enclosure")) if (!strcmp (ctag, "enclosure"))
return new RSS::Enclosure (m_doc); return new RSS::Enclosure (m_doc);
@ -92,7 +92,7 @@ KDE_NO_EXPORT void RSS::Item::activate () {
if (n) { if (n) {
for (NodePtr c = firstChild (); c; c = c->nextSibling ()) for (NodePtr c = firstChild (); c; c = c->nextSibling ())
if (c->id == id_node_description) { if (c->id == id_node_description) {
QString s = c->innerText (); TQString s = c->innerText ();
n->setInfoMessage (s); n->setInfoMessage (s);
if (!enclosure && !s.isEmpty ()) { if (!enclosure && !s.isEmpty ()) {
setState (state_activated); setState (state_activated);
@ -113,7 +113,7 @@ KDE_NO_EXPORT void RSS::Item::deactivate () {
} }
PlayListNotify * n = document()->notify_listener; PlayListNotify * n = document()->notify_listener;
if (n) if (n)
n->setInfoMessage (QString ()); n->setInfoMessage (TQString ());
Mrl::deactivate (); Mrl::deactivate ();
} }

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_RSS_H_ #ifndef _KMPLAYER_RSS_H_
#define _KMPLAYER_RSS_H_ #define _KMPLAYER_RSS_H_
#include <qstring.h> #include <tqstring.h>
#include "kmplayerplaylist.h" #include "kmplayerplaylist.h"
@ -42,7 +42,7 @@ const short id_node_enclosure = 205;
class KMPLAYER_NO_EXPORT Rss : public Mrl { class KMPLAYER_NO_EXPORT Rss : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Rss (NodePtr & d) : Mrl (d, id_node_rss) {} KDE_NO_CDTOR_EXPORT Rss (NodePtr & d) : Mrl (d, id_node_rss) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "rss"; } KDE_NO_EXPORT const char * nodeName () const { return "rss"; }
bool expose () const { return false; } bool expose () const { return false; }
}; };
@ -50,7 +50,7 @@ public:
class KMPLAYER_NO_EXPORT Channel : public Mrl { class KMPLAYER_NO_EXPORT Channel : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Channel (NodePtr & d) : Mrl (d, id_node_channel) {} KDE_NO_CDTOR_EXPORT Channel (NodePtr & d) : Mrl (d, id_node_channel) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "channel"; } KDE_NO_EXPORT const char * nodeName () const { return "channel"; }
PlayType playType () { return play_type_none; } PlayType playType () { return play_type_none; }
void closed (); void closed ();
@ -60,7 +60,7 @@ public:
class KMPLAYER_NO_EXPORT Item : public Mrl { class KMPLAYER_NO_EXPORT Item : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Item (NodePtr & d) : Mrl (d, id_node_item) {} KDE_NO_CDTOR_EXPORT Item (NodePtr & d) : Mrl (d, id_node_item) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "item"; } KDE_NO_EXPORT const char * nodeName () const { return "item"; }
PlayType playType () { return cached_play_type; } PlayType playType () { return cached_play_type; }
Mrl * linkNode (); Mrl * linkNode ();

File diff suppressed because it is too large Load Diff

@ -22,15 +22,15 @@
#define _KMPLAYER_SMILL_H_ #define _KMPLAYER_SMILL_H_
#include <config.h> #include <config.h>
#include <qobject.h> #include <tqobject.h>
#include <qstring.h> #include <tqstring.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include "kmplayerplaylist.h" #include "kmplayerplaylist.h"
class QTextStream; class TQTextStream;
class QImage; class TQImage;
class QPainter; class TQPainter;
namespace KIO { namespace KIO {
class Job; class Job;
@ -41,18 +41,18 @@ struct TransTypeInfo;
namespace KMPlayer { namespace KMPlayer {
struct KMPLAYER_NO_EXPORT ImageData { struct KMPLAYER_NO_EXPORT ImageData {
ImageData( const QString & img); ImageData( const TQString & img);
~ImageData(); ~ImageData();
QImage *image; TQImage *image;
private: private:
QString url; TQString url;
}; };
typedef SharedPtr <ImageData> ImageDataPtr; typedef SharedPtr <ImageData> ImageDataPtr;
typedef WeakPtr <ImageData> ImageDataPtrW; typedef WeakPtr <ImageData> ImageDataPtrW;
struct KMPLAYER_NO_EXPORT CachedImage { struct KMPLAYER_NO_EXPORT CachedImage {
void setUrl (const QString & url); void setUrl (const TQString & url);
bool isEmpty (); bool isEmpty ();
ImageDataPtr data; ImageDataPtr data;
}; };
@ -61,7 +61,7 @@ class TextRuntimePrivate;
/* /*
* Event signaled before the actual starting takes place. Use by SMIL::Excl * Event signaled before the actual starting takes place. Use by SMIL::Excl
* to stop possible other children * to stop possible other tqchildren
*/ */
class ToBeStartedEvent : public Event { class ToBeStartedEvent : public Event {
public: public:
@ -75,9 +75,9 @@ public:
class KMPLAYER_NO_EXPORT SizeType { class KMPLAYER_NO_EXPORT SizeType {
public: public:
SizeType (); SizeType ();
SizeType (const QString & s); SizeType (const TQString & s);
void reset (); void reset ();
SizeType & operator = (const QString & s); SizeType & operator = (const TQString & s);
SizeType & operator += (const SizeType & s); SizeType & operator += (const SizeType & s);
SizeType & operator -= (const SizeType & s); SizeType & operator -= (const SizeType & s);
SizeType & operator /= (const int i) SizeType & operator /= (const int i)
@ -106,8 +106,8 @@ public:
bool applyRegPoints (Node *, Single w, Single h, bool applyRegPoints (Node *, Single w, Single h,
Single & xoff, Single & yoff, Single & w1, Single & h1); Single & xoff, Single & yoff, Single & w1, Single & h1);
SizeType left, top, width, height, right, bottom; SizeType left, top, width, height, right, bottom;
QString reg_point, reg_align; TQString reg_point, reg_align;
bool setSizeParam (const TrieString &name, const QString &value, bool &dim); bool setSizeParam (const TrieString &name, const TQString &value, bool &dim);
void move (const SizeType &x, const SizeType &y); void move (const SizeType &x, const SizeType &y);
}; };
@ -136,7 +136,7 @@ public:
* Reset all data, called from end() and init() * Reset all data, called from end() and init()
*/ */
virtual void reset (); virtual void reset ();
virtual bool parseParam (const TrieString & name, const QString & value); virtual bool parseParam (const TrieString & name, const TQString & value);
TimingState state () const { return timingstate; } TimingState state () const { return timingstate; }
void propagateStop (bool forced); void propagateStop (bool forced);
void propagateStart (); void propagateStart ();
@ -156,7 +156,7 @@ public:
KDE_NO_EXPORT DurationItem & durTime () { return durations[duration_time]; } KDE_NO_EXPORT DurationItem & durTime () { return durations[duration_time]; }
KDE_NO_EXPORT DurationItem & endTime () { return durations [end_time]; } KDE_NO_EXPORT DurationItem & endTime () { return durations [end_time]; }
private: private:
void setDurationItem (DurationTime item, const QString & val); void setDurationItem (DurationTime item, const TQString & val);
public: public:
TimingState timingstate; TimingState timingstate;
protected: protected:
@ -190,32 +190,33 @@ class KMPLAYER_NO_EXPORT AudioVideoData : public MediaTypeRuntime {
public: public:
AudioVideoData (NodePtr e); AudioVideoData (NodePtr e);
virtual bool isAudioVideo (); virtual bool isAudioVideo ();
virtual bool parseParam (const TrieString & name, const QString & value); virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void started (); virtual void started ();
virtual void postpone (bool b); virtual void postpone (bool b);
virtual void clipStart (); virtual void clipStart ();
virtual void clipStop (); virtual void clipStop ();
}; };
class KMPLAYER_NO_EXPORT ImageRuntime : public QObject,public MediaTypeRuntime { class KMPLAYER_NO_EXPORT ImageRuntime : public TQObject,public MediaTypeRuntime {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ImageRuntime (NodePtr e); ImageRuntime (NodePtr e);
~ImageRuntime (); ~ImageRuntime ();
virtual bool parseParam (const TrieString & name, const QString & value); virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void postpone (bool b); virtual void postpone (bool b);
virtual void clipStart (); virtual void clipStart ();
virtual void clipStop (); virtual void clipStop ();
QMovie * img_movie; TQMovie * img_movie;
CachedImage cached_img; CachedImage cached_img;
int frame_nr; int frame_nr;
protected: protected:
virtual void started (); virtual void started ();
virtual void remoteReady (QByteArray &); virtual void remoteReady (TQByteArray &);
private slots: private slots:
void movieUpdated (const QRect &); void movieUpdated (const TQRect &);
void movieStatus (int); void movietqStatus (int);
void movieResize (const QSize &); void movieResize (const TQSize &);
}; };
/** /**
@ -226,17 +227,17 @@ public:
TextRuntime (NodePtr e); TextRuntime (NodePtr e);
~TextRuntime (); ~TextRuntime ();
void reset (); void reset ();
virtual bool parseParam (const TrieString & name, const QString & value); virtual bool parseParam (const TrieString & name, const TQString & value);
int font_size; int font_size;
unsigned int font_color; unsigned int font_color;
unsigned int background_color; unsigned int background_color;
int bg_opacity; int bg_opacity;
enum { align_left, align_center, align_right } halign; enum { align_left, align_center, align_right } halign;
QString text; TQString text;
TextRuntimePrivate * d; TextRuntimePrivate * d;
protected: protected:
virtual void started (); virtual void started ();
virtual void remoteReady (QByteArray &); virtual void remoteReady (TQByteArray &);
}; };
/** /**
@ -245,14 +246,14 @@ protected:
class KMPLAYER_NO_EXPORT AnimateGroupData : public Runtime { class KMPLAYER_NO_EXPORT AnimateGroupData : public Runtime {
public: public:
KDE_NO_CDTOR_EXPORT ~AnimateGroupData () {} KDE_NO_CDTOR_EXPORT ~AnimateGroupData () {}
virtual bool parseParam (const TrieString & name, const QString & value); virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void reset (); virtual void reset ();
protected: protected:
void restoreModification (); void restoreModification ();
AnimateGroupData (NodePtr e); AnimateGroupData (NodePtr e);
NodePtrW target_element; NodePtrW target_element;
TrieString changed_attribute; TrieString changed_attribute;
QString change_to; TQString change_to;
int modification_id; int modification_id;
protected: protected:
virtual void stopped (); virtual void stopped ();
@ -276,7 +277,7 @@ class KMPLAYER_NO_EXPORT AnimateData : public AnimateGroupData {
public: public:
AnimateData (NodePtr e); AnimateData (NodePtr e);
KDE_NO_CDTOR_EXPORT ~AnimateData () {} KDE_NO_CDTOR_EXPORT ~AnimateData () {}
virtual bool parseParam (const TrieString & name, const QString & value); virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void reset (); virtual void reset ();
virtual void started (); virtual void started ();
virtual void stopped (); virtual void stopped ();
@ -285,14 +286,14 @@ private:
void applyStep (); void applyStep ();
TimerInfoPtrW anim_timer; TimerInfoPtrW anim_timer;
enum { acc_none, acc_sum } accumulate; enum { acc_none, acc_sum } accumulate;
enum { add_replace, add_sum } additive; enum { add_tqreplace, add_sum } additive;
int change_by; int change_by;
enum { calc_discrete, calc_linear, calc_paced, calc_spline } calcMode; enum { calc_discrete, calc_linear, calc_paced, calc_spline } calcMode;
QString change_from; TQString change_from;
QStringList change_values; TQStringList change_values;
int steps; int steps;
float change_delta, change_to_val, change_from_val; float change_delta, change_to_val, change_from_val;
QString change_from_unit; TQString change_from_unit;
}; };
/** /**
@ -302,7 +303,7 @@ class KMPLAYER_NO_EXPORT AnimateMotionData : public AnimateGroupData {
public: public:
AnimateMotionData (NodePtr e); AnimateMotionData (NodePtr e);
~AnimateMotionData (); ~AnimateMotionData ();
virtual bool parseParam (const TrieString & name, const QString & value); virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void reset (); virtual void reset ();
virtual void started (); virtual void started ();
virtual void stopped (); virtual void stopped ();
@ -311,17 +312,17 @@ private:
bool checkTarget (Node *n); bool checkTarget (Node *n);
bool setInterval (); bool setInterval ();
void applyStep (); void applyStep ();
bool getCoordinates (const QString &coord, SizeType &x, SizeType &y); bool getCoordinates (const TQString &coord, SizeType &x, SizeType &y);
TimerInfoPtrW anim_timer; TimerInfoPtrW anim_timer;
enum { acc_none, acc_sum } accumulate; enum { acc_none, acc_sum } accumulate;
enum { add_replace, add_sum } additive; enum { add_tqreplace, add_sum } additive;
enum { calc_discrete, calc_linear, calc_paced, calc_spline } calcMode; enum { calc_discrete, calc_linear, calc_paced, calc_spline } calcMode;
QString change_from; TQString change_from;
QString change_by; TQString change_by;
QStringList values; TQStringList values;
float *keytimes; float *keytimes;
int keytime_count; int keytime_count;
QStringList splines; TQStringList splines;
float control_point[4]; float control_point[4];
unsigned int steps; unsigned int steps;
unsigned int cur_step; unsigned int cur_step;
@ -347,7 +348,7 @@ public:
/** /**
* Translates string to deci-seconds or 'special' high number * Translates string to deci-seconds or 'special' high number
*/ */
bool parseTime (const QString & val, int & dur /*,const QString & dateformat*/); bool parseTime (const TQString & val, int & dur /*,const TQString & dateformat*/);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -392,7 +393,7 @@ const short id_node_last = 200; // reserve 100 ids
class Smil : public Mrl { class Smil : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Smil (NodePtr & d) : Mrl (d, id_node_smil) {} KDE_NO_CDTOR_EXPORT Smil (NodePtr & d) : Mrl (d, id_node_smil) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "smil"; } KDE_NO_EXPORT const char * nodeName () const { return "smil"; }
PlayType playType () { return play_type_video; } PlayType playType () { return play_type_video; }
void activate (); void activate ();
@ -402,7 +403,7 @@ public:
bool expose () const; bool expose () const;
bool handleEvent (EventPtr event); bool handleEvent (EventPtr event);
void accept (Visitor *); void accept (Visitor *);
void jump (const QString & id); void jump (const TQString & id);
static Smil * findSmilNode (Node * node); static Smil * findSmilNode (Node * node);
/** /**
* Hack to mark the currently playing MediaType as finished * Hack to mark the currently playing MediaType as finished
@ -410,7 +411,7 @@ public:
*/ */
Mrl * linkNode (); Mrl * linkNode ();
NodePtrW current_av_media_type; NodePtrW current_av_media_type;
NodePtrW layout_node; NodePtrW tqlayout_node;
}; };
/** /**
@ -420,7 +421,7 @@ public:
class KMPLAYER_NO_EXPORT Head : public Element { class KMPLAYER_NO_EXPORT Head : public Element {
public: public:
KDE_NO_CDTOR_EXPORT Head (NodePtr & d) : Element (d, id_node_head) {} KDE_NO_CDTOR_EXPORT Head (NodePtr & d) : Element (d, id_node_head) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "head"; } KDE_NO_EXPORT const char * nodeName () const { return "head"; }
void closed (); void closed ();
void childDone (NodePtr child); void childDone (NodePtr child);
@ -439,19 +440,19 @@ public:
void activate (); void activate ();
void childDone (NodePtr child); void childDone (NodePtr child);
void deactivate (); void deactivate ();
virtual void parseParam (const TrieString & name, const QString & value); virtual void parseParam (const TrieString & name, const TQString & value);
/** /**
* repaints region, calls scheduleRepaint(x,y,w,h) on view * tqrepaints region, calls scheduleRepaint(x,y,w,h) on view
*/ */
void repaint (); void tqrepaint ();
void repaint (const SRect & rect); void tqrepaint (const SRect & rect);
/** /**
* calculate the relative x,y,w,h on the child region elements * calculate the relative x,y,w,h on the child region elements
* given this element's w and h value * given this element's w and h value
* and child's left/top/right/width/height/bottom attributes * and child's left/top/right/width/height/bottom attributes
*/ */
virtual void updateDimensions (); virtual void updateDimensions ();
void boundsUpdate (); // recalculates and repaint old and new bounds void boundsUpdate (); // recalculates and tqrepaint old and new bounds
virtual Surface *surface (); virtual Surface *surface ();
SurfacePtrW region_surface; SurfacePtrW region_surface;
@ -461,22 +462,22 @@ public:
Single x, y, w, h; // unscaled values Single x, y, w, h; // unscaled values
int z_order; int z_order;
unsigned int background_color; unsigned int background_color;
QString background_image; TQString background_image;
ShowBackground show_background; ShowBackground show_background;
protected: protected:
RegionBase (NodePtr & d, short id); RegionBase (NodePtr & d, short id);
PostponePtr postpone_lock; // pause while loading bg image PostponePtr postpone_lock; // pause while loading bg image
virtual void remoteReady (QByteArray &); // image downloaded virtual void remoteReady (TQByteArray &); // image downloaded
}; };
/** /**
* Defines region layout, should reside below 'head' element * Defines region tqlayout, should reside below 'head' element
*/ */
class KMPLAYER_NO_EXPORT Layout : public RegionBase { class KMPLAYER_NO_EXPORT Layout : public RegionBase {
public: public:
Layout (NodePtr & d); Layout (NodePtr & d);
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "layout"; } KDE_NO_EXPORT const char * nodeName () const { return "tqlayout"; }
void activate (); void activate ();
void closed (); void closed ();
virtual void accept (Visitor *); virtual void accept (Visitor *);
@ -496,7 +497,7 @@ class KMPLAYER_NO_EXPORT Region : public RegionBase {
public: public:
Region (NodePtr & d); Region (NodePtr & d);
KDE_NO_EXPORT const char * nodeName () const { return "region"; } KDE_NO_EXPORT const char * nodeName () const { return "region"; }
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
void calculateBounds (Single w, Single h); void calculateBounds (Single w, Single h);
virtual NodeRefListPtr listeners (unsigned int event_id); virtual NodeRefListPtr listeners (unsigned int event_id);
virtual void accept (Visitor *); virtual void accept (Visitor *);
@ -516,11 +517,11 @@ class KMPLAYER_NO_EXPORT RootLayout : public RegionBase {
public: public:
KDE_NO_CDTOR_EXPORT RootLayout (NodePtr & d) KDE_NO_CDTOR_EXPORT RootLayout (NodePtr & d)
: RegionBase (d, id_node_root_layout) {} : RegionBase (d, id_node_root_layout) {}
KDE_NO_EXPORT const char * nodeName () const { return "root-layout"; } KDE_NO_EXPORT const char * nodeName () const { return "root-tqlayout"; }
}; };
/** /**
* Represents a regPoint element for alignment inside regions * Represents a regPoint element for tqalignment inside regions
*/ */
class KMPLAYER_NO_EXPORT RegPoint : public Element { class KMPLAYER_NO_EXPORT RegPoint : public Element {
public: public:
@ -528,7 +529,7 @@ public:
KDE_NO_CDTOR_EXPORT ~RegPoint () {} KDE_NO_CDTOR_EXPORT ~RegPoint () {}
KDE_NO_EXPORT const char * nodeName () const { return "regPoint"; } KDE_NO_EXPORT const char * nodeName () const { return "regPoint"; }
KDE_NO_EXPORT bool expose () const { return false; } KDE_NO_EXPORT bool expose () const { return false; }
void parseParam (const TrieString & name, const QString & value); void parseParam (const TrieString & name, const TQString & value);
CalculatedSizer sizes; CalculatedSizer sizes;
}; };
@ -570,7 +571,7 @@ public:
void activate (); void activate ();
KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); } KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); }
KDE_NO_EXPORT const char * nodeName () const { return "transition"; } KDE_NO_EXPORT const char * nodeName () const { return "transition"; }
void parseParam (const TrieString & name, const QString & value); void parseParam (const TrieString & name, const TQString & value);
KDE_NO_EXPORT bool expose () const { return false; } KDE_NO_EXPORT bool expose () const { return false; }
bool supported (); bool supported ();
TransType type; TransType type;
@ -605,7 +606,7 @@ public:
virtual NodeRefListPtr listeners (unsigned int event_id); virtual NodeRefListPtr listeners (unsigned int event_id);
KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); } KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); }
void init (); void init ();
virtual void parseParam (const TrieString &, const QString &); virtual void parseParam (const TrieString &, const TQString &);
Runtime * runtime (); Runtime * runtime ();
static Runtime::DurationItem * getDuration (NodePtr n); static Runtime::DurationItem * getDuration (NodePtr n);
static bool isTimedMrl (const Node *n); static bool isTimedMrl (const Node *n);
@ -644,7 +645,7 @@ KDE_NO_EXPORT inline bool TimedMrl::isTimedMrl (const Node *n) {
class KMPLAYER_NO_EXPORT GroupBase : public TimedMrl { class KMPLAYER_NO_EXPORT GroupBase : public TimedMrl {
public: public:
KDE_NO_CDTOR_EXPORT ~GroupBase () {} KDE_NO_CDTOR_EXPORT ~GroupBase () {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
PlayType playType () { return play_type_none; } PlayType playType () { return play_type_none; }
void finish (); void finish ();
void deactivate (); void deactivate ();
@ -655,7 +656,7 @@ protected:
}; };
/** /**
* A Par represents parallel processing of all its children * A Par represents parallel processing of all its tqchildren
*/ */
class KMPLAYER_NO_EXPORT Par : public GroupBase { class KMPLAYER_NO_EXPORT Par : public GroupBase {
public: public:
@ -667,7 +668,7 @@ public:
}; };
/** /**
* A Seq represents sequential processing of all its children * A Seq represents sequential processing of all its tqchildren
*/ */
class KMPLAYER_NO_EXPORT Seq : public GroupBase { class KMPLAYER_NO_EXPORT Seq : public GroupBase {
public: public:
@ -690,7 +691,7 @@ public:
}; };
/** /**
* An Excl represents exclusive processing of one of its children * An Excl represents exclusive processing of one of its tqchildren
*/ */
class KMPLAYER_NO_EXPORT Excl : public GroupBase { class KMPLAYER_NO_EXPORT Excl : public GroupBase {
public: public:
@ -725,11 +726,11 @@ public:
KDE_NO_CDTOR_EXPORT ~LinkingBase () {} KDE_NO_CDTOR_EXPORT ~LinkingBase () {}
void deactivate (); void deactivate ();
KDE_NO_EXPORT bool expose () const { return false; } KDE_NO_EXPORT bool expose () const { return false; }
void parseParam (const TrieString & name, const QString & value); void parseParam (const TrieString & name, const TQString & value);
ConnectionPtr mediatype_activated; ConnectionPtr mediatype_activated;
ConnectionPtr mediatype_attach; ConnectionPtr mediatype_attach;
QString href; TQString href;
enum { show_new, show_replace } show; enum { show_new, show_tqreplace } show;
protected: protected:
LinkingBase (NodePtr & d, short id); LinkingBase (NodePtr & d, short id);
}; };
@ -741,22 +742,22 @@ public:
void activate (); void activate ();
void childDone (NodePtr child); void childDone (NodePtr child);
KDE_NO_EXPORT const char * nodeName () const { return "a"; } KDE_NO_EXPORT const char * nodeName () const { return "a"; }
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); } KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); }
}; };
class KMPLAYER_NO_EXPORT Area : public LinkingBase { class KMPLAYER_NO_EXPORT Area : public LinkingBase {
public: public:
Area (NodePtr & d, const QString & tag); Area (NodePtr & d, const TQString & tag);
~Area (); ~Area ();
void activate (); void activate ();
KDE_NO_EXPORT const char * nodeName () const { return tag.ascii (); } KDE_NO_EXPORT const char * nodeName () const { return tag.ascii (); }
KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); } KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); }
void parseParam (const TrieString & name, const QString & value); void parseParam (const TrieString & name, const TQString & value);
NodeRefListPtr listeners (unsigned int event_id); NodeRefListPtr listeners (unsigned int event_id);
SizeType * coords; SizeType * coords;
int nr_coords; int nr_coords;
const QString tag; const TQString tag;
MouseListeners mouse_listeners; MouseListeners mouse_listeners;
}; };
@ -765,8 +766,8 @@ public:
*/ */
class KMPLAYER_NO_EXPORT MediaType : public TimedMrl { class KMPLAYER_NO_EXPORT MediaType : public TimedMrl {
public: public:
MediaType (NodePtr & d, const QString & t, short id); MediaType (NodePtr & d, const TQString & t, short id);
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return m_type.latin1 (); } KDE_NO_EXPORT const char * nodeName () const { return m_type.latin1 (); }
void closed (); void closed ();
void activate (); void activate ();
@ -779,8 +780,8 @@ public:
Surface *surface (); Surface *surface ();
void resetSurface (); void resetSurface ();
SRect calculateBounds (); SRect calculateBounds ();
void boundsUpdate (); // recalculates and repaint old and new bounds void boundsUpdate (); // recalculates and tqrepaint old and new bounds
virtual void parseParam (const TrieString & name, const QString & value); virtual void parseParam (const TrieString & name, const TQString & value);
virtual bool handleEvent (EventPtr event); virtual bool handleEvent (EventPtr event);
NodeRefListPtr listeners (unsigned int event_id); NodeRefListPtr listeners (unsigned int event_id);
bool needsVideoWidget (); // for 'video' and 'ref' nodes bool needsVideoWidget (); // for 'video' and 'ref' nodes
@ -790,7 +791,7 @@ public:
NodePtrW trans_out; NodePtrW trans_out;
NodePtrW active_trans; NodePtrW active_trans;
NodePtrW region_node; NodePtrW region_node;
QString m_type; TQString m_type;
CalculatedSizer sizes; CalculatedSizer sizes;
Fit fit; Fit fit;
int opacity; int opacity;
@ -813,8 +814,8 @@ protected:
class KMPLAYER_NO_EXPORT AVMediaType : public MediaType { class KMPLAYER_NO_EXPORT AVMediaType : public MediaType {
public: public:
AVMediaType (NodePtr & d, const QString & t); AVMediaType (NodePtr & d, const TQString & t);
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
virtual Runtime * getNewRuntime (); virtual Runtime * getNewRuntime ();
virtual void defer (); virtual void defer ();
virtual void undefer (); virtual void undefer ();
@ -827,7 +828,7 @@ class KMPLAYER_NO_EXPORT ImageMediaType : public MediaType {
public: public:
ImageMediaType (NodePtr & d); ImageMediaType (NodePtr & d);
Runtime * getNewRuntime (); Runtime * getNewRuntime ();
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
PlayType playType () { return play_type_image; } PlayType playType () { return play_type_image; }
virtual void accept (Visitor *); virtual void accept (Visitor *);
}; };

@ -25,7 +25,7 @@
using namespace KMPlayer; using namespace KMPlayer;
KDE_NO_EXPORT NodePtr XSPF::Playlist::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr XSPF::Playlist::childFromTag (const TQString & tag) {
const char * name = tag.latin1 (); const char * name = tag.latin1 ();
if (!strcasecmp (name, "tracklist")) if (!strcasecmp (name, "tracklist"))
return new Tracklist (m_doc); return new Tracklist (m_doc);
@ -69,7 +69,7 @@ KDE_NO_EXPORT void XSPF::Playlist::closed () {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_EXPORT NodePtr XSPF::Tracklist::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr XSPF::Tracklist::childFromTag (const TQString & tag) {
const char * name = tag.latin1 (); const char * name = tag.latin1 ();
if (!strcasecmp (name, "track")) if (!strcasecmp (name, "track"))
return new XSPF::Track (m_doc); return new XSPF::Track (m_doc);
@ -78,7 +78,7 @@ KDE_NO_EXPORT NodePtr XSPF::Tracklist::childFromTag (const QString & tag) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_EXPORT NodePtr XSPF::Track::childFromTag (const QString & tag) { KDE_NO_EXPORT NodePtr XSPF::Track::childFromTag (const TQString & tag) {
const char * name = tag.latin1 (); const char * name = tag.latin1 ();
if (!strcasecmp (name, "location")) if (!strcasecmp (name, "location"))
return new Location (m_doc); return new Location (m_doc);

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_XSPF_H_ #ifndef _KMPLAYER_XSPF_H_
#define _KMPLAYER_XSPF_H_ #define _KMPLAYER_XSPF_H_
#include <qstring.h> #include <tqstring.h>
#include "kmplayerplaylist.h" #include "kmplayerplaylist.h"
@ -52,7 +52,7 @@ const short id_node_link = 518;
class KMPLAYER_NO_EXPORT Playlist : public Mrl { class KMPLAYER_NO_EXPORT Playlist : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT Playlist (NodePtr & d) : Mrl (d, id_node_playlist) {} KDE_NO_CDTOR_EXPORT Playlist (NodePtr & d) : Mrl (d, id_node_playlist) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "playlist"; } KDE_NO_EXPORT const char * nodeName () const { return "playlist"; }
bool expose () const { return !pretty_name.isEmpty (); } bool expose () const { return !pretty_name.isEmpty (); }
void closed (); void closed ();
@ -61,7 +61,7 @@ public:
class KMPLAYER_NO_EXPORT Tracklist : public Element { class KMPLAYER_NO_EXPORT Tracklist : public Element {
public: public:
KDE_NO_CDTOR_EXPORT Tracklist (NodePtr & d) : Element (d, id_node_tracklist) {} KDE_NO_CDTOR_EXPORT Tracklist (NodePtr & d) : Element (d, id_node_tracklist) {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "tracklist"; } KDE_NO_EXPORT const char * nodeName () const { return "tracklist"; }
bool expose () const { return false; } bool expose () const { return false; }
}; };
@ -74,7 +74,7 @@ public:
PlayType playType (); PlayType playType ();
Mrl * linkNode (); Mrl * linkNode ();
KDE_NO_EXPORT const char * nodeName () const { return "track"; } KDE_NO_EXPORT const char * nodeName () const { return "track"; }
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
NodePtrW location; NodePtrW location;
}; };

File diff suppressed because it is too large Load Diff

@ -23,7 +23,7 @@
#include <config.h> #include <config.h>
#endif #endif
#include <qframe.h> #include <tqframe.h>
#include <kurl.h> #include <kurl.h>
@ -33,10 +33,10 @@
class KMPlayerApp; class KMPlayerApp;
class KURLRequester; class KURLRequester;
class QPopupMenu; class TQPopupMenu;
class QMenuItem; class TQMenuItem;
class QCheckBox; class TQCheckBox;
class QLineEdit; class TQLineEdit;
class TVInput; class TVInput;
class TVChannel; class TVChannel;
@ -45,25 +45,27 @@ class TVChannel;
*/ */
class KMPLAYER_NO_EXPORT KMPlayerMenuSource : public KMPlayer::Source { class KMPLAYER_NO_EXPORT KMPlayerMenuSource : public KMPlayer::Source {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerMenuSource (const QString & n, KMPlayerApp * app, QPopupMenu * m, const char * src); KMPlayerMenuSource (const TQString & n, KMPlayerApp * app, TQPopupMenu * m, const char * src);
virtual ~KMPlayerMenuSource (); virtual ~KMPlayerMenuSource ();
protected: protected:
void menuItemClicked (QPopupMenu * menu, int id); void menuItemClicked (TQPopupMenu * menu, int id);
QPopupMenu * m_menu; TQPopupMenu * m_menu;
KMPlayerApp * m_app; KMPlayerApp * m_app;
}; };
/* /*
* Preference page for DVD * Preference page for DVD
*/ */
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageDVD : public QFrame { class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageDVD : public TQFrame {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerPrefSourcePageDVD (QWidget * parent); KMPlayerPrefSourcePageDVD (TQWidget * tqparent);
~KMPlayerPrefSourcePageDVD () {} ~KMPlayerPrefSourcePageDVD () {}
QCheckBox * autoPlayDVD; TQCheckBox * autoPlayDVD;
KURLRequester * dvddevice; KURLRequester * dvddevice;
}; };
@ -72,18 +74,19 @@ public:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerDVDSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage { class KMPLAYER_NO_EXPORT KMPlayerDVDSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerDVDSource (KMPlayerApp * app, QPopupMenu * m); KMPlayerDVDSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerDVDSource (); virtual ~KMPlayerDVDSource ();
virtual bool processOutput (const QString & line); virtual bool processOutput (const TQString & line);
virtual QString filterOptions (); virtual TQString filterOptions ();
virtual void setIdentified (bool b = true); virtual void setIdentified (bool b = true);
virtual QString prettyName (); virtual TQString prettyName ();
virtual void write (KConfig *); virtual void write (KConfig *);
virtual void read (KConfig *); virtual void read (KConfig *);
virtual void sync (bool); virtual void sync (bool);
virtual void prefLocation (QString & item, QString & icon, QString & tab); virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual QFrame * prefPage (QWidget * parent); virtual TQFrame * prefPage (TQWidget * tqparent);
public slots: public slots:
virtual void activate (); virtual void activate ();
virtual void deactivate (); virtual void deactivate ();
@ -95,10 +98,10 @@ public slots:
private: private:
void buildArguments (); void buildArguments ();
void play (); void play ();
QPopupMenu * m_dvdtitlemenu; TQPopupMenu * m_dvdtitlemenu;
QPopupMenu * m_dvdchaptermenu; TQPopupMenu * m_dvdchaptermenu;
QPopupMenu * m_dvdlanguagemenu; TQPopupMenu * m_dvdlanguagemenu;
QPopupMenu * m_dvdsubtitlemenu; TQPopupMenu * m_dvdsubtitlemenu;
KMPlayer::NodePtr disks; KMPlayer::NodePtr disks;
KMPlayerPrefSourcePageDVD * m_configpage; KMPlayerPrefSourcePageDVD * m_configpage;
int m_current_title; int m_current_title;
@ -111,10 +114,11 @@ private:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerDVDNavSource : public KMPlayerMenuSource { class KMPLAYER_NO_EXPORT KMPlayerDVDNavSource : public KMPlayerMenuSource {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerDVDNavSource (KMPlayerApp * app, QPopupMenu * m); KMPlayerDVDNavSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerDVDNavSource (); virtual ~KMPlayerDVDNavSource ();
virtual QString prettyName (); virtual TQString prettyName ();
public slots: public slots:
virtual void activate (); virtual void activate ();
virtual void deactivate (); virtual void deactivate ();
@ -128,13 +132,14 @@ public slots:
/* /*
* Preference page for VCD * Preference page for VCD
*/ */
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageVCD : public QFrame { class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageVCD : public TQFrame {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerPrefSourcePageVCD (QWidget * parent); KMPlayerPrefSourcePageVCD (TQWidget * tqparent);
~KMPlayerPrefSourcePageVCD () {} ~KMPlayerPrefSourcePageVCD () {}
KURLRequester * vcddevice; KURLRequester * vcddevice;
QCheckBox *autoPlayVCD; TQCheckBox *autoPlayVCD;
}; };
@ -143,17 +148,18 @@ public:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerVCDSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage { class KMPLAYER_NO_EXPORT KMPlayerVCDSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerVCDSource (KMPlayerApp * app, QPopupMenu * m); KMPlayerVCDSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerVCDSource (); virtual ~KMPlayerVCDSource ();
virtual bool processOutput (const QString & line); virtual bool processOutput (const TQString & line);
virtual void setIdentified (bool b = true); virtual void setIdentified (bool b = true);
virtual QString prettyName (); virtual TQString prettyName ();
virtual void write (KConfig *); virtual void write (KConfig *);
virtual void read (KConfig *); virtual void read (KConfig *);
virtual void sync (bool); virtual void sync (bool);
virtual void prefLocation (QString & item, QString & icon, QString & tab); virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual QFrame * prefPage (QWidget * parent); virtual TQFrame * prefPage (TQWidget * tqparent);
public slots: public slots:
virtual void activate (); virtual void activate ();
virtual void deactivate (); virtual void deactivate ();
@ -169,12 +175,13 @@ private:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerAudioCDSource : public KMPlayerMenuSource { class KMPLAYER_NO_EXPORT KMPlayerAudioCDSource : public KMPlayerMenuSource {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerAudioCDSource (KMPlayerApp * app, QPopupMenu * m); KMPlayerAudioCDSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerAudioCDSource (); virtual ~KMPlayerAudioCDSource ();
virtual bool processOutput (const QString & line); virtual bool processOutput (const TQString & line);
virtual void setIdentified (bool b = true); virtual void setIdentified (bool b = true);
virtual QString prettyName (); virtual TQString prettyName ();
public slots: public slots:
virtual void activate (); virtual void activate ();
virtual void deactivate (); virtual void deactivate ();
@ -188,13 +195,14 @@ private:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerPipeSource : public KMPlayer::Source { class KMPLAYER_NO_EXPORT KMPlayerPipeSource : public KMPlayer::Source {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerPipeSource (KMPlayerApp * app); KMPlayerPipeSource (KMPlayerApp * app);
virtual ~KMPlayerPipeSource (); virtual ~KMPlayerPipeSource ();
virtual bool hasLength (); virtual bool hasLength ();
virtual bool isSeekable (); virtual bool isSeekable ();
void setCommand (const QString & cmd); void setCommand (const TQString & cmd);
virtual QString prettyName (); virtual TQString prettyName ();
public slots: public slots:
virtual void activate (); virtual void activate ();
virtual void deactivate (); virtual void deactivate ();

@ -18,20 +18,20 @@
*/ */
#include <algorithm> #include <algorithm>
#include <qlayout.h> #include <tqlayout.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qtable.h> #include <tqtable.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qlistbox.h> #include <tqlistbox.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qwhatsthis.h> #include <tqwhatsthis.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
#include <qcursor.h> #include <tqcursor.h>
#include <qdir.h> #include <tqdir.h>
#include <qfile.h> #include <tqfile.h>
#include <qtimer.h> #include <tqtimer.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h> #include <kdebug.h>
@ -58,17 +58,17 @@ static const char * strFFServerCustomSetting = "Custom Setting";
static const char * strFFServerProfiles = "Profiles"; static const char * strFFServerProfiles = "Profiles";
KDE_NO_CDTOR_EXPORT FFServerSetting::FFServerSetting (int i, const QString & n, const QString & f, const QString & ac, int abr, int asr, const QString & vc, int vbr, int q, int fr, int gs, int w, int h) KDE_NO_CDTOR_EXPORT FFServerSetting::FFServerSetting (int i, const TQString & n, const TQString & f, const TQString & ac, int abr, int asr, const TQString & vc, int vbr, int q, int fr, int gs, int w, int h)
: index (i), name (n), format (f), audiocodec (ac), : index (i), name (n), format (f), audiocodec (ac),
audiobitrate (abr > 0 ? QString::number (abr) : QString ()), audiobitrate (abr > 0 ? TQString::number (abr) : TQString ()),
audiosamplerate (asr > 0 ? QString::number (asr) : QString ()), audiosamplerate (asr > 0 ? TQString::number (asr) : TQString ()),
videocodec (vc), videocodec (vc),
videobitrate (vbr > 0 ? QString::number (vbr) : QString ()), videobitrate (vbr > 0 ? TQString::number (vbr) : TQString ()),
quality (q > 0 ? QString::number (q) : QString ()), quality (q > 0 ? TQString::number (q) : TQString ()),
framerate (fr > 0 ? QString::number (fr) : QString ()), framerate (fr > 0 ? TQString::number (fr) : TQString ()),
gopsize (gs > 0 ? QString::number (gs) : QString ()), gopsize (gs > 0 ? TQString::number (gs) : TQString ()),
width (w > 0 ? QString::number (w) : QString ()), width (w > 0 ? TQString::number (w) : TQString ()),
height (h > 0 ? QString::number (h) : QString ()) {} height (h > 0 ? TQString::number (h) : TQString ()) {}
KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const FFServerSetting & fs) { KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const FFServerSetting & fs) {
format = fs.format; format = fs.format;
@ -85,11 +85,11 @@ KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const FFServerSetti
return *this; return *this;
} }
KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const QStringList & sl) { KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const TQStringList & sl) {
if (sl.count () < 11) { if (sl.count () < 11) {
return *this; return *this;
} }
QStringList::const_iterator it = sl.begin (); TQStringList::const_iterator it = sl.begin ();
format = *it++; format = *it++;
audiocodec = *it++; audiocodec = *it++;
audiobitrate = *it++; audiobitrate = *it++;
@ -102,38 +102,38 @@ KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const QStringList &
width = *it++; width = *it++;
height = *it++; height = *it++;
acl.clear (); acl.clear ();
QStringList::const_iterator end( sl.end() ); TQStringList::const_iterator end( sl.end() );
for (; it != end; ++it) for (; it != end; ++it)
acl.push_back (*it); acl.push_back (*it);
return *this; return *this;
} }
KDE_NO_EXPORT QString & FFServerSetting::ffconfig (QString & buf) { KDE_NO_EXPORT TQString & FFServerSetting::ffconfig (TQString & buf) {
QString nl ("\n"); TQString nl ("\n");
buf = QString ("Format ") + format + nl; buf = TQString ("Format ") + format + nl;
if (!audiocodec.isEmpty ()) if (!audiocodec.isEmpty ())
buf += QString ("AudioCodec ") + audiocodec + nl; buf += TQString ("AudioCodec ") + audiocodec + nl;
if (!audiobitrate.isEmpty ()) if (!audiobitrate.isEmpty ())
buf += QString ("AudioBitRate ") + audiobitrate + nl; buf += TQString ("AudioBitRate ") + audiobitrate + nl;
if (!audiosamplerate.isEmpty () > 0) if (!audiosamplerate.isEmpty () > 0)
buf += QString ("AudioSampleRate ") + audiosamplerate + nl; buf += TQString ("AudioSampleRate ") + audiosamplerate + nl;
if (!videocodec.isEmpty ()) if (!videocodec.isEmpty ())
buf += QString ("VideoCodec ") + videocodec + nl; buf += TQString ("VideoCodec ") + videocodec + nl;
if (!videobitrate.isEmpty ()) if (!videobitrate.isEmpty ())
buf += QString ("VideoBitRate ") + videobitrate + nl; buf += TQString ("VideoBitRate ") + videobitrate + nl;
if (!quality.isEmpty ()) if (!quality.isEmpty ())
buf += QString ("VideoQMin ") + quality + nl; buf += TQString ("VideoTQMin ") + quality + nl;
if (!framerate.isEmpty ()) if (!framerate.isEmpty ())
buf += QString ("VideoFrameRate ") + framerate + nl; buf += TQString ("VideoFrameRate ") + framerate + nl;
if (!gopsize.isEmpty ()) if (!gopsize.isEmpty ())
buf += QString ("VideoGopSize ") + gopsize + nl; buf += TQString ("VideoGopSize ") + gopsize + nl;
if (!width.isEmpty () && !height.isEmpty ()) if (!width.isEmpty () && !height.isEmpty ())
buf += QString ("VideoSize ") + width + QString ("x") + height + nl; buf += TQString ("VideoSize ") + width + TQString ("x") + height + nl;
return buf; return buf;
} }
KDE_NO_EXPORT const QStringList FFServerSetting::list () { KDE_NO_EXPORT const TQStringList FFServerSetting::list () {
QStringList sl; TQStringList sl;
sl.push_back (format); sl.push_back (format);
sl.push_back (audiocodec); sl.push_back (audiocodec);
sl.push_back (audiobitrate); sl.push_back (audiobitrate);
@ -145,8 +145,8 @@ KDE_NO_EXPORT const QStringList FFServerSetting::list () {
sl.push_back (gopsize); sl.push_back (gopsize);
sl.push_back (width); sl.push_back (width);
sl.push_back (height); sl.push_back (height);
QStringList::const_iterator it = acl.begin (); TQStringList::const_iterator it = acl.begin ();
QStringList::const_iterator end( acl.end () ); TQStringList::const_iterator end( acl.end () );
for (; it != end; ++it) for (; it != end; ++it)
sl.push_back (*it); sl.push_back (*it);
return sl; return sl;
@ -154,134 +154,130 @@ KDE_NO_EXPORT const QStringList FFServerSetting::list () {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastPage::KMPlayerPrefBroadcastPage (QWidget *parent) : QFrame (parent) { KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastPage::KMPlayerPrefBroadcastPage (TQWidget *tqparent) : TQFrame (tqparent) {
QVBoxLayout *layout = new QVBoxLayout (this, 5); TQVBoxLayout *tqlayout = new TQVBoxLayout (this, 5);
QGridLayout *gridlayout = new QGridLayout (layout, 6, 2, 2); TQGridLayout *gridtqlayout = new TQGridLayout (tqlayout, 6, 2, 2);
QLabel *label = new QLabel (i18n ("Bind address:"), this); TQLabel *label = new TQLabel (i18n ("Bind address:"), this);
bindaddress = new QLineEdit ("", this); bindaddress = new TQLineEdit ("", this);
QWhatsThis::add (bindaddress, i18n ("If you have multiple network devices, you can limit access")); TQWhatsThis::add (bindaddress, i18n ("If you have multiple network devices, you can limit access"));
gridlayout->addWidget (label, 0, 0); gridtqlayout->addWidget (label, 0, 0);
gridlayout->addWidget (bindaddress, 0, 1); gridtqlayout->addWidget (bindaddress, 0, 1);
label = new QLabel (i18n ("Listen port:"), this); label = new TQLabel (i18n ("Listen port:"), this);
port = new QLineEdit ("", this); port = new TQLineEdit ("", this);
gridlayout->addWidget (label, 1, 0); gridtqlayout->addWidget (label, 1, 0);
gridlayout->addWidget (port, 1, 1); gridtqlayout->addWidget (port, 1, 1);
label = new QLabel (i18n ("Maximum connections:"), this); label = new TQLabel (i18n ("Maximum connections:"), this);
maxclients = new QLineEdit ("", this); maxclients = new TQLineEdit ("", this);
gridlayout->addWidget (label, 2, 0); gridtqlayout->addWidget (label, 2, 0);
gridlayout->addWidget (maxclients, 2, 1); gridtqlayout->addWidget (maxclients, 2, 1);
label = new QLabel (i18n ("Maximum bandwidth (kbit):"), this); label = new TQLabel (i18n ("Maximum bandwidth (kbit):"), this);
maxbandwidth = new QLineEdit ("", this); maxbandwidth = new TQLineEdit ("", this);
gridlayout->addWidget (label, 3, 0); gridtqlayout->addWidget (label, 3, 0);
gridlayout->addWidget (maxbandwidth, 3, 1); gridtqlayout->addWidget (maxbandwidth, 3, 1);
label = new QLabel (i18n ("Temporary feed file:"), this); label = new TQLabel (i18n ("Temporary feed file:"), this);
feedfile = new QLineEdit ("", this); feedfile = new TQLineEdit ("", this);
gridlayout->addWidget (label, 4, 0); gridtqlayout->addWidget (label, 4, 0);
gridlayout->addWidget (feedfile, 4, 1); gridtqlayout->addWidget (feedfile, 4, 1);
label = new QLabel (i18n ("Feed file size (kB):"), this); label = new TQLabel (i18n ("Feed file size (kB):"), this);
feedfilesize = new QLineEdit ("", this); feedfilesize = new TQLineEdit ("", this);
gridlayout->addWidget (label, 5, 0); gridtqlayout->addWidget (label, 5, 0);
gridlayout->addWidget (feedfilesize, 5, 1); gridtqlayout->addWidget (feedfilesize, 5, 1);
layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); tqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#undef ADDPROPERTY #undef ADDPROPERTY
#define ADDPROPERTY(label,qedit,gridlayout,row,parent) \ #define ADDPROPERTY(label,qedit,gridtqlayout,row,tqparent) \
qedit = new QLineEdit ("", parent); \ qedit = new TQLineEdit ("", tqparent); \
gridlayout->addWidget (new QLabel (qedit, label, parent), row, 0); \ gridtqlayout->addWidget (new TQLabel (qedit, label, tqparent), row, 0); \
gridlayout->addWidget (qedit, row, 1); gridtqlayout->addWidget (qedit, row, 1);
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastFormatPage::KMPlayerPrefBroadcastFormatPage (QWidget *parent, FFServerSettingList & ffs) : QFrame (parent, "BroadcastPage"), profiles (ffs) KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastFormatPage::KMPlayerPrefBroadcastFormatPage (TQWidget *tqparent, FFServerSettingList & ffs) : TQFrame (tqparent, "BroadcastPage"), profiles (ffs)
{ {
QHBoxLayout *layout = new QHBoxLayout (this, 5); TQHBoxLayout *tqlayout = new TQHBoxLayout (this, 5);
QGridLayout *formatlayout = new QGridLayout (11, 2, 2); TQGridLayout *formattqlayout = new TQGridLayout (11, 2, 2);
formatlayout->setAlignment (Qt::AlignTop); formattqlayout->tqsetAlignment (TQt::AlignTop);
QVBoxLayout *leftlayout = new QVBoxLayout (15); TQVBoxLayout *lefttqlayout = new TQVBoxLayout (15);
QHBoxLayout *ledlayout = new QHBoxLayout (5); TQHBoxLayout *ledtqlayout = new TQHBoxLayout (5);
format = new QComboBox (this); format = new TQComboBox (this);
QLabel * label = new QLabel (format, i18n ("Format:"), this); TQLabel * label = new TQLabel (format, i18n ("Format:"), this);
format->clear (); format->clear ();
format->insertItem (QString ("asf")); format->insertItem (TQString ("asf"));
format->insertItem (QString ("avi")); format->insertItem (TQString ("avi"));
format->insertItem (QString ("mpjpeg")); format->insertItem (TQString ("mpjpeg"));
format->insertItem (QString ("mpeg")); format->insertItem (TQString ("mpeg"));
format->insertItem (QString ("rm")); format->insertItem (TQString ("rm"));
format->insertItem (QString ("swf")); format->insertItem (TQString ("swf"));
QWhatsThis::add (format, i18n ("Only avi, mpeg and rm work for mplayer playback")); TQWhatsThis::add (format, i18n ("Only avi, mpeg and rm work for mplayer playback"));
formatlayout->addWidget (label, 0, 0); formattqlayout->addWidget (label, 0, 0);
formatlayout->addWidget (format, 0, 1); formattqlayout->addWidget (format, 0, 1);
ADDPROPERTY (i18n ("Audio codec:"), audiocodec, formatlayout, 1, this); ADDPROPERTY (i18n ("Audio codec:"), audiocodec, formattqlayout, 1, this);
ADDPROPERTY (i18n ("Audio bit rate (kbit):"), audiobitrate, formatlayout, 2, this); ADDPROPERTY (i18n ("Audio bit rate (kbit):"), audiobitrate, formattqlayout, 2, this);
ADDPROPERTY (i18n ("Audio sample rate (Hz):"), audiosamplerate, formatlayout, 3, this); ADDPROPERTY (i18n ("Audio sample rate (Hz):"), audiosamplerate, formattqlayout, 3, this);
ADDPROPERTY (i18n ("Video codec:"), videocodec, formatlayout, 4, this); ADDPROPERTY (i18n ("Video codec:"), videocodec, formattqlayout, 4, this);
ADDPROPERTY (i18n ("Video bit rate (kbit):"), videobitrate, formatlayout, 5, this); ADDPROPERTY (i18n ("Video bit rate (kbit):"), videobitrate, formattqlayout, 5, this);
ADDPROPERTY (i18n ("Quality (1-31):"), quality, formatlayout, 6, this); ADDPROPERTY (i18n ("Quality (1-31):"), quality, formattqlayout, 6, this);
ADDPROPERTY (i18n ("Frame rate (Hz):"), framerate, formatlayout, 7, this); ADDPROPERTY (i18n ("Frame rate (Hz):"), framerate, formattqlayout, 7, this);
ADDPROPERTY (i18n ("Gop size:"), gopsize, formatlayout, 8, this); ADDPROPERTY (i18n ("Gop size:"), gopsize, formattqlayout, 8, this);
ADDPROPERTY (i18n ("Width (pixels):"), moviewidth, formatlayout, 9, this); ADDPROPERTY (i18n ("Width (pixels):"), moviewidth, formattqlayout, 9, this);
ADDPROPERTY (i18n ("Height (pixels):"), movieheight, formatlayout, 10, this); ADDPROPERTY (i18n ("Height (pixels):"), movieheight, formattqlayout, 10, this);
label = new QLabel (i18n ("Allow access from:"), this); label = new TQLabel (i18n ("Allow access from:"), this);
accesslist = new QTable (40, 1, this); accesslist = new TQTable (40, 1, this);
accesslist->verticalHeader ()->hide (); accesslist->verticalHeader ()->hide ();
accesslist->setLeftMargin (0); accesslist->setLeftMargin (0);
accesslist->setColumnWidth (0, 250); accesslist->setColumnWidth (0, 250);
QWhatsThis::add (accesslist, i18n ("'Single IP' or 'start-IP end-IP' for IP ranges")); TQWhatsThis::add (accesslist, i18n ("'Single IP' or 'start-IP end-IP' for IP ranges"));
QHeader *header = accesslist->horizontalHeader (); TQHeader *header = accesslist->horizontalHeader ();
header->setLabel (0, i18n ("Host/IP or IP Range")); header->setLabel (0, i18n ("Host/IP or IP Range"));
QFrame *profileframe = new QFrame (this); TQFrame *profileframe = new TQFrame (this);
QGridLayout *profileslayout = new QGridLayout (profileframe, 5, 2, 2); TQGridLayout *profilestqlayout = new TQGridLayout (profileframe, 5, 2, 2);
profile = new QLineEdit ("", profileframe); profile = new TQLineEdit ("", profileframe);
connect (profile, SIGNAL(textChanged (const QString &)), connect (profile, TQT_SIGNAL(textChanged (const TQString &)),
this, SLOT (slotTextChanged (const QString &))); this, TQT_SLOT (slotTextChanged (const TQString &)));
profilelist = new QListBox (profileframe); profilelist = new TQListBox (profileframe);
for (int i = 0; i < (int) profiles.size (); i++) for (int i = 0; i < (int) profiles.size (); i++)
profilelist->insertItem (profiles[i]->name, i); profilelist->insertItem (profiles[i]->name, i);
connect (profilelist, SIGNAL (selected (int)), connect (profilelist, TQT_SIGNAL (selected (int)),
this, SLOT (slotIndexChanged (int))); this, TQT_SLOT (slotIndexChanged (int)));
connect (profilelist, SIGNAL (highlighted (int)), connect (profilelist, TQT_SIGNAL (highlighted (int)),
this, SLOT (slotItemHighlighted (int))); this, TQT_SLOT (slotItemHighlighted (int)));
load = new QPushButton (i18n ("Load"), profileframe); load = new TQPushButton (i18n ("Load"), profileframe);
save = new QPushButton (i18n ("Save"), profileframe); save = new TQPushButton (i18n ("Save"), profileframe);
del = new QPushButton (i18n ("Delete"), profileframe); del = new TQPushButton (i18n ("Delete"), profileframe);
load->setEnabled (false); load->setEnabled (false);
save->setEnabled (false); save->setEnabled (false);
del->setEnabled (false); del->setEnabled (false);
connect (load, SIGNAL (clicked ()), this, SLOT (slotLoad ())); connect (load, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotLoad ()));
connect (save, SIGNAL (clicked ()), this, SLOT (slotSave ())); connect (save, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotSave ()));
connect (del, SIGNAL (clicked ()), this, SLOT (slotDelete ())); connect (del, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotDelete ()));
profileslayout->addWidget (profile, 0, 0); profilestqlayout->addWidget (profile, 0, 0);
#if (QT_VERSION < 0x030200) profilestqlayout->setRowSpacing (4, 60);
profileslayout->addRowSpacing (4, 60); profilestqlayout->addMultiCellWidget (profilelist, 1, 4, 0, 0);
#else profilestqlayout->addWidget (load, 1, 1);
profileslayout->setRowSpacing (4, 60); profilestqlayout->addWidget (save, 2, 1);
#endif profilestqlayout->addWidget (del, 3, 1);
profileslayout->addMultiCellWidget (profilelist, 1, 4, 0, 0); lefttqlayout->addWidget (profileframe);
profileslayout->addWidget (load, 1, 1); startbutton = new TQPushButton (i18n ("Start"), this);
profileslayout->addWidget (save, 2, 1); serverled = new KLed (TQt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
profileslayout->addWidget (del, 3, 1); feedled = new KLed (TQt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
leftlayout->addWidget (profileframe); ledtqlayout->addWidget (startbutton);
startbutton = new QPushButton (i18n ("Start"), this); ledtqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
serverled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this); ledtqlayout->addWidget (serverled);
feedled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this); ledtqlayout->addWidget (feedled);
ledlayout->addWidget (startbutton); lefttqlayout->addLayout (ledtqlayout);
ledlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum)); TQFrame * line = new TQFrame (this);
ledlayout->addWidget (serverled); line->setFrameShape (TQFrame::HLine);
ledlayout->addWidget (feedled); lefttqlayout->addWidget (line);
leftlayout->addLayout (ledlayout); lefttqlayout->addWidget (label);
QFrame * line = new QFrame (this); lefttqlayout->addWidget (accesslist);
line->setFrameShape (QFrame::HLine); lefttqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
leftlayout->addWidget (line); tqlayout->addLayout (lefttqlayout);
leftlayout->addWidget (label); line = new TQFrame (this);
leftlayout->addWidget (accesslist); line->setFrameShape (TQFrame::VLine);
leftlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); tqlayout->addWidget (line);
layout->addLayout (leftlayout); tqlayout->addLayout (formattqlayout);
line = new QFrame (this); tqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
line->setFrameShape (QFrame::VLine);
layout->addWidget (line);
layout->addLayout (formatlayout);
layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
} }
#undef ADDPROPERTY #undef ADDPROPERTY
@ -301,10 +297,10 @@ KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::setSettings (const FFServerS
movieheight->setText (fs.height); movieheight->setText (fs.height);
accesslist->setNumRows (0); accesslist->setNumRows (0);
accesslist->setNumRows (50); accesslist->setNumRows (50);
QStringList::const_iterator it = fs.acl.begin (); TQStringList::const_iterator it = fs.acl.begin ();
QStringList::const_iterator end( fs.acl.end () ); TQStringList::const_iterator end( fs.acl.end () );
for (int i = 0; it != end; ++i, ++it) for (int i = 0; it != end; ++i, ++it)
accesslist->setItem (i, 0, new QTableItem (accesslist, QTableItem::Always, *it)); accesslist->setItem (i, 0, new TQTableItem (accesslist, TQTableItem::Always, *it));
} }
KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::getSettings (FFServerSetting & fs) { KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::getSettings (FFServerSetting & fs) {
@ -332,7 +328,7 @@ KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::slotIndexChanged (int index)
setSettings (*profiles[index]); setSettings (*profiles[index]);
} }
KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::slotTextChanged (const QString & txt) { KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::slotTextChanged (const TQString & txt) {
save->setEnabled (txt.length ()); save->setEnabled (txt.length ());
} }
@ -419,10 +415,10 @@ KDE_NO_CDTOR_EXPORT KMPlayerBroadcastConfig::~KMPlayerBroadcastConfig () {
KDE_NO_EXPORT void KMPlayerBroadcastConfig::write (KConfig * config) { KDE_NO_EXPORT void KMPlayerBroadcastConfig::write (KConfig * config) {
config->setGroup (strBroadcast); config->setGroup (strBroadcast);
config->writeEntry (strFFServerCustomSetting, ffserversettings.list (), ';'); config->writeEntry (strFFServerCustomSetting, ffserversettings.list (), ';');
QStringList sl; TQStringList sl;
for (int i = 0; i < (int) ffserversettingprofiles.size (); i++) { for (int i = 0; i < (int) ffserversettingprofiles.size (); i++) {
sl.push_back (ffserversettingprofiles[i]->name); sl.push_back (ffserversettingprofiles[i]->name);
config->writeEntry (QString ("Profile_") + ffserversettingprofiles[i]->name, ffserversettingprofiles[i]->list(), ';'); config->writeEntry (TQString ("Profile_") + ffserversettingprofiles[i]->name, ffserversettingprofiles[i]->list(), ';');
} }
config->writeEntry (strFFServerProfiles, sl, ';'); config->writeEntry (strFFServerProfiles, sl, ';');
} }
@ -432,11 +428,11 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::read (KConfig * config) {
ffserversettingprofiles.clear (); ffserversettingprofiles.clear ();
config->setGroup (strBroadcast); config->setGroup (strBroadcast);
ffserversettings = config->readListEntry (strFFServerCustomSetting, ';'); ffserversettings = config->readListEntry (strFFServerCustomSetting, ';');
QStringList profiles = config->readListEntry (strFFServerProfiles, ';'); TQStringList profiles = config->readListEntry (strFFServerProfiles, ';');
QStringList::iterator pr_it = profiles.begin (); TQStringList::iterator pr_it = profiles.begin ();
QStringList::iterator pr_end( profiles.end () ); TQStringList::iterator pr_end( profiles.end () );
for (; pr_it != pr_end; ++pr_it) { for (; pr_it != pr_end; ++pr_it) {
QStringList sl = config->readListEntry (QString ("Profile_") + *pr_it, ';'); TQStringList sl = config->readListEntry (TQString ("Profile_") + *pr_it, ';');
if (sl.size () > 10) { if (sl.size () > 10) {
FFServerSetting * ffs = new FFServerSetting (sl); FFServerSetting * ffs = new FFServerSetting (sl);
ffs->name = *pr_it; ffs->name = *pr_it;
@ -450,21 +446,21 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::sync (bool fromUI) {
m_configpage->getSettings(ffserversettings); m_configpage->getSettings(ffserversettings);
} else { } else {
m_configpage->setSettings (ffserversettings); m_configpage->setSettings (ffserversettings);
m_configpage->profile->setText (QString ()); m_configpage->profile->setText (TQString ());
} }
} }
KDE_NO_EXPORT void KMPlayerBroadcastConfig::prefLocation (QString & item, QString & icon, QString & tab) { KDE_NO_EXPORT void KMPlayerBroadcastConfig::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Broadcasting"); item = i18n ("Broadcasting");
icon = QString ("share"); icon = TQString ("share");
tab = i18n ("Profiles"); tab = i18n ("Profiles");
} }
QFrame * KMPlayerBroadcastConfig::prefPage (QWidget * parent) { TQFrame * KMPlayerBroadcastConfig::prefPage (TQWidget * tqparent) {
if (!m_configpage) { if (!m_configpage) {
m_configpage = new KMPlayerPrefBroadcastFormatPage (parent, ffserversettingprofiles); m_configpage = new KMPlayerPrefBroadcastFormatPage (tqparent, ffserversettingprofiles);
connect (m_configpage->startbutton, SIGNAL (clicked ()), this, SLOT (startServer ())); connect (m_configpage->startbutton, TQT_SIGNAL (clicked ()), this, TQT_SLOT (startServer ()));
connect (m_player, SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)), this, SLOT (sourceChanged (KMPlayer::Source *,KMPlayer::Source *))); connect (m_player, TQT_SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)), this, TQT_SLOT (sourceChanged (KMPlayer::Source *,KMPlayer::Source *)));
m_configpage->startbutton->setEnabled m_configpage->startbutton->setEnabled
(!m_player->source ()->videoDevice ().isEmpty ()); (!m_player->source ()->videoDevice ().isEmpty ());
} }
@ -489,25 +485,25 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::startServer () {
stopServer (); stopServer ();
return; return;
} }
m_configpage->setCursor (QCursor (Qt::WaitCursor)); m_configpage->setCursor (TQCursor (TQt::WaitCursor));
m_ffserver_process = new KProcess; m_ffserver_process = new KProcess;
m_ffserver_process->setUseShell (true); m_ffserver_process->setUseShell (true);
connect (m_ffserver_process, SIGNAL (processExited (KProcess *)), connect (m_ffserver_process, TQT_SIGNAL (processExited (KProcess *)),
this, SLOT (processStopped (KProcess *))); this, TQT_SLOT (processStopped (KProcess *)));
QString conffile = locateLocal ("data", "kmplayer/ffserver.conf"); TQString conffile = locateLocal ("data", "kmplayer/ffserver.conf");
const char * noaudio = m_player->source ()->audioDevice ().isEmpty () ? "NoAudio" : ""; const char * noaudio = m_player->source ()->audioDevice ().isEmpty () ? "NoAudio" : "";
FFServerSetting ffs; FFServerSetting ffs;
m_configpage->getSettings (ffs); m_configpage->getSettings (ffs);
QString acl; TQString acl;
QStringList::iterator it = ffs.acl.begin (); TQStringList::iterator it = ffs.acl.begin ();
QStringList::iterator end( ffs.acl.end () ); TQStringList::iterator end( ffs.acl.end () );
for (; it != end; ++it) for (; it != end; ++it)
acl += QString ("ACL allow ") + *it + QString ("\n"); acl += TQString ("ACL allow ") + *it + TQString ("\n");
unlink (m_ffserverconfig->feedfile.ascii ()); unlink (m_ffserverconfig->feedfile.ascii ());
QFile qfile (conffile); TQFile qfile (conffile);
qfile.open (IO_WriteOnly); qfile.open (IO_WriteOnly);
QString configdata; TQString configdata;
QString buf; TQString buf;
configdata.sprintf (ffserverconf, m_ffserverconfig->ffserverport, m_ffserverconfig->bindaddress.ascii (), m_ffserverconfig->maxclients, m_ffserverconfig->maxbandwidth, m_ffserverconfig->feedfile.ascii (), m_ffserverconfig->feedfilesize, ffs.format.ascii (), acl.ascii (), ffs.ffconfig (buf).ascii (), noaudio); configdata.sprintf (ffserverconf, m_ffserverconfig->ffserverport, m_ffserverconfig->bindaddress.ascii (), m_ffserverconfig->maxclients, m_ffserverconfig->maxbandwidth, m_ffserverconfig->feedfile.ascii (), m_ffserverconfig->feedfilesize, ffs.format.ascii (), acl.ascii (), ffs.ffconfig (buf).ascii (), noaudio);
qfile.writeBlock (configdata.ascii (), configdata.length ()); qfile.writeBlock (configdata.ascii (), configdata.length ());
qfile.close (); qfile.close ();
@ -516,15 +512,15 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::startServer () {
*m_ffserver_process << "ffserver -f " << conffile; *m_ffserver_process << "ffserver -f " << conffile;
m_ffserver_out.truncate (0); m_ffserver_out.truncate (0);
connect (m_ffserver_process, connect (m_ffserver_process,
SIGNAL (receivedStderr (KProcess *, char *, int)), TQT_SIGNAL (receivedStderr (KProcess *, char *, int)),
this, SLOT (processOutput (KProcess *, char *, int))); this, TQT_SLOT (processOutput (KProcess *, char *, int)));
m_ffserver_process->start (KProcess::NotifyOnExit, KProcess::Stderr); m_ffserver_process->start (KProcess::NotifyOnExit, KProcess::Stderr);
if (m_ffserver_process->isRunning ()) { if (m_ffserver_process->isRunning ()) {
m_configpage->startbutton->setText (i18n ("Stop")); m_configpage->startbutton->setText (i18n ("Stop"));
m_configpage->serverled->setState (KLed::On); m_configpage->serverled->setState (KLed::On);
emit broadcastStarted (); emit broadcastStarted ();
} }
QTimer::singleShot (500, this, SLOT (startFeed ())); TQTimer::singleShot (500, this, TQT_SLOT (startFeed ()));
} }
KDE_NO_EXPORT void KMPlayerBroadcastConfig::stopServer () { KDE_NO_EXPORT void KMPlayerBroadcastConfig::stopServer () {
@ -537,7 +533,7 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::stopServer () {
KDE_NO_EXPORT void KMPlayerBroadcastConfig::processOutput (KProcess * p, char * s, int) { KDE_NO_EXPORT void KMPlayerBroadcastConfig::processOutput (KProcess * p, char * s, int) {
if (p == m_ffserver_process) if (p == m_ffserver_process)
m_ffserver_out += QString (s); m_ffserver_out += TQString (s);
} }
KDE_NO_EXPORT void KMPlayerBroadcastConfig::startFeed () { KDE_NO_EXPORT void KMPlayerBroadcastConfig::startFeed () {
@ -547,18 +543,18 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::startFeed () {
} }
FFServerSetting ffs; FFServerSetting ffs;
m_configpage->getSettings (ffs); m_configpage->getSettings (ffs);
QString ffurl; TQString ffurl;
if (!m_ffserver_process || !m_ffserver_process->isRunning ()) { if (!m_ffserver_process || !m_ffserver_process->isRunning ()) {
KMessageBox::error (m_configpage, i18n ("Failed to start ffserver.\n") + m_ffserver_out, i18n ("Error")); KMessageBox::error (m_configpage, i18n ("Failed to start ffserver.\n") + m_ffserver_out, i18n ("Error"));
goto bail_out; goto bail_out;
} }
disconnect (m_ffserver_process, SIGNAL (receivedStderr (KProcess *, char *, int)), disconnect (m_ffserver_process, TQT_SIGNAL (receivedStderr (KProcess *, char *, int)),
this, SLOT (processOutput (KProcess *, char *, int))); this, TQT_SLOT (processOutput (KProcess *, char *, int)));
if (m_ffmpeg_process) if (m_ffmpeg_process)
m_ffmpeg_process->stop (); m_ffmpeg_process->stop ();
delete m_ffmpeg_process; delete m_ffmpeg_process;
m_ffmpeg_process = new KMPlayer::FFMpeg (m_player, m_player->settings ()); m_ffmpeg_process = new KMPlayer::FFMpeg (m_player, m_player->settings ());
connect (m_ffmpeg_process, SIGNAL (stateChange (KMPlayer::Process::State, KMPlayer::Process::State)), this, SLOT (stateChange (KMPlayer::Process::State, KMPlayer::Process::State))); connect (m_ffmpeg_process, TQT_SIGNAL (stateChange (KMPlayer::Process::State, KMPlayer::Process::State)), this, TQT_SLOT (stateChange (KMPlayer::Process::State, KMPlayer::Process::State)));
ffurl.sprintf ("http://localhost:%d/kmplayer.ffm", m_ffserverconfig->ffserverport); ffurl.sprintf ("http://localhost:%d/kmplayer.ffm", m_ffserverconfig->ffserverport);
m_ffmpeg_process->setURL (KURL(ffurl)); m_ffmpeg_process->setURL (KURL(ffurl));
if (!m_ffmpeg_process->play (m_player->source (), KMPlayer::NodePtr())) { if (!m_ffmpeg_process->play (m_player->source (), KMPlayer::NodePtr())) {
@ -574,7 +570,7 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::startFeed () {
} else } else
stopServer (); stopServer ();
bail_out: bail_out:
m_configpage->setCursor (QCursor (Qt::ArrowCursor)); m_configpage->setCursor (TQCursor (TQt::ArrowCursor));
} }
KDE_NO_EXPORT void KMPlayerBroadcastConfig::stateChange (KMPlayer::Process::State old, KMPlayer::Process::State state) { KDE_NO_EXPORT void KMPlayerBroadcastConfig::stateChange (KMPlayer::Process::State old, KMPlayer::Process::State state) {
@ -586,8 +582,8 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::stateChange (KMPlayer::Process::Stat
kdDebug () << "ffmpeg process stopped " << m_endserver << endl; kdDebug () << "ffmpeg process stopped " << m_endserver << endl;
if (m_endserver && !stopProcess (m_ffserver_process)) { if (m_endserver && !stopProcess (m_ffserver_process)) {
disconnect (m_ffserver_process, disconnect (m_ffserver_process,
SIGNAL (receivedStderr (KProcess *, char *, int)), TQT_SIGNAL (receivedStderr (KProcess *, char *, int)),
this, SLOT (processOutput (KProcess *, char *, int))); this, TQT_SLOT (processOutput (KProcess *, char *, int)));
KMessageBox::error (m_configpage, i18n ("Failed to end ffserver process."), i18n ("Error")); KMessageBox::error (m_configpage, i18n ("Failed to end ffserver process."), i18n ("Error"));
processStopped (0L); processStopped (0L);
} }
@ -646,23 +642,23 @@ KDE_NO_EXPORT void KMPlayerFFServerConfig::sync (bool fromUI) {
feedfilesize = m_configpage->feedfilesize->text ().toInt(); feedfilesize = m_configpage->feedfilesize->text ().toInt();
} else { } else {
m_configpage->bindaddress->setText (bindaddress); m_configpage->bindaddress->setText (bindaddress);
m_configpage->port->setText (QString::number (ffserverport)); m_configpage->port->setText (TQString::number (ffserverport));
m_configpage->maxclients->setText (QString::number (maxclients)); m_configpage->maxclients->setText (TQString::number (maxclients));
m_configpage->maxbandwidth->setText (QString::number (maxbandwidth)); m_configpage->maxbandwidth->setText (TQString::number (maxbandwidth));
m_configpage->feedfile->setText (feedfile); m_configpage->feedfile->setText (feedfile);
m_configpage->feedfilesize->setText (QString::number (feedfilesize)); m_configpage->feedfilesize->setText (TQString::number (feedfilesize));
} }
} }
KDE_NO_EXPORT void KMPlayerFFServerConfig::prefLocation (QString & item, QString & icon, QString & tab) { KDE_NO_EXPORT void KMPlayerFFServerConfig::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Broadcasting"); item = i18n ("Broadcasting");
icon = QString ("share"); icon = TQString ("share");
tab = i18n ("FFServer"); tab = i18n ("FFServer");
} }
KDE_NO_EXPORT QFrame *KMPlayerFFServerConfig::prefPage (QWidget * parent) { KDE_NO_EXPORT TQFrame *KMPlayerFFServerConfig::prefPage (TQWidget * tqparent) {
if (!m_configpage) if (!m_configpage)
m_configpage = new KMPlayerPrefBroadcastPage (parent); m_configpage = new KMPlayerPrefBroadcastPage (tqparent);
return m_configpage; return m_configpage;
} }

@ -23,8 +23,8 @@
#include <list> #include <list>
#include <vector> #include <vector>
#include <qframe.h> #include <tqframe.h>
#include <qguardedptr.h> #include <tqguardedptr.h>
#include "kmplayerappsource.h" #include "kmplayerappsource.h"
#include "kmplayerprocess.h" #include "kmplayerprocess.h"
@ -32,11 +32,11 @@
class KMPlayerPrefBroadcastPage; // broadcast class KMPlayerPrefBroadcastPage; // broadcast
class KMPlayerPrefBroadcastFormatPage; // broadcast format class KMPlayerPrefBroadcastFormatPage; // broadcast format
class QListBox; class TQListBox;
class QComboBox; class TQComboBox;
class QLineEdit; class TQLineEdit;
class QTable; class TQTable;
class QPushButton; class TQPushButton;
class KLed; class KLed;
namespace KMPlayer { namespace KMPlayer {
@ -46,66 +46,68 @@ namespace KMPlayer {
class KMPLAYER_NO_EXPORT FFServerSetting { class KMPLAYER_NO_EXPORT FFServerSetting {
public: public:
KDE_NO_CDTOR_EXPORT FFServerSetting () {} KDE_NO_CDTOR_EXPORT FFServerSetting () {}
FFServerSetting (int i, const QString & n, const QString & f, const QString & ac, int abr, int asr, const QString & vc, int vbr, int q, int fr, int gs, int w, int h); FFServerSetting (int i, const TQString & n, const TQString & f, const TQString & ac, int abr, int asr, const TQString & vc, int vbr, int q, int fr, int gs, int w, int h);
KDE_NO_CDTOR_EXPORT FFServerSetting (const QStringList & sl) { *this = sl; } KDE_NO_CDTOR_EXPORT FFServerSetting (const TQStringList & sl) { *this = sl; }
KDE_NO_CDTOR_EXPORT ~FFServerSetting () {} KDE_NO_CDTOR_EXPORT ~FFServerSetting () {}
int index; int index;
QString name; TQString name;
QString format; TQString format;
QString audiocodec; TQString audiocodec;
QString audiobitrate; TQString audiobitrate;
QString audiosamplerate; TQString audiosamplerate;
QString videocodec; TQString videocodec;
QString videobitrate; TQString videobitrate;
QString quality; TQString quality;
QString framerate; TQString framerate;
QString gopsize; TQString gopsize;
QString width; TQString width;
QString height; TQString height;
QStringList acl; TQStringList acl;
FFServerSetting & operator = (const QStringList &); FFServerSetting & operator = (const TQStringList &);
FFServerSetting & operator = (const FFServerSetting & fs); FFServerSetting & operator = (const FFServerSetting & fs);
const QStringList list (); const TQStringList list ();
QString & ffconfig (QString & buf); TQString & ffconfig (TQString & buf);
}; };
typedef std::vector <FFServerSetting *> FFServerSettingList; typedef std::vector <FFServerSetting *> FFServerSettingList;
class KMPLAYER_NO_EXPORT KMPlayerPrefBroadcastPage : public QFrame { class KMPLAYER_NO_EXPORT KMPlayerPrefBroadcastPage : public TQFrame {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerPrefBroadcastPage (QWidget * parent); KMPlayerPrefBroadcastPage (TQWidget * tqparent);
KDE_NO_CDTOR_EXPORT ~KMPlayerPrefBroadcastPage () {} KDE_NO_CDTOR_EXPORT ~KMPlayerPrefBroadcastPage () {}
QLineEdit * bindaddress; TQLineEdit * bindaddress;
QLineEdit * port; TQLineEdit * port;
QLineEdit * maxclients; TQLineEdit * maxclients;
QLineEdit * maxbandwidth; TQLineEdit * maxbandwidth;
QLineEdit * feedfile; TQLineEdit * feedfile;
QLineEdit * feedfilesize; TQLineEdit * feedfilesize;
}; };
class KMPLAYER_NO_EXPORT KMPlayerPrefBroadcastFormatPage : public QFrame { class KMPLAYER_NO_EXPORT KMPlayerPrefBroadcastFormatPage : public TQFrame {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerPrefBroadcastFormatPage (QWidget * parent, FFServerSettingList &); KMPlayerPrefBroadcastFormatPage (TQWidget * tqparent, FFServerSettingList &);
KDE_NO_CDTOR_EXPORT ~KMPlayerPrefBroadcastFormatPage () {} KDE_NO_CDTOR_EXPORT ~KMPlayerPrefBroadcastFormatPage () {}
QListBox * profilelist; TQListBox * profilelist;
QComboBox * format; TQComboBox * format;
QLineEdit * audiocodec; TQLineEdit * audiocodec;
QLineEdit * audiobitrate; TQLineEdit * audiobitrate;
QLineEdit * audiosamplerate; TQLineEdit * audiosamplerate;
QLineEdit * videocodec; TQLineEdit * videocodec;
QLineEdit * videobitrate; TQLineEdit * videobitrate;
QLineEdit * quality; TQLineEdit * quality;
QLineEdit * framerate; TQLineEdit * framerate;
QLineEdit * gopsize; TQLineEdit * gopsize;
QLineEdit * moviewidth; TQLineEdit * moviewidth;
QLineEdit * movieheight; TQLineEdit * movieheight;
QLineEdit * profile; TQLineEdit * profile;
QPushButton * startbutton; TQPushButton * startbutton;
KLed * serverled; KLed * serverled;
KLed * feedled; KLed * feedled;
void setSettings (const FFServerSetting &); void setSettings (const FFServerSetting &);
@ -113,15 +115,15 @@ public:
private slots: private slots:
void slotIndexChanged (int index); void slotIndexChanged (int index);
void slotItemHighlighted (int index); void slotItemHighlighted (int index);
void slotTextChanged (const QString &); void slotTextChanged (const TQString &);
void slotLoad (); void slotLoad ();
void slotSave (); void slotSave ();
void slotDelete (); void slotDelete ();
private: private:
QTable * accesslist; TQTable * accesslist;
QPushButton * load; TQPushButton * load;
QPushButton * save; TQPushButton * save;
QPushButton * del; TQPushButton * del;
FFServerSettingList & profiles; FFServerSettingList & profiles;
}; };
@ -136,23 +138,24 @@ public:
virtual void write (KConfig *); virtual void write (KConfig *);
virtual void read (KConfig *); virtual void read (KConfig *);
virtual void sync (bool fromUI); virtual void sync (bool fromUI);
virtual void prefLocation (QString & item, QString & icon, QString & tab); virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual QFrame * prefPage (QWidget * parent); virtual TQFrame * prefPage (TQWidget * tqparent);
int ffserverport; int ffserverport;
int maxclients; int maxclients;
int maxbandwidth; int maxbandwidth;
QString feedfile; TQString feedfile;
int feedfilesize; int feedfilesize;
QString bindaddress; TQString bindaddress;
private: private:
QGuardedPtr <KMPlayerPrefBroadcastPage> m_configpage; TQGuardedPtr <KMPlayerPrefBroadcastPage> m_configpage;
}; };
/* /*
* Preference page for ffserver * Preference page for ffserver
*/ */
class KMPLAYER_NO_EXPORT KMPlayerBroadcastConfig : public QObject, public KMPlayer::PreferencesPage { class KMPLAYER_NO_EXPORT KMPlayerBroadcastConfig : public TQObject, public KMPlayer::PreferencesPage {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerBroadcastConfig (KMPlayer::PartBase * player, KMPlayerFFServerConfig * fsc); KMPlayerBroadcastConfig (KMPlayer::PartBase * player, KMPlayerFFServerConfig * fsc);
KDE_NO_CDTOR_EXPORT ~KMPlayerBroadcastConfig (); KDE_NO_CDTOR_EXPORT ~KMPlayerBroadcastConfig ();
@ -160,12 +163,12 @@ public:
virtual void write (KConfig *); virtual void write (KConfig *);
virtual void read (KConfig *); virtual void read (KConfig *);
virtual void sync (bool fromUI); virtual void sync (bool fromUI);
virtual void prefLocation (QString & item, QString & icon, QString & tab); virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual QFrame * prefPage (QWidget * parent); virtual TQFrame * prefPage (TQWidget * tqparent);
bool broadcasting () const; bool broadcasting () const;
void stopServer (); void stopServer ();
KDE_NO_EXPORT const QString & serverURL () const { return m_ffserver_url; } KDE_NO_EXPORT const TQString & serverURL () const { return m_ffserver_url; }
FFServerSetting ffserversettings; FFServerSetting ffserversettings;
FFServerSettingList ffserversettingprofiles; FFServerSettingList ffserversettingprofiles;
@ -182,12 +185,12 @@ private slots:
private: private:
KMPlayer::PartBase * m_player; KMPlayer::PartBase * m_player;
KMPlayerFFServerConfig * m_ffserverconfig; KMPlayerFFServerConfig * m_ffserverconfig;
QGuardedPtr <KMPlayerPrefBroadcastFormatPage> m_configpage; TQGuardedPtr <KMPlayerPrefBroadcastFormatPage> m_configpage;
KMPlayer::FFMpeg * m_ffmpeg_process; KMPlayer::FFMpeg * m_ffmpeg_process;
KProcess * m_ffserver_process; KProcess * m_ffserver_process;
bool m_endserver; bool m_endserver;
QString m_ffserver_out; TQString m_ffserver_out;
QString m_ffserver_url; TQString m_ffserver_url;
}; };

@ -19,16 +19,16 @@
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#include <config.h> #include <config.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qtextedit.h> #include <tqtextedit.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
#include <qslider.h> #include <tqslider.h>
#include <qspinbox.h> #include <tqspinbox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qfileinfo.h> #include <tqfileinfo.h>
#include <kurlrequester.h> #include <kurlrequester.h>
#include <klineedit.h> #include <klineedit.h>
@ -65,7 +65,7 @@ static OutputDriver _ads[] = {
{ "alsa5", i18n ("Advanced Linux Sound Architecture v0.5") }, { "alsa5", i18n ("Advanced Linux Sound Architecture v0.5") },
{ "alsa9", i18n ("Advanced Linux Sound Architecture v0.9") }, { "alsa9", i18n ("Advanced Linux Sound Architecture v0.9") },
{ "", i18n ("Use back-end defaults") }, { "", i18n ("Use back-end defaults") },
{ 0, QString () } { 0, TQString () }
}; };
static OutputDriver _vds [] = { static OutputDriver _vds [] = {
@ -77,7 +77,7 @@ static OutputDriver _vds [] = {
{ "gl", i18n ("OpenGL") }, { "gl", i18n ("OpenGL") },
{ "gl2", i18n ("OpenGL MT") }, { "gl2", i18n ("OpenGL MT") },
{ "xv", i18n ("XVideo") }, { "xv", i18n ("XVideo") },
{ 0, QString () } { 0, TQString () }
}; };
static const int ADRIVER_ARTS_INDEX = 4; static const int ADRIVER_ARTS_INDEX = 4;
@ -98,16 +98,16 @@ KDE_NO_CDTOR_EXPORT Settings::Settings (PartBase * player, KConfig * config)
colors [ColorSetting::playlist_active].option = "PlaylistActive"; colors [ColorSetting::playlist_active].option = "PlaylistActive";
colors [ColorSetting::playlist_active].color = KGlobalSettings::linkColor(); colors [ColorSetting::playlist_active].color = KGlobalSettings::linkColor();
colors [ColorSetting::console_background].option = "ConsoleBackground"; colors [ColorSetting::console_background].option = "ConsoleBackground";
colors [ColorSetting::console_background].color = QColor (0, 0, 0); colors [ColorSetting::console_background].color = TQColor (0, 0, 0);
colors [ColorSetting::console_foreground].title = i18n ("Console foreground"); colors [ColorSetting::console_foreground].title = i18n ("Console foreground");
colors [ColorSetting::console_foreground].option = "ConsoleForeground"; colors [ColorSetting::console_foreground].option = "ConsoleForeground";
colors [ColorSetting::console_foreground].color = QColor (0xB2, 0xB2, 0xB2); colors [ColorSetting::console_foreground].color = TQColor (0xB2, 0xB2, 0xB2);
colors [ColorSetting::video_background].title = i18n ("Video background"); colors [ColorSetting::video_background].title = i18n ("Video background");
colors [ColorSetting::video_background].option = "VideoBackground"; colors [ColorSetting::video_background].option = "VideoBackground";
colors [ColorSetting::video_background].color = QColor (0, 0, 0); colors [ColorSetting::video_background].color = TQColor (0, 0, 0);
colors [ColorSetting::area_background].title = i18n ("Viewing area background"); colors [ColorSetting::area_background].title = i18n ("Viewing area background");
colors [ColorSetting::area_background].option = "ViewingAreaBackground"; colors [ColorSetting::area_background].option = "ViewingAreaBackground";
colors [ColorSetting::area_background].color = QColor (0, 0, 0); colors [ColorSetting::area_background].color = TQColor (0, 0, 0);
colors [ColorSetting::infowindow_background].title = i18n ("Info window background"); colors [ColorSetting::infowindow_background].title = i18n ("Info window background");
colors [ColorSetting::infowindow_background].option ="InfoWindowBackground"; colors [ColorSetting::infowindow_background].option ="InfoWindowBackground";
colors [ColorSetting::infowindow_background].color = KGlobalSettings::baseColor (); colors [ColorSetting::infowindow_background].color = KGlobalSettings::baseColor ();
@ -223,7 +223,7 @@ KDE_NO_EXPORT void Settings::applyColorSetting (bool only_changed_ones) {
view->playList()->setActiveForegroundColor (colors[i].color); view->playList()->setActiveForegroundColor (colors[i].color);
break; break;
case ColorSetting::console_background: case ColorSetting::console_background:
view->console()->setPaper (QBrush (colors[i].color)); view->console()->setPaper (TQBrush (colors[i].color));
break; break;
case ColorSetting::console_foreground: case ColorSetting::console_foreground:
view->console()->setColor(colors[i].color); view->console()->setColor(colors[i].color);
@ -235,7 +235,7 @@ KDE_NO_EXPORT void Settings::applyColorSetting (bool only_changed_ones) {
view->viewArea()->setPaletteBackgroundColor(colors[i].color); view->viewArea()->setPaletteBackgroundColor(colors[i].color);
break; break;
case ColorSetting::infowindow_background: case ColorSetting::infowindow_background:
view->infoPanel ()->setPaper (QBrush (colors[i].color)); view->infoPanel ()->setPaper (TQBrush (colors[i].color));
break; break;
case ColorSetting::infowindow_foreground: case ColorSetting::infowindow_foreground:
view->infoPanel()->setPaletteForegroundColor(colors[i].color); view->infoPanel()->setPaletteForegroundColor(colors[i].color);
@ -277,8 +277,8 @@ KDE_NO_EXPORT void Settings::readConfig () {
brightness = m_config->readNumEntry (strBrightness, 0); brightness = m_config->readNumEntry (strBrightness, 0);
hue = m_config->readNumEntry (strHue, 0); hue = m_config->readNumEntry (strHue, 0);
saturation = m_config->readNumEntry (strSaturation, 0); saturation = m_config->readNumEntry (strSaturation, 0);
const QMap <QString, Source*>::const_iterator e = m_player->sources ().end (); const TQMap <TQString, Source*>::const_iterator e = m_player->sources ().end ();
QMap <QString, Source *>::const_iterator i = m_player->sources().begin (); TQMap <TQString, Source *>::const_iterator i = m_player->sources().begin ();
for (; i != e; ++i) for (; i != e; ++i)
backends[i.data()->name ()] = m_config->readEntry (i.data()->name ()); backends[i.data()->name ()] = m_config->readEntry (i.data()->name ());
for (int i = 0; i < int (ColorSetting::last_target); i++) for (int i = 0; i < int (ColorSetting::last_target); i++)
@ -311,7 +311,7 @@ KDE_NO_EXPORT void Settings::readConfig () {
m_config->setGroup (strRecordingGroup); m_config->setGroup (strRecordingGroup);
mencoderarguments = m_config->readEntry (strMencoderArgs, "-oac mp3lame -ovc lavc"); mencoderarguments = m_config->readEntry (strMencoderArgs, "-oac mp3lame -ovc lavc");
ffmpegarguments = m_config->readEntry (strFFMpegArgs, "-f avi -acodec mp3 -vcodec mpeg4"); ffmpegarguments = m_config->readEntry (strFFMpegArgs, "-f avi -acodec mp3 -vcodec mpeg4");
recordfile = m_config->readPathEntry(strRecordingFile, QDir::homeDirPath () + "/record.avi"); recordfile = m_config->readPathEntry(strRecordingFile, TQDir::homeDirPath () + "/record.avi");
recorder = Recorder (m_config->readNumEntry (strRecorder, int (MEncoder))); recorder = Recorder (m_config->readNumEntry (strRecorder, int (MEncoder)));
replayoption = ReplayOption (m_config->readNumEntry (strAutoPlayAfterRecording, ReplayFinished)); replayoption = ReplayOption (m_config->readNumEntry (strAutoPlayAfterRecording, ReplayFinished));
replaytime = m_config->readNumEntry (strAutoPlayAfterTime, 60); replaytime = m_config->readNumEntry (strAutoPlayAfterTime, 60);
@ -363,15 +363,15 @@ KDE_NO_EXPORT bool Settings::createDialog () {
for (PartBase::ProcessMap::const_iterator i = m_player->players ().begin(); i != e; ++i) { for (PartBase::ProcessMap::const_iterator i = m_player->players ().begin(); i != e; ++i) {
Process * p = i.data (); Process * p = i.data ();
if (p->supports ("urlsource")) if (p->supports ("urlsource"))
configdialog->m_SourcePageURL->backend->insertItem (p->menuName ().remove (QChar ('&')), id++); configdialog->m_SourcePageURL->backend->insertItem (p->menuName ().remove (TQChar ('&')), id++);
} }
connect (configdialog, SIGNAL (okClicked ()), connect (configdialog, TQT_SIGNAL (okClicked ()),
this, SLOT (okPressed ())); this, TQT_SLOT (okPressed ()));
connect (configdialog, SIGNAL (applyClicked ()), connect (configdialog, TQT_SIGNAL (applyClicked ()),
this, SLOT (okPressed ())); this, TQT_SLOT (okPressed ()));
if (KApplication::kApplication()) if (KApplication::kApplication())
connect (configdialog, SIGNAL (helpClicked ()), connect (configdialog, TQT_SIGNAL (helpClicked ()),
this, SLOT (getHelp ())); this, TQT_SLOT (getHelp ()));
return true; return true;
} }
@ -429,18 +429,18 @@ void Settings::show (const char * pagename) {
configdialog->m_SourcePageURL->sub_urllist->insertStringList (sub_urllist); configdialog->m_SourcePageURL->sub_urllist->insertStringList (sub_urllist);
configdialog->m_SourcePageURL->sub_urllist->setCurrentText (m_player->source ()->subUrl ().prettyURL ()); configdialog->m_SourcePageURL->sub_urllist->setCurrentText (m_player->source ()->subUrl ().prettyURL ());
configdialog->m_SourcePageURL->changed = false; configdialog->m_SourcePageURL->changed = false;
configdialog->m_SourcePageURL->prefBitRate->setText (QString::number (prefbitrate)); configdialog->m_SourcePageURL->prefBitRate->setText (TQString::number (prefbitrate));
configdialog->m_SourcePageURL->maxBitRate->setText (QString::number (maxbitrate)); configdialog->m_SourcePageURL->maxBitRate->setText (TQString::number (maxbitrate));
configdialog->m_GeneralPageOutput->videoDriver->setCurrentItem (videodriver); configdialog->m_GeneralPageOutput->videoDriver->setCurrentItem (videodriver);
configdialog->m_GeneralPageOutput->audioDriver->setCurrentItem (audiodriver); configdialog->m_GeneralPageOutput->audioDriver->setCurrentItem (audiodriver);
configdialog->m_SourcePageURL->backend->setCurrentItem (configdialog->m_SourcePageURL->backend->findItem (backends["urlsource"])); configdialog->m_SourcePageURL->backend->setCurrentItem (configdialog->m_SourcePageURL->backend->tqfindItem (backends["urlsource"]));
int id = 0; int id = 0;
const PartBase::ProcessMap::const_iterator e = m_player->players ().end (); const PartBase::ProcessMap::const_iterator e = m_player->players ().end ();
for (PartBase::ProcessMap::const_iterator i = m_player->players ().begin(); i != e; ++i) { for (PartBase::ProcessMap::const_iterator i = m_player->players ().begin(); i != e; ++i) {
Process * p = i.data (); Process * p = i.data ();
if (p->supports ("urlsource")) { if (p->supports ("urlsource")) {
if (backends["urlsource"] == QString (p->name())) if (backends["urlsource"] == TQString (p->name()))
configdialog->m_SourcePageURL->backend->setCurrentItem (id); configdialog->m_SourcePageURL->backend->setCurrentItem (id);
id++; id++;
} }
@ -484,7 +484,7 @@ void Settings::show (const char * pagename) {
configdialog->m_RecordPage->recorder->setButton (int (recorder)); configdialog->m_RecordPage->recorder->setButton (int (recorder));
configdialog->m_RecordPage->replayClicked (int (replayoption)); configdialog->m_RecordPage->replayClicked (int (replayoption));
configdialog->m_RecordPage->recorderClicked (int (recorder)); configdialog->m_RecordPage->recorderClicked (int (recorder));
configdialog->m_RecordPage->replaytime->setText (QString::number (replaytime)); configdialog->m_RecordPage->replaytime->setText (TQString::number (replaytime));
configdialog->m_MEncoderPage->arguments->setText (mencoderarguments); configdialog->m_MEncoderPage->arguments->setText (mencoderarguments);
configdialog->m_MEncoderPage->format->setButton (recordcopy ? 0 : 1); configdialog->m_MEncoderPage->format->setButton (recordcopy ? 0 : 1);
configdialog->m_MEncoderPage->formatClicked (recordcopy ? 0 : 1); configdialog->m_MEncoderPage->formatClicked (recordcopy ? 0 : 1);
@ -497,7 +497,7 @@ void Settings::show (const char * pagename) {
if (pagename) if (pagename)
configDialog ()->setPage (pagename); configDialog ()->setPage (pagename);
if (created) if (created)
configdialog->resize (configdialog->minimumSize ()); configdialog->resize (configdialog->tqminimumSize ());
configdialog->show (); configdialog->show ();
} }
@ -512,8 +512,8 @@ void Settings::writeConfig () {
m_config->writeEntry (strBrightness, brightness); m_config->writeEntry (strBrightness, brightness);
m_config->writeEntry (strHue, hue); m_config->writeEntry (strHue, hue);
m_config->writeEntry (strSaturation, saturation); m_config->writeEntry (strSaturation, saturation);
const QMap<QString,QString>::iterator b_end = backends.end (); const TQMap<TQString,TQString>::iterator b_end = backends.end ();
for (QMap<QString,QString>::iterator i = backends.begin(); i != b_end; ++i) for (TQMap<TQString,TQString>::iterator i = backends.begin(); i != b_end; ++i)
m_config->writeEntry (i.key (), i.data ()); m_config->writeEntry (i.key (), i.data ());
for (int i = 0; i < int (ColorSetting::last_target); i++) for (int i = 0; i < int (ColorSetting::last_target); i++)
m_config->writeEntry (colors[i].option, colors[i].color); m_config->writeEntry (colors[i].option, colors[i].color);
@ -598,13 +598,13 @@ void Settings::okPressed () {
else { else {
if (KURL::fromPathOrURL (configdialog->m_SourcePageURL->url->url ()).isLocalFile () || if (KURL::fromPathOrURL (configdialog->m_SourcePageURL->url->url ()).isLocalFile () ||
KURL::isRelativeURL (configdialog->m_SourcePageURL->url->url ())) { KURL::isRelativeURL (configdialog->m_SourcePageURL->url->url ())) {
QFileInfo fi (configdialog->m_SourcePageURL->url->url ()); TQFileInfo fi (configdialog->m_SourcePageURL->url->url ());
int hpos = configdialog->m_SourcePageURL->url->url ().findRev ('#'); int hpos = configdialog->m_SourcePageURL->url->url ().tqfindRev ('#');
QString xine_directives (""); TQString xine_directives ("");
while (!fi.exists () && hpos > -1) { while (!fi.exists () && hpos > -1) {
xine_directives = configdialog->m_SourcePageURL->url->url ().mid (hpos); xine_directives = configdialog->m_SourcePageURL->url->url ().mid (hpos);
fi.setFile (configdialog->m_SourcePageURL->url->url ().left (hpos)); fi.setFile (configdialog->m_SourcePageURL->url->url ().left (hpos));
hpos = configdialog->m_SourcePageURL->url->url ().findRev ('#', hpos-1); hpos = configdialog->m_SourcePageURL->url->url ().tqfindRev ('#', hpos-1);
} }
if (!fi.exists ()) { if (!fi.exists ()) {
urlchanged = false; urlchanged = false;
@ -616,10 +616,10 @@ void Settings::okPressed () {
!configdialog->m_SourcePageURL->sub_url->url ().isEmpty () && !configdialog->m_SourcePageURL->sub_url->url ().isEmpty () &&
(KURL::fromPathOrURL (configdialog->m_SourcePageURL->sub_url->url ()).isLocalFile () || (KURL::fromPathOrURL (configdialog->m_SourcePageURL->sub_url->url ()).isLocalFile () ||
KURL::isRelativeURL (configdialog->m_SourcePageURL->sub_url->url ()))) { KURL::isRelativeURL (configdialog->m_SourcePageURL->sub_url->url ()))) {
QFileInfo sfi (configdialog->m_SourcePageURL->sub_url->url ()); TQFileInfo sfi (configdialog->m_SourcePageURL->sub_url->url ());
if (!sfi.exists ()) { if (!sfi.exists ()) {
KMessageBox::error (m_player->view (), i18n ("Sub title file %1 does not exist.").arg (configdialog->m_SourcePageURL->sub_url->url ()), i18n ("Error")); KMessageBox::error (m_player->view (), i18n ("Sub title file %1 does not exist.").arg (configdialog->m_SourcePageURL->sub_url->url ()), i18n ("Error"));
configdialog->m_SourcePageURL->sub_url->setURL (QString ()); configdialog->m_SourcePageURL->sub_url->setURL (TQString ());
} else } else
configdialog->m_SourcePageURL->sub_url->setURL (sfi.absFilePath ()); configdialog->m_SourcePageURL->sub_url->setURL (sfi.absFilePath ());
} }
@ -628,10 +628,10 @@ void Settings::okPressed () {
if (urlchanged) { if (urlchanged) {
KURL url = KURL::fromPathOrURL (configdialog->m_SourcePageURL->url->url ()); KURL url = KURL::fromPathOrURL (configdialog->m_SourcePageURL->url->url ());
m_player->setURL (url); m_player->setURL (url);
if (urllist.find (url.prettyURL ()) == urllist.end ()) if (urllist.tqfind (url.prettyURL ()) == urllist.end ())
configdialog->m_SourcePageURL->urllist->insertItem (url.prettyURL (), 0); configdialog->m_SourcePageURL->urllist->insertItem (url.prettyURL (), 0);
KURL sub_url = KURL::fromPathOrURL (configdialog->m_SourcePageURL->sub_url->url ()); KURL sub_url = KURL::fromPathOrURL (configdialog->m_SourcePageURL->sub_url->url ());
if (sub_urllist.find (sub_url.prettyURL ()) == sub_urllist.end ()) if (sub_urllist.tqfind (sub_url.prettyURL ()) == sub_urllist.end ())
configdialog->m_SourcePageURL->sub_urllist->insertItem (sub_url.prettyURL (), 0); configdialog->m_SourcePageURL->sub_urllist->insertItem (sub_url.prettyURL (), 0);
} }
urllist.clear (); urllist.clear ();
@ -709,21 +709,13 @@ void Settings::okPressed () {
pp_med_int = configdialog->m_OPPagePostproc->MedianDeinterlacer->isChecked(); pp_med_int = configdialog->m_OPPagePostproc->MedianDeinterlacer->isChecked();
pp_ffmpeg_int = configdialog->m_OPPagePostproc->FfmpegDeinterlacer->isChecked(); pp_ffmpeg_int = configdialog->m_OPPagePostproc->FfmpegDeinterlacer->isChecked();
// recording // recording
#if (QT_VERSION < 0x030200)
recorder = Recorder (configdialog->m_RecordPage->recorder->id (configdialog->m_RecordPage->recorder->selected ()));
#else
recorder = Recorder (configdialog->m_RecordPage->recorder->selectedId ()); recorder = Recorder (configdialog->m_RecordPage->recorder->selectedId ());
#endif
replaytime = configdialog->m_RecordPage->replaytime->text ().toInt (); replaytime = configdialog->m_RecordPage->replaytime->text ().toInt ();
configdialog->m_RecordPage->replaytime->setText (QString::number (replaytime)); configdialog->m_RecordPage->replaytime->setText (TQString::number (replaytime));
recordfile = configdialog->m_RecordPage->url->lineEdit()->text (); recordfile = configdialog->m_RecordPage->url->lineEdit()->text ();
mencoderarguments = configdialog->m_MEncoderPage->arguments->text (); mencoderarguments = configdialog->m_MEncoderPage->arguments->text ();
ffmpegarguments = configdialog->m_FFMpegPage->arguments->text (); ffmpegarguments = configdialog->m_FFMpegPage->arguments->text ();
#if (QT_VERSION < 0x030200)
recordcopy = !configdialog->m_MEncoderPage->format->id (configdialog->m_MEncoderPage->format->selected ());
#else
recordcopy = !configdialog->m_MEncoderPage->format->selectedId (); recordcopy = !configdialog->m_MEncoderPage->format->selectedId ();
#endif
//dynamic stuff //dynamic stuff
for (PreferencesPage * p = pagelist; p; p = p->next) for (PreferencesPage * p = pagelist; p; p = p->next)

@ -23,9 +23,9 @@
#include <config.h> #include <config.h>
#endif #endif
#include <qobject.h> #include <tqobject.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qmap.h> #include <tqmap.h>
#include <kurl.h> #include <kurl.h>
@ -40,15 +40,15 @@ class View;
class OutputDriver { class OutputDriver {
public: public:
const char * driver; const char * driver;
const QString description; const TQString description;
}; };
class ColorSetting { class ColorSetting {
public: public:
QString title; TQString title;
QString option; TQString option;
QColor color; TQColor color;
QColor newcolor; TQColor newcolor;
enum Target { enum Target {
playlist_background = 0, playlist_foreground, playlist_active, playlist_background = 0, playlist_foreground, playlist_active,
console_background, console_foreground, console_background, console_foreground,
@ -60,10 +60,10 @@ public:
class FontSetting { class FontSetting {
public: public:
QString title; TQString title;
QString option; // for ini file TQString option; // for ini file
QFont font; TQFont font;
QFont newfont; TQFont newfont;
enum Target { enum Target {
playlist, infowindow, last_target playlist, infowindow, last_target
} target; } target;
@ -85,16 +85,17 @@ public:
virtual void write (KConfig *) = 0; virtual void write (KConfig *) = 0;
virtual void read (KConfig *) = 0; virtual void read (KConfig *) = 0;
virtual void sync (bool fromUI) = 0; virtual void sync (bool fromUI) = 0;
virtual void prefLocation (QString & item, QString & icon, QString & tab) = 0; virtual void prefLocation (TQString & item, TQString & icon, TQString & tab) = 0;
virtual QFrame * prefPage (QWidget * parent) = 0; virtual TQFrame * prefPage (TQWidget * tqparent) = 0;
PreferencesPage * next; PreferencesPage * next;
}; };
/* /*
* Class for storing all actual settings and reading/writing them * Class for storing all actual settings and reading/writing them
*/ */
class KMPLAYER_EXPORT Settings : public QObject { class KMPLAYER_EXPORT Settings : public TQObject {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Settings (PartBase *, KConfig * part); Settings (PartBase *, KConfig * part);
~Settings (); ~Settings ();
@ -107,8 +108,8 @@ public:
View * defaultView (); View * defaultView ();
KConfig * kconfig () { return m_config; } KConfig * kconfig () { return m_config; }
QStringList urllist; TQStringList urllist;
QStringList sub_urllist; TQStringList sub_urllist;
int volume; int volume;
int contrast; int contrast;
int brightness; int brightness;
@ -171,9 +172,9 @@ public:
enum ReplayOption { ReplayNo = 0, ReplayFinished, ReplayAfter }; enum ReplayOption { ReplayNo = 0, ReplayFinished, ReplayAfter };
ReplayOption replayoption; ReplayOption replayoption;
int replaytime; int replaytime;
QString mencoderarguments; TQString mencoderarguments;
QString ffmpegarguments; TQString ffmpegarguments;
QString recordfile; TQString recordfile;
int seektime; int seektime;
int videodriver; int videodriver;
int audiodriver; int audiodriver;
@ -181,9 +182,9 @@ public:
OutputDriver * videodrivers; OutputDriver * videodrivers;
ColorSetting colors [ColorSetting::last_target]; ColorSetting colors [ColorSetting::last_target];
FontSetting fonts [FontSetting::last_target]; FontSetting fonts [FontSetting::last_target];
QString dvddevice; TQString dvddevice;
QString vcddevice; TQString vcddevice;
QMap <QString, QString> backends; TQMap <TQString, TQString> backends;
PreferencesPage * pagelist; PreferencesPage * pagelist;
signals: signals:
void configChanged (); void configChanged ();

@ -16,13 +16,13 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
**/ **/
#include <qlayout.h> #include <tqlayout.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qslider.h> #include <tqslider.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <klocale.h> #include <klocale.h>
@ -255,46 +255,46 @@ static const char * blue_xpm[] = {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static QPushButton * ctrlButton (QWidget * w, QBoxLayout * l, const char ** p, int key = 0) { static TQPushButton * ctrlButton (TQWidget * w, TQBoxLayout * l, const char ** p, int key = 0) {
QPushButton * b = new QPushButton (QIconSet (QPixmap(p)), QString (), w); TQPushButton * b = new TQPushButton (TQIconSet (TQPixmap(p)), TQString (), w);
b->setFocusPolicy (QWidget::NoFocus); b->setFocusPolicy (TQ_NoFocus);
b->setFlat (true); b->setFlat (true);
if (key) if (key)
b->setAccel (QKeySequence (key)); b->setAccel (TQKeySequence (key));
l->addWidget (b); l->addWidget (b);
return b; return b;
} }
KDE_NO_CDTOR_EXPORT KDE_NO_CDTOR_EXPORT
KMPlayerMenuButton::KMPlayerMenuButton (QWidget * parent, QBoxLayout * l, const char ** p, int key) KMPlayerMenuButton::KMPlayerMenuButton (TQWidget * tqparent, TQBoxLayout * l, const char ** p, int key)
: QPushButton (QIconSet (QPixmap(p)), QString (), parent, "kde_kmplayer_control_button") { : TQPushButton (TQIconSet (TQPixmap(p)), TQString (), tqparent, "kde_kmplayer_control_button") {
setFocusPolicy (QWidget::NoFocus); setFocusPolicy (TQ_NoFocus);
setFlat (true); setFlat (true);
if (key) if (key)
setAccel (QKeySequence (key)); setAccel (TQKeySequence (key));
l->addWidget (this); l->addWidget (this);
} }
KDE_NO_EXPORT void KMPlayerMenuButton::enterEvent (QEvent *) { KDE_NO_EXPORT void KMPlayerMenuButton::enterEvent (TQEvent *) {
emit mouseEntered (); emit mouseEntered ();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerPopupMenu::KMPlayerPopupMenu (QWidget * parent) KDE_NO_CDTOR_EXPORT KMPlayerPopupMenu::KMPlayerPopupMenu (TQWidget * tqparent)
: KPopupMenu (parent, "kde_kmplayer_popupmenu") {} : KPopupMenu (tqparent, "kde_kmplayer_popupmenu") {}
KDE_NO_EXPORT void KMPlayerPopupMenu::leaveEvent (QEvent *) { KDE_NO_EXPORT void KMPlayerPopupMenu::leaveEvent (TQEvent *) {
emit mouseLeft (); emit mouseLeft ();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT VolumeBar::VolumeBar (QWidget * parent, View * view) KDE_NO_CDTOR_EXPORT VolumeBar::VolumeBar (TQWidget * tqparent, View * view)
: QWidget (parent), m_view (view), m_value (100) { : TQWidget (tqparent), m_view (view), m_value (100) {
setSizePolicy( QSizePolicy (QSizePolicy::Minimum, QSizePolicy::Fixed)); tqsetSizePolicy( TQSizePolicy (TQSizePolicy::Minimum, TQSizePolicy::Fixed));
setMinimumSize (QSize (51, button_height_only_buttons + 2)); setMinimumSize (TQSize (51, button_height_only_buttons + 2));
QToolTip::add (this, i18n ("Volume is %1").arg (m_value)); TQToolTip::add (this, i18n ("Volume is %1").arg (m_value));
} }
KDE_NO_CDTOR_EXPORT VolumeBar::~VolumeBar () { KDE_NO_CDTOR_EXPORT VolumeBar::~VolumeBar () {
@ -304,22 +304,22 @@ void VolumeBar::setValue (int v) {
m_value = v; m_value = v;
if (m_value < 0) m_value = 0; if (m_value < 0) m_value = 0;
if (m_value > 100) m_value = 100; if (m_value > 100) m_value = 100;
QToolTip::remove (this); TQToolTip::remove (this);
QToolTip::add (this, i18n ("Volume is %1").arg (m_value)); TQToolTip::add (this, i18n ("Volume is %1").arg (m_value));
repaint (true); tqrepaint (true);
emit volumeChanged (m_value); emit volumeChanged (m_value);
} }
void VolumeBar::wheelEvent (QWheelEvent * e) { void VolumeBar::wheelEvent (TQWheelEvent * e) {
setValue (m_value + (e->delta () > 0 ? 2 : -2)); setValue (m_value + (e->delta () > 0 ? 2 : -2));
e->accept (); e->accept ();
} }
void VolumeBar::paintEvent (QPaintEvent * e) { void VolumeBar::paintEvent (TQPaintEvent * e) {
QWidget::paintEvent (e); TQWidget::paintEvent (e);
QPainter p; TQPainter p;
p.begin (this); p.begin (this);
QColor color = paletteForegroundColor (); TQColor color = paletteForegroundColor ();
p.setPen (color); p.setPen (color);
int w = width () - 6; int w = width () - 6;
int vx = m_value * w / 100; int vx = m_value * w / 100;
@ -329,20 +329,20 @@ void VolumeBar::paintEvent (QPaintEvent * e) {
//kdDebug () << "w=" << w << " vx=" << vx << endl; //kdDebug () << "w=" << w << " vx=" << vx << endl;
} }
void VolumeBar::mousePressEvent (QMouseEvent * e) { void VolumeBar::mousePressEvent (TQMouseEvent * e) {
setValue (100 * (e->x () - 3) / (width () - 6)); setValue (100 * (e->x () - 3) / (width () - 6));
e->accept (); e->accept ();
} }
void VolumeBar::mouseMoveEvent (QMouseEvent * e) { void VolumeBar::mouseMoveEvent (TQMouseEvent * e) {
setValue (100 * (e->x () - 3) / (width () - 6)); setValue (100 * (e->x () - 3) / (width () - 6));
e->accept (); e->accept ();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(QWidget * parent, View * view) KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(TQWidget * tqparent, View * view)
: QWidget (parent), : TQWidget (tqparent),
m_progress_mode (progress_playing), m_progress_mode (progress_playing),
m_progress_length (0), m_progress_length (0),
m_popup_timer (0), m_popup_timer (0),
@ -350,17 +350,17 @@ KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(QWidget * parent, View * view)
m_view (view), m_view (view),
m_auto_controls (true), m_auto_controls (true),
m_popup_clicked (false) { m_popup_clicked (false) {
m_buttonbox = new QHBoxLayout (this, 5, 4); m_buttonbox = new TQHBoxLayout (this, 5, 4);
QColor c = paletteForegroundColor (); TQColor c = paletteForegroundColor ();
strncpy (xpm_fg_color, QString().sprintf(". c #%02x%02x%02x", c.red(), c.green(),c.blue()).ascii(), 31); strncpy (xpm_fg_color, TQString(TQString().sprintf(". c #%02x%02x%02x", c.red(), c.green(),c.blue())).ascii(), 31);
xpm_fg_color[31] = 0; xpm_fg_color[31] = 0;
m_buttons[button_config] = new KMPlayerMenuButton (this, m_buttonbox, config_xpm); m_buttons[button_config] = new KMPlayerMenuButton (this, m_buttonbox, config_xpm);
m_buttons[button_playlist] = ctrlButton (this, m_buttonbox, playlist_xpm); m_buttons[button_playlist] = ctrlButton (this, m_buttonbox, playlist_xpm);
m_buttons[button_back] = ctrlButton (this, m_buttonbox, back_xpm); m_buttons[button_back] = ctrlButton (this, m_buttonbox, back_xpm);
m_buttons[button_play] = ctrlButton(this, m_buttonbox, play_xpm, Qt::Key_R); m_buttons[button_play] = ctrlButton(this, m_buttonbox, play_xpm, TQt::Key_R);
m_buttons[button_forward] = ctrlButton (this, m_buttonbox, forward_xpm); m_buttons[button_forward] = ctrlButton (this, m_buttonbox, forward_xpm);
m_buttons[button_stop] = ctrlButton(this, m_buttonbox, stop_xpm, Qt::Key_S); m_buttons[button_stop] = ctrlButton(this, m_buttonbox, stop_xpm, TQt::Key_S);
m_buttons[button_pause]=ctrlButton(this, m_buttonbox, pause_xpm, Qt::Key_P); m_buttons[button_pause]=ctrlButton(this, m_buttonbox, pause_xpm, TQt::Key_P);
m_buttons[button_record] = ctrlButton (this, m_buttonbox, record_xpm); m_buttons[button_record] = ctrlButton (this, m_buttonbox, record_xpm);
m_buttons[button_broadcast] = ctrlButton (this, m_buttonbox, broadcast_xpm); m_buttons[button_broadcast] = ctrlButton (this, m_buttonbox, broadcast_xpm);
m_buttons[button_language] = new KMPlayerMenuButton (this, m_buttonbox, language_xpm); m_buttons[button_language] = new KMPlayerMenuButton (this, m_buttonbox, language_xpm);
@ -372,7 +372,7 @@ KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(QWidget * parent, View * view)
m_buttons[button_stop]->setToggleButton (true); m_buttons[button_stop]->setToggleButton (true);
m_buttons[button_record]->setToggleButton (true); m_buttons[button_record]->setToggleButton (true);
m_buttons[button_broadcast]->setToggleButton (true); m_buttons[button_broadcast]->setToggleButton (true);
m_posSlider = new QSlider (0, 100, 1, 0, Qt::Horizontal, this); m_posSlider = new TQSlider (0, 100, 1, 0, Qt::Horizontal, this);
m_posSlider->setEnabled (false); m_posSlider->setEnabled (false);
m_buttonbox->addWidget (m_posSlider); m_buttonbox->addWidget (m_posSlider);
setupPositionSlider (true); setupPositionSlider (true);
@ -383,81 +383,81 @@ KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(QWidget * parent, View * view)
m_popupMenu->insertItem (i18n ("&Play with"), m_playerMenu, menu_player); m_popupMenu->insertItem (i18n ("&Play with"), m_playerMenu, menu_player);
m_bookmarkMenu = new KMPlayerPopupMenu (this); m_bookmarkMenu = new KMPlayerPopupMenu (this);
m_popupMenu->insertItem (i18n("&Bookmarks"), m_bookmarkMenu, menu_bookmark); m_popupMenu->insertItem (i18n("&Bookmarks"), m_bookmarkMenu, menu_bookmark);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("konsole"), KIcon::Small, 0, true), i18n ("Con&sole"), menu_video); m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("konsole"), KIcon::Small, 0, true), i18n ("Con&sole"), menu_video);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("player_playlist"), KIcon::Small, 0, true), i18n ("Play&list"), menu_playlist); m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("player_playlist"), KIcon::Small, 0, true), i18n ("Play&list"), menu_playlist);
m_zoomMenu = new KMPlayerPopupMenu (this); m_zoomMenu = new KMPlayerPopupMenu (this);
m_zoomMenu->insertItem (i18n ("50%"), menu_zoom50); m_zoomMenu->insertItem (i18n ("50%"), menu_zoom50);
m_zoomMenu->insertItem (i18n ("100%"), menu_zoom100); m_zoomMenu->insertItem (i18n ("100%"), menu_zoom100);
m_zoomMenu->insertItem (i18n ("150%"), menu_zoom150); m_zoomMenu->insertItem (i18n ("150%"), menu_zoom150);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("viewmag"), KIcon::Small, 0, false), i18n ("&Zoom"), m_zoomMenu, menu_zoom); m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("viewmag"), KIcon::Small, 0, false), i18n ("&Zoom"), m_zoomMenu, menu_zoom);
m_popupMenu->insertItem (KGlobal::iconLoader()->loadIconSet (QString ("window_fullscreen"), KIcon::Small, 0, true), i18n ("&Full Screen"), menu_fullscreen); m_popupMenu->insertItem (KGlobal::iconLoader()->loadIconSet (TQString ("window_fullscreen"), KIcon::Small, 0, true), i18n ("&Full Screen"), menu_fullscreen);
m_popupMenu->setAccel (QKeySequence (Qt::Key_F), menu_fullscreen); m_popupMenu->setAccel (TQKeySequence (TQt::Key_F), menu_fullscreen);
m_popupMenu->insertSeparator (); m_popupMenu->insertSeparator ();
m_colorMenu = new KMPlayerPopupMenu (this); m_colorMenu = new KMPlayerPopupMenu (this);
m_languageMenu = new KMPlayerPopupMenu (this); m_languageMenu = new KMPlayerPopupMenu (this);
m_audioMenu = new KMPlayerPopupMenu (this); m_audioMenu = new KMPlayerPopupMenu (this);
m_subtitleMenu = new KMPlayerPopupMenu (this); m_subtitleMenu = new KMPlayerPopupMenu (this);
m_languageMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("mime-sound"), KIcon::Small, 0, true), i18n ("&Audio languages"), m_audioMenu); m_languageMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("mime-sound"), KIcon::Small, 0, true), i18n ("&Audio languages"), m_audioMenu);
m_languageMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("view_text"), KIcon::Small, 0, true), i18n ("&Subtitles"), m_subtitleMenu); m_languageMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("view_text"), KIcon::Small, 0, true), i18n ("&Subtitles"), m_subtitleMenu);
QLabel * label = new QLabel (i18n ("Contrast:"), m_colorMenu); TQLabel * label = new TQLabel (i18n ("Contrast:"), m_colorMenu);
m_colorMenu->insertItem (label); m_colorMenu->insertItem (label);
m_contrastSlider = new QSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu); m_contrastSlider = new TQSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_colorMenu->insertItem (m_contrastSlider); m_colorMenu->insertItem (m_contrastSlider);
label = new QLabel (i18n ("Brightness:"), m_colorMenu); label = new TQLabel (i18n ("Brightness:"), m_colorMenu);
m_colorMenu->insertItem (label); m_colorMenu->insertItem (label);
m_brightnessSlider = new QSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu); m_brightnessSlider = new TQSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_colorMenu->insertItem (m_brightnessSlider); m_colorMenu->insertItem (m_brightnessSlider);
label = new QLabel (i18n ("Hue:"), m_colorMenu); label = new TQLabel (i18n ("Hue:"), m_colorMenu);
m_colorMenu->insertItem (label); m_colorMenu->insertItem (label);
m_hueSlider = new QSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu); m_hueSlider = new TQSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_colorMenu->insertItem (m_hueSlider); m_colorMenu->insertItem (m_hueSlider);
label = new QLabel (i18n ("Saturation:"), m_colorMenu); label = new TQLabel (i18n ("Saturation:"), m_colorMenu);
m_colorMenu->insertItem (label); m_colorMenu->insertItem (label);
m_saturationSlider = new QSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu); m_saturationSlider = new TQSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_colorMenu->insertItem (m_saturationSlider); m_colorMenu->insertItem (m_saturationSlider);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("colorize"), KIcon::Small, 0, true), i18n ("Co&lors"), m_colorMenu); m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("colorize"), KIcon::Small, 0, true), i18n ("Co&lors"), m_colorMenu);
m_popupMenu->insertSeparator (); m_popupMenu->insertSeparator ();
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("configure"), KIcon::Small, 0, true), i18n ("&Configure KMPlayer..."), menu_config); m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("configure"), KIcon::Small, 0, true), i18n ("&Configure KMPlayer..."), menu_config);
setAutoControls (true); setAutoControls (true);
connect (m_buttons [button_config], SIGNAL (clicked ()), connect (m_buttons [button_config], TQT_SIGNAL (clicked ()),
this, SLOT (buttonClicked ())); this, TQT_SLOT (buttonClicked ()));
connect (m_buttons [button_language], SIGNAL (clicked ()), connect (m_buttons [button_language], TQT_SIGNAL (clicked ()),
this, SLOT (buttonClicked ())); this, TQT_SLOT (buttonClicked ()));
connect (m_buttons [button_config], SIGNAL (mouseEntered ()), connect (m_buttons [button_config], TQT_SIGNAL (mouseEntered ()),
this, SLOT (buttonMouseEntered ())); this, TQT_SLOT (buttonMouseEntered ()));
connect (m_buttons [button_language], SIGNAL (mouseEntered ()), connect (m_buttons [button_language], TQT_SIGNAL (mouseEntered ()),
this, SLOT (buttonMouseEntered ())); this, TQT_SLOT (buttonMouseEntered ()));
connect (m_popupMenu, SIGNAL (mouseLeft ()), this, SLOT (menuMouseLeft ())); connect (m_popupMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT (menuMouseLeft ()));
connect (m_playerMenu, SIGNAL (mouseLeft ()), this, SLOT(menuMouseLeft ())); connect (m_playerMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT(menuMouseLeft ()));
connect (m_zoomMenu, SIGNAL (mouseLeft ()), this, SLOT (menuMouseLeft ())); connect (m_zoomMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT (menuMouseLeft ()));
connect (m_colorMenu, SIGNAL (mouseLeft ()), this, SLOT (menuMouseLeft ())); connect (m_colorMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT (menuMouseLeft ()));
connect (m_languageMenu, SIGNAL(mouseLeft ()), this, SLOT(menuMouseLeft())); connect (m_languageMenu, TQT_SIGNAL(mouseLeft ()), this, TQT_SLOT(menuMouseLeft()));
connect (m_subtitleMenu, SIGNAL(mouseLeft ()), this, SLOT(menuMouseLeft())); connect (m_subtitleMenu, TQT_SIGNAL(mouseLeft ()), this, TQT_SLOT(menuMouseLeft()));
connect (m_audioMenu, SIGNAL (mouseLeft ()), this, SLOT (menuMouseLeft ())); connect (m_audioMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT (menuMouseLeft ()));
} }
KDE_NO_EXPORT void ControlPanel::setPalette (const QPalette & pal) { KDE_NO_EXPORT void ControlPanel::setPalette (const TQPalette & pal) {
QWidget::setPalette (pal); TQWidget::setPalette (pal);
QColor c = paletteForegroundColor (); TQColor c = paletteForegroundColor ();
strncpy (xpm_fg_color, QString().sprintf(". c #%02x%02x%02x", c.red(), c.green(),c.blue()).ascii(), 31); strncpy (xpm_fg_color, TQString(TQString().sprintf(". c #%02x%02x%02x", c.red(), c.green(),c.blue())).ascii(), 31);
xpm_fg_color[31] = 0; xpm_fg_color[31] = 0;
m_buttons[button_config]->setIconSet (QIconSet (QPixmap (config_xpm))); m_buttons[button_config]->setIconSet (TQIconSet (TQPixmap (config_xpm)));
m_buttons[button_playlist]->setIconSet (QIconSet (QPixmap (playlist_xpm))); m_buttons[button_playlist]->setIconSet (TQIconSet (TQPixmap (playlist_xpm)));
m_buttons[button_back]->setIconSet (QIconSet (QPixmap (back_xpm))); m_buttons[button_back]->setIconSet (TQIconSet (TQPixmap (back_xpm)));
m_buttons[button_play]->setIconSet (QIconSet (QPixmap (play_xpm))); m_buttons[button_play]->setIconSet (TQIconSet (TQPixmap (play_xpm)));
m_buttons[button_forward]->setIconSet (QIconSet (QPixmap (forward_xpm))); m_buttons[button_forward]->setIconSet (TQIconSet (TQPixmap (forward_xpm)));
m_buttons[button_stop]->setIconSet (QIconSet (QPixmap (stop_xpm))); m_buttons[button_stop]->setIconSet (TQIconSet (TQPixmap (stop_xpm)));
m_buttons[button_pause]->setIconSet (QIconSet (QPixmap (pause_xpm))); m_buttons[button_pause]->setIconSet (TQIconSet (TQPixmap (pause_xpm)));
m_buttons[button_record]->setIconSet (QIconSet (QPixmap (record_xpm))); m_buttons[button_record]->setIconSet (TQIconSet (TQPixmap (record_xpm)));
m_buttons[button_broadcast]->setIconSet (QIconSet (QPixmap (broadcast_xpm))); m_buttons[button_broadcast]->setIconSet (TQIconSet (TQPixmap (broadcast_xpm)));
m_buttons[button_language]->setIconSet (QIconSet (QPixmap (language_xpm))); m_buttons[button_language]->setIconSet (TQIconSet (TQPixmap (language_xpm)));
m_buttons[button_red]->setIconSet (QIconSet (QPixmap (red_xpm))); m_buttons[button_red]->setIconSet (TQIconSet (TQPixmap (red_xpm)));
m_buttons[button_green]->setIconSet (QIconSet (QPixmap (green_xpm))); m_buttons[button_green]->setIconSet (TQIconSet (TQPixmap (green_xpm)));
m_buttons[button_yellow]->setIconSet (QIconSet (QPixmap (yellow_xpm))); m_buttons[button_yellow]->setIconSet (TQIconSet (TQPixmap (yellow_xpm)));
m_buttons[button_blue]->setIconSet (QIconSet (QPixmap (blue_xpm))); m_buttons[button_blue]->setIconSet (TQIconSet (TQPixmap (blue_xpm)));
} }
KDE_NO_EXPORT void ControlPanel::timerEvent (QTimerEvent * e) { KDE_NO_EXPORT void ControlPanel::timerEvent (TQTimerEvent * e) {
if (e->timerId () == m_popup_timer) { if (e->timerId () == m_popup_timer) {
m_popup_timer = 0; m_popup_timer = 0;
if (m_button_monitored == button_config) { if (m_button_monitored == button_config) {
@ -477,7 +477,7 @@ KDE_NO_EXPORT void ControlPanel::timerEvent (QTimerEvent * e) {
!m_colorMenu->hasMouse () && !m_colorMenu->hasMouse () &&
!m_bookmarkMenu->hasMouse ()) { !m_bookmarkMenu->hasMouse ()) {
if (!(m_bookmarkMenu->isVisible () && if (!(m_bookmarkMenu->isVisible () &&
static_cast <QWidget *> (m_bookmarkMenu) != QWidget::keyboardGrabber ())) { static_cast <TQWidget *> (m_bookmarkMenu) != TQWidget::keyboardGrabber ())) {
// not if user entered the bookmark sub menu or if I forgot one // not if user entered the bookmark sub menu or if I forgot one
m_popupMenu->hide (); m_popupMenu->hide ();
if (m_buttons [button_config]->isOn ()) if (m_buttons [button_config]->isOn ())
@ -517,11 +517,11 @@ void ControlPanel::setAutoControls (bool b) {
KDE_NO_EXPORT void ControlPanel::showPopupMenu () { KDE_NO_EXPORT void ControlPanel::showPopupMenu () {
m_view->updateVolume (); m_view->updateVolume ();
m_popupMenu->exec (m_buttons [button_config]->mapToGlobal (QPoint (0, maximumSize ().height ()))); m_popupMenu->exec (m_buttons [button_config]->mapToGlobal (TQPoint (0, tqmaximumSize ().height ())));
} }
KDE_NO_EXPORT void ControlPanel::showLanguageMenu () { KDE_NO_EXPORT void ControlPanel::showLanguageMenu () {
m_languageMenu->exec (m_buttons [button_language]->mapToGlobal (QPoint (0, maximumSize ().height ()))); m_languageMenu->exec (m_buttons [button_language]->mapToGlobal (TQPoint (0, tqmaximumSize ().height ())));
} }
void ControlPanel::showPositionSlider (bool show) { void ControlPanel::showPositionSlider (bool show) {
@ -540,12 +540,12 @@ KDE_NO_EXPORT void ControlPanel::setupPositionSlider (bool show) {
m_posSlider->show (); m_posSlider->show ();
m_buttonbox->setMargin (4); m_buttonbox->setMargin (4);
m_buttonbox->setSpacing (4); m_buttonbox->setSpacing (4);
setEraseColor (m_view->topLevelWidget ()->paletteBackgroundColor ()); setEraseColor (m_view->tqtopLevelWidget ()->paletteBackgroundColor ());
} else { } else {
m_posSlider->hide (); m_posSlider->hide ();
m_buttonbox->setMargin (1); m_buttonbox->setMargin (1);
m_buttonbox->setSpacing (1); m_buttonbox->setSpacing (1);
setEraseColor (QColor (0, 0, 0)); setEraseColor (TQColor (0, 0, 0));
} }
for (int i = 0; i < (int) button_last; i++) { for (int i = 0; i < (int) button_last; i++) {
m_buttons[i]->setMinimumSize (15, h-1); m_buttons[i]->setMinimumSize (15, h-1);
@ -656,7 +656,7 @@ KDE_NO_EXPORT void ControlPanel::menuMouseLeft () {
m_popdown_timer = startTimer (400); m_popdown_timer = startTimer (400);
} }
KDE_NO_EXPORT void ControlPanel::setLanguages (const QStringList & alang, const QStringList & slang) { KDE_NO_EXPORT void ControlPanel::setLanguages (const TQStringList & alang, const TQStringList & slang) {
int sz = (int) alang.size (); int sz = (int) alang.size ();
bool showbutton = (sz > 0); bool showbutton = (sz > 0);
m_audioMenu->clear (); m_audioMenu->clear ();

@ -23,15 +23,15 @@
#include <config.h> #include <config.h>
#endif #endif
#include <qwidget.h> #include <tqwidget.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <kpopupmenu.h> #include <kpopupmenu.h>
class QSlider; class TQSlider;
//class QPushButton; //class TQPushButton;
class QBoxLayout; class TQBoxLayout;
class QStringList; class TQStringList;
class KPopupMenu; class KPopupMenu;
namespace KMPlayer { namespace KMPlayer {
@ -41,15 +41,16 @@ class View;
/* /*
* A button from the controlpanel * A button from the controlpanel
*/ */
class KMPLAYER_NO_EXPORT KMPlayerMenuButton : public QPushButton { class KMPLAYER_NO_EXPORT KMPlayerMenuButton : public TQPushButton {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerMenuButton (QWidget *, QBoxLayout *, const char **, int = 0); KMPlayerMenuButton (TQWidget *, TQBoxLayout *, const char **, int = 0);
KDE_NO_CDTOR_EXPORT ~KMPlayerMenuButton () {} KDE_NO_CDTOR_EXPORT ~KMPlayerMenuButton () {}
signals: signals:
void mouseEntered (); void mouseEntered ();
protected: protected:
void enterEvent (QEvent *); void enterEvent (TQEvent *);
}; };
/* /*
@ -57,32 +58,34 @@ protected:
*/ */
class KMPLAYER_EXPORT KMPlayerPopupMenu : public KPopupMenu { class KMPLAYER_EXPORT KMPlayerPopupMenu : public KPopupMenu {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerPopupMenu (QWidget *); KMPlayerPopupMenu (TQWidget *);
KDE_NO_CDTOR_EXPORT ~KMPlayerPopupMenu () {} KDE_NO_CDTOR_EXPORT ~KMPlayerPopupMenu () {}
signals: signals:
void mouseLeft (); void mouseLeft ();
protected: protected:
void leaveEvent (QEvent *); void leaveEvent (TQEvent *);
}; };
/* /*
* The volume bar from the controlpanel * The volume bar from the controlpanel
*/ */
class KMPLAYER_EXPORT VolumeBar : public QWidget { class KMPLAYER_EXPORT VolumeBar : public TQWidget {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
VolumeBar (QWidget * parent, View * view); VolumeBar (TQWidget * tqparent, View * view);
~VolumeBar (); ~VolumeBar ();
KDE_NO_EXPORT int value () const { return m_value; } KDE_NO_EXPORT int value () const { return m_value; }
void setValue (int v); void setValue (int v);
signals: signals:
void volumeChanged (int); // 0 - 100 void volumeChanged (int); // 0 - 100
protected: protected:
void wheelEvent (QWheelEvent * e); void wheelEvent (TQWheelEvent * e);
void paintEvent (QPaintEvent *); void paintEvent (TQPaintEvent *);
void mousePressEvent (QMouseEvent * e); void mousePressEvent (TQMouseEvent * e);
void mouseMoveEvent (QMouseEvent * e); void mouseMoveEvent (TQMouseEvent * e);
private: private:
View * m_view; View * m_view;
int m_value; int m_value;
@ -91,8 +94,9 @@ private:
/* /*
* The controlpanel GUI * The controlpanel GUI
*/ */
class KMPLAYER_EXPORT ControlPanel : public QWidget { class KMPLAYER_EXPORT ControlPanel : public TQWidget {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
enum MenuID { enum MenuID {
menu_config = 0, menu_player, menu_fullscreen, menu_volume, menu_config = 0, menu_player, menu_fullscreen, menu_volume,
@ -107,7 +111,7 @@ public:
button_red, button_green, button_yellow, button_blue, button_red, button_green, button_yellow, button_blue,
button_last button_last
}; };
ControlPanel (QWidget * parent, View * view); ControlPanel (TQWidget * tqparent, View * view);
KDE_NO_CDTOR_EXPORT ~ControlPanel () {} KDE_NO_CDTOR_EXPORT ~ControlPanel () {}
void showPositionSlider (bool show); void showPositionSlider (bool show);
void enableSeekButtons (bool enable); void enableSeekButtons (bool enable);
@ -115,27 +119,27 @@ public:
void setPlaying (bool play); void setPlaying (bool play);
void setRecording (bool record); void setRecording (bool record);
void setAutoControls (bool b); void setAutoControls (bool b);
void setPalette (const QPalette &); void setPalette (const TQPalette &);
int preferedHeight (); int preferedHeight ();
KDE_NO_EXPORT bool autoControls () const { return m_auto_controls; } KDE_NO_EXPORT bool autoControls () const { return m_auto_controls; }
KDE_NO_EXPORT QSlider * positionSlider () const { return m_posSlider; } KDE_NO_EXPORT TQSlider * positionSlider () const { return m_posSlider; }
KDE_NO_EXPORT QSlider * contrastSlider () const { return m_contrastSlider; } KDE_NO_EXPORT TQSlider * contrastSlider () const { return m_contrastSlider; }
KDE_NO_EXPORT QSlider * brightnessSlider () const { return m_brightnessSlider; } KDE_NO_EXPORT TQSlider * brightnessSlider () const { return m_brightnessSlider; }
KDE_NO_EXPORT QSlider * hueSlider () const { return m_hueSlider; } KDE_NO_EXPORT TQSlider * hueSlider () const { return m_hueSlider; }
KDE_NO_EXPORT QSlider * saturationSlider () const { return m_saturationSlider; } KDE_NO_EXPORT TQSlider * saturationSlider () const { return m_saturationSlider; }
QPushButton * button (Button b) const { return m_buttons [(int) b]; } TQPushButton * button (Button b) const { return m_buttons [(int) b]; }
KDE_NO_EXPORT QPushButton * broadcastButton () const { return m_buttons[button_broadcast]; } KDE_NO_EXPORT TQPushButton * broadcastButton () const { return m_buttons[button_broadcast]; }
KDE_NO_EXPORT VolumeBar * volumeBar () const { return m_volume; } KDE_NO_EXPORT VolumeBar * volumeBar () const { return m_volume; }
KDE_NO_EXPORT KMPlayerPopupMenu * popupMenu () const { return m_popupMenu; } KDE_NO_EXPORT KMPlayerPopupMenu * popupMenu () const { return m_popupMenu; }
KDE_NO_EXPORT KPopupMenu * bookmarkMenu () const { return m_bookmarkMenu; } KDE_NO_EXPORT KPopupMenu * bookmarkMenu () const { return m_bookmarkMenu; }
KDE_NO_EXPORT QPopupMenu * zoomMenu () const { return m_zoomMenu; } KDE_NO_EXPORT TQPopupMenu * zoomMenu () const { return m_zoomMenu; }
KDE_NO_EXPORT QPopupMenu * playerMenu () const { return m_playerMenu; } KDE_NO_EXPORT TQPopupMenu * playerMenu () const { return m_playerMenu; }
KDE_NO_EXPORT QPopupMenu * colorMenu () const { return m_colorMenu; } KDE_NO_EXPORT TQPopupMenu * colorMenu () const { return m_colorMenu; }
KDE_NO_EXPORT QPopupMenu * audioMenu () const { return m_audioMenu; } KDE_NO_EXPORT TQPopupMenu * audioMenu () const { return m_audioMenu; }
KDE_NO_EXPORT QPopupMenu * subtitleMenu () const { return m_subtitleMenu; } KDE_NO_EXPORT TQPopupMenu * subtitleMenu () const { return m_subtitleMenu; }
KDE_NO_EXPORT View * view () const { return m_view; } KDE_NO_EXPORT View * view () const { return m_view; }
public slots: public slots:
void setLanguages (const QStringList & al, const QStringList & sl); void setLanguages (const TQStringList & al, const TQStringList & sl);
void selectSubtitle (int id); void selectSubtitle (int id);
void selectAudioLanguage (int id); void selectAudioLanguage (int id);
void showPopupMenu (); void showPopupMenu ();
@ -143,7 +147,7 @@ public slots:
void setPlayingProgress (int position, int length); void setPlayingProgress (int position, int length);
void setLoadingProgress (int pos); void setLoadingProgress (int pos);
protected: protected:
void timerEvent (QTimerEvent * e); void timerEvent (TQTimerEvent * e);
void setupPositionSlider (bool show); void setupPositionSlider (bool show);
private slots: private slots:
void buttonMouseEntered (); void buttonMouseEntered ();
@ -156,13 +160,13 @@ private:
int m_popdown_timer; int m_popdown_timer;
int m_button_monitored; int m_button_monitored;
View * m_view; View * m_view;
QBoxLayout * m_buttonbox; TQBoxLayout * m_buttonbox;
QSlider * m_posSlider; TQSlider * m_posSlider;
QSlider * m_contrastSlider; TQSlider * m_contrastSlider;
QSlider * m_brightnessSlider; TQSlider * m_brightnessSlider;
QSlider * m_hueSlider; TQSlider * m_hueSlider;
QSlider * m_saturationSlider; TQSlider * m_saturationSlider;
QPushButton * m_buttons [button_last]; TQPushButton * m_buttons [button_last];
VolumeBar * m_volume; VolumeBar * m_volume;
KMPlayerPopupMenu * m_popupMenu; KMPlayerPopupMenu * m_popupMenu;
KMPlayerPopupMenu * m_bookmarkMenu; KMPlayerPopupMenu * m_bookmarkMenu;

File diff suppressed because it is too large Load Diff

@ -23,10 +23,10 @@
#include "kmplayer_def.h" #include "kmplayer_def.h"
#include <qobject.h> #include <tqobject.h>
#include <qguardedptr.h> #include <tqguardedptr.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qmap.h> #include <tqmap.h>
#include <dcopobject.h> #include <dcopobject.h>
#include <kmediaplayer/player.h> #include <kmediaplayer/player.h>
@ -41,9 +41,9 @@ class KInstance;
class KActionCollection; class KActionCollection;
class KBookmarkMenu; class KBookmarkMenu;
class KConfig; class KConfig;
class QIODevice; class TQIODevice;
class QTextStream; class TQTextStream;
class QListViewItem; class TQListViewItem;
namespace KIO { namespace KIO {
class Job; class Job;
@ -67,13 +67,14 @@ class Settings;
*/ */
class KMPLAYER_EXPORT URLSource : public Source { class KMPLAYER_EXPORT URLSource : public Source {
Q_OBJECT Q_OBJECT
// TQ_OBJECT
public: public:
URLSource (PartBase * player, const KURL & url = KURL ()); URLSource (PartBase * player, const KURL & url = KURL ());
virtual ~URLSource (); virtual ~URLSource ();
virtual void dimensions (int & w, int & h); virtual void dimensions (int & w, int & h);
virtual bool hasLength (); virtual bool hasLength ();
virtual QString prettyName (); virtual TQString prettyName ();
virtual void reset (); virtual void reset ();
virtual void setURL (const KURL & url); virtual void setURL (const KURL & url);
public slots: public slots:
@ -86,21 +87,21 @@ public slots:
virtual void jump (NodePtr e); virtual void jump (NodePtr e);
void play (); void play ();
private slots: private slots:
void kioData (KIO::Job *, const QByteArray &); void kioData (KIO::Job *, const TQByteArray &);
void kioMimetype (KIO::Job *, const QString &); void kioMimetype (KIO::Job *, const TQString &);
void kioResult (KIO::Job *); void kioResult (KIO::Job *);
protected: protected:
virtual bool requestPlayURL (NodePtr mrl); virtual bool requestPlayURL (NodePtr mrl);
virtual bool resolveURL (NodePtr mrl); virtual bool resolveURL (NodePtr mrl);
private: private:
void read (NodePtr mrl, QTextStream &); void read (NodePtr mrl, TQTextStream &);
void stopResolving (); void stopResolving ();
struct ResolveInfo { struct ResolveInfo {
ResolveInfo (NodePtr mrl, KIO::Job * j, SharedPtr <ResolveInfo> & n) ResolveInfo (NodePtr mrl, KIO::Job * j, SharedPtr <ResolveInfo> & n)
: resolving_mrl (mrl), job (j), progress (0), next (n) {} : resolving_mrl (mrl), job (j), progress (0), next (n) {}
NodePtrW resolving_mrl; NodePtrW resolving_mrl;
KIO::Job * job; KIO::Job * job;
QByteArray data; TQByteArray data;
int progress; int progress;
SharedPtr <ResolveInfo> next; SharedPtr <ResolveInfo> next;
}; };
@ -113,10 +114,11 @@ private:
*/ */
class KMPLAYER_EXPORT PartBase : public KMediaPlayer::Player { class KMPLAYER_EXPORT PartBase : public KMediaPlayer::Player {
Q_OBJECT Q_OBJECT
// TQ_OBJECT
K_DCOP K_DCOP
public: public:
typedef QMap <QString, Process *> ProcessMap; typedef TQMap <TQString, Process *> ProcessMap;
PartBase (QWidget * parent, const char * wname,QObject * objectParent, const char * name, KConfig *); PartBase (TQWidget * tqparent, const char * wname,TQObject * objectParent, const char * name, KConfig *);
~PartBase (); ~PartBase ();
void init (KActionCollection * = 0L); void init (KActionCollection * = 0L);
virtual KMediaPlayer::View* view (); virtual KMediaPlayer::View* view ();
@ -143,23 +145,23 @@ public:
Process * process () const { return m_process; } Process * process () const { return m_process; }
Process * recorder () const { return m_recorder; } Process * recorder () const { return m_recorder; }
Source * source () const { return m_source; } Source * source () const { return m_source; }
QMap <QString, Process *> & players () { return m_players; } TQMap <TQString, Process *> & players () { return m_players; }
QMap <QString, Process *> & recorders () { return m_recorders; } TQMap <TQString, Process *> & recorders () { return m_recorders; }
QMap <QString, Source *> & sources () { return m_sources; } TQMap <TQString, Source *> & sources () { return m_sources; }
KConfig * config () const { return m_config; } KConfig * config () const { return m_config; }
bool mayResize () const { return !m_noresize; } bool mayResize () const { return !m_noresize; }
void updatePlayerMenu (ControlPanel *); void updatePlayerMenu (ControlPanel *);
void updateInfo (const QString & msg); void updateInfo (const TQString & msg);
void updateStatus (const QString & msg); void updatetqStatus (const TQString & msg);
#ifdef HAVE_DBUS #ifdef HAVE_DBUS
void setServiceName (const QString & srv) { m_service = srv; } void setServiceName (const TQString & srv) { m_service = srv; }
QString serviceName () const { return m_service; } TQString serviceName () const { return m_service; }
#endif #endif
// these are called from Process // these are called from Process
void changeURL (const QString & url); void changeURL (const TQString & url);
void updateTree (bool full=true, bool force=false); void updateTree (bool full=true, bool force=false);
void setLanguages (const QStringList & alang, const QStringList & slang); void setLanguages (const TQStringList & alang, const TQStringList & slang);
public slots: public slots:
virtual bool openURL (const KURL & url); virtual bool openURL (const KURL & url);
virtual bool openURL (const KURL::List & urls); virtual bool openURL (const KURL::List & urls);
@ -176,7 +178,7 @@ public slots:
void slotPlayerMenu (int); void slotPlayerMenu (int);
void back (); void back ();
void forward (); void forward ();
void addBookMark (const QString & title, const QString & url); void addBookMark (const TQString & title, const TQString & url);
void volumeChanged (int); void volumeChanged (int);
void increaseVolume (); void increaseVolume ();
void decreaseVolume (); void decreaseVolume ();
@ -194,20 +196,20 @@ signals:
void sourceChanged (KMPlayer::Source * old, KMPlayer::Source * nw); void sourceChanged (KMPlayer::Source * old, KMPlayer::Source * nw);
void sourceDimensionChanged (); void sourceDimensionChanged ();
void loading (int percentage); void loading (int percentage);
void urlAdded (const QString & url); void urlAdded (const TQString & url);
void urlChanged (const QString & url); void urlChanged (const TQString & url);
void processChanged (const char *); void processChanged (const char *);
void treeChanged (int id, NodePtr root, NodePtr, bool select, bool open); void treeChanged (int id, NodePtr root, NodePtr, bool select, bool open);
void treeUpdated (); void treeUpdated ();
void infoUpdated (const QString & msg); void infoUpdated (const TQString & msg);
void statusUpdated (const QString & msg); void statusUpdated (const TQString & msg);
void languagesUpdated(const QStringList & alang, const QStringList & slang); void languagesUpdated(const TQStringList & alang, const TQStringList & slang);
void audioIsSelected (int id); void audioIsSelected (int id);
void subtitleIsSelected (int id); void subtitleIsSelected (int id);
void positioned (int pos, int length); void positioned (int pos, int length);
protected: protected:
bool openFile(); bool openFile();
virtual void timerEvent (QTimerEvent *); virtual void timerEvent (TQTimerEvent *);
protected slots: protected slots:
void posSliderPressed (); void posSliderPressed ();
void posSliderReleased (); void posSliderReleased ();
@ -218,8 +220,8 @@ protected slots:
void saturationValueChanged (int val); void saturationValueChanged (int val);
void sourceHasChangedAspects (); void sourceHasChangedAspects ();
void fullScreen (); void fullScreen ();
void playListItemClicked (QListViewItem *); void playListItemClicked (TQListViewItem *);
void playListItemExecuted (QListViewItem *); void playListItemExecuted (TQListViewItem *);
virtual void playingStarted (); virtual void playingStarted ();
virtual void playingStopped (); virtual void playingStopped ();
void recordingStarted (); void recordingStarted ();
@ -229,20 +231,20 @@ protected slots:
void subtitleSelected (int); void subtitleSelected (int);
protected: protected:
KConfig * m_config; KConfig * m_config;
QGuardedPtr <View> m_view; TQGuardedPtr <View> m_view;
QMap <QString, QString> temp_backends; TQMap <TQString, TQString> temp_backends;
Settings * m_settings; Settings * m_settings;
Process * m_process; Process * m_process;
Process * m_recorder; Process * m_recorder;
Source * m_source; Source * m_source;
ProcessMap m_players; ProcessMap m_players;
ProcessMap m_recorders; ProcessMap m_recorders;
QMap <QString, Source *> m_sources; TQMap <TQString, Source *> m_sources;
BookmarkManager * m_bookmark_manager; BookmarkManager * m_bookmark_manager;
BookmarkOwner * m_bookmark_owner; BookmarkOwner * m_bookmark_owner;
KBookmarkMenu * m_bookmark_menu; KBookmarkMenu * m_bookmark_menu;
#ifdef HAVE_DBUS #ifdef HAVE_DBUS
QString m_service; TQString m_service;
#endif #endif
int m_record_timer; int m_record_timer;
int m_update_tree_timer; int m_update_tree_timer;
@ -254,40 +256,42 @@ protected:
bool m_update_tree_full : 1; bool m_update_tree_full : 1;
}; };
class KMPLAYER_NO_EXPORT DataCache : public QObject { class KMPLAYER_NO_EXPORT DataCache : public TQObject {
Q_OBJECT Q_OBJECT
typedef QMap <QString, QByteArray> DataMap; // TQ_OBJECT
typedef QMap <QString, bool> PreserveMap; typedef TQMap <TQString, TQByteArray> DataMap;
typedef TQMap <TQString, bool> PreserveMap;
DataMap cache_map; DataMap cache_map;
PreserveMap preserve_map; PreserveMap preserve_map;
public: public:
DataCache () {} DataCache () {}
~DataCache () {} ~DataCache () {}
void add (const QString &, const QByteArray &); void add (const TQString &, const TQByteArray &);
bool get (const QString &, QByteArray &); bool get (const TQString &, TQByteArray &);
bool preserve (const QString &); bool preserve (const TQString &);
bool unpreserve (const QString &); bool unpreserve (const TQString &);
bool isPreserved (const QString &); bool isPreserved (const TQString &);
signals: signals:
void preserveRemoved (const QString &); // ready or canceled void preserveRemoved (const TQString &); // ready or canceled
}; };
class KMPLAYER_NO_EXPORT RemoteObjectPrivate : public QObject { class KMPLAYER_NO_EXPORT RemoteObjectPrivate : public TQObject {
Q_OBJECT Q_OBJECT
// TQ_OBJECT
public: public:
RemoteObjectPrivate (RemoteObject * r); RemoteObjectPrivate (RemoteObject * r);
~RemoteObjectPrivate (); ~RemoteObjectPrivate ();
bool download (const QString &); bool download (const TQString &);
void clear (); void clear ();
KIO::Job * job; KIO::Job * job;
QString url; TQString url;
QByteArray data; TQByteArray data;
QString mime; TQString mime;
private slots: private slots:
void slotResult (KIO::Job*); void slotResult (KIO::Job*);
void slotData (KIO::Job*, const QByteArray& qb); void slotData (KIO::Job*, const TQByteArray& qb);
void slotMimetype (KIO::Job * job, const QString & mimestr); void slotMimetype (KIO::Job * job, const TQString & mimestr);
void cachePreserveRemoved (const QString &); void cachePreserveRemoved (const TQString &);
private: private:
RemoteObject * remote_object; RemoteObject * remote_object;
bool preserve_wait; bool preserve_wait;

@ -19,7 +19,7 @@
#include <config.h> #include <config.h>
#include <time.h> #include <time.h>
#include <qtextstream.h> #include <tqtextstream.h>
#include <kdebug.h> #include <kdebug.h>
#include <kurl.h> #include <kurl.h>
#ifdef HAVE_EXPAT #ifdef HAVE_EXPAT
@ -45,7 +45,7 @@ using namespace KMPlayer;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
namespace KMPlayer { namespace KMPlayer {
Node * fromXMLDocumentTag (NodePtr & d, const QString & tag) { Node * fromXMLDocumentTag (NodePtr & d, const TQString & tag) {
const char * const name = tag.latin1 (); const char * const name = tag.latin1 ();
if (!strcmp (name, "smil")) if (!strcmp (name, "smil"))
return new SMIL::Smil (d); return new SMIL::Smil (d);
@ -60,7 +60,7 @@ namespace KMPlayer {
else if (!strcasecmp (name, "playlist")) else if (!strcasecmp (name, "playlist"))
return new XSPF::Playlist (d); return new XSPF::Playlist (d);
else if (!strcasecmp (name, "url")) else if (!strcasecmp (name, "url"))
return new GenericURL (d, QString ()); return new GenericURL (d, TQString ());
else if (!strcasecmp (name, "mrl") || else if (!strcasecmp (name, "mrl") ||
!strcasecmp (name, "document")) !strcasecmp (name, "document"))
return new GenericMrl (d); return new GenericMrl (d);
@ -70,21 +70,21 @@ namespace KMPlayer {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct XMLStringlet { struct XMLStringlet {
const QString str; const TQString str;
XMLStringlet (const QString & s) : str (s) {} XMLStringlet (const TQString & s) : str (s) {}
}; };
} // namespace } // namespace
QTextStream & operator << (QTextStream & out, const XMLStringlet & txt) { TQTextStream & operator << (TQTextStream & out, const XMLStringlet & txt) {
int len = int (txt.str.length ()); int len = int (txt.str.length ());
for (int i = 0; i < len; ++i) { for (int i = 0; i < len; ++i) {
if (txt.str [i] == QChar ('<')) { if (txt.str [i] == TQChar ('<')) {
out << "&lt;"; out << "&lt;";
} else if (txt.str [i] == QChar ('>')) { } else if (txt.str [i] == TQChar ('>')) {
out << "&gt;"; out << "&gt;";
} else if (txt.str [i] == QChar ('"')) { } else if (txt.str [i] == TQChar ('"')) {
out << "&quot;"; out << "&quot;";
} else if (txt.str [i] == QChar ('&')) { } else if (txt.str [i] == TQChar ('&')) {
out << "&amp;"; out << "&amp;";
} else } else
out << txt.str [i]; out << txt.str [i];
@ -296,7 +296,7 @@ void Node::clearChildren () {
if (m_doc) if (m_doc)
document()->m_tree_version++; document()->m_tree_version++;
while (m_first_child != m_last_child) { while (m_first_child != m_last_child) {
// avoid stack abuse with 10k children derefing each other // avoid stack abuse with 10k tqchildren derefing each other
m_last_child->m_parent = 0L; m_last_child->m_parent = 0L;
m_last_child = m_last_child->m_prev; m_last_child = m_last_child->m_prev;
m_last_child->m_next = 0L; m_last_child->m_next = 0L;
@ -308,7 +308,7 @@ void Node::clearChildren () {
void Node::appendChild (NodePtr c) { void Node::appendChild (NodePtr c) {
document()->m_tree_version++; document()->m_tree_version++;
ASSERT (!c->parentNode ()); ASSERT (!c->tqparentNode ());
TreeNode<Node>::appendChild (c); TreeNode<Node>::appendChild (c);
} }
@ -316,7 +316,7 @@ void Node::insertBefore (NodePtr c, NodePtr b) {
if (!b) { if (!b) {
appendChild (c); appendChild (c);
} else { } else {
ASSERT (!c->parentNode ()); ASSERT (!c->tqparentNode ());
document()->m_tree_version++; document()->m_tree_version++;
if (b->m_prev) { if (b->m_prev) {
b->m_prev->m_next = c; b->m_prev->m_next = c;
@ -358,11 +358,11 @@ KDE_NO_EXPORT void Node::replaceChild (NodePtr _new, NodePtr old) {
old->m_parent = 0L; old->m_parent = 0L;
} }
NodePtr Node::childFromTag (const QString &) { NodePtr Node::childFromTag (const TQString &) {
return NodePtr (); return NodePtr ();
} }
KDE_NO_EXPORT void Node::characterData (const QString & s) { KDE_NO_EXPORT void Node::characterData (const TQString & s) {
document()->m_tree_version++; document()->m_tree_version++;
if (!m_last_child || m_last_child->id != id_node_text) if (!m_last_child || m_last_child->id != id_node_text)
appendChild (new TextNode (m_doc, s)); appendChild (new TextNode (m_doc, s));
@ -375,7 +375,7 @@ void Node::normalize () {
while (e) { while (e) {
NodePtr tmp = e->nextSibling (); NodePtr tmp = e->nextSibling ();
if (!e->isElementNode () && e->id == id_node_text) { if (!e->isElementNode () && e->id == id_node_text) {
QString val = e->nodeValue ().simplifyWhiteSpace (); TQString val = e->nodeValue ().simplifyWhiteSpace ();
if (val.isEmpty ()) if (val.isEmpty ())
removeChild (e); removeChild (e);
else else
@ -386,7 +386,7 @@ void Node::normalize () {
} }
} }
static void getInnerText (const NodePtr p, QTextOStream & out) { static void getInnerText (const NodePtr p, TQTextOStream & out) {
for (NodePtr e = p->firstChild (); e; e = e->nextSibling ()) { for (NodePtr e = p->firstChild (); e; e = e->nextSibling ()) {
if (e->id == id_node_text || e->id == id_node_cdata) if (e->id == id_node_text || e->id == id_node_cdata)
out << e->nodeValue (); out << e->nodeValue ();
@ -395,48 +395,48 @@ static void getInnerText (const NodePtr p, QTextOStream & out) {
} }
} }
QString Node::innerText () const { TQString Node::innerText () const {
QString buf; TQString buf;
QTextOStream out (&buf); TQTextOStream out (&buf);
getInnerText (m_self, out); getInnerText (m_self, out);
return buf; return buf;
} }
static void getOuterXML (const NodePtr p, QTextOStream & out, int depth) { static void getOuterXML (const NodePtr p, TQTextOStream & out, int depth) {
if (!p->isElementNode ()) { // #text or #cdata if (!p->isElementNode ()) { // #text or #cdata
if (p->id == id_node_cdata) if (p->id == id_node_cdata)
out << "<![CDATA[" << p->nodeValue () << "]]>" << QChar ('\n'); out << "<![CDATA[" << p->nodeValue () << "]]>" << TQChar ('\n');
else else
out << XMLStringlet (p->nodeValue ()) << QChar ('\n'); out << XMLStringlet (p->nodeValue ()) << TQChar ('\n');
} else { } else {
Element * e = convertNode <Element> (p); Element * e = convertNode <Element> (p);
QString indent (QString ().fill (QChar (' '), depth)); TQString indent (TQString ().fill (TQChar (' '), depth));
out << indent << QChar ('<') << XMLStringlet (e->nodeName ()); out << indent << TQChar ('<') << XMLStringlet (e->nodeName ());
for (AttributePtr a = e->attributes()->first(); a; a = a->nextSibling()) for (AttributePtr a = e->attributes()->first(); a; a = a->nextSibling())
out << " " << XMLStringlet (a->name ().toString ()) << out << " " << XMLStringlet (a->name ().toString ()) <<
"=\"" << XMLStringlet (a->value ()) << "\""; "=\"" << XMLStringlet (a->value ()) << "\"";
if (e->hasChildNodes ()) { if (e->hasChildNodes ()) {
out << QChar ('>') << QChar ('\n'); out << TQChar ('>') << TQChar ('\n');
for (NodePtr c = e->firstChild (); c; c = c->nextSibling ()) for (NodePtr c = e->firstChild (); c; c = c->nextSibling ())
getOuterXML (c, out, depth + 1); getOuterXML (c, out, depth + 1);
out << indent << QString("</") << XMLStringlet (e->nodeName()) << out << indent << TQString("</") << XMLStringlet (e->nodeName()) <<
QChar ('>') << QChar ('\n'); TQChar ('>') << TQChar ('\n');
} else } else
out << QString ("/>") << QChar ('\n'); out << TQString ("/>") << TQChar ('\n');
} }
} }
QString Node::innerXML () const { TQString Node::innerXML () const {
QString buf; TQString buf;
QTextOStream out (&buf); TQTextOStream out (&buf);
for (NodePtr e = firstChild (); e; e = e->nextSibling ()) for (NodePtr e = firstChild (); e; e = e->nextSibling ())
getOuterXML (e, out, 0); getOuterXML (e, out, 0);
return buf; return buf;
} }
QString Node::outerXML () const { TQString Node::outerXML () const {
QString buf; TQString buf;
QTextOStream out (&buf); TQTextOStream out (&buf);
getOuterXML (m_self, out, 0); getOuterXML (m_self, out, 0);
return buf; return buf;
} }
@ -475,8 +475,8 @@ ConnectionPtr Node::connectTo (NodePtr node, unsigned int evt_id) {
return ConnectionPtr (); return ConnectionPtr ();
} }
QString Node::nodeValue () const { TQString Node::nodeValue () const {
return QString (); return TQString ();
} }
SurfacePtr Node::getSurface (NodePtr) { SurfacePtr Node::getSurface (NodePtr) {
@ -493,21 +493,21 @@ RefNode::RefNode (NodePtr & d, NodePtr ref)
void RefNode::setRefNode (const NodePtr ref) { void RefNode::setRefNode (const NodePtr ref) {
ref_node = ref; ref_node = ref;
if (ref_node) if (ref_node)
tag_name = QString ("&%1").arg (ref_node->nodeName ()); tag_name = TQString ("&%1").arg (ref_node->nodeName ());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
namespace KMPlayer { namespace KMPlayer {
struct KMPLAYER_NO_EXPORT ParamValue { struct KMPLAYER_NO_EXPORT ParamValue {
QString val; TQString val;
QStringList * modifications; TQStringList * modifications;
ParamValue (const QString & v) : val (v), modifications (0L) {} ParamValue (const TQString & v) : val (v), modifications (0L) {}
~ParamValue () { delete modifications; } ~ParamValue () { delete modifications; }
QString value (); TQString value ();
void setValue (const QString & v) { val = v; } void setValue (const TQString & v) { val = v; }
}; };
typedef QMap <TrieString, ParamValue *> ParamMap; typedef TQMap <TrieString, ParamValue *> ParamMap;
class KMPLAYER_NO_EXPORT ElementPrivate { class KMPLAYER_NO_EXPORT ElementPrivate {
public: public:
~ElementPrivate (); ~ElementPrivate ();
@ -516,7 +516,7 @@ namespace KMPlayer {
}; };
} }
KDE_NO_EXPORT QString ParamValue::value () { KDE_NO_EXPORT TQString ParamValue::value () {
return modifications && modifications->size () return modifications && modifications->size ()
? modifications->back () : val; ? modifications->back () : val;
} }
@ -539,15 +539,15 @@ Element::~Element () {
delete d; delete d;
} }
void Element::setParam (const TrieString &param, const QString &val, int *mid) { void Element::setParam (const TrieString &param, const TQString &val, int *mid) {
ParamValue * pv = d->params [param]; ParamValue * pv = d->params [param];
if (!pv) { if (!pv) {
pv = new ParamValue (mid ? QString() : val); pv = new ParamValue (mid ? TQString() : val);
d->params.insert (param, pv); d->params.insert (param, pv);
} }
if (mid) { if (mid) {
if (!pv->modifications) if (!pv->modifications)
pv->modifications = new QStringList; pv->modifications = new TQStringList;
if (*mid >= 0 && *mid < int (pv->modifications->size ())) { if (*mid >= 0 && *mid < int (pv->modifications->size ())) {
(*pv->modifications) [*mid] = val; (*pv->modifications) [*mid] = val;
} else { } else {
@ -559,23 +559,23 @@ void Element::setParam (const TrieString &param, const QString &val, int *mid) {
parseParam (param, val); parseParam (param, val);
} }
QString Element::param (const TrieString & name) { TQString Element::param (const TrieString & name) {
ParamValue * pv = d->params [name]; ParamValue * pv = d->params [name];
if (pv) if (pv)
return pv->value (); return pv->value ();
return QString (); return TQString ();
} }
void Element::resetParam (const TrieString & param, int mid) { void Element::resetParam (const TrieString & param, int mid) {
ParamValue * pv = d->params [param]; ParamValue * pv = d->params [param];
if (pv && pv->modifications) { if (pv && pv->modifications) {
if (int (pv->modifications->size ()) > mid && mid > -1) { if (int (pv->modifications->size ()) > mid && mid > -1) {
(*pv->modifications) [mid] = QString (); (*pv->modifications) [mid] = TQString ();
while (pv->modifications->size () > 0 && while (pv->modifications->size () > 0 &&
pv->modifications->back ().isNull ()) pv->modifications->back ().isNull ())
pv->modifications->pop_back (); pv->modifications->pop_back ();
} }
QString val = pv->value (); TQString val = pv->value ();
if (pv->modifications->size () == 0) { if (pv->modifications->size () == 0) {
delete pv->modifications; delete pv->modifications;
pv->modifications = 0L; pv->modifications = 0L;
@ -590,7 +590,7 @@ void Element::resetParam (const TrieString & param, int mid) {
kdError () << "resetting " << param.toString() << " that doesn't exists" << endl; kdError () << "resetting " << param.toString() << " that doesn't exists" << endl;
} }
void Element::setAttribute (const TrieString & name, const QString & value) { void Element::setAttribute (const TrieString & name, const TQString & value) {
for (AttributePtr a = m_attributes->first (); a; a = a->nextSibling ()) for (AttributePtr a = m_attributes->first (); a; a = a->nextSibling ())
if (name == a->name ()) { if (name == a->name ()) {
a->setValue (value); a->setValue (value);
@ -599,11 +599,11 @@ void Element::setAttribute (const TrieString & name, const QString & value) {
m_attributes->append (new Attribute (name, value)); m_attributes->append (new Attribute (name, value));
} }
QString Element::getAttribute (const TrieString & name) { TQString Element::getAttribute (const TrieString & name) {
for (AttributePtr a = m_attributes->first (); a; a = a->nextSibling ()) for (AttributePtr a = m_attributes->first (); a; a = a->nextSibling ())
if (name == a->name ()) if (name == a->name ())
return a->value (); return a->value ();
return QString (); return TQString ();
} }
void Element::init () { void Element::init () {
@ -629,14 +629,14 @@ void Element::setAttributes (AttributeListPtr attrs) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
Attribute::Attribute (const TrieString & n, const QString & v) Attribute::Attribute (const TrieString & n, const TQString & v)
: m_name (n), m_value (v) {} : m_name (n), m_value (v) {}
void Attribute::setName (const TrieString & n) { void Attribute::setName (const TrieString & n) {
m_name = n; m_name = n;
} }
void Attribute::setValue (const QString & v) { void Attribute::setValue (const TQString & v) {
m_value = v; m_value = v;
} }
@ -666,10 +666,10 @@ Node::PlayType Mrl::playType () {
return cached_play_type; return cached_play_type;
} }
QString Mrl::absolutePath () { TQString Mrl::absolutePath () {
QString path = src; TQString path = src;
if (!path.isEmpty()) { if (!path.isEmpty()) {
for (NodePtr e = parentNode (); e; e = e->parentNode ()) { for (NodePtr e = tqparentNode (); e; e = e->tqparentNode ()) {
Mrl * mrl = e->mrl (); Mrl * mrl = e->mrl ();
if (mrl && !mrl->src.isEmpty () && mrl->src != src) { if (mrl && !mrl->src.isEmpty () && mrl->src != src) {
path = KURL (mrl->absolutePath (), src).url (); path = KURL (mrl->absolutePath (), src).url ();
@ -680,7 +680,7 @@ QString Mrl::absolutePath () {
return path; return path;
} }
NodePtr Mrl::childFromTag (const QString & tag) { NodePtr Mrl::childFromTag (const TQString & tag) {
Node * elm = fromXMLDocumentTag (m_doc, tag); Node * elm = fromXMLDocumentTag (m_doc, tag);
if (elm) if (elm)
return elm; return elm;
@ -737,7 +737,7 @@ void Mrl::begin () {
} }
SurfacePtr Mrl::getSurface (NodePtr node) { SurfacePtr Mrl::getSurface (NodePtr node) {
for (NodePtr p = parentNode (); p; p = p->parentNode ()) for (NodePtr p = tqparentNode (); p; p = p->tqparentNode ())
if (p->mrl ()) if (p->mrl ())
return p->getSurface (node); return p->getSurface (node);
return 0L; return 0L;
@ -747,9 +747,9 @@ bool Mrl::handleEvent (EventPtr) {
return false; return false;
} }
void Mrl::parseParam (const TrieString & para, const QString & val) { void Mrl::parseParam (const TrieString & para, const TQString & val) {
if (para == StringPool::attr_src && !src.startsWith ("#")) { if (para == StringPool::attr_src && !src.startsWith ("#")) {
QString abs = absolutePath (); TQString abs = absolutePath ();
if (abs != src) if (abs != src)
src = val; src = val;
else else
@ -782,7 +782,7 @@ Surface::~Surface() {
} }
void Surface::remove () { void Surface::remove () {
Surface *sp = parentNode ().ptr (); Surface *sp = tqparentNode ().ptr ();
if (sp) { if (sp) {
sp->markDirty (); sp->markDirty ();
sp->removeChild (this); sp->removeChild (this);
@ -790,7 +790,7 @@ void Surface::remove () {
} }
void Surface::markDirty () { void Surface::markDirty () {
for (Surface *s = this; s; s = s->parentNode ().ptr ()) for (Surface *s = this; s; s = s->tqparentNode ().ptr ())
s->dirty = true; s->dirty = true;
} }
@ -812,7 +812,7 @@ namespace KMPlayer {
static NodePtr dummy_element; static NodePtr dummy_element;
} }
Document::Document (const QString & s, PlayListNotify * n) Document::Document (const TQString & s, PlayListNotify * n)
: Mrl (dummy_element, id_node_document), : Mrl (dummy_element, id_node_document),
notify_listener (n), notify_listener (n),
m_tree_version (0), m_tree_version (0),
@ -827,7 +827,7 @@ Document::~Document () {
kdDebug () << "~Document" << endl; kdDebug () << "~Document" << endl;
} }
static NodePtr getElementByIdImpl (NodePtr n, const QString & id, bool inter) { static NodePtr getElementByIdImpl (NodePtr n, const TQString & id, bool inter) {
NodePtr elm; NodePtr elm;
if (!n->isElementNode ()) if (!n->isElementNode ())
return elm; return elm;
@ -843,15 +843,15 @@ static NodePtr getElementByIdImpl (NodePtr n, const QString & id, bool inter) {
return elm; return elm;
} }
NodePtr Document::getElementById (const QString & id) { NodePtr Document::getElementById (const TQString & id) {
return getElementByIdImpl (this, id, true); return getElementByIdImpl (this, id, true);
} }
NodePtr Document::getElementById (NodePtr n, const QString & id, bool inter) { NodePtr Document::getElementById (NodePtr n, const TQString & id, bool inter) {
return getElementByIdImpl (n, id, inter); return getElementByIdImpl (n, id, inter);
} }
NodePtr Document::childFromTag (const QString & tag) { NodePtr Document::childFromTag (const TQString & tag) {
Node * elm = fromXMLDocumentTag (m_doc, tag); Node * elm = fromXMLDocumentTag (m_doc, tag);
if (elm) if (elm)
return elm; return elm;
@ -1066,14 +1066,14 @@ NodeRefListPtr Document::listeners (unsigned int id) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TextNode::TextNode (NodePtr & d, const QString & s, short i) KDE_NO_CDTOR_EXPORT TextNode::TextNode (NodePtr & d, const TQString & s, short i)
: Node (d, i), text (s) {} : Node (d, i), text (s) {}
void TextNode::appendText (const QString & s) { void TextNode::appendText (const TQString & s) {
text += s; text += s;
} }
QString TextNode::nodeValue () const { TQString TextNode::nodeValue () const {
return text; return text;
} }
@ -1083,16 +1083,16 @@ KDE_NO_EXPORT bool TextNode::expose () const {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT CData::CData (NodePtr & d, const QString & s) KDE_NO_CDTOR_EXPORT CData::CData (NodePtr & d, const TQString & s)
: TextNode (d, s, id_node_cdata) {} : TextNode (d, s, id_node_cdata) {}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
DarkNode::DarkNode (NodePtr & d, const QString & n, short id) DarkNode::DarkNode (NodePtr & d, const TQString & n, short id)
: Element (d, id), name (n) { : Element (d, id), name (n) {
} }
NodePtr DarkNode::childFromTag (const QString & tag) { NodePtr DarkNode::childFromTag (const TQString & tag) {
return new DarkNode (m_doc, tag); return new DarkNode (m_doc, tag);
} }
@ -1102,7 +1102,7 @@ KDE_NO_EXPORT bool DarkNode::expose () const {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
GenericURL::GenericURL (NodePtr & d, const QString & s, const QString & name) GenericURL::GenericURL (NodePtr & d, const TQString & s, const TQString & name)
: Mrl (d, id_node_playlist_item) { : Mrl (d, id_node_playlist_item) {
src = s; src = s;
if (!src.isEmpty ()) if (!src.isEmpty ())
@ -1117,7 +1117,7 @@ KDE_NO_EXPORT void GenericURL::closed () {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
GenericMrl::GenericMrl (NodePtr & d, const QString & s, const QString & name, const QString & tag) GenericMrl::GenericMrl (NodePtr & d, const TQString & s, const TQString & name, const TQString & tag)
: Mrl (d, id_node_playlist_item), node_name (tag) { : Mrl (d, id_node_playlist_item), node_name (tag) {
src = s; src = s;
if (!src.isEmpty ()) if (!src.isEmpty ())
@ -1155,16 +1155,16 @@ class KMPLAYER_NO_EXPORT DocumentBuilder {
public: public:
DocumentBuilder (NodePtr d, bool set_opener); DocumentBuilder (NodePtr d, bool set_opener);
~DocumentBuilder () {} ~DocumentBuilder () {}
bool startTag (const QString & tag, AttributeListPtr attr); bool startTag (const TQString & tag, AttributeListPtr attr);
bool endTag (const QString & tag); bool endTag (const TQString & tag);
bool characterData (const QString & data); bool characterData (const TQString & data);
bool cdataData (const QString & data); bool cdataData (const TQString & data);
#ifdef HAVE_EXPAT #ifdef HAVE_EXPAT
void cdataStart (); void cdataStart ();
void cdataEnd (); void cdataEnd ();
private: private:
bool in_cdata; bool in_cdata;
QString cdata; TQString cdata;
#endif #endif
}; };
@ -1178,7 +1178,7 @@ DocumentBuilder::DocumentBuilder (NodePtr d, bool set_opener)
#endif #endif
{} {}
bool DocumentBuilder::startTag(const QString &tag, AttributeListPtr attr) { bool DocumentBuilder::startTag(const TQString &tag, AttributeListPtr attr) {
if (m_ignore_depth) { if (m_ignore_depth) {
m_ignore_depth++; m_ignore_depth++;
//kdDebug () << "Warning: ignored tag " << tag.latin1 () << " ignore depth = " << m_ignore_depth << endl; //kdDebug () << "Warning: ignored tag " << tag.latin1 () << " ignore depth = " << m_ignore_depth << endl;
@ -1207,7 +1207,7 @@ bool DocumentBuilder::startTag(const QString &tag, AttributeListPtr attr) {
return true; return true;
} }
bool DocumentBuilder::endTag (const QString & tag) { bool DocumentBuilder::endTag (const TQString & tag) {
if (m_ignore_depth) { // endtag to ignore if (m_ignore_depth) { // endtag to ignore
m_ignore_depth--; m_ignore_depth--;
kdDebug () << "Warning: ignored end tag " << " ignore depth = " << m_ignore_depth << endl; kdDebug () << "Warning: ignored end tag " << " ignore depth = " << m_ignore_depth << endl;
@ -1218,10 +1218,10 @@ bool DocumentBuilder::endTag (const QString & tag) {
(m_root_is_first || n != m_root)) { (m_root_is_first || n != m_root)) {
while (n != m_node) { while (n != m_node) {
kdWarning() << m_node->nodeName () << " not closed" << endl; kdWarning() << m_node->nodeName () << " not closed" << endl;
if (m_root == m_node->parentNode ()) if (m_root == m_node->tqparentNode ())
break; break;
m_node->closed (); m_node->closed ();
m_node = m_node->parentNode (); m_node = m_node->tqparentNode ();
} }
break; break;
} }
@ -1234,16 +1234,16 @@ bool DocumentBuilder::endTag (const QString & tag) {
break; break;
} else } else
kdWarning () << "tag " << tag << " not " << n->nodeName () << endl; kdWarning () << "tag " << tag << " not " << n->nodeName () << endl;
n = n ->parentNode (); n = n ->tqparentNode ();
} }
//kdDebug () << "end tag " << tag << endl; //kdDebug () << "end tag " << tag << endl;
m_node->closed (); m_node->closed ();
m_node = m_node->parentNode (); m_node = m_node->tqparentNode ();
} }
return true; return true;
} }
bool DocumentBuilder::characterData (const QString & data) { bool DocumentBuilder::characterData (const TQString & data) {
if (!m_ignore_depth) { if (!m_ignore_depth) {
#ifdef HAVE_EXPAT #ifdef HAVE_EXPAT
if (in_cdata) if (in_cdata)
@ -1256,7 +1256,7 @@ bool DocumentBuilder::characterData (const QString & data) {
return true; return true;
} }
bool DocumentBuilder::cdataData (const QString & data) { bool DocumentBuilder::cdataData (const TQString & data) {
if (!m_ignore_depth) { if (!m_ignore_depth) {
NodePtr d = m_node->document (); NodePtr d = m_node->document ();
m_node->appendChild (new CData (d, data)); m_node->appendChild (new CData (d, data));
@ -1283,14 +1283,14 @@ static void startTag (void *data, const char * tag, const char **attr) {
AttributeListPtr attributes = new AttributeList; AttributeListPtr attributes = new AttributeList;
if (attr && attr [0]) { if (attr && attr [0]) {
for (int i = 0; attr[i]; i += 2) for (int i = 0; attr[i]; i += 2)
attributes->append (new Attribute (QString::fromUtf8 (attr [i]), QString::fromUtf8 (attr [i+1]))); attributes->append (new Attribute (TQString::fromUtf8 (attr [i]), TQString::fromUtf8 (attr [i+1])));
} }
builder->startTag (QString::fromUtf8 (tag), attributes); builder->startTag (TQString::fromUtf8 (tag), attributes);
} }
static void endTag (void *data, const char * tag) { static void endTag (void *data, const char * tag) {
DocumentBuilder * builder = static_cast <DocumentBuilder *> (data); DocumentBuilder * builder = static_cast <DocumentBuilder *> (data);
builder->endTag (QString::fromUtf8 (tag)); builder->endTag (TQString::fromUtf8 (tag));
} }
static void characterData (void *data, const char *s, int len) { static void characterData (void *data, const char *s, int len) {
@ -1298,7 +1298,7 @@ static void characterData (void *data, const char *s, int len) {
char * buf = new char [len + 1]; char * buf = new char [len + 1];
strncpy (buf, s, len); strncpy (buf, s, len);
buf[len] = 0; buf[len] = 0;
builder->characterData (QString::fromUtf8 (buf)); builder->characterData (TQString::fromUtf8 (buf));
delete [] buf; delete [] buf;
} }
@ -1315,7 +1315,7 @@ static void cdataEnd (void *data) {
namespace KMPlayer { namespace KMPlayer {
KMPLAYER_EXPORT KMPLAYER_EXPORT
void readXML (NodePtr root, QTextStream & in, const QString & firstline, bool set_opener) { void readXML (NodePtr root, TQTextStream & in, const TQString & firstline, bool set_opener) {
bool ok = true; bool ok = true;
DocumentBuilder builder (root, set_opener); DocumentBuilder builder (root, set_opener);
XML_Parser parser = XML_ParserCreate (0L); XML_Parser parser = XML_ParserCreate (0L);
@ -1324,14 +1324,14 @@ void readXML (NodePtr root, QTextStream & in, const QString & firstline, bool se
XML_SetCharacterDataHandler (parser, characterData); XML_SetCharacterDataHandler (parser, characterData);
XML_SetCdataSectionHandler (parser, cdataStart, cdataEnd); XML_SetCdataSectionHandler (parser, cdataStart, cdataEnd);
if (!firstline.isEmpty ()) { if (!firstline.isEmpty ()) {
QString str (firstline + QChar ('\n')); TQString str (firstline + TQChar ('\n'));
QCString buf = str.utf8 (); TQCString buf = str.utf8 ();
ok = XML_Parse(parser, buf, strlen (buf), false) != XML_STATUS_ERROR; ok = XML_Parse(parser, buf, strlen (buf), false) != XML_STATUS_ERROR;
if (!ok) if (!ok)
kdWarning () << XML_ErrorString(XML_GetErrorCode(parser)) << " at " << XML_GetCurrentLineNumber(parser) << " col " << XML_GetCurrentColumnNumber(parser) << endl; kdWarning () << XML_ErrorString(XML_GetErrorCode(parser)) << " at " << XML_GetCurrentLineNumber(parser) << " col " << XML_GetCurrentColumnNumber(parser) << endl;
} }
if (ok && !in.atEnd ()) { if (ok && !in.atEnd ()) {
QCString buf = in.read ().utf8 (); TQCString buf = in.read ().utf8 ();
ok = XML_Parse(parser, buf, strlen (buf), true) != XML_STATUS_ERROR; ok = XML_Parse(parser, buf, strlen (buf), true) != XML_STATUS_ERROR;
if (!ok) if (!ok)
kdWarning () << XML_ErrorString(XML_GetErrorCode(parser)) << " at " << XML_GetCurrentLineNumber(parser) << " col " << XML_GetCurrentColumnNumber(parser) << endl; kdWarning () << XML_ErrorString(XML_GetErrorCode(parser)) << " at " << XML_GetCurrentLineNumber(parser) << " col " << XML_GetCurrentColumnNumber(parser) << endl;
@ -1352,12 +1352,12 @@ class KMPLAYER_NO_EXPORT SimpleSAXParser {
public: public:
SimpleSAXParser (DocumentBuilder & b) : builder (b), position (0), m_attributes (new AttributeList), equal_seen (false), in_dbl_quote (false), in_sngl_quote (false), have_error (false), no_entitity_look_ahead (false), have_next_char (false) {} SimpleSAXParser (DocumentBuilder & b) : builder (b), position (0), m_attributes (new AttributeList), equal_seen (false), in_dbl_quote (false), in_sngl_quote (false), have_error (false), no_entitity_look_ahead (false), have_next_char (false) {}
virtual ~SimpleSAXParser () {}; virtual ~SimpleSAXParser () {};
bool parse (QTextStream & d); bool parse (TQTextStream & d);
private: private:
QTextStream * data; TQTextStream * data;
DocumentBuilder & builder; DocumentBuilder & builder;
int position; int position;
QChar next_char; TQChar next_char;
enum Token { tok_empty, tok_text, tok_white_space, tok_angle_open, enum Token { tok_empty, tok_text, tok_white_space, tok_angle_open,
tok_equal, tok_double_quote, tok_single_quote, tok_angle_close, tok_equal, tok_double_quote, tok_single_quote, tok_angle_close,
tok_slash, tok_exclamation, tok_amp, tok_hash, tok_semi_colon, tok_slash, tok_exclamation, tok_amp, tok_hash, tok_semi_colon,
@ -1368,23 +1368,23 @@ private:
struct TokenInfo { struct TokenInfo {
TokenInfo () : token (tok_empty) {} TokenInfo () : token (tok_empty) {}
Token token; Token token;
QString string; TQString string;
SharedPtr <TokenInfo> next; SharedPtr <TokenInfo> next;
}; };
typedef SharedPtr <TokenInfo> TokenInfoPtr; typedef SharedPtr <TokenInfo> TokenInfoPtr;
struct StateInfo { struct StateInfo {
StateInfo (State s, SharedPtr <StateInfo> n) : state (s), next (n) {} StateInfo (State s, SharedPtr <StateInfo> n) : state (s), next (n) {}
State state; State state;
QString data; TQString data;
SharedPtr <StateInfo> next; SharedPtr <StateInfo> next;
}; };
SharedPtr <StateInfo> m_state; SharedPtr <StateInfo> m_state;
TokenInfoPtr next_token, token, prev_token; TokenInfoPtr next_token, token, prev_token;
// for element reading // for element reading
QString tagname; TQString tagname;
AttributeListPtr m_attributes; AttributeListPtr m_attributes;
QString attr_name, attr_value; TQString attr_name, attr_value;
QString cdata; TQString cdata;
bool equal_seen; bool equal_seen;
bool in_dbl_quote; bool in_dbl_quote;
bool in_sngl_quote; bool in_sngl_quote;
@ -1407,17 +1407,17 @@ private:
} // namespace } // namespace
KMPLAYER_EXPORT KMPLAYER_EXPORT
void KMPlayer::readXML (NodePtr root, QTextStream & in, const QString & firstline, bool set_opener) { void KMPlayer::readXML (NodePtr root, TQTextStream & in, const TQString & firstline, bool set_opener) {
DocumentBuilder builder (root, set_opener); DocumentBuilder builder (root, set_opener);
SimpleSAXParser parser (builder); SimpleSAXParser parser (builder);
if (!firstline.isEmpty ()) { if (!firstline.isEmpty ()) {
QString str (firstline + QChar ('\n')); TQString str (firstline + TQChar ('\n'));
QTextStream fl_in (&str, IO_ReadOnly); TQTextStream fl_in (&str, IO_ReadOnly);
parser.parse (fl_in); parser.parse (fl_in);
} }
if (!in.atEnd ()) if (!in.atEnd ())
parser.parse (in); parser.parse (in);
for (NodePtr e = root; e; e = e->parentNode ()) for (NodePtr e = root; e; e = e->tqparentNode ())
e->closed (); e->closed ();
//doc->normalize (); //doc->normalize ();
//kdDebug () << root->outerXML (); //kdDebug () << root->outerXML ();
@ -1455,39 +1455,39 @@ bool SimpleSAXParser::nextToken () {
push (); push ();
next_token->token = tok_white_space; next_token->token = tok_white_space;
} else if (!next_char.isLetterOrNumber ()) { } else if (!next_char.isLetterOrNumber ()) {
if (next_char == QChar ('#')) { if (next_char == TQChar ('#')) {
//if (next_token->token == tok_empty) { // check last item on stack & //if (next_token->token == tok_empty) { // check last item on stack &
push (); push ();
next_token->token = tok_hash; next_token->token = tok_hash;
//} //}
} else if (next_char == QChar ('/')) { } else if (next_char == TQChar ('/')) {
push (); push ();
next_token->token = tok_slash; next_token->token = tok_slash;
} else if (next_char == QChar ('!')) { } else if (next_char == TQChar ('!')) {
push (); push ();
next_token->token = tok_exclamation; next_token->token = tok_exclamation;
} else if (next_char == QChar ('?')) { } else if (next_char == TQChar ('?')) {
push (); push ();
next_token->token = tok_question_mark; next_token->token = tok_question_mark;
} else if (next_char == QChar ('<')) { } else if (next_char == TQChar ('<')) {
push (); push ();
next_token->token = tok_angle_open; next_token->token = tok_angle_open;
} else if (next_char == QChar ('>')) { } else if (next_char == TQChar ('>')) {
push (); push ();
next_token->token = tok_angle_close; next_token->token = tok_angle_close;
} else if (next_char == QChar (';')) { } else if (next_char == TQChar (';')) {
push (); push ();
next_token->token = tok_semi_colon; next_token->token = tok_semi_colon;
} else if (next_char == QChar ('=')) { } else if (next_char == TQChar ('=')) {
push (); push ();
next_token->token = tok_equal; next_token->token = tok_equal;
} else if (next_char == QChar ('"')) { } else if (next_char == TQChar ('"')) {
push (); push ();
next_token->token = tok_double_quote; next_token->token = tok_double_quote;
} else if (next_char == QChar ('\'')) { } else if (next_char == TQChar ('\'')) {
push (); push ();
next_token->token = tok_single_quote; next_token->token = tok_single_quote;
} else if (next_char == QChar ('&')) { } else if (next_char == TQChar ('&')) {
push (); push ();
if (no_entitity_look_ahead) { if (no_entitity_look_ahead) {
have_next_char = true; have_next_char = true;
@ -1499,20 +1499,20 @@ bool SimpleSAXParser::nextToken () {
TokenInfoPtr prev_tmp = prev_token; TokenInfoPtr prev_tmp = prev_token;
if (nextToken () && token->token == tok_text && if (nextToken () && token->token == tok_text &&
nextToken () && token->token == tok_semi_colon) { nextToken () && token->token == tok_semi_colon) {
if (prev_token->string == QString ("amp")) if (prev_token->string == TQString ("amp"))
token->string = QChar ('&'); token->string = TQChar ('&');
else if (prev_token->string == QString ("lt")) else if (prev_token->string == TQString ("lt"))
token->string = QChar ('<'); token->string = TQChar ('<');
else if (prev_token->string == QString ("gt")) else if (prev_token->string == TQString ("gt"))
token->string = QChar ('>'); token->string = TQChar ('>');
else if (prev_token->string == QString ("quot")) else if (prev_token->string == TQString ("quot"))
token->string = QChar ('"'); token->string = TQChar ('"');
else if (prev_token->string == QString ("apos")) else if (prev_token->string == TQString ("apos"))
token->string = QChar ('\''); token->string = TQChar ('\'');
else if (prev_token->string == QString ("copy")) else if (prev_token->string == TQString ("copy"))
token->string = QChar (169); token->string = TQChar (169);
else else
token->string = QChar ('?');// TODO lookup more .. token->string = TQChar ('?');// TODO lookup more ..
token->token = tok_text; token->token = tok_text;
if (tmp) { // cut out the & xxx ; tokens if (tmp) { // cut out the & xxx ; tokens
tmp->next = token; tmp->next = token;
@ -1524,10 +1524,10 @@ bool SimpleSAXParser::nextToken () {
nextToken () && token->token == tok_semi_colon) { nextToken () && token->token == tok_semi_colon) {
//kdDebug () << "char entity found " << prev_token->string << prev_token->string.toInt (0L, 16) << endl; //kdDebug () << "char entity found " << prev_token->string << prev_token->string.toInt (0L, 16) << endl;
token->token = tok_text; token->token = tok_text;
if (!prev_token->string.startsWith (QChar ('x'))) if (!prev_token->string.startsWith (TQChar ('x')))
token->string = QChar (prev_token->string.toInt ()); token->string = TQChar (prev_token->string.toInt ());
else else
token->string = QChar (prev_token->string.mid (1).toInt (0L, 16)); token->string = TQChar (prev_token->string.mid (1).toInt (0L, 16));
if (tmp) { // cut out the '& # xxx ;' tokens if (tmp) { // cut out the '& # xxx ;' tokens
tmp->next = token; tmp->next = token;
token = tmp; token = tmp;
@ -1536,7 +1536,7 @@ bool SimpleSAXParser::nextToken () {
token = tmp; // restore and insert the lost & token token = tmp; // restore and insert the lost & token
tmp = TokenInfoPtr (new TokenInfo); tmp = TokenInfoPtr (new TokenInfo);
tmp->token = tok_amp; tmp->token = tok_amp;
tmp->string += QChar ('&'); tmp->string += TQChar ('&');
tmp->next = token->next; tmp->next = token->next;
if (token) if (token)
token->next = tmp; token->next = tmp;
@ -1556,7 +1556,7 @@ bool SimpleSAXParser::nextToken () {
if (append_char) if (append_char)
next_token->string += next_char; next_token->string += next_char;
if (next_token->token == tok_text && if (next_token->token == tok_text &&
next_char == QChar ('[' ) && next_token->string == "[CDATA[") { next_char == TQChar ('[' ) && next_token->string == "[CDATA[") {
next_token->token = tok_cdata_start; next_token->token = tok_cdata_start;
break; break;
} }
@ -1639,7 +1639,7 @@ bool SimpleSAXParser::readAttributes () {
} }
m_state = m_state->next; m_state = m_state->next;
if (m_state->state == InPITag) { if (m_state->state == InPITag) {
if (tagname == QString ("xml")) { if (tagname == TQString ("xml")) {
/*const AttributeMap::const_iterator e = attr.end (); /*const AttributeMap::const_iterator e = attr.end ();
for (AttributeMap::const_iterator i = attr.begin (); i != e; ++i) for (AttributeMap::const_iterator i = attr.begin (); i != e; ++i)
if (!strcasecmp (i.key ().latin1 (), "encoding")) if (!strcasecmp (i.key ().latin1 (), "encoding"))
@ -1674,7 +1674,7 @@ bool SimpleSAXParser::readPI () {
bool SimpleSAXParser::readDTD () { bool SimpleSAXParser::readDTD () {
//TODO: <!ENTITY ..> //TODO: <!ENTITY ..>
if (!nextToken ()) return false; if (!nextToken ()) return false;
if (token->token == tok_text && token->string.startsWith (QString ("--"))) { if (token->token == tok_text && token->string.startsWith (TQString ("--"))) {
m_state = new StateInfo (InComment, m_state->next); // note: pop DTD m_state = new StateInfo (InComment, m_state->next); // note: pop DTD
return readComment (); return readComment ();
} }
@ -1702,7 +1702,7 @@ bool SimpleSAXParser::readDTD () {
bool SimpleSAXParser::readCDATA () { bool SimpleSAXParser::readCDATA () {
while (!data->atEnd ()) { while (!data->atEnd ()) {
*data >> next_char; *data >> next_char;
if (next_char == QChar ('>') && cdata.endsWith (QString ("]]"))) { if (next_char == TQChar ('>') && cdata.endsWith (TQString ("]]"))) {
cdata.truncate (cdata.length () - 2); cdata.truncate (cdata.length () - 2);
m_state = m_state->next; m_state = m_state->next;
if (m_state->state == InContent) if (m_state->state == InContent)
@ -1724,7 +1724,7 @@ bool SimpleSAXParser::readCDATA () {
bool SimpleSAXParser::readComment () { bool SimpleSAXParser::readComment () {
while (nextToken ()) { while (nextToken ()) {
if (token->token == tok_angle_close && prev_token) if (token->token == tok_angle_close && prev_token)
if (prev_token->string.endsWith (QString ("--"))) { if (prev_token->string.endsWith (TQString ("--"))) {
m_state = m_state->next; m_state = m_state->next;
return true; return true;
} }
@ -1773,7 +1773,7 @@ bool SimpleSAXParser::readTag () {
return readAttributes (); return readAttributes ();
} }
bool SimpleSAXParser::parse (QTextStream & d) { bool SimpleSAXParser::parse (TQTextStream & d) {
data = &d; data = &d;
if (!next_token) { if (!next_token) {
next_token = TokenInfoPtr (new TokenInfo); next_token = TokenInfoPtr (new TokenInfo);
@ -1781,7 +1781,7 @@ bool SimpleSAXParser::parse (QTextStream & d) {
} }
bool ok = true; bool ok = true;
bool in_character_data = false; bool in_character_data = false;
QString white_space; TQString white_space;
while (ok) { while (ok) {
switch (m_state->state) { switch (m_state->state) {
case InTag: case InTag:
@ -1821,7 +1821,7 @@ bool SimpleSAXParser::parse (QTextStream & d) {
} else { } else {
if (!white_space.isEmpty ()) { if (!white_space.isEmpty ()) {
if (!in_character_data) { if (!in_character_data) {
int pos = white_space.findRev (QChar ('\n')); int pos = white_space.tqfindRev (TQChar ('\n'));
if (pos > -1) if (pos > -1)
white_space = white_space.mid (pos + 1); white_space = white_space.mid (pos + 1);
} }

@ -26,7 +26,7 @@
#include <config.h> #include <config.h>
#include <sys/time.h> #include <sys/time.h>
#include <qstring.h> #include <tqstring.h>
#include "kmplayer_def.h" #include "kmplayer_def.h"
#include "kmplayertypes.h" #include "kmplayertypes.h"
@ -34,7 +34,7 @@
typedef struct _cairo_surface cairo_surface_t; typedef struct _cairo_surface cairo_surface_t;
class QTextStream; class TQTextStream;
namespace KMPlayer { namespace KMPlayer {
@ -164,8 +164,8 @@ public:
}; };
/* /*
* Base class for double linked tree nodes having parent/siblings/children. * Base class for double linked tree nodes having tqparent/siblings/tqchildren.
* The linkage is a shared firstChild and weak parentNode. * The linkage is a shared firstChild and weak tqparentNode.
*/ */
template <class T> template <class T>
class KMPLAYER_EXPORT TreeNode : public ListNodeBase <T> { class KMPLAYER_EXPORT TreeNode : public ListNodeBase <T> {
@ -176,7 +176,7 @@ public:
virtual void removeChild (typename Item<T>::SharedType c); virtual void removeChild (typename Item<T>::SharedType c);
bool hasChildNodes () const { return m_first_child != 0L; } bool hasChildNodes () const { return m_first_child != 0L; }
typename Item<T>::SharedType parentNode () const { return m_parent; } typename Item<T>::SharedType tqparentNode () const { return m_parent; }
typename Item<T>::SharedType firstChild () const { return m_first_child; } typename Item<T>::SharedType firstChild () const { return m_first_child; }
typename Item<T>::SharedType lastChild () const { return m_last_child; } typename Item<T>::SharedType lastChild () const { return m_last_child; }
@ -193,15 +193,15 @@ protected:
class KMPLAYER_EXPORT Attribute : public ListNodeBase <Attribute> { class KMPLAYER_EXPORT Attribute : public ListNodeBase <Attribute> {
public: public:
KDE_NO_CDTOR_EXPORT Attribute () {} KDE_NO_CDTOR_EXPORT Attribute () {}
Attribute (const TrieString & n, const QString & v); Attribute (const TrieString & n, const TQString & v);
KDE_NO_CDTOR_EXPORT ~Attribute () {} KDE_NO_CDTOR_EXPORT ~Attribute () {}
TrieString name () const { return m_name; } TrieString name () const { return m_name; }
QString value () const { return m_value; } TQString value () const { return m_value; }
void setName (const TrieString &); void setName (const TrieString &);
void setValue (const QString &); void setValue (const TQString &);
protected: protected:
TrieString m_name; TrieString m_name;
QString m_value; TQString m_value;
}; };
ITEM_AS_POINTER(KMPlayer::Attribute) ITEM_AS_POINTER(KMPlayer::Attribute)
@ -246,7 +246,7 @@ typedef Item<Node>::WeakType NodePtrW;
typedef Item<Attribute>::SharedType AttributePtr; typedef Item<Attribute>::SharedType AttributePtr;
typedef Item<Attribute>::WeakType AttributePtrW; typedef Item<Attribute>::WeakType AttributePtrW;
typedef Item<Event>::SharedType EventPtr; typedef Item<Event>::SharedType EventPtr;
typedef List<Node> NodeList; // eg. for Node's children typedef List<Node> NodeList; // eg. for Node's tqchildren
typedef Item<NodeList>::SharedType NodeListPtr; typedef Item<NodeList>::SharedType NodeListPtr;
typedef Item<NodeList>::WeakType NodeListPtrW; typedef Item<NodeList>::WeakType NodeListPtrW;
ITEM_AS_POINTER(KMPlayer::NodeList) ITEM_AS_POINTER(KMPlayer::NodeList)
@ -312,14 +312,14 @@ public:
virtual ~Node (); virtual ~Node ();
Document * document (); Document * document ();
virtual Mrl * mrl (); virtual Mrl * mrl ();
virtual NodePtr childFromTag (const QString & tag); virtual NodePtr childFromTag (const TQString & tag);
void characterData (const QString & s); void characterData (const TQString & s);
QString innerText () const; TQString innerText () const;
QString innerXML () const; TQString innerXML () const;
QString outerXML () const; TQString outerXML () const;
virtual const char * nodeName () const; virtual const char * nodeName () const;
virtual QString nodeValue () const; virtual TQString nodeValue () const;
virtual void setNodeName (const QString &) {} virtual void setNodeName (const TQString &) {}
/** /**
* If this is a derived Mrl object and has a SRC attribute * If this is a derived Mrl object and has a SRC attribute
@ -397,12 +397,12 @@ public:
virtual void begin (); virtual void begin ();
/** /**
* Sets state to state_finish when >= state_activated. * Sets state to state_finish when >= state_activated.
* Notifies parent with a childDone call. * Notifies tqparent with a childDone call.
*/ */
virtual void finish (); virtual void finish ();
/** /**
* Stops element, sets state to state_deactivated. Calls deactivate() on * Stops element, sets state to state_deactivated. Calls deactivate() on
* activated/deferred children. May call childDone() when active() and not * activated/deferred tqchildren. May call childDone() when active() and not
* finished yet. * finished yet.
*/ */
virtual void deactivate (); virtual void deactivate ();
@ -440,7 +440,7 @@ public:
*/ */
virtual void opened (); virtual void opened ();
/* /*
* Close tag is found by parser, children are appended * Close tag is found by parser, tqchildren are appended
*/ */
virtual void closed (); virtual void closed ();
protected: protected:
@ -475,8 +475,8 @@ class KMPLAYER_EXPORT Element : public Node {
public: public:
~Element (); ~Element ();
void setAttributes (AttributeListPtr attrs); void setAttributes (AttributeListPtr attrs);
void setAttribute (const TrieString & name, const QString & value); void setAttribute (const TrieString & name, const TQString & value);
QString getAttribute (const TrieString & name); TQString getAttribute (const TrieString & name);
KDE_NO_EXPORT AttributeListPtr attributes () const { return m_attributes; } KDE_NO_EXPORT AttributeListPtr attributes () const { return m_attributes; }
virtual void init (); virtual void init ();
virtual void reset (); virtual void reset ();
@ -487,13 +487,13 @@ public:
* pass a modification id, that it can use to restore the old value. * pass a modification id, that it can use to restore the old value.
* Param will be auto removed on deactivate * Param will be auto removed on deactivate
*/ */
void setParam (const TrieString &para, const QString &val, int * mod_id=0L); void setParam (const TrieString &para, const TQString &val, int * mod_id=0L);
QString param (const TrieString & para); TQString param (const TrieString & para);
void resetParam (const TrieString & para, int mod_id); void resetParam (const TrieString & para, int mod_id);
/** /**
* Called from (re)setParam for specialized interpretation of params * Called from (re)setParam for specialized interpretation of params
**/ **/
virtual void parseParam (const TrieString &, const QString &) {} virtual void parseParam (const TrieString &, const TQString &) {}
protected: protected:
Element (NodePtr & d, short id=0); Element (NodePtr & d, short id=0);
AttributeListPtr m_attributes; AttributeListPtr m_attributes;
@ -512,7 +512,7 @@ public:
void setRefNode (const NodePtr ref); void setRefNode (const NodePtr ref);
protected: protected:
NodePtrW ref_node; NodePtrW ref_node;
QString tag_name; TQString tag_name;
}; };
template <class T> template <class T>
@ -526,8 +526,8 @@ inline KDE_NO_EXPORT T * convertNode (NodePtr e) {
class KMPLAYER_EXPORT Mrl : public Element { class KMPLAYER_EXPORT Mrl : public Element {
protected: protected:
Mrl (NodePtr & d, short id=0); Mrl (NodePtr & d, short id=0);
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
void parseParam (const TrieString &, const QString &); void parseParam (const TrieString &, const TQString &);
unsigned int cached_ismrl_version; unsigned int cached_ismrl_version;
PlayType cached_play_type; PlayType cached_play_type;
public: public:
@ -539,7 +539,7 @@ public:
virtual Mrl * linkNode (); virtual Mrl * linkNode ();
virtual Mrl * mrl (); virtual Mrl * mrl ();
virtual void endOfFile (); virtual void endOfFile ();
QString absolutePath (); TQString absolutePath ();
/* /*
* Reimplement to callback with requestPlayURL if isPlayable() * Reimplement to callback with requestPlayURL if isPlayable()
*/ */
@ -553,12 +553,12 @@ public:
/** /**
* If this Mrl is top node of external document, opener has the * If this Mrl is top node of external document, opener has the
* location in SCR. Typically that's the parent of this node. * location in SCR. Typically that's the tqparent of this node.
*/ */
NodePtrW opener; //if this node is top node of external document, NodePtrW opener; //if this node is top node of external document,
QString src; TQString src;
QString pretty_name; TQString pretty_name;
QString mimetype; TQString mimetype;
Single width; Single width;
Single height; Single height;
float aspect; float aspect;
@ -594,7 +594,7 @@ public:
/** /**
* Request to show msg for informing the user * Request to show msg for informing the user
*/ */
virtual void setInfoMessage (const QString & msg) = 0; virtual void setInfoMessage (const TQString & msg) = 0;
/** /**
* Ask for connection bitrates settings * Ask for connection bitrates settings
*/ */
@ -613,12 +613,12 @@ class KMPLAYER_NO_EXPORT RemoteObject {
public: public:
RemoteObject (); RemoteObject ();
virtual ~RemoteObject (); virtual ~RemoteObject ();
bool wget (const QString & url); bool wget (const TQString & url);
void killWGet (); void killWGet ();
void clear (); void clear ();
QString mimetype (); TQString mimetype ();
protected: protected:
KDE_NO_EXPORT virtual void remoteReady (QByteArray &) {} KDE_NO_EXPORT virtual void remoteReady (TQByteArray &) {}
bool downloading () const; bool downloading () const;
private: private:
RemoteObjectPrivate *d; RemoteObjectPrivate *d;
@ -632,14 +632,14 @@ public:
virtual SurfacePtr createSurface (NodePtr owner, const SRect & rect) = 0; virtual SurfacePtr createSurface (NodePtr owner, const SRect & rect) = 0;
virtual IRect toScreen (Single x, Single y, Single w, Single h) = 0; virtual IRect toScreen (Single x, Single y, Single w, Single h) = 0;
virtual void resize (const SRect & rect) = 0; virtual void resize (const SRect & rect) = 0;
virtual void repaint () = 0; virtual void tqrepaint () = 0;
virtual void repaint (const SRect &rect) = 0; virtual void tqrepaint (const SRect &rect) = 0;
virtual void video () = 0; virtual void video () = 0;
void remove (); // remove from parent, mark ancestors dirty void remove (); // remove from tqparent, mark ancestors dirty
void markDirty (); // mark this and ancestors dirty void markDirty (); // mark this and ancestors dirty
NodePtrW node; NodePtrW node;
SRect bounds; // bounds in in parent coord. SRect bounds; // bounds in in tqparent coord.
float xscale, yscale; // internal scaling float xscale, yscale; // internal scaling
unsigned int background_color; // rgba background color unsigned int background_color; // rgba background color
bool dirty; // a decendant is removed bool dirty; // a decendant is removed
@ -710,15 +710,15 @@ typedef WeakPtr <Postpone> PostponePtrW;
class KMPLAYER_EXPORT Document : public Mrl { class KMPLAYER_EXPORT Document : public Mrl {
friend class Postpone; friend class Postpone;
public: public:
Document (const QString &, PlayListNotify * notify = 0L); Document (const TQString &, PlayListNotify * notify = 0L);
~Document (); ~Document ();
NodePtr getElementById (const QString & id); NodePtr getElementById (const TQString & id);
NodePtr getElementById (NodePtr start, const QString & id, bool inter_doc); NodePtr getElementById (NodePtr start, const TQString & id, bool inter_doc);
/** All nodes have shared pointers to Document, /** All nodes have shared pointers to Document,
* so explicitly dispose it (calls clear and set m_doc to 0L) * so explicitly dispose it (calls clear and set m_doc to 0L)
* */ * */
void dispose (); void dispose ();
virtual NodePtr childFromTag (const QString & tag); virtual NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "document"; } KDE_NO_EXPORT const char * nodeName () const { return "document"; }
virtual void activate (); virtual void activate ();
virtual void defer (); virtual void defer ();
@ -765,15 +765,15 @@ private:
*/ */
class KMPLAYER_EXPORT TextNode : public Node { class KMPLAYER_EXPORT TextNode : public Node {
public: public:
TextNode (NodePtr & d, const QString & s, short _id = id_node_text); TextNode (NodePtr & d, const TQString & s, short _id = id_node_text);
KDE_NO_CDTOR_EXPORT ~TextNode () {} KDE_NO_CDTOR_EXPORT ~TextNode () {}
void appendText (const QString & s); void appendText (const TQString & s);
void setText (const QString & txt) { text = txt; } void setText (const TQString & txt) { text = txt; }
const char * nodeName () const { return "#text"; } const char * nodeName () const { return "#text"; }
QString nodeValue () const; TQString nodeValue () const;
bool expose () const; bool expose () const;
protected: protected:
QString text; TQString text;
}; };
/** /**
@ -781,23 +781,23 @@ protected:
*/ */
class KMPLAYER_EXPORT CData : public TextNode { class KMPLAYER_EXPORT CData : public TextNode {
public: public:
CData (NodePtr & d, const QString & s); CData (NodePtr & d, const TQString & s);
KDE_NO_CDTOR_EXPORT ~CData () {} KDE_NO_CDTOR_EXPORT ~CData () {}
const char * nodeName () const { return "#cdata"; } const char * nodeName () const { return "#cdata"; }
}; };
/** /**
* Unrecognized tag by parent element or just some auxiliary node * Unrecognized tag by tqparent element or just some auxiliary node
*/ */
class KMPLAYER_EXPORT DarkNode : public Element { class KMPLAYER_EXPORT DarkNode : public Element {
public: public:
DarkNode (NodePtr & d, const QString & n, short id=0); DarkNode (NodePtr & d, const TQString & n, short id=0);
KDE_NO_CDTOR_EXPORT ~DarkNode () {} KDE_NO_CDTOR_EXPORT ~DarkNode () {}
const char * nodeName () const { return name.ascii (); } const char * nodeName () const { return name.ascii (); }
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
virtual bool expose () const; virtual bool expose () const;
protected: protected:
QString name; TQString name;
}; };
namespace SMIL { namespace SMIL {
@ -860,7 +860,7 @@ public:
*/ */
class KMPLAYER_EXPORT GenericURL : public Mrl { class KMPLAYER_EXPORT GenericURL : public Mrl {
public: public:
GenericURL(NodePtr &d, const QString &s, const QString &n=QString ()); GenericURL(NodePtr &d, const TQString &s, const TQString &n=TQString ());
KDE_NO_EXPORT const char * nodeName () const { return "url"; } KDE_NO_EXPORT const char * nodeName () const { return "url"; }
void closed (); void closed ();
}; };
@ -871,16 +871,16 @@ public:
class KMPLAYER_EXPORT GenericMrl : public Mrl { class KMPLAYER_EXPORT GenericMrl : public Mrl {
public: public:
KDE_NO_CDTOR_EXPORT GenericMrl (NodePtr & d) : Mrl (d), node_name ("mrl") {} KDE_NO_CDTOR_EXPORT GenericMrl (NodePtr & d) : Mrl (d), node_name ("mrl") {}
GenericMrl(NodePtr &d, const QString &s, const QString & name=QString (), const QString &tag=QString ("mrl")); GenericMrl(NodePtr &d, const TQString &s, const TQString & name=TQString (), const TQString &tag=TQString ("mrl"));
KDE_NO_EXPORT const char * nodeName () const { return node_name.ascii (); } KDE_NO_EXPORT const char * nodeName () const { return node_name.ascii (); }
void closed (); void closed ();
bool expose () const; bool expose () const;
QString node_name; TQString node_name;
}; };
KMPLAYER_EXPORT KMPLAYER_EXPORT
void readXML (NodePtr root, QTextStream & in, const QString & firstline, bool set_opener=true); void readXML (NodePtr root, TQTextStream & in, const TQString & firstline, bool set_opener=true);
KMPLAYER_EXPORT Node * fromXMLDocumentTag (NodePtr & d, const QString & tag); KMPLAYER_EXPORT Node * fromXMLDocumentTag (NodePtr & d, const TQString & tag);
template <class T> template <class T>
inline Item<T>::Item () : m_self (static_cast <T*> (this), true) {} inline Item<T>::Item () : m_self (static_cast <T*> (this), true) {}

File diff suppressed because it is too large Load Diff

@ -21,12 +21,12 @@
#ifndef _KMPLAYERPROCESS_H_ #ifndef _KMPLAYERPROCESS_H_
#define _KMPLAYERPROCESS_H_ #define _KMPLAYERPROCESS_H_
#include <qobject.h> #include <tqobject.h>
#include <qguardedptr.h> #include <tqguardedptr.h>
#include <qstring.h> #include <tqstring.h>
#include <qcstring.h> #include <tqcstring.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qregexp.h> #include <tqregexp.h>
#include <kurl.h> #include <kurl.h>
#include <kio/global.h> #include <kio/global.h>
@ -34,7 +34,7 @@
#include "kmplayerconfig.h" #include "kmplayerconfig.h"
#include "kmplayersource.h" #include "kmplayersource.h"
class QWidget; class TQWidget;
class KProcess; class KProcess;
namespace KIO { namespace KIO {
@ -53,19 +53,20 @@ class Backend_stub;
/* /*
* Base class for all backend processes * Base class for all backend processes
*/ */
class KMPLAYER_EXPORT Process : public QObject { class KMPLAYER_EXPORT Process : public TQObject {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
enum State { enum State {
NotRunning = 0, Ready, Buffering, Playing NotRunning = 0, Ready, Buffering, Playing
}; };
Process (QObject * parent, Settings * settings, const char * n); Process (TQObject * tqparent, Settings * settings, const char * n);
virtual ~Process (); virtual ~Process ();
virtual void init (); virtual void init ();
virtual void initProcess (Viewer *); virtual void initProcess (Viewer *);
virtual QString menuName () const; virtual TQString menuName () const;
virtual void setAudioLang (int, const QString &); virtual void setAudioLang (int, const TQString &);
virtual void setSubtitle (int, const QString &); virtual void setSubtitle (int, const TQString &);
bool playing () const; bool playing () const;
KDE_NO_EXPORT KProcess * process () const { return m_process; } KDE_NO_EXPORT KProcess * process () const { return m_process; }
KDE_NO_EXPORT Source * source () const { return m_source; } KDE_NO_EXPORT Source * source () const { return m_source; }
@ -77,7 +78,7 @@ public:
State state () const { return m_state; } State state () const { return m_state; }
NodePtr mrl () const { return m_mrl; } NodePtr mrl () const { return m_mrl; }
signals: signals:
void grabReady (const QString & path); void grabReady (const TQString & path);
public slots: public slots:
virtual bool ready (Viewer *); virtual bool ready (Viewer *);
bool play (Source *, NodePtr mrl); bool play (Source *, NodePtr mrl);
@ -107,11 +108,11 @@ protected:
State m_old_state; State m_old_state;
KProcess * m_process; KProcess * m_process;
KIO::Job * m_job; KIO::Job * m_job;
QString m_url; TQString m_url;
int m_request_seek; int m_request_seek;
const char ** m_supported_sources; const char ** m_supported_sources;
private: private:
QGuardedPtr <Viewer> m_viewer; TQGuardedPtr <Viewer> m_viewer;
}; };
/* /*
@ -119,16 +120,17 @@ private:
*/ */
class MPlayerBase : public Process { class MPlayerBase : public Process {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MPlayerBase (QObject * parent, Settings * settings, const char * n); MPlayerBase (TQObject * tqparent, Settings * settings, const char * n);
~MPlayerBase (); ~MPlayerBase ();
void initProcess (Viewer *); void initProcess (Viewer *);
public slots: public slots:
virtual bool stop (); virtual bool stop ();
virtual bool quit (); virtual bool quit ();
protected: protected:
bool sendCommand (const QString &); bool sendCommand (const TQString &);
QStringList commands; TQStringList commands;
bool m_use_slave : 1; bool m_use_slave : 1;
protected slots: protected slots:
virtual void processStopped (KProcess *); virtual void processStopped (KProcess *);
@ -144,15 +146,16 @@ class MPlayerPreferencesFrame;
*/ */
class KDE_EXPORT MPlayer : public MPlayerBase { class KDE_EXPORT MPlayer : public MPlayerBase {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MPlayer (QObject * parent, Settings * settings); MPlayer (TQObject * tqparent, Settings * settings);
~MPlayer (); ~MPlayer ();
virtual void init (); virtual void init ();
virtual QString menuName () const; virtual TQString menuName () const;
virtual WId widget (); virtual WId widget ();
virtual bool grabPicture (const KURL & url, int pos); virtual bool grabPicture (const KURL & url, int pos);
virtual void setAudioLang (int, const QString &); virtual void setAudioLang (int, const TQString &);
virtual void setSubtitle (int, const QString &); virtual void setSubtitle (int, const TQString &);
bool run (const char * args, const char * pipe = 0L); bool run (const char * args, const char * pipe = 0L);
public slots: public slots:
virtual bool deMediafiedPlay (); virtual bool deMediafiedPlay ();
@ -171,14 +174,14 @@ protected slots:
private slots: private slots:
void processOutput (KProcess *, char *, int); void processOutput (KProcess *, char *, int);
private: private:
QString m_process_output; TQString m_process_output;
QString m_grabfile; TQString m_grabfile;
QWidget * m_widget; TQWidget * m_widget;
MPlayerPreferencesPage * m_configpage; MPlayerPreferencesPage * m_configpage;
QString m_tmpURL; TQString m_tmpURL;
struct LangInfo { struct LangInfo {
LangInfo (int i, const QString & n) : id (i), name (n) {} LangInfo (int i, const TQString & n) : id (i), name (n) {}
int id; QString name; SharedPtr <LangInfo> next; int id; TQString name; SharedPtr <LangInfo> next;
}; };
SharedPtr <LangInfo> alanglist; SharedPtr <LangInfo> alanglist;
WeakPtr <LangInfo> alanglist_end; WeakPtr <LangInfo> alanglist_end;
@ -206,12 +209,12 @@ public:
void write (KConfig *); void write (KConfig *);
void read (KConfig *); void read (KConfig *);
void sync (bool fromUI); void sync (bool fromUI);
void prefLocation (QString & item, QString & icon, QString & tab); void prefLocation (TQString & item, TQString & icon, TQString & tab);
QFrame * prefPage (QWidget * parent); TQFrame * prefPage (TQWidget * tqparent);
QRegExp m_patterns[pat_last]; TQRegExp m_patterns[pat_last];
int cachesize; int cachesize;
QString mplayer_path; TQString mplayer_path;
QString additionalarguments; TQString additionalarguments;
bool alwaysbuildindex; bool alwaysbuildindex;
private: private:
MPlayer * m_process; MPlayer * m_process;
@ -234,8 +237,9 @@ protected:
*/ */
class MEncoder : public MPlayerBase, public Recorder { class MEncoder : public MPlayerBase, public Recorder {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MEncoder (QObject * parent, Settings * settings); MEncoder (TQObject * tqparent, Settings * settings);
~MEncoder (); ~MEncoder ();
virtual void init (); virtual void init ();
virtual bool deMediafiedPlay (); virtual bool deMediafiedPlay ();
@ -249,8 +253,9 @@ public slots:
class KMPLAYER_NO_EXPORT MPlayerDumpstream class KMPLAYER_NO_EXPORT MPlayerDumpstream
: public MPlayerBase, public Recorder { : public MPlayerBase, public Recorder {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MPlayerDumpstream (QObject * parent, Settings * settings); MPlayerDumpstream (TQObject * tqparent, Settings * settings);
~MPlayerDumpstream (); ~MPlayerDumpstream ();
virtual void init (); virtual void init ();
virtual bool deMediafiedPlay (); virtual bool deMediafiedPlay ();
@ -266,27 +271,28 @@ class XMLPreferencesFrame;
*/ */
class KMPLAYER_EXPORT CallbackProcess : public Process { class KMPLAYER_EXPORT CallbackProcess : public Process {
Q_OBJECT Q_OBJECT
TQ_OBJECT
friend class Callback; friend class Callback;
public: public:
CallbackProcess (QObject * parent, Settings * settings, const char * n, const QString & menu); CallbackProcess (TQObject * tqparent, Settings * settings, const char * n, const TQString & menu);
~CallbackProcess (); ~CallbackProcess ();
virtual void setStatusMessage (const QString & msg); virtual void setStatusMessage (const TQString & msg);
virtual void setErrorMessage (int code, const QString & msg); virtual void setErrorMessage (int code, const TQString & msg);
virtual void setFinished (); virtual void setFinished ();
virtual void setPlaying (); virtual void setPlaying ();
virtual void setStarted (QCString dcopname, QByteArray & data); virtual void setStarted (TQCString dcopname, TQByteArray & data);
virtual void setMovieParams (int length, int width, int height, float aspect, const QStringList & alang, const QStringList & slang); virtual void setMovieParams (int length, int width, int height, float aspect, const TQStringList & alang, const TQStringList & slang);
virtual void setMoviePosition (int position); virtual void setMoviePosition (int position);
virtual void setLoadingProgress (int percentage); virtual void setLoadingProgress (int percentage);
virtual void setAudioLang (int, const QString &); virtual void setAudioLang (int, const TQString &);
virtual void setSubtitle (int, const QString &); virtual void setSubtitle (int, const TQString &);
virtual QString menuName () const; virtual TQString menuName () const;
virtual WId widget (); virtual WId widget ();
KDE_NO_EXPORT QByteArray & configData () { return m_configdata; } KDE_NO_EXPORT TQByteArray & configData () { return m_configdata; }
KDE_NO_EXPORT bool haveConfig () { return m_have_config == config_yes; } KDE_NO_EXPORT bool haveConfig () { return m_have_config == config_yes; }
bool getConfigData (); bool getConfigData ();
void setChangedData (const QByteArray &); void setChangedData (const TQByteArray &);
QString dcopName (); TQString dcopName ();
NodePtr configDocument () { return configdoc; } NodePtr configDocument () { return configdoc; }
void initProcess (Viewer *); void initProcess (Viewer *);
virtual bool deMediafiedPlay (); virtual bool deMediafiedPlay ();
@ -308,9 +314,9 @@ protected slots:
protected: protected:
Callback * m_callback; Callback * m_callback;
Backend_stub * m_backend; Backend_stub * m_backend;
QString m_menuname; TQString m_menuname;
QByteArray m_configdata; TQByteArray m_configdata;
QByteArray m_changeddata; TQByteArray m_changeddata;
XMLPreferencesPage * m_configpage; XMLPreferencesPage * m_configpage;
NodePtr configdoc; NodePtr configdoc;
bool in_gui_update; bool in_gui_update;
@ -324,30 +330,30 @@ protected:
struct KMPLAYER_NO_EXPORT ConfigDocument : public Document { struct KMPLAYER_NO_EXPORT ConfigDocument : public Document {
ConfigDocument (); ConfigDocument ();
~ConfigDocument (); ~ConfigDocument ();
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
}; };
/* /*
* Element for ConfigDocument * Element for ConfigDocument
*/ */
struct KMPLAYER_NO_EXPORT ConfigNode : public DarkNode { struct KMPLAYER_NO_EXPORT ConfigNode : public DarkNode {
ConfigNode (NodePtr & d, const QString & tag); ConfigNode (NodePtr & d, const TQString & tag);
KDE_NO_CDTOR_EXPORT ~ConfigNode () {} KDE_NO_CDTOR_EXPORT ~ConfigNode () {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
QWidget * w; TQWidget * w;
}; };
/* /*
* Element for ConfigDocument, defining type of config item * Element for ConfigDocument, defining type of config item
*/ */
struct KMPLAYER_NO_EXPORT TypeNode : public ConfigNode { struct KMPLAYER_NO_EXPORT TypeNode : public ConfigNode {
TypeNode (NodePtr & d, const QString & t); TypeNode (NodePtr & d, const TQString & t);
KDE_NO_CDTOR_EXPORT ~TypeNode () {} KDE_NO_CDTOR_EXPORT ~TypeNode () {}
NodePtr childFromTag (const QString & tag); NodePtr childFromTag (const TQString & tag);
void changedXML (QTextStream & out); void changedXML (TQTextStream & out);
QWidget * createWidget (QWidget * parent); TQWidget * createWidget (TQWidget * tqparent);
const char * nodeName () const { return tag.ascii (); } const char * nodeName () const { return tag.ascii (); }
QString tag; TQString tag;
}; };
/* /*
@ -360,8 +366,8 @@ public:
void write (KConfig *); void write (KConfig *);
void read (KConfig *); void read (KConfig *);
void sync (bool fromUI); void sync (bool fromUI);
void prefLocation (QString & item, QString & icon, QString & tab); void prefLocation (TQString & item, TQString & icon, TQString & tab);
QFrame * prefPage (QWidget * parent); TQFrame * prefPage (TQWidget * tqparent);
private: private:
CallbackProcess * m_process; CallbackProcess * m_process;
XMLPreferencesFrame * m_configframe; XMLPreferencesFrame * m_configframe;
@ -372,8 +378,9 @@ private:
*/ */
class KMPLAYER_NO_EXPORT Xine : public CallbackProcess, public Recorder { class KMPLAYER_NO_EXPORT Xine : public CallbackProcess, public Recorder {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Xine (QObject * parent, Settings * settings); Xine (TQObject * tqparent, Settings * settings);
~Xine (); ~Xine ();
public slots: public slots:
bool ready (Viewer *); bool ready (Viewer *);
@ -384,8 +391,9 @@ public slots:
*/ */
class KMPLAYER_NO_EXPORT GStreamer : public CallbackProcess { class KMPLAYER_NO_EXPORT GStreamer : public CallbackProcess {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
GStreamer (QObject * parent, Settings * settings); GStreamer (TQObject * tqparent, Settings * settings);
~GStreamer (); ~GStreamer ();
public slots: public slots:
virtual bool ready (Viewer *); virtual bool ready (Viewer *);
@ -396,8 +404,9 @@ public slots:
*/ */
class KMPLAYER_EXPORT FFMpeg : public Process, public Recorder { class KMPLAYER_EXPORT FFMpeg : public Process, public Recorder {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
FFMpeg (QObject * parent, Settings * settings); FFMpeg (TQObject * tqparent, Settings * settings);
~FFMpeg (); ~FFMpeg ();
virtual void init (); virtual void init ();
virtual bool deMediafiedPlay (); virtual bool deMediafiedPlay ();
@ -412,61 +421,63 @@ private slots:
* npplayer backend * npplayer backend
*/ */
class KMPLAYER_NO_EXPORT NpStream : public QObject { class KMPLAYER_NO_EXPORT NpStream : public TQObject {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
enum Reason { enum Reason {
NoReason = -1, NoReason = -1,
BecauseDone = 0, BecauseError = 1, BecauseStopped = 2 BecauseDone = 0, BecauseError = 1, BecauseStopped = 2
}; };
NpStream (QObject *parent, Q_UINT32 stream_id, const KURL & url); NpStream (TQObject *tqparent, TQ_UINT32 stream_id, const KURL & url);
~NpStream (); ~NpStream ();
void open (); void open ();
void close (); void close ();
KURL url; KURL url;
QByteArray pending_buf; TQByteArray pending_buf;
KIO::TransferJob *job; KIO::TransferJob *job;
timeval data_arrival; timeval data_arrival;
Q_UINT32 bytes; TQ_UINT32 bytes;
Q_UINT32 stream_id; TQ_UINT32 stream_id;
Q_UINT32 content_length; TQ_UINT32 content_length;
Reason finish_reason; Reason finish_reason;
QString mimetype; TQString mimetype;
signals: signals:
void stateChanged (); void stateChanged ();
void redirected (Q_UINT32, const KURL &); void redirected (TQ_UINT32, const KURL &);
private slots: private slots:
void slotResult (KIO::Job*); void slotResult (KIO::Job*);
void slotData (KIO::Job*, const QByteArray& qb); void slotData (KIO::Job*, const TQByteArray& qb);
void redirection (KIO::Job *, const KURL &url); void redirection (KIO::Job *, const KURL &url);
void slotMimetype (KIO::Job *, const QString &mime); void slotMimetype (KIO::Job *, const TQString &mime);
void slotTotalSize (KIO::Job *, KIO::filesize_t sz); void slotTotalSize (KIO::Job *, KIO::filesize_t sz);
}; };
class KMPLAYER_NO_EXPORT NpPlayer : public Process { class KMPLAYER_NO_EXPORT NpPlayer : public Process {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
NpPlayer (QObject * parent, Settings * settings, const QString & srv); NpPlayer (TQObject * tqparent, Settings * settings, const TQString & srv);
~NpPlayer (); ~NpPlayer ();
virtual void init (); virtual void init ();
virtual bool deMediafiedPlay (); virtual bool deMediafiedPlay ();
virtual void initProcess (Viewer * viewer); virtual void initProcess (Viewer * viewer);
virtual QString menuName () const; virtual TQString menuName () const;
void setStarted (const QString & srv); void setStarted (const TQString & srv);
void requestStream (const QString & path, const QString & url, const QString & target); void requestStream (const TQString & path, const TQString & url, const TQString & target);
void destroyStream (const QString & path); void destroyStream (const TQString & path);
KDE_NO_EXPORT const QString & destination () const { return service; } KDE_NO_EXPORT const TQString & destination () const { return service; }
KDE_NO_EXPORT const QString & interface () const { return iface; } KDE_NO_EXPORT const TQString & interface () const { return iface; }
KDE_NO_EXPORT QString objectPath () const { return path; } KDE_NO_EXPORT TQString objectPath () const { return path; }
QString evaluateScript (const QString & scr); TQString evaluateScript (const TQString & scr);
signals: signals:
void evaluate (const QString & scr, QString & result); void evaluate (const TQString & scr, TQString & result);
void openUrl (const KURL & url, const QString & target); void openUrl (const KURL & url, const TQString & target);
public slots: public slots:
virtual bool stop (); virtual bool stop ();
virtual bool quit (); virtual bool quit ();
@ -477,21 +488,21 @@ private slots:
void processStopped (KProcess *); void processStopped (KProcess *);
void wroteStdin (KProcess *); void wroteStdin (KProcess *);
void streamStateChanged (); void streamStateChanged ();
void streamRedirected (Q_UINT32, const KURL &); void streamRedirected (TQ_UINT32, const KURL &);
protected: protected:
virtual void terminateJobs (); virtual void terminateJobs ();
private: private:
void sendFinish (Q_UINT32 sid, Q_UINT32 total, NpStream::Reason because); void sendFinish (TQ_UINT32 sid, TQ_UINT32 total, NpStream::Reason because);
void processStreams (); void processStreams ();
QString service; TQString service;
QString iface; TQString iface;
QString path; TQString path;
QString filter; TQString filter;
QString m_base_url; TQString m_base_url;
typedef QMap <Q_UINT32, NpStream *> StreamMap; typedef TQMap <TQ_UINT32, NpStream *> StreamMap;
StreamMap streams; StreamMap streams;
QString remote_service; TQString remote_service;
QByteArray send_buf; TQByteArray send_buf;
bool write_in_progress; bool write_in_progress;
}; };

@ -21,16 +21,16 @@
#ifndef KMPLAYERSOURCE_H #ifndef KMPLAYERSOURCE_H
#define KMPLAYERSOURCE_H #define KMPLAYERSOURCE_H
#include <qobject.h> #include <tqobject.h>
#include <qstring.h> #include <tqstring.h>
#include <kurl.h> #include <kurl.h>
#include "kmplayerplaylist.h" #include "kmplayerplaylist.h"
#include "kmplayerprocess.h" #include "kmplayerprocess.h"
class KConfig; class KConfig;
class QWidget; class TQWidget;
class QFrame; class TQFrame;
namespace KMPlayer { namespace KMPlayer {
@ -39,13 +39,14 @@ class PartBase;
/** /**
* Class for a certain media, like URL, DVD, TV etc * Class for a certain media, like URL, DVD, TV etc
*/ */
class KMPLAYER_EXPORT Source : public QObject, public PlayListNotify { class KMPLAYER_EXPORT Source : public TQObject, public PlayListNotify {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Source (const QString & name, PartBase * player, const char * src); Source (const TQString & name, PartBase * player, const char * src);
virtual ~Source (); virtual ~Source ();
virtual void init (); virtual void init ();
virtual bool processOutput (const QString & line); virtual bool processOutput (const TQString & line);
bool identified () const { return m_identified; } bool identified () const { return m_identified; }
virtual bool hasLength (); virtual bool hasLength ();
@ -63,28 +64,28 @@ public:
KDE_NO_EXPORT const KURL & subUrl () const { return m_sub_url; } KDE_NO_EXPORT const KURL & subUrl () const { return m_sub_url; }
PartBase * player () { return m_player; } PartBase * player () { return m_player; }
virtual void reset (); virtual void reset ();
QString currentMrl (); TQString currentMrl ();
KDE_NO_EXPORT const QString & audioDevice () const { return m_audiodevice; } KDE_NO_EXPORT const TQString & audioDevice () const { return m_audiodevice; }
KDE_NO_EXPORT const QString & videoDevice () const { return m_videodevice; } KDE_NO_EXPORT const TQString & videoDevice () const { return m_videodevice; }
KDE_NO_EXPORT const QString & videoNorm () const { return m_videonorm; } KDE_NO_EXPORT const TQString & videoNorm () const { return m_videonorm; }
/* frequency() if set, returns frequency in kHz */ /* frequency() if set, returns frequency in kHz */
KDE_NO_EXPORT int frequency () const { return m_frequency; } KDE_NO_EXPORT int frequency () const { return m_frequency; }
KDE_NO_EXPORT int xvPort () const { return m_xvport; } KDE_NO_EXPORT int xvPort () const { return m_xvport; }
KDE_NO_EXPORT int xvEncoding () const { return m_xvencoding; } KDE_NO_EXPORT int xvEncoding () const { return m_xvencoding; }
KDE_NO_EXPORT const QString & pipeCmd () const { return m_pipecmd; } KDE_NO_EXPORT const TQString & pipeCmd () const { return m_pipecmd; }
KDE_NO_EXPORT const QString & options () const { return m_options; } KDE_NO_EXPORT const TQString & options () const { return m_options; }
KDE_NO_EXPORT const QString & recordCmd () const { return m_recordcmd; } KDE_NO_EXPORT const TQString & recordCmd () const { return m_recordcmd; }
KDE_NO_EXPORT const QString & tuner () const { return m_tuner; } KDE_NO_EXPORT const TQString & tuner () const { return m_tuner; }
KDE_NO_EXPORT NodePtr current () const { return m_current; } KDE_NO_EXPORT NodePtr current () const { return m_current; }
QString plugin (const QString &mime) const; TQString plugin (const TQString &mime) const;
virtual NodePtr document (); virtual NodePtr document ();
virtual NodePtr root (); virtual NodePtr root ();
virtual QString filterOptions (); virtual TQString filterOptions ();
virtual void setURL (const KURL & url); virtual void setURL (const KURL & url);
void insertURL (NodePtr mrl, const QString & url, const QString & title=QString()); void insertURL (NodePtr mrl, const TQString & url, const TQString & title=TQString());
KDE_NO_EXPORT void setSubURL (const KURL & url) { m_sub_url = url; } KDE_NO_EXPORT void setSubURL (const KURL & url) { m_sub_url = url; }
void setLanguages (const QStringList & alang, const QStringList & slang); void setLanguages (const TQStringList & alang, const TQStringList & slang);
KDE_NO_EXPORT void setWidth (int w) { m_width = w; } KDE_NO_EXPORT void setWidth (int w) { m_width = w; }
KDE_NO_EXPORT void setHeight (int h) { m_height = h; } KDE_NO_EXPORT void setHeight (int h) { m_height = h; }
virtual void setDimensions (NodePtr, int w, int h); virtual void setDimensions (NodePtr, int w, int h);
@ -98,11 +99,11 @@ public:
virtual void stateChange (Process *, Process::State os, Process::State ns); virtual void stateChange (Process *, Process::State os, Process::State ns);
KDE_NO_EXPORT void setAutoPlay (bool b) { m_auto_play = b; } KDE_NO_EXPORT void setAutoPlay (bool b) { m_auto_play = b; }
KDE_NO_EXPORT bool autoPlay () const { return m_auto_play; } KDE_NO_EXPORT bool autoPlay () const { return m_auto_play; }
void setTitle (const QString & title); void setTitle (const TQString & title);
void setLoading (int percentage); void setLoading (int percentage);
bool setCurrent (NodePtr mrl); bool setCurrent (NodePtr mrl);
virtual QString prettyName (); virtual TQString prettyName ();
signals: signals:
void startPlaying (); void startPlaying ();
void stopPlaying (); void stopPlaying ();
@ -113,7 +114,7 @@ signals:
*/ */
void endOfPlayItems (); void endOfPlayItems ();
void dimensionsChanged (); void dimensionsChanged ();
void titleChanged (const QString & title); void titleChanged (const TQString & title);
public slots: public slots:
virtual void activate () = 0; virtual void activate () = 0;
virtual void deactivate () = 0; virtual void deactivate () = 0;
@ -130,7 +131,7 @@ public slots:
void setAudioLang (int); void setAudioLang (int);
void setSubtitle (int); void setSubtitle (int);
protected: protected:
void timerEvent (QTimerEvent *); void timerEvent (TQTimerEvent *);
/** /**
* PlayListNotify implementation * PlayListNotify implementation
*/ */
@ -138,30 +139,30 @@ protected:
bool resolveURL (NodePtr mrl); bool resolveURL (NodePtr mrl);
void stateElementChanged (Node * element, Node::State os, Node::State ns); void stateElementChanged (Node * element, Node::State os, Node::State ns);
SurfacePtr getSurface (NodePtr node); SurfacePtr getSurface (NodePtr node);
void setInfoMessage (const QString & msg); void setInfoMessage (const TQString & msg);
void bitRates (int & preferred, int & maximal); void bitRates (int & preferred, int & maximal);
void setTimeout (int ms); void setTimeout (int ms);
NodePtr m_document; NodePtr m_document;
NodePtrW m_current; NodePtrW m_current;
NodePtrW m_back_request; NodePtrW m_back_request;
QString m_name; TQString m_name;
PartBase * m_player; PartBase * m_player;
QString m_recordcmd; TQString m_recordcmd;
bool m_identified; bool m_identified;
bool m_auto_play; bool m_auto_play;
KURL m_url; KURL m_url;
KURL m_sub_url; KURL m_sub_url;
QString m_audiodevice; TQString m_audiodevice;
QString m_videodevice; TQString m_videodevice;
QString m_videonorm; TQString m_videonorm;
QString m_tuner; TQString m_tuner;
int m_frequency; int m_frequency;
int m_xvport; int m_xvport;
int m_xvencoding; int m_xvencoding;
QString m_pipecmd; TQString m_pipecmd;
QString m_options; TQString m_options;
QString m_plugin; TQString m_plugin;
private: private:
int m_width; int m_width;
int m_height; int m_height;

@ -17,21 +17,21 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#include <qlayout.h> #include <tqlayout.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qtable.h> #include <tqtable.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qwhatsthis.h> #include <tqwhatsthis.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
#include <qmessagebox.h> #include <tqmessagebox.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qfontmetrics.h> #include <tqfontmetrics.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h> #include <kdebug.h>
@ -55,84 +55,84 @@ static const char * strTV = "TV";
static const char * strTVDriver = "Driver"; static const char * strTVDriver = "Driver";
KDE_NO_CDTOR_EXPORT TVDevicePage::TVDevicePage (QWidget *parent, KMPlayer::NodePtr dev) KDE_NO_CDTOR_EXPORT TVDevicePage::TVDevicePage (TQWidget *tqparent, KMPlayer::NodePtr dev)
: QFrame (parent, "PageTVDevice"), device_doc (dev) { : TQFrame (tqparent, "PageTVDevice"), device_doc (dev) {
TVDevice * device = KMPlayer::convertNode <TVDevice> (device_doc); TVDevice * device = KMPlayer::convertNode <TVDevice> (device_doc);
QVBoxLayout *layout = new QVBoxLayout (this, 5, 2); TQVBoxLayout *tqlayout = new TQVBoxLayout (this, 5, 2);
QLabel * deviceLabel = new QLabel (i18n ("Video device:") + device->src, this, 0); TQLabel * deviceLabel = new TQLabel (i18n ("Video device:") + device->src, this, 0);
layout->addWidget (deviceLabel); tqlayout->addWidget (deviceLabel);
QGridLayout *gridlayout = new QGridLayout (layout, 3, 4); TQGridLayout *gridtqlayout = new TQGridLayout (tqlayout, 3, 4);
QLabel * audioLabel = new QLabel (i18n ("Audio device:"), this); TQLabel * audioLabel = new TQLabel (i18n ("Audio device:"), this);
audiodevice = new KURLRequester (device->getAttribute ("audio"), this); audiodevice = new KURLRequester (device->getAttribute ("audio"), this);
QLabel * nameLabel = new QLabel (i18n ("Name:"), this, 0); TQLabel * nameLabel = new TQLabel (i18n ("Name:"), this, 0);
name = new QLineEdit (device->pretty_name, this, 0); name = new TQLineEdit (device->pretty_name, this, 0);
QLabel *sizewidthLabel = new QLabel (i18n ("Width:"), this, 0); TQLabel *sizewidthLabel = new TQLabel (i18n ("Width:"), this, 0);
sizewidth = new QLineEdit (device->getAttribute (KMPlayer::StringPool::attr_width), this, 0); sizewidth = new TQLineEdit (device->getAttribute (KMPlayer::StringPool::attr_width), this, 0);
QLabel *sizeheightLabel = new QLabel (i18n ("Height:"), this, 0); TQLabel *sizeheightLabel = new TQLabel (i18n ("Height:"), this, 0);
sizeheight = new QLineEdit (device->getAttribute (KMPlayer::StringPool::attr_height), this, 0); sizeheight = new TQLineEdit (device->getAttribute (KMPlayer::StringPool::attr_height), this, 0);
noplayback = new QCheckBox (i18n ("Do not immediately play"), this); noplayback = new TQCheckBox (i18n ("Do not immediately play"), this);
noplayback->setChecked (!device->getAttribute ("playback").toInt ()); noplayback->setChecked (!device->getAttribute ("playback").toInt ());
QWhatsThis::add (noplayback, i18n ("Only start playing after clicking the play button")); TQWhatsThis::add (noplayback, i18n ("Only start playing after clicking the play button"));
inputsTab = new QTabWidget (this); inputsTab = new TQTabWidget (this);
for (KMPlayer::NodePtr ip = device->firstChild (); ip; ip = ip->nextSibling ()) { for (KMPlayer::NodePtr ip = device->firstChild (); ip; ip = ip->nextSibling ()) {
if (ip->id != id_node_tv_input) if (ip->id != id_node_tv_input)
continue; continue;
TVInput * input = KMPlayer::convertNode <TVInput> (ip); TVInput * input = KMPlayer::convertNode <TVInput> (ip);
QWidget * widget = new QWidget (this); TQWidget * widget = new TQWidget (this);
QHBoxLayout *tablayout = new QHBoxLayout (widget, 5, 2); TQHBoxLayout *tabtqlayout = new TQHBoxLayout (widget, 5, 2);
if (!input->getAttribute ("tuner").isEmpty ()) { if (!input->getAttribute ("tuner").isEmpty ()) {
QHBoxLayout *horzlayout = new QHBoxLayout (); TQHBoxLayout *horztqlayout = new TQHBoxLayout ();
QVBoxLayout *vertlayout = new QVBoxLayout (); TQVBoxLayout *verttqlayout = new TQVBoxLayout ();
horzlayout->addWidget (new QLabel (i18n ("Norm:"), widget)); horztqlayout->addWidget (new TQLabel (i18n ("Norm:"), widget));
QComboBox * norms = new QComboBox (widget, "PageTVNorm"); TQComboBox * norms = new TQComboBox (widget, "PageTVNorm");
norms->insertItem (QString ("NTSC"), 0); norms->insertItem (TQString ("NTSC"), 0);
norms->insertItem (QString ("PAL"), 1); norms->insertItem (TQString ("PAL"), 1);
norms->insertItem (QString ("SECAM"), 2); norms->insertItem (TQString ("SECAM"), 2);
norms->setCurrentText (input->getAttribute ("norm")); norms->setCurrentText (input->getAttribute ("norm"));
horzlayout->addWidget (norms); horztqlayout->addWidget (norms);
vertlayout->addLayout (horzlayout); verttqlayout->addLayout (horztqlayout);
vertlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); verttqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
QTable * table = new QTable (90, 2, widget, "PageTVChannels"); TQTable * table = new TQTable (90, 2, widget, "PageTVChannels");
QFontMetrics metrics (table->font ()); TQFontMetrics metrics (table->font ());
QHeader *header = table->horizontalHeader(); TQHeader *header = table->horizontalHeader();
header->setLabel (0, i18n ("Channel")); header->setLabel (0, i18n ("Channel"));
header->setLabel (1, i18n ("Frequency (MHz)")); header->setLabel (1, i18n ("Frequency (MHz)"));
int index = 0; int index = 0;
int first_column_width = QFontMetrics (header->font ()).boundingRect (header->label (0)).width () + 20; int first_column_width = TQFontMetrics (header->font ()).boundingRect (header->label (0)).width () + 20;
for (KMPlayer::NodePtr c=input->firstChild();c;c=c->nextSibling()) { for (KMPlayer::NodePtr c=input->firstChild();c;c=c->nextSibling()) {
if (c->id != id_node_tv_channel) if (c->id != id_node_tv_channel)
continue; continue;
int strwid = metrics.boundingRect (c->mrl ()->pretty_name).width (); int strwid = metrics.boundingRect (c->mrl ()->pretty_name).width ();
if (strwid > first_column_width) if (strwid > first_column_width)
first_column_width = strwid + 4; first_column_width = strwid + 4;
table->setItem (index, 0, new QTableItem (table, QTableItem::Always, c->mrl ()->pretty_name)); table->setItem (index, 0, new TQTableItem (table, TQTableItem::Always, c->mrl ()->pretty_name));
table->setItem (index++, 1, new QTableItem (table, QTableItem::Always, KMPlayer::convertNode<TVChannel>(c)->getAttribute ("frequency"))); table->setItem (index++, 1, new TQTableItem (table, TQTableItem::Always, KMPlayer::convertNode<TVChannel>(c)->getAttribute ("frequency")));
} }
table->setColumnWidth (0, first_column_width); table->setColumnWidth (0, first_column_width);
table->setColumnStretchable (1, true); table->setColumnStretchable (1, true);
tablayout->addWidget (table); tabtqlayout->addWidget (table);
tablayout->addLayout (vertlayout); tabtqlayout->addLayout (verttqlayout);
} }
inputsTab->addTab (widget, input->mrl ()->pretty_name); inputsTab->addTab (widget, input->mrl ()->pretty_name);
} }
QPushButton * delButton = new QPushButton (i18n ("Delete"), this); TQPushButton * delButton = new TQPushButton (i18n ("Delete"), this);
connect (delButton, SIGNAL (clicked ()), this, SLOT (slotDelete ())); connect (delButton, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotDelete ()));
gridlayout->addWidget (audioLabel, 0, 0); gridtqlayout->addWidget (audioLabel, 0, 0);
gridlayout->addMultiCellWidget (audiodevice, 0, 0, 1, 3); gridtqlayout->addMultiCellWidget (audiodevice, 0, 0, 1, 3);
gridlayout->addWidget (nameLabel, 1, 0); gridtqlayout->addWidget (nameLabel, 1, 0);
gridlayout->addMultiCellWidget (name, 1, 1, 1, 3); gridtqlayout->addMultiCellWidget (name, 1, 1, 1, 3);
gridlayout->addWidget (sizewidthLabel, 2, 0); gridtqlayout->addWidget (sizewidthLabel, 2, 0);
gridlayout->addWidget (sizewidth, 2, 1); gridtqlayout->addWidget (sizewidth, 2, 1);
gridlayout->addWidget (sizeheightLabel, 2, 2); gridtqlayout->addWidget (sizeheightLabel, 2, 2);
gridlayout->addWidget (sizeheight, 2, 3); gridtqlayout->addWidget (sizeheight, 2, 3);
layout->addWidget (inputsTab); tqlayout->addWidget (inputsTab);
layout->addSpacing (5); tqlayout->addSpacing (5);
layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum)); tqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Minimum));
QHBoxLayout *buttonlayout = new QHBoxLayout (); TQHBoxLayout *buttontqlayout = new TQHBoxLayout ();
buttonlayout->addWidget (noplayback); buttontqlayout->addWidget (noplayback);
buttonlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum)); buttontqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
buttonlayout->addWidget (delButton); buttontqlayout->addWidget (delButton);
layout->addLayout (buttonlayout); tqlayout->addLayout (buttontqlayout);
} }
KDE_NO_EXPORT void TVDevicePage::slotDelete () { KDE_NO_EXPORT void TVDevicePage::slotDelete () {
@ -142,58 +142,58 @@ KDE_NO_EXPORT void TVDevicePage::slotDelete () {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageTV::KMPlayerPrefSourcePageTV (QWidget *parent, KMPlayerTVSource * tvsource) KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageTV::KMPlayerPrefSourcePageTV (TQWidget *tqparent, KMPlayerTVSource * tvsource)
: QFrame (parent), m_tvsource (tvsource) { : TQFrame (tqparent), m_tvsource (tvsource) {
QVBoxLayout * mainlayout = new QVBoxLayout (this, 5); TQVBoxLayout * maintqlayout = new TQVBoxLayout (this, 5);
notebook = new QTabWidget (this); notebook = new TQTabWidget (this);
notebook->setTabPosition (QTabWidget::Bottom); notebook->setTabPosition (TQTabWidget::Bottom);
mainlayout->addWidget (notebook); maintqlayout->addWidget (notebook);
QWidget * general = new QWidget (notebook); TQWidget * general = new TQWidget (notebook);
QVBoxLayout *layout = new QVBoxLayout (general); TQVBoxLayout *tqlayout = new TQVBoxLayout (general);
QGridLayout *gridlayout = new QGridLayout (layout, 2, 2, 2); TQGridLayout *gridtqlayout = new TQGridLayout (tqlayout, 2, 2, 2);
QLabel *driverLabel = new QLabel (i18n ("Driver:"), general, 0); TQLabel *driverLabel = new TQLabel (i18n ("Driver:"), general, 0);
driver = new QLineEdit ("", general, 0); driver = new TQLineEdit ("", general, 0);
QWhatsThis::add (driver, i18n ("dummy, v4l or bsdbt848")); TQWhatsThis::add (driver, i18n ("dummy, v4l or bsdbt848"));
QLabel *deviceLabel = new QLabel (i18n ("Device:"), general, 0); TQLabel *deviceLabel = new TQLabel (i18n ("Device:"), general, 0);
device = new KURLRequester ("/dev/video", general); device = new KURLRequester ("/dev/video", general);
QWhatsThis::add(device, i18n("Path to your video device, eg. /dev/video0")); TQWhatsThis::add(device, i18n("Path to your video device, eg. /dev/video0"));
scan = new QPushButton (i18n ("Scan..."), general); scan = new TQPushButton (i18n ("Scan..."), general);
gridlayout->addWidget (driverLabel, 0, 0); gridtqlayout->addWidget (driverLabel, 0, 0);
gridlayout->addWidget (driver, 0, 1); gridtqlayout->addWidget (driver, 0, 1);
gridlayout->addWidget (deviceLabel, 1, 0); gridtqlayout->addWidget (deviceLabel, 1, 0);
gridlayout->addWidget (device, 1, 1); gridtqlayout->addWidget (device, 1, 1);
QHBoxLayout *buttonlayout = new QHBoxLayout (); TQHBoxLayout *buttontqlayout = new TQHBoxLayout ();
buttonlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum)); buttontqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Minimum));
buttonlayout->addWidget (scan); buttontqlayout->addWidget (scan);
layout->addLayout (buttonlayout); tqlayout->addLayout (buttontqlayout);
layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); tqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
notebook->insertTab (general, i18n ("General")); notebook->insertTab (general, i18n ("General"));
} }
KDE_NO_EXPORT void KMPlayerPrefSourcePageTV::showEvent (QShowEvent *) { KDE_NO_EXPORT void KMPlayerPrefSourcePageTV::showEvent (TQShowEvent *) {
m_tvsource->readXML (); m_tvsource->readXML ();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TVNode::TVNode (KMPlayer::NodePtr &d, const QString & s, const char * t, short id, const QString & n) : KMPlayer::GenericMrl (d, s, n, t) { KDE_NO_CDTOR_EXPORT TVNode::TVNode (KMPlayer::NodePtr &d, const TQString & s, const char * t, short id, const TQString & n) : KMPlayer::GenericMrl (d, s, n, t) {
this->id = id; this->id = id;
editable = true; editable = true;
} }
KDE_NO_EXPORT void TVNode::setNodeName (const QString & nn) { KDE_NO_EXPORT void TVNode::setNodeName (const TQString & nn) {
pretty_name = nn; pretty_name = nn;
setAttribute (KMPlayer::StringPool::attr_name, nn); setAttribute (KMPlayer::StringPool::attr_name, nn);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d, const QString & n, double freq) : TVNode (d, QString ("tv://"), "channel", id_node_tv_channel, n) { KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d, const TQString & n, double freq) : TVNode (d, TQString ("tv://"), "channel", id_node_tv_channel, n) {
setAttribute (KMPlayer::StringPool::attr_name, n); setAttribute (KMPlayer::StringPool::attr_name, n);
setAttribute ("frequency", QString::number (freq, 'f', 2)); setAttribute ("frequency", TQString::number (freq, 'f', 2));
} }
KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d) : TVNode (d, QString ("tv://"), "channel", id_node_tv_channel) { KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d) : TVNode (d, TQString ("tv://"), "channel", id_node_tv_channel) {
} }
KDE_NO_EXPORT void TVChannel::closed () { KDE_NO_EXPORT void TVChannel::closed () {
@ -202,18 +202,18 @@ KDE_NO_EXPORT void TVChannel::closed () {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
TVInput::TVInput (KMPlayer::NodePtr & d, const QString & n, int id) TVInput::TVInput (KMPlayer::NodePtr & d, const TQString & n, int id)
: TVNode (d, QString ("tv://"), "input", id_node_tv_input, n) { : TVNode (d, TQString ("tv://"), "input", id_node_tv_input, n) {
setAttribute (KMPlayer::StringPool::attr_name, n); setAttribute (KMPlayer::StringPool::attr_name, n);
setAttribute (KMPlayer::StringPool::attr_id, QString::number (id)); setAttribute (KMPlayer::StringPool::attr_id, TQString::number (id));
} }
KDE_NO_CDTOR_EXPORT TVInput::TVInput (KMPlayer::NodePtr & d) : TVNode (d, QString ("tv://"), "input", id_node_tv_input) { KDE_NO_CDTOR_EXPORT TVInput::TVInput (KMPlayer::NodePtr & d) : TVNode (d, TQString ("tv://"), "input", id_node_tv_input) {
} }
KDE_NO_EXPORT KMPlayer::NodePtr TVInput::childFromTag (const QString & tag) { KDE_NO_EXPORT KMPlayer::NodePtr TVInput::childFromTag (const TQString & tag) {
// kdDebug () << nodeName () << " childFromTag " << tag << endl; // kdDebug () << nodeName () << " childFromTag " << tag << endl;
if (tag == QString::fromLatin1 ("channel")) { if (tag == TQString::tqfromLatin1 ("channel")) {
return new TVChannel (m_doc); return new TVChannel (m_doc);
} else } else
return 0L; return 0L;
@ -223,21 +223,21 @@ KDE_NO_EXPORT void TVInput::closed () {
//pretty_name = getAttribute (KMPlayer::StringPool::attr_name); //pretty_name = getAttribute (KMPlayer::StringPool::attr_name);
} }
KDE_NO_EXPORT void TVInput::setNodeName (const QString & name) { KDE_NO_EXPORT void TVInput::setNodeName (const TQString & name) {
Node * p = parentNode ().ptr (); Node * p = tqparentNode ().ptr ();
QString nm (name); TQString nm (name);
if (p && p->id == id_node_tv_device) { if (p && p->id == id_node_tv_device) {
int pos = name.find (QString (" - ") + p->mrl ()->pretty_name); int pos = name.tqfind (TQString (" - ") + p->mrl ()->pretty_name);
if (pos > -1) if (pos > -1)
nm.truncate (pos); nm.truncate (pos);
} }
pretty_name = nm + QString (" - ") + pretty_name; pretty_name = nm + TQString (" - ") + pretty_name;
TVNode::setNodeName (nm); TVNode::setNodeName (nm);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TVDevice::TVDevice (KMPlayer::NodePtr & doc, const QString & d) : TVNode (doc, d, "device", id_node_tv_device), zombie (false) { KDE_NO_CDTOR_EXPORT TVDevice::TVDevice (KMPlayer::NodePtr & doc, const TQString & d) : TVNode (doc, d, "device", id_node_tv_device), zombie (false) {
setAttribute ("path", d); setAttribute ("path", d);
} }
@ -250,9 +250,9 @@ KDE_NO_CDTOR_EXPORT TVDevice::~TVDevice () {
device_page->deleteLater (); device_page->deleteLater ();
} }
KDE_NO_EXPORT KMPlayer::NodePtr TVDevice::childFromTag (const QString & tag) { KDE_NO_EXPORT KMPlayer::NodePtr TVDevice::childFromTag (const TQString & tag) {
// kdDebug () << nodeName () << " childFromTag " << tag << endl; // kdDebug () << nodeName () << " childFromTag " << tag << endl;
if (tag == QString::fromLatin1 ("input")) if (tag == TQString::tqfromLatin1 ("input"))
return new TVInput (m_doc); return new TVInput (m_doc);
return 0L; return 0L;
} }
@ -265,7 +265,7 @@ KDE_NO_EXPORT void TVDevice::childDone (KMPlayer::NodePtr) {
finish (); finish ();
} }
KDE_NO_EXPORT void TVDevice::setNodeName (const QString & name) { KDE_NO_EXPORT void TVDevice::setNodeName (const TQString & name) {
TVNode::setNodeName (name); TVNode::setNodeName (name);
updateNodeName (); updateNodeName ();
} }
@ -277,7 +277,7 @@ KDE_NO_EXPORT void TVDevice::updateNodeName () {
if (c->id == id_node_tv_input) { if (c->id == id_node_tv_input) {
TVInput * i = static_cast <TVInput *> (c.ptr ()); TVInput * i = static_cast <TVInput *> (c.ptr ());
i->pretty_name = i->getAttribute (KMPlayer::StringPool::attr_name) + i->pretty_name = i->getAttribute (KMPlayer::StringPool::attr_name) +
QString (" - ") + pretty_name; TQString (" - ") + pretty_name;
} }
} }
@ -297,15 +297,15 @@ KDE_NO_EXPORT void TVDevice::updateDevicePage () {
TVInput * input = KMPlayer::convertNode <TVInput> (ip); TVInput * input = KMPlayer::convertNode <TVInput> (ip);
bool ok; bool ok;
if (input->getAttribute ("tuner").toInt (&ok) && ok) { if (input->getAttribute ("tuner").toInt (&ok) && ok) {
QWidget * widget = device_page->inputsTab->page (i); TQWidget * widget = device_page->inputsTab->page (i);
QTable * table = static_cast <QTable *> (widget->child ("PageTVChannels", "QTable")); TQTable * table = static_cast <TQTable *> (TQT_TQWIDGET(widget->child ("PageTVChannels", TQTABLE_OBJECT_NAME_STRING)));
if (table) { if (table) {
input->clearChildren (); input->clearChildren ();
for (int j = 0; j<table->numRows() && table->item (j, 1); ++j) { for (int j = 0; j<table->numRows() && table->item (j, 1); ++j) {
input->appendChild (new TVChannel (m_doc, table->item (j, 0)->text (), table->item (j, 1)->text ().toDouble ())); input->appendChild (new TVChannel (m_doc, table->item (j, 0)->text (), table->item (j, 1)->text ().toDouble ()));
} }
} }
QComboBox * norms = static_cast <QComboBox *> (widget->child ("PageTVNorm", "QComboBox")); TQComboBox * norms = static_cast <TQComboBox *> (TQT_TQWIDGET(widget->child ("PageTVNorm", TQCOMBOBOX_OBJECT_NAME_STRING)));
if (norms) { if (norms) {
input->setAttribute ("norm", norms->currentText ()); input->setAttribute ("norm", norms->currentText ());
} }
@ -321,9 +321,9 @@ TVDocument::TVDocument (KMPlayerTVSource * source)
pretty_name = i18n ("Television"); pretty_name = i18n ("Television");
} }
KDE_NO_EXPORT KMPlayer::NodePtr TVDocument::childFromTag (const QString & tag) { KDE_NO_EXPORT KMPlayer::NodePtr TVDocument::childFromTag (const TQString & tag) {
// kdDebug () << nodeName () << " childFromTag " << tag << endl; // kdDebug () << nodeName () << " childFromTag " << tag << endl;
if (tag == QString::fromLatin1 ("device")) if (tag == TQString::tqfromLatin1 ("device"))
return new TVDevice (m_doc); return new TVDevice (m_doc);
return FileDocument::childFromTag (tag); return FileDocument::childFromTag (tag);
} }
@ -341,11 +341,11 @@ KDE_NO_EXPORT void TVDocument::defer () {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerTVSource::KMPlayerTVSource (KMPlayerApp * a, QPopupMenu * m) KDE_NO_CDTOR_EXPORT KMPlayerTVSource::KMPlayerTVSource (KMPlayerApp * a, TQPopupMenu * m)
: KMPlayerMenuSource (i18n ("TV"), a, m, "tvsource"), m_configpage (0L), scanner (0L), config_read (false) { : KMPlayerMenuSource (i18n ("TV"), a, m, "tvsource"), m_configpage (0L), scanner (0L), config_read (false) {
m_url = "tv://"; m_url = "tv://";
m_menu->insertTearOffHandle (); m_menu->insertTearOffHandle ();
connect (m_menu, SIGNAL (aboutToShow ()), this, SLOT (menuAboutToShow ())); connect (m_menu, TQT_SIGNAL (aboutToShow ()), this, TQT_SLOT (menuAboutToShow ()));
m_document = new TVDocument (this); m_document = new TVDocument (this);
m_player->settings ()->addPage (this); m_player->settings ()->addPage (this);
tree_id = static_cast <KMPlayer::View*>(m_player->view ())->playList ()->addTree (m_document, "tvsource", "tv", KMPlayer::PlayListView::TreeEdit | KMPlayer::PlayListView::Moveable | KMPlayer::PlayListView::Deleteable); tree_id = static_cast <KMPlayer::View*>(m_player->view ())->playList ()->addTree (m_document, "tvsource", "tv", KMPlayer::PlayListView::TreeEdit | KMPlayer::PlayListView::Moveable | KMPlayer::PlayListView::Deleteable);
@ -377,9 +377,9 @@ KDE_NO_EXPORT void KMPlayerTVSource::activate () {
KMPlayer::Source::reset (); KMPlayer::Source::reset ();
buildArguments (); buildArguments ();
if (m_cur_tvdevice) { if (m_cur_tvdevice) {
QString playback = static_cast <KMPlayer::Element *> (m_cur_tvdevice.ptr ())->getAttribute (QString::fromLatin1 ("playback")); TQString playback = static_cast <KMPlayer::Element *> (m_cur_tvdevice.ptr ())->getAttribute (TQString::tqfromLatin1 ("playback"));
if (playback.isEmpty () || playback.toInt ()) if (playback.isEmpty () || playback.toInt ())
QTimer::singleShot (0, m_player, SLOT (play ())); TQTimer::singleShot (0, m_player, TQT_SLOT (play ()));
} }
} }
/* TODO: playback by /* TODO: playback by
@ -397,7 +397,7 @@ KDE_NO_EXPORT void KMPlayerTVSource::buildMenu () {
int counter = 0; int counter = 0;
for (KMPlayer::NodePtr dp = m_document->firstChild (); dp; dp = dp->nextSibling ()) for (KMPlayer::NodePtr dp = m_document->firstChild (); dp; dp = dp->nextSibling ())
if (dp->id == id_node_tv_device) if (dp->id == id_node_tv_device)
m_menu->insertItem (KMPlayer::convertNode <TVDevice> (dp)->pretty_name, this, SLOT (menuClicked (int)), 0, counter++); m_menu->insertItem (KMPlayer::convertNode <TVDevice> (dp)->pretty_name, this, TQT_SLOT (menuClicked (int)), 0, counter++);
} }
KDE_NO_EXPORT void KMPlayerTVSource::menuAboutToShow () { KDE_NO_EXPORT void KMPlayerTVSource::menuAboutToShow () {
@ -409,7 +409,7 @@ void KMPlayerTVSource::jump (KMPlayer::NodePtr e) {
readXML (); readXML ();
} else { } else {
m_current = e; m_current = e;
for (; e; e = e->parentNode ()) { for (; e; e = e->tqparentNode ()) {
if (e->id == id_node_tv_device) { if (e->id == id_node_tv_device) {
m_cur_tvdevice = e; m_cur_tvdevice = e;
break; break;
@ -436,14 +436,14 @@ KDE_NO_EXPORT void KMPlayerTVSource::buildArguments () {
KMPlayer::NodePtr elm = m_current; KMPlayer::NodePtr elm = m_current;
if (elm && elm->id == id_node_tv_channel) { if (elm && elm->id == id_node_tv_channel) {
channel = KMPlayer::convertNode <TVChannel> (elm); channel = KMPlayer::convertNode <TVChannel> (elm);
elm = elm->parentNode (); elm = elm->tqparentNode ();
} }
if (elm && elm->id == id_node_tv_input) if (elm && elm->id == id_node_tv_input)
input = KMPlayer::convertNode <TVInput> (elm); input = KMPlayer::convertNode <TVInput> (elm);
if (!(channel || (input && input->getAttribute ("tuner").isEmpty ()))) if (!(channel || (input && input->getAttribute ("tuner").isEmpty ())))
return; return;
m_cur_tvinput = input; m_cur_tvinput = input;
m_cur_tvdevice = input->parentNode (); m_cur_tvdevice = input->tqparentNode ();
static_cast <KMPlayer::View*>(m_player->view ())->playList ()->updateTree (0, m_cur_tvinput, m_current, true, false); static_cast <KMPlayer::View*>(m_player->view ())->playList ()->updateTree (0, m_cur_tvinput, m_current, true, false);
if (m_cur_tvdevice->id != id_node_tv_device) { if (m_cur_tvdevice->id != id_node_tv_device) {
return; return;
@ -454,39 +454,39 @@ KDE_NO_EXPORT void KMPlayerTVSource::buildArguments () {
m_videodevice = tvdevice->src; m_videodevice = tvdevice->src;
m_videonorm = input->getAttribute ("norm"); m_videonorm = input->getAttribute ("norm");
m_tuner = input->getAttribute (KMPlayer::StringPool::attr_name); m_tuner = input->getAttribute (KMPlayer::StringPool::attr_name);
QString xvport = tvdevice->getAttribute ("xvport"); TQString xvport = tvdevice->getAttribute ("xvport");
if (!xvport.isEmpty ()) if (!xvport.isEmpty ())
m_xvport = xvport.toInt (); m_xvport = xvport.toInt ();
QString xvenc = input->getAttribute ("xvenc"); TQString xvenc = input->getAttribute ("xvenc");
if (!xvenc.isEmpty ()) if (!xvenc.isEmpty ())
m_xvencoding = xvenc.toInt (); m_xvencoding = xvenc.toInt ();
QString command; TQString command;
command.sprintf ("device=%s:input=%s", command.sprintf ("device=%s:input=%s",
tvdevice->src.ascii (), tvdevice->src.ascii (),
input->getAttribute (KMPlayer::StringPool::attr_id).ascii ()); input->getAttribute (KMPlayer::StringPool::attr_id).ascii ());
if (channel) { if (channel) {
QString freq = channel->getAttribute ("frequency"); TQString freq = channel->getAttribute ("frequency");
m_frequency = (int)(1000 * freq.toDouble ()); m_frequency = (int)(1000 * freq.toDouble ());
command += QString (":freq=%1").arg (freq); command += TQString (":freq=%1").arg (freq);
} else } else
m_frequency = 0; m_frequency = 0;
if (!m_videonorm.isEmpty ()) if (!m_videonorm.isEmpty ())
command += QString (":norm=%1").arg (m_videonorm); command += TQString (":norm=%1").arg (m_videonorm);
m_app->setCaption (i18n ("TV: ") + (channel ? channel->mrl ()->pretty_name : input->mrl ()->pretty_name), false); m_app->setCaption (i18n ("TV: ") + (channel ? channel->mrl ()->pretty_name : input->mrl ()->pretty_name), false);
setDimensions (m_cur_tvdevice, setDimensions (m_cur_tvdevice,
tvdevice->getAttribute (KMPlayer::StringPool::attr_width).toInt (), tvdevice->getAttribute (KMPlayer::StringPool::attr_width).toInt (),
tvdevice->getAttribute (KMPlayer::StringPool::attr_height).toInt ()); tvdevice->getAttribute (KMPlayer::StringPool::attr_height).toInt ());
m_options.sprintf ("-tv noaudio:driver=%s:%s:width=%d:height=%d -slave -nocache -quiet", tvdriver.ascii (), command.ascii (), width (), height ()); m_options.sprintf ("-tv noaudio:driver=%s:%s:width=%d:height=%d -slave -nocache -quiet", tvdriver.ascii (), command.ascii (), width (), height ());
if (m_player->settings ()->mplayerpost090) if (m_player->settings ()->mplayerpost090)
m_recordcmd.sprintf ("-tv %s:driver=%s:%s:width=%d:height=%d", m_audiodevice.isEmpty () ? "noaudio" : (QString ("forceaudio:adevice=") + m_audiodevice).ascii(), tvdriver.ascii (), command.ascii (), width (), height ()); m_recordcmd.sprintf ("-tv %s:driver=%s:%s:width=%d:height=%d", m_audiodevice.isEmpty () ? "noaudio" : (TQString ("forceaudio:adevice=") + m_audiodevice).ascii(), tvdriver.ascii (), command.ascii (), width (), height ());
else else
m_recordcmd.sprintf ("-tv on:%s:driver=%s:%s:width=%d:height=%d", m_audiodevice.isEmpty () ? "noaudio" : (QString ("forceaudio:adevice=") + m_audiodevice).ascii(), tvdriver.ascii (), command.ascii (), width (), height ()); m_recordcmd.sprintf ("-tv on:%s:driver=%s:%s:width=%d:height=%d", m_audiodevice.isEmpty () ? "noaudio" : (TQString ("forceaudio:adevice=") + m_audiodevice).ascii(), tvdriver.ascii (), command.ascii (), width (), height ());
} }
KDE_NO_EXPORT void KMPlayerTVSource::playCurrent () { KDE_NO_EXPORT void KMPlayerTVSource::playCurrent () {
buildArguments (); buildArguments ();
if (m_app->broadcasting ()) if (m_app->broadcasting ())
QTimer::singleShot (0, m_app->broadcastConfig (), SLOT (startFeed ())); TQTimer::singleShot (0, m_app->broadcastConfig (), TQT_SLOT (startFeed ()));
else else
KMPlayer::Source::playCurrent (); KMPlayer::Source::playCurrent ();
} }
@ -501,10 +501,10 @@ KDE_NO_EXPORT void KMPlayerTVSource::menuClicked (int id) {
m_player->setSource (this); m_player->setSource (this);
} }
KDE_NO_EXPORT QString KMPlayerTVSource::filterOptions () { KDE_NO_EXPORT TQString KMPlayerTVSource::filterOptions () {
if (! m_player->settings ()->disableppauto) if (! m_player->settings ()->disableppauto)
return KMPlayer::Source::filterOptions (); return KMPlayer::Source::filterOptions ();
return QString ("-vf pp=lb"); return TQString ("-vf pp=lb");
} }
KDE_NO_EXPORT bool KMPlayerTVSource::hasLength () { KDE_NO_EXPORT bool KMPlayerTVSource::hasLength () {
@ -515,8 +515,8 @@ KDE_NO_EXPORT bool KMPlayerTVSource::isSeekable () {
return true; return true;
} }
KDE_NO_EXPORT QString KMPlayerTVSource::prettyName () { KDE_NO_EXPORT TQString KMPlayerTVSource::prettyName () {
QString name (i18n ("TV")); TQString name (i18n ("TV"));
//if (m_tvsource) //if (m_tvsource)
// name += ' ' + m_tvsource->title; // name += ' ' + m_tvsource->title;
return name; return name;
@ -565,22 +565,22 @@ KDE_NO_EXPORT void KMPlayerTVSource::sync (bool fromUI) {
} }
} }
KDE_NO_EXPORT void KMPlayerTVSource::prefLocation (QString & item, QString & icon, QString & tab) { KDE_NO_EXPORT void KMPlayerTVSource::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Source"); item = i18n ("Source");
icon = QString ("source"); icon = TQString ("source");
tab = i18n ("TV"); tab = i18n ("TV");
} }
KDE_NO_EXPORT QFrame * KMPlayerTVSource::prefPage (QWidget * parent) { KDE_NO_EXPORT TQFrame * KMPlayerTVSource::prefPage (TQWidget * tqparent) {
if (!m_configpage) { if (!m_configpage) {
m_configpage = new KMPlayerPrefSourcePageTV (parent, this); m_configpage = new KMPlayerPrefSourcePageTV (tqparent, this);
scanner = new TVDeviceScannerSource (this); scanner = new TVDeviceScannerSource (this);
connect (m_configpage->scan, SIGNAL(clicked()), this, SLOT(slotScan())); connect (m_configpage->scan, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotScan()));
} }
return m_configpage; return m_configpage;
} }
static bool hasTVDevice (KMPlayer::NodePtr doc, const QString & devstr) { static bool hasTVDevice (KMPlayer::NodePtr doc, const TQString & devstr) {
for (KMPlayer::NodePtr e = doc->firstChild (); e; e = e->nextSibling ()) for (KMPlayer::NodePtr e = doc->firstChild (); e; e = e->nextSibling ())
if (e->id == id_node_tv_device && if (e->id == id_node_tv_device &&
KMPlayer::convertNode <TVDevice> (e)->src == devstr) KMPlayer::convertNode <TVDevice> (e)->src == devstr)
@ -589,19 +589,19 @@ static bool hasTVDevice (KMPlayer::NodePtr doc, const QString & devstr) {
} }
KDE_NO_EXPORT void KMPlayerTVSource::slotScan () { KDE_NO_EXPORT void KMPlayerTVSource::slotScan () {
QString devstr = m_configpage->device->lineEdit()->text (); TQString devstr = m_configpage->device->lineEdit()->text ();
if (!hasTVDevice(m_document, devstr)) { if (!hasTVDevice(m_document, devstr)) {
scanner->scan (devstr, m_configpage->driver->text()); scanner->scan (devstr, m_configpage->driver->text());
connect (scanner, SIGNAL (scanFinished (TVDevice *)), connect (scanner, TQT_SIGNAL (scanFinished (TVDevice *)),
this, SLOT (slotScanFinished (TVDevice *))); this, TQT_SLOT (slotScanFinished (TVDevice *)));
} else } else
KMessageBox::error (m_configpage, i18n ("Device already present."), KMessageBox::error (m_configpage, i18n ("Device already present."),
i18n ("Error")); i18n ("Error"));
} }
KDE_NO_EXPORT void KMPlayerTVSource::slotScanFinished (TVDevice * tvdevice) { KDE_NO_EXPORT void KMPlayerTVSource::slotScanFinished (TVDevice * tvdevice) {
disconnect (scanner, SIGNAL (scanFinished (TVDevice *)), disconnect (scanner, TQT_SIGNAL (scanFinished (TVDevice *)),
this, SLOT (slotScanFinished (TVDevice *))); this, TQT_SLOT (slotScanFinished (TVDevice *)));
if (tvdevice) { if (tvdevice) {
tvdevice->zombie = false; tvdevice->zombie = false;
addTVDevicePage (tvdevice, true); addTVDevicePage (tvdevice, true);
@ -614,8 +614,8 @@ KDE_NO_EXPORT void KMPlayerTVSource::addTVDevicePage(TVDevice *dev, bool show) {
dev->device_page->deleteLater (); dev->device_page->deleteLater ();
dev->device_page = new TVDevicePage (m_configpage->notebook, dev); dev->device_page = new TVDevicePage (m_configpage->notebook, dev);
m_configpage->notebook->insertTab (dev->device_page, dev->pretty_name); m_configpage->notebook->insertTab (dev->device_page, dev->pretty_name);
connect (dev->device_page, SIGNAL (deleted (TVDevicePage *)), connect (dev->device_page, TQT_SIGNAL (deleted (TVDevicePage *)),
this, SLOT (slotDeviceDeleted (TVDevicePage *))); this, TQT_SLOT (slotDeviceDeleted (TVDevicePage *)));
if (show) if (show)
m_configpage->notebook->setCurrentPage (m_configpage->notebook->count ()-1); m_configpage->notebook->setCurrentPage (m_configpage->notebook->count ()-1);
} }
@ -634,7 +634,7 @@ KDE_NO_CDTOR_EXPORT TVDeviceScannerSource::TVDeviceScannerSource (KMPlayerTVSour
KDE_NO_EXPORT void TVDeviceScannerSource::init () { KDE_NO_EXPORT void TVDeviceScannerSource::init () {
} }
KDE_NO_EXPORT bool TVDeviceScannerSource::processOutput (const QString & line) { KDE_NO_EXPORT bool TVDeviceScannerSource::processOutput (const TQString & line) {
if (m_nameRegExp.search (line) > -1) { if (m_nameRegExp.search (line) > -1) {
m_tvdevice->pretty_name = m_nameRegExp.cap (1); m_tvdevice->pretty_name = m_nameRegExp.cap (1);
m_tvdevice->setAttribute(KMPlayer::StringPool::attr_name,m_tvdevice->pretty_name); m_tvdevice->setAttribute(KMPlayer::StringPool::attr_name,m_tvdevice->pretty_name);
@ -661,8 +661,8 @@ KDE_NO_EXPORT bool TVDeviceScannerSource::processOutput (const QString & line) {
return true; return true;
} }
KDE_NO_EXPORT QString TVDeviceScannerSource::filterOptions () { KDE_NO_EXPORT TQString TVDeviceScannerSource::filterOptions () {
return QString (""); return TQString ("");
} }
KDE_NO_EXPORT bool TVDeviceScannerSource::hasLength () { KDE_NO_EXPORT bool TVDeviceScannerSource::hasLength () {
@ -673,7 +673,7 @@ KDE_NO_EXPORT bool TVDeviceScannerSource::isSeekable () {
return false; return false;
} }
KDE_NO_EXPORT bool TVDeviceScannerSource::scan (const QString & dev, const QString & dri) { KDE_NO_EXPORT bool TVDeviceScannerSource::scan (const TQString & dev, const TQString & dri) {
if (m_tvdevice) if (m_tvdevice)
return false; return false;
setURL (KURL ("tv://")); setURL (KURL ("tv://"));
@ -698,8 +698,8 @@ KDE_NO_EXPORT void TVDeviceScannerSource::activate () {
KDE_NO_EXPORT void TVDeviceScannerSource::deactivate () { KDE_NO_EXPORT void TVDeviceScannerSource::deactivate () {
kdDebug () << "TVDeviceScannerSource::deactivate" << endl; kdDebug () << "TVDeviceScannerSource::deactivate" << endl;
if (m_tvdevice) { if (m_tvdevice) {
if (m_tvdevice->parentNode ()) if (m_tvdevice->tqparentNode ())
m_tvdevice->parentNode ()->removeChild (m_tvdevice); m_tvdevice->tqparentNode ()->removeChild (m_tvdevice);
m_tvdevice = 0L; m_tvdevice = 0L;
emit scanFinished (m_tvdevice); emit scanFinished (m_tvdevice);
} }
@ -708,7 +708,7 @@ KDE_NO_EXPORT void TVDeviceScannerSource::deactivate () {
KDE_NO_EXPORT void TVDeviceScannerSource::play () { KDE_NO_EXPORT void TVDeviceScannerSource::play () {
if (!m_tvdevice) if (!m_tvdevice)
return; return;
QString args; TQString args;
args.sprintf ("tv:// -tv driver=%s:device=%s -identify -frames 0", m_driver.ascii (), m_tvdevice->src.ascii ()); args.sprintf ("tv:// -tv driver=%s:device=%s -identify -frames 0", m_driver.ascii (), m_tvdevice->src.ascii ());
m_tvsource->player ()->stop (); m_tvsource->player ()->stop ();
m_tvsource->player ()->process ()->initProcess (m_player->settings ()->defaultView ()->viewer ()); m_tvsource->player ()->process ()->initProcess (m_player->settings ()->defaultView ()->viewer ());

@ -20,9 +20,9 @@
#ifndef _KMPLAYER_TV_SOURCE_H_ #ifndef _KMPLAYER_TV_SOURCE_H_
#define _KMPLAYER_TV_SOURCE_H_ #define _KMPLAYER_TV_SOURCE_H_
#include <qguardedptr.h> #include <tqguardedptr.h>
#include <qstring.h> #include <tqstring.h>
#include <qframe.h> #include <tqframe.h>
#include "kmplayerappsource.h" #include "kmplayerappsource.h"
#include "kmplayerconfig.h" #include "kmplayerconfig.h"
@ -39,26 +39,27 @@ class KMPlayerTVSource;
class KURLRequester; class KURLRequester;
class KHistoryCombo; class KHistoryCombo;
class KMPlayerApp; class KMPlayerApp;
class QTabWidget; class TQTabWidget;
class QGroupBox; class TQGroupBox;
class QLineEdit; class TQLineEdit;
class QCheckBox; class TQCheckBox;
class KComboBox; class KComboBox;
class KConfig; class KConfig;
class KMPLAYER_NO_EXPORT TVDevicePage : public QFrame { class KMPLAYER_NO_EXPORT TVDevicePage : public TQFrame {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
TVDevicePage (QWidget *parent, KMPlayer::NodePtr dev); TVDevicePage (TQWidget *tqparent, KMPlayer::NodePtr dev);
KDE_NO_CDTOR_EXPORT ~TVDevicePage () {} KDE_NO_CDTOR_EXPORT ~TVDevicePage () {}
QLineEdit * name; TQLineEdit * name;
KURLRequester * audiodevice; KURLRequester * audiodevice;
QLineEdit * sizewidth; TQLineEdit * sizewidth;
QLineEdit * sizeheight; TQLineEdit * sizeheight;
QCheckBox * noplayback; TQCheckBox * noplayback;
QTabWidget * inputsTab; TQTabWidget * inputsTab;
KMPlayer::NodePtrW device_doc; KMPlayer::NodePtrW device_doc;
signals: signals:
void deleted (TVDevicePage *); void deleted (TVDevicePage *);
@ -66,24 +67,25 @@ private slots:
void slotDelete (); void slotDelete ();
}; };
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageTV : public QFrame { class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageTV : public TQFrame {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerPrefSourcePageTV (QWidget *parent, KMPlayerTVSource *); KMPlayerPrefSourcePageTV (TQWidget *tqparent, KMPlayerTVSource *);
KDE_NO_CDTOR_EXPORT ~KMPlayerPrefSourcePageTV () {} KDE_NO_CDTOR_EXPORT ~KMPlayerPrefSourcePageTV () {}
QLineEdit * driver; TQLineEdit * driver;
KURLRequester * device; KURLRequester * device;
QPushButton * scan; TQPushButton * scan;
QTabWidget * notebook; TQTabWidget * notebook;
protected: protected:
void showEvent (QShowEvent *); void showEvent (TQShowEvent *);
KMPlayerTVSource * m_tvsource; KMPlayerTVSource * m_tvsource;
}; };
class KMPLAYER_NO_EXPORT TVNode : public KMPlayer::GenericMrl { class KMPLAYER_NO_EXPORT TVNode : public KMPlayer::GenericMrl {
public: public:
TVNode (KMPlayer::NodePtr &d, const QString &s, const char * t, short id, const QString &n=QString ()); TVNode (KMPlayer::NodePtr &d, const TQString &s, const char * t, short id, const TQString &n=TQString ());
virtual void setNodeName (const QString &); virtual void setNodeName (const TQString &);
}; };
/* /*
@ -91,7 +93,7 @@ public:
*/ */
class KMPLAYER_NO_EXPORT TVChannel : public TVNode { class KMPLAYER_NO_EXPORT TVChannel : public TVNode {
public: public:
TVChannel (KMPlayer::NodePtr & d, const QString & n, double f); TVChannel (KMPlayer::NodePtr & d, const TQString & n, double f);
TVChannel (KMPlayer::NodePtr & d); TVChannel (KMPlayer::NodePtr & d);
KDE_NO_CDTOR_EXPORT ~TVChannel () {} KDE_NO_CDTOR_EXPORT ~TVChannel () {}
void closed (); void closed ();
@ -102,11 +104,11 @@ public:
*/ */
class KMPLAYER_NO_EXPORT TVInput : public TVNode { class KMPLAYER_NO_EXPORT TVInput : public TVNode {
public: public:
TVInput (KMPlayer::NodePtr & d, const QString & n, int id); TVInput (KMPlayer::NodePtr & d, const TQString & n, int id);
TVInput (KMPlayer::NodePtr & d); TVInput (KMPlayer::NodePtr & d);
KDE_NO_CDTOR_EXPORT ~TVInput () {} KDE_NO_CDTOR_EXPORT ~TVInput () {}
KMPlayer::NodePtr childFromTag (const QString &); KMPlayer::NodePtr childFromTag (const TQString &);
void setNodeName (const QString &); void setNodeName (const TQString &);
void closed (); void closed ();
}; };
@ -115,25 +117,25 @@ public:
*/ */
class KMPLAYER_NO_EXPORT TVDevice : public TVNode { class KMPLAYER_NO_EXPORT TVDevice : public TVNode {
public: public:
TVDevice (KMPlayer::NodePtr & d, const QString & s); TVDevice (KMPlayer::NodePtr & d, const TQString & s);
TVDevice (KMPlayer::NodePtr & d); TVDevice (KMPlayer::NodePtr & d);
~TVDevice (); ~TVDevice ();
KMPlayer::NodePtr childFromTag (const QString &); KMPlayer::NodePtr childFromTag (const TQString &);
void closed (); void closed ();
void childDone (KMPlayer::NodePtr child); void childDone (KMPlayer::NodePtr child);
void setNodeName (const QString &); void setNodeName (const TQString &);
bool expose () const { return false; } bool expose () const { return false; }
void updateNodeName (); void updateNodeName ();
void updateDevicePage (); void updateDevicePage ();
bool zombie; bool zombie;
QGuardedPtr <TVDevicePage> device_page; TQGuardedPtr <TVDevicePage> device_page;
}; };
class KMPLAYER_NO_EXPORT TVDocument : public FileDocument { class KMPLAYER_NO_EXPORT TVDocument : public FileDocument {
KMPlayerTVSource * m_source; KMPlayerTVSource * m_source;
public: public:
TVDocument (KMPlayerTVSource *); TVDocument (KMPlayerTVSource *);
KMPlayer::NodePtr childFromTag (const QString &); KMPlayer::NodePtr childFromTag (const TQString &);
void defer (); void defer ();
KDE_NO_EXPORT const char * nodeName () const { return "tvdevices"; } KDE_NO_EXPORT const char * nodeName () const { return "tvdevices"; }
void childDone (KMPlayer::NodePtr child); void childDone (KMPlayer::NodePtr child);
@ -145,15 +147,16 @@ public:
*/ */
class KMPLAYER_NO_EXPORT TVDeviceScannerSource : public KMPlayer::Source { class KMPLAYER_NO_EXPORT TVDeviceScannerSource : public KMPlayer::Source {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
TVDeviceScannerSource (KMPlayerTVSource * src); TVDeviceScannerSource (KMPlayerTVSource * src);
KDE_NO_CDTOR_EXPORT ~TVDeviceScannerSource () {}; KDE_NO_CDTOR_EXPORT ~TVDeviceScannerSource () {};
virtual void init (); virtual void init ();
virtual bool processOutput (const QString & line); virtual bool processOutput (const TQString & line);
virtual QString filterOptions (); virtual TQString filterOptions ();
virtual bool hasLength (); virtual bool hasLength ();
virtual bool isSeekable (); virtual bool isSeekable ();
virtual bool scan (const QString & device, const QString & driver); virtual bool scan (const TQString & device, const TQString & driver);
public slots: public slots:
virtual void activate (); virtual void activate ();
virtual void deactivate (); virtual void deactivate ();
@ -165,10 +168,10 @@ private:
KMPlayerTVSource * m_tvsource; KMPlayerTVSource * m_tvsource;
TVDevice * m_tvdevice; TVDevice * m_tvdevice;
KMPlayer::Source * m_old_source; KMPlayer::Source * m_old_source;
QString m_driver; TQString m_driver;
QRegExp m_nameRegExp; TQRegExp m_nameRegExp;
QRegExp m_sizesRegExp; TQRegExp m_sizesRegExp;
QRegExp m_inputRegExp; TQRegExp m_inputRegExp;
}; };
/* /*
@ -176,20 +179,21 @@ private:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerTVSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage { class KMPLAYER_NO_EXPORT KMPlayerTVSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerTVSource (KMPlayerApp * app, QPopupMenu * m); KMPlayerTVSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerTVSource (); virtual ~KMPlayerTVSource ();
virtual QString filterOptions (); virtual TQString filterOptions ();
virtual bool hasLength (); virtual bool hasLength ();
virtual bool isSeekable (); virtual bool isSeekable ();
virtual KMPlayer::NodePtr root (); virtual KMPlayer::NodePtr root ();
void buildMenu (); void buildMenu ();
virtual QString prettyName (); virtual TQString prettyName ();
virtual void write (KConfig *); virtual void write (KConfig *);
virtual void read (KConfig *); virtual void read (KConfig *);
virtual void sync (bool); virtual void sync (bool);
virtual void prefLocation (QString & item, QString & icon, QString & tab); virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual QFrame * prefPage (QWidget * parent); virtual TQFrame * prefPage (TQWidget * tqparent);
void readXML (); void readXML ();
public slots: public slots:
virtual void activate (); virtual void activate ();
@ -207,8 +211,8 @@ private:
void buildArguments (); void buildArguments ();
KMPlayer::NodePtrW m_cur_tvdevice; KMPlayer::NodePtrW m_cur_tvdevice;
KMPlayer::NodePtrW m_cur_tvinput; KMPlayer::NodePtrW m_cur_tvinput;
QPopupMenu * m_channelmenu; TQPopupMenu * m_channelmenu;
QString tvdriver; TQString tvdriver;
KMPlayerPrefSourcePageTV * m_configpage; KMPlayerPrefSourcePageTV * m_configpage;
TVDeviceScannerSource * scanner; TVDeviceScannerSource * scanner;
int tree_id; int tree_id;

@ -20,25 +20,25 @@
#include <math.h> #include <math.h>
#include <unistd.h> #include <unistd.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qmap.h> #include <tqmap.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qtable.h> #include <tqtable.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qwhatsthis.h> #include <tqwhatsthis.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qmessagebox.h> #include <tqmessagebox.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qsocket.h> #include <tqsocket.h>
#include <qeventloop.h> #include <tqeventloop.h>
#include <klocale.h> #include <klocale.h>
#include <kdebug.h> #include <kdebug.h>
@ -75,39 +75,39 @@ static const char * strXVPort = "XV Port";
static const char * strXVEncoding = "XV Encoding"; static const char * strXVEncoding = "XV Encoding";
static const char * strXVScale = "XV Scale"; static const char * strXVScale = "XV Scale";
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::KMPlayerPrefSourcePageVDR (QWidget * parent, KMPlayer::PartBase * player) KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::KMPlayerPrefSourcePageVDR (TQWidget * tqparent, KMPlayer::PartBase * player)
: QFrame (parent), m_player (player) { : TQFrame (tqparent), m_player (player) {
//KURLRequester * v4ldevice; //KURLRequester * v4ldevice;
QVBoxLayout *layout = new QVBoxLayout (this, 5, 2); TQVBoxLayout *tqlayout = new TQVBoxLayout (this, 5, 2);
QGridLayout *gridlayout = new QGridLayout (1, 2); TQGridLayout *gridtqlayout = new TQGridLayout (1, 2);
xv_port = new KListView (this); xv_port = new KListView (this);
xv_port->addColumn (QString()); xv_port->addColumn (TQString());
xv_port->header()->hide (); xv_port->header()->hide ();
xv_port->setTreeStepSize (15); xv_port->setTreeStepSize (15);
//xv_port->setRootIsDecorated (true); //xv_port->setRootIsDecorated (true);
//xv_port->setSorting (-1); //xv_port->setSorting (-1);
QListViewItem * vitem = new QListViewItem (xv_port, i18n ("XVideo port")); TQListViewItem * vitem = new TQListViewItem (xv_port, i18n ("XVideo port"));
vitem->setOpen (true); vitem->setOpen (true);
QWhatsThis::add (xv_port, i18n ("Port base of the X Video extension.\nIf left to default (0), the first available port will be used. However if you have multiple XVideo instances, you might have to provide the port to use here.\nSee the output from 'xvinfo' for more information")); TQWhatsThis::add (xv_port, i18n ("Port base of the X Video extension.\nIf left to default (0), the first available port will be used. However if you have multiple XVideo instances, you might have to provide the port to use here.\nSee the output from 'xvinfo' for more information"));
QLabel * label = new QLabel (i18n ("Communication port:"), this); TQLabel * label = new TQLabel (i18n ("Communication port:"), this);
gridlayout->addWidget (label, 0, 0); gridtqlayout->addWidget (label, 0, 0);
tcp_port = new QLineEdit ("", this); tcp_port = new TQLineEdit ("", this);
QWhatsThis::add (tcp_port, i18n ("Communication port with VDR. Default is port 2001.\nIf you use another port, with the '-p' option of 'vdr', you must set it here too.")); TQWhatsThis::add (tcp_port, i18n ("Communication port with VDR. Default is port 2001.\nIf you use another port, with the '-p' option of 'vdr', you must set it here too."));
gridlayout->addWidget (tcp_port, 0, 1); gridtqlayout->addWidget (tcp_port, 0, 1);
layout->addWidget (xv_port); tqlayout->addWidget (xv_port);
layout->addLayout (gridlayout); tqlayout->addLayout (gridtqlayout);
scale = new QButtonGroup (2, Qt::Vertical, i18n ("Scale"), this); scale = new TQButtonGroup (2, Qt::Vertical, i18n ("Scale"), this);
new QRadioButton (i18n ("4:3"), scale); new TQRadioButton (i18n ("4:3"), scale);
new QRadioButton (i18n ("16:9"), scale); new TQRadioButton (i18n ("16:9"), scale);
QWhatsThis::add (scale, i18n ("Aspects to use when viewing VDR")); TQWhatsThis::add (scale, i18n ("Aspects to use when viewing VDR"));
scale->setButton (0); scale->setButton (0);
layout->addWidget (scale); tqlayout->addWidget (scale);
layout->addItem (new QSpacerItem (5, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); tqlayout->addItem (new TQSpacerItem (5, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
} }
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::~KMPlayerPrefSourcePageVDR () {} KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::~KMPlayerPrefSourcePageVDR () {}
KDE_NO_EXPORT void KMPlayerPrefSourcePageVDR::showEvent (QShowEvent *) { KDE_NO_EXPORT void KMPlayerPrefSourcePageVDR::showEvent (TQShowEvent *) {
XVideo * xvideo = static_cast<XVideo *>(m_player->players()["xvideo"]); XVideo * xvideo = static_cast<XVideo *>(m_player->players()["xvideo"]);
if (!xvideo->configDocument ()) if (!xvideo->configDocument ())
xvideo->getConfigData (); xvideo->getConfigData ();
@ -130,10 +130,10 @@ public:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::KMPlayerVDRSource (KMPlayerApp * app) KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::KMPlayerVDRSource (KMPlayerApp * app)
: KMPlayer::Source (QString ("VDR"), app->player (), "vdrsource"), : KMPlayer::Source (TQString ("VDR"), app->player (), "vdrsource"),
m_app (app), m_app (app),
m_configpage (0), m_configpage (0),
m_socket (new QSocket (this)), m_socket (new TQSocket (this)),
commands (0L), commands (0L),
channel_timer (0), channel_timer (0),
timeout_timer (0), timeout_timer (0),
@ -142,10 +142,10 @@ KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::KMPlayerVDRSource (KMPlayerApp * app)
m_stored_volume (0) { m_stored_volume (0) {
memset (m_actions, 0, sizeof (KAction *) * int (act_last)); memset (m_actions, 0, sizeof (KAction *) * int (act_last));
m_player->settings ()->addPage (this); m_player->settings ()->addPage (this);
connect (m_socket, SIGNAL (connectionClosed()), this, SLOT(disconnected())); connect (m_socket, TQT_SIGNAL (connectionClosed()), this, TQT_SLOT(disconnected()));
connect (m_socket, SIGNAL (connected ()), this, SLOT (connected ())); connect (m_socket, TQT_SIGNAL (connected ()), this, TQT_SLOT (connected ()));
connect (m_socket, SIGNAL (readyRead ()), this, SLOT (readyRead ())); connect (m_socket, TQT_SIGNAL (readyRead ()), this, TQT_SLOT (readyRead ()));
connect (m_socket, SIGNAL (error (int)), this, SLOT (socketError (int))); connect (m_socket, TQT_SIGNAL (error (int)), this, TQT_SLOT (socketError (int)));
} }
KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::~KMPlayerVDRSource () {} KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::~KMPlayerVDRSource () {}
@ -154,8 +154,8 @@ KDE_NO_CDTOR_EXPORT void KMPlayerVDRSource::waitForConnectionClose () {
if (timeout_timer) { if (timeout_timer) {
finish_timer = startTimer (500); finish_timer = startTimer (500);
kdDebug () << "VDR connection not yet closed" << endl; kdDebug () << "VDR connection not yet closed" << endl;
QApplication::eventLoop ()->enterLoop (); TQApplication::eventLoop ()->enterLoop ();
kdDebug () << "VDR connection:" << (m_socket->state () == QSocket::Connected) << endl; kdDebug () << "VDR connection:" << (m_socket->state () == TQSocket::Connected) << endl;
timeout_timer = 0; timeout_timer = 0;
} }
} }
@ -168,14 +168,14 @@ KDE_NO_EXPORT bool KMPlayerVDRSource::isSeekable () {
return true; return true;
} }
KDE_NO_EXPORT QString KMPlayerVDRSource::prettyName () { KDE_NO_EXPORT TQString KMPlayerVDRSource::prettyName () {
return i18n ("VDR"); return i18n ("VDR");
} }
KDE_NO_EXPORT void KMPlayerVDRSource::activate () { KDE_NO_EXPORT void KMPlayerVDRSource::activate () {
last_channel = 0; last_channel = 0;
connect (this, SIGNAL (startPlaying ()), this, SLOT (processStarted())); connect (this, TQT_SIGNAL (startPlaying ()), this, TQT_SLOT (processStarted()));
connect (this, SIGNAL (stopPlaying ()), this, SLOT (processStopped ())); connect (this, TQT_SIGNAL (stopPlaying ()), this, TQT_SLOT (processStopped ()));
KMPlayer::ControlPanel * panel = m_app->view()->controlPanel (); KMPlayer::ControlPanel * panel = m_app->view()->controlPanel ();
panel->button (KMPlayer::ControlPanel::button_red)->show (); panel->button (KMPlayer::ControlPanel::button_red)->show ();
panel->button (KMPlayer::ControlPanel::button_green)->show (); panel->button (KMPlayer::ControlPanel::button_green)->show ();
@ -183,29 +183,29 @@ KDE_NO_EXPORT void KMPlayerVDRSource::activate () {
panel->button (KMPlayer::ControlPanel::button_blue)->show (); panel->button (KMPlayer::ControlPanel::button_blue)->show ();
panel->button (KMPlayer::ControlPanel::button_pause)->hide (); panel->button (KMPlayer::ControlPanel::button_pause)->hide ();
panel->button (KMPlayer::ControlPanel::button_record)->hide (); panel->button (KMPlayer::ControlPanel::button_record)->hide ();
connect (panel->volumeBar (), SIGNAL (volumeChanged (int)), this, SLOT (volumeChanged (int))); connect (panel->volumeBar (), TQT_SIGNAL (volumeChanged (int)), this, TQT_SLOT (volumeChanged (int)));
connect (panel->button (KMPlayer::ControlPanel::button_red), SIGNAL (clicked ()), this, SLOT (keyRed ())); connect (panel->button (KMPlayer::ControlPanel::button_red), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyRed ()));
connect (panel->button (KMPlayer::ControlPanel::button_green), SIGNAL (clicked ()), this, SLOT (keyGreen ())); connect (panel->button (KMPlayer::ControlPanel::button_green), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyGreen ()));
connect (panel->button (KMPlayer::ControlPanel::button_yellow), SIGNAL (clicked ()), this, SLOT (keyYellow ())); connect (panel->button (KMPlayer::ControlPanel::button_yellow), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyYellow ()));
connect (panel->button (KMPlayer::ControlPanel::button_blue), SIGNAL (clicked ()), this, SLOT (keyBlue ())); connect (panel->button (KMPlayer::ControlPanel::button_blue), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyBlue ()));
setAspect (m_document, scale ? 16.0/9 : 1.33); setAspect (m_document, scale ? 16.0/9 : 1.33);
if (!m_url.protocol ().compare ("kmplayer")) if (!m_url.protocol ().compare ("kmplayer"))
m_request_jump = KURL::decode_string (m_url.path ()).mid (1); m_request_jump = KURL::decode_string (m_url.path ()).mid (1);
setURL (KURL (QString ("vdr://localhost:%1").arg (tcp_port))); setURL (KURL (TQString ("vdr://localhost:%1").arg (tcp_port)));
QTimer::singleShot (0, m_player, SLOT (play ())); TQTimer::singleShot (0, m_player, TQT_SLOT (play ()));
} }
KDE_NO_EXPORT void KMPlayerVDRSource::deactivate () { KDE_NO_EXPORT void KMPlayerVDRSource::deactivate () {
disconnect (m_socket, SIGNAL (error (int)), this, SLOT (socketError (int))); disconnect (m_socket, TQT_SIGNAL (error (int)), this, TQT_SLOT (socketError (int)));
if (m_player->view ()) { if (m_player->view ()) {
disconnect (this, SIGNAL(startPlaying()), this, SLOT(processStarted())); disconnect (this, TQT_SIGNAL(startPlaying()), this, TQT_SLOT(processStarted()));
disconnect (this, SIGNAL (stopPlaying()), this, SLOT(processStopped())); disconnect (this, TQT_SIGNAL (stopPlaying()), this, TQT_SLOT(processStopped()));
KMPlayer::ControlPanel * panel = m_app->view()->controlPanel (); KMPlayer::ControlPanel * panel = m_app->view()->controlPanel ();
disconnect (panel->volumeBar (), SIGNAL (volumeChanged (int)), this, SLOT (volumeChanged (int))); disconnect (panel->volumeBar (), TQT_SIGNAL (volumeChanged (int)), this, TQT_SLOT (volumeChanged (int)));
disconnect (panel->button (KMPlayer::ControlPanel::button_red), SIGNAL (clicked ()), this, SLOT (keyRed ())); disconnect (panel->button (KMPlayer::ControlPanel::button_red), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyRed ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_green), SIGNAL (clicked ()), this, SLOT (keyGreen ())); disconnect (panel->button (KMPlayer::ControlPanel::button_green), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyGreen ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_yellow), SIGNAL (clicked ()), this, SLOT (keyYellow ())); disconnect (panel->button (KMPlayer::ControlPanel::button_yellow), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyYellow ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_blue), SIGNAL (clicked ()), this, SLOT (keyBlue ())); disconnect (panel->button (KMPlayer::ControlPanel::button_blue), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyBlue ()));
} }
processStopped (); processStopped ();
m_request_jump.truncate (0); m_request_jump.truncate (0);
@ -217,9 +217,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::playCurrent () {
} }
KDE_NO_EXPORT void KMPlayerVDRSource::processStopped () { KDE_NO_EXPORT void KMPlayerVDRSource::processStopped () {
if (m_socket->state () == QSocket::Connected) { if (m_socket->state () == TQSocket::Connected) {
queueCommand (QString ("VOLU %1\n").arg (m_stored_volume).ascii ()); queueCommand (TQString ("VOLU %1\n").tqarg (m_stored_volume).ascii ());
queueCommand ("QUIT\n"); queueCommand ("TQUIT\n");
} }
} }
@ -229,7 +229,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::processStarted () {
} }
#define DEF_ACT(i,text,pix,scut,slot,name) \ #define DEF_ACT(i,text,pix,scut,slot,name) \
m_actions [i] = new KAction (text, QString (pix), KShortcut (scut), this, slot, m_app->actionCollection (), name); \ m_actions [i] = new KAction (text, TQString (pix), KShortcut (scut), this, slot, m_app->actionCollection (), name); \
m_fullscreen_actions [i] = new KAction (text, KShortcut (scut), this, slot, m_app->view ()->viewArea ()->actionCollection (), name) m_fullscreen_actions [i] = new KAction (text, KShortcut (scut), this, slot, m_app->view ()->viewArea ()->actionCollection (), name)
KDE_NO_EXPORT void KMPlayerVDRSource::connected () { KDE_NO_EXPORT void KMPlayerVDRSource::connected () {
@ -238,33 +238,33 @@ KDE_NO_EXPORT void KMPlayerVDRSource::connected () {
killTimer (channel_timer); killTimer (channel_timer);
channel_timer = startTimer (3000); channel_timer = startTimer (3000);
KAction * action = m_app->actionCollection ()->action ("vdr_connect"); KAction * action = m_app->actionCollection ()->action ("vdr_connect");
action->setIcon (QString ("connect_no")); action->setIcon (TQString ("connect_no"));
action->setText (i18n ("Dis&connect")); action->setText (i18n ("Dis&connect"));
DEF_ACT (act_up, i18n ("VDR Key Up"), "up", , SLOT (keyUp ()), "vdr_key_up"); DEF_ACT (act_up, i18n ("VDR Key Up"), "up", , TQT_SLOT (keyUp ()), "vdr_key_up");
DEF_ACT (act_down, i18n ("VDR Key Down"), "down", , SLOT (keyDown ()), "vdr_key_down"); DEF_ACT (act_down, i18n ("VDR Key Down"), "down", , TQT_SLOT (keyDown ()), "vdr_key_down");
DEF_ACT (act_back, i18n ("VDR Key Back"), "back", , SLOT (keyBack ()), "vdr_key_back"); DEF_ACT (act_back, i18n ("VDR Key Back"), "back", , TQT_SLOT (keyBack ()), "vdr_key_back");
DEF_ACT (act_ok, i18n ("VDR Key Ok"), "ok", , SLOT (keyOk ()), "vdr_key_ok"); DEF_ACT (act_ok, i18n ("VDR Key Ok"), "ok", , TQT_SLOT (keyOk ()), "vdr_key_ok");
DEF_ACT (act_setup, i18n ("VDR Key Setup"), "configure", , SLOT (keySetup ()), "vdr_key_setup"); DEF_ACT (act_setup, i18n ("VDR Key Setup"), "configure", , TQT_SLOT (keySetup ()), "vdr_key_setup");
DEF_ACT (act_channels, i18n ("VDR Key Channels"), "player_playlist", , SLOT (keyChannels ()), "vdr_key_channels"); DEF_ACT (act_channels, i18n ("VDR Key Channels"), "player_playlist", , TQT_SLOT (keyChannels ()), "vdr_key_channels");
DEF_ACT (act_menu, i18n ("VDR Key Menu"), "showmenu", , SLOT (keyMenu ()), "vdr_key_menu"); DEF_ACT (act_menu, i18n ("VDR Key Menu"), "showmenu", , TQT_SLOT (keyMenu ()), "vdr_key_menu");
DEF_ACT (act_red, i18n ("VDR Key Red"), "red", , SLOT (keyRed ()), "vdr_key_red"); DEF_ACT (act_red, i18n ("VDR Key Red"), "red", , TQT_SLOT (keyRed ()), "vdr_key_red");
DEF_ACT (act_green, i18n ("VDR Key Green"), "green", , SLOT (keyGreen ()), "vdr_key_green"); DEF_ACT (act_green, i18n ("VDR Key Green"), "green", , TQT_SLOT (keyGreen ()), "vdr_key_green");
DEF_ACT (act_yellow, i18n ("VDR Key Yellow"), "yellow", , SLOT (keyYellow ()), "vdr_key_yellow"); DEF_ACT (act_yellow, i18n ("VDR Key Yellow"), "yellow", , TQT_SLOT (keyYellow ()), "vdr_key_yellow");
DEF_ACT (act_blue, i18n ("VDR Key Blue"), "blue", , SLOT (keyBlue ()), "vdr_key_blue"); DEF_ACT (act_blue, i18n ("VDR Key Blue"), "blue", , TQT_SLOT (keyBlue ()), "vdr_key_blue");
#if KDE_IS_VERSION(3, 1, 90) #if KDE_IS_VERSION(3, 1, 90)
DEF_ACT (act_custom, "VDR Custom Command", "exec", , SLOT (customCmd ()), "vdr_key_custom"); DEF_ACT (act_custom, "VDR Custom Command", "exec", , TQT_SLOT (customCmd ()), "vdr_key_custom");
#endif #endif
m_app->initMenu (); // update menu and toolbar m_app->initMenu (); // update menu and toolbar
DEF_ACT (act_0, i18n ("VDR Key 0"), "0", Qt::Key_0, SLOT (key0 ()), "vdr_key_0"); DEF_ACT (act_0, i18n ("VDR Key 0"), "0", TQt::Key_0, TQT_SLOT (key0 ()), "vdr_key_0");
DEF_ACT (act_1, i18n ("VDR Key 1"), "1", Qt::Key_1, SLOT (key1 ()), "vdr_key_1"); DEF_ACT (act_1, i18n ("VDR Key 1"), "1", TQt::Key_1, TQT_SLOT (key1 ()), "vdr_key_1");
DEF_ACT (act_2, i18n ("VDR Key 2"), "2", Qt::Key_2, SLOT (key2 ()), "vdr_key_2"); DEF_ACT (act_2, i18n ("VDR Key 2"), "2", TQt::Key_2, TQT_SLOT (key2 ()), "vdr_key_2");
DEF_ACT (act_3, i18n ("VDR Key 3"), "3", Qt::Key_3, SLOT (key3 ()), "vdr_key_3"); DEF_ACT (act_3, i18n ("VDR Key 3"), "3", TQt::Key_3, TQT_SLOT (key3 ()), "vdr_key_3");
DEF_ACT (act_4, i18n ("VDR Key 4"), "4", Qt::Key_4, SLOT (key4 ()), "vdr_key_4"); DEF_ACT (act_4, i18n ("VDR Key 4"), "4", TQt::Key_4, TQT_SLOT (key4 ()), "vdr_key_4");
DEF_ACT (act_5, i18n ("VDR Key 5"), "5", Qt::Key_5, SLOT (key5 ()), "vdr_key_5"); DEF_ACT (act_5, i18n ("VDR Key 5"), "5", TQt::Key_5, TQT_SLOT (key5 ()), "vdr_key_5");
DEF_ACT (act_6, i18n ("VDR Key 6"), "6", Qt::Key_6, SLOT (key6 ()), "vdr_key_6"); DEF_ACT (act_6, i18n ("VDR Key 6"), "6", TQt::Key_6, TQT_SLOT (key6 ()), "vdr_key_6");
DEF_ACT (act_7, i18n ("VDR Key 7"), "7", Qt::Key_7, SLOT (key7 ()), "vdr_key_7"); DEF_ACT (act_7, i18n ("VDR Key 7"), "7", TQt::Key_7, TQT_SLOT (key7 ()), "vdr_key_7");
DEF_ACT (act_8, i18n ("VDR Key 8"), "8", Qt::Key_8, SLOT (key8 ()), "vdr_key_8"); DEF_ACT (act_8, i18n ("VDR Key 8"), "8", TQt::Key_8, TQT_SLOT (key8 ()), "vdr_key_8");
DEF_ACT (act_9, i18n ("VDR Key 9"), "9", Qt::Key_9, SLOT (key9 ()), "vdr_key_9"); DEF_ACT (act_9, i18n ("VDR Key 9"), "9", TQt::Key_9, TQT_SLOT (key9 ()), "vdr_key_9");
//KMPlayer::ViewLayer * layer = m_app->view ()->viewArea (); //KMPlayer::ViewLayer * layer = m_app->view ()->viewArea ();
for (int i = 0; i < int (act_last); ++i) for (int i = 0; i < int (act_last); ++i)
// somehow, the configured shortcuts only show up after createGUI() call // somehow, the configured shortcuts only show up after createGUI() call
@ -280,12 +280,12 @@ KDE_NO_EXPORT void KMPlayerVDRSource::disconnected () {
deleteCommands (); deleteCommands ();
return; return;
} }
setURL (KURL (QString ("vdr://localhost:%1").arg (tcp_port))); setURL (KURL (TQString ("vdr://localhost:%1").arg (tcp_port)));
if (channel_timer && m_player->source () == this) if (channel_timer && m_player->source () == this)
m_player->process ()->quit (); m_player->process ()->quit ();
deleteCommands (); deleteCommands ();
KAction * action = m_app->actionCollection ()->action ("vdr_connect"); KAction * action = m_app->actionCollection ()->action ("vdr_connect");
action->setIcon (QString ("connect_established")); action->setIcon (TQString ("connect_established"));
action->setText (i18n ("&Connect")); action->setText (i18n ("&Connect"));
m_app->guiFactory ()->removeClient (m_app);// crash w/ m_actions[i]->unplugAll (); in for loop below m_app->guiFactory ()->removeClient (m_app);// crash w/ m_actions[i]->unplugAll (); in for loop below
for (int i = 0; i < int (act_last); ++i) for (int i = 0; i < int (act_last); ++i)
@ -298,8 +298,8 @@ KDE_NO_EXPORT void KMPlayerVDRSource::disconnected () {
} }
KDE_NO_EXPORT void KMPlayerVDRSource::toggleConnected () { KDE_NO_EXPORT void KMPlayerVDRSource::toggleConnected () {
if (m_socket->state () == QSocket::Connected) { if (m_socket->state () == TQSocket::Connected) {
queueCommand ("QUIT\n"); queueCommand ("TQUIT\n");
killTimer (channel_timer); killTimer (channel_timer);
channel_timer = 0; channel_timer = 0;
} else { } else {
@ -309,7 +309,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::toggleConnected () {
} }
KDE_NO_EXPORT void KMPlayerVDRSource::volumeChanged (int val) { KDE_NO_EXPORT void KMPlayerVDRSource::volumeChanged (int val) {
queueCommand (QString ("VOLU %1\n").arg (int (sqrt (255 * 255 * val / 100))).ascii ()); queueCommand (TQString ("VOLU %1\n").tqarg (int (sqrt (255 * 255 * val / 100))).ascii ());
} }
static struct ReadBuf { static struct ReadBuf {
@ -329,13 +329,13 @@ static struct ReadBuf {
delete buf; delete buf;
buf = b; buf = b;
} }
KDE_NO_EXPORT QCString mid (int p) { KDE_NO_EXPORT TQCString mid (int p) {
return QCString (buf + p); return TQCString (buf + p);
} }
KDE_NO_EXPORT QCString left (int p) { KDE_NO_EXPORT TQCString left (int p) {
return QCString (buf, p); return TQCString (buf, p);
} }
KDE_NO_EXPORT QCString getReadLine (); KDE_NO_EXPORT TQCString getReadLine ();
KDE_NO_EXPORT void clear () { KDE_NO_EXPORT void clear () {
delete [] buf; delete [] buf;
buf = 0; buf = 0;
@ -343,8 +343,8 @@ static struct ReadBuf {
} }
} readbuf; } readbuf;
KDE_NO_EXPORT QCString ReadBuf::getReadLine () { KDE_NO_EXPORT TQCString ReadBuf::getReadLine () {
QCString out; TQCString out;
if (!length) if (!length)
return out; return out;
int p = strcspn (buf, "\r\n"); int p = strcspn (buf, "\r\n");
@ -365,7 +365,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
m_socket->readBlock (data, nr); m_socket->readBlock (data, nr);
data [nr] = 0; data [nr] = 0;
readbuf += data; readbuf += data;
QCString line = readbuf.getReadLine (); TQCString line = readbuf.getReadLine ();
if (commands) { if (commands) {
bool cmd_done = false; bool cmd_done = false;
while (!line.isEmpty ()) { while (!line.isEmpty ()) {
@ -373,14 +373,14 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
cmd_done = (line.length () > 3 && line[3] == ' '); // from svdrpsend.pl cmd_done = (line.length () > 3 && line[3] == ' '); // from svdrpsend.pl
// kdDebug () << "readyRead " << cmd_done << " " << commands->command << endl; // kdDebug () << "readyRead " << cmd_done << " " << commands->command << endl;
if (!strcmp (commands->command, cmd_list_channels) && m_document) { if (!strcmp (commands->command, cmd_list_channels) && m_document) {
int p = line.find (';'); int p = line.tqfind (';');
int q = line.find (':'); int q = line.tqfind (':');
if (q > 0 && (p < 0 || q < p)) if (q > 0 && (p < 0 || q < p))
p = q; p = q;
if (p > 0) if (p > 0)
line.truncate (p); line.truncate (p);
QString channel_name = line.mid (4); TQString channel_name = line.mid (4);
m_document->appendChild (new KMPlayer::GenericMrl (m_document, QString ("kmplayer://vdrsource/%1").arg(channel_name), channel_name)); m_document->appendChild (new KMPlayer::GenericMrl (m_document, TQString ("kmplayer://vdrsource/%1").tqarg(channel_name), channel_name));
if (cmd_done) { if (cmd_done) {
m_player->updateTree (); m_player->updateTree ();
if (!m_request_jump.isEmpty ()) { if (!m_request_jump.isEmpty ()) {
@ -391,9 +391,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
toconsole = false; toconsole = false;
} else if (!strcmp (commands->command, cmd_chan_query)) { } else if (!strcmp (commands->command, cmd_chan_query)) {
if (v && line.length () > 4) { if (v && line.length () > 4) {
QString ch = line.mid (4); TQString ch = line.mid (4);
setTitle (ch); setTitle (ch);
KMPlayer::PlayListItem * lvi = static_cast <KMPlayer::PlayListItem *> (v->playList ()->findItem (ch, 0)); KMPlayer::PlayListItem * lvi = static_cast <KMPlayer::PlayListItem *> (v->playList ()->tqfindItem (ch, 0));
if (lvi && lvi->node != m_last_channel) { if (lvi && lvi->node != m_last_channel) {
KMPlayer::PlayListItem * si = static_cast <KMPlayer::PlayListItem *> (v->playList ()->selectedItem ()); KMPlayer::PlayListItem * si = static_cast <KMPlayer::PlayListItem *> (v->playList ()->selectedItem ());
bool jump_selection = (si && (si->node == m_document || si->node == m_last_channel)); bool jump_selection = (si && (si->node == m_document || si->node == m_last_channel));
@ -412,14 +412,14 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
int c = strtol(ch.ascii(), 0L, 10); int c = strtol(ch.ascii(), 0L, 10);
if (c != last_channel) { if (c != last_channel) {
last_channel = c; last_channel = c;
m_app->statusBar ()->changeItem (QString::number (c), m_app->statusBar ()->changeItem (TQString::number (c),
id_status_timer); id_status_timer);
} }
} }
} else if (cmd_done && !strcmp(commands->command,cmd_volume_query)){ } else if (cmd_done && !strcmp(commands->command,cmd_volume_query)){
int pos = line.findRev (QChar (' ')); int pos = line.tqfindRev (TQChar (' '));
if (pos > 0) { if (pos > 0) {
QString vol = line.mid (pos + 1); TQString vol = line.mid (pos + 1);
if (!vol.compare ("mute")) if (!vol.compare ("mute"))
m_stored_volume = 0; m_stored_volume = 0;
else else
@ -429,7 +429,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
} }
} }
if (v && toconsole) if (v && toconsole)
v->addText (QString (line), true); v->addText (TQString (line), true);
line = readbuf.getReadLine (); line = readbuf.getReadLine ();
} }
if (cmd_done) { if (cmd_done) {
@ -448,9 +448,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
} }
KDE_NO_EXPORT void KMPlayerVDRSource::socketError (int code) { KDE_NO_EXPORT void KMPlayerVDRSource::socketError (int code) {
if (code == QSocket::ErrHostNotFound) { if (code == TQSocket::ErrHostNotFound) {
KMessageBox::error (m_configpage, i18n ("Host not found"), i18n ("Error")); KMessageBox::error (m_configpage, i18n ("Host not found"), i18n ("Error"));
} else if (code == QSocket::ErrConnectionRefused) { } else if (code == TQSocket::ErrConnectionRefused) {
KMessageBox::error (m_configpage, i18n ("Connection refused"), i18n ("Error")); KMessageBox::error (m_configpage, i18n ("Connection refused"), i18n ("Error"));
} }
} }
@ -461,7 +461,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::queueCommand (const char * cmd) {
if (!commands) { if (!commands) {
readbuf.clear (); readbuf.clear ();
commands = new VDRCommand (cmd); commands = new VDRCommand (cmd);
if (m_socket->state () == QSocket::Connected) { if (m_socket->state () == TQSocket::Connected) {
sendCommand (); sendCommand ();
} else { } else {
m_socket->connectToHost ("127.0.0.1", tcp_port); m_socket->connectToHost ("127.0.0.1", tcp_port);
@ -493,13 +493,13 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sendCommand () {
KDE_NO_EXPORT void KMPlayerVDRSource::customCmd () { KDE_NO_EXPORT void KMPlayerVDRSource::customCmd () {
#if KDE_IS_VERSION(3, 1, 90) #if KDE_IS_VERSION(3, 1, 90)
QString cmd = KInputDialog::getText (i18n ("Custom VDR command"), i18n ("You can pass commands to VDR.\nEnter 'HELP' to see a list of available commands.\nYou can see VDR response in the console window.\n\nVDR Command:"), QString(), 0, m_player->view ()); TQString cmd = KInputDialog::getText (i18n ("Custom VDR command"), i18n ("You can pass commands to VDR.\nEnter 'HELP' to see a list of available commands.\nYou can see VDR response in the console window.\n\nVDR Command:"), TQString(), 0, m_player->view ());
if (!cmd.isEmpty ()) if (!cmd.isEmpty ())
queueCommand (QString (cmd + QChar ('\n')).local8Bit ()); queueCommand (TQString (cmd + TQChar ('\n')).local8Bit ());
#endif #endif
} }
KDE_NO_EXPORT void KMPlayerVDRSource::timerEvent (QTimerEvent * e) { KDE_NO_EXPORT void KMPlayerVDRSource::timerEvent (TQTimerEvent * e) {
if (e->timerId () == timeout_timer || e->timerId () == finish_timer) { if (e->timerId () == timeout_timer || e->timerId () == finish_timer) {
deleteCommands (); deleteCommands ();
} else if (e->timerId () == channel_timer) { } else if (e->timerId () == channel_timer) {
@ -521,7 +521,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::deleteCommands () {
readbuf.clear (); readbuf.clear ();
if (finish_timer) { if (finish_timer) {
killTimer (finish_timer); killTimer (finish_timer);
QApplication::eventLoop ()->exitLoop (); TQApplication::eventLoop ()->exitLoop ();
} }
} }
@ -531,10 +531,10 @@ KDE_NO_EXPORT void KMPlayerVDRSource::jump (KMPlayer::NodePtr e) {
jump (e->mrl ()->pretty_name); jump (e->mrl ()->pretty_name);
} }
KDE_NO_EXPORT void KMPlayerVDRSource::jump (const QString & channel) { KDE_NO_EXPORT void KMPlayerVDRSource::jump (const TQString & channel) {
QCString c ("CHAN "); TQCString c ("CHAN ");
QCString ch = channel.local8Bit (); TQCString ch = channel.local8Bit ();
int p = ch.find (' '); int p = ch.tqfind (' ');
if (p > 0) if (p > 0)
c += ch.left (p); c += ch.left (p);
else else
@ -651,9 +651,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::read (KConfig * m_config) {
scale = m_config->readNumEntry (strXVScale, 0); scale = m_config->readNumEntry (strXVScale, 0);
} }
struct XVTreeItem : public QListViewItem { struct XVTreeItem : public TQListViewItem {
XVTreeItem (QListViewItem *parent, const QString & t, int p, int e) XVTreeItem (TQListViewItem *tqparent, const TQString & t, int p, int e)
: QListViewItem (parent, t), port (p), encoding (e) {} : TQListViewItem (tqparent, t), port (p), encoding (e) {}
int port; int port;
int encoding; int encoding;
}; };
@ -670,12 +670,12 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
m_xvencoding = vitem->encoding; m_xvencoding = vitem->encoding;
} }
} else { } else {
m_configpage->tcp_port->setText (QString::number (tcp_port)); m_configpage->tcp_port->setText (TQString::number (tcp_port));
m_configpage->scale->setButton (scale); m_configpage->scale->setButton (scale);
QListViewItem * vitem = m_configpage->xv_port->firstChild (); TQListViewItem * vitem = m_configpage->xv_port->firstChild ();
NodePtr configdoc = xvideo->configDocument (); NodePtr configdoc = xvideo->configDocument ();
if (configdoc && configdoc->firstChild ()) { if (configdoc && configdoc->firstChild ()) {
for (QListViewItem *i=vitem->firstChild(); i; i=vitem->firstChild()) for (TQListViewItem *i=vitem->firstChild(); i; i=vitem->firstChild())
delete i; delete i;
NodePtr node = configdoc->firstChild (); NodePtr node = configdoc->firstChild ();
for (node = node->firstChild (); node; node = node->nextSibling()) { for (node = node->firstChild (); node; node = node->nextSibling()) {
@ -683,27 +683,27 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
continue; // some text sneaked in ? continue; // some text sneaked in ?
Element * elm = convertNode <Element> (node); Element * elm = convertNode <Element> (node);
if (elm->getAttribute (KMPlayer::StringPool::attr_type) != if (elm->getAttribute (KMPlayer::StringPool::attr_type) !=
QString ("tree")) TQString ("tree"))
continue; continue;
for (NodePtr n = elm->firstChild (); n; n = n->nextSibling ()) { for (NodePtr n = elm->firstChild (); n; n = n->nextSibling ()) {
if (!n->isElementNode () || strcmp (n->nodeName (), "Port")) if (!n->isElementNode () || strcmp (n->nodeName (), "Port"))
continue; continue;
Element * e = convertNode <Element> (n); Element * e = convertNode <Element> (n);
QString portatt = e->getAttribute ( TQString portatt = e->getAttribute (
KMPlayer::StringPool::attr_value); KMPlayer::StringPool::attr_value);
int port; int port;
QListViewItem *pi = new QListViewItem (vitem, i18n ("Port ") + portatt); TQListViewItem *pi = new TQListViewItem (vitem, i18n ("Port ") + portatt);
port = portatt.toInt (); port = portatt.toInt ();
for (NodePtr in=e->firstChild(); in; in=in->nextSibling()) { for (NodePtr in=e->firstChild(); in; in=in->nextSibling()) {
if (!in->isElementNode () || if (!in->isElementNode () ||
strcmp (in->nodeName (), "Input")) strcmp (in->nodeName (), "Input"))
continue; continue;
Element * i = convertNode <Element> (in); Element * i = convertNode <Element> (in);
QString inp = i->getAttribute ( TQString inp = i->getAttribute (
KMPlayer::StringPool::attr_name); KMPlayer::StringPool::attr_name);
int enc = i->getAttribute ( int enc = i->getAttribute (
KMPlayer::StringPool::attr_value).toInt (); KMPlayer::StringPool::attr_value).toInt ();
QListViewItem * ii = new XVTreeItem(pi, inp, port, enc); TQListViewItem * ii = new XVTreeItem(pi, inp, port, enc);
if (m_xvport == port && enc == m_xvencoding) { if (m_xvport == port && enc == m_xvencoding) {
ii->setSelected (true); ii->setSelected (true);
m_configpage->xv_port->ensureItemVisible (ii); m_configpage->xv_port->ensureItemVisible (ii);
@ -712,25 +712,25 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
} }
} }
} else // wait for showEvent } else // wait for showEvent
connect (xvideo, SIGNAL (configReceived()), this, SLOT (configReceived())); connect (xvideo, TQT_SIGNAL (configReceived()), this, TQT_SLOT (configReceived()));
} }
} }
KDE_NO_EXPORT void KMPlayerVDRSource::configReceived () { KDE_NO_EXPORT void KMPlayerVDRSource::configReceived () {
XVideo * xvideo = static_cast<XVideo *>(m_player->players()["xvideo"]); XVideo * xvideo = static_cast<XVideo *>(m_player->players()["xvideo"]);
disconnect (xvideo, SIGNAL (configReceived()), this, SLOT (configReceived())); disconnect (xvideo, TQT_SIGNAL (configReceived()), this, TQT_SLOT (configReceived()));
sync (false); sync (false);
} }
KDE_NO_EXPORT void KMPlayerVDRSource::prefLocation (QString & item, QString & icon, QString & tab) { KDE_NO_EXPORT void KMPlayerVDRSource::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Source"); item = i18n ("Source");
icon = QString ("source"); icon = TQString ("source");
tab = i18n ("VDR"); tab = i18n ("VDR");
} }
KDE_NO_EXPORT QFrame * KMPlayerVDRSource::prefPage (QWidget * parent) { KDE_NO_EXPORT TQFrame * KMPlayerVDRSource::prefPage (TQWidget * tqparent) {
if (!m_configpage) if (!m_configpage)
m_configpage = new KMPlayerPrefSourcePageVDR (parent, m_player); m_configpage = new KMPlayerPrefSourcePageVDR (tqparent, m_player);
return m_configpage; return m_configpage;
} }
@ -747,8 +747,8 @@ static const char * xv_supported [] = {
"tvsource", "vdrsource", 0L "tvsource", "vdrsource", 0L
}; };
KDE_NO_CDTOR_EXPORT XVideo::XVideo (QObject * parent, Settings * settings) KDE_NO_CDTOR_EXPORT XVideo::XVideo (TQObject * tqparent, Settings * settings)
: KMPlayer::CallbackProcess (parent, settings, "xvideo", i18n ("X&Video")) { : KMPlayer::CallbackProcess (tqparent, settings, "xvideo", i18n ("X&Video")) {
m_supported_sources = xv_supported; m_supported_sources = xv_supported;
//m_player->settings ()->addPage (m_configpage); //m_player->settings ()->addPage (m_configpage);
} }
@ -760,16 +760,16 @@ KDE_NO_EXPORT bool XVideo::ready (KMPlayer::Viewer * v) {
return true; return true;
} }
initProcess (v); initProcess (v);
QString cmd = QString ("kxvplayer -wid %3 -cb %4").arg (viewer ()->embeddedWinId ()).arg (dcopName ()); TQString cmd = TQString ("kxvplayer -wid %3 -cb %4").arg (viewer ()->embeddedWinId ()).arg (dcopName ());
if (m_have_config == config_unknown || m_have_config == config_probe) if (m_have_config == config_unknown || m_have_config == config_probe)
cmd += QString (" -c"); cmd += TQString (" -c");
if (m_source) { if (m_source) {
int xv_port = m_source->xvPort (); int xv_port = m_source->xvPort ();
int xv_encoding = m_source->xvEncoding (); int xv_encoding = m_source->xvEncoding ();
int freq = m_source->frequency (); int freq = m_source->frequency ();
cmd += QString (" -port %1 -enc %2 -norm \"%3\"").arg (xv_port).arg (xv_encoding).arg (m_source->videoNorm ()); cmd += TQString (" -port %1 -enc %2 -norm \"%3\"").arg (xv_port).arg (xv_encoding).arg (m_source->videoNorm ());
if (freq > 0) if (freq > 0)
cmd += QString (" -freq %1").arg (freq); cmd += TQString (" -freq %1").arg (freq);
} }
fprintf (stderr, "%s\n", cmd.latin1 ()); fprintf (stderr, "%s\n", cmd.latin1 ());
*m_process << cmd; *m_process << cmd;

@ -24,7 +24,7 @@
#include <config.h> #include <config.h>
#endif #endif
#include <qframe.h> #include <tqframe.h>
#include <kurl.h> #include <kurl.h>
@ -36,29 +36,30 @@
class KMPlayerApp; class KMPlayerApp;
class VDRCommand; class VDRCommand;
class KURLRequester; class KURLRequester;
class QButtonGroup; class TQButtonGroup;
class QMenuItem; class TQMenuItem;
class QCheckBox; class TQCheckBox;
class QLineEdit; class TQLineEdit;
class KAction; class KAction;
class QSocket; class TQSocket;
class QTimerEvent; class TQTimerEvent;
class KListView; class KListView;
/* /*
* Preference page for VDR * Preference page for VDR
*/ */
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageVDR : public QFrame { class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageVDR : public TQFrame {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerPrefSourcePageVDR (QWidget * parent, KMPlayer::PartBase * player); KMPlayerPrefSourcePageVDR (TQWidget * tqparent, KMPlayer::PartBase * player);
~KMPlayerPrefSourcePageVDR (); ~KMPlayerPrefSourcePageVDR ();
KURLRequester * vcddevice; KURLRequester * vcddevice;
KListView * xv_port; KListView * xv_port;
QLineEdit * tcp_port; TQLineEdit * tcp_port;
QButtonGroup * scale; TQButtonGroup * scale;
protected: protected:
void showEvent (QShowEvent *); void showEvent (TQShowEvent *);
private: private:
KMPlayer::PartBase * m_player; KMPlayer::PartBase * m_player;
}; };
@ -69,17 +70,18 @@ private:
*/ */
class KMPLAYER_NO_EXPORT KMPlayerVDRSource : public KMPlayer::Source, public KMPlayer::PreferencesPage { class KMPLAYER_NO_EXPORT KMPlayerVDRSource : public KMPlayer::Source, public KMPlayer::PreferencesPage {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMPlayerVDRSource (KMPlayerApp * app); KMPlayerVDRSource (KMPlayerApp * app);
virtual ~KMPlayerVDRSource (); virtual ~KMPlayerVDRSource ();
virtual bool hasLength (); virtual bool hasLength ();
virtual bool isSeekable (); virtual bool isSeekable ();
virtual QString prettyName (); virtual TQString prettyName ();
virtual void write (KConfig *); virtual void write (KConfig *);
virtual void read (KConfig *); virtual void read (KConfig *);
virtual void sync (bool); virtual void sync (bool);
virtual void prefLocation (QString & item, QString & icon, QString & tab); virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual QFrame * prefPage (QWidget * parent); virtual TQFrame * prefPage (TQWidget * tqparent);
virtual bool requestPlayURL (KMPlayer::NodePtr mrl); virtual bool requestPlayURL (KMPlayer::NodePtr mrl);
virtual void stateElementChanged (KMPlayer::Node * node, KMPlayer::Node::State os, KMPlayer::Node::State ns); virtual void stateElementChanged (KMPlayer::Node * node, KMPlayer::Node::State os, KMPlayer::Node::State ns);
void waitForConnectionClose (); void waitForConnectionClose ();
@ -123,7 +125,7 @@ private slots:
void processStarted (); void processStarted ();
void configReceived (); void configReceived ();
protected: protected:
void timerEvent (QTimerEvent *); void timerEvent (TQTimerEvent *);
private: private:
enum { enum {
act_up = 0, act_down, act_back, act_ok, act_up = 0, act_down, act_back, act_ok,
@ -139,14 +141,14 @@ private:
void queueCommand (const char * cmd, int repeat_ms); void queueCommand (const char * cmd, int repeat_ms);
void sendCommand (); void sendCommand ();
void deleteCommands (); void deleteCommands ();
void jump (const QString & channel); void jump (const TQString & channel);
KMPlayerApp * m_app; KMPlayerApp * m_app;
KMPlayerPrefSourcePageVDR * m_configpage; KMPlayerPrefSourcePageVDR * m_configpage;
KAction * m_actions [act_last]; KAction * m_actions [act_last];
KAction * m_fullscreen_actions [act_last]; KAction * m_fullscreen_actions [act_last];
QSocket * m_socket; TQSocket * m_socket;
VDRCommand * commands; VDRCommand * commands;
QString m_request_jump; TQString m_request_jump;
KMPlayer::NodePtrW m_last_channel; KMPlayer::NodePtrW m_last_channel;
int channel_timer; int channel_timer;
int timeout_timer; int timeout_timer;
@ -159,8 +161,9 @@ private:
class XVideo : public KMPlayer::CallbackProcess { class XVideo : public KMPlayer::CallbackProcess {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
XVideo (QObject * parent, KMPlayer::Settings * settings); XVideo (TQObject * tqparent, KMPlayer::Settings * settings);
~XVideo (); ~XVideo ();
public slots: public slots:
virtual bool ready (KMPlayer::Viewer *); virtual bool ready (KMPlayer::Viewer *);

@ -20,25 +20,25 @@
#include <math.h> #include <math.h>
#include <config.h> #include <config.h>
// include files for Qt // include files for TQt
#include <qstyle.h> #include <tqstyle.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qmetaobject.h> #include <tqmetaobject.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qtextedit.h> #include <tqtextedit.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qiconset.h> #include <tqiconset.h>
#include <qcursor.h> #include <tqcursor.h>
#include <qkeysequence.h> #include <tqkeysequence.h>
#include <qslider.h> #include <tqslider.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qdatastream.h> #include <tqdatastream.h>
#include <qwidgetstack.h> #include <tqwidgetstack.h>
#include <qcursor.h> #include <tqcursor.h>
#include <qclipboard.h> #include <tqclipboard.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kstatusbar.h> #include <kstatusbar.h>
@ -68,7 +68,7 @@ static const int XKeyPress = KeyPress;
#undef KeyPress #undef KeyPress
#undef Always #undef Always
#undef Never #undef Never
#undef Status #undef tqStatus
#undef Unsorted #undef Unsorted
#undef Bool #undef Bool
@ -85,49 +85,49 @@ using namespace KMPlayer;
namespace KMPlayer { namespace KMPlayer {
class KMPlayerPictureWidget : public QWidget { class KMPlayerPictureWidget : public TQWidget {
View * m_view; View * m_view;
public: public:
KDE_NO_CDTOR_EXPORT KMPlayerPictureWidget (QWidget * parent, View * view) KDE_NO_CDTOR_EXPORT KMPlayerPictureWidget (TQWidget * tqparent, View * view)
: QWidget (parent), m_view (view) {} : TQWidget (tqparent), m_view (view) {}
KDE_NO_CDTOR_EXPORT ~KMPlayerPictureWidget () {} KDE_NO_CDTOR_EXPORT ~KMPlayerPictureWidget () {}
protected: protected:
void mousePressEvent (QMouseEvent *); void mousePressEvent (TQMouseEvent *);
}; };
} // namespace } // namespace
KDE_NO_EXPORT void KMPlayerPictureWidget::mousePressEvent (QMouseEvent *) { KDE_NO_EXPORT void KMPlayerPictureWidget::mousePressEvent (TQMouseEvent *) {
m_view->emitPictureClicked (); m_view->emitPictureClicked ();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TextEdit::TextEdit (QWidget * parent, View * view) : QTextEdit (parent, "kde_kmplayer_console"), m_view (view) { KDE_NO_CDTOR_EXPORT TextEdit::TextEdit (TQWidget * tqparent, View * view) : TQTextEdit (tqparent, "kde_kmplayer_console"), m_view (view) {
setReadOnly (true); setReadOnly (true);
setPaper (QBrush (QColor (0, 0, 0))); setPaper (TQBrush (TQColor (0, 0, 0)));
setColor (QColor (0xB2, 0xB2, 0xB2)); setColor (TQColor (0xB2, 0xB2, 0xB2));
} }
KDE_NO_EXPORT void TextEdit::contextMenuEvent (QContextMenuEvent * e) { KDE_NO_EXPORT void TextEdit::contextMenuEvent (TQContextMenuEvent * e) {
m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ()); m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT InfoWindow::InfoWindow (QWidget * parent, View * view) : QTextEdit (parent, "kde_kmplayer_console"), m_view (view) { KDE_NO_CDTOR_EXPORT InfoWindow::InfoWindow (TQWidget * tqparent, View * view) : TQTextEdit (tqparent, "kde_kmplayer_console"), m_view (view) {
setReadOnly (true); setReadOnly (true);
setLinkUnderline (false); setLinkUnderline (false);
} }
KDE_NO_EXPORT void InfoWindow::contextMenuEvent (QContextMenuEvent * e) { KDE_NO_EXPORT void InfoWindow::contextMenuEvent (TQContextMenuEvent * e) {
m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ()); m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT View::View (QWidget *parent, const char *name) KDE_NO_CDTOR_EXPORT View::View (TQWidget *tqparent, const char *name)
: KMediaPlayer::View (parent, name), : KMediaPlayer::View (tqparent, name),
m_image (0L), m_image (0L),
m_control_panel (0L), m_control_panel (0L),
m_status_bar (0L), m_status_bar (0L),
@ -148,13 +148,13 @@ KDE_NO_CDTOR_EXPORT View::View (QWidget *parent, const char *name)
m_edit_mode (false) m_edit_mode (false)
{} {}
KDE_NO_EXPORT void View::dropEvent (QDropEvent * de) { KDE_NO_EXPORT void View::dropEvent (TQDropEvent * de) {
KURL::List sl; KURL::List sl;
if (KURLDrag::canDecode (de)) { if (KURLDrag::canDecode (de)) {
KURLDrag::decode (de, sl); KURLDrag::decode (de, sl);
} else if (QTextDrag::canDecode (de)) { } else if (TQTextDrag::canDecode (de)) {
QString text; TQString text;
QTextDrag::decode (de, text); TQTextDrag::decode (de, text);
sl.push_back (KURL (text)); sl.push_back (KURL (text));
} }
if (sl.size () > 0) { if (sl.size () > 0) {
@ -166,34 +166,34 @@ KDE_NO_EXPORT void View::dropEvent (QDropEvent * de) {
} }
} }
KDE_NO_EXPORT void View::dragEnterEvent (QDragEnterEvent* dee) { KDE_NO_EXPORT void View::dragEnterEvent (TQDragEnterEvent* dee) {
if (isDragValid (dee)) if (isDragValid (dee))
dee->accept (); dee->accept ();
} }
KDE_NO_EXPORT void View::init (KActionCollection * action_collection) { KDE_NO_EXPORT void View::init (KActionCollection * action_collection) {
setBackgroundMode(Qt::NoBackground); // prevents flashing setBackgroundMode(TQt::NoBackground); // prevents flashing
//m_dockarea->setEraseColor (QColor (0, 0, 0)); //m_dockarea->setEraseColor (TQColor (0, 0, 0));
QPalette pal (QColor (64, 64,64), QColor (32, 32, 32)); TQPalette pal (TQColor (64, 64,64), TQColor (32, 32, 32));
QVBoxLayout * viewbox = new QVBoxLayout (this, 0, 0); TQVBoxLayout * viewbox = new TQVBoxLayout (this, 0, 0);
m_dockarea = new KDockArea (this, "kde_kmplayer_dock_area"); m_dockarea = new KDockArea (this, "kde_kmplayer_dock_area");
m_dock_video = new KDockWidget (m_dockarea->manager (), 0, KGlobal::iconLoader ()->loadIcon (QString ("kmplayer"), KIcon::Small), m_dockarea); m_dock_video = new KDockWidget (m_dockarea->manager (), 0, KGlobal::iconLoader ()->loadIcon (TQString ("kmplayer"), KIcon::Small), m_dockarea);
m_dock_video->setEraseColor (QColor (0, 0, 255)); m_dock_video->setEraseColor (TQColor (0, 0, 255));
m_dock_video->setDockSite (KDockWidget::DockLeft | KDockWidget::DockBottom | KDockWidget::DockRight | KDockWidget::DockTop); m_dock_video->setDockSite (KDockWidget::DockLeft | KDockWidget::DockBottom | KDockWidget::DockRight | KDockWidget::DockTop);
m_dock_video->setEnableDocking(KDockWidget::DockNone); m_dock_video->setEnableDocking(KDockWidget::DockNone);
m_view_area = new ViewArea (m_dock_video, this); m_view_area = new ViewArea (m_dock_video, this);
m_dock_video->setWidget (m_view_area); m_dock_video->setWidget (m_view_area);
m_dockarea->setMainDockWidget (m_dock_video); m_dockarea->setMainDockWidget (m_dock_video);
m_dock_playlist = m_dockarea->createDockWidget (i18n ("Play List"), KGlobal::iconLoader ()->loadIcon (QString ("player_playlist"), KIcon::Small)); m_dock_playlist = m_dockarea->createDockWidget (i18n ("Play List"), KGlobal::iconLoader ()->loadIcon (TQString ("player_playlist"), KIcon::Small));
m_playlist = new PlayListView (m_dock_playlist, this, action_collection); m_playlist = new PlayListView (m_dock_playlist, this, action_collection);
m_dock_playlist->setWidget (m_playlist); m_dock_playlist->setWidget (m_playlist);
viewbox->addWidget (m_dockarea); viewbox->addWidget (m_dockarea);
m_widgetstack = new QWidgetStack (m_view_area); m_widgetstack = new TQWidgetStack (m_view_area);
m_control_panel = new ControlPanel (m_view_area, this); m_control_panel = new ControlPanel (m_view_area, this);
m_control_panel->setMaximumSize (2500, controlPanel ()->maximumSize ().height ()); m_control_panel->setMaximumSize (2500, controlPanel ()->tqmaximumSize ().height ());
m_status_bar = new StatusBar (m_view_area); m_status_bar = new StatusBar (m_view_area);
m_status_bar->insertItem (QString (""), 0); m_status_bar->insertItem (TQString (""), 0);
QSize sbsize = m_status_bar->sizeHint (); TQSize sbsize = m_status_bar->tqsizeHint ();
m_status_bar->hide (); m_status_bar->hide ();
m_status_bar->setMaximumSize (2500, sbsize.height ()); m_status_bar->setMaximumSize (2500, sbsize.height ());
m_viewer = new Viewer (m_widgetstack, this); m_viewer = new Viewer (m_widgetstack, this);
@ -203,14 +203,14 @@ KDE_NO_EXPORT void View::init (KActionCollection * action_collection) {
#endif #endif
m_multiedit = new TextEdit (m_widgetstack, this); m_multiedit = new TextEdit (m_widgetstack, this);
m_multiedit->setTextFormat (Qt::PlainText); m_multiedit->setTextFormat (TQt::PlainText);
QFont fnt = KGlobalSettings::fixedFont (); TQFont fnt = KGlobalSettings::fixedFont ();
m_multiedit->setFont (fnt); m_multiedit->setFont (fnt);
m_widgettypes[WT_Console] = m_multiedit; m_widgettypes[WT_Console] = m_multiedit;
m_widgettypes[WT_Picture] = new KMPlayerPictureWidget (m_widgetstack, this); m_widgettypes[WT_Picture] = new KMPlayerPictureWidget (m_widgetstack, this);
m_dock_infopanel = m_dockarea->createDockWidget ("infopanel", KGlobal::iconLoader ()->loadIcon (QString ("info"), KIcon::Small)); m_dock_infopanel = m_dockarea->createDockWidget ("infopanel", KGlobal::iconLoader ()->loadIcon (TQString ("info"), KIcon::Small));
m_infopanel = new InfoWindow (m_dock_infopanel, this); m_infopanel = new InfoWindow (m_dock_infopanel, this);
m_dock_infopanel->setWidget (m_infopanel); m_dock_infopanel->setWidget (m_infopanel);
@ -218,7 +218,7 @@ KDE_NO_EXPORT void View::init (KActionCollection * action_collection) {
m_widgetstack->addWidget (m_multiedit); m_widgetstack->addWidget (m_multiedit);
m_widgetstack->addWidget (m_widgettypes[WT_Picture]); m_widgetstack->addWidget (m_widgettypes[WT_Picture]);
setFocusPolicy (QWidget::ClickFocus); setFocusPolicy (TQ_ClickFocus);
setAcceptDrops (true); setAcceptDrops (true);
m_view_area->resizeEvent (0L); m_view_area->resizeEvent (0L);
@ -228,11 +228,11 @@ KDE_NO_EXPORT void View::init (KActionCollection * action_collection) {
KDE_NO_CDTOR_EXPORT View::~View () { KDE_NO_CDTOR_EXPORT View::~View () {
delete m_image; delete m_image;
if (m_view_area->parent () != this) if (TQT_BASE_OBJECT(m_view_area->tqparent ()) != TQT_BASE_OBJECT(this))
delete m_view_area; delete m_view_area;
} }
KDE_NO_EXPORT void View::setEraseColor (const QColor & color) { KDE_NO_EXPORT void View::setEraseColor (const TQColor & color) {
KMediaPlayer::View::setEraseColor (color); KMediaPlayer::View::setEraseColor (color);
if (statusBar ()) { if (statusBar ()) {
statusBar ()->setEraseColor (color); statusBar ()->setEraseColor (color);
@ -240,7 +240,7 @@ KDE_NO_EXPORT void View::setEraseColor (const QColor & color) {
} }
} }
void View::setInfoMessage (const QString & msg) { void View::setInfoMessage (const TQString & msg) {
bool ismain = m_dockarea->getMainDockWidget () == m_dock_infopanel; bool ismain = m_dockarea->getMainDockWidget () == m_dock_infopanel;
if (msg.isEmpty ()) { if (msg.isEmpty ()) {
if (!ismain && !m_edit_mode && !infopanel_timer) if (!ismain && !m_edit_mode && !infopanel_timer)
@ -253,7 +253,7 @@ void View::setInfoMessage (const QString & msg) {
} }
} }
void View::setStatusMessage (const QString & msg) { void View::setStatusMessage (const TQString & msg) {
if (m_statusbar_mode != SB_Hide) if (m_statusbar_mode != SB_Hide)
m_status_bar->changeItem (msg, 0); m_status_bar->changeItem (msg, 0);
} }
@ -266,11 +266,11 @@ void View::toggleShowPlaylist () {
m_dock_playlist->dockBack (); m_dock_playlist->dockBack ();
else { else {
bool horz = true; bool horz = true;
QStyle & style = m_playlist->style (); TQStyle & style = m_playlist->tqstyle ();
int h = style.pixelMetric (QStyle::PM_ScrollBarExtent, m_playlist); int h = style.tqpixelMetric (TQStyle::PM_ScrollBarExtent, m_playlist);
h += style.pixelMetric(QStyle::PM_DockWindowFrameWidth, m_playlist); h += style.tqpixelMetric(TQStyle::PM_DockWindowFrameWidth, m_playlist);
h +=style.pixelMetric(QStyle::PM_DockWindowHandleExtent,m_playlist); h +=style.tqpixelMetric(TQStyle::PM_DockWindowHandleExtent,m_playlist);
for (QListViewItem *i=m_playlist->firstChild();i;i=i->itemBelow()) { for (TQListViewItem *i=m_playlist->firstChild();i;i=i->itemBelow()) {
h += i->height (); h += i->height ();
if (h > int (0.25 * height ())) { if (h > int (0.25 * height ())) {
horz = false; horz = false;
@ -314,18 +314,18 @@ void View::setPlaylistOnly () {
void View::setEditMode (RootPlayListItem *ri, bool enable) { void View::setEditMode (RootPlayListItem *ri, bool enable) {
m_edit_mode = enable; m_edit_mode = enable;
m_infopanel->setReadOnly (!m_edit_mode); m_infopanel->setReadOnly (!m_edit_mode);
m_infopanel->setTextFormat (enable ? Qt::PlainText : Qt::AutoText); m_infopanel->setTextFormat (enable ? TQt::PlainText : TQt::AutoText);
if (m_edit_mode && m_dock_infopanel->mayBeShow ()) if (m_edit_mode && m_dock_infopanel->mayBeShow ())
m_dock_infopanel->manualDock(m_dock_video,KDockWidget::DockBottom,50); m_dock_infopanel->manualDock(m_dock_video,KDockWidget::DockBottom,50);
m_playlist->showAllNodes (ri, m_edit_mode); m_playlist->showAllNodes (ri, m_edit_mode);
} }
bool View::setPicture (const QString & path) { bool View::setPicture (const TQString & path) {
delete m_image; delete m_image;
if (path.isEmpty ()) if (path.isEmpty ())
m_image = 0L; m_image = 0L;
else { else {
m_image = new QPixmap (path); m_image = new TQPixmap (path);
if (m_image->isNull ()) { if (m_image->isNull ()) {
delete m_image; delete m_image;
m_image = 0L; m_image = 0L;
@ -345,8 +345,8 @@ bool View::setPicture (const QString & path) {
KDE_NO_EXPORT void View::updateVolume () { KDE_NO_EXPORT void View::updateVolume () {
if (m_mixer_init && !m_volume_slider) if (m_mixer_init && !m_volume_slider)
return; return;
QByteArray data, replydata; TQByteArray data, replydata;
QCString replyType; TQCString replyType;
int volume; int volume;
bool has_mixer = kapp->dcopClient ()->call (m_mixer_object, "Mixer0", bool has_mixer = kapp->dcopClient ()->call (m_mixer_object, "Mixer0",
"masterVolume()", data, replyType, replydata); "masterVolume()", data, replyType, replydata);
@ -356,13 +356,13 @@ KDE_NO_EXPORT void View::updateVolume () {
"masterVolume()", data, replyType, replydata); "masterVolume()", data, replyType, replydata);
} }
if (has_mixer) { if (has_mixer) {
QDataStream replystream (replydata, IO_ReadOnly); TQDataStream replystream (replydata, IO_ReadOnly);
replystream >> volume; replystream >> volume;
if (!m_mixer_init) { if (!m_mixer_init) {
QLabel * mixer_label = new QLabel (i18n ("Volume:"), m_control_panel->popupMenu ()); TQLabel * mixer_label = new TQLabel (i18n ("Volume:"), m_control_panel->popupMenu ());
m_control_panel->popupMenu ()->insertItem (mixer_label, -1, 4); m_control_panel->popupMenu ()->insertItem (mixer_label, -1, 4);
m_volume_slider = new QSlider (0, 100, 10, volume, Qt::Horizontal, m_control_panel->popupMenu ()); m_volume_slider = new TQSlider (0, 100, 10, volume, Qt::Horizontal, m_control_panel->popupMenu ());
connect(m_volume_slider, SIGNAL(valueChanged(int)), this,SLOT(setVolume(int))); connect(m_volume_slider, TQT_SIGNAL(valueChanged(int)), this,TQT_SLOT(setVolume(int)));
m_control_panel->popupMenu ()->insertItem (m_volume_slider, ControlPanel::menu_volume, 5); m_control_panel->popupMenu ()->insertItem (m_volume_slider, ControlPanel::menu_volume, 5);
m_control_panel->popupMenu ()->insertSeparator (6); m_control_panel->popupMenu ()->insertSeparator (6);
} else { } else {
@ -382,7 +382,7 @@ KDE_NO_EXPORT void View::updateVolume () {
void View::showWidget (WidgetType wt) { void View::showWidget (WidgetType wt) {
m_widgetstack->raiseWidget (m_widgettypes [wt]); m_widgetstack->raiseWidget (m_widgettypes [wt]);
if (m_widgetstack->visibleWidget () == m_widgettypes[WT_Console]) { if (m_widgetstack->visibleWidget () == m_widgettypes[WT_Console]) {
addText (QString (""), false); addText (TQString (""), false);
if (m_controlpanel_mode == CP_AutoHide && m_playing) if (m_controlpanel_mode == CP_AutoHide && m_playing)
m_control_panel->show(); m_control_panel->show();
} else } else
@ -394,9 +394,9 @@ void View::toggleVideoConsoleWindow () {
WidgetType wt = WT_Console; WidgetType wt = WT_Console;
if (m_widgetstack->visibleWidget () == m_widgettypes[WT_Console]) { if (m_widgetstack->visibleWidget () == m_widgettypes[WT_Console]) {
wt = WT_Video; wt = WT_Video;
m_control_panel->popupMenu ()->changeItem (ControlPanel::menu_video, KGlobal::iconLoader ()->loadIconSet (QString ("konsole"), KIcon::Small, 0, true), i18n ("Con&sole")); m_control_panel->popupMenu ()->changeItem (ControlPanel::menu_video, KGlobal::iconLoader ()->loadIconSet (TQString ("konsole"), KIcon::Small, 0, true), i18n ("Con&sole"));
} else } else
m_control_panel->popupMenu ()->changeItem (ControlPanel::menu_video, KGlobal::iconLoader ()->loadIconSet (QString ("video"), KIcon::Small, 0, true), i18n ("V&ideo")); m_control_panel->popupMenu ()->changeItem (ControlPanel::menu_video, KGlobal::iconLoader ()->loadIconSet (TQString ("video"), KIcon::Small, 0, true), i18n ("V&ideo"));
showWidget (wt); showWidget (wt);
emit windowVideoConsoleToggled (int (wt)); emit windowVideoConsoleToggled (int (wt));
} }
@ -454,8 +454,8 @@ KDE_NO_EXPORT void View::delayedShowButtons (bool show) {
KDE_NO_EXPORT void View::setVolume (int vol) { KDE_NO_EXPORT void View::setVolume (int vol) {
if (m_inVolumeUpdate) return; if (m_inVolumeUpdate) return;
QByteArray data; TQByteArray data;
QDataStream arg( data, IO_WriteOnly ); TQDataStream arg( data, IO_WriteOnly );
arg << vol; arg << vol;
if (!kapp->dcopClient()->send (m_mixer_object, "Mixer0", "setMasterVolume(int)", data)) if (!kapp->dcopClient()->send (m_mixer_object, "Mixer0", "setMasterVolume(int)", data))
kdWarning() << "Failed to update volume" << endl; kdWarning() << "Failed to update volume" << endl;
@ -475,14 +475,14 @@ void View::setKeepSizeRatio (bool b) {
} }
} }
KDE_NO_EXPORT void View::timerEvent (QTimerEvent * e) { KDE_NO_EXPORT void View::timerEvent (TQTimerEvent * e) {
if (e->timerId () == controlbar_timer) { if (e->timerId () == controlbar_timer) {
controlbar_timer = 0; controlbar_timer = 0;
if (m_playing || if (m_playing ||
m_widgetstack->visibleWidget () == m_widgettypes[WT_Picture]) { m_widgetstack->visibleWidget () == m_widgettypes[WT_Picture]) {
int vert_buttons_pos = m_view_area->height()-statusBarHeight (); int vert_buttons_pos = m_view_area->height()-statusBarHeight ();
QPoint mouse_pos = m_view_area->mapFromGlobal (QCursor::pos ()); TQPoint mouse_pos = m_view_area->mapFromGlobal (TQCursor::pos ());
int cp_height = m_control_panel->maximumSize ().height (); int cp_height = m_control_panel->tqmaximumSize ().height ();
bool mouse_on_buttons = (//m_view_area->hasMouse () && bool mouse_on_buttons = (//m_view_area->hasMouse () &&
mouse_pos.y () >= vert_buttons_pos-cp_height && mouse_pos.y () >= vert_buttons_pos-cp_height &&
mouse_pos.y ()<= vert_buttons_pos && mouse_pos.y ()<= vert_buttons_pos &&
@ -504,9 +504,9 @@ KDE_NO_EXPORT void View::timerEvent (QTimerEvent * e) {
killTimer (e->timerId ()); killTimer (e->timerId ());
} }
void View::addText (const QString & str, bool eol) { void View::addText (const TQString & str, bool eol) {
if (m_tmplog_needs_eol) if (m_tmplog_needs_eol)
tmplog += QChar ('\n'); tmplog += TQChar ('\n');
tmplog += str; tmplog += str;
m_tmplog_needs_eol = eol; m_tmplog_needs_eol = eol;
if (m_widgetstack->visibleWidget () != m_widgettypes[WT_Console] && if (m_widgetstack->visibleWidget () != m_widgettypes[WT_Console] &&
@ -517,7 +517,7 @@ void View::addText (const QString & str, bool eol) {
tmplog.truncate (0); tmplog.truncate (0);
m_tmplog_needs_eol = false; m_tmplog_needs_eol = false;
} else { } else {
int pos = tmplog.findRev (QChar ('\n')); int pos = tmplog.tqfindRev (TQChar ('\n'));
if (pos >= 0) { if (pos >= 0) {
m_multiedit->append (tmplog.left (pos)); m_multiedit->append (tmplog.left (pos));
tmplog = tmplog.mid (pos+1); tmplog = tmplog.mid (pos+1);
@ -531,9 +531,9 @@ void View::addText (const QString & str, bool eol) {
m_multiedit->setCursorPosition (m_multiedit->paragraphs () - 1, 0); m_multiedit->setCursorPosition (m_multiedit->paragraphs () - 1, 0);
} }
/* void View::print (QPrinter *pPrinter) /* void View::print (TQPrinter *pPrinter)
{ {
QPainter printpainter; TQPainter printpainter;
printpainter.begin (pPrinter); printpainter.begin (pPrinter);
// TODO: add your printing code here // TODO: add your printing code here
@ -581,7 +581,7 @@ KDE_NO_EXPORT void View::playingStop () {
m_view_area->resizeEvent (0L); m_view_area->resizeEvent (0L);
} }
KDE_NO_EXPORT void View::leaveEvent (QEvent *) { KDE_NO_EXPORT void View::leaveEvent (TQEvent *) {
delayedShowButtons (false); delayedShowButtons (false);
} }
@ -600,16 +600,16 @@ bool View::isFullScreen () const {
void View::fullScreen () { void View::fullScreen () {
if (!m_view_area->isFullScreen()) { if (!m_view_area->isFullScreen()) {
m_sreensaver_disabled = false; m_sreensaver_disabled = false;
QByteArray data, replydata; TQByteArray data, replydata;
QCString replyType; TQCString replyType;
if (kapp->dcopClient ()->call ("kdesktop", "KScreensaverIface", if (kapp->dcopClient ()->call ("kdesktop", "KScreensaverIface",
"isEnabled()", data, replyType, replydata)) { "isEnabled()", data, replyType, replydata)) {
bool enabled; bool enabled;
QDataStream replystream (replydata, IO_ReadOnly); TQDataStream replystream (replydata, IO_ReadOnly);
replystream >> enabled; replystream >> enabled;
if (enabled) if (enabled)
m_sreensaver_disabled = kapp->dcopClient()->send m_sreensaver_disabled = kapp->dcopClient()->send
("kdesktop", "KScreensaverIface", "enable(bool)", "false"); ("kdesktop", "KScreensaverIface", "enable(bool)", TQString("false"));
} }
//if (m_keepsizeratio && m_viewer->aspect () < 0.01) //if (m_keepsizeratio && m_viewer->aspect () < 0.01)
// m_viewer->setAspect (1.0 * m_viewer->width() / m_viewer->height()); // m_viewer->setAspect (1.0 * m_viewer->width() / m_viewer->height());
@ -619,7 +619,7 @@ void View::fullScreen () {
} else { } else {
if (m_sreensaver_disabled) if (m_sreensaver_disabled)
m_sreensaver_disabled = !kapp->dcopClient()->send m_sreensaver_disabled = !kapp->dcopClient()->send
("kdesktop", "KScreensaverIface", "enable(bool)", "true"); ("kdesktop", "KScreensaverIface", "enable(bool)", TQString("true"));
m_view_area->fullScreen(); m_view_area->fullScreen();
m_control_panel->popupMenu ()->setItemVisible (ControlPanel::menu_zoom, true); m_control_panel->popupMenu ()->setItemVisible (ControlPanel::menu_zoom, true);
} }
@ -632,7 +632,7 @@ KDE_NO_EXPORT int View::statusBarHeight () const {
if (statusBarMode () == SB_Only) if (statusBarMode () == SB_Only)
return height (); return height ();
else else
return statusBar()->maximumSize ().height (); return statusBar()->tqmaximumSize ().height ();
} }
return 0; return 0;
} }
@ -665,13 +665,13 @@ bool View::x11Event (XEvent * e) {
if (e->xmotion.window == m_viewer->embeddedWinId ()) if (e->xmotion.window == m_viewer->embeddedWinId ())
delayedShowButtons (e->xmotion.y > m_view_area->height () - delayedShowButtons (e->xmotion.y > m_view_area->height () -
statusBarHeight () - statusBarHeight () -
m_control_panel->maximumSize ().height ()); m_control_panel->tqmaximumSize ().height ());
m_view_area->mouseMoved (); m_view_area->mouseMoved ();
break; break;
case MapNotify: case MapNotify:
if (e->xmap.event == m_viewer->embeddedWinId ()) { if (e->xmap.event == m_viewer->embeddedWinId ()) {
show (); show ();
QTimer::singleShot (10, m_viewer, SLOT (sendConfigureEvent ())); TQTimer::singleShot (10, m_viewer, TQT_SLOT (sendConfigureEvent ()));
} }
break; break;
/*case ConfigureNotify: /*case ConfigureNotify:
@ -685,8 +685,8 @@ bool View::x11Event (XEvent * e) {
//---------------------------------------------------------------------- //----------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT Viewer::Viewer (QWidget *parent, View * view) KDE_NO_CDTOR_EXPORT Viewer::Viewer (TQWidget *tqparent, View * view)
: QXEmbed (parent), m_plain_window (0), m_bgcolor (0), m_aspect (0.0), : QXEmbed (tqparent), m_plain_window (0), m_bgcolor (0), m_aspect (0.0),
m_view (view) { m_view (view) {
/*XWindowAttributes xwa; /*XWindowAttributes xwa;
XGetWindowAttributes (qt_xdisplay(), winId (), &xwa); XGetWindowAttributes (qt_xdisplay(), winId (), &xwa);
@ -694,7 +694,7 @@ KDE_NO_CDTOR_EXPORT Viewer::Viewer (QWidget *parent, View * view)
xswa.background_pixel = 0; xswa.background_pixel = 0;
xswa.border_pixel = 0; xswa.border_pixel = 0;
xswa.colormap = xwa.colormap; xswa.colormap = xwa.colormap;
create (XCreateWindow (qt_xdisplay (), parent->winId (), 0, 0, 10, 10, 0, create (XCreateWindow (qt_xdisplay (), tqparent->winId (), 0, 0, 10, 10, 0,
x11Depth (), InputOutput, (Visual*)x11Visual (), x11Depth (), InputOutput, (Visual*)x11Visual (),
CWBackPixel | CWBorderPixel | CWColormap, &xswa));*/ CWBackPixel | CWBorderPixel | CWColormap, &xswa));*/
setAcceptDrops (true); setAcceptDrops (true);
@ -747,9 +747,9 @@ KDE_NO_EXPORT void Viewer::windowChanged (WId w) {
PointerMotionMask); PointerMotionMask);
} }
KDE_NO_EXPORT void Viewer::mouseMoveEvent (QMouseEvent * e) { KDE_NO_EXPORT void Viewer::mouseMoveEvent (TQMouseEvent * e) {
if (e->state () == Qt::NoButton) { if (e->state () == Qt::NoButton) {
int cp_height = m_view->controlPanel ()->maximumSize ().height (); int cp_height = m_view->controlPanel ()->tqmaximumSize ().height ();
m_view->delayedShowButtons (e->y () > height () - cp_height); m_view->delayedShowButtons (e->y () > height () - cp_height);
} }
m_view->viewArea ()->mouseMoved (); m_view->viewArea ()->mouseMoved ();
@ -765,11 +765,11 @@ KDE_NO_EXPORT int Viewer::heightForWidth (int w) const {
return int (w/m_aspect); return int (w/m_aspect);
} }
KDE_NO_EXPORT void Viewer::dropEvent (QDropEvent * de) { KDE_NO_EXPORT void Viewer::dropEvent (TQDropEvent * de) {
m_view->dropEvent (de); m_view->dropEvent (de);
} }
KDE_NO_EXPORT void Viewer::dragEnterEvent (QDragEnterEvent* dee) { KDE_NO_EXPORT void Viewer::dragEnterEvent (TQDragEnterEvent* dee) {
m_view->dragEnterEvent (dee); m_view->dragEnterEvent (dee);
} }
/* /*
@ -804,11 +804,11 @@ KDE_NO_EXPORT void Viewer::sendConfigureEvent () {
} }
} }
KDE_NO_EXPORT void Viewer::contextMenuEvent (QContextMenuEvent * e) { KDE_NO_EXPORT void Viewer::contextMenuEvent (TQContextMenuEvent * e) {
m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ()); m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ());
} }
KDE_NO_EXPORT void Viewer::setBackgroundColor (const QColor & c) { KDE_NO_EXPORT void Viewer::setBackgroundColor (const TQColor & c) {
if (m_bgcolor != c.rgb ()) { if (m_bgcolor != c.rgb ()) {
m_bgcolor = c.rgb (); m_bgcolor = c.rgb ();
setCurrentBackgroundColor (c); setCurrentBackgroundColor (c);
@ -819,7 +819,7 @@ KDE_NO_EXPORT void Viewer::resetBackgroundColor () {
setCurrentBackgroundColor (m_bgcolor); setCurrentBackgroundColor (m_bgcolor);
} }
KDE_NO_EXPORT void Viewer::setCurrentBackgroundColor (const QColor & c) { KDE_NO_EXPORT void Viewer::setCurrentBackgroundColor (const TQColor & c) {
setPaletteBackgroundColor (c); setPaletteBackgroundColor (c);
WId w = embeddedWinId (); WId w = embeddedWinId ();
if (w) { if (w) {

@ -22,8 +22,8 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#include <qwidget.h> #include <tqwidget.h>
#include <qtextedit.h> #include <tqtextedit.h>
#include <kdockwidget.h> #include <kdockwidget.h>
#include <kurl.h> #include <kurl.h>
@ -34,12 +34,12 @@
#define MOUSE_INVISIBLE_DELAY 2000 #define MOUSE_INVISIBLE_DELAY 2000
class QWidgetStack; class TQWidgetStack;
class QPixmap; class TQPixmap;
class QPaintDevice; class TQPaintDevice;
class QPainter; class TQPainter;
class QSlider; class TQSlider;
class QLabel; class TQLabel;
class KActionCollection; class KActionCollection;
class KAction; class KAction;
class KShortcut; class KShortcut;
@ -63,11 +63,11 @@ typedef KStatusBar StatusBar;
/* /*
* The console GUI * The console GUI
*/ */
class TextEdit : public QTextEdit { class TextEdit : public TQTextEdit {
public: public:
TextEdit (QWidget * parent, View * view); TextEdit (TQWidget * tqparent, View * view);
protected: protected:
void contextMenuEvent (QContextMenuEvent * e); void contextMenuEvent (TQContextMenuEvent * e);
private: private:
View * m_view; View * m_view;
}; };
@ -75,12 +75,12 @@ private:
/* /*
* The infowindow GUI * The infowindow GUI
*/ */
class InfoWindow : public QTextEdit { class InfoWindow : public TQTextEdit {
public: public:
InfoWindow (QWidget * parent, View * view); InfoWindow (TQWidget * tqparent, View * view);
KDE_NO_EXPORT View * view () const { return m_view; } KDE_NO_EXPORT View * view () const { return m_view; }
protected: protected:
void contextMenuEvent (QContextMenuEvent * e); void contextMenuEvent (TQContextMenuEvent * e);
private: private:
View * m_view; View * m_view;
}; };
@ -90,6 +90,7 @@ private:
*/ */
class KMPLAYER_EXPORT View : public KMediaPlayer::View { class KMPLAYER_EXPORT View : public KMediaPlayer::View {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
enum ControlPanelMode { enum ControlPanelMode {
CP_Hide, CP_AutoHide, CP_Show, CP_Only /* no video widget */ CP_Hide, CP_AutoHide, CP_Show, CP_Only /* no video widget */
@ -101,13 +102,13 @@ public:
WT_Video, WT_Console, WT_Picture, WT_Last WT_Video, WT_Console, WT_Picture, WT_Last
}; };
View (QWidget *parent, const char *); View (TQWidget *tqparent, const char *);
~View(); ~View();
void addText (const QString &, bool eol=false); void addText (const TQString &, bool eol=false);
void init (KActionCollection * ac); void init (KActionCollection * ac);
void reset (); void reset ();
//void print(QPrinter *pPrinter); //void print(TQPrinter *pPrinter);
TextEdit * console () const { return m_multiedit; } TextEdit * console () const { return m_multiedit; }
KDE_NO_EXPORT Viewer * viewer () const { return m_viewer; } KDE_NO_EXPORT Viewer * viewer () const { return m_viewer; }
@ -115,7 +116,7 @@ public:
KDE_NO_EXPORT StatusBar * statusBar () const {return m_status_bar;} KDE_NO_EXPORT StatusBar * statusBar () const {return m_status_bar;}
KDE_NO_EXPORT PlayListView * playList () const { return m_playlist; } KDE_NO_EXPORT PlayListView * playList () const { return m_playlist; }
KDE_NO_EXPORT InfoWindow * infoPanel () const { return m_infopanel; } KDE_NO_EXPORT InfoWindow * infoPanel () const { return m_infopanel; }
KDE_NO_EXPORT QWidgetStack * widgetStack () const { return m_widgetstack; } KDE_NO_EXPORT TQWidgetStack * widgetStack () const { return m_widgetstack; }
KDE_NO_EXPORT KDockArea * docArea () const { return m_dockarea; } KDE_NO_EXPORT KDockArea * docArea () const { return m_dockarea; }
KDE_NO_EXPORT ViewArea * viewArea () const { return m_view_area; } KDE_NO_EXPORT ViewArea * viewArea () const { return m_view_area; }
KDE_NO_EXPORT bool keepSizeRatio () const { return m_keepsizeratio; } KDE_NO_EXPORT bool keepSizeRatio () const { return m_keepsizeratio; }
@ -123,22 +124,22 @@ public:
void showWidget (WidgetType w); void showWidget (WidgetType w);
void setControlPanelMode (ControlPanelMode m); void setControlPanelMode (ControlPanelMode m);
void setStatusBarMode (StatusBarMode m); void setStatusBarMode (StatusBarMode m);
void setEraseColor (const QColor &); void setEraseColor (const TQColor &);
KDE_NO_EXPORT ControlPanelMode controlPanelMode () const { return m_controlpanel_mode; } KDE_NO_EXPORT ControlPanelMode controlPanelMode () const { return m_controlpanel_mode; }
KDE_NO_EXPORT StatusBarMode statusBarMode () const { return m_statusbar_mode; } KDE_NO_EXPORT StatusBarMode statusBarMode () const { return m_statusbar_mode; }
void delayedShowButtons (bool show); void delayedShowButtons (bool show);
bool isFullScreen () const; bool isFullScreen () const;
int statusBarHeight () const; int statusBarHeight () const;
KDE_NO_EXPORT bool editMode () const { return m_edit_mode; } KDE_NO_EXPORT bool editMode () const { return m_edit_mode; }
bool setPicture (const QString & path); bool setPicture (const TQString & path);
KDE_NO_EXPORT QPixmap * image () const { return m_image; } KDE_NO_EXPORT TQPixmap * image () const { return m_image; }
void setNoInfoMessages (bool b) { m_no_info = b; } void setNoInfoMessages (bool b) { m_no_info = b; }
void setViewOnly (); void setViewOnly ();
void setInfoPanelOnly (); void setInfoPanelOnly ();
void setPlaylistOnly (); void setPlaylistOnly ();
void setEditMode (RootPlayListItem *, bool enable=true); void setEditMode (RootPlayListItem *, bool enable=true);
void dragEnterEvent (QDragEnterEvent *); void dragEnterEvent (TQDragEnterEvent *);
void dropEvent (QDropEvent *); void dropEvent (TQDropEvent *);
KDE_NO_EXPORT void emitPictureClicked () { emit pictureClicked (); } KDE_NO_EXPORT void emitPictureClicked () { emit pictureClicked (); }
/* raise video widget, might (auto) hides panel */ /* raise video widget, might (auto) hides panel */
void videoStart (); void videoStart ();
@ -152,16 +153,16 @@ public slots:
void updateLayout (); void updateLayout ();
void toggleShowPlaylist (); void toggleShowPlaylist ();
void toggleVideoConsoleWindow (); void toggleVideoConsoleWindow ();
void setInfoMessage (const QString & msg); void setInfoMessage (const TQString & msg);
void setStatusMessage (const QString & msg); void setStatusMessage (const TQString & msg);
signals: signals:
void urlDropped (const KURL::List & urls); void urlDropped (const KURL::List & urls);
void pictureClicked (); void pictureClicked ();
void fullScreenChanged (); void fullScreenChanged ();
void windowVideoConsoleToggled (int wt); void windowVideoConsoleToggled (int wt);
protected: protected:
void leaveEvent (QEvent *) KDE_NO_EXPORT; void leaveEvent (TQEvent *) KDE_NO_EXPORT;
void timerEvent (QTimerEvent *) KDE_NO_EXPORT; void timerEvent (TQTimerEvent *) KDE_NO_EXPORT;
bool x11Event (XEvent *) KDE_NO_EXPORT; bool x11Event (XEvent *) KDE_NO_EXPORT;
private: private:
// widget for player's output // widget for player's output
@ -169,24 +170,24 @@ private:
// console output // console output
TextEdit * m_multiedit; TextEdit * m_multiedit;
// widget stack contains m_viewer, m_multiedit and m_picturewidget // widget stack contains m_viewer, m_multiedit and m_picturewidget
QWidgetStack * m_widgetstack; TQWidgetStack * m_widgetstack;
// widget that layouts m_widgetstack for ratio setting and m_control_panel // widget that tqlayouts m_widgetstack for ratio setting and m_control_panel
ViewArea * m_view_area; ViewArea * m_view_area;
// playlist widget // playlist widget
PlayListView * m_playlist; PlayListView * m_playlist;
// infopanel widget // infopanel widget
InfoWindow * m_infopanel; InfoWindow * m_infopanel;
// all widget types // all widget types
QWidget * m_widgettypes [WT_Last]; TQWidget * m_widgettypes [WT_Last];
KDockArea * m_dockarea; KDockArea * m_dockarea;
KDockWidget * m_dock_video; KDockWidget * m_dock_video;
KDockWidget * m_dock_playlist; KDockWidget * m_dock_playlist;
KDockWidget * m_dock_infopanel; KDockWidget * m_dock_infopanel;
QString tmplog; TQString tmplog;
QPixmap * m_image; TQPixmap * m_image;
ControlPanel * m_control_panel; ControlPanel * m_control_panel;
StatusBar * m_status_bar; StatusBar * m_status_bar;
QSlider * m_volume_slider; TQSlider * m_volume_slider;
const char * m_mixer_object; const char * m_mixer_object;
ControlPanelMode m_controlpanel_mode; ControlPanelMode m_controlpanel_mode;
ControlPanelMode m_old_controlpanel_mode; ControlPanelMode m_old_controlpanel_mode;
@ -209,8 +210,9 @@ private:
*/ */
class KMPLAYER_EXPORT Viewer : public QXEmbed { class KMPLAYER_EXPORT Viewer : public QXEmbed {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Viewer(QWidget *parent, View * view); Viewer(TQWidget *tqparent, View * view);
~Viewer(); ~Viewer();
int heightForWidth (int w) const; int heightForWidth (int w) const;
@ -218,18 +220,18 @@ public:
void setAspect (float a); void setAspect (float a);
float aspect () { return m_aspect; } float aspect () { return m_aspect; }
void sendKeyEvent (int key); void sendKeyEvent (int key);
void setBackgroundColor (const QColor & c); void setBackgroundColor (const TQColor & c);
void resetBackgroundColor (); void resetBackgroundColor ();
void setCurrentBackgroundColor (const QColor & c); void setCurrentBackgroundColor (const TQColor & c);
KDE_NO_EXPORT View * view () const { return m_view; } KDE_NO_EXPORT View * view () const { return m_view; }
void changeProtocol (QXEmbed::Protocol p); void changeProtocol (QXEmbed::Protocol p);
public slots: public slots:
void sendConfigureEvent (); void sendConfigureEvent ();
protected: protected:
void dragEnterEvent (QDragEnterEvent *); void dragEnterEvent (TQDragEnterEvent *);
void dropEvent (QDropEvent *); void dropEvent (TQDropEvent *);
void mouseMoveEvent (QMouseEvent * e); void mouseMoveEvent (TQMouseEvent * e);
void contextMenuEvent (QContextMenuEvent * e); void contextMenuEvent (TQContextMenuEvent * e);
virtual void windowChanged( WId w ); virtual void windowChanged( WId w );
private: private:
WId m_plain_window; WId m_plain_window;

@ -23,8 +23,8 @@ email :
#include <kdemacros.h> #include <kdemacros.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <qguardedptr.h> #include <tqguardedptr.h>
#include <qfileinfo.h> #include <tqfileinfo.h>
#include "kmplayer.h" #include "kmplayer.h"
@ -54,7 +54,7 @@ extern "C" {
KMPlayer::StringPool::init(); KMPlayer::StringPool::init();
KApplication app; KApplication app;
QGuardedPtr <KMPlayerApp> kmplayer; TQGuardedPtr <KMPlayerApp> kmplayer;
if (app.isRestored ()) { if (app.isRestored ()) {
RESTORE (KMPlayerApp); RESTORE (KMPlayerApp);
@ -70,8 +70,8 @@ extern "C" {
if (args->count () > 1) if (args->count () > 1)
for (int i = 0; i < args->count (); i++) { for (int i = 0; i < args->count (); i++) {
KURL url = args->url (i); KURL url = args->url (i);
if (url.url ().find ("://") < 0) if (url.url ().tqfind ("://") < 0)
url = KURL (QFileInfo (url.url ()).absFilePath ()); url = KURL (TQFileInfo (url.url ()).absFilePath ());
if (url.isValid ()) if (url.isValid ())
kmplayer->addURL (url); kmplayer->addURL (url);
} }

@ -58,7 +58,7 @@ static gchar *callback_path;
static GModule *library; static GModule *library;
static GtkWidget *xembed; static GtkWidget *xembed;
static Window socket_id; static Window socket_id;
static Window parent_id; static Window tqparent_id;
static int top_w, top_h; static int top_w, top_h;
static int update_dimension_timer; static int update_dimension_timer;
static int stdin_read_watch; static int stdin_read_watch;
@ -94,7 +94,7 @@ typedef struct _StreamInfo {
struct JsObject; struct JsObject;
typedef struct _JsObject { typedef struct _JsObject {
NPObject npobject; NPObject npobject;
struct _JsObject * parent; struct _JsObject * tqparent;
char * name; char * name;
} JsObject; } JsObject;
@ -249,15 +249,15 @@ static StreamInfo *addStream (const char *url, const char *mime, const char *tar
static void createJsName (JsObject * obj, char **name, uint32_t * len) { static void createJsName (JsObject * obj, char **name, uint32_t * len) {
int slen = strlen (obj->name); int slen = strlen (obj->name);
if (obj->parent) { if (obj->tqparent) {
*len += slen + 1; *len += slen + 1;
createJsName (obj->parent, name, len); createJsName (obj->tqparent, name, len);
} else { } else {
*name = (char *) malloc (*len + slen + 1); *name = (char *) malloc (*len + slen + 1);
*(*name + *len + slen) = 0; *(*name + *len + slen) = 0;
*len = 0; *len = 0;
} }
if (obj->parent) { if (obj->tqparent) {
*(*name + *len) = '.'; *(*name + *len) = '.';
*len += 1; *len += 1;
} }
@ -379,9 +379,9 @@ static NPError nsDestroyStream (NPP instance, NPStream *stream, NPError reason)
return NPERR_NO_DATA; return NPERR_NO_DATA;
} }
static void nsStatus (NPP instance, const char* message) { static void nstqStatus (NPP instance, const char* message) {
(void)instance; (void)instance;
print ("NPN_Status %s\n", message ? message : "-"); print ("NPN_tqStatus %s\n", message ? message : "-");
} }
static const char* nsUserAgent (NPP instance) { static const char* nsUserAgent (NPP instance) {
@ -687,8 +687,8 @@ static NPObject * windowClassAllocate (NPP instance, NPClass *aClass) {
static void windowClassDeallocate (NPObject *npobj) { static void windowClassDeallocate (NPObject *npobj) {
JsObject *jo = (JsObject *) npobj; JsObject *jo = (JsObject *) npobj;
/*print ("windowClassDeallocate\n");*/ /*print ("windowClassDeallocate\n");*/
if (jo->parent) { if (jo->tqparent) {
nsReleaseObject ((NPObject *) jo->parent); nsReleaseObject ((NPObject *) jo->tqparent);
} else if (jo->name && !strncmp (jo->name, "this.__kmplayer__obj_", 21)) { } else if (jo->name && !strncmp (jo->name, "this.__kmplayer__obj_", 21)) {
char *script = (char *) malloc (strlen (jo->name) + 7); char *script = (char *) malloc (strlen (jo->name) + 7);
char *result; char *result;
@ -793,7 +793,7 @@ static bool windowClassGetProperty (NPObject *npobj, NPIdentifier property,
} }
jo.name = id; jo.name = id;
jo.parent = (JsObject *) npobj; jo.tqparent = (JsObject *) npobj;
createJsName (&jo, (char **)&fullname.utf8characters, &fullname.utf8length); createJsName (&jo, (char **)&fullname.utf8characters, &fullname.utf8length);
res = nsEvaluate (npp, npobj, &fullname, result); res = nsEvaluate (npp, npobj, &fullname, result);
@ -814,7 +814,7 @@ static bool windowClassSetProperty (NPObject *npobj, NPIdentifier property,
return false; return false;
jo.name = id; jo.name = id;
jo.parent = (JsObject *) npobj; jo.tqparent = (JsObject *) npobj;
createJsName (&jo, &var_name, &len); createJsName (&jo, &var_name, &len);
var_val = nsVariant2Str (value); var_val = nsVariant2Str (value);
@ -966,7 +966,7 @@ static int initPlugin (const char *plugin_lib) {
ns_funcs.newstream = nsNewStream; ns_funcs.newstream = nsNewStream;
ns_funcs.write = nsWrite; ns_funcs.write = nsWrite;
ns_funcs.destroystream = nsDestroyStream; ns_funcs.destroystream = nsDestroyStream;
ns_funcs.status = nsStatus; ns_funcs.status = nstqStatus;
ns_funcs.uagent = nsUserAgent; ns_funcs.uagent = nsUserAgent;
ns_funcs.memalloc = nsAlloc; ns_funcs.memalloc = nsAlloc;
ns_funcs.memfree = nsMemFree; ns_funcs.memfree = nsMemFree;
@ -1354,19 +1354,19 @@ static void windowCreatedEvent (GtkWidget *w, gpointer d) {
(void)d; (void)d;
print ("windowCreatedEvent\n"); print ("windowCreatedEvent\n");
socket_id = gtk_socket_get_id (GTK_SOCKET (xembed)); socket_id = gtk_socket_get_id (GTK_SOCKET (xembed));
if (parent_id) { if (tqparent_id) {
print ("windowCreatedEvent %p\n", GTK_PLUG (w)->socket_window); print ("windowCreatedEvent %p\n", GTK_PLUG (w)->socket_window);
if (!GTK_PLUG (w)->socket_window) if (!GTK_PLUG (w)->socket_window)
gtk_plug_construct (GTK_PLUG (w), parent_id); gtk_plug_construct (GTK_PLUG (w), tqparent_id);
gdk_window_reparent( w->window, gdk_window_reparent( w->window,
GTK_PLUG (w)->socket_window GTK_PLUG (w)->socket_window
? GTK_PLUG (w)->socket_window ? GTK_PLUG (w)->socket_window
: gdk_window_foreign_new (parent_id), : gdk_window_foreign_new (tqparent_id),
0, 0); 0, 0);
gtk_widget_show_all (w); gtk_widget_show_all (w);
/*XReparentWindow (gdk_x11_drawable_get_xdisplay (w->window), /*XRetqparentWindow (gdk_x11_drawable_get_xdisplay (w->window),
gdk_x11_drawable_get_xid (w->window), gdk_x11_drawable_get_xid (w->window),
parent_id, tqparent_id,
0, 0);*/ 0, 0);*/
} }
if (!callback_service) { if (!callback_service) {
@ -1425,7 +1425,7 @@ static gboolean initPlayer (void * p) {
(void)p; (void)p;
window = callback_service window = callback_service
? gtk_plug_new (parent_id) ? gtk_plug_new (tqparent_id)
: gtk_window_new (GTK_WINDOW_TOPLEVEL); : gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), "delete_event", g_signal_connect (G_OBJECT (window), "delete_event",
G_CALLBACK (windowCloseEvent), NULL); G_CALLBACK (windowCloseEvent), NULL);
@ -1446,7 +1446,7 @@ static gboolean initPlayer (void * p) {
gtk_container_add (GTK_CONTAINER (window), xembed); gtk_container_add (GTK_CONTAINER (window), xembed);
if (!parent_id) { if (!tqparent_id) {
gtk_widget_set_size_request (window, 440, 330); gtk_widget_set_size_request (window, 440, 330);
gtk_widget_show_all (window); gtk_widget_show_all (window);
} else { } else {
@ -1518,7 +1518,7 @@ int main (int argc, char **argv) {
} else if (!strcmp (argv[i], "-m") && ++i < argc) { } else if (!strcmp (argv[i], "-m") && ++i < argc) {
mimetype = g_strdup (argv[i]); mimetype = g_strdup (argv[i]);
} else if (!strcmp (argv [i], "-wid") && ++i < argc) { } else if (!strcmp (argv [i], "-wid") && ++i < argc) {
parent_id = strtol (argv[i], 0L, 10); tqparent_id = strtol (argv[i], 0L, 10);
} else } else
object_url = g_strdup (argv[i]); object_url = g_strdup (argv[i]);
} }

@ -19,17 +19,17 @@
#include <stdio.h> #include <stdio.h>
#include <config.h> #include <config.h>
// include files for Qt // include files for TQt
#include <qapplication.h> #include <tqapplication.h>
#include <qclipboard.h> #include <tqclipboard.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qdrawutil.h> #include <tqdrawutil.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qiconset.h> #include <tqiconset.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qheader.h> #include <tqheader.h>
#include <qstyle.h> #include <tqstyle.h>
#include <qtimer.h> #include <tqtimer.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kfinddialog.h> #include <kfinddialog.h>
@ -48,12 +48,12 @@ using namespace KMPlayer;
namespace KMPlayer { namespace KMPlayer {
KDE_NO_EXPORT bool isDragValid (QDropEvent * de) { KDE_NO_EXPORT bool isDragValid (TQDropEvent * de) {
if (KURLDrag::canDecode (de)) if (KURLDrag::canDecode (de))
return true; return true;
if (QTextDrag::canDecode (de)) { if (TQTextDrag::canDecode (de)) {
QString text; TQString text;
if (QTextDrag::decode (de, text) && KURL (text).isValid ()) if (TQTextDrag::decode (de, text) && KURL (text).isValid ())
return true; return true;
} }
return false; return false;
@ -62,59 +62,59 @@ namespace KMPlayer {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (QListViewItem *p, const NodePtr & e, PlayListView * lv) : QListViewItem (p), node (e), listview (lv) {} KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (TQListViewItem *p, const NodePtr & e, PlayListView * lv) : TQListViewItem (p), node (e), listview (lv) {}
KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (QListViewItem *p, const AttributePtr & a, PlayListView * lv) : QListViewItem (p), m_attr (a), listview (lv) {} KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (TQListViewItem *p, const AttributePtr & a, PlayListView * lv) : TQListViewItem (p), m_attr (a), listview (lv) {}
KDE_NO_CDTOR_EXPORT KDE_NO_CDTOR_EXPORT
PlayListItem::PlayListItem (PlayListView *v, const NodePtr &e, QListViewItem *b) PlayListItem::PlayListItem (PlayListView *v, const NodePtr &e, TQListViewItem *b)
: QListViewItem (v, b), node (e), listview (v) {} : TQListViewItem (v, b), node (e), listview (v) {}
KDE_NO_CDTOR_EXPORT void PlayListItem::paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align) { KDE_NO_CDTOR_EXPORT void PlayListItem::paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align) {
if (node && node->state == Node::state_began) { if (node && node->state == Node::state_began) {
QColorGroup mycg (cg); TQColorGroup mycg (cg);
mycg.setColor (QColorGroup::Foreground, listview->activeColor ()); mycg.setColor (TQColorGroup::Foreground, listview->activeColor ());
mycg.setColor (QColorGroup::Text, listview->activeColor ()); mycg.setColor (TQColorGroup::Text, listview->activeColor ());
QListViewItem::paintCell (p, mycg, column, width, align); TQListViewItem::paintCell (p, mycg, column, width, align);
} else } else
QListViewItem::paintCell (p, cg, column, width, align); TQListViewItem::paintCell (p, cg, column, width, align);
} }
KDE_NO_CDTOR_EXPORT void PlayListItem::paintBranches (QPainter * p, const QColorGroup &, int w, int, int h) { KDE_NO_CDTOR_EXPORT void PlayListItem::paintBranches (TQPainter * p, const TQColorGroup &, int w, int, int h) {
p->fillRect (0, 0, w, h, listview->paletteBackgroundColor()); p->fillRect (0, 0, w, h, listview->paletteBackgroundColor());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KDE_NO_CDTOR_EXPORT
RootPlayListItem::RootPlayListItem (int _id, PlayListView *v, const NodePtr & e, QListViewItem * before, int flgs) RootPlayListItem::RootPlayListItem (int _id, PlayListView *v, const NodePtr & e, TQListViewItem * before, int flgs)
: PlayListItem (v, e, before), : PlayListItem (v, e, before),
id (_id), id (_id),
flags (flgs), flags (flgs),
show_all_nodes (false), show_all_nodes (false),
have_dark_nodes (false) {} have_dark_nodes (false) {}
KDE_NO_CDTOR_EXPORT void RootPlayListItem::paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align) { KDE_NO_CDTOR_EXPORT void RootPlayListItem::paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align) {
QColorGroup mycg (cg); TQColorGroup mycg (cg);
mycg.setColor (QColorGroup::Base, listview->topLevelWidget()->paletteBackgroundColor()); mycg.setColor (TQColorGroup::Base, listview->tqtopLevelWidget()->paletteBackgroundColor());
mycg.setColor (QColorGroup::Highlight, mycg.base ()); mycg.setColor (TQColorGroup::Highlight, mycg.base ());
mycg.setColor (QColorGroup::Text, listview->topLevelWidget()->paletteForegroundColor()); mycg.setColor (TQColorGroup::Text, listview->tqtopLevelWidget()->paletteForegroundColor());
mycg.setColor (QColorGroup::HighlightedText, mycg.text ()); mycg.setColor (TQColorGroup::HighlightedText, mycg.text ());
QListViewItem::paintCell (p, mycg, column, width, align); TQListViewItem::paintCell (p, mycg, column, width, align);
qDrawShadeRect (p, 0, 0, width -1, height () -1, mycg, !isOpen ()); qDrawShadeRect (p, 0, 0, width -1, height () -1, mycg, !isOpen ());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (QWidget * parent, View * view, KActionCollection * ac) KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (TQWidget * tqparent, View * view, KActionCollection * ac)
: KListView (parent, "kde_kmplayer_playlist"), : KListView (tqparent, "kde_kmplayer_playlist"),
m_view (view), m_view (view),
m_find_dialog (0L), m_find_dialog (0L),
m_active_color (30, 0, 255), m_active_color (30, 0, 255),
last_id (0), last_id (0),
last_drag_tree_id (0), last_drag_tree_id (0),
m_ignore_expanded (false) { m_ignore_expanded (false) {
addColumn (QString ()); addColumn (TQString ());
header()->hide (); header()->hide ();
//setRootIsDecorated (true); //setRootIsDecorated (true);
setSorting (-1); setSorting (-1);
@ -122,36 +122,36 @@ KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (QWidget * parent, View * view, K
setDropVisualizer (true); setDropVisualizer (true);
setItemsRenameable (true); setItemsRenameable (true);
setItemMargin (2); setItemMargin (2);
setPaletteBackgroundColor (QColor (0, 0, 0)); setPaletteBackgroundColor (TQColor (0, 0, 0));
setPaletteForegroundColor (QColor (0xB2, 0xB2, 0xB2)); setPaletteForegroundColor (TQColor (0xB2, 0xB2, 0xB2));
m_itemmenu = new QPopupMenu (this); m_itemmenu = new TQPopupMenu (this);
folder_pix = KGlobal::iconLoader ()->loadIcon (QString ("folder"), KIcon::Small); folder_pix = KGlobal::iconLoader ()->loadIcon (TQString ("folder"), KIcon::Small);
auxiliary_pix = KGlobal::iconLoader ()->loadIcon (QString ("folder_grey"), KIcon::Small); auxiliary_pix = KGlobal::iconLoader ()->loadIcon (TQString ("folder_grey"), KIcon::Small);
video_pix = KGlobal::iconLoader ()->loadIcon (QString ("video"), KIcon::Small); video_pix = KGlobal::iconLoader ()->loadIcon (TQString ("video"), KIcon::Small);
info_pix = KGlobal::iconLoader ()->loadIcon (QString ("messagebox_info"), KIcon::Small); info_pix = KGlobal::iconLoader ()->loadIcon (TQString ("messagebox_info"), KIcon::Small);
img_pix = KGlobal::iconLoader ()->loadIcon (QString ("colorize"), KIcon::Small); img_pix = KGlobal::iconLoader ()->loadIcon (TQString ("colorize"), KIcon::Small);
unknown_pix = KGlobal::iconLoader ()->loadIcon (QString ("unknown"), KIcon::Small); unknown_pix = KGlobal::iconLoader ()->loadIcon (TQString ("unknown"), KIcon::Small);
menu_pix = KGlobal::iconLoader ()->loadIcon (QString ("player_playlist"), KIcon::Small); menu_pix = KGlobal::iconLoader ()->loadIcon (TQString ("player_playlist"), KIcon::Small);
config_pix = KGlobal::iconLoader ()->loadIcon (QString ("configure"), KIcon::Small); config_pix = KGlobal::iconLoader ()->loadIcon (TQString ("configure"), KIcon::Small);
url_pix = KGlobal::iconLoader ()->loadIcon (QString ("www"), KIcon::Small); url_pix = KGlobal::iconLoader ()->loadIcon (TQString ("www"), KIcon::Small);
m_find = KStdAction::find (this, SLOT (slotFind ()), ac, "find"); m_tqfind = KStdAction::find (TQT_TQOBJECT(this), TQT_SLOT (slotFind ()), ac, "tqfind");
m_find_next = KStdAction::findNext (this, SLOT(slotFindNext()), ac, "next"); m_find_next = KStdAction::findNext (TQT_TQOBJECT(this), TQT_SLOT(slotFindNext()), ac, "next");
m_find_next->setEnabled (false); m_find_next->setEnabled (false);
connect (this, SIGNAL (contextMenuRequested (QListViewItem *, const QPoint &, int)), this, SLOT (contextMenuItem (QListViewItem *, const QPoint &, int))); connect (this, TQT_SIGNAL (contextMenuRequested (TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT (contextMenuItem (TQListViewItem *, const TQPoint &, int)));
connect (this, SIGNAL (expanded (QListViewItem *)), connect (this, TQT_SIGNAL (expanded (TQListViewItem *)),
this, SLOT (itemExpanded (QListViewItem *))); this, TQT_SLOT (itemExpanded (TQListViewItem *)));
connect (this, SIGNAL (dropped (QDropEvent *, QListViewItem *)), connect (this, TQT_SIGNAL (dropped (TQDropEvent *, TQListViewItem *)),
this, SLOT (itemDropped (QDropEvent *, QListViewItem *))); this, TQT_SLOT (itemDropped (TQDropEvent *, TQListViewItem *)));
connect (this, SIGNAL (itemRenamed (QListViewItem *)), connect (this, TQT_SIGNAL (itemRenamed (TQListViewItem *)),
this, SLOT (itemIsRenamed (QListViewItem *))); this, TQT_SLOT (itemIsRenamed (TQListViewItem *)));
connect (this, SIGNAL (selectionChanged (QListViewItem *)), connect (this, TQT_SIGNAL (selectionChanged (TQListViewItem *)),
this, SLOT (itemIsSelected (QListViewItem *))); this, TQT_SLOT (itemIsSelected (TQListViewItem *)));
} }
KDE_NO_CDTOR_EXPORT PlayListView::~PlayListView () { KDE_NO_CDTOR_EXPORT PlayListView::~PlayListView () {
} }
int PlayListView::addTree (NodePtr root, const QString & source, const QString & icon, int flags) { int PlayListView::addTree (NodePtr root, const TQString & source, const TQString & icon, int flags) {
//kdDebug () << "addTree " << source << " " << root->mrl()->src << endl; //kdDebug () << "addTree " << source << " " << root->mrl()->src << endl;
RootPlayListItem * ritem = new RootPlayListItem (++last_id, this, root, lastChild(), flags); RootPlayListItem * ritem = new RootPlayListItem (++last_id, this, root, lastChild(), flags);
ritem->source = source; ritem->source = source;
@ -173,7 +173,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
} }
PlayListItem * item = pitem ? new PlayListItem (pitem, e, this) : root; PlayListItem * item = pitem ? new PlayListItem (pitem, e, this) : root;
Mrl * mrl = e->mrl (); Mrl * mrl = e->mrl ();
QString text (e->nodeName()); TQString text (e->nodeName());
if (mrl && !root->show_all_nodes) { if (mrl && !root->show_all_nodes) {
if (mrl->pretty_name.isEmpty ()) { if (mrl->pretty_name.isEmpty ()) {
if (!mrl->src.isEmpty()) if (!mrl->src.isEmpty())
@ -201,7 +201,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
as->setPixmap (0, menu_pix); as->setPixmap (0, menu_pix);
for (; a; a = a->nextSibling ()) { for (; a; a = a->nextSibling ()) {
PlayListItem * ai = new PlayListItem (as, a, this); PlayListItem * ai = new PlayListItem (as, a, this);
ai->setText (0, QString ("%1=%2").arg ( ai->setText (0, TQString ("%1=%2").arg (
a->name ().toString ()).arg (a->value ())); a->name ().toString ()).arg (a->value ()));
ai->setPixmap (0, config_pix); ai->setPixmap (0, config_pix);
} }
@ -210,7 +210,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
} }
if (item != root) { if (item != root) {
Node::PlayType pt = e->playType (); Node::PlayType pt = e->playType ();
QPixmap * pix; TQPixmap * pix;
switch (pt) { switch (pt) {
case Node::play_type_image: case Node::play_type_image:
pix = &img_pix; pix = &img_pix;
@ -238,7 +238,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
bool select, bool open) { bool select, bool open) {
// TODO, if root is same as rootitems->node and treeversion is the same // TODO, if root is same as rootitems->node and treeversion is the same
// and show all nodes is unchanged then only update the cells // and show all nodes is unchanged then only update the cells
QWidget * w = focusWidget (); TQWidget * w = tqfocusWidget ();
if (w && w != this) if (w && w != this)
w->clearFocus (); w->clearFocus ();
//setSelected (firstChild (), true); //setSelected (firstChild (), true);
@ -251,7 +251,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
break; // found based on id break; // found based on id
} }
if (id == -1) { // wildcard id if (id == -1) { // wildcard id
for (NodePtr n = root; n; n = n->parentNode ()) for (NodePtr n = root; n; n = n->tqparentNode ())
if (n == ritem->node) { if (n == ritem->node) {
root = n; root = n;
break; break;
@ -277,7 +277,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
bool need_timer = !tree_update; bool need_timer = !tree_update;
tree_update = new TreeUpdate (ritem, active, select, open, tree_update); tree_update = new TreeUpdate (ritem, active, select, open, tree_update);
if (need_timer) if (need_timer)
QTimer::singleShot (0, this, SLOT (updateTrees ())); TQTimer::singleShot (0, this, TQT_SLOT (updateTrees ()));
} }
KDE_NO_EXPORT void PlayListView::updateTrees () { KDE_NO_EXPORT void PlayListView::updateTrees () {
@ -308,23 +308,23 @@ void PlayListView::updateTree (RootPlayListItem * ritem, NodePtr active, bool se
m_ignore_expanded = false; m_ignore_expanded = false;
} }
void PlayListView::selectItem (const QString & txt) { void PlayListView::selectItem (const TQString & txt) {
QListViewItem * item = selectedItem (); TQListViewItem * item = selectedItem ();
if (item && item->text (0) == txt) if (item && item->text (0) == txt)
return; return;
item = findItem (txt, 0); item = tqfindItem (txt, 0);
if (item) { if (item) {
setSelected (item, true); setSelected (item, true);
ensureItemVisible (item); ensureItemVisible (item);
} }
} }
KDE_NO_EXPORT QDragObject * PlayListView::dragObject () { KDE_NO_EXPORT TQDragObject * PlayListView::dragObject () {
PlayListItem * item = static_cast <PlayListItem *> (selectedItem ()); PlayListItem * item = static_cast <PlayListItem *> (selectedItem ());
if (item && item->node) { if (item && item->node) {
QString txt = item->node->isPlayable () TQString txt = item->node->isPlayable ()
? item->node->mrl ()->src : item->node->outerXML (); ? item->node->mrl ()->src : item->node->outerXML ();
QTextDrag * drag = new QTextDrag (txt, this); TQTextDrag * drag = new TQTextDrag (txt, this);
last_drag_tree_id = rootItem (item)->id; last_drag_tree_id = rootItem (item)->id;
m_last_drag = item->node; m_last_drag = item->node;
drag->setPixmap (*item->pixmap (0)); drag->setPixmap (*item->pixmap (0));
@ -335,40 +335,40 @@ KDE_NO_EXPORT QDragObject * PlayListView::dragObject () {
return 0; return 0;
} }
KDE_NO_EXPORT void PlayListView::setFont (const QFont & fnt) { KDE_NO_EXPORT void PlayListView::setFont (const TQFont & fnt) {
setTreeStepSize (QFontMetrics (fnt).boundingRect ('m').width ()); setTreeStepSize (TQFontMetrics (fnt).boundingRect ('m').width ());
KListView::setFont (fnt); KListView::setFont (fnt);
} }
KDE_NO_EXPORT void PlayListView::contextMenuItem (QListViewItem * vi, const QPoint & p, int) { KDE_NO_EXPORT void PlayListView::contextMenuItem (TQListViewItem * vi, const TQPoint & p, int) {
if (vi) { if (vi) {
PlayListItem * item = static_cast <PlayListItem *> (vi); PlayListItem * item = static_cast <PlayListItem *> (vi);
if (item->node || item->m_attr) { if (item->node || item->m_attr) {
RootPlayListItem * ritem = rootItem (vi); RootPlayListItem * ritem = rootItem (vi);
if (m_itemmenu->count () > 0) { if (m_itemmenu->count () > 0) {
m_find->unplug (m_itemmenu); m_tqfind->unplug (m_itemmenu);
m_find_next->unplug (m_itemmenu); m_find_next->unplug (m_itemmenu);
m_itemmenu->clear (); m_itemmenu->clear ();
} }
m_itemmenu->insertItem (KGlobal::iconLoader ()->loadIconSet m_itemmenu->insertItem (KGlobal::iconLoader ()->loadIconSet
(QString ("editcopy"), KIcon::Small, 0, true), (TQString ("editcopy"), KIcon::Small, 0, true),
i18n ("&Copy to Clipboard"), i18n ("&Copy to Clipboard"),
this, SLOT (copyToClipboard ()), 0, 0); this, TQT_SLOT (copyToClipboard ()), 0, 0);
if (item->m_attr || if (item->m_attr ||
(item->node && (item->node->isPlayable () || (item->node && (item->node->isPlayable () ||
item->node->isDocument ()) && item->node->isDocument ()) &&
item->node->mrl ()->bookmarkable)) item->node->mrl ()->bookmarkable))
m_itemmenu->insertItem (KGlobal::iconLoader ()->loadIconSet m_itemmenu->insertItem (KGlobal::iconLoader ()->loadIconSet
(QString ("bookmark_add"), KIcon::Small, 0, true), (TQString ("bookmark_add"), KIcon::Small, 0, true),
i18n ("&Add Bookmark"), i18n ("&Add Bookmark"),
this, SLOT (addBookMark ()), 0, 1); this, TQT_SLOT (addBookMark ()), 0, 1);
if (ritem->have_dark_nodes) { if (ritem->have_dark_nodes) {
m_itemmenu->insertItem (i18n ("&Show all"), m_itemmenu->insertItem (i18n ("&Show all"),
this, SLOT (toggleShowAllNodes ()), 0, 2); this, TQT_SLOT (toggleShowAllNodes ()), 0, 2);
m_itemmenu->setItemChecked (2, ritem->show_all_nodes); m_itemmenu->setItemChecked (2, ritem->show_all_nodes);
} }
m_itemmenu->insertSeparator (); m_itemmenu->insertSeparator ();
m_find->plug (m_itemmenu); m_tqfind->plug (m_itemmenu);
m_find_next->plug (m_itemmenu); m_find_next->plug (m_itemmenu);
emit prepareMenu (item, m_itemmenu); emit prepareMenu (item, m_itemmenu);
m_itemmenu->exec (p); m_itemmenu->exec (p);
@ -377,7 +377,7 @@ KDE_NO_EXPORT void PlayListView::contextMenuItem (QListViewItem * vi, const QPoi
m_view->controlPanel ()->popupMenu ()->exec (p); m_view->controlPanel ()->popupMenu ()->exec (p);
} }
void PlayListView::itemExpanded (QListViewItem * item) { void PlayListView::itemExpanded (TQListViewItem * item) {
if (!m_ignore_expanded && item->childCount () == 1) { if (!m_ignore_expanded && item->childCount () == 1) {
PlayListItem * child_item = static_cast<PlayListItem*>(item->firstChild ()); PlayListItem * child_item = static_cast<PlayListItem*>(item->firstChild ());
child_item->setOpen (rootItem (item)->show_all_nodes || child_item->setOpen (rootItem (item)->show_all_nodes ||
@ -385,11 +385,11 @@ void PlayListView::itemExpanded (QListViewItem * item) {
} }
} }
RootPlayListItem * PlayListView::rootItem (QListViewItem * item) const { RootPlayListItem * PlayListView::rootItem (TQListViewItem * item) const {
if (!item) if (!item)
return 0L; return 0L;
while (item->parent ()) while (item->tqparent ())
item = item->parent (); item = item->tqparent ();
return static_cast <RootPlayListItem *> (item); return static_cast <RootPlayListItem *> (item);
} }
@ -404,20 +404,20 @@ RootPlayListItem * PlayListView::rootItem (int id) const {
void PlayListView::copyToClipboard () { void PlayListView::copyToClipboard () {
PlayListItem * item = currentPlayListItem (); PlayListItem * item = currentPlayListItem ();
QString text = item->text (0); TQString text = item->text (0);
if (item->node) { if (item->node) {
Mrl * mrl = item->node->mrl (); Mrl * mrl = item->node->mrl ();
if (mrl && !mrl->src.isEmpty ()) if (mrl && !mrl->src.isEmpty ())
text = mrl->src; text = mrl->src;
} }
QApplication::clipboard()->setText (text); TQApplication::tqclipboard()->setText (text);
} }
void PlayListView::addBookMark () { void PlayListView::addBookMark () {
PlayListItem * item = currentPlayListItem (); PlayListItem * item = currentPlayListItem ();
if (item->node) { if (item->node) {
Mrl * mrl = item->node->mrl (); Mrl * mrl = item->node->mrl ();
KURL url (mrl ? mrl->src : QString (item->node->nodeName ())); KURL url (mrl ? mrl->src : TQString (item->node->nodeName ()));
emit addBookMark (mrl->pretty_name.isEmpty () ? url.prettyURL () : mrl->pretty_name, url.url ()); emit addBookMark (mrl->pretty_name.isEmpty () ? url.prettyURL () : mrl->pretty_name, url.url ());
} }
} }
@ -445,8 +445,8 @@ KDE_NO_EXPORT void PlayListView::showAllNodes(RootPlayListItem *ri, bool show) {
} }
} }
KDE_NO_EXPORT bool PlayListView::acceptDrag (QDropEvent * de) const { KDE_NO_EXPORT bool PlayListView::acceptDrag (TQDropEvent * de) const {
QListViewItem * item = itemAt (contentsToViewport (de->pos ())); TQListViewItem * item = itemAt (contentsToViewport (de->pos ()));
if (item && (de->source () == this || isDragValid (de))) { if (item && (de->source () == this || isDragValid (de))) {
RootPlayListItem * ritem = rootItem (item); RootPlayListItem * ritem = rootItem (item);
return ritem->flags & AllowDrops; return ritem->flags & AllowDrops;
@ -454,11 +454,11 @@ KDE_NO_EXPORT bool PlayListView::acceptDrag (QDropEvent * de) const {
return false; return false;
} }
KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *after) { KDE_NO_EXPORT void PlayListView::itemDropped (TQDropEvent * de, TQListViewItem *after) {
if (!after) { // could still be a descendent if (!after) { // could still be a descendent
after = itemAt (contentsToViewport (de->pos ())); after = itemAt (contentsToViewport (de->pos ()));
if (after) if (after)
after = after->parent (); after = after->tqparent ();
} }
if (after) { if (after) {
RootPlayListItem * ritem = rootItem (after); RootPlayListItem * ritem = rootItem (after);
@ -469,9 +469,9 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
KURL::List sl; KURL::List sl;
if (KURLDrag::canDecode (de)) { if (KURLDrag::canDecode (de)) {
KURLDrag::decode (de, sl); KURLDrag::decode (de, sl);
} else if (QTextDrag::canDecode (de)) { } else if (TQTextDrag::canDecode (de)) {
QString text; TQString text;
QTextDrag::decode (de, text); TQTextDrag::decode (de, text);
sl.push_back (KURL (text)); sl.push_back (KURL (text));
} }
if (valid && sl.size () > 0) { if (valid && sl.size () > 0) {
@ -482,7 +482,7 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
if (as_child) if (as_child)
n->insertBefore (ni, n->firstChild ()); n->insertBefore (ni, n->firstChild ());
else else
n->parentNode ()->insertBefore (ni, n->nextSibling ()); n->tqparentNode ()->insertBefore (ni, n->nextSibling ());
} }
PlayListItem * citem = currentPlayListItem (); PlayListItem * citem = currentPlayListItem ();
NodePtr cn; NodePtr cn;
@ -494,7 +494,7 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
m_view->dropEvent (de); m_view->dropEvent (de);
} }
KDE_NO_EXPORT void PlayListView::itemIsRenamed (QListViewItem * qitem) { KDE_NO_EXPORT void PlayListView::itemIsRenamed (TQListViewItem * qitem) {
PlayListItem * item = static_cast <PlayListItem *> (qitem); PlayListItem * item = static_cast <PlayListItem *> (qitem);
if (item->node) { if (item->node) {
RootPlayListItem * ri = rootItem (qitem); RootPlayListItem * ri = rootItem (qitem);
@ -505,30 +505,30 @@ KDE_NO_EXPORT void PlayListView::itemIsRenamed (QListViewItem * qitem) {
} else // restore damage .. } else // restore damage ..
updateTree (ri, item->node, true); updateTree (ri, item->node, true);
} else if (item->m_attr) { } else if (item->m_attr) {
QString txt = item->text (0); TQString txt = item->text (0);
int pos = txt.find (QChar ('=')); int pos = txt.tqfind (TQChar ('='));
if (pos > -1) { if (pos > -1) {
item->m_attr->setName (txt.left (pos)); item->m_attr->setName (txt.left (pos));
item->m_attr->setValue (txt.mid (pos + 1)); item->m_attr->setValue (txt.mid (pos + 1));
} else { } else {
item->m_attr->setName (txt); item->m_attr->setName (txt);
item->m_attr->setValue (QString ("")); item->m_attr->setValue (TQString (""));
} }
PlayListItem * pi = static_cast <PlayListItem *> (item->parent ()); PlayListItem * pi = static_cast <PlayListItem *> (item->tqparent ());
if (pi && pi->node) if (pi && pi->node)
pi->node->document ()->m_tree_version++; pi->node->document ()->m_tree_version++;
} }
} }
KDE_NO_EXPORT void PlayListView::itemIsSelected (QListViewItem * qitem) { KDE_NO_EXPORT void PlayListView::itemIsSelected (TQListViewItem * qitem) {
RootPlayListItem * ri = rootItem (qitem); RootPlayListItem * ri = rootItem (qitem);
setItemsRenameable (ri && (ri->flags & TreeEdit) && ri != qitem); setItemsRenameable (ri && (ri->flags & TreeEdit) && ri != qitem);
} }
KDE_NO_EXPORT void PlayListView::rename (QListViewItem * qitem, int c) { KDE_NO_EXPORT void PlayListView::rename (TQListViewItem * qitem, int c) {
PlayListItem * item = static_cast <PlayListItem *> (qitem); PlayListItem * item = static_cast <PlayListItem *> (qitem);
if (rootItem (qitem)->show_all_nodes && item && item->m_attr) { if (rootItem (qitem)->show_all_nodes && item && item->m_attr) {
PlayListItem * pi = static_cast <PlayListItem *> (qitem->parent ()); PlayListItem * pi = static_cast <PlayListItem *> (qitem->tqparent ());
if (pi && pi->node && pi->node->isEditable ()) if (pi && pi->node && pi->node->isEditable ())
KListView::rename (item, c); KListView::rename (item, c);
} else if (item && item->node && item->node->isEditable ()) { } else if (item && item->node && item->node->isEditable ()) {
@ -542,7 +542,7 @@ KDE_NO_EXPORT void PlayListView::rename (QListViewItem * qitem, int c) {
} }
KDE_NO_EXPORT void PlayListView::editCurrent () { KDE_NO_EXPORT void PlayListView::editCurrent () {
QListViewItem * qitem = selectedItem (); TQListViewItem * qitem = selectedItem ();
if (qitem) { if (qitem) {
RootPlayListItem * ri = rootItem (qitem); RootPlayListItem * ri = rootItem (qitem);
if (ri && (ri->flags & TreeEdit) && ri != qitem) if (ri && (ri->flags & TreeEdit) && ri != qitem)
@ -553,24 +553,24 @@ KDE_NO_EXPORT void PlayListView::editCurrent () {
KDE_NO_EXPORT void PlayListView::slotFind () { KDE_NO_EXPORT void PlayListView::slotFind () {
m_current_find_elm = 0L; m_current_find_elm = 0L;
if (!m_find_dialog) { if (!m_find_dialog) {
m_find_dialog = new KFindDialog (false, this, "kde_kmplayer_find", KFindDialog::CaseSensitive); m_find_dialog = new KFindDialog (false, this, "kde_kmplayer_tqfind", KFindDialog::CaseSensitive);
m_find_dialog->setHasSelection (false); m_find_dialog->setHasSelection (false);
connect(m_find_dialog, SIGNAL(okClicked ()), this, SLOT(slotFindOk ())); connect(m_find_dialog, TQT_SIGNAL(okClicked ()), this, TQT_SLOT(slotFindOk ()));
} else } else
m_find_dialog->setPattern (QString ()); m_find_dialog->setPattern (TQString ());
m_find_dialog->show (); m_find_dialog->show ();
} }
static QListViewItem * findNodeInTree (NodePtr n, QListViewItem * item) { static TQListViewItem * findNodeInTree (NodePtr n, TQListViewItem * item) {
//kdDebug () << "item:" << item->text (0) << " n:" << (n ? n->nodeName () : "null" ) <<endl; //kdDebug () << "item:" << item->text (0) << " n:" << (n ? n->nodeName () : "null" ) <<endl;
PlayListItem * pi = static_cast <PlayListItem *> (item); PlayListItem * pi = static_cast <PlayListItem *> (item);
if (!n || !pi->node) if (!n || !pi->node)
return 0L; return 0L;
if (n == pi->node) if (n == pi->node)
return item; return item;
for (QListViewItem * ci = item->firstChild(); ci; ci = ci->nextSibling ()) { for (TQListViewItem * ci = item->firstChild(); ci; ci = ci->nextSibling ()) {
//kdDebug () << "ci:" << ci->text (0) << " n:" << n->nodeName () <<endl; //kdDebug () << "ci:" << ci->text (0) << " n:" << n->nodeName () <<endl;
QListViewItem * vi = findNodeInTree (n, ci); TQListViewItem * vi = findNodeInTree (n, ci);
if (vi) if (vi)
return vi; return vi;
} }
@ -590,7 +590,7 @@ KDE_NO_EXPORT void PlayListView::slotFindOk () {
m_current_find_elm = lvi->node; m_current_find_elm = lvi->node;
current_find_tree_id = rootItem (lvi)->id; current_find_tree_id = rootItem (lvi)->id;
} else if (lvi && lvi->m_attr) { } else if (lvi && lvi->m_attr) {
PlayListItem*pi=static_cast<PlayListItem*>(currentItem()->parent()); PlayListItem*pi=static_cast<PlayListItem*>(currentItem()->tqparent());
if (pi) { if (pi) {
m_current_find_attr = lvi->m_attr; m_current_find_attr = lvi->m_attr;
m_current_find_elm = pi->node; m_current_find_elm = pi->node;
@ -607,17 +607,17 @@ KDE_NO_EXPORT void PlayListView::slotFindOk () {
slotFindNext (); slotFindNext ();
} }
/* A bit tricky, but between the find's PlayListItems might be gone, so /* A bit tricky, but between the tqfind's PlayListItems might be gone, so
* try to match on the generated tree following the source's document tree * try to match on the generated tree following the source's document tree
*/ */
KDE_NO_EXPORT void PlayListView::slotFindNext () { KDE_NO_EXPORT void PlayListView::slotFindNext () {
if (!m_find_dialog) if (!m_find_dialog)
return; return;
QString str = m_find_dialog->pattern(); TQString str = m_find_dialog->pattern();
if (!m_current_find_elm || str.isEmpty ()) if (!m_current_find_elm || str.isEmpty ())
return; return;
long opt = m_find_dialog->options (); long opt = m_find_dialog->options ();
QRegExp regexp; TQRegExp regexp;
if (opt & KFindDialog::RegularExpression) if (opt & KFindDialog::RegularExpression)
regexp = str; regexp = str;
bool cs = (opt & KFindDialog::CaseSensitive); bool cs = (opt & KFindDialog::CaseSensitive);
@ -627,7 +627,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
while (!found && n) { while (!found && n) {
if (ri->show_all_nodes || n->expose ()) { if (ri->show_all_nodes || n->expose ()) {
bool elm = n->isElementNode (); bool elm = n->isElementNode ();
QString val = n->nodeName (); TQString val = n->nodeName ();
if (elm && !ri->show_all_nodes) { if (elm && !ri->show_all_nodes) {
Mrl * mrl = n->mrl (); Mrl * mrl = n->mrl ();
if (mrl) { if (mrl) {
@ -640,19 +640,19 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (!elm) } else if (!elm)
val = n->nodeValue (); val = n->nodeValue ();
if (((opt & KFindDialog::RegularExpression) && if (((opt & KFindDialog::RegularExpression) &&
val.find (regexp, 0) > -1) || val.tqfind (regexp, 0) > -1) ||
(!(opt & KFindDialog::RegularExpression) && (!(opt & KFindDialog::RegularExpression) &&
val.find (str, 0, cs) > -1)) { val.tqfind (str, 0, cs) > -1)) {
node = n; node = n;
m_current_find_attr = 0L; m_current_find_attr = 0L;
found = true; found = true;
} else if (elm && ri->show_all_nodes) { } else if (elm && ri->show_all_nodes) {
for (AttributePtr a = convertNode <Element> (n)->attributes ()->first (); a; a = a->nextSibling ()) { for (AttributePtr a = convertNode <Element> (n)->attributes ()->first (); a; a = a->nextSibling ()) {
QString attr = a->name ().toString (); TQString attr = a->name ().toString ();
if (((opt & KFindDialog::RegularExpression) && if (((opt & KFindDialog::RegularExpression) &&
(attr.find (regexp, 0) || a->value ().find (regexp, 0) > -1)) || (attr.tqfind (regexp, 0) || a->value ().tqfind (regexp, 0) > -1)) ||
(!(opt & KFindDialog::RegularExpression) && (!(opt & KFindDialog::RegularExpression) &&
(attr.find (str, 0, cs) > -1 || a->value ().find (str, 0, cs) > -1))) { (attr.tqfind (str, 0, cs) > -1 || a->value ().tqfind (str, 0, cs) > -1))) {
node = n; node = n;
m_current_find_attr = a; m_current_find_attr = a;
found = true; found = true;
@ -668,7 +668,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (n->previousSibling ()) { } else if (n->previousSibling ()) {
n = n->previousSibling (); n = n->previousSibling ();
} else { } else {
for (n = n->parentNode (); n; n = n->parentNode ()) for (n = n->tqparentNode (); n; n = n->tqparentNode ())
if (n->previousSibling ()) { if (n->previousSibling ()) {
n = n->previousSibling (); n = n->previousSibling ();
break; break;
@ -685,7 +685,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (n->nextSibling ()) { } else if (n->nextSibling ()) {
n = n->nextSibling (); n = n->nextSibling ();
} else { } else {
for (n = n->parentNode (); n; n = n->parentNode ()) for (n = n->tqparentNode (); n; n = n->tqparentNode ())
if (n->nextSibling ()) { if (n->nextSibling ()) {
n = n->nextSibling (); n = n->nextSibling ();
break; break;
@ -703,7 +703,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
m_current_find_elm = n; m_current_find_elm = n;
kdDebug () << " search for " << str << "=" << (node ? node->nodeName () : "not found") << " next:" << (n ? n->nodeName () : " not found") << endl; kdDebug () << " search for " << str << "=" << (node ? node->nodeName () : "not found") << " next:" << (n ? n->nodeName () : " not found") << endl;
if (found) { if (found) {
QListViewItem * fc = findNodeInTree (node, ri); TQListViewItem * fc = findNodeInTree (node, ri);
if (!fc) { if (!fc) {
m_current_find_elm = 0L; m_current_find_elm = 0L;
kdDebug () << "node not found in tree tree:" << ri->id << endl; kdDebug () << "node not found in tree tree:" << ri->id << endl;

@ -27,30 +27,30 @@
#include "kmplayerplaylist.h" #include "kmplayerplaylist.h"
class QFont; class TQFont;
class QPixmap; class TQPixmap;
class QPainter; class TQPainter;
class QPopupMenu; class TQPopupMenu;
class QDropEvent; class TQDropEvent;
namespace KMPlayer { namespace KMPlayer {
class View; class View;
class PlayListView; class PlayListView;
bool isDragValid (QDropEvent * de) KMPLAYER_NO_MBR_EXPORT; bool isDragValid (TQDropEvent * de) KMPLAYER_NO_MBR_EXPORT;
/* /*
* An item in the playlist * An item in the playlist
*/ */
class KMPLAYER_NO_EXPORT PlayListItem : public QListViewItem { class KMPLAYER_NO_EXPORT PlayListItem : public TQListViewItem {
public: public:
PlayListItem (QListViewItem *p, const NodePtr & e, PlayListView * lv); PlayListItem (TQListViewItem *p, const NodePtr & e, PlayListView * lv);
PlayListItem (QListViewItem *p, const AttributePtr & e, PlayListView * lv); PlayListItem (TQListViewItem *p, const AttributePtr & e, PlayListView * lv);
PlayListItem (PlayListView *v, const NodePtr & d, QListViewItem * b); PlayListItem (PlayListView *v, const NodePtr & d, TQListViewItem * b);
KDE_NO_CDTOR_EXPORT ~PlayListItem () {} KDE_NO_CDTOR_EXPORT ~PlayListItem () {}
void paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align); void paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align);
void paintBranches(QPainter *p, const QColorGroup &cg, int w, int y, int h); void paintBranches(TQPainter *p, const TQColorGroup &cg, int w, int y, int h);
PlayListView * playListView () const; PlayListView * playListView () const;
NodePtrW node; NodePtrW node;
AttributePtrW m_attr; AttributePtrW m_attr;
@ -61,11 +61,11 @@ protected:
class KMPLAYER_NO_EXPORT RootPlayListItem : public PlayListItem { class KMPLAYER_NO_EXPORT RootPlayListItem : public PlayListItem {
public: public:
RootPlayListItem (int id, PlayListView *v, const NodePtr & d, QListViewItem * b, int flags); RootPlayListItem (int id, PlayListView *v, const NodePtr & d, TQListViewItem * b, int flags);
KDE_NO_CDTOR_EXPORT ~RootPlayListItem () {} KDE_NO_CDTOR_EXPORT ~RootPlayListItem () {}
void paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align); void paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align);
QString source; TQString source;
QString icon; TQString icon;
int id; int id;
int flags; int flags;
bool show_all_nodes; bool show_all_nodes;
@ -77,45 +77,46 @@ public:
*/ */
class KMPLAYER_EXPORT PlayListView : public KListView { class KMPLAYER_EXPORT PlayListView : public KListView {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
enum Flags { enum Flags {
AllowDrops = 0x01, AllowDrag = 0x02, AllowDrops = 0x01, AllowDrag = 0x02,
InPlaceEdit = 0x04, TreeEdit = 0x08, InPlaceEdit = 0x04, TreeEdit = 0x08,
Moveable = 0x10, Deleteable = 0x20 Moveable = 0x10, Deleteable = 0x20
}; };
PlayListView (QWidget * parent, View * view, KActionCollection * ac); PlayListView (TQWidget * tqparent, View * view, KActionCollection * ac);
~PlayListView (); ~PlayListView ();
void selectItem (const QString & txt); void selectItem (const TQString & txt);
void showAllNodes (RootPlayListItem *, bool show=true); void showAllNodes (RootPlayListItem *, bool show=true);
void setActiveForegroundColor (const QColor & c) { m_active_color = c; } void setActiveForegroundColor (const TQColor & c) { m_active_color = c; }
const QColor & activeColor () const { return m_active_color; } const TQColor & activeColor () const { return m_active_color; }
int addTree (NodePtr r, const QString & src, const QString & ico, int flgs); int addTree (NodePtr r, const TQString & src, const TQString & ico, int flgs);
RootPlayListItem * rootItem (QListViewItem * item) const; RootPlayListItem * rootItem (TQListViewItem * item) const;
RootPlayListItem * rootItem (int id) const; RootPlayListItem * rootItem (int id) const;
void setFont (const QFont &); void setFont (const TQFont &);
PlayListItem * currentPlayListItem () const; PlayListItem * currentPlayListItem () const;
PlayListItem * selectedPlayListItem () const; PlayListItem * selectedPlayListItem () const;
NodePtr lastDragNode () const { return m_last_drag; } NodePtr lastDragNode () const { return m_last_drag; }
int lastDragTreeId () const { return last_drag_tree_id; } int lastDragTreeId () const { return last_drag_tree_id; }
signals: signals:
void addBookMark (const QString & title, const QString & url); void addBookMark (const TQString & title, const TQString & url);
void prepareMenu (KMPlayer::PlayListItem * item, QPopupMenu * menu); void prepareMenu (KMPlayer::PlayListItem * item, TQPopupMenu * menu);
protected: protected:
bool acceptDrag (QDropEvent* event) const; bool acceptDrag (TQDropEvent* event) const;
QDragObject * dragObject (); TQDragObject * dragObject ();
public slots: public slots:
void editCurrent (); void editCurrent ();
void rename (QListViewItem * item, int c); void rename (TQListViewItem * item, int c);
void updateTree (int id, NodePtr root, NodePtr active, bool sel, bool open); void updateTree (int id, NodePtr root, NodePtr active, bool sel, bool open);
private slots: private slots:
void contextMenuItem (QListViewItem *, const QPoint &, int); void contextMenuItem (TQListViewItem *, const TQPoint &, int);
void itemExpanded (QListViewItem *); void itemExpanded (TQListViewItem *);
void copyToClipboard (); void copyToClipboard ();
void addBookMark (); void addBookMark ();
void toggleShowAllNodes (); void toggleShowAllNodes ();
void itemDropped (QDropEvent * e, QListViewItem * after); void itemDropped (TQDropEvent * e, TQListViewItem * after);
void itemIsRenamed (QListViewItem * item); void itemIsRenamed (TQListViewItem * item);
void itemIsSelected (QListViewItem * item); void itemIsSelected (TQListViewItem * item);
void updateTrees (); void updateTrees ();
void slotFind (); void slotFind ();
void slotFindOk (); void slotFindOk ();
@ -134,20 +135,20 @@ private:
}; };
SharedPtr <TreeUpdate> tree_update; SharedPtr <TreeUpdate> tree_update;
View * m_view; View * m_view;
QPopupMenu * m_itemmenu; TQPopupMenu * m_itemmenu;
KAction * m_find; KAction * m_tqfind;
KAction * m_find_next; KAction * m_find_next;
KFindDialog * m_find_dialog; KFindDialog * m_find_dialog;
QPixmap folder_pix; TQPixmap folder_pix;
QPixmap auxiliary_pix; TQPixmap auxiliary_pix;
QPixmap video_pix; TQPixmap video_pix;
QPixmap unknown_pix; TQPixmap unknown_pix;
QPixmap menu_pix; TQPixmap menu_pix;
QPixmap config_pix; TQPixmap config_pix;
QPixmap url_pix; TQPixmap url_pix;
QPixmap info_pix; TQPixmap info_pix;
QPixmap img_pix; TQPixmap img_pix;
QColor m_active_color; TQColor m_active_color;
NodePtrW m_current_find_elm; NodePtrW m_current_find_elm;
NodePtrW m_last_drag; NodePtrW m_last_drag;
AttributePtrW m_current_find_attr; AttributePtrW m_current_find_attr;

File diff suppressed because it is too large Load Diff

@ -24,20 +24,20 @@
#include "kmplayer_def.h" #include "kmplayer_def.h"
#include <kdialogbase.h> #include <kdialogbase.h>
#include <qframe.h> #include <tqframe.h>
#include <qmap.h> #include <tqmap.h>
class QTabWidget; class TQTabWidget;
class QTable; class TQTable;
class QGroupBox; class TQGroupBox;
class QCheckBox; class TQCheckBox;
class QComboBox; class TQComboBox;
class QLineEdit; class TQLineEdit;
class QRadioButton; class TQRadioButton;
class QSlider; class TQSlider;
class QSpinBox; class TQSpinBox;
class QColor; class TQColor;
class QButtonGroup; class TQButtonGroup;
class KHistoryCombo; class KHistoryCombo;
class KComboBox; class KComboBox;
class KURLRequester; class KURLRequester;
@ -68,6 +68,7 @@ class FontSetting;
class KMPLAYER_NO_EXPORT Preferences : public KDialogBase class KMPLAYER_NO_EXPORT Preferences : public KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Preferences(PartBase *, Settings *); Preferences(PartBase *, Settings *);
@ -92,46 +93,48 @@ public:
void removePrefPage (PreferencesPage *); void removePrefPage (PreferencesPage *);
RecorderPage * recorders; RecorderPage * recorders;
QMap<QString, QTabWidget *> entries; TQMap<TQString, TQTabWidget *> entries;
public slots: public slots:
void confirmDefaults(); void confirmDefaults();
}; };
class KMPLAYER_NO_EXPORT PrefGeneralPageGeneral : public QFrame class KMPLAYER_NO_EXPORT PrefGeneralPageGeneral : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefGeneralPageGeneral(QWidget *parent, Settings *); PrefGeneralPageGeneral(TQWidget *tqparent, Settings *);
~PrefGeneralPageGeneral() {} ~PrefGeneralPageGeneral() {}
QCheckBox *keepSizeRatio; TQCheckBox *keepSizeRatio;
QCheckBox * autoResize; TQCheckBox * autoResize;
QButtonGroup *sizesChoice; TQButtonGroup *sizesChoice;
QCheckBox *dockSysTray; TQCheckBox *dockSysTray;
QCheckBox *loop; TQCheckBox *loop;
QCheckBox *showConfigButton; TQCheckBox *showConfigButton;
QCheckBox *showPlaylistButton; TQCheckBox *showPlaylistButton;
QCheckBox *showRecordButton; TQCheckBox *showRecordButton;
QCheckBox *showBroadcastButton; TQCheckBox *showBroadcastButton;
QCheckBox *framedrop; TQCheckBox *framedrop;
QCheckBox *adjustvolume; TQCheckBox *adjustvolume;
QCheckBox *adjustcolors; TQCheckBox *adjustcolors;
QSpinBox *seekTime; TQSpinBox *seekTime;
}; };
class KMPLAYER_NO_EXPORT PrefGeneralPageLooks : public QFrame { class KMPLAYER_NO_EXPORT PrefGeneralPageLooks : public TQFrame {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefGeneralPageLooks (QWidget *parent, Settings *); PrefGeneralPageLooks (TQWidget *tqparent, Settings *);
~PrefGeneralPageLooks () {} ~PrefGeneralPageLooks () {}
QComboBox *colorscombo; TQComboBox *colorscombo;
KColorButton *colorbutton; KColorButton *colorbutton;
QComboBox *fontscombo; TQComboBox *fontscombo;
QPushButton *fontbutton; TQPushButton *fontbutton;
public slots: public slots:
void colorItemChanged (int); void colorItemChanged (int);
void colorCanged (const QColor &); void colorCanged (const TQColor &);
void fontItemChanged (int); void fontItemChanged (int);
void fontClicked (); void fontClicked ();
private: private:
@ -139,11 +142,12 @@ private:
FontSetting * fonts; FontSetting * fonts;
}; };
class KMPLAYER_NO_EXPORT PrefSourcePageURL : public QFrame class KMPLAYER_NO_EXPORT PrefSourcePageURL : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefSourcePageURL (QWidget *parent); PrefSourcePageURL (TQWidget *tqparent);
~PrefSourcePageURL () {} ~PrefSourcePageURL () {}
KURLRequester * url; KURLRequester * url;
@ -151,29 +155,30 @@ public:
KComboBox * urllist; KComboBox * urllist;
KURLRequester * sub_url; KURLRequester * sub_url;
KComboBox * sub_urllist; KComboBox * sub_urllist;
QListBox * backend; TQListBox * backend;
QCheckBox * allowhref; TQCheckBox * allowhref;
QLineEdit * prefBitRate; TQLineEdit * prefBitRate;
QLineEdit * maxBitRate; TQLineEdit * maxBitRate;
bool changed; bool changed;
private slots: private slots:
void slotBrowse (); void slotBrowse ();
void slotTextChanged (const QString &); void slotTextChanged (const TQString &);
}; };
class KMPLAYER_NO_EXPORT PrefRecordPage : public QFrame class KMPLAYER_NO_EXPORT PrefRecordPage : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefRecordPage (QWidget *parent, PartBase *, RecorderPage *, int len); PrefRecordPage (TQWidget *tqparent, PartBase *, RecorderPage *, int len);
~PrefRecordPage () {} ~PrefRecordPage () {}
KURLRequester * url; KURLRequester * url;
QButtonGroup * recorder; TQButtonGroup * recorder;
QButtonGroup * replay; TQButtonGroup * replay;
QLineEdit * replaytime; TQLineEdit * replaytime;
QLabel * source; TQLabel * source;
public slots: public slots:
void replayClicked (int id); void replayClicked (int id);
void recorderClicked (int id); void recorderClicked (int id);
@ -186,18 +191,19 @@ private slots:
private: private:
PartBase * m_player; PartBase * m_player;
RecorderPage * m_recorders; RecorderPage * m_recorders;
QPushButton * recordButton; TQPushButton * recordButton;
int m_recorders_length; int m_recorders_length;
}; };
class KMPLAYER_NO_EXPORT RecorderPage : public QFrame class KMPLAYER_NO_EXPORT RecorderPage : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
RecorderPage (QWidget *parent, PartBase *); RecorderPage (TQWidget *tqparent, PartBase *);
virtual ~RecorderPage () {}; virtual ~RecorderPage () {};
virtual void record (); virtual void record ();
virtual QString name () = 0; virtual TQString name () = 0;
virtual const char * recorderName () = 0; virtual const char * recorderName () = 0;
RecorderPage * next; RecorderPage * next;
protected: protected:
@ -207,16 +213,17 @@ protected:
class KMPLAYER_NO_EXPORT PrefMEncoderPage : public RecorderPage class KMPLAYER_NO_EXPORT PrefMEncoderPage : public RecorderPage
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefMEncoderPage (QWidget *parent, PartBase *); PrefMEncoderPage (TQWidget *tqparent, PartBase *);
~PrefMEncoderPage () {} ~PrefMEncoderPage () {}
void record (); void record ();
QString name (); TQString name ();
const char * recorderName () { return "mencoder"; } const char * recorderName () { return "mencoder"; }
QLineEdit * arguments; TQLineEdit * arguments;
QButtonGroup * format; TQButtonGroup * format;
public slots: public slots:
void formatClicked (int id); void formatClicked (int id);
private: private:
@ -224,20 +231,20 @@ private:
class KMPLAYER_NO_EXPORT PrefMPlayerDumpstreamPage : public RecorderPage { class KMPLAYER_NO_EXPORT PrefMPlayerDumpstreamPage : public RecorderPage {
public: public:
PrefMPlayerDumpstreamPage (QWidget *parent, PartBase *); PrefMPlayerDumpstreamPage (TQWidget *tqparent, PartBase *);
~PrefMPlayerDumpstreamPage () {} ~PrefMPlayerDumpstreamPage () {}
QString name (); TQString name ();
const char * recorderName () { return "mplayerdumpstream"; } const char * recorderName () { return "mplayerdumpstream"; }
}; };
#ifdef HAVE_XINE #ifdef HAVE_XINE
class KMPLAYER_NO_EXPORT PrefXinePage : public RecorderPage { class KMPLAYER_NO_EXPORT PrefXinePage : public RecorderPage {
public: public:
PrefXinePage (QWidget *parent, PartBase *); PrefXinePage (TQWidget *tqparent, PartBase *);
~PrefXinePage () {} ~PrefXinePage () {}
QString name (); TQString name ();
const char * recorderName () { return "xine"; } const char * recorderName () { return "xine"; }
}; };
#endif #endif
@ -245,74 +252,78 @@ public:
class KMPLAYER_NO_EXPORT PrefFFMpegPage : public RecorderPage class KMPLAYER_NO_EXPORT PrefFFMpegPage : public RecorderPage
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefFFMpegPage (QWidget *parent, PartBase *); PrefFFMpegPage (TQWidget *tqparent, PartBase *);
~PrefFFMpegPage () {} ~PrefFFMpegPage () {}
void record (); void record ();
QString name (); TQString name ();
const char * recorderName () { return "ffmpeg"; } const char * recorderName () { return "ffmpeg"; }
QLineEdit * arguments; TQLineEdit * arguments;
QButtonGroup * format; TQButtonGroup * format;
private: private:
}; };
class KMPLAYER_NO_EXPORT PrefGeneralPageOutput : public QFrame class KMPLAYER_NO_EXPORT PrefGeneralPageOutput : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefGeneralPageOutput (QWidget *parent, OutputDriver * ad, OutputDriver * vd); PrefGeneralPageOutput (TQWidget *tqparent, OutputDriver * ad, OutputDriver * vd);
~PrefGeneralPageOutput() {} ~PrefGeneralPageOutput() {}
QListBox *videoDriver; TQListBox *videoDriver;
QListBox *audioDriver; TQListBox *audioDriver;
}; };
class KMPLAYER_NO_EXPORT PrefOPPageGeneral : public QFrame class KMPLAYER_NO_EXPORT PrefOPPageGeneral : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefOPPageGeneral(QWidget *parent = 0); PrefOPPageGeneral(TQWidget *tqparent = 0);
~PrefOPPageGeneral() {} ~PrefOPPageGeneral() {}
}; };
class KMPLAYER_NO_EXPORT PrefOPPagePostProc : public QFrame class KMPLAYER_NO_EXPORT PrefOPPagePostProc : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrefOPPagePostProc(QWidget *parent = 0); PrefOPPagePostProc(TQWidget *tqparent = 0);
~PrefOPPagePostProc() {} ~PrefOPPagePostProc() {}
QCheckBox* postProcessing; TQCheckBox* postProcessing;
QCheckBox* disablePPauto; TQCheckBox* disablePPauto;
QTabWidget* PostprocessingOptions; TQTabWidget* PostprocessingOptions;
QRadioButton* defaultPreset; TQRadioButton* defaultPreset;
QRadioButton* customPreset; TQRadioButton* customPreset;
QRadioButton* fastPreset; TQRadioButton* fastPreset;
QCheckBox* HzDeblockFilter; TQCheckBox* HzDeblockFilter;
QCheckBox* VtDeblockFilter; TQCheckBox* VtDeblockFilter;
QCheckBox* DeringFilter; TQCheckBox* DeringFilter;
QCheckBox* HzDeblockAQuality; TQCheckBox* HzDeblockAQuality;
QCheckBox* VtDeblockAQuality; TQCheckBox* VtDeblockAQuality;
QCheckBox* DeringAQuality; TQCheckBox* DeringAQuality;
QCheckBox* AutolevelsFilter; TQCheckBox* AutolevelsFilter;
QCheckBox* AutolevelsFullrange; TQCheckBox* AutolevelsFullrange;
QCheckBox* HzDeblockCFiltering; TQCheckBox* HzDeblockCFiltering;
QCheckBox* VtDeblockCFiltering; TQCheckBox* VtDeblockCFiltering;
QCheckBox* DeringCFiltering; TQCheckBox* DeringCFiltering;
QCheckBox* TmpNoiseFilter; TQCheckBox* TmpNoiseFilter;
QSlider* TmpNoiseSlider; TQSlider* TmpNoiseSlider;
QCheckBox* LinBlendDeinterlacer; TQCheckBox* LinBlendDeinterlacer;
QCheckBox* CubicIntDeinterlacer; TQCheckBox* CubicIntDeinterlacer;
QCheckBox* LinIntDeinterlacer; TQCheckBox* LinIntDeinterlacer;
QCheckBox* MedianDeinterlacer; TQCheckBox* MedianDeinterlacer;
QCheckBox* FfmpegDeinterlacer; TQCheckBox* FfmpegDeinterlacer;
}; };
} // namespace } // namespace

@ -40,13 +40,13 @@ struct KMPLAYER_NO_EXPORT TrieNode {
void unref (); void unref ();
void removeChild (TrieNode *); void removeChild (TrieNode *);
void dump (int lvl) { void dump (int lvl) {
QString indent (QString ().fill (QChar ('.'), lvl)); TQString indent (TQString ().fill (TQChar ('.'), lvl));
printf("%s%s len:%4d rc:%4d\n", indent.ascii(), str, length, ref_count); printf("%s%s len:%4d rc:%4d\n", indent.ascii(), str, length, ref_count);
} }
char * str; char * str;
unsigned short length; unsigned short length;
unsigned short ref_count; unsigned short ref_count;
TrieNode * parent; TrieNode * tqparent;
TrieNode * first_child; TrieNode * first_child;
TrieNode * next_sibling; TrieNode * next_sibling;
}; };
@ -70,7 +70,7 @@ KDE_NO_CDTOR_EXPORT TrieNode::TrieNode (const char * s)
: str (s ? strdup (s) : 0L), : str (s ? strdup (s) : 0L),
length (s ? strlen (s) : 0), length (s ? strlen (s) : 0),
ref_count (1), ref_count (1),
parent (0L), tqparent (0L),
first_child (0L), first_child (0L),
next_sibling (0L) {} next_sibling (0L) {}
@ -81,7 +81,7 @@ KDE_NO_CDTOR_EXPORT TrieNode::~TrieNode () {
KDE_NO_EXPORT void TrieNode::unref () { KDE_NO_EXPORT void TrieNode::unref () {
if (--ref_count <= 0 && !first_child) if (--ref_count <= 0 && !first_child)
parent->removeChild (this); tqparent->removeChild (this);
} }
KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) { KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) {
@ -95,10 +95,10 @@ KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) {
} }
} }
delete node; delete node;
if (!parent) if (!tqparent)
return; return;
if (!ref_count && !first_child) if (!ref_count && !first_child)
parent->removeChild (this); // can this happen ? tqparent->removeChild (this); // can this happen ?
else if (!ref_count && !first_child->next_sibling) { // merge with child else if (!ref_count && !first_child->next_sibling) { // merge with child
char * tmp = first_child->str; char * tmp = first_child->str;
first_child->length = first_child->length + length; first_child->length = first_child->length + length;
@ -106,12 +106,12 @@ KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) {
strcpy (first_child->str, str); strcpy (first_child->str, str);
strcat (first_child->str, tmp); strcat (first_child->str, tmp);
free (tmp); free (tmp);
first_child->parent = parent; first_child->tqparent = tqparent;
first_child->next_sibling = next_sibling; first_child->next_sibling = next_sibling;
if (parent->first_child == this) { if (tqparent->first_child == this) {
parent->first_child = first_child; tqparent->first_child = first_child;
} else { } else {
for (TrieNode *n = parent->first_child; n; n = n->next_sibling) for (TrieNode *n = tqparent->first_child; n; n = n->next_sibling)
if (n->next_sibling == this) { if (n->next_sibling == this) {
n->next_sibling = first_child; n->next_sibling = first_child;
break; break;
@ -123,9 +123,9 @@ KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) {
static char * trieRetrieveString (TrieNode * node, int &len) { static char * trieRetrieveString (TrieNode * node, int &len) {
char *buf; char *buf;
if (node->parent) { if (node->tqparent) {
len += node->length; len += node->length;
buf = trieRetrieveString (node->parent, len); buf = trieRetrieveString (node->tqparent, len);
strcat (buf, node->str); strcat (buf, node->str);
} else { } else {
buf = (char *) malloc (len + 1); buf = (char *) malloc (len + 1);
@ -138,8 +138,8 @@ static int trieStringCompare (TrieNode * node, const char * s, int &len) {
int cmp = 0; int cmp = 0;
if (!node) if (!node)
return !!s; return !!s;
if (node->parent && node->parent != root_trie) if (node->tqparent && node->tqparent != root_trie)
cmp = trieStringCompare (node->parent, s, len); cmp = trieStringCompare (node->tqparent, s, len);
if (!cmp) { if (!cmp) {
#ifdef TEST_TRIE #ifdef TEST_TRIE
printf( "compare %s %s %d\n", node->str, s + len, node->length); printf( "compare %s %s %d\n", node->str, s + len, node->length);
@ -153,8 +153,8 @@ static int trieStringCompare (TrieNode * node, const char * s, int &len) {
static int trieStringCompare (TrieNode * n1, TrieNode * n2) { static int trieStringCompare (TrieNode * n1, TrieNode * n2) {
// pre n1 && n2 on same depth and not NIL // pre n1 && n2 on same depth and not NIL
int cmp = 0; int cmp = 0;
if (n1->parent && n1->parent != root_trie) if (n1->tqparent && n1->tqparent != root_trie)
cmp = trieStringCompare (n1->parent, n2->parent); cmp = trieStringCompare (n1->tqparent, n2->tqparent);
if (!cmp && n1 != n2) { if (!cmp && n1 != n2) {
#ifdef TEST_TRIE #ifdef TEST_TRIE
printf( "compare %s %s", n1->str, n2->str); printf( "compare %s %s", n1->str, n2->str);
@ -174,8 +174,8 @@ static int trieStringCompare (TrieNode * n1, TrieNode * n2) {
static int trieStringStarts (TrieNode * node, const char * s, int & pos) { static int trieStringStarts (TrieNode * node, const char * s, int & pos) {
int cmp = -1; // -1 still matches, 0 no, 1 yes int cmp = -1; // -1 still matches, 0 no, 1 yes
if (node->parent && node->parent != root_trie) if (node->tqparent && node->tqparent != root_trie)
cmp = trieStringStarts (node->parent, s, pos); cmp = trieStringStarts (node->tqparent, s, pos);
if (cmp == -1) { if (cmp == -1) {
for (int i = 0; i < node->length; i++) for (int i = 0; i < node->length; i++)
if (node->str[i] != s[pos + i]) if (node->str[i] != s[pos + i])
@ -190,8 +190,8 @@ static TrieNode * trieInsert (const char * s) {
root_trie = new TrieNode (0L); root_trie = new TrieNode (0L);
//printf("trieInsert %s\n", s); //printf("trieInsert %s\n", s);
//dumpTrie(); //dumpTrie();
TrieNode * parent = root_trie; TrieNode * tqparent = root_trie;
for (TrieNode * c = parent->first_child; c; c = c->first_child) { for (TrieNode * c = tqparent->first_child; c; c = c->first_child) {
TrieNode * prev = c; TrieNode * prev = c;
for (TrieNode * n = prev; n; n = n->next_sibling) { for (TrieNode * n = prev; n; n = n->next_sibling) {
if (n->str[0] == s[0]) { // insert here if (n->str[0] == s[0]) { // insert here
@ -206,13 +206,13 @@ static TrieNode * trieInsert (const char * s) {
tmp[i] = 0; tmp[i] = 0;
TrieNode * node = new TrieNode (tmp); TrieNode * node = new TrieNode (tmp);
free (tmp); free (tmp);
node->parent = parent; node->tqparent = tqparent;
node->next_sibling = n->next_sibling; node->next_sibling = n->next_sibling;
if (prev != n) if (prev != n)
prev->next_sibling = node; prev->next_sibling = node;
else else
parent->first_child = node; tqparent->first_child = node;
n->parent = node; n->tqparent = node;
TrieNode * snode; TrieNode * snode;
if (!s[i]) { if (!s[i]) {
node->first_child = n; node->first_child = n;
@ -220,7 +220,7 @@ static TrieNode * trieInsert (const char * s) {
snode = node; // s is complete in node snode = node; // s is complete in node
} else { } else {
snode = new TrieNode (s+i); snode = new TrieNode (s+i);
snode->parent = node; snode->tqparent = node;
if (bigger) { // set n before snode if (bigger) { // set n before snode
node->first_child = n; node->first_child = n;
n->next_sibling = snode; n->next_sibling = snode;
@ -244,32 +244,32 @@ static TrieNode * trieInsert (const char * s) {
return n; return n;
} else if (n->str[0] > s[0]) { // insert before } else if (n->str[0] > s[0]) { // insert before
TrieNode * node = new TrieNode (s); TrieNode * node = new TrieNode (s);
node->parent = parent; node->tqparent = tqparent;
node->next_sibling = n; node->next_sibling = n;
if (prev != n) if (prev != n)
prev->next_sibling = node; prev->next_sibling = node;
else else
parent->first_child = node; tqparent->first_child = node;
return node; return node;
} }
prev = n; prev = n;
} }
if (prev) { // insert after if (prev) { // insert after
TrieNode * node = new TrieNode (s); TrieNode * node = new TrieNode (s);
node->parent = parent; node->tqparent = tqparent;
prev->next_sibling = node; prev->next_sibling = node;
return node; return node;
} }
parent = c; tqparent = c;
} }
// hit an empty first_child, add s as first_child // hit an empty first_child, add s as first_child
TrieNode * node = new TrieNode (s); TrieNode * node = new TrieNode (s);
parent->first_child = node; tqparent->first_child = node;
node->parent = parent; node->tqparent = tqparent;
return node; return node;
} }
TrieString::TrieString (const QString & s) TrieString::TrieString (const TQString & s)
: node (s.isEmpty () ? 0L : trieInsert (s.utf8 ().data ())) : node (s.isEmpty () ? 0L : trieInsert (s.utf8 ().data ()))
{} {}
@ -288,7 +288,7 @@ TrieString::~TrieString () {
} }
bool TrieString::startsWith (const TrieString & s) const { bool TrieString::startsWith (const TrieString & s) const {
for (TrieNode * n = node; n; n = n->parent) for (TrieNode * n = node; n; n = n->tqparent)
if (n == s.node) if (n == s.node)
return true; return true;
return s.node ? false : true; return s.node ? false : true;
@ -327,12 +327,12 @@ TrieString & TrieString::operator = (const char * utf8) {
return *this; return *this;
} }
QString TrieString::toString () const { TQString TrieString::toString () const {
QString s; TQString s;
if (node) { if (node) {
int len = 0; int len = 0;
char *utf8 = trieRetrieveString (node, len); char *utf8 = trieRetrieveString (node, len);
s = QString::fromUtf8 (utf8); s = TQString::fromUtf8 (utf8);
free (utf8); free (utf8);
} }
return s; return s;
@ -342,11 +342,11 @@ bool TrieString::operator < (const TrieString & s) const {
if (node == s.node) if (node == s.node)
return false; return false;
int depth1 = 0, depth2 = 0; int depth1 = 0, depth2 = 0;
for (TrieNode * n = node; n; n = n->parent) for (TrieNode * n = node; n; n = n->tqparent)
depth1++; depth1++;
if (!depth1) if (!depth1)
return s.node ? true : false; return s.node ? true : false;
for (TrieNode * n = s.node; n; n = n->parent) for (TrieNode * n = s.node; n; n = n->tqparent)
depth2++; depth2++;
if (!depth2) if (!depth2)
return false; return false;
@ -355,13 +355,13 @@ bool TrieString::operator < (const TrieString & s) const {
while (depth1 > depth2) { while (depth1 > depth2) {
if (n1 == n2) if (n1 == n2)
return false; return false;
n1 = n1->parent; n1 = n1->tqparent;
depth1--; depth1--;
} }
while (depth2 > depth1) { while (depth2 > depth1) {
if (n1 == n2) if (n1 == n2)
return true; return true;
n2 = n2->parent; n2 = n2->tqparent;
depth2--; depth2--;
} }
int cmp = trieStringCompare (n1, n2); int cmp = trieStringCompare (n1, n2);
@ -455,37 +455,37 @@ void KMPlayer::dumpTrie () {
} }
#ifdef TEST_TRIE #ifdef TEST_TRIE
// g++ triestring.cpp -o triestring -I$QTDIR/include -L$QTDIR/lib -lqt-mt -g -DTEST_TRIE // g++ triestring.cpp -o triestring -I$TQTDIR/include -L$TQTDIR/lib -lqt-mt -g -DTEST_TRIE
int main (int, char **) { int main (int, char **) {
StringPool::init(); StringPool::init();
{ {
TrieString s1; TrieString s1;
TrieString s1_1(QString ("region")); TrieString s1_1(TQString ("region"));
s1 = s1_1; s1 = s1_1;
TrieString s2 (QString ("regionName")); TrieString s2 (TQString ("regionName"));
TrieString s3 (QString ("regPoint")); TrieString s3 (TQString ("regPoint"));
TrieString s4 (QString ("regAlign")); TrieString s4 (TQString ("regAlign"));
TrieString s6 (QString ("freeze")); TrieString s6 (TQString ("freeze"));
TrieString s7 (QString ("fit")); TrieString s7 (TQString ("fit"));
{ {
TrieString s7_1 (QString ("fit")); TrieString s7_1 (TQString ("fit"));
TrieString s5 (QString ("fill")); TrieString s5 (TQString ("fill"));
dump (root_trie, 0); dump (root_trie, 0);
} }
dump (root_trie, 0); dump (root_trie, 0);
TrieString s5 (QString ("fill")); TrieString s5 (TQString ("fill"));
TrieString s8 (QString ("fontPtSize")); TrieString s8 (TQString ("fontPtSize"));
TrieString s9 (QString ("fontSize")); TrieString s9 (TQString ("fontSize"));
TrieString s10 (QString ("fontFace")); TrieString s10 (TQString ("fontFace"));
TrieString s11 (QString ("fontColor")); TrieString s11 (TQString ("fontColor"));
TrieString s12 (QString ("hAlign")); TrieString s12 (TQString ("hAlign"));
TrieString s13 (QString ("region")); TrieString s13 (TQString ("region"));
TrieString s14 (QString ("ref")); TrieString s14 (TQString ("ref"));
TrieString s15 (QString ("head")); TrieString s15 (TQString ("head"));
dump (root_trie, 0); dump (root_trie, 0);
QString qs1 = s1.toString (); TQString qs1 = s1.toString ();
QString qs2 = s2.toString (); TQString qs2 = s2.toString ();
printf ("%s\n%s\n", qs1.ascii(), qs2.ascii()); printf ("%s\n%s\n", qs1.ascii(), qs2.ascii());
printf("equal %s %s %d\n", qs2.ascii(), "regionName", s2 == "regionName"); printf("equal %s %s %d\n", qs2.ascii(), "regionName", s2 == "regionName");
printf("equal %s %s %d\n", qs2.ascii(), "zegionName", s2 == "zegionName"); printf("equal %s %s %d\n", qs2.ascii(), "zegionName", s2 == "zegionName");

@ -20,7 +20,7 @@
#ifndef _TRIE_STRING_H_ #ifndef _TRIE_STRING_H_
#define _TRIE_STRING_H_ #define _TRIE_STRING_H_
#include <qstring.h> #include <tqstring.h>
namespace KMPlayer { namespace KMPlayer {
@ -34,12 +34,12 @@ class KMPLAYER_EXPORT TrieString {
friend bool operator != (const TrieString & s1, const TrieString & s2); friend bool operator != (const TrieString & s1, const TrieString & s2);
public: public:
TrieString (); TrieString ();
TrieString (const QString & s); TrieString (const TQString & s);
TrieString (const char * utf8); TrieString (const char * utf8);
TrieString (const TrieString & s); TrieString (const TrieString & s);
~TrieString (); ~TrieString ();
QString toString () const; TQString toString () const;
bool isNull () const; bool isNull () const;
void clear (); void clear ();
bool startsWith (const TrieString & s) const; bool startsWith (const TrieString & s) const;

@ -22,12 +22,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qwidgetstack.h> #include <tqwidgetstack.h>
#include <qslider.h> #include <tqslider.h>
#include <qcursor.h> #include <tqcursor.h>
#include <qimage.h> #include <tqimage.h>
#include <qmap.h> #include <tqmap.h>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kstaticdeleter.h> #include <kstaticdeleter.h>
@ -56,12 +56,12 @@ extern const char * playlist_xpm[];
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
namespace KMPlayer { namespace KMPlayer {
typedef QMap <QString, ImageDataPtrW> ImageDataMap; typedef TQMap <TQString, ImageDataPtrW> ImageDataMap;
static KStaticDeleter <ImageDataMap> imageCacheDeleter; static KStaticDeleter <ImageDataMap> imageCacheDeleter;
static ImageDataMap * image_data_map; static ImageDataMap * image_data_map;
} }
ImageData::ImageData( const QString & img) : ImageData::ImageData( const TQString & img) :
image (0L), image (0L),
url (img) { url (img) {
//if (img.isEmpty ()) //if (img.isEmpty ())
@ -77,12 +77,12 @@ ImageData::~ImageData() {
} }
#ifdef HAVE_CAIRO #ifdef HAVE_CAIRO
static void copyImage (Surface *s, int w, int h, QImage *img, cairo_surface_t *similar) { static void copyImage (Surface *s, int w, int h, TQImage *img, cairo_surface_t *similar) {
int iw = img->width (); int iw = img->width ();
int ih = img->height (); int ih = img->height ();
if (img->depth () < 24) { if (img->depth () < 24) {
QImage qi = img->convertDepth (32, 0); TQImage qi = img->convertDepth (32, 0);
*img = qi; *img = qi;
} }
cairo_surface_t *sf = cairo_image_surface_create_for_data ( cairo_surface_t *sf = cairo_image_surface_create_for_data (
@ -114,11 +114,11 @@ bool CachedImage::isEmpty () {
return !data || !data->image; return !data || !data->image;
} }
void CachedImage::setUrl (const QString & url) { void CachedImage::setUrl (const TQString & url) {
if (url.isEmpty ()) { if (url.isEmpty ()) {
data = ImageDataPtr (new ImageData (url)); data = ImageDataPtr (new ImageData (url));
} else { } else {
ImageDataMap::iterator i = image_data_map->find (url); ImageDataMap::iterator i = image_data_map->tqfind (url);
if (i == image_data_map->end ()) { if (i == image_data_map->end ()) {
data = ImageDataPtr (new ImageData (url)); data = ImageDataPtr (new ImageData (url));
image_data_map->insert (url, ImageDataPtrW (data)); image_data_map->insert (url, ImageDataPtrW (data));
@ -144,8 +144,8 @@ public:
SurfacePtr createSurface (NodePtr owner, const SRect & rect); SurfacePtr createSurface (NodePtr owner, const SRect & rect);
IRect toScreen (Single x, Single y, Single w, Single h); IRect toScreen (Single x, Single y, Single w, Single h);
void resize (const SRect & rect); void resize (const SRect & rect);
void repaint (); void tqrepaint ();
void repaint (const SRect &rect); void tqrepaint (const SRect &rect);
void video (); void video ();
NodePtrW current_video; NodePtrW current_video;
@ -181,14 +181,14 @@ KDE_NO_EXPORT void ViewSurface::resize (const SRect &r) {
#endif #endif
/*if (rect == nrect) /*if (rect == nrect)
;//return; ;//return;
SRect pr = rect.unite (nrect); // for repaint SRect pr = rect.unite (nrect); // for tqrepaint
rect = nrect;*/ rect = nrect;*/
} }
KDE_NO_EXPORT IRect ViewSurface::toScreen (Single x, Single y, Single w, Single h) { KDE_NO_EXPORT IRect ViewSurface::toScreen (Single x, Single y, Single w, Single h) {
Matrix matrix (0, 0, xscale, yscale); Matrix matrix (0, 0, xscale, yscale);
matrix.translate (bounds.x (), bounds.y ()); matrix.translate (bounds.x (), bounds.y ());
for (SurfacePtr s = parentNode(); s; s = s->parentNode()) { for (SurfacePtr s = tqparentNode(); s; s = s->tqparentNode()) {
matrix.transform(Matrix (0, 0, s->xscale, s->yscale)); matrix.transform(Matrix (0, 0, s->xscale, s->yscale));
matrix.translate (s->bounds.x (), s->bounds.y ()); matrix.translate (s->bounds.x (), s->bounds.y ());
} }
@ -197,14 +197,14 @@ KDE_NO_EXPORT IRect ViewSurface::toScreen (Single x, Single y, Single w, Single
} }
KDE_NO_EXPORT KDE_NO_EXPORT
void ViewSurface::repaint (const SRect &r) { void ViewSurface::tqrepaint (const SRect &r) {
markDirty (); markDirty ();
view_widget->scheduleRepaint (toScreen (r.x (), r.y (), r.width (), r.height ())); view_widget->scheduleRepaint (toScreen (r.x (), r.y (), r.width (), r.height ()));
//kdDebug() << "Surface::repaint x:" << (int)x << " y:" << (int)y << " w:" << (int)w << " h:" << (int)h << endl; //kdDebug() << "Surface::tqrepaint x:" << (int)x << " y:" << (int)y << " w:" << (int)w << " h:" << (int)h << endl;
} }
KDE_NO_EXPORT KDE_NO_EXPORT
void ViewSurface::repaint () { void ViewSurface::tqrepaint () {
markDirty (); markDirty ();
view_widget->scheduleRepaint (toScreen (0, 0, bounds.width (), bounds.height ())); view_widget->scheduleRepaint (toScreen (0, 0, bounds.width (), bounds.height ()));
} }
@ -258,7 +258,7 @@ class KMPLAYER_NO_EXPORT CairoPaintVisitor : public Visitor {
public: public:
cairo_t * cr; cairo_t * cr;
CairoPaintVisitor (cairo_surface_t * cs, Matrix m, CairoPaintVisitor (cairo_surface_t * cs, Matrix m,
const IRect & rect, QColor c=QColor(), bool toplevel=false); const IRect & rect, TQColor c=TQColor(), bool toplevel=false);
~CairoPaintVisitor (); ~CairoPaintVisitor ();
using Visitor::visit; using Visitor::visit;
void visit (Node * n); void visit (Node * n);
@ -281,7 +281,7 @@ public:
KDE_NO_CDTOR_EXPORT KDE_NO_CDTOR_EXPORT
CairoPaintVisitor::CairoPaintVisitor (cairo_surface_t * cs, Matrix m, CairoPaintVisitor::CairoPaintVisitor (cairo_surface_t * cs, Matrix m,
const IRect & rect, QColor c, bool top) const IRect & rect, TQColor c, bool top)
: clip (rect), cairo_surface (cs), matrix (m), toplevel (top) { : clip (rect), cairo_surface (cs), matrix (m), toplevel (top) {
cr = cairo_create (cs); cr = cairo_create (cs);
if (toplevel) { if (toplevel) {
@ -327,7 +327,7 @@ KDE_NO_EXPORT void CairoPaintVisitor::traverseRegion (SMIL::RegionBase * reg) {
if (c->data) if (c->data)
c->data->accept (this); c->data->accept (this);
} }
// finally visit children, accounting for z-order FIXME optimize // finally visit tqchildren, accounting for z-order FIXME optimize
NodeRefList sorted; NodeRefList sorted;
for (NodePtr n = reg->firstChild (); n; n = n->nextSibling ()) { for (NodePtr n = reg->firstChild (); n; n = n->nextSibling ()) {
if (n->id != SMIL::id_node_region) if (n->id != SMIL::id_node_region)
@ -550,7 +550,7 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::Transition *trans) {
case SMIL::Transition::SubHorizontal: case SMIL::Transition::SubHorizontal:
phi = 0; phi = 0;
break; break;
default: // Vertical default: //Qt::Vertical
phi = -M_PI / 2; phi = -M_PI / 2;
break; break;
} }
@ -707,31 +707,31 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::TextMediaType * txt) {
matrix.getXYWH (x, y, w, h); matrix.getXYWH (x, y, w, h);
if (!s->surface) { if (!s->surface) {
//kdDebug() << "new txt surface " << td->text << endl; //kdDebug() << "new txt surface " << td->text << endl;
/* QTextEdit * edit = new QTextEdit; /* TQTextEdit * edit = new TQTextEdit;
edit->setReadOnly (true); edit->setReadOnly (true);
edit->setHScrollBarMode (QScrollView::AlwaysOff); edit->setHScrollBarMode (TQScrollView::AlwaysOff);
edit->setVScrollBarMode (QScrollView::AlwaysOff); edit->setVScrollBarMode (TQScrollView::AlwaysOff);
edit->setFrameShape (QFrame::NoFrame); edit->setFrameShape (TQFrame::NoFrame);
edit->setFrameShadow (QFrame::Plain); edit->setFrameShadow (TQFrame::Plain);
edit->setGeometry (0, 0, w, h); edit->setGeometry (0, 0, w, h);
if (edit->length () == 0) if (edit->length () == 0)
edit->setText (text); edit->setText (text);
if (w0 > 0) if (w0 > 0)
font.setPointSize (int (1.0 * w * font_size / w0)); font.setPointSize (int (1.0 * w * font_size / w0));
edit->setFont (font); edit->setFont (font);
QRect rect = p.clipRegion (QPainter::CoordPainter).boundingRect (); TQRect rect = p.clipRegion (TQPainter::CoordPainter).boundingRect ();
rect = rect.intersect (QRect (xoff, yoff, w, h)); rect = rect.intersect (TQRect (xoff, yoff, w, h));
QPixmap pix = QPixmap::grabWidget (edit, rect.x () - (int) xoff, TQPixmap pix = TQPixmap::grabWidget (edit, rect.x () - (int) xoff,
rect.y () - (int) yoff, rect.width (), rect.height ());*/ rect.y () - (int) yoff, rect.width (), rect.height ());*/
float scale = 1.0 * w / rect.width (); // TODO: make an image float scale = 1.0 * w / rect.width (); // TODO: make an image
cairo_set_font_size (cr, scale * td->font_size); cairo_set_font_size (cr, scale * td->font_size);
cairo_font_extents_t txt_fnt; cairo_font_extents_t txt_fnt;
cairo_font_extents (cr, &txt_fnt); cairo_font_extents (cr, &txt_fnt);
QString str = td->text; TQString str = td->text;
struct Line { struct Line {
Line (const QString & ln) : txt (ln), next(0) {} Line (const TQString & ln) : txt (ln), next(0) {}
QString txt; TQString txt;
cairo_text_extents_t txt_ext; cairo_text_extents_t txt_ext;
Single xoff; Single xoff;
Line * next; Line * next;
@ -741,13 +741,13 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::TextMediaType * txt) {
int line_count = 0; int line_count = 0;
Single min_xoff = w; Single min_xoff = w;
while (!str.isEmpty ()) { while (!str.isEmpty ()) {
int len = str.find (QChar ('\n')); int len = str.tqfind (TQChar ('\n'));
bool skip_cr = false; bool skip_cr = false;
if (len > 1 && str[len-1] == QChar ('\r')) { if (len > 1 && str[len-1] == TQChar ('\r')) {
--len; --len;
skip_cr = true; skip_cr = true;
} }
QString para = len > -1 ? str.left (len) : str; TQString para = len > -1 ? str.left (len) : str;
Line * line = new Line (para); Line * line = new Line (para);
++line_count; ++line_count;
if (!lines) if (!lines)
@ -764,7 +764,7 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::TextMediaType * txt) {
int br_pos = int (line->txt.length () * frag); //educated guess int br_pos = int (line->txt.length () * frag); //educated guess
while (br_pos > 0) { while (br_pos > 0) {
line->txt.truncate (br_pos); line->txt.truncate (br_pos);
br_pos = line->txt.findRev (QChar (' ')); br_pos = line->txt.tqfindRev (TQChar (' '));
if (br_pos < 1) if (br_pos < 1)
break; break;
line->txt.truncate (br_pos); line->txt.truncate (br_pos);
@ -853,7 +853,7 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::Brush * brush) {
SRect rect = s->bounds; SRect rect = s->bounds;
Single x, y, w = rect.width(), h = rect.height(); Single x, y, w = rect.width(), h = rect.height();
matrix.getXYWH (x, y, w, h); matrix.getXYWH (x, y, w, h);
unsigned int color = QColor (brush->param ("color")).rgb (); unsigned int color = TQColor (brush->param ("color")).rgb ();
if (brush->active_trans) { if (brush->active_trans) {
cur_media = brush; cur_media = brush;
cur_pat = NULL; cur_pat = NULL;
@ -1129,7 +1129,7 @@ public:
void visit (SMIL::MediaType * n); void visit (SMIL::MediaType * n);
void visit (SMIL::Anchor *); void visit (SMIL::Anchor *);
void visit (SMIL::Area *); void visit (SMIL::Area *);
QCursor cursor; TQCursor cursor;
}; };
} // namespace } // namespace
@ -1143,17 +1143,17 @@ KDE_NO_EXPORT void MouseVisitor::visit (Node * n) {
kdDebug () << "Mouse event ignored for " << n->nodeName () << endl; kdDebug () << "Mouse event ignored for " << n->nodeName () << endl;
} }
KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Layout * layout) { KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Layout * tqlayout) {
if (layout->surface ()) { if (tqlayout->surface ()) {
Matrix m = matrix; Matrix m = matrix;
SRect rect = layout->region_surface->bounds; SRect rect = tqlayout->region_surface->bounds;
matrix = Matrix (rect.x(), rect.y(), matrix = Matrix (rect.x(), rect.y(),
layout->region_surface->xscale, layout->region_surface->yscale); tqlayout->region_surface->xscale, tqlayout->region_surface->yscale);
matrix.transform (m); matrix.transform (m);
NodePtr node_save = node; NodePtr node_save = node;
node = layout; node = tqlayout;
for (NodePtr r = layout->firstChild (); r; r = r->nextSibling ()) { for (NodePtr r = tqlayout->firstChild (); r; r = r->nextSibling ()) {
if (r->id == SMIL::id_node_region) if (r->id == SMIL::id_node_region)
r->accept (this); r->accept (this);
if (!node->active ()) if (!node->active ())
@ -1232,7 +1232,7 @@ static void followLink (SMIL::LinkingBase * link) {
else else
kdError() << "In document jumps smil not found" << endl; kdError() << "In document jumps smil not found" << endl;
} else } else
for (NodePtr p = link->parentNode (); p; p = p->parentNode ()) { for (NodePtr p = link->tqparentNode (); p; p = p->tqparentNode ()) {
if (n->mrl () && n->mrl ()->opener == p) { if (n->mrl () && n->mrl ()->opener == p) {
p->setState (Node::state_deferred); p->setState (Node::state_deferred);
p->mrl ()->setParam (StringPool::attr_src, link->href, 0L); p->mrl ()->setParam (StringPool::attr_src, link->href, 0L);
@ -1251,7 +1251,7 @@ KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Anchor * anchor) {
} }
KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Area * area) { KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Area * area) {
NodePtr n = area->parentNode (); NodePtr n = area->tqparentNode ();
if (n->id >= SMIL::id_node_first_mediatype && if (n->id >= SMIL::id_node_first_mediatype &&
n->id < SMIL::id_node_last_mediatype) { n->id < SMIL::id_node_last_mediatype) {
SMIL::MediaType * mt = convertNode <SMIL::MediaType> (n); SMIL::MediaType * mt = convertNode <SMIL::MediaType> (n);
@ -1338,22 +1338,22 @@ KDE_NO_EXPORT void MouseVisitor::visit (SMIL::MediaType * mediatype) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT ViewArea::ViewArea (QWidget * parent, View * view) KDE_NO_CDTOR_EXPORT ViewArea::ViewArea (TQWidget * tqparent, View * view)
: QWidget (parent, "kde_kmplayer_viewarea", WResizeNoErase | WRepaintNoErase), : TQWidget (tqparent, "kde_kmplayer_viewarea", WResizeNoErase | WRepaintNoErase),
m_parent (parent), m_parent (tqparent),
m_view (view), m_view (view),
m_collection (new KActionCollection (this)), m_collection (new KActionCollection (this)),
surface (new ViewSurface (this)), surface (new ViewSurface (this)),
m_mouse_invisible_timer (0), m_mouse_invisible_timer (0),
m_repaint_timer (0), m_tqrepaint_timer (0),
m_fullscreen_scale (100), m_fullscreen_scale (100),
scale_lbl_id (-1), scale_lbl_id (-1),
scale_slider_id (-1), scale_slider_id (-1),
m_fullscreen (false), m_fullscreen (false),
m_minimal (false) { m_minimal (false) {
setEraseColor (QColor (0, 0, 0)); setEraseColor (TQColor (0, 0, 0));
setAcceptDrops (true); setAcceptDrops (true);
new KAction (i18n ("Fullscreen"), KShortcut (Qt::Key_F), this, SLOT (accelActivated ()), m_collection, "view_fullscreen_toggle"); new KAction (i18n ("Fullscreen"), KShortcut (TQt::Key_F), TQT_TQOBJECT(this), TQT_SLOT (accelActivated ()), m_collection, "view_fullscreen_toggle");
setMouseTracking (true); setMouseTracking (true);
if (!image_data_map) if (!image_data_map)
imageCacheDeleter.setObject (image_data_map, new ImageDataMap); imageCacheDeleter.setObject (image_data_map, new ImageDataMap);
@ -1363,11 +1363,11 @@ KDE_NO_CDTOR_EXPORT ViewArea::~ViewArea () {
} }
KDE_NO_EXPORT void ViewArea::fullScreen () { KDE_NO_EXPORT void ViewArea::fullScreen () {
killTimers (); TQT_TQOBJECT(this)->killTimers ();
m_mouse_invisible_timer = m_repaint_timer = 0; m_mouse_invisible_timer = m_tqrepaint_timer = 0;
if (m_fullscreen) { if (m_fullscreen) {
showNormal (); showNormal ();
reparent (m_parent, 0, QPoint (0, 0), true); reparent (m_parent, 0, TQPoint (0, 0), true);
static_cast <KDockWidget *> (m_parent)->setWidget (this); static_cast <KDockWidget *> (m_parent)->setWidget (this);
for (unsigned i = 0; i < m_collection->count (); ++i) for (unsigned i = 0; i < m_collection->count (); ++i)
m_collection->action (i)->setEnabled (false); m_collection->action (i)->setEnabled (false);
@ -1376,20 +1376,20 @@ KDE_NO_EXPORT void ViewArea::fullScreen () {
m_view->controlPanel ()->popupMenu ()->removeItem (scale_slider_id); m_view->controlPanel ()->popupMenu ()->removeItem (scale_slider_id);
scale_lbl_id = scale_slider_id = -1; scale_lbl_id = scale_slider_id = -1;
} }
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (QIconSet (QPixmap (playlist_xpm))); m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (TQIconSet (TQPixmap (playlist_xpm)));
} else { } else {
m_topwindow_rect = topLevelWidget ()->geometry (); m_topwindow_rect = tqtopLevelWidget ()->tqgeometry ();
reparent (0L, 0, qApp->desktop()->screenGeometry(this).topLeft(), true); reparent (0L, 0, tqApp->desktop()->screenGeometry(this).topLeft(), true);
showFullScreen (); showFullScreen ();
for (unsigned i = 0; i < m_collection->count (); ++i) for (unsigned i = 0; i < m_collection->count (); ++i)
m_collection->action (i)->setEnabled (true); m_collection->action (i)->setEnabled (true);
QPopupMenu * menu = m_view->controlPanel ()->popupMenu (); TQPopupMenu * menu = m_view->controlPanel ()->popupMenu ();
QLabel * lbl = new QLabel (i18n ("Scale:"), menu); TQLabel * lbl = new TQLabel (i18n ("Scale:"), menu);
scale_lbl_id = menu->insertItem (lbl, -1, 4); scale_lbl_id = menu->insertItem (lbl, -1, 4);
QSlider * slider = new QSlider (50, 150, 10, m_fullscreen_scale, Qt::Horizontal, menu); TQSlider * slider = new TQSlider (50, 150, 10, m_fullscreen_scale, Qt::Horizontal, menu);
connect (slider, SIGNAL (valueChanged (int)), this, SLOT (scale (int))); connect (slider, TQT_SIGNAL (valueChanged (int)), this, TQT_SLOT (scale (int)));
scale_slider_id = menu->insertItem (slider, -1, 5); scale_slider_id = menu->insertItem (slider, -1, 5);
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (QIconSet (QPixmap (normal_window_xpm))); m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (TQIconSet (TQPixmap (normal_window_xpm)));
} }
m_fullscreen = !m_fullscreen; m_fullscreen = !m_fullscreen;
m_view->controlPanel()->popupMenu ()->setItemChecked (ControlPanel::menu_fullscreen, m_fullscreen); m_view->controlPanel()->popupMenu ()->setItemChecked (ControlPanel::menu_fullscreen, m_fullscreen);
@ -1413,26 +1413,26 @@ KDE_NO_EXPORT void ViewArea::fullScreen () {
void ViewArea::minimalMode () { void ViewArea::minimalMode () {
m_minimal = !m_minimal; m_minimal = !m_minimal;
killTimers (); TQT_TQOBJECT(this)->killTimers ();
m_mouse_invisible_timer = m_repaint_timer = 0; m_mouse_invisible_timer = m_tqrepaint_timer = 0;
if (m_minimal) { if (m_minimal) {
m_view->setViewOnly (); m_view->setViewOnly ();
m_view->setControlPanelMode (KMPlayer::View::CP_AutoHide); m_view->setControlPanelMode (KMPlayer::View::CP_AutoHide);
m_view->setNoInfoMessages (true); m_view->setNoInfoMessages (true);
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (QIconSet (QPixmap (normal_window_xpm))); m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (TQIconSet (TQPixmap (normal_window_xpm)));
} else { } else {
m_view->setControlPanelMode (KMPlayer::View::CP_Show); m_view->setControlPanelMode (KMPlayer::View::CP_Show);
m_view->setNoInfoMessages (false); m_view->setNoInfoMessages (false);
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (QIconSet (QPixmap (playlist_xpm))); m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (TQIconSet (TQPixmap (playlist_xpm)));
} }
m_topwindow_rect = topLevelWidget ()->geometry (); m_topwindow_rect = tqtopLevelWidget ()->tqgeometry ();
} }
KDE_NO_EXPORT void ViewArea::accelActivated () { KDE_NO_EXPORT void ViewArea::accelActivated () {
m_view->controlPanel()->popupMenu ()->activateItemAt (m_view->controlPanel()->popupMenu ()->indexOf (ControlPanel::menu_fullscreen)); m_view->controlPanel()->popupMenu ()->activateItemAt (m_view->controlPanel()->popupMenu ()->indexOf (ControlPanel::menu_fullscreen));
} }
KDE_NO_EXPORT void ViewArea::mousePressEvent (QMouseEvent * e) { KDE_NO_EXPORT void ViewArea::mousePressEvent (TQMouseEvent * e) {
if (surface->node) { if (surface->node) {
MouseVisitor visitor (event_pointer_clicked, e->x(), e->y()); MouseVisitor visitor (event_pointer_clicked, e->x(), e->y());
surface->node->accept (&visitor); surface->node->accept (&visitor);
@ -1440,14 +1440,14 @@ KDE_NO_EXPORT void ViewArea::mousePressEvent (QMouseEvent * e) {
e->accept (); e->accept ();
} }
KDE_NO_EXPORT void ViewArea::mouseDoubleClickEvent (QMouseEvent *) { KDE_NO_EXPORT void ViewArea::mouseDoubleClickEvent (TQMouseEvent *) {
m_view->fullScreen (); // screensaver stuff m_view->fullScreen (); // screensaver stuff
} }
KDE_NO_EXPORT void ViewArea::mouseMoveEvent (QMouseEvent * e) { KDE_NO_EXPORT void ViewArea::mouseMoveEvent (TQMouseEvent * e) {
if (e->state () == Qt::NoButton) { if (e->state () == Qt::NoButton) {
int vert_buttons_pos = height () - m_view->statusBarHeight (); int vert_buttons_pos = height () - m_view->statusBarHeight ();
int cp_height = m_view->controlPanel ()->maximumSize ().height (); int cp_height = m_view->controlPanel ()->tqmaximumSize ().height ();
m_view->delayedShowButtons (e->y() > vert_buttons_pos-cp_height && m_view->delayedShowButtons (e->y() > vert_buttons_pos-cp_height &&
e->y() < vert_buttons_pos); e->y() < vert_buttons_pos);
} }
@ -1481,22 +1481,22 @@ KDE_NO_EXPORT void ViewArea::syncVisual (const IRect & rect) {
if (surface->node) if (surface->node)
surface->node->accept (&visitor); surface->node->accept (&visitor);
#else #else
repaint (QRect(rect.x, rect.y, rect.w, rect.h), false); tqrepaint (TQRect(rect.x, rect.y, rect.w, rect.h), false);
#endif #endif
if (m_repaint_timer) { if (m_tqrepaint_timer) {
killTimer (m_repaint_timer); killTimer (m_tqrepaint_timer);
m_repaint_timer = 0; m_tqrepaint_timer = 0;
} }
//XFlush (qt_xdisplay ()); //XFlush (qt_xdisplay ());
} }
KDE_NO_EXPORT void ViewArea::paintEvent (QPaintEvent * pe) { KDE_NO_EXPORT void ViewArea::paintEvent (TQPaintEvent * pe) {
#ifdef HAVE_CAIRO #ifdef HAVE_CAIRO
if (surface->node) if (surface->node)
scheduleRepaint (IRect (pe->rect ().x (), pe->rect ().y (), pe->rect ().width (), pe->rect ().height ())); scheduleRepaint (IRect (pe->rect ().x (), pe->rect ().y (), pe->rect ().width (), pe->rect ().height ()));
else else
#endif #endif
QWidget::paintEvent (pe); TQWidget::paintEvent (pe);
} }
KDE_NO_EXPORT void ViewArea::scale (int val) { KDE_NO_EXPORT void ViewArea::scale (int val) {
@ -1510,7 +1510,7 @@ KDE_NO_EXPORT void ViewArea::updateSurfaceBounds () {
h -= m_view->controlPanel ()->isVisible () h -= m_view->controlPanel ()->isVisible ()
? (m_view->controlPanelMode () == View::CP_Only ? (m_view->controlPanelMode () == View::CP_Only
? h ? h
: (Single) m_view->controlPanel()->maximumSize ().height ()) : (Single) m_view->controlPanel()->tqmaximumSize ().height ())
: Single (0); : Single (0);
surface->resize (SRect (x, y, w, h)); surface->resize (SRect (x, y, w, h));
Mrl *mrl = surface->node ? surface->node->mrl () : NULL; Mrl *mrl = surface->node ? surface->node->mrl () : NULL;
@ -1538,14 +1538,14 @@ KDE_NO_EXPORT void ViewArea::updateSurfaceBounds () {
scheduleRepaint (IRect (0, 0, width (), height ())); scheduleRepaint (IRect (0, 0, width (), height ()));
} }
KDE_NO_EXPORT void ViewArea::resizeEvent (QResizeEvent *) { KDE_NO_EXPORT void ViewArea::resizeEvent (TQResizeEvent *) {
if (!m_view->controlPanel ()) return; if (!m_view->controlPanel ()) return;
Single x, y, w = width (), h = height (); Single x, y, w = width (), h = height ();
Single hsb = m_view->statusBarHeight (); Single hsb = m_view->statusBarHeight ();
Single hcp = m_view->controlPanel ()->isVisible () Single hcp = m_view->controlPanel ()->isVisible ()
? (m_view->controlPanelMode () == View::CP_Only ? (m_view->controlPanelMode () == View::CP_Only
? h-hsb ? h-hsb
: (Single) m_view->controlPanel()->maximumSize ().height ()) : (Single) m_view->controlPanel()->tqmaximumSize ().height ())
: Single (0); : Single (0);
Single wws = w; Single wws = w;
// move controlpanel over video when autohiding and playing // move controlpanel over video when autohiding and playing
@ -1593,18 +1593,18 @@ void ViewArea::setAudioVideoGeometry (const IRect &rect, unsigned int * bg_color
h = hfw; h = hfw;
} }
} }
m_av_geometry = QRect (x, y, w, h); m_av_tqgeometry = TQRect (x, y, w, h);
QRect wrect = m_view->widgetStack ()->geometry (); TQRect wrect = m_view->widgetStack ()->tqgeometry ();
if (m_av_geometry != wrect && if (m_av_tqgeometry != wrect &&
!(m_av_geometry.width() <= 0 && !(m_av_tqgeometry.width() <= 0 &&
wrect.width() <= 1 && wrect.height() <= 1)) { wrect.width() <= 1 && wrect.height() <= 1)) {
m_view->widgetStack ()->setGeometry (x, y, w, h); m_view->widgetStack ()->setGeometry (x, y, w, h);
wrect.unite (m_av_geometry); wrect.unite (m_av_tqgeometry);
scheduleRepaint (IRect (wrect.x (), wrect.y (), wrect.width (), wrect.height ())); scheduleRepaint (IRect (wrect.x (), wrect.y (), wrect.width (), wrect.height ()));
} }
if (bg_color) if (bg_color)
if (QColor (QRgb (*bg_color)) != (m_view->viewer ()->paletteBackgroundColor ())) { if (TQColor (TQRgb (*bg_color)) != (m_view->viewer ()->paletteBackgroundColor ())) {
m_view->viewer()->setCurrentBackgroundColor (QColor (QRgb (*bg_color))); m_view->viewer()->setCurrentBackgroundColor (TQColor (TQRgb (*bg_color)));
scheduleRepaint (IRect (x, y, w, h)); scheduleRepaint (IRect (x, y, w, h));
} }
} }
@ -1625,19 +1625,19 @@ KDE_NO_EXPORT SurfacePtr ViewArea::getSurface (NodePtr node) {
return 0L; return 0L;
} }
KDE_NO_EXPORT void ViewArea::showEvent (QShowEvent *) { KDE_NO_EXPORT void ViewArea::showEvent (TQShowEvent *) {
resizeEvent (0L); resizeEvent (0L);
} }
KDE_NO_EXPORT void ViewArea::dropEvent (QDropEvent * de) { KDE_NO_EXPORT void ViewArea::dropEvent (TQDropEvent * de) {
m_view->dropEvent (de); m_view->dropEvent (de);
} }
KDE_NO_EXPORT void ViewArea::dragEnterEvent (QDragEnterEvent* dee) { KDE_NO_EXPORT void ViewArea::dragEnterEvent (TQDragEnterEvent* dee) {
m_view->dragEnterEvent (dee); m_view->dragEnterEvent (dee);
} }
KDE_NO_EXPORT void ViewArea::contextMenuEvent (QContextMenuEvent * e) { KDE_NO_EXPORT void ViewArea::contextMenuEvent (TQContextMenuEvent * e) {
m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ()); m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ());
} }
@ -1651,40 +1651,40 @@ KDE_NO_EXPORT void ViewArea::mouseMoved () {
} }
KDE_NO_EXPORT void ViewArea::scheduleRepaint (const IRect &rect) { KDE_NO_EXPORT void ViewArea::scheduleRepaint (const IRect &rect) {
if (m_repaint_timer) { if (m_tqrepaint_timer) {
m_repaint_rect = m_repaint_rect.unite (rect); m_tqrepaint_rect = m_tqrepaint_rect.unite (rect);
} else { } else {
m_repaint_rect = rect; m_tqrepaint_rect = rect;
m_repaint_timer = startTimer (10); // 100 per sec should do m_tqrepaint_timer = startTimer (10); // 100 per sec should do
} }
} }
KDE_NO_EXPORT void ViewArea::timerEvent (QTimerEvent * e) { KDE_NO_EXPORT void ViewArea::timerEvent (TQTimerEvent * e) {
if (e->timerId () == m_mouse_invisible_timer) { if (e->timerId () == m_mouse_invisible_timer) {
killTimer (m_mouse_invisible_timer); killTimer (m_mouse_invisible_timer);
m_mouse_invisible_timer = 0; m_mouse_invisible_timer = 0;
if (m_fullscreen) if (m_fullscreen)
setCursor (BlankCursor); setCursor (BlankCursor);
} else if (e->timerId () == m_repaint_timer) { } else if (e->timerId () == m_tqrepaint_timer) {
killTimer (m_repaint_timer); killTimer (m_tqrepaint_timer);
m_repaint_timer = 0; m_tqrepaint_timer = 0;
//repaint (m_repaint_rect, false); //tqrepaint (m_tqrepaint_rect, false);
syncVisual (m_repaint_rect.intersect (IRect (0, 0, width (), height ()))); syncVisual (m_tqrepaint_rect.intersect (IRect (0, 0, width (), height ())));
} else { } else {
kdError () << "unknown timer " << e->timerId () << " " << m_repaint_timer << endl; kdError () << "unknown timer " << e->timerId () << " " << m_tqrepaint_timer << endl;
killTimer (e->timerId ()); killTimer (e->timerId ());
} }
} }
KDE_NO_EXPORT void ViewArea::closeEvent (QCloseEvent * e) { KDE_NO_EXPORT void ViewArea::closeEvent (TQCloseEvent * e) {
//kdDebug () << "closeEvent" << endl; //kdDebug () << "closeEvent" << endl;
if (m_fullscreen) { if (m_fullscreen) {
fullScreen (); fullScreen ();
if (!m_parent->topLevelWidget ()->isVisible ()) if (!m_parent->tqtopLevelWidget ()->isVisible ())
m_parent->topLevelWidget ()->show (); m_parent->tqtopLevelWidget ()->show ();
e->ignore (); e->ignore ();
} else } else
QWidget::closeEvent (e); TQWidget::closeEvent (e);
} }

@ -20,7 +20,7 @@
#ifndef KMPLAYER_VIEW_AREA_H #ifndef KMPLAYER_VIEW_AREA_H
#define KMPLAYER_VIEW_AREA_H #define KMPLAYER_VIEW_AREA_H
#include <qwidget.h> #include <tqwidget.h>
class KActionCollection; class KActionCollection;
@ -32,51 +32,52 @@ class ViewAreaPrivate;
/* /*
* The area in which the video widget and controlpanel are laid out * The area in which the video widget and controlpanel are laid out
*/ */
class KMPLAYER_EXPORT ViewArea : public QWidget { class KMPLAYER_EXPORT ViewArea : public TQWidget {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ViewArea (QWidget * parent, View * view); ViewArea (TQWidget * tqparent, View * view);
~ViewArea (); ~ViewArea ();
KDE_NO_EXPORT bool isFullScreen () const { return m_fullscreen; } KDE_NO_EXPORT bool isFullScreen () const { return m_fullscreen; }
KDE_NO_EXPORT bool isMinimalMode () const { return m_minimal; } KDE_NO_EXPORT bool isMinimalMode () const { return m_minimal; }
KDE_NO_EXPORT KActionCollection * actionCollection () const { return m_collection; } KDE_NO_EXPORT KActionCollection * actionCollection () const { return m_collection; }
KDE_NO_EXPORT QRect topWindowRect () const { return m_topwindow_rect; } KDE_NO_EXPORT TQRect topWindowRect () const { return m_topwindow_rect; }
SurfacePtr getSurface (NodePtr node); SurfacePtr getSurface (NodePtr node);
void setAudioVideoGeometry (const IRect &rect, unsigned int * bg); void setAudioVideoGeometry (const IRect &rect, unsigned int * bg);
void setAudioVideoNode (NodePtr n); void setAudioVideoNode (NodePtr n);
void mouseMoved (); void mouseMoved ();
void scheduleRepaint (const IRect &rect); void scheduleRepaint (const IRect &rect);
void resizeEvent (QResizeEvent *); void resizeEvent (TQResizeEvent *);
void minimalMode (); void minimalMode ();
public slots: public slots:
void fullScreen (); void fullScreen ();
void accelActivated (); void accelActivated ();
void scale (int); void scale (int);
protected: protected:
void showEvent (QShowEvent *); void showEvent (TQShowEvent *);
void mouseMoveEvent (QMouseEvent *); void mouseMoveEvent (TQMouseEvent *);
void mousePressEvent (QMouseEvent *); void mousePressEvent (TQMouseEvent *);
void mouseDoubleClickEvent (QMouseEvent *); void mouseDoubleClickEvent (TQMouseEvent *);
void dragEnterEvent (QDragEnterEvent *); void dragEnterEvent (TQDragEnterEvent *);
void dropEvent (QDropEvent *); void dropEvent (TQDropEvent *);
void contextMenuEvent (QContextMenuEvent * e); void contextMenuEvent (TQContextMenuEvent * e);
void paintEvent (QPaintEvent *); void paintEvent (TQPaintEvent *);
void timerEvent (QTimerEvent * e); void timerEvent (TQTimerEvent * e);
void closeEvent (QCloseEvent * e); void closeEvent (TQCloseEvent * e);
private: private:
void syncVisual (const IRect & rect); void syncVisual (const IRect & rect);
void updateSurfaceBounds (); void updateSurfaceBounds ();
ViewAreaPrivate * d; ViewAreaPrivate * d;
QWidget * m_parent; TQWidget * m_parent;
View * m_view; View * m_view;
KActionCollection * m_collection; KActionCollection * m_collection;
SurfacePtr surface; SurfacePtr surface;
NodePtrW video_node; NodePtrW video_node;
QRect m_av_geometry; TQRect m_av_tqgeometry;
IRect m_repaint_rect; IRect m_tqrepaint_rect;
QRect m_topwindow_rect; TQRect m_topwindow_rect;
int m_mouse_invisible_timer; int m_mouse_invisible_timer;
int m_repaint_timer; int m_tqrepaint_timer;
int m_fullscreen_scale; int m_fullscreen_scale;
int scale_lbl_id; int scale_lbl_id;
int scale_slider_id; int scale_slider_id;

@ -23,13 +23,13 @@
#include <math.h> #include <math.h>
#include <libgen.h> #include <libgen.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <qcstring.h> #include <tqcstring.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qfile.h> #include <tqfile.h>
#include <qurl.h> #include <tqurl.h>
#include <qthread.h> #include <tqthread.h>
#include <qmutex.h> #include <tqmutex.h>
#include <qdom.h> #include <tqdom.h>
#include "kmplayer_backend.h" #include "kmplayer_backend.h"
#include "kmplayer_callback_stub.h" #include "kmplayer_callback_stub.h"
#include "kmplayer_callback.h" #include "kmplayer_callback.h"
@ -62,7 +62,7 @@ typedef struct {
static KXinePlayer * xineapp; static KXinePlayer * xineapp;
static KMPlayer::Callback_stub * callback; static KMPlayer::Callback_stub * callback;
static QMutex mutex (true); static TQMutex mutex (true);
static xine_t *xine; static xine_t *xine;
static xine_stream_t *stream; static xine_stream_t *stream;
@ -97,31 +97,31 @@ static double pixel_aspect;
static int running = 0; static int running = 0;
static volatile int firstframe = 0; static volatile int firstframe = 0;
static const int event_finished = QEvent::User; static const int event_finished = TQEvent::User;
static const int event_progress = QEvent::User + 2; static const int event_progress = TQEvent::User + 2;
static const int event_url = QEvent::User + 3; static const int event_url = TQEvent::User + 3;
static const int event_size = QEvent::User + 4; static const int event_size = TQEvent::User + 4;
static const int event_title = QEvent::User + 5; static const int event_title = TQEvent::User + 5;
static const int event_video = QEvent::User + 6; static const int event_video = TQEvent::User + 6;
static QString mrl; static TQString mrl;
static QString sub_mrl; static TQString sub_mrl;
static QString rec_mrl; static TQString rec_mrl;
static QString alang, slang; static TQString alang, slang;
static QStringList alanglist, slanglist; static TQStringList alanglist, slanglist;
static QString elmentry ("entry"); static TQString elmentry ("entry");
static QString elmitem ("item"); static TQString elmitem ("item");
static QString attname ("name"); static TQString attname ("name");
static QString atttype ("type"); static TQString atttype ("type");
static QString attdefault ("DEFAULT"); static TQString attdefault ("DEFAULT");
static QString attvalue ("value"); static TQString attvalue ("value");
static QString attstart ("START"); static TQString attstart ("START");
static QString attend ("end"); static TQString attend ("end");
static QString valrange ("range"); static TQString valrange ("range");
static QString valnum ("num"); static TQString valnum ("num");
static QString valbool ("bool"); static TQString valbool ("bool");
static QString valenum ("enum"); static TQString valenum ("enum");
static QString valstring ("string"); static TQString valstring ("string");
extern "C" { extern "C" {
@ -146,7 +146,7 @@ static void frame_output_cb(void * /*data*/, int /*video_width*/, int /*video_he
movie_width = xine_get_stream_info(stream, XINE_STREAM_INFO_VIDEO_WIDTH); movie_width = xine_get_stream_info(stream, XINE_STREAM_INFO_VIDEO_WIDTH);
movie_height = xine_get_stream_info(stream, XINE_STREAM_INFO_VIDEO_HEIGHT); movie_height = xine_get_stream_info(stream, XINE_STREAM_INFO_VIDEO_HEIGHT);
mutex.unlock (); mutex.unlock ();
QApplication::postEvent (xineapp, new XineMovieParamEvent (movie_length, movie_width, movie_height, alanglist, slanglist, true)); TQApplication::postEvent (xineapp, new XineMovieParamEvent (movie_length, movie_width, movie_height, alanglist, slanglist, true));
} }
@ -185,15 +185,15 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
if (repeat_count-- > 0) if (repeat_count-- > 0)
xine_play (stream, 0, 0); xine_play (stream, 0, 0);
else else
QApplication::postEvent (xineapp, new QEvent ((QEvent::Type) event_finished)); TQApplication::postEvent (xineapp, new TQEvent ((TQEvent::Type) event_finished));
break; break;
case XINE_EVENT_PROGRESS: case XINE_EVENT_PROGRESS:
QApplication::postEvent (xineapp, new XineProgressEvent (((xine_progress_data_t *) event->data)->percent)); TQApplication::postEvent (xineapp, new XineProgressEvent (((xine_progress_data_t *) event->data)->percent));
break; break;
case XINE_EVENT_MRL_REFERENCE: case XINE_EVENT_MRL_REFERENCE:
fprintf(stderr, "XINE_EVENT_MRL_REFERENCE %s\n", fprintf(stderr, "XINE_EVENT_MRL_REFERENCE %s\n",
((xine_mrl_reference_data_t*)event->data)->mrl); ((xine_mrl_reference_data_t*)event->data)->mrl);
QApplication::postEvent (xineapp, new XineURLEvent (QString::fromLocal8Bit (((xine_mrl_reference_data_t*)event->data)->mrl))); TQApplication::postEvent (xineapp, new XineURLEvent (TQString::fromLocal8Bit (((xine_mrl_reference_data_t*)event->data)->mrl)));
break; break;
case XINE_EVENT_FRAME_FORMAT_CHANGE: case XINE_EVENT_FRAME_FORMAT_CHANGE:
fprintf (stderr, "XINE_EVENT_FRAME_FORMAT_CHANGE\n"); fprintf (stderr, "XINE_EVENT_FRAME_FORMAT_CHANGE\n");
@ -201,7 +201,7 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
case XINE_EVENT_UI_SET_TITLE: case XINE_EVENT_UI_SET_TITLE:
{ {
xine_ui_data_t * data = (xine_ui_data_t *) event->data; xine_ui_data_t * data = (xine_ui_data_t *) event->data;
QApplication::postEvent(xineapp, new XineTitleEvent(data->str)); TQApplication::postEvent(xineapp, new XineTitleEvent(data->str));
fprintf (stderr, "Set title event %s\n", data->str); fprintf (stderr, "Set title event %s\n", data->str);
} }
break; break;
@ -221,7 +221,7 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
for (int i = 0; i < nr; ++i) { for (int i = 0; i < nr; ++i) {
if (!xine_get_audio_lang (stream, i, langstr)) if (!xine_get_audio_lang (stream, i, langstr))
continue; continue;
QString ls = QString::fromLocal8Bit (langstr).stripWhiteSpace(); TQString ls = TQString(TQString::fromLocal8Bit (langstr)).stripWhiteSpace();
if (ls.isEmpty ()) if (ls.isEmpty ())
continue; continue;
if (!slang.isEmpty () && alang == ls) if (!slang.isEmpty () && alang == ls)
@ -234,7 +234,7 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
for (int i = 0; i < nr; ++i) { for (int i = 0; i < nr; ++i) {
if (!xine_get_spu_lang (stream, i, langstr)) if (!xine_get_spu_lang (stream, i, langstr))
continue; continue;
QString ls = QString::fromLocal8Bit (langstr).stripWhiteSpace(); TQString ls = TQString(TQString::fromLocal8Bit (langstr)).stripWhiteSpace();
if (ls.isEmpty ()) if (ls.isEmpty ())
continue; continue;
if (!slang.isEmpty () && slang == ls) if (!slang.isEmpty () && slang == ls)
@ -247,7 +247,7 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
movie_width = w; movie_width = w;
movie_height = h; movie_height = h;
movie_length = l; movie_length = l;
QApplication::postEvent (xineapp, new XineMovieParamEvent (l, w, h, alanglist, slanglist, firstframe)); TQApplication::postEvent (xineapp, new XineMovieParamEvent (l, w, h, alanglist, slanglist, firstframe));
if (running && firstframe) if (running && firstframe)
firstframe = 0; firstframe = 0;
if (window_created && w > 0 && h > 0) { if (window_created && w > 0 && h > 0) {
@ -271,16 +271,16 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
using namespace KMPlayer; using namespace KMPlayer;
Backend::Backend () Backend::Backend ()
: DCOPObject (QCString ("Backend")) { : DCOPObject (TQCString ("Backend")) {
} }
Backend::~Backend () {} Backend::~Backend () {}
void Backend::setURL (QString url) { void Backend::setURL (TQString url) {
mrl = url; mrl = url;
} }
void Backend::setSubTitleURL (QString url) { void Backend::setSubTitleURL (TQString url) {
sub_mrl = url; sub_mrl = url;
} }
@ -289,7 +289,7 @@ void Backend::play (int repeat_count) {
} }
void Backend::stop () { void Backend::stop () {
QTimer::singleShot (0, xineapp, SLOT (stop ())); TQTimer::singleShot (0, xineapp, TQT_SLOT (stop ()));
} }
void Backend::pause () { void Backend::pause () {
@ -323,11 +323,11 @@ void Backend::volume (int v, bool) {
void Backend::frequency (int) { void Backend::frequency (int) {
} }
void Backend::setAudioLang (int id, QString al) { void Backend::setAudioLang (int id, TQString al) {
xineapp->setAudioLang (id, al); xineapp->setAudioLang (id, al);
} }
void Backend::setSubtitle (int id, QString sl) { void Backend::setSubtitle (int id, TQString sl) {
xineapp->setSubtitle (id, sl); xineapp->setSubtitle (id, sl);
} }
@ -337,10 +337,10 @@ void Backend::quit () {
if (running) if (running)
stop (); stop ();
else else
QTimer::singleShot (0, qApp, SLOT (quit ())); TQTimer::singleShot (0, tqApp, TQT_SLOT (quit ()));
} }
bool updateConfigEntry (const QString & name, const QString & value) { bool updateConfigEntry (const TQString & name, const TQString & value) {
fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ()); fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ());
bool changed = false; bool changed = false;
xine_cfg_entry_t cfg_entry; xine_cfg_entry_t cfg_entry;
@ -358,22 +358,22 @@ bool updateConfigEntry (const QString & name, const QString & value) {
return changed; return changed;
} }
void Backend::setConfig (QByteArray data) { void Backend::setConfig (TQByteArray data) {
QString err; TQString err;
int line, column; int line, column;
QDomDocument dom; TQDomDocument dom;
if (dom.setContent (data, false, &err, &line, &column)) { if (dom.setContent (data, false, &err, &line, &column)) {
if (dom.childNodes().length() == 1) { if (dom.childNodes().length() == 1) {
for (QDomNode node = dom.firstChild().firstChild(); for (TQDomNode node = dom.firstChild().firstChild();
!node.isNull (); !node.isNull ();
node = node.nextSibling ()) { node = node.nextSibling ()) {
QDomNamedNodeMap attr = node.attributes (); TQDomNamedNodeMap attr = node.attributes ();
updateConfigEntry (attr.namedItem (attname).nodeValue (), updateConfigEntry (attr.namedItem (attname).nodeValue (),
attr.namedItem (attvalue).nodeValue ()); attr.namedItem (attvalue).nodeValue ());
} }
xine_config_save (xine, configfile); xine_config_save (xine, configfile);
} else } else
err = QString ("invalid data"); err = TQString ("invalid data");
} }
if (callback) if (callback)
callback->errorMessage (0, err); callback->errorMessage (0, err);
@ -389,7 +389,7 @@ bool Backend::isPlaying () {
} }
KXinePlayer::KXinePlayer (int _argc, char ** _argv) KXinePlayer::KXinePlayer (int _argc, char ** _argv)
: QApplication (_argc, _argv, false) { : TQApplication (_argc, _argv, false) {
} }
void KXinePlayer::init () { void KXinePlayer::init () {
@ -441,7 +441,7 @@ void KXinePlayer::init () {
options[i+1] = 0L; options[i+1] = 0L;
xine_config_register_enum (xine, "audio.visualization", 0, (char ** ) options, 0L, 0L, 0, xine_config_cb, 0L); xine_config_register_enum (xine, "audio.visualization", 0, (char ** ) options, 0L, 0L, 0, xine_config_cb, 0L);
if (!callback) if (!callback)
QTimer::singleShot (10, this, SLOT (play ())); TQTimer::singleShot (10, this, TQT_SLOT (play ()));
} }
KXinePlayer::~KXinePlayer () { KXinePlayer::~KXinePlayer () {
@ -456,32 +456,32 @@ KXinePlayer::~KXinePlayer () {
xineapp = 0L; xineapp = 0L;
} }
void getConfigEntries (QByteArray & buf) { void getConfigEntries (TQByteArray & buf) {
xine_cfg_entry_t entry; xine_cfg_entry_t entry;
QDomDocument doc; TQDomDocument doc;
QDomElement root = doc.createElement (QString ("document")); TQDomElement root = doc.createElement (TQString ("document"));
for (int i = xine_config_get_first_entry (xine, &entry); for (int i = xine_config_get_first_entry (xine, &entry);
i; i;
i = xine_config_get_next_entry (xine, &entry)) { i = xine_config_get_next_entry (xine, &entry)) {
QDomElement elm = doc.createElement (elmentry); TQDomElement elm = doc.createElement (elmentry);
elm.setAttribute (attname, QString (entry.key)); elm.setAttribute (attname, TQString (entry.key));
if (entry.type == XINE_CONFIG_TYPE_STRING || entry.type == XINE_CONFIG_TYPE_UNKNOWN) { if (entry.type == XINE_CONFIG_TYPE_STRING || entry.type == XINE_CONFIG_TYPE_UNKNOWN) {
elm.setAttribute (atttype, valstring); elm.setAttribute (atttype, valstring);
elm.setAttribute (attvalue, QString (entry.str_value)); elm.setAttribute (attvalue, TQString (entry.str_value));
} else { } else {
elm.setAttribute (attdefault, QString::number (entry.num_default)); elm.setAttribute (attdefault, TQString::number (entry.num_default));
elm.setAttribute (attvalue, QString::number (entry.num_value)); elm.setAttribute (attvalue, TQString::number (entry.num_value));
switch (entry.type) { switch (entry.type) {
case XINE_CONFIG_TYPE_RANGE: case XINE_CONFIG_TYPE_RANGE:
elm.setAttribute (atttype, valrange); elm.setAttribute (atttype, valrange);
elm.setAttribute (attstart, QString::number (entry.range_min)); elm.setAttribute (attstart, TQString::number (entry.range_min));
elm.setAttribute (attend, QString::number (entry.range_max)); elm.setAttribute (attend, TQString::number (entry.range_max));
break; break;
case XINE_CONFIG_TYPE_ENUM: case XINE_CONFIG_TYPE_ENUM:
elm.setAttribute (atttype, valenum); elm.setAttribute (atttype, valenum);
for (int i = 0; entry.enum_values[i]; i++) { for (int i = 0; entry.enum_values[i]; i++) {
QDomElement item = doc.createElement (elmitem); TQDomElement item = doc.createElement (elmitem);
item.setAttribute (attvalue, QString (entry.enum_values[i])); item.setAttribute (attvalue, TQString (entry.enum_values[i]));
elm.appendChild (item); elm.appendChild (item);
} }
break; break;
@ -496,12 +496,12 @@ void getConfigEntries (QByteArray & buf) {
} }
} }
if (entry.help) if (entry.help)
elm.appendChild (doc.createTextNode (QString::fromUtf8 (entry.help))); elm.appendChild (doc.createTextNode (TQString::fromUtf8 (entry.help)));
root.appendChild (elm); root.appendChild (elm);
} }
doc.appendChild (root); doc.appendChild (root);
QString exp = doc.toString (); TQString exp = doc.toString ();
QCString cexp = exp.utf8 (); TQCString cexp = exp.utf8 ();
buf.duplicate (cexp); buf.duplicate (cexp);
buf.resize (cexp.length ()); // strip terminating \0 buf.resize (cexp.length ()); // strip terminating \0
} }
@ -522,7 +522,7 @@ void KXinePlayer::play (int repeat) {
movie_height = 0; movie_height = 0;
if (mrl.startsWith ("cdda://")) if (mrl.startsWith ("cdda://"))
mrl = QString ("cdda:/") + mrl.mid (7); mrl = TQString ("cdda:/") + mrl.mid (7);
stream = xine_stream_new (xine, ao_port, vo_port); stream = xine_stream_new (xine, ao_port, vo_port);
event_queue = xine_event_new_queue (stream); event_queue = xine_event_new_queue (stream);
xine_event_create_listener_thread (event_queue, event_listener, NULL); xine_event_create_listener_thread (event_queue, event_listener, NULL);
@ -531,12 +531,12 @@ void KXinePlayer::play (int repeat) {
char ** mrls = xine_get_autoplay_mrls (xine, "CD", &nr); char ** mrls = xine_get_autoplay_mrls (xine, "CD", &nr);
running = 1; running = 1;
for (int i = 0; i < nr; i++) { for (int i = 0; i < nr; i++) {
QString m (mrls[i]); TQString m (mrls[i]);
QString title; TQString title;
if (xine_open (stream, mrls[i])) { if (xine_open (stream, mrls[i])) {
const char * t = xine_get_meta_info (stream, XINE_META_INFO_TITLE); const char * t = xine_get_meta_info (stream, XINE_META_INFO_TITLE);
if (t && t[0]) if (t && t[0])
title = QString::fromUtf8 (t); title = TQString::fromUtf8 (t);
xine_close (stream); xine_close (stream);
} }
if (callback) if (callback)
@ -552,14 +552,14 @@ void KXinePlayer::play (int repeat) {
xine_gui_send_vo_data(stream, XINE_GUI_SEND_VIDEOWIN_VISIBLE, (void *) 1); xine_gui_send_vo_data(stream, XINE_GUI_SEND_VIDEOWIN_VISIBLE, (void *) 1);
running = 1; running = 1;
QString mrlsetup = mrl; TQString mrlsetup = mrl;
if (!rec_mrl.isEmpty ()) { if (!rec_mrl.isEmpty ()) {
char * rm = strdup (rec_mrl.local8Bit ()); char * rm = strdup (rec_mrl.local8Bit ());
char *bn = basename (rm); char *bn = basename (rm);
char *dn = dirname (rm); char *dn = dirname (rm);
if (bn) if (bn)
updateConfigEntry (QString ("media.capture.save_dir"), QString::fromLocal8Bit (dn)); updateConfigEntry (TQString ("media.capture.save_dir"), TQString::fromLocal8Bit (dn));
mrlsetup += QString ("#save:") + QString::fromLocal8Bit (bn); mrlsetup += TQString ("#save:") + TQString::fromLocal8Bit (bn);
free (rm); free (rm);
} }
if (!xine_open (stream, (const char *) mrlsetup.local8Bit ())) { if (!xine_open (stream, (const char *) mrlsetup.local8Bit ())) {
@ -593,7 +593,7 @@ void KXinePlayer::play (int repeat) {
} }
audio_vis = false; audio_vis = false;
if (xine_get_stream_info (stream, XINE_STREAM_INFO_HAS_VIDEO)) if (xine_get_stream_info (stream, XINE_STREAM_INFO_HAS_VIDEO))
QApplication::postEvent(xineapp, new QEvent((QEvent::Type)event_video)); TQApplication::postEvent(xineapp, new TQEvent((TQEvent::Type)event_video));
else else
audio_vis = xine_config_lookup_entry audio_vis = xine_config_lookup_entry
(xine, "audio.visualization", &audio_vis_cfg_entry); (xine, "audio.visualization", &audio_vis_cfg_entry);
@ -613,11 +613,11 @@ void KXinePlayer::stop () {
xine_stop (sub_stream); xine_stop (sub_stream);
xine_stop (stream); xine_stop (stream);
mutex.unlock (); mutex.unlock ();
QTimer::singleShot (10, this, SLOT (postFinished ())); TQTimer::singleShot (10, this, TQT_SLOT (postFinished ()));
} }
void KXinePlayer::postFinished () { void KXinePlayer::postFinished () {
QApplication::postEvent (xineapp, new QEvent ((QEvent::Type) event_finished)); TQApplication::postEvent (xineapp, new TQEvent ((TQEvent::Type) event_finished));
} }
void KXinePlayer::pause () { void KXinePlayer::pause () {
@ -633,10 +633,10 @@ void KXinePlayer::pause () {
} }
void KXinePlayer::finished () { void KXinePlayer::finished () {
QTimer::singleShot (10, this, SLOT (stop ())); TQTimer::singleShot (10, this, TQT_SLOT (stop ()));
} }
void KXinePlayer::setAudioLang (int id, const QString & al) { void KXinePlayer::setAudioLang (int id, const TQString & al) {
alang = al; alang = al;
mutex.lock (); mutex.lock ();
if (xine_get_status (stream) == XINE_STATUS_PLAY) if (xine_get_status (stream) == XINE_STATUS_PLAY)
@ -644,7 +644,7 @@ void KXinePlayer::setAudioLang (int id, const QString & al) {
mutex.unlock (); mutex.unlock ();
} }
void KXinePlayer::setSubtitle (int id, const QString & sl) { void KXinePlayer::setSubtitle (int id, const TQString & sl) {
slang = sl; slang = sl;
mutex.lock (); mutex.lock ();
if (xine_get_status (stream) == XINE_STATUS_PLAY) if (xine_get_status (stream) == XINE_STATUS_PLAY)
@ -662,7 +662,7 @@ void KXinePlayer::updatePosition () {
movie_pos = pos; movie_pos = pos;
callback->moviePosition (pos/100); callback->moviePosition (pos/100);
} }
QTimer::singleShot (500, this, SLOT (updatePosition ())); TQTimer::singleShot (500, this, TQT_SLOT (updatePosition ()));
} }
void KXinePlayer::saturation (int val) { void KXinePlayer::saturation (int val) {
@ -721,7 +721,7 @@ void KXinePlayer::seek (int val) {
} }
} }
bool KXinePlayer::event (QEvent * e) { bool KXinePlayer::event (TQEvent * e) {
switch (e->type()) { switch (e->type()) {
case event_finished: { case event_finished: {
fprintf (stderr, "event_finished\n"); fprintf (stderr, "event_finished\n");
@ -748,7 +748,7 @@ bool KXinePlayer::event (QEvent * e) {
if (callback) if (callback)
callback->finished (); callback->finished ();
else else
QTimer::singleShot (0, this, SLOT (quit ())); TQTimer::singleShot (0, this, TQT_SLOT (quit ()));
break; break;
} }
case event_size: { case event_size: {
@ -758,7 +758,7 @@ bool KXinePlayer::event (QEvent * e) {
callback->movieParams (se->length/100, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0, se->alang, se->slang); callback->movieParams (se->length/100, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0, se->alang, se->slang);
if (se->first_frame) { if (se->first_frame) {
callback->playing (); callback->playing ();
QTimer::singleShot (500, this, SLOT (updatePosition ())); TQTimer::singleShot (500, this, TQT_SLOT (updatePosition ()));
} }
} }
break; break;
@ -772,7 +772,7 @@ bool KXinePlayer::event (QEvent * e) {
case event_url: { case event_url: {
XineURLEvent * ue = static_cast <XineURLEvent *> (e); XineURLEvent * ue = static_cast <XineURLEvent *> (e);
if (callback) if (callback)
callback->subMrl (ue->url, QString ()); callback->subMrl (ue->url, TQString ());
break; break;
} }
case event_title: { case event_title: {
@ -783,7 +783,7 @@ bool KXinePlayer::event (QEvent * e) {
} }
case event_video: case event_video:
if (callback) if (callback)
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, QString ()); callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, TQString ());
break; break;
default: default:
return false; return false;
@ -791,33 +791,33 @@ bool KXinePlayer::event (QEvent * e) {
return true; return true;
} }
void KXinePlayer::saveState (QSessionManager & sm) { void KXinePlayer::saveState (TQSessionManager & sm) {
if (callback) if (callback)
sm.setRestartHint (QSessionManager::RestartNever); sm.setRestartHint (TQSessionManager::RestartNever);
} }
XineMovieParamEvent::XineMovieParamEvent(int l, int w, int h, const QStringList & a, const QStringList & s, bool ff) XineMovieParamEvent::XineMovieParamEvent(int l, int w, int h, const TQStringList & a, const TQStringList & s, bool ff)
: QEvent ((QEvent::Type) event_size), : TQEvent ((TQEvent::Type) event_size),
length (l), width (w), height (h), alang (a), slang (s) , first_frame (ff) length (l), width (w), height (h), alang (a), slang (s) , first_frame (ff)
{} {}
XineURLEvent::XineURLEvent (const QString & u) XineURLEvent::XineURLEvent (const TQString & u)
: QEvent ((QEvent::Type) event_url), url (u) : TQEvent ((TQEvent::Type) event_url), url (u)
{} {}
XineTitleEvent::XineTitleEvent (const char * t) XineTitleEvent::XineTitleEvent (const char * t)
: QEvent ((QEvent::Type) event_title), title (QString::fromUtf8 (t)) : TQEvent ((TQEvent::Type) event_title), title (TQString::fromUtf8 (t))
{ {
QUrl::decode (title); TQUrl::decode (title);
} }
XineProgressEvent::XineProgressEvent (const int p) XineProgressEvent::XineProgressEvent (const int p)
: QEvent ((QEvent::Type) event_progress), progress (p) : TQEvent ((TQEvent::Type) event_progress), progress (p)
{} {}
//static bool translateCoordinates (int wx, int wy, int mx, int my) { //static bool translateCoordinates (int wx, int wy, int mx, int my) {
// movie_width // movie_width
class XEventThread : public QThread { class XEventThread : public TQThread {
protected: protected:
void run () { void run () {
Time prev_click_time = 0; Time prev_click_time = 0;
@ -1056,8 +1056,8 @@ int main(int argc, char **argv) {
snprintf(configfile, sizeof (configfile), "%s%s", xine_get_homedir(), "/.xine/config2"); snprintf(configfile, sizeof (configfile), "%s%s", xine_get_homedir(), "/.xine/config2");
xineapp = new KXinePlayer (argc, argv); xineapp = new KXinePlayer (argc, argv);
window_created = true; window_created = true;
QString vo_driver ("auto"); TQString vo_driver ("auto");
QString ao_driver ("auto"); TQString ao_driver ("auto");
for (int i = 1; i < argc; i++) { for (int i = 1; i < argc; i++) {
if (!strcmp (argv [i], "-vo") && ++i < argc) { if (!strcmp (argv [i], "-vo") && ++i < argc) {
vo_driver = argv [i]; vo_driver = argv [i];
@ -1079,9 +1079,9 @@ int main(int argc, char **argv) {
} else if (!strcmp (argv [i], "-window")) { } else if (!strcmp (argv [i], "-window")) {
; ;
} else if (!strcmp (argv [i], "-sub") && ++i < argc) { } else if (!strcmp (argv [i], "-sub") && ++i < argc) {
sub_mrl = QString (argv [i]); sub_mrl = TQString (argv [i]);
} else if (!strcmp (argv [i], "-lang") && ++i < argc) { } else if (!strcmp (argv [i], "-lang") && ++i < argc) {
slang = alang = QString (argv [i]); slang = alang = TQString (argv [i]);
} else if (!strcmp (argv [i], "-v")) { } else if (!strcmp (argv [i], "-v")) {
xine_verbose = true; xine_verbose = true;
} else if (!strcmp (argv [i], "-vv")) { } else if (!strcmp (argv [i], "-vv")) {
@ -1092,15 +1092,15 @@ int main(int argc, char **argv) {
strncpy (configfile, argv [i], sizeof (configfile)); strncpy (configfile, argv [i], sizeof (configfile));
configfile[sizeof (configfile) - 1] = 0; configfile[sizeof (configfile) - 1] = 0;
} else if (!strcmp (argv [i], "-cb") && ++i < argc) { } else if (!strcmp (argv [i], "-cb") && ++i < argc) {
QString str = argv [i]; TQString str = argv [i];
int pos = str.find ('/'); int pos = str.tqfind ('/');
if (pos > -1) { if (pos > -1) {
fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ()); fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ());
callback = new KMPlayer::Callback_stub callback = new KMPlayer::Callback_stub
(str.left (pos).ascii (), str.mid (pos + 1).ascii ()); (str.left (pos).ascii (), str.mid (pos + 1).ascii ());
} }
} else if (!strcmp (argv [i], "-rec") && i < argc - 1) { } else if (!strcmp (argv [i], "-rec") && i < argc - 1) {
rec_mrl = QString::fromLocal8Bit (argv [++i]); rec_mrl = TQString::fromLocal8Bit (argv [++i]);
} else if (!strcmp (argv [i], "-loop") && i < argc - 1) { } else if (!strcmp (argv [i], "-loop") && i < argc - 1) {
repeat_count = atol (argv [++i]); repeat_count = atol (argv [++i]);
} else { } else {
@ -1108,10 +1108,10 @@ int main(int argc, char **argv) {
delete xineapp; delete xineapp;
return 1; return 1;
} }
mrl = QString::fromLocal8Bit (argv [i]); mrl = TQString::fromLocal8Bit (argv [i]);
} }
} }
bool config_changed = !QFile (configfile).exists (); bool config_changed = !TQFile (configfile).exists ();
if (!callback && mrl.isEmpty ()) { if (!callback && mrl.isEmpty ()) {
fprintf (stderr, "usage: %s [-vo (xv|xshm)] [-ao (arts|esd|..)] " fprintf (stderr, "usage: %s [-vo (xv|xshm)] [-ao (arts|esd|..)] "
@ -1141,16 +1141,16 @@ int main(int argc, char **argv) {
xineapp->init (); xineapp->init ();
if (dvd_device) if (dvd_device)
config_changed |= updateConfigEntry (QString ("input.dvd_device"), QString (dvd_device)); config_changed |= updateConfigEntry (TQString ("input.dvd_device"), TQString (dvd_device));
if (vcd_device) if (vcd_device)
config_changed |= updateConfigEntry (QString ("input.vcd_device"), QString (vcd_device)); config_changed |= updateConfigEntry (TQString ("input.vcd_device"), TQString (vcd_device));
if (grab_device) if (grab_device)
config_changed |= updateConfigEntry (QString ("media.video4linux.video_device"), QString (grab_device)); config_changed |= updateConfigEntry (TQString ("media.video4linux.video_device"), TQString (grab_device));
if (config_changed) if (config_changed)
xine_config_save (xine, configfile); xine_config_save (xine, configfile);
QStringList vos = QStringList::split (',', vo_driver); TQStringList vos = TQStringList::split (',', vo_driver);
for (int i = 0; i < vos.size (); i++) { for (int i = 0; i < vos.size (); i++) {
if (vos[i] == "x11") if (vos[i] == "x11")
vos[i] = "xshm"; vos[i] = "xshm";
@ -1164,7 +1164,7 @@ int main(int argc, char **argv) {
} }
if (!vo_port) if (!vo_port)
fprintf (stderr, "no video driver found\n"); fprintf (stderr, "no video driver found\n");
QStringList aos = QStringList::split (',', ao_driver); TQStringList aos = TQStringList::split (',', ao_driver);
for (int i = 0; i < aos.size (); i++) { for (int i = 0; i < aos.size (); i++) {
fprintf (stderr, "trying audio driver %s ..\n", aos[i].ascii ()); fprintf (stderr, "trying audio driver %s ..\n", aos[i].ascii ());
ao_port = xine_open_audio_driver (xine, aos[i].ascii (), NULL); ao_port = xine_open_audio_driver (xine, aos[i].ascii (), NULL);
@ -1175,7 +1175,7 @@ int main(int argc, char **argv) {
fprintf (stderr, "audio driver initialisation failed\n"); fprintf (stderr, "audio driver initialisation failed\n");
stream = xine_stream_new (xine, ao_port, vo_port); stream = xine_stream_new (xine, ao_port, vo_port);
QByteArray buf; TQByteArray buf;
if (wants_config) { if (wants_config) {
/* TODO? Opening the output drivers in front, will add more config /* TODO? Opening the output drivers in front, will add more config
settings. Unfortunately, that also adds a second in startup.. settings. Unfortunately, that also adds a second in startup..
@ -1196,7 +1196,7 @@ int main(int argc, char **argv) {
if (callback) if (callback)
callback->started (dcopclient.appId (), buf); callback->started (dcopclient.appId (), buf);
else else
;//printf ("%s\n", QString (buf).ascii ()); ;//printf ("%s\n", TQString (buf).ascii ());
xineapp->exec (); xineapp->exec ();
if (sub_stream) if (sub_stream)

@ -19,38 +19,39 @@
#ifndef _KXINEPLAYER_H_ #ifndef _KXINEPLAYER_H_
#define _KXINEPLAYER_H_ #define _KXINEPLAYER_H_
#include <qapplication.h> #include <tqapplication.h>
#include <qstring.h> #include <tqstring.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qsessionmanager.h> #include <tqsessionmanager.h>
struct XineMovieParamEvent : public QEvent { struct XineMovieParamEvent : public TQEvent {
XineMovieParamEvent (int l, int w, int h, const QStringList & al, const QStringList & sl, bool ff=false); XineMovieParamEvent (int l, int w, int h, const TQStringList & al, const TQStringList & sl, bool ff=false);
int length; int length;
int width; int width;
int height; int height;
QStringList alang; TQStringList alang;
QStringList slang; TQStringList slang;
bool first_frame; bool first_frame;
}; };
struct XineURLEvent : public QEvent { struct XineURLEvent : public TQEvent {
XineURLEvent (const QString & u); XineURLEvent (const TQString & u);
QString url; TQString url;
}; };
struct XineTitleEvent : public QEvent { struct XineTitleEvent : public TQEvent {
XineTitleEvent (const char *); XineTitleEvent (const char *);
QString title; TQString title;
}; };
struct XineProgressEvent : public QEvent { struct XineProgressEvent : public TQEvent {
XineProgressEvent (int p); XineProgressEvent (int p);
int progress; int progress;
}; };
class KXinePlayer : public QApplication { class KXinePlayer : public TQApplication {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KXinePlayer (int argc, char ** argv); KXinePlayer (int argc, char ** argv);
~KXinePlayer (); ~KXinePlayer ();
@ -63,9 +64,9 @@ public:
void brightness (int val); void brightness (int val);
void volume (int val); void volume (int val);
void seek (int val); void seek (int val);
bool event (QEvent * e); bool event (TQEvent * e);
void setAudioLang (int, const QString &); void setAudioLang (int, const TQString &);
void setSubtitle (int, const QString &); void setSubtitle (int, const TQString &);
public slots: public slots:
void play (int repeat_count); void play (int repeat_count);
void stop (); void stop ();
@ -73,7 +74,7 @@ public slots:
void updatePosition (); void updatePosition ();
void postFinished (); void postFinished ();
protected: protected:
void saveState (QSessionManager & sm); void saveState (TQSessionManager & sm);
}; };
#endif //_KXINEPLAYER_H_ #endif //_KXINEPLAYER_H_

@ -22,13 +22,13 @@
#include <math.h> #include <math.h>
#include <config.h> #include <config.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <qcstring.h> #include <tqcstring.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qfile.h> #include <tqfile.h>
#include <qurl.h> #include <tqurl.h>
#include <qthread.h> #include <tqthread.h>
#include <qmutex.h> #include <tqmutex.h>
#include <qdom.h> #include <tqdom.h>
#include "kmplayer_backend.h" #include "kmplayer_backend.h"
#include "kmplayer_callback_stub.h" #include "kmplayer_callback_stub.h"
#include "kmplayer_callback.h" #include "kmplayer_callback.h"
@ -60,7 +60,7 @@ static bool reset_xv_autopaint_colorkey;
static bool reset_xv_mute; static bool reset_xv_mute;
static int xvport; static int xvport;
static int xv_encoding = -1; static int xv_encoding = -1;
static QString xv_norm; static TQString xv_norm;
static int xv_frequency; static int xv_frequency;
static int screen; static int screen;
static int movie_width; static int movie_width;
@ -84,21 +84,21 @@ enum {
limit_last limit_last
}; };
static struct Limit { int min; int max; } xv_limits [limit_last]; static struct Limit { int min; int max; } xv_limits [limit_last];
static QString elmentry ("entry"); static TQString elmentry ("entry");
static QString elmitem ("item"); static TQString elmitem ("item");
static QString attname ("name"); static TQString attname ("name");
static QString atttype ("type"); static TQString atttype ("type");
static QString attdefault ("DEFAULT"); static TQString attdefault ("DEFAULT");
static QString attvalue ("value"); static TQString attvalue ("value");
//static QString attstart ("START"); //static TQString attstart ("START");
//static QString attend ("END"); //static TQString attend ("END");
//static QString valrange ("range"); //static TQString valrange ("range");
//static QString valnum ("num"); //static TQString valnum ("num");
//static QString valbool ("bool"); //static TQString valbool ("bool");
//static QString valenum ("enum"); //static TQString valenum ("enum");
//static QString valstring ("string"); //static TQString valstring ("string");
static QString valtree ("tree"); static TQString valtree ("tree");
static QByteArray config_buf; static TQByteArray config_buf;
extern "C" { extern "C" {
@ -113,15 +113,15 @@ static void putVideo () {
using namespace KMPlayer; using namespace KMPlayer;
Backend::Backend () Backend::Backend ()
: DCOPObject (QCString ("Backend")) { : DCOPObject (TQCString ("Backend")) {
} }
Backend::~Backend () {} Backend::~Backend () {}
void Backend::setURL (QString) { void Backend::setURL (TQString) {
} }
void Backend::setSubTitleURL (QString) { void Backend::setSubTitleURL (TQString) {
} }
void Backend::play (int) { void Backend::play (int) {
@ -129,7 +129,7 @@ void Backend::play (int) {
} }
void Backend::stop () { void Backend::stop () {
QTimer::singleShot (0, xvapp, SLOT (stop ())); TQTimer::singleShot (0, xvapp, TQT_SLOT (stop ()));
} }
void Backend::pause () { void Backend::pause () {
@ -167,10 +167,10 @@ void Backend::frequency (int f) {
xvapp->frequency (f); xvapp->frequency (f);
} }
void Backend::setAudioLang (int, QString) { void Backend::setAudioLang (int, TQString) {
} }
void Backend::setSubtitle (int, QString) { void Backend::setSubtitle (int, TQString) {
} }
void Backend::quit () { void Backend::quit () {
@ -179,29 +179,29 @@ void Backend::quit () {
if (running) if (running)
stop (); stop ();
else else
QTimer::singleShot (0, qApp, SLOT (quit ())); TQTimer::singleShot (0, tqApp, TQT_SLOT (quit ()));
} }
bool updateConfigEntry (const QString & name, const QString & value) { bool updateConfigEntry (const TQString & name, const TQString & value) {
fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ()); fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ());
return true; return true;
} }
void Backend::setConfig (QByteArray data) { void Backend::setConfig (TQByteArray data) {
QString err; TQString err;
int line, column; int line, column;
QDomDocument dom; TQDomDocument dom;
if (dom.setContent (data, false, &err, &line, &column)) { if (dom.setContent (data, false, &err, &line, &column)) {
if (dom.childNodes().length() == 1) { if (dom.childNodes().length() == 1) {
for (QDomNode node = dom.firstChild().firstChild(); for (TQDomNode node = dom.firstChild().firstChild();
!node.isNull (); !node.isNull ();
node = node.nextSibling ()) { node = node.nextSibling ()) {
QDomNamedNodeMap attr = node.attributes (); TQDomNamedNodeMap attr = node.attributes ();
updateConfigEntry (attr.namedItem (attname).nodeValue (), updateConfigEntry (attr.namedItem (attname).nodeValue (),
attr.namedItem (attvalue).nodeValue ()); attr.namedItem (attvalue).nodeValue ());
} }
} else } else
err = QString ("invalid data"); err = TQString ("invalid data");
} }
if (callback) if (callback)
callback->errorMessage (0, err); callback->errorMessage (0, err);
@ -212,7 +212,7 @@ bool Backend::isPlaying () {
} }
KXVideoPlayer::KXVideoPlayer (int _argc, char ** _argv) KXVideoPlayer::KXVideoPlayer (int _argc, char ** _argv)
: QApplication (_argc, _argv, false), mute_timer (0) { : TQApplication (_argc, _argv, false), mute_timer (0) {
} }
void KXVideoPlayer::init () { void KXVideoPlayer::init () {
@ -226,17 +226,17 @@ void KXVideoPlayer::init () {
wid = XCreateSimpleWindow(display, XDefaultRootWindow(display), wid = XCreateSimpleWindow(display, XDefaultRootWindow(display),
xpos, ypos, width, height, 1, 0, 0); xpos, ypos, width, height, 1, 0, 0);
if (!callback) if (!callback)
QTimer::singleShot (10, this, SLOT (play ())); TQTimer::singleShot (10, this, TQT_SLOT (play ()));
XSelectInput (display, wid, XSelectInput (display, wid,
(PointerMotionMask | ExposureMask | KeyPressMask | ButtonPressMask | StructureNotifyMask)); // | SubstructureNotifyMask)); (PointerMotionMask | ExposureMask | KeyPressMask | ButtonPressMask | StructureNotifyMask)); // | SubstructureNotifyMask));
XvAdaptorInfo * ai; XvAdaptorInfo * ai;
unsigned int adaptors; unsigned int adaptors;
xv_success = true; xv_success = true;
QDomDocument doc; TQDomDocument doc;
QDomElement root = doc.createElement (QString ("document")); TQDomElement root = doc.createElement (TQString ("document"));
if (XvQueryAdaptors (display, XDefaultRootWindow (display), &adaptors, &ai) == Success) { if (XvQueryAdaptors (display, XDefaultRootWindow (display), &adaptors, &ai) == Success) {
QDomElement elm = doc.createElement (elmentry); TQDomElement elm = doc.createElement (elmentry);
elm.setAttribute (attname, QString ("XVideo")); elm.setAttribute (attname, TQString ("XVideo"));
elm.setAttribute (atttype, valtree); elm.setAttribute (atttype, valtree);
for (unsigned i = 0; i < adaptors; i++) { for (unsigned i = 0; i < adaptors; i++) {
if ((ai[i].type & XvInputMask) && if ((ai[i].type & XvInputMask) &&
@ -270,21 +270,21 @@ void KXVideoPlayer::init () {
unsigned nr_encode; unsigned nr_encode;
XvQueryEncodings (display, port, &nr_encode, &encodings); XvQueryEncodings (display, port, &nr_encode, &encodings);
if (encodings) { if (encodings) {
QDomElement port_item = doc.createElement (QString("Port")); TQDomElement port_item = doc.createElement (TQString("Port"));
port_item.setAttribute (attvalue, QString::number (port)); port_item.setAttribute (attvalue, TQString::number (port));
if (freq_found) if (freq_found)
port_item.setAttribute (QString("FREQ"), QString("1")); port_item.setAttribute (TQString("FREQ"), TQString("1"));
for (unsigned i = 0; i < nr_encode; i++) { for (unsigned i = 0; i < nr_encode; i++) {
if (strcmp (encodings[i].name, "XV_IMAGE")) { if (strcmp (encodings[i].name, "XV_IMAGE")) {
if (xvport == port && xv_encoding < 0 && !xv_norm.isEmpty () && QString (encodings[i].name).lower ().startsWith(xv_norm.lower ())) if (xvport == port && xv_encoding < 0 && !xv_norm.isEmpty () && TQString (encodings[i].name).lower ().startsWith(xv_norm.lower ()))
xv_encoding = encodings[i].encoding_id; xv_encoding = encodings[i].encoding_id;
if (port == xvport && encodings[i].encoding_id == xv_encoding) { if (port == xvport && encodings[i].encoding_id == xv_encoding) {
movie_width = encodings[i].width; movie_width = encodings[i].width;
movie_height = encodings[i].height; movie_height = encodings[i].height;
} }
QDomElement item = doc.createElement (QString ("Input")); TQDomElement item = doc.createElement (TQString ("Input"));
item.setAttribute (attvalue, QString::number (encodings[i].encoding_id)); item.setAttribute (attvalue, TQString::number (encodings[i].encoding_id));
item.setAttribute (attname, QString (encodings[i].name)); item.setAttribute (attname, TQString (encodings[i].name));
port_item.appendChild (item); port_item.appendChild (item);
fprintf (stderr, " encoding: %d %s\n", ( int ) encodings[i].encoding_id, encodings[i].name); fprintf (stderr, " encoding: %d %s\n", ( int ) encodings[i].encoding_id, encodings[i].name);
} }
@ -298,7 +298,7 @@ void KXVideoPlayer::init () {
XvFreeAdaptorInfo(ai); XvFreeAdaptorInfo(ai);
} }
doc.appendChild (root); doc.appendChild (root);
QCString exp = doc.toCString (); TQCString exp = doc.toCString ();
config_buf = exp; config_buf = exp;
//fprintf (stderr, "%s\n", (const char *)exp); //fprintf (stderr, "%s\n", (const char *)exp);
config_buf.resize (exp.length ()); // strip terminating \0 config_buf.resize (exp.length ()); // strip terminating \0
@ -332,11 +332,11 @@ KXVideoPlayer::~KXVideoPlayer () {
xvapp = 0L; xvapp = 0L;
} }
void getConfigEntries (QByteArray & buf) { void getConfigEntries (TQByteArray & buf) {
QDomDocument doc; TQDomDocument doc;
QDomElement root = doc.createElement (QString ("document")); TQDomElement root = doc.createElement (TQString ("document"));
doc.appendChild (root); doc.appendChild (root);
QCString exp = doc.toCString (); TQCString exp = doc.toCString ();
buf = exp; buf = exp;
buf.resize (exp.length ()); // strip terminating \0 buf.resize (exp.length ()); // strip terminating \0
} }
@ -346,7 +346,7 @@ void KXVideoPlayer::play () {
if (!xv_success) if (!xv_success)
return; return;
if (callback && movie_width > 0 && movie_height > 0) if (callback && movie_width > 0 && movie_height > 0)
callback->movieParams (0, movie_width, movie_height, 1.0*movie_width/movie_height, QStringList (), QStringList ()); callback->movieParams (0, movie_width, movie_height, 1.0*movie_width/movie_height, TQStringList (), TQStringList ());
XLockDisplay (display); XLockDisplay (display);
if (!running && XvGrabPort (display, xvport, CurrentTime) == Success) { if (!running && XvGrabPort (display, xvport, CurrentTime) == Success) {
gc = XCreateGC (display, wid, 0, NULL); gc = XCreateGC (display, wid, 0, NULL);
@ -404,7 +404,7 @@ void KXVideoPlayer::play () {
putVideo (); putVideo ();
if (callback) { if (callback) {
callback->playing (); callback->playing ();
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, QString ()); callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, TQString ());
} }
} }
XUnlockDisplay (display); XUnlockDisplay (display);
@ -435,11 +435,11 @@ void KXVideoPlayer::stop () {
if (callback) if (callback)
callback->finished (); callback->finished ();
else else
QTimer::singleShot (0, qApp, SLOT (quit ())); TQTimer::singleShot (0, tqApp, TQT_SLOT (quit ()));
} }
void KXVideoPlayer::finished () { void KXVideoPlayer::finished () {
QTimer::singleShot (10, this, SLOT (stop ())); TQTimer::singleShot (10, this, TQT_SLOT (stop ()));
} }
void KXVideoPlayer::saturation (int val) { void KXVideoPlayer::saturation (int val) {
@ -502,12 +502,12 @@ void KXVideoPlayer::frequency (int val) {
} }
} }
void KXVideoPlayer::saveState (QSessionManager & sm) { void KXVideoPlayer::saveState (TQSessionManager & sm) {
if (callback) if (callback)
sm.setRestartHint (QSessionManager::RestartNever); sm.setRestartHint (TQSessionManager::RestartNever);
} }
void KXVideoPlayer::timerEvent (QTimerEvent * e) { void KXVideoPlayer::timerEvent (TQTimerEvent * e) {
if (e->timerId () == mute_timer) { if (e->timerId () == mute_timer) {
int step = (current_volume - xv_limits[limit_volume].min) / 20; int step = (current_volume - xv_limits[limit_volume].min) / 20;
if (step > 0 && tmp_volume == xv_limits[limit_volume].min) { if (step > 0 && tmp_volume == xv_limits[limit_volume].min) {
@ -528,7 +528,7 @@ void KXVideoPlayer::timerEvent (QTimerEvent * e) {
killTimer (e->timerId ()); killTimer (e->timerId ());
} }
class XEventThread : public QThread { class XEventThread : public TQThread {
protected: protected:
void run () { void run () {
Time prev_click_time = 0; Time prev_click_time = 0;
@ -647,8 +647,8 @@ int main(int argc, char **argv) {
strncpy (configfile, argv [++i], sizeof (configfile)); strncpy (configfile, argv [++i], sizeof (configfile));
configfile[sizeof (configfile) - 1] = 0; configfile[sizeof (configfile) - 1] = 0;
} else if (!strcmp (argv [i], "-cb")) { } else if (!strcmp (argv [i], "-cb")) {
QString str = argv [++i]; TQString str = argv [++i];
int pos = str.find ('/'); int pos = str.tqfind ('/');
if (pos > -1) { if (pos > -1) {
fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ()); fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ());
callback = new KMPlayer::Callback_stub callback = new KMPlayer::Callback_stub

@ -20,12 +20,13 @@
#ifndef _K_XV_PLAYER_H_ #ifndef _K_XV_PLAYER_H_
#define _K_XV_PLAYER_H_ #define _K_XV_PLAYER_H_
#include <qapplication.h> #include <tqapplication.h>
#include <qstring.h> #include <tqstring.h>
#include <qsessionmanager.h> #include <tqsessionmanager.h>
class KXVideoPlayer : public QApplication { class KXVideoPlayer : public TQApplication {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KXVideoPlayer (int argc, char ** argv); KXVideoPlayer (int argc, char ** argv);
~KXVideoPlayer (); ~KXVideoPlayer ();
@ -39,7 +40,7 @@ public:
void volume (int val); void volume (int val);
void frequency (int val); void frequency (int val);
//void seek (int val); //void seek (int val);
//bool event (QEvent * e); //bool event (TQEvent * e);
public slots: public slots:
void play (); void play ();
void stop (); void stop ();
@ -47,8 +48,8 @@ public slots:
//void updatePosition (); //void updatePosition ();
//void postFinished (); //void postFinished ();
protected: protected:
void saveState (QSessionManager & sm); void saveState (TQSessionManager & sm);
void timerEvent (QTimerEvent *); void timerEvent (TQTimerEvent *);
private: private:
int mute_timer; int mute_timer;
}; };

Loading…
Cancel
Save