diff options
Diffstat (limited to 'krita/core/kis_paint_device.h')
-rw-r--r-- | krita/core/kis_paint_device.h | 167 |
1 files changed, 84 insertions, 83 deletions
diff --git a/krita/core/kis_paint_device.h b/krita/core/kis_paint_device.h index 3b1dcfe7..653c013a 100644 --- a/krita/core/kis_paint_device.h +++ b/krita/core/kis_paint_device.h @@ -18,13 +18,13 @@ #ifndef KIS_PAINT_DEVICE_IMPL_H_ #define KIS_PAINT_DEVICE_IMPL_H_ -#include <qcolor.h> -#include <qobject.h> -#include <qpixmap.h> -#include <qptrlist.h> -#include <qrect.h> -#include <qvaluelist.h> -#include <qstring.h> +#include <tqcolor.h> +#include <tqobject.h> +#include <tqpixmap.h> +#include <tqptrlist.h> +#include <tqrect.h> +#include <tqvaluelist.h> +#include <tqstring.h> #include "kis_types.h" #include "kdebug.h" @@ -37,11 +37,11 @@ class DCOPObject; -class QImage; -class QSize; -class QPoint; -class QWMatrix; -class QTimer; +class TQImage; +class TQSize; +class TQPoint; +class TQWMatrix; +class TQTimer; class KNamedCommand; @@ -71,11 +71,12 @@ typedef KSharedPtr<KisMemento> KisMementoSP; * when pixels are accessed by an iterator. */ class KRITACORE_EXPORT KisPaintDevice - : public QObject + : public TQObject , public KShared { Q_OBJECT + TQ_OBJECT public: @@ -89,13 +90,13 @@ public: /** * Create a new paint device with the specified colorspace. The - * parentLayer will be notified of changes to this paint device. + * tqparentLayer will be notified of changes to this paint device. * - * @param parentLayer the layer that contains this paint device. + * @param tqparentLayer the layer that contains this paint device. * @param colorSpace the colorspace of this paint device * @param name for debugging purposes */ - KisPaintDevice(KisLayer *parentLayer, KisColorSpace * colorSpace, const char * name = 0); + KisPaintDevice(KisLayer *tqparentLayer, KisColorSpace * colorSpace, const char * name = 0); KisPaintDevice(const KisPaintDevice& rhs); virtual ~KisPaintDevice(); @@ -120,28 +121,28 @@ public: /** * Moves the device to these new coordinates (so no incremental move or so) */ - virtual void move(Q_INT32 x, Q_INT32 y); + virtual void move(TQ_INT32 x, TQ_INT32 y); /** * Convenience method for the above */ - virtual void move(const QPoint& pt); + virtual void move(const TQPoint& pt); /** * Move the paint device to the specified location and make it possible to * undo the move. */ - virtual KNamedCommand * moveCommand(Q_INT32 x, Q_INT32 y); + virtual KNamedCommand * moveCommand(TQ_INT32 x, TQ_INT32 y); /** * Returns true of x,y is within the extent of this paint device */ - bool contains(Q_INT32 x, Q_INT32 y) const; + bool tqcontains(TQ_INT32 x, TQ_INT32 y) const; /** * Convenience method for the above */ - bool contains(const QPoint& pt) const; + bool tqcontains(const TQPoint& pt) const; /** * Retrieve the bounds of the paint device. The size is not exact, @@ -149,8 +150,8 @@ public: * For instance, the tiled datamanager keeps the extent to the nearest * multiple of 64. */ - virtual void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; - virtual QRect extent() const; + virtual void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const; + virtual TQRect extent() const; /** * XXX: This should be a temporay hack, awaiting a proper fix. @@ -168,18 +169,18 @@ public: * Get the exact bounds of this paint device. This may be very slow, * especially on larger paint devices because it does a linear scanline search. */ - virtual void exactBounds(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; - virtual QRect exactBounds() const; - virtual QRect exactBoundsOldMethod() const; - virtual QRect exactBoundsImprovedOldMethod() const; + virtual void exactBounds(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const; + virtual TQRect exactBounds() const; + virtual TQRect exactBoundsOldMethod() const; + virtual TQRect exactBoundsImprovedOldMethod() const; /** * Cut the paint device down to the specified rect */ - void crop(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + void crop(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); /// Convience method for the above - void crop(QRect r); + void crop(TQRect r); /** * Complete erase the current paint device. Its size will become 0. @@ -189,7 +190,7 @@ public: /** * Fill the given rectangle with the given pixel. */ - void fill(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *fillPixel); + void fill(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *fillPixel); /** * Read the bytes representing the rectangle described by x, y, w, h into @@ -201,7 +202,7 @@ public: * Reading from areas not previously initialized will read the default * pixel value into data but not initialize that region. */ - virtual void readBytes(Q_UINT8 * data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + virtual void readBytes(TQ_UINT8 * data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); /** * Copy the bytes in data into the rect specified by x, y, w, h. If the @@ -211,40 +212,40 @@ public: * If the data is written to areas of the paint device not previously initialized, * the paint device will grow. */ - virtual void writeBytes(const Q_UINT8 * data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + virtual void writeBytes(const TQ_UINT8 * data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); /** * Get the number of contiguous columns starting at x, valid for all values * of y between minY and maxY. */ - Q_INT32 numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT32 maxY); + TQ_INT32 numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY); /** * Get the number of contiguous rows starting at y, valid for all values * of x between minX and maxX. */ - Q_INT32 numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 maxX); + TQ_INT32 numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX); /** * Get the row stride at pixel (x, y). This is the number of bytes to add to a * pointer to pixel (x, y) to access (x, y + 1). */ - Q_INT32 rowStride(Q_INT32 x, Q_INT32 y); + TQ_INT32 rowStride(TQ_INT32 x, TQ_INT32 y); /** * Get a read-only pointer to pixel (x, y). */ - KDE_DEPRECATED const Q_UINT8* pixel(Q_INT32 x, Q_INT32 y); + KDE_DEPRECATED const TQ_UINT8* pixel(TQ_INT32 x, TQ_INT32 y); /** * Get a read-write pointer to pixel (x, y). */ - KDE_DEPRECATED Q_UINT8* writablePixel(Q_INT32 x, Q_INT32 y); + KDE_DEPRECATED TQ_UINT8* writablePixel(TQ_INT32 x, TQ_INT32 y); /** * Converts the paint device to a different colorspace */ - virtual void convertTo(KisColorSpace * dstColorSpace, Q_INT32 renderingIntent = INTENT_PERCEPTUAL); + virtual void convertTo(KisColorSpace * dstColorSpace, TQ_INT32 renderingIntent = INTENT_PERCEPTUAL); /** * Changes the profile of the colorspace of this paint device to the given @@ -256,10 +257,10 @@ public: * Fill this paint device with the data from img; starting at (offsetX, offsetY) * @param srcProfileName name of the RGB profile to interpret the img as. "" is interpreted as sRGB */ - virtual void convertFromQImage(const QImage& img, const QString &srcProfileName, Q_INT32 offsetX = 0, Q_INT32 offsetY = 0); + virtual void convertFromTQImage(const TQImage& img, const TQString &srcProfileName, TQ_INT32 offsetX = 0, TQ_INT32 offsetY = 0); /** - * Create an RGBA QImage from a rectangle in the paint device. + * Create an RGBA TQImage from a rectangle in the paint device. * * @param x Left coordinate of the rectangle * @param y Top coordinate of the rectangle @@ -270,31 +271,31 @@ public: * like sRGB). * @param exposure The exposure setting used to render a preview of a high dynamic range image. */ - virtual QImage convertToQImage(KisProfile * dstProfile, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, float exposure = 0.0f); + virtual TQImage convertToTQImage(KisProfile * dstProfile, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, float exposure = 0.0f); /** - * Create an RGBA QImage from a rectangle in the paint device. The rectangle is defined by the parent image's bounds. + * Create an RGBA TQImage from a rectangle in the paint device. The rectangle is defined by the tqparent image's bounds. * * @param dstProfile RGB profile to use in conversion. May be 0, in which * case it's up to the colour strategy to choose a profile (most * like sRGB). * @param exposure The exposure setting used to render a preview of a high dynamic range image. */ - virtual QImage convertToQImage(KisProfile * dstProfile, float exposure = 0.0f); + virtual TQImage convertToTQImage(KisProfile * dstProfile, float exposure = 0.0f); /** * Creates a paint device thumbnail of the paint device, retaining the aspect ratio. * The width and height of the returned device won't exceed \p maxw and \p maxw, but they may be smaller. */ - KisPaintDeviceSP createThumbnailDevice(Q_INT32 w, Q_INT32 h); + KisPaintDeviceSP createThumbnailDevice(TQ_INT32 w, TQ_INT32 h); /** * Creates a thumbnail of the paint device, retaining the aspect ratio. - * The width and height of the returned QImage won't exceed \p maxw and \p maxw, but they may be smaller. + * The width and height of the returned TQImage won't exceed \p maxw and \p maxw, but they may be smaller. * The colors are not corrected for display! */ - virtual QImage createThumbnail(Q_INT32 maxw, Q_INT32 maxh); + virtual TQImage createThumbnail(TQ_INT32 maxw, TQ_INT32 maxh); /** @@ -305,7 +306,7 @@ public: * * @return true if the operation was succesful. */ - bool pixel(Q_INT32 x, Q_INT32 y, QColor *c, Q_UINT8 *opacity); + bool pixel(TQ_INT32 x, TQ_INT32 y, TQColor *c, TQ_UINT8 *opacity); /** @@ -317,17 +318,17 @@ public: * * @return true if the operation was succesful. */ - bool pixel(Q_INT32 x, Q_INT32 y, KisColor * kc); + bool pixel(TQ_INT32 x, TQ_INT32 y, KisColor * kc); /** * Return the KisColor of the pixel at x,y. */ - KisColor colorAt(Q_INT32 x, Q_INT32 y); + KisColor colorAt(TQ_INT32 x, TQ_INT32 y); /** * Set the specified pixel to the specified color. Note that this * bypasses KisPainter. the PaintDevice is here used as an equivalent - * to QImage, not QPixmap. This means that this is not undoable; also, + * to TQImage, not TQPixmap. This means that this is not undoable; also, * there is no compositing with an existing value at this location. * * The color values will be transformed from the display profile to @@ -339,9 +340,9 @@ public: * @return true if the operation was succesful * */ - bool setPixel(Q_INT32 x, Q_INT32 y, const QColor& c, Q_UINT8 opacity); + bool setPixel(TQ_INT32 x, TQ_INT32 y, const TQColor& c, TQ_UINT8 opacity); - bool setPixel(Q_INT32 x, Q_INT32 y, const KisColor& kc); + bool setPixel(TQ_INT32 x, TQ_INT32 y, const KisColor& kc); KisColorSpace * colorSpace() const; @@ -355,37 +356,37 @@ public: /** * The X offset of the paint device */ - Q_INT32 getX() const; + TQ_INT32 getX() const; /** * The Y offset of the paint device */ - Q_INT32 getY() const; + TQ_INT32 getY() const; /** * Return the X offset of the paint device */ - void setX(Q_INT32 x); + void setX(TQ_INT32 x); /** * Return the Y offset of the paint device */ - void setY(Q_INT32 y); + void setY(TQ_INT32 y); /** * Return the number of bytes a pixel takes. */ - virtual Q_INT32 pixelSize() const; + virtual TQ_INT32 pixelSize() const; /** * Return the number of channels a pixel takes */ - virtual Q_INT32 nChannels() const; + virtual TQ_INT32 nChannels() const; /** * Return the image that contains this paint device, or 0 if it is not - * part of an image. This is the same as calling parentLayer()->image(). + * part of an image. This is the same as calling tqparentLayer()->image(). */ KisImage *image() const; @@ -393,21 +394,21 @@ public: * Returns the KisLayer that contains this paint device, or 0 if this is not * part of a layer. */ - KisLayer *parentLayer() const; + KisLayer *tqparentLayer() const; /** * Set the KisLayer that contains this paint device, or 0 if this is not * part of a layer. */ - void setParentLayer(KisLayer *parentLayer); + void setParentLayer(KisLayer *tqparentLayer); /** - * Add the specified rect top the parent layer (if present) + * Add the specified rect top the tqparent layer (if present) */ - virtual void setDirty(const QRect & rc); + virtual void setDirty(const TQRect & rc); /** - * Set the parent layer completely dirty, if this paint device has one. + * Set the tqparent layer completely dirty, if this paint device has one. */ virtual void setDirty(); @@ -428,17 +429,17 @@ public: /** * This function return an iterator which points to the first pixel of an rectangle */ - KisRectIteratorPixel createRectIterator(Q_INT32 left, Q_INT32 top, Q_INT32 w, Q_INT32 h, bool writable); + KisRectIteratorPixel createRectIterator(TQ_INT32 left, TQ_INT32 top, TQ_INT32 w, TQ_INT32 h, bool writable); /** * This function return an iterator which points to the first pixel of a horizontal line */ - KisHLineIteratorPixel createHLineIterator(Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable); + KisHLineIteratorPixel createHLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable); /** * This function return an iterator which points to the first pixel of a vertical line */ - KisVLineIteratorPixel createVLineIterator(Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable); + KisVLineIteratorPixel createVLineIterator(TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable); /** * This function creates a random accessor which allow to randomly access any pixels on @@ -446,7 +447,7 @@ public: * <b>Note:</b> random access is way slower than iterators, allways use iterators whenever * you can */ - KisRandomAccessorPixel createRandomAccessor(Q_INT32 x, Q_INT32 y, bool writable); + KisRandomAccessorPixel createRandomAccessor(TQ_INT32 x, TQ_INT32 y, bool writable); /** * This function create a random accessor which can easily access to sub pixel values. @@ -478,10 +479,10 @@ public: void clearSelection(); /** - * Apply a mask to the image data, i.e. multiply each pixel's opacity by its - * selectedness in the mask. + * Apply a tqmask to the image data, i.e. multiply each pixel's opacity by its + * selectedness in the tqmask. */ - void applySelectionMask(KisSelectionSP mask); + void applySelectionMask(KisSelectionSP tqmask); /** * Sets the selection of this paint device to the new selection, @@ -500,7 +501,7 @@ public: * * @param r the area for which the selection has changed */ - void emitSelectionChanged(const QRect& r); + void emitSelectionChanged(const TQRect& r); KisUndoAdapter *undoAdapter() const; @@ -516,7 +517,7 @@ public: bool hasExifInfo() { return m_exifInfo != 0; } signals: void positionChanged(KisPaintDeviceSP device); - void ioProgress(Q_INT8 percentage); + void ioProgress(TQ_INT8 percentage); void profileChanged(KisProfile * profile); private slots: @@ -537,12 +538,12 @@ private: bool m_extentIsValid; - Q_INT32 m_x; - Q_INT32 m_y; + TQ_INT32 m_x; + TQ_INT32 m_y; KisColorSpace * m_colorSpace; // Cached for quick access - Q_INT32 m_pixelSize; - Q_INT32 m_nChannels; + TQ_INT32 m_pixelSize; + TQ_INT32 m_nChannels; // Whether the selection is active bool m_hasSelection; @@ -556,19 +557,19 @@ private: KisExifInfo* m_exifInfo; - QValueList<KisFilter*> m_longRunningFilters; - QTimer * m_longRunningFilterTimer; + TQValueList<KisFilter*> m_longRunningFilters; + TQTimer * m_longRunningFilterTimer; bool m_lock; }; -inline Q_INT32 KisPaintDevice::pixelSize() const +inline TQ_INT32 KisPaintDevice::pixelSize() const { Q_ASSERT(m_pixelSize > 0); return m_pixelSize; } -inline Q_INT32 KisPaintDevice::nChannels() const +inline TQ_INT32 KisPaintDevice::nChannels() const { Q_ASSERT(m_nChannels > 0); return m_nChannels; @@ -582,12 +583,12 @@ inline KisColorSpace * KisPaintDevice::colorSpace() const } -inline Q_INT32 KisPaintDevice::getX() const +inline TQ_INT32 KisPaintDevice::getX() const { return m_x; } -inline Q_INT32 KisPaintDevice::getY() const +inline TQ_INT32 KisPaintDevice::getY() const { return m_y; } |