diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /krita/ui/kis_canvas.h | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/ui/kis_canvas.h')
-rw-r--r-- | krita/ui/kis_canvas.h | 214 |
1 files changed, 108 insertions, 106 deletions
diff --git a/krita/ui/kis_canvas.h b/krita/ui/kis_canvas.h index b9e38738..aff09e65 100644 --- a/krita/ui/kis_canvas.h +++ b/krita/ui/kis_canvas.h @@ -24,21 +24,21 @@ #include <config.h> #endif -#include <qwidget.h> +#include <tqwidget.h> #ifdef HAVE_GL -#include <qgl.h> +#include <tqgl.h> #endif -#include <qpainter.h> +#include <tqpainter.h> #include "kis_global.h" #include "kis_point.h" #include "kis_vec.h" #include "kis_input_device.h" -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 // Irix has a different (and better) XInput tablet driver to -// the XFree/xorg driver. Qt needs a separate code path for that +// the XFree/xorg driver. TQt needs a separate code path for that // and so would we. #if defined(HAVE_XINPUTEXT) && !defined(Q_OS_IRIX) #define EXTENDED_X11_TABLET_SUPPORT @@ -51,7 +51,7 @@ #include <X11/extensions/XInput.h> #endif -#endif // Q_WS_X11 +#endif // TQ_WS_X11 class KisEvent; class KisMoveEvent; @@ -60,8 +60,9 @@ class KisButtonReleaseEvent; class KisDoubleClickEvent; class KisCanvasWidgetPainter; -class KisCanvasWidget : public QObject { +class KisCanvasWidget : public TQObject { Q_OBJECT + TQ_OBJECT public: KisCanvasWidget(); @@ -78,41 +79,41 @@ public: static KisInputDevice findActiveInputDevice(); virtual void selectTabletDeviceEvents() = 0; - static void selectTabletDeviceEvents(QWidget *widget); + static void selectTabletDeviceEvents(TQWidget *widget); #endif -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 static void initX11Support(); #endif signals: - void sigGotPaintEvent(QPaintEvent*); - void sigGotEnterEvent(QEvent*); - void sigGotLeaveEvent(QEvent*); - void sigGotMouseWheelEvent(QWheelEvent*); - void sigGotKeyPressEvent(QKeyEvent*); - void sigGotKeyReleaseEvent(QKeyEvent*); - void sigGotDragEnterEvent(QDragEnterEvent*); - void sigGotDropEvent(QDropEvent*); + void sigGotPaintEvent(TQPaintEvent*); + void sigGotEnterEvent(TQEvent*); + void sigGotLeaveEvent(TQEvent*); + void sigGotMouseWheelEvent(TQWheelEvent*); + void sigGotKeyPressEvent(TQKeyEvent*); + void sigGotKeyReleaseEvent(TQKeyEvent*); + void sigGotDragEnterEvent(TQDragEnterEvent*); + void sigGotDropEvent(TQDropEvent*); void sigGotMoveEvent(KisMoveEvent *); void sigGotButtonPressEvent(KisButtonPressEvent *); void sigGotButtonReleaseEvent(KisButtonReleaseEvent *); void sigGotDoubleClickEvent(KisDoubleClickEvent *); protected: - void widgetGotPaintEvent(QPaintEvent *event); - void widgetGotMousePressEvent(QMouseEvent *event); - void widgetGotMouseReleaseEvent(QMouseEvent *event); - void widgetGotMouseDoubleClickEvent(QMouseEvent *event); - void widgetGotMouseMoveEvent(QMouseEvent *event); - void widgetGotTabletEvent(QTabletEvent *event); - void widgetGotEnterEvent(QEvent *event ); - void widgetGotLeaveEvent(QEvent *event); - void widgetGotWheelEvent(QWheelEvent *event); - void widgetGotKeyPressEvent(QKeyEvent *event); - void widgetGotKeyReleaseEvent(QKeyEvent *event); - void widgetGotDragEnterEvent(QDragEnterEvent *event); - void widgetGotDropEvent(QDropEvent *event); + void widgetGotPaintEvent(TQPaintEvent *event); + void widgetGotMousePressEvent(TQMouseEvent *event); + void widgetGotMouseReleaseEvent(TQMouseEvent *event); + void widgetGotMouseDoubleClickEvent(TQMouseEvent *event); + void widgetGotMouseMoveEvent(TQMouseEvent *event); + void widgetGotTabletEvent(TQTabletEvent *event); + void widgetGotEnterEvent(TQEvent *event ); + void widgetGotLeaveEvent(TQEvent *event); + void widgetGotWheelEvent(TQWheelEvent *event); + void widgetGotKeyPressEvent(TQKeyEvent *event); + void widgetGotKeyReleaseEvent(TQKeyEvent *event); + void widgetGotDragEnterEvent(TQDragEnterEvent *event); + void widgetGotDropEvent(TQDropEvent *event); void moveEvent(KisMoveEvent *event); void buttonPressEvent(KisButtonPressEvent *event); void buttonReleaseEvent(KisButtonReleaseEvent *event); @@ -124,18 +125,18 @@ protected: bool m_enableMoveEventCompressionHint; double m_lastPressure; -#ifdef Q_WS_X11 - // On X11 systems, Qt throws away mouse move events if the application +#ifdef TQ_WS_X11 + // On X11 systems, TQt throws away mouse move events if the application // is unable to keep up with them. We override this behaviour so that // we receive all move events, so that painting follows the mouse's motion // accurately. - bool x11Event(XEvent *event, Display *x11Display, WId winId, QPoint widgetOriginPos); - static Qt::ButtonState translateX11ButtonState(int state); - static Qt::ButtonState translateX11Button(unsigned int button); + bool x11Event(XEvent *event, Display *x11Display, WId winId, TQPoint widgetOriginPos); + static TQt::ButtonState translateX11ButtonState(int state); + static TQt::ButtonState translateX11Button(unsigned int button); static bool X11SupportInitialised; - // Modifier masks for alt/meta - detected at run-time + // Modifier tqmasks for alt/meta - detected at run-time static long X11AltMask; static long X11MetaMask; @@ -155,7 +156,7 @@ public: XID id() const { return m_deviceId; } XDevice *xDevice() const { return m_XDevice; } - QString name() const { return m_name; } + TQString name() const { return m_name; } KisInputDevice inputDevice() const { return m_inputDevice; } void setInputDevice(KisInputDevice inputDevice) { m_inputDevice = inputDevice; } @@ -163,28 +164,28 @@ public: void setEnabled(bool enabled); bool enabled() const; - Q_INT32 numAxes() const; - - void setXAxis(Q_INT32 axis); - void setYAxis(Q_INT32 axis); - void setPressureAxis(Q_INT32 axis); - void setXTiltAxis(Q_INT32 axis); - void setYTiltAxis(Q_INT32 axis); - void setWheelAxis(Q_INT32 axis); - void setToolIDAxis(Q_INT32 axis); - void setSerialNumberAxis(Q_INT32 axis); - - static const Q_INT32 NoAxis = -1; - static const Q_INT32 DefaultAxis = -2; - - Q_INT32 xAxis() const; - Q_INT32 yAxis() const; - Q_INT32 pressureAxis() const; - Q_INT32 xTiltAxis() const; - Q_INT32 yTiltAxis() const; - Q_INT32 wheelAxis() const; - Q_INT32 toolIDAxis() const; - Q_INT32 serialNumberAxis() const; + TQ_INT32 numAxes() const; + + void setXAxis(TQ_INT32 axis); + void setYAxis(TQ_INT32 axis); + void setPressureAxis(TQ_INT32 axis); + void setXTiltAxis(TQ_INT32 axis); + void setYTiltAxis(TQ_INT32 axis); + void setWheelAxis(TQ_INT32 axis); + void setToolIDAxis(TQ_INT32 axis); + void setSerialNumberAxis(TQ_INT32 axis); + + static const TQ_INT32 NoAxis = -1; + static const TQ_INT32 DefaultAxis = -2; + + TQ_INT32 xAxis() const; + TQ_INT32 yAxis() const; + TQ_INT32 pressureAxis() const; + TQ_INT32 xTiltAxis() const; + TQ_INT32 yTiltAxis() const; + TQ_INT32 wheelAxis() const; + TQ_INT32 toolIDAxis() const; + TQ_INT32 serialNumberAxis() const; void readSettingsFromConfig(); void writeSettingsToConfig(); @@ -196,14 +197,14 @@ public: int proximityInEvent() const { return m_proximityInEvent; } int proximityOutEvent() const { return m_proximityOutEvent; } - void enableEvents(QWidget *widget) const; + void enableEvents(TQWidget *widget) const; class State { public: State() {} State(const KisPoint& pos, double pressure, const KisVector2D& tilt, double wheel, - Q_UINT32 toolID, Q_UINT32 serialNumber); + TQ_UINT32 toolID, TQ_UINT32 serialNumber); // Position, pressure and wheel are normalised to 0 - 1 KisPoint pos() const { return m_pos; } @@ -212,16 +213,16 @@ public: KisVector2D tilt() const { return m_tilt; } double wheel() const { return m_wheel; } // Wacom tool id and serial number of device. - Q_UINT32 toolID() const { return m_toolID; } - Q_UINT32 serialNumber() const { return m_serialNumber; } + TQ_UINT32 toolID() const { return m_toolID; } + TQ_UINT32 serialNumber() const { return m_serialNumber; } private: KisPoint m_pos; double m_pressure; KisVector2D m_tilt; double m_wheel; - Q_UINT32 m_toolID; - Q_UINT32 m_serialNumber; + TQ_UINT32 m_toolID; + TQ_UINT32 m_serialNumber; }; State translateAxisData(const int *axisData) const; @@ -232,23 +233,23 @@ public: XID m_deviceId; XDevice *m_XDevice; - QString m_name; + TQString m_name; bool m_mightBeTabletDevice; KisInputDevice m_inputDevice; bool m_enabled; - Q_INT32 m_xAxis; - Q_INT32 m_yAxis; - Q_INT32 m_pressureAxis; - Q_INT32 m_xTiltAxis; - Q_INT32 m_yTiltAxis; - Q_INT32 m_wheelAxis; - Q_INT32 m_toolIDAxis; - Q_INT32 m_serialNumberAxis; + TQ_INT32 m_xAxis; + TQ_INT32 m_yAxis; + TQ_INT32 m_pressureAxis; + TQ_INT32 m_xTiltAxis; + TQ_INT32 m_yTiltAxis; + TQ_INT32 m_wheelAxis; + TQ_INT32 m_toolIDAxis; + TQ_INT32 m_serialNumberAxis; - QValueVector<XAxisInfo> m_axisInfo; + TQValueVector<XAxisInfo> m_axisInfo; int m_motionNotifyEvent; int m_buttonPressEvent; @@ -256,7 +257,7 @@ public: int m_proximityInEvent; int m_proximityOutEvent; - QValueVector<XEventClass> m_eventClassList; + TQValueVector<XEventClass> m_eventClassList; }; typedef std::map<XID, X11TabletDevice> X11XIDTabletDeviceMap; @@ -273,14 +274,15 @@ protected: #endif // EXTENDED_X11_TABLET_SUPPORT -#endif // Q_WS_X11 +#endif // TQ_WS_X11 }; -class KisCanvas : public QObject { +class KisCanvas : public TQObject { Q_OBJECT + TQ_OBJECT public: - KisCanvas(QWidget *parent, const char *name); + KisCanvas(TQWidget *tqparent, const char *name); virtual ~KisCanvas(); // When enabled, the canvas may throw away move events if the application @@ -299,19 +301,19 @@ public: * Handle the given event (which must be a key event) as if the canvas * had received it directly. */ - void handleKeyEvent(QEvent *e); + void handleKeyEvent(TQEvent *e); int width() const; int height() const; void update(); - void update(const QRect& r); + void update(const TQRect& r); void update(int x, int y, int width, int height); - void repaint(); - void repaint(bool erase); - void repaint(int x, int y, int width, int height, bool erase = true); - void repaint(const QRect& r, bool erase = true); - void repaint(const QRegion& r, bool erase = true); + void tqrepaint(); + void tqrepaint(bool erase); + void tqrepaint(int x, int y, int width, int height, bool erase = true); + void tqrepaint(const TQRect& r, bool erase = true); + void tqrepaint(const TQRegion& r, bool erase = true); void updateGeometry(); @@ -320,14 +322,14 @@ public: #endif signals: - void sigGotPaintEvent(QPaintEvent*); - void sigGotEnterEvent(QEvent*); - void sigGotLeaveEvent(QEvent*); - void sigGotMouseWheelEvent(QWheelEvent*); - void sigGotKeyPressEvent(QKeyEvent*); - void sigGotKeyReleaseEvent(QKeyEvent*); - void sigGotDragEnterEvent(QDragEnterEvent*); - void sigGotDropEvent(QDropEvent*); + void sigGotPaintEvent(TQPaintEvent*); + void sigGotEnterEvent(TQEvent*); + void sigGotLeaveEvent(TQEvent*); + void sigGotMouseWheelEvent(TQWheelEvent*); + void sigGotKeyPressEvent(TQKeyEvent*); + void sigGotKeyReleaseEvent(TQKeyEvent*); + void sigGotDragEnterEvent(TQDragEnterEvent*); + void sigGotDropEvent(TQDropEvent*); void sigGotMoveEvent(KisMoveEvent *); void sigGotButtonPressEvent(KisButtonPressEvent *); void sigGotButtonReleaseEvent(KisButtonReleaseEvent *); @@ -339,15 +341,15 @@ protected: friend class KisView; friend class KisCanvasPainter; - // One of these will be valid, the other null. In Qt3, using a QPainter on - // a QGLWidget is not reliable. - QWidget *QPaintDeviceWidget() const; + // One of these will be valid, the other null. In TQt3, using a TQPainter on + // a TQGLWidget is not reliable. + TQWidget *TQPaintDeviceWidget() const; #ifdef HAVE_GL - QGLWidget *OpenGLWidget() const; + TQGLWidget *OpenGLWidget() const; #endif - void createQPaintDeviceCanvas(); + void createTQPaintDeviceCanvas(); #ifdef HAVE_GL - void createOpenGLCanvas(QGLWidget *sharedContextWidget); + void createOpenGLCanvas(TQGLWidget *sharedContextWidget); #endif void show(); void hide(); @@ -356,22 +358,22 @@ protected: void setUpdatesEnabled(bool updatesEnabled); bool isUpdatesEnabled() const; - void setFocusPolicy(QWidget::FocusPolicy focusPolicy); + void setFocusPolicy(TQWidget::FocusPolicy focusPolicy); - const QCursor& cursor() const; - void setCursor(const QCursor& cursor); + const TQCursor& cursor() const; + void setCursor(const TQCursor& cursor); KisCanvasWidgetPainter *createPainter(); KisCanvasWidget *canvasWidget() const; protected: #ifdef HAVE_GL - void createCanvasWidget(bool useOpenGL, QGLWidget *sharedContextWidget = 0); + void createCanvasWidget(bool useOpenGL, TQGLWidget *sharedContextWidget = 0); #else void createCanvasWidget(bool useOpenGL); #endif - QWidget *m_parent; - QString m_name; + TQWidget *m_parent; + TQString m_name; KisCanvasWidget *m_canvasWidget; bool m_enableMoveEventCompressionHint; bool m_useOpenGL; |