diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
commit | c663b6440964f6ac48027143ac9e63298991f9d0 (patch) | |
tree | 6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /nsplugins/viewer | |
parent | a061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff) | |
download | tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'nsplugins/viewer')
-rw-r--r-- | nsplugins/viewer/NSPluginClassIface.h | 18 | ||||
-rw-r--r-- | nsplugins/viewer/glibevents.cpp | 4 | ||||
-rw-r--r-- | nsplugins/viewer/glibevents.h | 6 | ||||
-rw-r--r-- | nsplugins/viewer/kxt.cpp | 72 | ||||
-rw-r--r-- | nsplugins/viewer/kxt.h | 18 | ||||
-rw-r--r-- | nsplugins/viewer/nsplugin.cpp | 242 | ||||
-rw-r--r-- | nsplugins/viewer/nsplugin.h | 136 | ||||
-rw-r--r-- | nsplugins/viewer/qxteventloop.cpp | 74 | ||||
-rw-r--r-- | nsplugins/viewer/qxteventloop.h | 14 | ||||
-rw-r--r-- | nsplugins/viewer/viewer.cpp | 28 |
10 files changed, 306 insertions, 306 deletions
diff --git a/nsplugins/viewer/NSPluginClassIface.h b/nsplugins/viewer/NSPluginClassIface.h index 20fd6ed03..7eb71f27d 100644 --- a/nsplugins/viewer/NSPluginClassIface.h +++ b/nsplugins/viewer/NSPluginClassIface.h @@ -25,8 +25,8 @@ #define __NSPluginClassIface_h__ -#include <qstringlist.h> -#include <qcstring.h> +#include <tqstringlist.h> +#include <tqcstring.h> #include <dcopobject.h> #include <dcopref.h> @@ -37,7 +37,7 @@ class NSPluginViewerIface : virtual public DCOPObject k_dcop: virtual void shutdown() = 0; - virtual DCOPRef newClass(QString plugin) = 0; + virtual DCOPRef newClass(TQString plugin) = 0; }; @@ -47,11 +47,11 @@ class NSPluginClassIface : virtual public DCOPObject k_dcop: - virtual DCOPRef newInstance(QString url, QString mimeType, Q_INT8 embed, - QStringList argn, QStringList argv, - QString appId, QString callbackId, Q_INT8 reload, - Q_INT8 doPost, QByteArray postData, Q_UINT32 xembed) = 0; - virtual QString getMIMEDescription() = 0; + virtual DCOPRef newInstance(TQString url, TQString mimeType, Q_INT8 embed, + TQStringList argn, TQStringList argv, + TQString appId, TQString callbackId, Q_INT8 reload, + Q_INT8 doPost, TQByteArray postData, Q_UINT32 xembed) = 0; + virtual TQString getMIMEDescription() = 0; }; @@ -70,7 +70,7 @@ k_dcop: virtual void resizePlugin(Q_INT32 w, Q_INT32 h) = 0; - virtual void javascriptResult(Q_INT32 id, QString result) = 0; + virtual void javascriptResult(Q_INT32 id, TQString result) = 0; virtual void displayPlugin() = 0; diff --git a/nsplugins/viewer/glibevents.cpp b/nsplugins/viewer/glibevents.cpp index b1012675b..fe059d1ee 100644 --- a/nsplugins/viewer/glibevents.cpp +++ b/nsplugins/viewer/glibevents.cpp @@ -19,12 +19,12 @@ #include "glibevents.h" -#include <qapplication.h> +#include <tqapplication.h> GlibEvents::GlibEvents() { g_main_context_ref( g_main_context_default()); - connect( &timer, SIGNAL( timeout()), SLOT( process())); + connect( &timer, TQT_SIGNAL( timeout()), TQT_SLOT( process())); // TODO Poll for now timer.start( 10 ); } diff --git a/nsplugins/viewer/glibevents.h b/nsplugins/viewer/glibevents.h index 8a890807b..396273a85 100644 --- a/nsplugins/viewer/glibevents.h +++ b/nsplugins/viewer/glibevents.h @@ -20,8 +20,8 @@ #ifndef GLIBEVENTS_H #define GLIBEVENTS_H -#include <qwidget.h> -#include <qtimer.h> +#include <tqwidget.h> +#include <tqtimer.h> #include <glib.h> @@ -35,7 +35,7 @@ class GlibEvents private slots: void process(); private: - QTimer timer; + TQTimer timer; }; #endif diff --git a/nsplugins/viewer/kxt.cpp b/nsplugins/viewer/kxt.cpp index 7f2e04b54..9f5f43d51 100644 --- a/nsplugins/viewer/kxt.cpp +++ b/nsplugins/viewer/kxt.cpp @@ -44,15 +44,15 @@ ** *****************************************************************************/ -#include <qglobal.h> +#include <tqglobal.h> #if QT_VERSION < 0x030100 #include <kapplication.h> -#include <qwidget.h> -#include <qobjectlist.h> -#include <qwidgetlist.h> +#include <tqwidget.h> +#include <tqobjectlist.h> +#include <tqwidgetlist.h> #include <kdebug.h> -#include <qtimer.h> +#include <tqtimer.h> #include "kxt.h" @@ -136,15 +136,15 @@ typedef struct _QWidgetRec { static -void reparentChildrenOf(QWidget* parent) +void reparentChildrenOf(TQWidget* parent) { if ( !parent->children() ) return; // nothing to do - for ( QObjectListIt it( *parent->children() ); it.current(); ++it ) { + for ( TQObjectListIt it( *parent->children() ); it.current(); ++it ) { if ( it.current()->isWidgetType() ) { - QWidget* widget = (QWidget*)it.current(); + TQWidget* widget = (TQWidget*)it.current(); XReparentWindow( qt_xdisplay(), widget->winId(), parent->winId(), @@ -177,7 +177,7 @@ static QWidgetClassRec qwidgetClassRec = { { /* core fields */ /* superclass */ (WidgetClass) &widgetClassRec, - /* class_name */ (char*)"QWidget", + /* class_name */ (char*)"TQWidget", /* widget_size */ sizeof(QWidgetRec), /* class_initialize */ 0, /* class_part_initialize */ 0, @@ -249,7 +249,7 @@ void removeXtEventFilters() filters_installed = FALSE; } -// When we are in an event loop of QApplication rather than the browser's +// When we are in an event loop of TQApplication rather than the browser's // event loop (eg. for a modal dialog), we still send events to Xt. static void np_event_proc( XEvent* e ) @@ -263,7 +263,7 @@ void np_event_proc( XEvent* e ) static void np_set_timer( int interval ) { - // Ensure we only have one timeout in progress - QApplication is + // Ensure we only have one timeout in progress - TQApplication is // computing the one amount of time we need to wait. if ( qt_np_timerid ) { XtRemoveTimeOut( qt_np_timerid ); @@ -302,7 +302,7 @@ static void np_do_timers( void*, void* ) static bool my_xt; /*! - Constructs a QApplication and initializes the Xt toolkit. + Constructs a TQApplication and initializes the Xt toolkit. The \a appclass, \a options, \a num_options, and \a resources arguments are passed on to XtAppSetFallbackResources and XtDisplayInitialize. @@ -311,7 +311,7 @@ static bool my_xt; needs to use some existing Xt/Motif widgets. */ KXtApplication::KXtApplication(int& argc, char** argv, - const QCString& rAppName, bool allowStyles, bool GUIenabled, + const TQCString& rAppName, bool allowStyles, bool GUIenabled, XrmOptionDescRec *options, int num_options, char** resources) : KApplication(argc, argv, rAppName, allowStyles, GUIenabled) @@ -327,14 +327,14 @@ KXtApplication::KXtApplication(int& argc, char** argv, } /*! - Constructs a QApplication from the \a display of an already-initialized + Constructs a TQApplication from the \a display of an already-initialized Xt application. Use this constructor when introducing Qt widgets into an existing Xt/Motif application. */ KXtApplication::KXtApplication(Display* dpy, int& argc, char** argv, - const QCString& rAppName, bool allowStyles, bool GUIenabled) + const TQCString& rAppName, bool allowStyles, bool GUIenabled) : KApplication(dpy, argc, argv, rAppName, allowStyles, GUIenabled) { my_xt = FALSE; @@ -367,7 +367,7 @@ void KXtApplication::init() qt_np_add_timer_setter(np_set_timer); qt_np_add_event_proc(np_event_proc); qt_np_count++; -/* QTimer *timer = new QTimer( this ); +/* TQTimer *timer = new TQTimer( this ); timer->start(500);*/ } @@ -381,11 +381,11 @@ void KXtApplication::init() Xt widgets, it can be a QWidget based on a Xt widget class. For including Qt widgets in an existing Xt/Motif application, it can be a special Xt widget class that is - a QWidget. See the constructors for the different behaviors. + a TQWidget. See the constructors for the different behaviors. */ void KXtWidget::init(const char* name, WidgetClass widget_class, - Widget parent, QWidget* qparent, + Widget parent, TQWidget* qparent, ArgList args, Cardinal num_args, bool managed) { @@ -438,14 +438,14 @@ void KXtWidget::init(const char* name, WidgetClass widget_class, /*! Constructs a KXtWidget of the special Xt widget class known as - "QWidget" to the resource manager. + "TQWidget" to the resource manager. Use this constructor to utilize Qt widgets in an Xt/Motif - application. The KXtWidget is a QWidget, so you can create + application. The KXtWidget is a TQWidget, so you can create subwidgets, layouts, etc. using Qt functionality. */ KXtWidget::KXtWidget(const char* name, Widget parent, bool managed) : - QWidget( 0, name, WResizeNoErase ) + TQWidget( 0, name, WResizeNoErase ) { init(name, qWidgetClass, parent, 0, 0, 0, managed); Arg reqargs[20]; @@ -460,21 +460,21 @@ KXtWidget::KXtWidget(const char* name, Widget parent, bool managed) : Use this constructor to utilize Xt or Motif widgets in a Qt application. The KXtWidget looks and behaves - like the Xt class, but can be used like any QWidget. + like the Xt class, but can be used like any TQWidget. Note that Xt requires that the most toplevel Xt widget is a shell. That means, if \a parent is a KXtWidget, the \a widget_class can be of any kind. If there isn't a parent or the parent is just a normal - QWidget, \a widget_class should be something like \c + TQWidget, \a widget_class should be something like \c topLevelShellWidgetClass. If the \a managed parameter is TRUE and \a parent in not NULL, XtManageChild it used to manage the child. */ KXtWidget::KXtWidget(const char* name, WidgetClass widget_class, - QWidget *parent, ArgList args, Cardinal num_args, + TQWidget *parent, ArgList args, Cardinal num_args, bool managed) : - QWidget( parent, name, WResizeNoErase ) + TQWidget( parent, name, WResizeNoErase ) { if ( !parent ) init(name, widget_class, 0, 0, args, num_args, managed); @@ -492,11 +492,11 @@ KXtWidget::~KXtWidget() { // Delete children first, as Xt will destroy their windows // - QObjectList* list = queryList("QWidget", 0, FALSE, FALSE); + TQObjectList* list = queryList("TQWidget", 0, FALSE, FALSE); if ( list ) { - QWidget* c; - QObjectListIt it( *list ); - while ( (c = (QWidget*)it.current()) ) { + TQWidget* c; + TQObjectListIt it( *list ); + while ( (c = (TQWidget*)it.current()) ) { delete c; ++it; } @@ -530,7 +530,7 @@ bool KXtWidget::x11Event( XEvent * e ) if ( xtparent ) setActiveWindow(); } - return QWidget::x11Event( e ); + return TQWidget::x11Event( e ); } @@ -540,7 +540,7 @@ bool KXtWidget::x11Event( XEvent * e ) void KXtWidget::setActiveWindow() { if ( xtparent ) { - if ( !QWidget::isActiveWindow() && isActiveWindow() ) { + if ( !TQWidget::isActiveWindow() && isActiveWindow() ) { XFocusChangeEvent e; e.type = FocusIn; e.window = winId(); @@ -549,12 +549,12 @@ void KXtWidget::setActiveWindow() XSendEvent( qt_xdisplay(), e.window, TRUE, NoEventMask, (XEvent*)&e ); } } else { - QWidget::setActiveWindow(); + TQWidget::setActiveWindow(); } } /*! - Different from QWidget::isActiveWindow() + Different from TQWidget::isActiveWindow() */ bool KXtWidget::isActiveWindow() const { @@ -564,7 +564,7 @@ bool KXtWidget::isActiveWindow() const if ( win == None) return FALSE; - QWidget *w = find( (WId)win ); + TQWidget *w = find( (WId)win ); if ( w ) { // We know that window return w->topLevelWidget() == topLevelWidget(); @@ -586,7 +586,7 @@ bool KXtWidget::isActiveWindow() const /*!\reimp */ -void KXtWidget::moveEvent( QMoveEvent* ) +void KXtWidget::moveEvent( TQMoveEvent* ) { if ( xtparent ) return; @@ -605,7 +605,7 @@ void KXtWidget::moveEvent( QMoveEvent* ) /*!\reimp */ -void KXtWidget::resizeEvent( QResizeEvent* ) +void KXtWidget::resizeEvent( TQResizeEvent* ) { if ( xtparent ) return; diff --git a/nsplugins/viewer/kxt.h b/nsplugins/viewer/kxt.h index 1d594b328..44f05db19 100644 --- a/nsplugins/viewer/kxt.h +++ b/nsplugins/viewer/kxt.h @@ -46,11 +46,11 @@ #ifndef KXT_H #define KXT_H -#include <qglobal.h> +#include <tqglobal.h> #if QT_VERSION < 0x030100 #include <kapplication.h> -#include <qwidget.h> +#include <tqwidget.h> #include <X11/Intrinsic.h> class KXtApplication : public KApplication { @@ -59,20 +59,20 @@ class KXtApplication : public KApplication { public: KXtApplication(int& argc, char** argv, - const QCString& rAppName, bool allowStyles=true, bool GUIenabled=true, + const TQCString& rAppName, bool allowStyles=true, bool GUIenabled=true, XrmOptionDescRec *options=0, int num_options=0, char** resources=0); - KXtApplication(Display*, int& argc, char** argv, const QCString& rAppName, + KXtApplication(Display*, int& argc, char** argv, const TQCString& rAppName, bool allowStyles=true, bool GUIenabled=true); ~KXtApplication(); }; -class KXtWidget : public QWidget { +class KXtWidget : public TQWidget { Q_OBJECT Widget xtw; Widget xtparent; bool need_reroot; void init(const char* name, WidgetClass widget_class, - Widget parent, QWidget* qparent, + Widget parent, TQWidget* qparent, ArgList args, Cardinal num_args, bool managed); friend void qwidget_realize( Widget widget, XtValueMask* mask, @@ -81,7 +81,7 @@ class KXtWidget : public QWidget { public: KXtWidget(const char* name, Widget parent, bool managed=FALSE); KXtWidget(const char* name, WidgetClass widget_class, - QWidget *parent=0, ArgList args=0, Cardinal num_args=0, + TQWidget *parent=0, ArgList args=0, Cardinal num_args=0, bool managed=FALSE); ~KXtWidget(); @@ -90,8 +90,8 @@ public: void setActiveWindow(); protected: - void moveEvent( QMoveEvent* ); - void resizeEvent( QResizeEvent* ); + void moveEvent( TQMoveEvent* ); + void resizeEvent( TQResizeEvent* ); bool x11Event( XEvent * ); }; diff --git a/nsplugins/viewer/nsplugin.cpp b/nsplugins/viewer/nsplugin.cpp index cb39aa107..be313b52b 100644 --- a/nsplugins/viewer/nsplugin.cpp +++ b/nsplugins/viewer/nsplugin.cpp @@ -30,10 +30,10 @@ #include <stdlib.h> #include <unistd.h> -#include <qdict.h> -#include <qdir.h> -#include <qfile.h> -#include <qtimer.h> +#include <tqdict.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqtimer.h> #include "kxt.h" #include "nsplugin.h" @@ -252,8 +252,8 @@ NPError g_NPN_GetURL(NPP instance, const char *url, const char *target) NSPluginInstance *inst = static_cast<NSPluginInstance*>(instance->ndata); if (inst) { - inst->requestURL( QString::fromLatin1(url), QString::null, - QString::fromLatin1(target), 0 ); + inst->requestURL( TQString::fromLatin1(url), TQString::null, + TQString::fromLatin1(target), 0 ); } return NPERR_NO_ERROR; @@ -267,8 +267,8 @@ NPError g_NPN_GetURLNotify(NPP instance, const char *url, const char *target, NSPluginInstance *inst = static_cast<NSPluginInstance*>(instance->ndata); if (inst) { kdDebug(1431) << "g_NPN_GetURLNotify: ndata=" << (void*)inst << endl; - inst->requestURL( QString::fromLatin1(url), QString::null, - QString::fromLatin1(target), notifyData, true ); + inst->requestURL( TQString::fromLatin1(url), TQString::null, + TQString::fromLatin1(target), notifyData, true ); } return NPERR_NO_ERROR; @@ -281,7 +281,7 @@ NPError g_NPN_PostURLNotify(NPP instance, const char* url, const char* target, // http://devedge.netscape.com/library/manuals/2002/plugin/1.0/npn_api14.html kdDebug(1431) << "g_NPN_PostURLNotify() [incomplete]" << endl; kdDebug(1431) << "url=[" << url << "] target=[" << target << "]" << endl; - QByteArray postdata; + TQByteArray postdata; KParts::URLArgs args; if (len == 0) { @@ -289,7 +289,7 @@ NPError g_NPN_PostURLNotify(NPP instance, const char* url, const char* target, } if (file) { // buf is a filename - QFile f(buf); + TQFile f(buf); if (!f.open(IO_ReadOnly)) { return NPERR_FILE_NOT_FOUND; } @@ -318,7 +318,7 @@ NPError g_NPN_PostURLNotify(NPP instance, const char* url, const char* target, break; } - QString thisLine = QString::fromLatin1(previousStart, &buf[l-1] - previousStart).stripWhiteSpace(); + TQString thisLine = TQString::fromLatin1(previousStart, &buf[l-1] - previousStart).stripWhiteSpace(); previousStart = &buf[l]; previousCR = true; @@ -337,7 +337,7 @@ NPError g_NPN_PostURLNotify(NPP instance, const char* url, const char* target, kdDebug(1431) << "Post data: " << postdata.size() << " bytes" << endl; #if 0 - QFile f("/tmp/nspostdata"); + TQFile f("/tmp/nspostdata"); f.open(IO_WriteOnly); f.writeBlock(postdata); f.close(); @@ -360,9 +360,9 @@ NPError g_NPN_PostURLNotify(NPP instance, const char* url, const char* target, } NSPluginInstance *inst = static_cast<NSPluginInstance*>(instance->ndata); - if (inst && !inst->normalizedURL(QString::fromLatin1(url)).isNull()) { - inst->postURL( QString::fromLatin1(url), postdata, args.contentType(), - QString::fromLatin1(target), notifyData, args, true ); + if (inst && !inst->normalizedURL(TQString::fromLatin1(url)).isNull()) { + inst->postURL( TQString::fromLatin1(url), postdata, args.contentType(), + TQString::fromLatin1(target), notifyData, args, true ); } else { // Unsupported / insecure return NPERR_INVALID_URL; @@ -378,7 +378,7 @@ NPError g_NPN_PostURL(NPP instance, const char* url, const char* target, // http://devedge.netscape.com/library/manuals/2002/plugin/1.0/npn_api13.html kdDebug(1431) << "g_NPN_PostURL()" << endl; kdDebug(1431) << "url=[" << url << "] target=[" << target << "]" << endl; - QByteArray postdata; + TQByteArray postdata; KParts::URLArgs args; if (len == 0) { @@ -386,7 +386,7 @@ NPError g_NPN_PostURL(NPP instance, const char* url, const char* target, } if (file) { // buf is a filename - QFile f(buf); + TQFile f(buf); if (!f.open(IO_ReadOnly)) { return NPERR_FILE_NOT_FOUND; } @@ -415,7 +415,7 @@ NPError g_NPN_PostURL(NPP instance, const char* url, const char* target, break; } - QString thisLine = QString::fromLatin1(previousStart, &buf[l-1] - previousStart).stripWhiteSpace(); + TQString thisLine = TQString::fromLatin1(previousStart, &buf[l-1] - previousStart).stripWhiteSpace(); previousStart = &buf[l]; previousCR = true; @@ -434,7 +434,7 @@ NPError g_NPN_PostURL(NPP instance, const char* url, const char* target, kdDebug(1431) << "Post data: " << postdata.size() << " bytes" << endl; #if 0 - QFile f("/tmp/nspostdata"); + TQFile f("/tmp/nspostdata"); f.open(IO_WriteOnly); f.writeBlock(postdata); f.close(); @@ -457,9 +457,9 @@ NPError g_NPN_PostURL(NPP instance, const char* url, const char* target, } NSPluginInstance *inst = static_cast<NSPluginInstance*>(instance->ndata); - if (inst && !inst->normalizedURL(QString::fromLatin1(url)).isNull()) { - inst->postURL( QString::fromLatin1(url), postdata, args.contentType(), - QString::fromLatin1(target), 0L, args, false ); + if (inst && !inst->normalizedURL(TQString::fromLatin1(url)).isNull()) { + inst->postURL( TQString::fromLatin1(url), postdata, args.contentType(), + TQString::fromLatin1(target), 0L, args, false ); } else { // Unsupported / insecure return NPERR_INVALID_URL; @@ -488,7 +488,7 @@ void g_NPN_Status(NPP instance, const char *message) const char *g_NPN_UserAgent(NPP /*instance*/) { KProtocolManager kpm; - QString agent = kpm.userAgentForHost("nspluginviewer"); + TQString agent = kpm.userAgentForHost("nspluginviewer"); kdDebug(1431) << "g_NPN_UserAgent() = " << agent << endl; // flash crashes without Firefox UA agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.10) Gecko/2007101500 Firefox/2.0.0.10"; @@ -589,11 +589,11 @@ NSPluginInstance::forwarder(Widget w, XtPointer cl_data, XEvent * event, Boolean NSPluginInstance::NSPluginInstance(NPP privateData, NPPluginFuncs *pluginFuncs, KLibrary *handle, int width, int height, - QString src, QString /*mime*/, - QString appId, QString callbackId, + TQString src, TQString /*mime*/, + TQString appId, TQString callbackId, bool embed, WId xembed, - QObject *parent, const char* name ) - : DCOPObject(), QObject( parent, name ) + TQObject *parent, const char* name ) + : DCOPObject(), TQObject( parent, name ) { Q_UNUSED(embed); _visible = false; @@ -611,13 +611,13 @@ NSPluginInstance::NSPluginInstance(NPP privateData, NPPluginFuncs *pluginFuncs, _toplevel = _form = 0; KURL base(src); - base.setFileName( QString::null ); + base.setFileName( TQString::null ); _baseURL = base.url(); memcpy(&_pluginFuncs, pluginFuncs, sizeof(_pluginFuncs)); - _timer = new QTimer( this ); - connect( _timer, SIGNAL(timeout()), SLOT(timer()) ); + _timer = new TQTimer( this ); + connect( _timer, TQT_SIGNAL(timeout()), TQT_SLOT(timer()) ); kdDebug(1431) << "NSPluginInstance::NSPluginInstance" << endl; kdDebug(1431) << "pdata = " << _npp->pdata << endl; @@ -651,9 +651,9 @@ NSPluginInstance::NSPluginInstance(NPP privateData, NPPluginFuncs *pluginFuncs, // Create form window that is searched for by flash plugin _form = XtVaCreateWidget("form", compositeWidgetClass, _toplevel, NULL); - XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++; - XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++; - XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++; + XtSetArg(args[nargs], XtNvisual, TQPaintDevice::x11AppVisual()); nargs++; + XtSetArg(args[nargs], XtNdepth, TQPaintDevice::x11AppDepth()); nargs++; + XtSetArg(args[nargs], XtNcolormap, TQPaintDevice::x11AppColormap()); nargs++; XtSetValues(_form, args, nargs); XSync(qt_xdisplay(), false); @@ -772,7 +772,7 @@ void NSPluginInstance::timer() Request req( *_waitingRequests.head() ); _waitingRequests.remove(); - QString url; + TQString url; // make absolute url if ( req.url.left(11).lower()=="javascript:" ) @@ -810,8 +810,8 @@ void NSPluginInstance::timer() if (req.post) { // create stream NSPluginStream *s = new NSPluginStream( this ); - connect( s, SIGNAL(finished(NSPluginStreamBase*)), - SLOT(streamFinished(NSPluginStreamBase*)) ); + connect( s, TQT_SIGNAL(finished(NSPluginStreamBase*)), + TQT_SLOT(streamFinished(NSPluginStreamBase*)) ); _streams.append( s ); kdDebug() << "posting to " << url << endl; @@ -829,8 +829,8 @@ void NSPluginInstance::timer() } else { // create stream NSPluginStream *s = new NSPluginStream( this ); - connect( s, SIGNAL(finished(NSPluginStreamBase*)), - SLOT(streamFinished(NSPluginStreamBase*)) ); + connect( s, TQT_SIGNAL(finished(NSPluginStreamBase*)), + TQT_SLOT(streamFinished(NSPluginStreamBase*)) ); _streams.append( s ); kdDebug() << "getting " << url << endl; @@ -846,7 +846,7 @@ void NSPluginInstance::timer() } -QString NSPluginInstance::normalizedURL(const QString& url) const { +TQString NSPluginInstance::normalizedURL(const TQString& url) const { KURL bu( _baseURL ); KURL inURL(bu, url); KConfig cfg("kcmnspluginrc", true); @@ -861,15 +861,15 @@ QString NSPluginInstance::normalizedURL(const QString& url) const { // Allow: javascript:, http, https, or no protocol (match loading) kdDebug(1431) << "NSPluginInstance::normalizedURL - I don't think so. http or https only!" << endl; - return QString::null; + return TQString::null; } -void NSPluginInstance::requestURL( const QString &url, const QString &mime, - const QString &target, void *notify, bool forceNotify, bool reload ) +void NSPluginInstance::requestURL( const TQString &url, const TQString &mime, + const TQString &target, void *notify, bool forceNotify, bool reload ) { // Generally this should already be done, but let's be safe for now. - QString nurl = normalizedURL(url); + TQString nurl = normalizedURL(url); if (nurl.isNull()) { return; } @@ -880,13 +880,13 @@ void NSPluginInstance::requestURL( const QString &url, const QString &mime, } -void NSPluginInstance::postURL( const QString &url, const QByteArray& data, - const QString &mime, - const QString &target, void *notify, +void NSPluginInstance::postURL( const TQString &url, const TQByteArray& data, + const TQString &mime, + const TQString &target, void *notify, const KParts::URLArgs& args, bool forceNotify ) { // Generally this should already be done, but let's be safe for now. - QString nurl = normalizedURL(url); + TQString nurl = normalizedURL(url); if (nurl.isNull()) { return; } @@ -897,7 +897,7 @@ void NSPluginInstance::postURL( const QString &url, const QByteArray& data, } -void NSPluginInstance::emitStatus(const QString &message) +void NSPluginInstance::emitStatus(const TQString &message) { if( _callback ) _callback->statusMessage( message ); @@ -907,7 +907,7 @@ void NSPluginInstance::emitStatus(const QString &message) void NSPluginInstance::streamFinished( NSPluginStreamBase* strm ) { kdDebug(1431) << "-> NSPluginInstance::streamFinished" << endl; - emitStatus( QString::null ); + emitStatus( TQString::null ); _streams.setAutoDelete(false); // Don't delete it yet!! we get called from // its slot! _streams.remove(strm); @@ -998,9 +998,9 @@ void NSPluginInstance::resizePlugin(Q_INT32 w, Q_INT32 h) Cardinal nargs = 0; XtSetArg(args[nargs], XtNwidth, _width); nargs++; XtSetArg(args[nargs], XtNheight, _height); nargs++; - XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++; - XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++; - XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++; + XtSetArg(args[nargs], XtNvisual, TQPaintDevice::x11AppVisual()); nargs++; + XtSetArg(args[nargs], XtNdepth, TQPaintDevice::x11AppDepth()); nargs++; + XtSetArg(args[nargs], XtNcolormap, TQPaintDevice::x11AppColormap()); nargs++; XtSetArg(args[nargs], XtNborderWidth, 0); nargs++; XtSetValues(_toplevel, args, nargs); @@ -1021,27 +1021,27 @@ void NSPluginInstance::resizePlugin(Q_INT32 w, Q_INT32 h) } -void NSPluginInstance::javascriptResult(Q_INT32 id, QString result) { - QMap<int, Request*>::iterator i = _jsrequests.find( id ); +void NSPluginInstance::javascriptResult(Q_INT32 id, TQString result) { + TQMap<int, Request*>::iterator i = _jsrequests.find( id ); if (i != _jsrequests.end()) { Request *req = i.data(); _jsrequests.remove( i ); NSPluginStream *s = new NSPluginStream( this ); - connect( s, SIGNAL(finished(NSPluginStreamBase*)), - SLOT(streamFinished(NSPluginStreamBase*)) ); + connect( s, TQT_SIGNAL(finished(NSPluginStreamBase*)), + TQT_SLOT(streamFinished(NSPluginStreamBase*)) ); _streams.append( s ); int len = result.length(); - s->create( req->url, QString("text/plain"), req->notify, req->forceNotify ); + s->create( req->url, TQString("text/plain"), req->notify, req->forceNotify ); kdDebug(1431) << "javascriptResult has been called with: "<<result<<endl; if (len > 0) { - QByteArray data(len + 1); + TQByteArray data(len + 1); memcpy(data.data(), result.latin1(), len); data[len] = 0; s->process(data, 0); } else { len = 7; // "unknown" - QByteArray data(len + 1); + TQByteArray data(len + 1); memcpy(data.data(), "unknown", len); data[len] = 0; s->process(data, 0); @@ -1190,7 +1190,7 @@ int32 NSPluginInstance::NPWriteReady(NPStream *stream) } -void NSPluginInstance::NPURLNotify(QString url, NPReason reason, void *notifyData) +void NSPluginInstance::NPURLNotify(TQString url, NPReason reason, void *notifyData) { if (!_pluginFuncs.urlnotify) return; @@ -1249,15 +1249,15 @@ int XQueryKeymap( Display* dpy, char k[32] ) /***************************************************************************/ -NSPluginViewer::NSPluginViewer( QCString dcopId, - QObject *parent, const char *name ) - : DCOPObject(dcopId), QObject( parent, name ) +NSPluginViewer::NSPluginViewer( TQCString dcopId, + TQObject *parent, const char *name ) + : DCOPObject(dcopId), TQObject( parent, name ) { _classes.setAutoDelete( true ); connect(KApplication::dcopClient(), - SIGNAL(applicationRemoved(const QCString&)), + TQT_SIGNAL(applicationRemoved(const TQCString&)), this, - SLOT(appUnregistered(const QCString&))); + TQT_SLOT(appUnregistered(const TQCString&))); } @@ -1267,15 +1267,15 @@ NSPluginViewer::~NSPluginViewer() } -void NSPluginViewer::appUnregistered(const QCString& id) { +void NSPluginViewer::appUnregistered(const TQCString& id) { if (id.isEmpty()) { return; } - QDictIterator<NSPluginClass> it(_classes); + TQDictIterator<NSPluginClass> it(_classes); NSPluginClass *c; while ( (c = it.current()) ) { - QString key = it.currentKey(); + TQString key = it.currentKey(); ++it; if (c->app() == id) { _classes.remove(key); @@ -1300,7 +1300,7 @@ void NSPluginViewer::shutdown() } -DCOPRef NSPluginViewer::newClass( QString plugin ) +DCOPRef NSPluginViewer::newClass( TQString plugin ) { kdDebug(1431) << "NSPluginViewer::NewClass( " << plugin << ")" << endl; @@ -1309,7 +1309,7 @@ DCOPRef NSPluginViewer::newClass( QString plugin ) if ( !cls ) { // create new class cls = new NSPluginClass( plugin, this ); - QCString id = ""; + TQCString id = ""; DCOPClient *dc = callingDcopClient(); if (dc) { id = dc->senderId(); @@ -1331,12 +1331,12 @@ DCOPRef NSPluginViewer::newClass( QString plugin ) /****************************************************************************/ -NSPluginClass::NSPluginClass( const QString &library, - QObject *parent, const char *name ) - : DCOPObject(), QObject( parent, name ) +NSPluginClass::NSPluginClass( const TQString &library, + TQObject *parent, const char *name ) + : DCOPObject(), TQObject( parent, name ) { // initialize members - _handle = KLibLoader::self()->library(QFile::encodeName(library)); + _handle = KLibLoader::self()->library(TQFile::encodeName(library)); _libname = library; _constructed = false; _error = true; @@ -1345,8 +1345,8 @@ NSPluginClass::NSPluginClass( const QString &library, _NP_Initialize = 0; _NP_Shutdown = 0; - _timer = new QTimer( this ); - connect( _timer, SIGNAL(timeout()), SLOT(timer()) ); + _timer = new TQTimer( this ); + connect( _timer, TQT_SIGNAL(timeout()), TQT_SLOT(timer()) ); // check lib handle if (!_handle) { @@ -1444,7 +1444,7 @@ int NSPluginClass::initialize() } -QString NSPluginClass::getMIMEDescription() +TQString NSPluginClass::getMIMEDescription() { return _NP_GetMIMEDescription(); } @@ -1458,10 +1458,10 @@ void NSPluginClass::shutdown() } -DCOPRef NSPluginClass::newInstance( QString url, QString mimeType, Q_INT8 embed, - QStringList argn, QStringList argv, - QString appId, QString callbackId, - Q_INT8 reload, Q_INT8 doPost, QByteArray postData, Q_UINT32 xembed ) +DCOPRef NSPluginClass::newInstance( TQString url, TQString mimeType, Q_INT8 embed, + TQStringList argn, TQStringList argv, + TQString appId, TQString callbackId, + Q_INT8 reload, Q_INT8 doPost, TQByteArray postData, Q_UINT32 xembed ) { kdDebug(1431) << "-> NSPluginClass::NewInstance" << endl; @@ -1472,15 +1472,15 @@ DCOPRef NSPluginClass::newInstance( QString url, QString mimeType, Q_INT8 embed, unsigned int argc = argn.count(); char **_argn = new char*[argc]; char **_argv = new char*[argc]; - QString src = url; + TQString src = url; int width = 0; int height = 0; - QString baseURL = url; + TQString baseURL = url; for (unsigned int i=0; i<argc; i++) { - QCString encN = argn[i].utf8(); - QCString encV = argv[i].utf8(); + TQCString encN = argn[i].utf8(); + TQCString encV = argv[i].utf8(); const char *n = encN; const char *v = encV; @@ -1540,9 +1540,9 @@ DCOPRef NSPluginClass::newInstance( QString url, QString mimeType, Q_INT8 embed, // create source stream if ( !src.isEmpty() ) { if (doPost) { - inst->postURL(src, postData, mimeType, QString::null, 0, KParts::URLArgs(), false); + inst->postURL(src, postData, mimeType, TQString::null, 0, KParts::URLArgs(), false); } else { - inst->requestURL( src, mimeType, QString::null, 0, false, reload ); + inst->requestURL( src, mimeType, TQString::null, 0, false, reload ); } } @@ -1561,7 +1561,7 @@ void NSPluginClass::destroyInstance( NSPluginInstance* inst ) /****************************************************************************/ NSPluginStreamBase::NSPluginStreamBase( NSPluginInstance *instance ) - : QObject( instance ), _instance(instance), _stream(0), _tempFile(0L), + : TQObject( instance ), _instance(instance), _stream(0), _tempFile(0L), _pos(0), _queue(0), _queuePos(0), _error(false) { _informed = false; @@ -1632,7 +1632,7 @@ void NSPluginStreamBase::inform() } -bool NSPluginStreamBase::create( const QString& url, const QString& mimeType, void *notify, bool forceNotify) +bool NSPluginStreamBase::create( const TQString& url, const TQString& mimeType, void *notify, bool forceNotify) { if ( _stream ) return false; @@ -1667,7 +1667,7 @@ void NSPluginStreamBase::updateURL( const KURL& newURL ) _stream->url = strdup(_url.url().ascii()); } -int NSPluginStreamBase::process( const QByteArray &data, int start ) +int NSPluginStreamBase::process( const TQByteArray &data, int start ) { int32 max, sent, to_sent, len; char *d = data.data() + start; @@ -1742,7 +1742,7 @@ bool NSPluginStreamBase::pump() } -void NSPluginStreamBase::queue( const QByteArray &data ) +void NSPluginStreamBase::queue( const TQByteArray &data ) { _queue = data; _queue.detach(); @@ -1811,8 +1811,8 @@ void NSPluginStreamBase::finish( bool err ) NSPluginBufStream::NSPluginBufStream( class NSPluginInstance *instance ) : NSPluginStreamBase( instance ) { - _timer = new QTimer( this ); - connect( _timer, SIGNAL(timeout()), this, SLOT(timer()) ); + _timer = new TQTimer( this ); + connect( _timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timer()) ); } @@ -1822,8 +1822,8 @@ NSPluginBufStream::~NSPluginBufStream() } -bool NSPluginBufStream::get( const QString& url, const QString& mimeType, - const QByteArray &buf, void *notifyData, +bool NSPluginBufStream::get( const TQString& url, const TQString& mimeType, + const TQByteArray &buf, void *notifyData, bool singleShot ) { _singleShot = singleShot; @@ -1857,8 +1857,8 @@ void NSPluginBufStream::timer() NSPluginStream::NSPluginStream( NSPluginInstance *instance ) : NSPluginStreamBase( instance ), _job(0) { - _resumeTimer = new QTimer( this ); - connect(_resumeTimer, SIGNAL(timeout()), this, SLOT(resume())); + _resumeTimer = new TQTimer( this ); + connect(_resumeTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(resume())); } @@ -1869,7 +1869,7 @@ NSPluginStream::~NSPluginStream() } -bool NSPluginStream::get( const QString& url, const QString& mimeType, +bool NSPluginStream::get( const TQString& url, const TQString& mimeType, void *notify, bool reload ) { // create new stream @@ -1881,23 +1881,23 @@ bool NSPluginStream::get( const QString& url, const QString& mimeType, if (reload) { _job->addMetaData("cache", "reload"); } - connect(_job, SIGNAL(data(KIO::Job *, const QByteArray &)), - SLOT(data(KIO::Job *, const QByteArray &))); - connect(_job, SIGNAL(result(KIO::Job *)), SLOT(result(KIO::Job *))); - connect(_job, SIGNAL(totalSize(KIO::Job *, KIO::filesize_t )), - SLOT(totalSize(KIO::Job *, KIO::filesize_t))); - connect(_job, SIGNAL(mimetype(KIO::Job *, const QString &)), - SLOT(mimetype(KIO::Job *, const QString &))); - connect(_job, SIGNAL(redirection(KIO::Job *, const KURL&)), - SLOT(redirection(KIO::Job *, const KURL&))); + connect(_job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), + TQT_SLOT(data(KIO::Job *, const TQByteArray &))); + connect(_job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(result(KIO::Job *))); + connect(_job, TQT_SIGNAL(totalSize(KIO::Job *, KIO::filesize_t )), + TQT_SLOT(totalSize(KIO::Job *, KIO::filesize_t))); + connect(_job, TQT_SIGNAL(mimetype(KIO::Job *, const TQString &)), + TQT_SLOT(mimetype(KIO::Job *, const TQString &))); + connect(_job, TQT_SIGNAL(redirection(KIO::Job *, const KURL&)), + TQT_SLOT(redirection(KIO::Job *, const KURL&))); } return false; } -bool NSPluginStream::post( const QString& url, const QByteArray& data, - const QString& mimeType, void *notify, const KParts::URLArgs& args ) +bool NSPluginStream::post( const TQString& url, const TQByteArray& data, + const TQString& mimeType, void *notify, const KParts::URLArgs& args ) { // create new stream if ( create( url, mimeType, notify ) ) { @@ -1906,22 +1906,22 @@ bool NSPluginStream::post( const QString& url, const QByteArray& data, _job->addMetaData("content-type", args.contentType()); _job->addMetaData("errorPage", "false"); _job->addMetaData("AllowCompressedPage", "false"); - connect(_job, SIGNAL(data(KIO::Job *, const QByteArray &)), - SLOT(data(KIO::Job *, const QByteArray &))); - connect(_job, SIGNAL(result(KIO::Job *)), SLOT(result(KIO::Job *))); - connect(_job, SIGNAL(totalSize(KIO::Job *, KIO::filesize_t )), - SLOT(totalSize(KIO::Job *, KIO::filesize_t))); - connect(_job, SIGNAL(mimetype(KIO::Job *, const QString &)), - SLOT(mimetype(KIO::Job *, const QString &))); - connect(_job, SIGNAL(redirection(KIO::Job *, const KURL&)), - SLOT(redirection(KIO::Job *, const KURL&))); + connect(_job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), + TQT_SLOT(data(KIO::Job *, const TQByteArray &))); + connect(_job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(result(KIO::Job *))); + connect(_job, TQT_SIGNAL(totalSize(KIO::Job *, KIO::filesize_t )), + TQT_SLOT(totalSize(KIO::Job *, KIO::filesize_t))); + connect(_job, TQT_SIGNAL(mimetype(KIO::Job *, const TQString &)), + TQT_SLOT(mimetype(KIO::Job *, const TQString &))); + connect(_job, TQT_SIGNAL(redirection(KIO::Job *, const KURL&)), + TQT_SLOT(redirection(KIO::Job *, const KURL&))); } return false; } -void NSPluginStream::data(KIO::Job * job, const QByteArray &data) +void NSPluginStream::data(KIO::Job * job, const TQByteArray &data) { //kdDebug(1431) << "NSPluginStream::data - job=" << (void*)job << " data size=" << data.size() << endl; queue( data ); @@ -1942,9 +1942,9 @@ void NSPluginStream::totalSize(KIO::Job * job, KIO::filesize_t size) _stream->end = size; } -void NSPluginStream::mimetype(KIO::Job * job, const QString &mimeType) +void NSPluginStream::mimetype(KIO::Job * job, const TQString &mimeType) { - kdDebug(1431) << "NSPluginStream::QByteArray - job=" << (void*)job << " mimeType=" << mimeType << endl; + kdDebug(1431) << "NSPluginStream::TQByteArray - job=" << (void*)job << " mimeType=" << mimeType << endl; _mimeType = mimeType; } diff --git a/nsplugins/viewer/nsplugin.h b/nsplugins/viewer/nsplugin.h index 76d2e659b..c68eb1bcf 100644 --- a/nsplugins/viewer/nsplugin.h +++ b/nsplugins/viewer/nsplugin.h @@ -32,14 +32,14 @@ #include "NSPluginCallbackIface_stub.h" -#include <qobject.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qptrqueue.h> -#include <qdict.h> -#include <qmap.h> -#include <qintdict.h> -#include <qguardedptr.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqptrqueue.h> +#include <tqdict.h> +#include <tqmap.h> +#include <tqintdict.h> +#include <tqguardedptr.h> #include <kparts/browserextension.h> // for URLArgs #include <kio/job.h> @@ -82,8 +82,8 @@ protected: void finish( bool err ); bool pump(); bool error() { return _error; } - void queue( const QByteArray &data ); - bool create( const QString& url, const QString& mimeType, void *notify, bool forceNotify = false ); + void queue( const TQByteArray &data ); + bool create( const TQString& url, const TQString& mimeType, void *notify, bool forceNotify = false ); int tries() { return _tries; } void inform( ); void updateURL( const KURL& newURL ); @@ -93,16 +93,16 @@ protected: NPStream *_stream; void *_notifyData; KURL _url; - QString _fileURL; - QString _mimeType; - QByteArray _data; + TQString _fileURL; + TQString _mimeType; + TQByteArray _data; class KTempFile *_tempFile; private: - int process( const QByteArray &data, int start ); + int process( const TQByteArray &data, int start ); unsigned int _pos; - QByteArray _queue; + TQByteArray _queue; unsigned int _queuePos; int _tries; bool _onlyAsFile; @@ -120,20 +120,20 @@ public: NSPluginStream( class NSPluginInstance *instance ); ~NSPluginStream(); - bool get(const QString& url, const QString& mimeType, void *notifyData, bool reload = false); - bool post(const QString& url, const QByteArray& data, const QString& mimeType, void *notifyData, const KParts::URLArgs& args); + bool get(const TQString& url, const TQString& mimeType, void *notifyData, bool reload = false); + bool post(const TQString& url, const TQByteArray& data, const TQString& mimeType, void *notifyData, const KParts::URLArgs& args); protected slots: - void data(KIO::Job *job, const QByteArray &data); + void data(KIO::Job *job, const TQByteArray &data); void totalSize(KIO::Job *job, KIO::filesize_t size); - void mimetype(KIO::Job * job, const QString &mimeType); + void mimetype(KIO::Job * job, const TQString &mimeType); void result(KIO::Job *job); void redirection(KIO::Job *job, const KURL& url); void resume(); protected: - QGuardedPtr<KIO::TransferJob> _job; - QTimer *_resumeTimer; + TQGuardedPtr<KIO::TransferJob> _job; + TQTimer *_resumeTimer; }; @@ -145,18 +145,18 @@ public: NSPluginBufStream( class NSPluginInstance *instance ); ~NSPluginBufStream(); - bool get( const QString& url, const QString& mimeType, const QByteArray &buf, void *notifyData, bool singleShot=false ); + bool get( const TQString& url, const TQString& mimeType, const TQByteArray &buf, void *notifyData, bool singleShot=false ); protected slots: void timer(); protected: - QTimer *_timer; + TQTimer *_timer; bool _singleShot; }; -class NSPluginInstance : public QObject, public virtual NSPluginInstanceIface +class NSPluginInstance : public TQObject, public virtual NSPluginInstanceIface { Q_OBJECT @@ -164,9 +164,9 @@ public: // constructor, destructor NSPluginInstance( NPP privateData, NPPluginFuncs *pluginFuncs, KLibrary *handle, - int width, int height, QString src, QString mime, - QString appId, QString callbackId, bool embed, WId xembed, - QObject *parent, const char* name=0 ); + int width, int height, TQString src, TQString mime, + TQString appId, TQString callbackId, bool embed, WId xembed, + TQObject *parent, const char* name=0 ); ~NSPluginInstance(); // DCOP functions @@ -174,7 +174,7 @@ public: int winId() { return _form != 0 ? XtWindow(_form) : 0; } int setWindow(Q_INT8 remove=0); void resizePlugin(Q_INT32 w, Q_INT32 h); - void javascriptResult(Q_INT32 id, QString result); + void javascriptResult(Q_INT32 id, TQString result); void displayPlugin(); void gotFocusIn(); void gotFocusOut(); @@ -194,19 +194,19 @@ public: int32 NPWriteReady(NPStream *stream); // URL functions - void NPURLNotify(QString url, NPReason reason, void *notifyData); + void NPURLNotify(TQString url, NPReason reason, void *notifyData); // Event handling uint16 HandleEvent(void *event); // signal emitters - void emitStatus( const QString &message); - void requestURL( const QString &url, const QString &mime, - const QString &target, void *notify, bool forceNotify = false, bool reload = false ); - void postURL( const QString &url, const QByteArray& data, const QString &mime, - const QString &target, void *notify, const KParts::URLArgs& args, bool forceNotify = false ); + void emitStatus( const TQString &message); + void requestURL( const TQString &url, const TQString &mime, + const TQString &target, void *notify, bool forceNotify = false, bool reload = false ); + void postURL( const TQString &url, const TQByteArray& data, const TQString &mime, + const TQString &target, void *notify, const KParts::URLArgs& args, bool forceNotify = false ); - QString normalizedURL(const QString& url) const; + TQString normalizedURL(const TQString& url) const; public slots: void streamFinished( NSPluginStreamBase *strm ); @@ -224,40 +224,40 @@ private: bool _destroyed; bool _visible; void addTempFile(KTempFile *tmpFile); - QPtrList<KTempFile> _tempFiles; + TQPtrList<KTempFile> _tempFiles; NSPluginCallbackIface_stub *_callback; - QPtrList<NSPluginStreamBase> _streams; + TQPtrList<NSPluginStreamBase> _streams; KLibrary *_handle; - QTimer *_timer; + TQTimer *_timer; NPP _npp; NPPluginFuncs _pluginFuncs; Widget _area, _form, _toplevel; WId _xembed_window; - QString _baseURL; + TQString _baseURL; int _width, _height; struct Request { // A GET request - Request( const QString &_url, const QString &_mime, - const QString &_target, void *_notify, bool _forceNotify = false, + Request( const TQString &_url, const TQString &_mime, + const TQString &_target, void *_notify, bool _forceNotify = false, bool _reload = false) { url=_url; mime=_mime; target=_target; notify=_notify; post=false; forceNotify = _forceNotify; reload = _reload; } // A POST request - Request( const QString &_url, const QByteArray& _data, - const QString &_mime, const QString &_target, void *_notify, + Request( const TQString &_url, const TQByteArray& _data, + const TQString &_mime, const TQString &_target, void *_notify, const KParts::URLArgs& _args, bool _forceNotify = false) { url=_url; mime=_mime; target=_target; notify=_notify; post=true; data=_data; args=_args; forceNotify = _forceNotify; } - QString url; - QString mime; - QString target; - QByteArray data; + TQString url; + TQString mime; + TQString target; + TQByteArray data; bool post; bool forceNotify; bool reload; @@ -267,29 +267,29 @@ private: NPWindow _win; NPSetWindowCallbackStruct _win_info; - QPtrQueue<Request> _waitingRequests; - QMap<int, Request*> _jsrequests; + TQPtrQueue<Request> _waitingRequests; + TQMap<int, Request*> _jsrequests; }; -class NSPluginClass : public QObject, virtual public NSPluginClassIface +class NSPluginClass : public TQObject, virtual public NSPluginClassIface { Q_OBJECT public: - NSPluginClass( const QString &library, QObject *parent, const char *name=0 ); + NSPluginClass( const TQString &library, TQObject *parent, const char *name=0 ); ~NSPluginClass(); - QString getMIMEDescription(); - DCOPRef newInstance(QString url, QString mimeType, Q_INT8 embed, - QStringList argn, QStringList argv, - QString appId, QString callbackId, Q_INT8 reload, Q_INT8 post, - QByteArray postData, Q_UINT32 xembed ); + TQString getMIMEDescription(); + DCOPRef newInstance(TQString url, TQString mimeType, Q_INT8 embed, + TQStringList argn, TQStringList argv, + TQString appId, TQString callbackId, Q_INT8 reload, Q_INT8 post, + TQByteArray postData, Q_UINT32 xembed ); void destroyInstance( NSPluginInstance* inst ); bool error() { return _error; } - void setApp(const QCString& app) { _app = app; } - const QCString& app() const { return _app; } + void setApp(const TQCString& app) { _app = app; } + const TQCString& app() const { return _app; } protected slots: void timer(); @@ -299,10 +299,10 @@ private: void shutdown(); KLibrary *_handle; - QString _libname; + TQString _libname; bool _constructed; bool _error; - QTimer *_timer; + TQTimer *_timer; NP_GetMIMEDescriptionUPP *_NP_GetMIMEDescription; NP_InitializeUPP *_NP_Initialize; @@ -311,28 +311,28 @@ private: NPPluginFuncs _pluginFuncs; NPNetscapeFuncs _nsFuncs; - QPtrList<NSPluginInstance> _instances; - QPtrList<NSPluginInstance> _trash; + TQPtrList<NSPluginInstance> _instances; + TQPtrList<NSPluginInstance> _trash; - QCString _app; + TQCString _app; }; -class NSPluginViewer : public QObject, virtual public NSPluginViewerIface +class NSPluginViewer : public TQObject, virtual public NSPluginViewerIface { Q_OBJECT public: - NSPluginViewer( QCString dcopId, QObject *parent, const char *name=0 ); + NSPluginViewer( TQCString dcopId, TQObject *parent, const char *name=0 ); virtual ~NSPluginViewer(); void shutdown(); - DCOPRef newClass( QString plugin ); + DCOPRef newClass( TQString plugin ); private slots: - void appUnregistered(const QCString& id); + void appUnregistered(const TQCString& id); private: - QDict<NSPluginClass> _classes; + TQDict<NSPluginClass> _classes; }; diff --git a/nsplugins/viewer/qxteventloop.cpp b/nsplugins/viewer/qxteventloop.cpp index 856cfe67c..b34c1e03c 100644 --- a/nsplugins/viewer/qxteventloop.cpp +++ b/nsplugins/viewer/qxteventloop.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Implementation of QWidget class +** Implementation of TQWidget class ** ** Created : 931031 ** @@ -39,11 +39,11 @@ #if QT_VERSION >= 0x030100 -#include <qapplication.h> -#include <qwidgetintdict.h> +#include <tqapplication.h> +#include <tqwidgetintdict.h> #include <kglobal.h> -// resolve the conflict between X11's FocusIn and QEvent::FocusIn +// resolve the conflict between X11's FocusIn and TQEvent::FocusIn const int XFocusOut = FocusOut; const int XFocusIn = FocusIn; #undef FocusOut @@ -65,10 +65,10 @@ public: void unhook(); XtAppContext appContext, ownContext; - QMemArray<XtEventDispatchProc> dispatchers; - QWidgetIntDict mapper; + TQMemArray<XtEventDispatchProc> dispatchers; + TQWidgetIntDict mapper; - QIntDict<QSocketNotifier> socknotDict; + TQIntDict<TQSocketNotifier> socknotDict; bool activate_timers; XtIntervalId timerid; @@ -87,7 +87,7 @@ static XEvent* last_xevent = 0; Rationale: An XEvent handled by Qt does not go through the Xt event handlers, and the internal state of Xt/Motif widgets will not be updated. This function should only be used if an event delivered by - Qt to a QWidget needs to be sent to an Xt/Motif widget. + Qt to a TQWidget needs to be sent to an Xt/Motif widget. */ bool QXtEventLoop::redeliverEvent( XEvent *event ) { @@ -123,7 +123,7 @@ void QXtEventLoopPrivate::hookMeUp() int et; for ( et = 2; et < LASTEvent; et++ ) dispatchers[ et ] = - XtSetEventDispatcher( QPaintDevice::x11AppDisplay(), + XtSetEventDispatcher( TQPaintDevice::x11AppDisplay(), et, ::qmotif_event_dispatcher ); } @@ -135,29 +135,29 @@ void QXtEventLoopPrivate::unhook() // ### TODO extensions? int et; for ( et = 2; et < LASTEvent; et++ ) - (void) XtSetEventDispatcher( QPaintDevice::x11AppDisplay(), + (void) XtSetEventDispatcher( TQPaintDevice::x11AppDisplay(), et, dispatchers[ et ] ); dispatchers.resize( 0 ); /* We cannot destroy the app context here because it closes the X - display, something QApplication does as well a bit later. + display, something TQApplication does as well a bit later. if ( ownContext ) XtDestroyApplicationContext( ownContext ); */ appContext = ownContext = 0; } -extern bool qt_try_modal( QWidget *, XEvent * ); // defined in qapplication_x11.cpp +extern bool qt_try_modal( TQWidget *, XEvent * ); // defined in qapplication_x11.cpp Boolean qmotif_event_dispatcher( XEvent *event ) { - QApplication::sendPostedEvents(); + TQApplication::sendPostedEvents(); - QWidgetIntDict *mapper = &static_d->mapper; - QWidget* qMotif = mapper->find( event->xany.window ); - if ( !qMotif && QWidget::find( event->xany.window) == 0 ) { + TQWidgetIntDict *mapper = &static_d->mapper; + TQWidget* qMotif = mapper->find( event->xany.window ); + if ( !qMotif && TQWidget::find( event->xany.window) == 0 ) { // event is not for Qt, try Xt - Display* dpy = QPaintDevice::x11AppDisplay(); + Display* dpy = TQPaintDevice::x11AppDisplay(); Widget w = XtWindowToWidget( dpy, event->xany.window ); while ( w && ! ( qMotif = mapper->find( XtWindow( w ) ) ) ) { if ( XtIsShell( w ) ) { @@ -201,11 +201,11 @@ Boolean qmotif_event_dispatcher( XEvent *event ) return True; - if ( QApplication::activePopupWidget() ) + if ( TQApplication::activePopupWidget() ) // we get all events through the popup grabs. discard the event return True; - if ( qMotif && QApplication::activeModalWidget() ) { + if ( qMotif && TQApplication::activeModalWidget() ) { if ( !qt_try_modal(qMotif, event) ) return True; @@ -229,13 +229,13 @@ Boolean qmotif_event_dispatcher( XEvent *event ) QXtEventLoop only provides a few public functions, but is the brains behind the integration. QXtEventLoop is responsible for initializing the Xt toolkit and the Xt application context. It does not open a - connection to the X server, this is done by using QApplication. + connection to the X server, this is done by using TQApplication. The only member function in QXtEventLoop that depends on an X server connection is QXtEventLoop::initialize(). QXtEventLoop must be created before - QApplication. + TQApplication. - Example usage of QXtEventLoop and QApplication: + Example usage of QXtEventLoop and TQApplication: \code static char *resources[] = { @@ -247,7 +247,7 @@ Boolean qmotif_event_dispatcher( XEvent *event ) QXtEventLoop integrator( "AppClass" ); XtAppSetFallbackResources( integrator.applicationContext(), resources ); - QApplication app( argc, argv ); + TQApplication app( argc, argv ); ... @@ -264,7 +264,7 @@ Boolean qmotif_event_dispatcher( XEvent *event ) All arguments passed to this function (\a applicationClass, \a options and \a numOptions) are used to call XtDisplayInitialize() - after QApplication has been constructed. + after TQApplication has been constructed. */ @@ -311,7 +311,7 @@ void QXtEventLoop::appStartingUp() { int argc = qApp->argc(); XtDisplayInitialize( d->appContext, - QPaintDevice::x11AppDisplay(), + TQPaintDevice::x11AppDisplay(), qApp->name(), d->applicationClass, d->options, @@ -329,7 +329,7 @@ void QXtEventLoop::appClosingDown() /*!\internal */ -void QXtEventLoop::registerWidget( QWidget* w ) +void QXtEventLoop::registerWidget( TQWidget* w ) { if ( !static_d ) return; @@ -339,7 +339,7 @@ void QXtEventLoop::registerWidget( QWidget* w ) /*!\internal */ -void QXtEventLoop::unregisterWidget( QWidget* w ) +void QXtEventLoop::unregisterWidget( TQWidget* w ) { if ( !static_d ) return; @@ -352,7 +352,7 @@ void QXtEventLoop::unregisterWidget( QWidget* w ) void qmotif_socknot_handler( XtPointer pointer, int *, XtInputId *id ) { QXtEventLoop *eventloop = (QXtEventLoop *) pointer; - QSocketNotifier *socknot = static_d->socknotDict.find( *id ); + TQSocketNotifier *socknot = static_d->socknotDict.find( *id ); if ( ! socknot ) // this shouldn't happen return; eventloop->setSocketNotifierPending( socknot ); @@ -360,19 +360,19 @@ void qmotif_socknot_handler( XtPointer pointer, int *, XtInputId *id ) /*! \reimp */ -void QXtEventLoop::registerSocketNotifier( QSocketNotifier *notifier ) +void QXtEventLoop::registerSocketNotifier( TQSocketNotifier *notifier ) { XtInputMask mask; switch ( notifier->type() ) { - case QSocketNotifier::Read: + case TQSocketNotifier::Read: mask = XtInputReadMask; break; - case QSocketNotifier::Write: + case TQSocketNotifier::Write: mask = XtInputWriteMask; break; - case QSocketNotifier::Exception: + case TQSocketNotifier::Exception: mask = XtInputExceptMask; break; @@ -386,14 +386,14 @@ void QXtEventLoop::registerSocketNotifier( QSocketNotifier *notifier ) qmotif_socknot_handler, this ); d->socknotDict.insert( id, notifier ); - QEventLoop::registerSocketNotifier( notifier ); + TQEventLoop::registerSocketNotifier( notifier ); } /*! \reimp */ -void QXtEventLoop::unregisterSocketNotifier( QSocketNotifier *notifier ) +void QXtEventLoop::unregisterSocketNotifier( TQSocketNotifier *notifier ) { - QIntDictIterator<QSocketNotifier> it( d->socknotDict ); + TQIntDictIterator<TQSocketNotifier> it( d->socknotDict ); while ( it.current() && notifier != it.current() ) ++it; if ( ! it.current() ) { @@ -405,7 +405,7 @@ void QXtEventLoop::unregisterSocketNotifier( QSocketNotifier *notifier ) XtRemoveInput( it.currentKey() ); d->socknotDict.remove( it.currentKey() ); - QEventLoop::unregisterSocketNotifier( notifier ); + TQEventLoop::unregisterSocketNotifier( notifier ); } /*! \internal @@ -422,7 +422,7 @@ bool QXtEventLoop::processEvents( ProcessEventsFlags flags ) { // Qt uses posted events to do lots of delayed operations, like repaints... these // need to be delivered before we go to sleep - QApplication::sendPostedEvents(); + TQApplication::sendPostedEvents(); // make sure we fire off Qt's timers int ttw = timeToWait(); diff --git a/nsplugins/viewer/qxteventloop.h b/nsplugins/viewer/qxteventloop.h index 0bed590b2..02ed69541 100644 --- a/nsplugins/viewer/qxteventloop.h +++ b/nsplugins/viewer/qxteventloop.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Implementation of QWidget class +** Implementation of TQWidget class ** ** Created : 931031 ** @@ -36,10 +36,10 @@ #ifndef QXTEVENTLOOP_H #define QXTEVENTLOOP_H -#include <qglobal.h> +#include <tqglobal.h> #if QT_VERSION >= 0x030100 -#include <qeventloop.h> +#include <tqeventloop.h> @@ -57,11 +57,11 @@ public: XtAppContext applicationContext() const; - void registerSocketNotifier( QSocketNotifier * ); - void unregisterSocketNotifier( QSocketNotifier * ); + void registerSocketNotifier( TQSocketNotifier * ); + void unregisterSocketNotifier( TQSocketNotifier * ); - static void registerWidget( QWidget* ); - static void unregisterWidget( QWidget* ); + static void registerWidget( TQWidget* ); + static void unregisterWidget( TQWidget* ); static bool redeliverEvent( XEvent *event ); static XEvent* lastEvent(); diff --git a/nsplugins/viewer/viewer.cpp b/nsplugins/viewer/viewer.cpp index 3e23a944a..ba14b0990 100644 --- a/nsplugins/viewer/viewer.cpp +++ b/nsplugins/viewer/viewer.cpp @@ -34,8 +34,8 @@ #include <kglobal.h> #include <klocale.h> #include <kmessagebox.h> -#include <qptrlist.h> -#include <qsocketnotifier.h> +#include <tqptrlist.h> +#include <tqsocketnotifier.h> #include <stdlib.h> #include <sys/resource.h> #include <sys/time.h> @@ -85,7 +85,7 @@ static int x_errhandler(Display *dpy, XErrorEvent *error) * the "old style" and keep lot's of global vars. :-) */ -static QCString g_dcopId; +static TQCString g_dcopId; /** * parseCommandLine - get command line parameters @@ -122,11 +122,11 @@ void quitXt() struct SocketNot { int fd; - QObject *obj; + TQObject *obj; XtInputId id; }; -QPtrList<SocketNot> _notifiers[3]; +TQPtrList<SocketNot> _notifiers[3]; /** * socketCallback - send event to the socket notifier @@ -136,10 +136,10 @@ void socketCallback(void *client_data, int* /*source*/, XtInputId* /*id*/) { kdDebug(1430) << "-> socketCallback( client_data=" << client_data << " )" << endl; - QEvent event( QEvent::SockAct ); + TQEvent event( TQEvent::SockAct ); SocketNot *socknot = (SocketNot *)client_data; kdDebug(1430) << "obj=" << (void*)socknot->obj << endl; - QApplication::sendEvent( socknot->obj, &event ); + TQApplication::sendEvent( socknot->obj, &event ); kdDebug(1430) << "<- socketCallback" << endl; } @@ -151,12 +151,12 @@ void socketCallback(void *client_data, int* /*source*/, XtInputId* /*id*/) * the original one in Qt. I hope this works with every dynamic library loader on any OS. * */ -extern bool qt_set_socket_handler( int, int, QObject *, bool ); -bool qt_set_socket_handler( int sockfd, int type, QObject *obj, bool enable ) +extern bool qt_set_socket_handler( int, int, TQObject *, bool ); +bool qt_set_socket_handler( int sockfd, int type, TQObject *obj, bool enable ) { if ( sockfd < 0 || type < 0 || type > 2 || obj == 0 ) { #if defined(CHECK_RANGE) - qWarning( "QSocketNotifier: Internal error" ); + qWarning( "TQSocketNotifier: Internal error" ); #endif return FALSE; } @@ -164,9 +164,9 @@ bool qt_set_socket_handler( int sockfd, int type, QObject *obj, bool enable ) XtPointer inpMask = 0; switch (type) { - case QSocketNotifier::Read: inpMask = (XtPointer)XtInputReadMask; break; - case QSocketNotifier::Write: inpMask = (XtPointer)XtInputWriteMask; break; - case QSocketNotifier::Exception: inpMask = (XtPointer)XtInputExceptMask; break; + case TQSocketNotifier::Read: inpMask = (XtPointer)XtInputReadMask; break; + case TQSocketNotifier::Write: inpMask = (XtPointer)XtInputWriteMask; break; + case TQSocketNotifier::Exception: inpMask = (XtPointer)XtInputExceptMask; break; default: return FALSE; } @@ -185,7 +185,7 @@ bool qt_set_socket_handler( int sockfd, int type, QObject *obj, bool enable ) #if defined(CHECK_STATE) if ( p && p->fd==sockfd ) { static const char *t[] = { "read", "write", "exception" }; - qWarning( "QSocketNotifier: Multiple socket notifiers for " + qWarning( "TQSocketNotifier: Multiple socket notifiers for " "same socket %d and type %s", sockfd, t[type] ); } #endif |