Browse Source

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 10 years ago
parent
commit
769e63d24a
59 changed files with 4348 additions and 4298 deletions
  1. +1
    -1
      configure.in
  2. +1
    -1
      configure.in.in
  3. +1
    -1
      src/Makefile.am
  4. +91
    -91
      src/gstplayer.cpp
  5. +9
    -8
      src/gstplayer.h
  6. +23
    -22
      src/kmplayer.h
  7. +6
    -6
      src/kmplayer_asx.cpp
  8. +5
    -5
      src/kmplayer_asx.h
  9. +12
    -12
      src/kmplayer_atom.cpp
  10. +3
    -3
      src/kmplayer_atom.h
  11. +5
    -5
      src/kmplayer_backend.h
  12. +6
    -6
      src/kmplayer_callback.h
  13. +40
    -40
      src/kmplayer_koffice_part.cpp
  14. +17
    -15
      src/kmplayer_koffice_part.h
  15. +158
    -158
      src/kmplayer_part.cpp
  16. +31
    -27
      src/kmplayer_part.h
  17. +22
    -22
      src/kmplayer_rp.cpp
  18. +6
    -6
      src/kmplayer_rp.h
  19. +5
    -5
      src/kmplayer_rss.cpp
  20. +4
    -4
      src/kmplayer_rss.h
  21. +223
    -223
      src/kmplayer_smil.cpp
  22. +83
    -82
      src/kmplayer_smil.h
  23. +3
    -3
      src/kmplayer_xspf.cpp
  24. +4
    -4
      src/kmplayer_xspf.h
  25. +397
    -396
      src/kmplayerapp.cpp
  26. +44
    -36
      src/kmplayerappsource.h
  27. +196
    -200
      src/kmplayerbroadcast.cpp
  28. +69
    -66
      src/kmplayerbroadcast.h
  29. +45
    -53
      src/kmplayerconfig.cpp
  30. +24
    -23
      src/kmplayerconfig.h
  31. +104
    -104
      src/kmplayercontrolpanel.cpp
  32. +45
    -41
      src/kmplayercontrolpanel.h
  33. +252
    -256
      src/kmplayerpartbase.cpp
  34. +57
    -53
      src/kmplayerpartbase.h
  35. +148
    -148
      src/kmplayerplaylist.cpp
  36. +60
    -60
      src/kmplayerplaylist.h
  37. +396
    -396
      src/kmplayerprocess.cpp
  38. +105
    -94
      src/kmplayerprocess.h
  39. +34
    -33
      src/kmplayersource.h
  40. +161
    -161
      src/kmplayertvsource.cpp
  41. +49
    -45
      src/kmplayertvsource.h
  42. +150
    -150
      src/kmplayervdr.cpp
  43. +23
    -20
      src/kmplayervdr.h
  44. +103
    -103
      src/kmplayerview.cpp
  45. +42
    -40
      src/kmplayerview.h
  46. +5
    -5
      src/main.cpp
  47. +20
    -20
      src/npplayer.c
  48. +126
    -126
      src/playlistview.cpp
  49. +46
    -45
      src/playlistview.h
  50. +373
    -373
      src/pref.cpp
  51. +113
    -102
      src/pref.h
  52. +59
    -59
      src/triestring.cpp
  53. +3
    -3
      src/triestring.h
  54. +109
    -109
      src/viewarea.cpp
  55. +21
    -20
      src/viewarea.h
  56. +117
    -117
      src/xineplayer.cpp
  57. +20
    -19
      src/xineplayer.h
  58. +65
    -65
      src/xvplayer.cpp
  59. +8
    -7
      src/xvplayer.h

+ 1
- 1
configure.in View File

@ -219,7 +219,7 @@ if test "$buildnpp" = "yes"; then
if test "x$have_dbus" = "xyes"; then
have_nspr=yes
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`"
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`"


+ 1
- 1
configure.in.in View File

@ -154,7 +154,7 @@ if test "$buildnpp" = "yes"; then
if test "x$have_dbus" = "xyes"; then
have_nspr=yes
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`"
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`"


+ 1
- 1
src/Makefile.am View File

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


+ 91
- 91
src/gstplayer.cpp View File

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


+ 9
- 8
src/gstplayer.h View File

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

+ 23
- 22
src/kmplayer.h View File

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

+ 6
- 6
src/kmplayer_asx.cpp View File

@ -24,14 +24,14 @@
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 ())
if (attr == a->name ().toString ().lower ())
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 ();
if (!strcasecmp (name, "entry"))
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 ();
if (!strcasecmp (name, "ref"))
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 ())
if (e->id == id_node_param) {
Element * elm = convertNode <Element> (e);
if (getAsxAttribute(elm,"name").lower() == QString("clipsummary")) {
if (getAsxAttribute(elm,"name").lower() == TQString("clipsummary")) {
PlayListNotify * n = document ()->notify_listener;
if (n)
n->setInfoMessage (KURL::decode_string (
@ -119,7 +119,7 @@ KDE_NO_EXPORT void ASX::Entry::activate () {
KDE_NO_EXPORT void ASX::Entry::deactivate () {
PlayListNotify * n = document ()->notify_listener;
if (n)
n->setInfoMessage (QString ());
n->setInfoMessage (TQString ());
}
KDE_NO_EXPORT bool ASX::Entry::expose () const {


+ 5
- 5
src/kmplayer_asx.h View File

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_ASX_H_
#define _KMPLAYER_ASX_H_
#include <qstring.h>
#include <tqstring.h>
#include "kmplayerplaylist.h"
@ -45,7 +45,7 @@ const short id_node_duration = 408;
class KMPLAYER_NO_EXPORT Asx : public Mrl {
public:
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"; }
bool expose () const { return !pretty_name.isEmpty (); }
PlayType playType ();
@ -58,7 +58,7 @@ class KMPLAYER_NO_EXPORT Entry : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Entry (NodePtr & d)
: 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"; }
/**
* 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 {
public:
KDE_NO_CDTOR_EXPORT Ref (NodePtr & d) : Mrl (d, id_node_ref) {}
//NodePtr childFromTag (const QString & tag);
//NodePtr childFromTag (const TQString & tag);
void opened ();
KDE_NO_EXPORT const char * nodeName () const { return "Ref"; }
bool expose () const;
@ -88,7 +88,7 @@ public:
class KMPLAYER_NO_EXPORT EntryRef : public Mrl {
public:
KDE_NO_CDTOR_EXPORT EntryRef (NodePtr & d) : Mrl (d, id_node_entryref) {}
//NodePtr childFromTag (const QString & tag);
//NodePtr childFromTag (const TQString & tag);
void opened ();
KDE_NO_EXPORT const char * nodeName () const { return "EntryRef"; }
};


+ 12
- 12
src/kmplayer_atom.cpp View File

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


+ 3
- 3
src/kmplayer_atom.h View File

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_ATOM_H_
#define _KMPLAYER_ATOM_H_
#include <qstringlist.h>
#include <tqstringlist.h>
#include "kmplayerplaylist.h"
@ -42,7 +42,7 @@ const short id_node_content = 305;
class KMPLAYER_NO_EXPORT Feed : public Mrl {
public:
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"; }
void closed ();
bool expose () const { return !pretty_name.isEmpty (); }
@ -51,7 +51,7 @@ public:
class KMPLAYER_NO_EXPORT Entry : public Mrl {
public:
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"; }
PlayType playType () { return play_type_none; }
void closed ();


+ 5
- 5
src/kmplayer_backend.h View File

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


+ 6
- 6
src/kmplayer_callback.h View File

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


+ 40
- 40
src/kmplayer_koffice_part.cpp View File

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


+ 17
- 15
src/kmplayer_koffice_part.h View File

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


+ 158
- 158
src/kmplayer_part.cpp View File

@ -23,10 +23,10 @@
#include <algorithm>
#include <config.h>
#include <qpopupmenu.h>
#include <qtimer.h>
#include <qpushbutton.h>
#include <qslider.h>
#include <tqpopupmenu.h>
#include <tqtimer.h>
#include <tqpushbutton.h>
#include <tqslider.h>
class KXMLGUIClient; // workaround for kde3.3 on sarge with gcc4, kactioncollection.h does not forward declare KXMLGUIClient
#include <klibloader.h>
@ -72,17 +72,17 @@ KDE_NO_CDTOR_EXPORT KMPlayerPartStatic::~KMPlayerPartStatic () {
struct KMPLAYER_NO_EXPORT GroupPredicate {
const KMPlayerPart * m_part;
const QString & m_group;
const TQString & m_group;
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) {}
bool operator () (const KMPlayerPart * part) const {
return ((m_get_any && part != m_part &&
!part->master () && !part->url ().isEmpty ()) ||
(m_part->allowRedir (part->m_docbase) &&
(part->m_group == m_group ||
part->m_group == QString::fromLatin1("_master") ||
m_group == QString::fromLatin1("_master")) &&
part->m_group == TQString::tqfromLatin1("_master") ||
m_group == TQString::tqfromLatin1("_master")) &&
(part->m_features & KMPlayerPart::Feat_Viewer) !=
(m_part->m_features & KMPlayerPart::Feat_Viewer)));
}
@ -97,9 +97,9 @@ public:
KMPlayerFactory ();
virtual ~KMPlayerFactory ();
virtual KParts::Part *createPartObject
(QWidget *wparent, const char *wname,
QObject *parent, const char *name,
const char *className, const QStringList &args);
(TQWidget *wtqparent, const char *wname,
TQObject *tqparent, const char *name,
const char *className, const TQStringList &args);
static KInstance * instance () { return s_instance; }
private:
static KInstance * s_instance;
@ -118,27 +118,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerFactory::~KMPlayerFactory () {
}
KDE_NO_EXPORT KParts::Part *KMPlayerFactory::createPartObject
(QWidget *wparent, const char *wname,
QObject *parent, const char * name,
const char * cls, const QStringList & args) {
(TQWidget *wtqparent, const char *wname,
TQObject *tqparent, const char * name,
const char * cls, const TQStringList & args) {
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) {
return (value.lower() != QString::fromLatin1("false") &&
value.lower() != QString::fromLatin1("off") &&
value.lower() != QString::fromLatin1("0"));
static bool getBoolValue (const TQString & value) {
return (value.lower() != TQString::tqfromLatin1("false") &&
value.lower() != TQString::tqfromLatin1("off") &&
value.lower() != TQString::tqfromLatin1("0"));
}
#define SET_FEAT_ON(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,
QObject * parent, const char *name, const QStringList &args)
: PartBase (wparent, wname, parent, name, new KConfig ("kmplayerrc")),
KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (TQWidget * wtqparent, const char *wname,
TQObject * tqparent, const char *name, const TQStringList &args)
: PartBase (wtqparent, wname, tqparent, name, new KConfig ("kmplayerrc")),
m_master (0L),
m_browserextension (new KMPlayerBrowserExtension (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));
#ifdef HAVE_NSPR
KMPlayer::NpPlayer *npp = (KMPlayer::NpPlayer *) players () ["npp"];
connect (npp, SIGNAL (evaluate (const QString &, QString &)),
m_liveconnectextension, SLOT (evaluate (const QString &, QString &)));
connect (npp, SIGNAL (openUrl (const KURL &, const QString &)),
connect (npp, TQT_SIGNAL (evaluate (const TQString &, TQString &)),
m_liveconnectextension, TQT_SLOT (evaluate (const TQString &, TQString &)));
connect (npp, TQT_SIGNAL (openUrl (const KURL &, const TQString &)),
m_browserextension,
SLOT (slotRequestOpenURL (const KURL &, const QString &)));
TQT_SLOT (slotRequestOpenURL (const KURL &, const TQString &)));
#endif
/*KAction *playact =*/ new KAction(i18n("P&lay"), QString ("player_play"), KShortcut (), this, SLOT(play ()), actionCollection (), "play");
/*KAction *pauseact =*/ new KAction(i18n("&Pause"), QString ("player_pause"), KShortcut (), this, SLOT(pause ()), actionCollection (), "pause");
/*KAction *stopact =*/ new KAction(i18n("&Stop"), QString ("player_stop"), KShortcut (), this, SLOT(stop ()), actionCollection (), "stop");
new KAction (i18n ("Increase Volume"), QString ("player_volume"), KShortcut (), this, SLOT (increaseVolume ()), actionCollection (), "edit_volume_up");
new KAction (i18n ("Decrease Volume"), QString ("player_volume"), KShortcut (), this, SLOT (decreaseVolume ()), actionCollection (), "edit_volume_down");
/*KAction *playact =*/ new KAction(i18n("P&lay"), TQString ("player_play"), KShortcut (), this, TQT_SLOT(play ()), actionCollection (), "play");
/*KAction *pauseact =*/ new KAction(i18n("&Pause"), TQString ("player_pause"), KShortcut (), this, TQT_SLOT(pause ()), actionCollection (), "pause");
/*KAction *stopact =*/ new KAction(i18n("&Stop"), TQString ("player_stop"), KShortcut (), this, TQT_SLOT(stop ()), actionCollection (), "stop");
new KAction (i18n ("Increase Volume"), TQString ("player_volume"), KShortcut (), this, TQT_SLOT (increaseVolume ()), actionCollection (), "edit_volume_up");
new KAction (i18n ("Decrease Volume"), TQString ("player_volume"), KShortcut (), this, TQT_SLOT (decreaseVolume ()), actionCollection (), "edit_volume_down");
Source * urlsource = m_sources ["urlsource"];
KMPlayer::ControlPanel * panel = m_view->controlPanel ();
QStringList::const_iterator it = args.begin ();
QStringList::const_iterator end = args.end ();
TQStringList::const_iterator it = args.begin ();
TQStringList::const_iterator end = args.end ();