diff options
Diffstat (limited to 'kivio/plugins/kiviosmlconnector')
-rw-r--r-- | kivio/plugins/kiviosmlconnector/plugin.cpp | 10 | ||||
-rw-r--r-- | kivio/plugins/kiviosmlconnector/plugin.h | 11 | ||||
-rw-r--r-- | kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp | 62 | ||||
-rw-r--r-- | kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h | 31 | ||||
-rw-r--r-- | kivio/plugins/kiviosmlconnector/tool_connector.cpp | 40 | ||||
-rw-r--r-- | kivio/plugins/kiviosmlconnector/tool_connector.h | 27 |
6 files changed, 92 insertions, 89 deletions
diff --git a/kivio/plugins/kiviosmlconnector/plugin.cpp b/kivio/plugins/kiviosmlconnector/plugin.cpp index ee12cf17..a622f6e3 100644 --- a/kivio/plugins/kiviosmlconnector/plugin.cpp +++ b/kivio/plugins/kiviosmlconnector/plugin.cpp @@ -31,8 +31,8 @@ K_EXPORT_COMPONENT_FACTORY( libkiviosmlconnector, SMLConnectorFactory ) KInstance* SMLConnectorFactory::s_global = 0; -SMLConnectorFactory::SMLConnectorFactory( QObject* parent, const char* name ) -: KLibFactory( parent, name ) +SMLConnectorFactory::SMLConnectorFactory( TQObject* tqparent, const char* name ) +: KLibFactory( tqparent, name ) { s_global = new KInstance("kivio"); } @@ -42,12 +42,12 @@ SMLConnectorFactory::~SMLConnectorFactory() delete s_global; } -QObject* SMLConnectorFactory::createObject( QObject* parent, const char*, const char*, const QStringList& ) +TQObject* SMLConnectorFactory::createObject( TQObject* tqparent, const char*, const char*, const TQStringList& ) { - if ( !parent->inherits("KivioView") ) + if ( !tqparent->inherits("KivioView") ) return 0; - QObject *obj = new SMLConnector( (KivioView*)parent ); + TQObject *obj = new SMLConnector( (KivioView*)tqparent ); return obj; } diff --git a/kivio/plugins/kiviosmlconnector/plugin.h b/kivio/plugins/kiviosmlconnector/plugin.h index 530d8de8..9868fcc0 100644 --- a/kivio/plugins/kiviosmlconnector/plugin.h +++ b/kivio/plugins/kiviosmlconnector/plugin.h @@ -19,8 +19,8 @@ #ifndef SML_CONNECTOR_PLUGIN_H #define SML_CONNECTOR_PLUGIN_H -#include <qstringlist.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <klibloader.h> @@ -28,12 +28,13 @@ class KInstance; class SMLConnectorFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - SMLConnectorFactory( QObject* parent = 0, const char* name = 0 ); + SMLConnectorFactory( TQObject* tqparent = 0, const char* name = 0 ); ~SMLConnectorFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* tqparent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList() ); static KInstance* global(); diff --git a/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp b/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp index b6770700..3ab38fa4 100644 --- a/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp +++ b/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp @@ -32,13 +32,13 @@ #include "kivio_stencil_spawner_set.h" #include "kivio_text_style.h" #include "kivio_shape.h" -#include "kivio_shape_data.h" +#include "kivio_tqshape_data.h" #include "kivio_point.h" #include "tkmath.h" -#include <qcolor.h> -#include <qpixmap.h> +#include <tqcolor.h> +#include <tqpixmap.h> #include <kdebug.h> #include <KoZoomHandler.h> #include <kiconloader.h> @@ -48,13 +48,13 @@ static KivioStencilSpawnerInfo sinfo = KivioStencilSpawnerInfo( "Ian Reinhart Ge K_EXPORT_COMPONENT_FACTORY( sml_connector, KGenericFactory<KivioSMLConnectorFactory>( "KivioSMLConnectorFactory" ) ) -KivioSMLConnectorFactory::KivioSMLConnectorFactory( QObject *parent, const char* name, const QStringList& args ) : - KivioStencilFactory( parent, name, args ) +KivioSMLConnectorFactory::KivioSMLConnectorFactory( TQObject *tqparent, const char* name, const TQStringList& args ) : + KivioStencilFactory( tqparent, name, args ) { kdDebug(43000) << "new sml stencil factory: " << endl; } -KivioStencil *KivioSMLConnectorFactory::NewStencil( const QString& name ) +KivioStencil *KivioSMLConnectorFactory::NewStencil( const TQString& name ) { return new KivioSMLConnector( name ); } @@ -65,7 +65,7 @@ KivioStencil *KivioSMLConnectorFactory::NewStencil() } -QPixmap *KivioSMLConnectorFactory::GetIcon() +TQPixmap *KivioSMLConnectorFactory::GetIcon() { return & BarIcon( "SML_conn" ); } @@ -75,7 +75,7 @@ KivioStencilSpawnerInfo *KivioSMLConnectorFactory::GetSpawnerInfo() return & sinfo; } -KivioSMLConnector::KivioSMLConnector( const QString &name ) +KivioSMLConnector::KivioSMLConnector( const TQString &name ) : Kivio1DStencil(), m_name( name ) { @@ -96,9 +96,9 @@ KivioSMLConnector::KivioSMLConnector( const QString &name ) // This is a stencil of type connector setType( kstConnector ); - // We only have one shape, an open path. - //m_shape = new KivioShape(); - //m_shape->shapeData() ->setShapeType( KivioShapeData::kstOpenPath ); + // We only have one tqshape, an open path. + //m_tqshape = new KivioShape(); + //m_tqshape->tqshapeData() ->setShapeType( KivioShapeData::kstOpenPath ); loadPath( name ); } @@ -196,11 +196,11 @@ KivioStencil *KivioSMLConnector::duplicate() void KivioSMLConnector::drawOpenPath( KivioShape *pShape, KivioIntraStencilData *pData ) { KivioPainter * painter; - KivioShapeData *pShapeData = pShape->shapeData(); + KivioShapeData *pShapeData = pShape->tqshapeData(); KivioPoint *pPoint, *pNewPoint; - QPtrList <KivioPoint> *pPointList = pShapeData->pointList(); + TQPtrList <KivioPoint> *pPointList = pShapeData->pointList(); - QPtrList <KivioPoint> *pNewPoints = new QPtrList<KivioPoint>; + TQPtrList <KivioPoint> *pNewPoints = new TQPtrList<KivioPoint>; pNewPoints->setAutoDelete( true ); pPoint = pPointList->first(); @@ -262,10 +262,10 @@ void KivioSMLConnector::paint( KivioIntraStencilData *pData ) } - // Build shape up from m_pConnectorPoints + // Build tqshape up from m_pConnectorPoints - QPtrList <KivioPoint> *pNewPoints = new QPtrList<KivioPoint>; + TQPtrList <KivioPoint> *pNewPoints = new TQPtrList<KivioPoint>; pNewPoints->setAutoDelete( true ); pNewPoints->append(new KivioPoint( zoomHandler->zoomItX( m_pStart->x() ), @@ -309,27 +309,27 @@ void KivioSMLConnector::paintOutline( KivioIntraStencilData *pData ) paint( pData ); } -bool KivioSMLConnector::saveCustom( QDomElement &e, QDomDocument &doc ) +bool KivioSMLConnector::saveCustom( TQDomElement &e, TQDomDocument &doc ) { kdDebug(43000) << "Save custom " << endl; e.appendChild( saveArrowHeads( doc ) ); - //QDomElement type = m_shape->saveXML(doc); + //TQDomElement type = m_tqshape->saveXML(doc); KivioConnectorPoint *p = m_PointList.first(); while ( p ) { - QDomElement pt = p->saveXML( doc ); + TQDomElement pt = p->saveXML( doc ); e.appendChild( pt ); p = m_PointList.next(); } return true; } -bool KivioSMLConnector::loadCustom( const QDomElement &e ) +bool KivioSMLConnector::loadCustom( const TQDomElement &e ) { kdDebug(43000) << "Load custom " << endl; - QDomNode node; - QString name; + TQDomNode node; + TQString name; node = e.firstChild(); while ( !node.isNull() ) @@ -341,8 +341,8 @@ bool KivioSMLConnector::loadCustom( const QDomElement &e ) } else if ( name == "KivioShape" ) { - //m_shape->loadXML(node.toElement()); - QDomNode pts = node.firstChild(); + //m_tqshape->loadXML(node.toElement()); + TQDomNode pts = node.firstChild(); while ( !pts.isNull() ) { KivioConnectorPoint * pt = new KivioConnectorPoint(); @@ -360,9 +360,9 @@ bool KivioSMLConnector::loadCustom( const QDomElement &e ) return true; } -QDomElement KivioSMLConnector::saveArrowHeads( QDomDocument &doc ) +TQDomElement KivioSMLConnector::saveArrowHeads( TQDomDocument &doc ) { - QDomElement e = doc.createElement( "KivioArrowHeads" ); + TQDomElement e = doc.createElement( "KivioArrowHeads" ); e.appendChild( m_startAH->saveXML( doc ) ); e.appendChild( m_endAH->saveXML( doc ) ); @@ -370,11 +370,11 @@ QDomElement KivioSMLConnector::saveArrowHeads( QDomDocument &doc ) return e; } -bool KivioSMLConnector::loadArrowHeads( const QDomElement &e ) +bool KivioSMLConnector::loadArrowHeads( const TQDomElement &e ) { - QDomNode node; - QString nodeName; - QDomElement arrowE; + TQDomNode node; + TQString nodeName; + TQDomElement arrowE; bool first = true; node = e.firstChild(); @@ -404,7 +404,7 @@ bool KivioSMLConnector::loadArrowHeads( const QDomElement &e ) } -bool KivioSMLConnector::loadPath( const QString &file ) +bool KivioSMLConnector::loadPath( const TQString &file ) { kdDebug(43000) << "Loading :" << file << endl; diff --git a/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h b/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h index 4371ff8a..0be46d46 100644 --- a/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h +++ b/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h @@ -31,9 +31,9 @@ class KivioPage; class KivioShape; -#include <qstringlist.h> -#include <qcolor.h> -#include <qdom.h> +#include <tqstringlist.h> +#include <tqcolor.h> +#include <tqdom.h> #include "kivio_1d_stencil.h" @@ -41,24 +41,24 @@ class KivioShape; class KivioSMLConnector : public Kivio1DStencil { private: - bool loadPath(const QString &file); + bool loadPath(const TQString &file); //void drawOpenPath( KivioShape *, KivioIntraStencilData * ); - KivioShape *m_shape; - QPtrList<KivioConnectorPoint> m_PointList; + KivioShape *m_tqshape; + TQPtrList<KivioConnectorPoint> m_PointList; - QString m_name; + TQString m_name; protected: KivioArrowHead *m_startAH; KivioArrowHead *m_endAH; - bool loadArrowHeads( const QDomElement & ); - QDomElement saveArrowHeads( QDomDocument & ); - virtual bool loadCustom( const QDomElement & ); - virtual bool saveCustom( QDomElement &, QDomDocument & ); + bool loadArrowHeads( const TQDomElement & ); + TQDomElement saveArrowHeads( TQDomDocument & ); + virtual bool loadCustom( const TQDomElement & ); + virtual bool saveCustom( TQDomElement &, TQDomDocument & ); public: - KivioSMLConnector(const QString& name); + KivioSMLConnector(const TQString& name); virtual ~KivioSMLConnector(); virtual void setStartPoint( double, double ); @@ -93,11 +93,12 @@ public: class KivioSMLConnectorFactory : public KivioStencilFactory { Q_OBJECT + TQ_OBJECT public: - KivioSMLConnectorFactory(QObject *parent=0, const char* name=0, const QStringList& args = QStringList()); - KivioStencil *NewStencil(const QString& name); + KivioSMLConnectorFactory(TQObject *tqparent=0, const char* name=0, const TQStringList& args = TQStringList()); + KivioStencil *NewStencil(const TQString& name); KivioStencil *NewStencil(); - QPixmap *GetIcon(); + TQPixmap *GetIcon(); KivioStencilSpawnerInfo *GetSpawnerInfo(); }; #endif diff --git a/kivio/plugins/kiviosmlconnector/tool_connector.cpp b/kivio/plugins/kiviosmlconnector/tool_connector.cpp index ded38f13..4578f0a7 100644 --- a/kivio/plugins/kiviosmlconnector/tool_connector.cpp +++ b/kivio/plugins/kiviosmlconnector/tool_connector.cpp @@ -18,7 +18,7 @@ */ #include "tool_connector.h" -#include <qcursor.h> +#include <tqcursor.h> #include <kdebug.h> #include <kiconloader.h> #include <kstandarddirs.h> @@ -46,12 +46,12 @@ SMLConnector::SMLConnector( KivioView* view ) { m_connectorAction = new KToggleAction(i18n("Polyline Connector"), "", 0, actionCollection(), "sml_connector"); - connect(m_connectorAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); + connect(m_connectorAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); m_mode = stmNone; - m_pConnectorCursor1 = new QCursor(BarIcon("kivio_connector_cursor1",KivioFactory::global()),2,2); - m_pConnectorCursor2 = new QCursor(BarIcon("kivio_connector_cursor2",KivioFactory::global()),2,2); + m_pConnectorCursor1 = new TQCursor(BarIcon("kivio_connector_cursor1",KivioFactory::global()),2,2); + m_pConnectorCursor2 = new TQCursor(BarIcon("kivio_connector_cursor2",KivioFactory::global()),2,2); } SMLConnector::~SMLConnector() @@ -67,22 +67,22 @@ SMLConnector::~SMLConnector() * @param e The event to be identified and processed * */ -bool SMLConnector::processEvent( QEvent* e ) +bool SMLConnector::processEvent( TQEvent* e ) { switch (e->type()) { - case QEvent::MouseButtonPress: - mousePress( (QMouseEvent*)e ); + case TQEvent::MouseButtonPress: + mousePress( (TQMouseEvent*)e ); return true; break; - case QEvent::MouseButtonRelease: - mouseRelease( (QMouseEvent*)e ); + case TQEvent::MouseButtonRelease: + mouseRelease( (TQMouseEvent*)e ); return true; break; - case QEvent::MouseMove: - mouseMove( (QMouseEvent*)e ); + case TQEvent::MouseMove: + mouseMove( (TQMouseEvent*)e ); return true; break; @@ -111,7 +111,7 @@ void SMLConnector::setActivated(bool a) } } -void SMLConnector::connector(QRect) +void SMLConnector::connector(TQRect) { if (!m_pStencil) return; @@ -135,7 +135,7 @@ void SMLConnector::connector(QRect) doc->updateView(page); } -void SMLConnector::mousePress( QMouseEvent *e ) +void SMLConnector::mousePress( TQMouseEvent *e ) { if(e->button() == RightButton) { @@ -151,7 +151,7 @@ void SMLConnector::mousePress( QMouseEvent *e ) /** * Tests if we should start rubber banding (always returns true). */ -bool SMLConnector::startRubberBanding( QMouseEvent *e ) +bool SMLConnector::startRubberBanding( TQMouseEvent *e ) { KivioDoc* doc = view()->doc(); KivioPage* pPage = view()->activePage(); @@ -190,12 +190,12 @@ bool SMLConnector::startRubberBanding( QMouseEvent *e ) m_pStencil->customDrag(m_pDragData); - canvas->repaint(); + canvas->tqrepaint(); canvas->setCursor(*m_pConnectorCursor2); return true; } -void SMLConnector::mouseMove( QMouseEvent * e ) +void SMLConnector::mouseMove( TQMouseEvent * e ) { switch( m_mode ) { @@ -208,7 +208,7 @@ void SMLConnector::mouseMove( QMouseEvent * e ) } } -void SMLConnector::continueRubberBanding( QMouseEvent *e ) +void SMLConnector::continueRubberBanding( TQMouseEvent *e ) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint endPoint = canvas->mapFromScreen( e->pos() ); @@ -223,10 +223,10 @@ void SMLConnector::continueRubberBanding( QMouseEvent *e ) m_pStencil->customDrag(m_pDragData); m_pStencil->updateGeometry(); - canvas->repaint(); + canvas->tqrepaint(); } -void SMLConnector::mouseRelease( QMouseEvent *e ) +void SMLConnector::mouseRelease( TQMouseEvent *e ) { switch( m_mode ) { @@ -239,7 +239,7 @@ void SMLConnector::mouseRelease( QMouseEvent *e ) m_mode = stmNone; } -void SMLConnector::endRubberBanding(QMouseEvent *) +void SMLConnector::endRubberBanding(TQMouseEvent *) { connector(view()->canvasWidget()->rect()); m_pStencil = 0; diff --git a/kivio/plugins/kiviosmlconnector/tool_connector.h b/kivio/plugins/kiviosmlconnector/tool_connector.h index aecb26db..788192f6 100644 --- a/kivio/plugins/kiviosmlconnector/tool_connector.h +++ b/kivio/plugins/kiviosmlconnector/tool_connector.h @@ -22,8 +22,8 @@ #include "kivio_mousetool.h" #include <KoPoint.h> -class QMouseEvent; -class QCursor; +class TQMouseEvent; +class TQCursor; class KToggleAction; @@ -34,13 +34,14 @@ class KivioCustomDragData; class SMLConnector : public Kivio::MouseTool { Q_OBJECT + TQ_OBJECT public: SMLConnector( KivioView* view ); ~SMLConnector(); - virtual bool processEvent( QEvent* ); + virtual bool processEvent( TQEvent* ); - void connector(QRect); + void connector(TQRect); public slots: virtual void setActivated(bool a); @@ -49,17 +50,17 @@ signals: void operationDone(); protected: - void mousePress(QMouseEvent *); - void mouseMove(QMouseEvent *); - void mouseRelease(QMouseEvent *); + void mousePress(TQMouseEvent *); + void mouseMove(TQMouseEvent *); + void mouseRelease(TQMouseEvent *); - bool startRubberBanding(QMouseEvent*); - void continueRubberBanding(QMouseEvent *); - void endRubberBanding(QMouseEvent *); + bool startRubberBanding(TQMouseEvent*); + void continueRubberBanding(TQMouseEvent *); + void endRubberBanding(TQMouseEvent *); - QPoint m_startPoint, m_releasePoint; + TQPoint m_startPoint, m_releasePoint; // Connector Tool Mode enum @@ -71,8 +72,8 @@ protected: private: // Flag to indicate that we are drawing a rubber band int m_mode; - QCursor* m_pConnectorCursor1; - QCursor* m_pConnectorCursor2; + TQCursor* m_pConnectorCursor1; + TQCursor* m_pConnectorCursor2; KivioSMLConnector* m_pStencil; KoPoint startPoint; KivioCustomDragData* m_pDragData; |