diff options
Diffstat (limited to 'krita/core/tiles')
-rw-r--r-- | krita/core/tiles/kis_memento.cc | 30 | ||||
-rw-r--r-- | krita/core/tiles/kis_memento.h | 34 | ||||
-rw-r--r-- | krita/core/tiles/kis_tile.cc | 18 | ||||
-rw-r--r-- | krita/core/tiles/kis_tile.h | 40 | ||||
-rw-r--r-- | krita/core/tiles/kis_tiled_random_accessor.cc | 20 | ||||
-rw-r--r-- | krita/core/tiles/kis_tiled_random_accessor.h | 34 | ||||
-rw-r--r-- | krita/core/tiles/kis_tileddatamanager.cc | 282 | ||||
-rw-r--r-- | krita/core/tiles/kis_tileddatamanager.h | 100 | ||||
-rw-r--r-- | krita/core/tiles/kis_tiledhlineiterator.cc | 4 | ||||
-rw-r--r-- | krita/core/tiles/kis_tilediterator.cc | 6 | ||||
-rw-r--r-- | krita/core/tiles/kis_tilediterator.h | 102 | ||||
-rw-r--r-- | krita/core/tiles/kis_tiledrectiterator.cc | 6 | ||||
-rw-r--r-- | krita/core/tiles/kis_tiledvlineiterator.cc | 2 | ||||
-rw-r--r-- | krita/core/tiles/kis_tilemanager.cc | 52 | ||||
-rw-r--r-- | krita/core/tiles/kis_tilemanager.h | 54 | ||||
-rw-r--r-- | krita/core/tiles/tests/kis_tiled_data_tester.cpp | 14 |
16 files changed, 399 insertions, 399 deletions
diff --git a/krita/core/tiles/kis_memento.cc b/krita/core/tiles/kis_memento.cc index ea6ed722..aaec3724 100644 --- a/krita/core/tiles/kis_memento.cc +++ b/krita/core/tiles/kis_memento.cc @@ -20,7 +20,7 @@ #include "kis_tile.h" #include "kis_tile_global.h" -KisMemento::KisMemento(Q_UINT32 pixelSize) : KShared() +KisMemento::KisMemento(TQ_UINT32 pixelSize) : KShared() { m_hashTable = new KisTile * [1024]; Q_CHECK_PTR(m_hashTable); @@ -34,8 +34,8 @@ KisMemento::KisMemento(Q_UINT32 pixelSize) : KShared() m_redoHashTable [i] = 0; } m_numTiles = 0; - m_defPixel = new Q_UINT8[pixelSize]; - m_redoDefPixel = new Q_UINT8[pixelSize]; + m_defPixel = new TQ_UINT8[pixelSize]; + m_redoDefPixel = new TQ_UINT8[pixelSize]; m_valid = true; } @@ -87,12 +87,12 @@ void KisMemento::deleteAll(KisTile *tile) } } -void KisMemento::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const +void KisMemento::extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { - Q_INT32 maxX = Q_INT32_MIN; - Q_INT32 maxY = Q_INT32_MIN; - x = Q_INT32_MAX; - y = Q_INT32_MAX; + TQ_INT32 maxX = TQ_INT32_MIN; + TQ_INT32 maxY = TQ_INT32_MIN; + x = TQ_INT32_MAX; + y = TQ_INT32_MAX; for(int i = 0; i < 1024; i++) { @@ -124,19 +124,19 @@ void KisMemento::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const h = maxY - y +1; } -QRect KisMemento::extent() const +TQRect KisMemento::extent() const { - Q_INT32 x; - Q_INT32 y; - Q_INT32 w; - Q_INT32 h; + TQ_INT32 x; + TQ_INT32 y; + TQ_INT32 w; + TQ_INT32 h; extent(x, y, w, h); - return QRect(x, y, w, h); + return TQRect(x, y, w, h); } -bool KisMemento::containsTile(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash) const +bool KisMemento::containsTile(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash) const { const KisTile *tile = m_hashTable[tileHash]; diff --git a/krita/core/tiles/kis_memento.h b/krita/core/tiles/kis_memento.h index 696f8129..5942dc44 100644 --- a/krita/core/tiles/kis_memento.h +++ b/krita/core/tiles/kis_memento.h @@ -19,8 +19,8 @@ #ifndef KIS_MEMENTO_H_ #define KIS_MEMENTO_H_ -#include <qglobal.h> -#include <qrect.h> +#include <tqglobal.h> +#include <tqrect.h> #include <ksharedptr.h> @@ -33,7 +33,7 @@ typedef KSharedPtr<KisMemento> KisMementoSP; class KisMemento : public KShared { public: - KisMemento(Q_UINT32 pixelSize); + KisMemento(TQ_UINT32 pixelSize); ~KisMemento(); /* // For consolidating transactions @@ -42,10 +42,10 @@ public: virtual KisTransaction &operator+(const KisTransaction &, const KisTransaction &) = 0; */ - void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; - QRect extent() const; + void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const; + TQRect extent() const; - bool containsTile(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash) const; + bool containsTile(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash) const; // For debugging use bool valid() const { return m_valid; } @@ -55,20 +55,20 @@ private: class DeletedTile { public: - DeletedTile(Q_INT32 col, Q_INT32 row, const DeletedTile *next) + DeletedTile(TQ_INT32 col, TQ_INT32 row, const DeletedTile *next) : m_col(col), m_row(row), m_next(next) { } - Q_INT32 col() const { return m_col; } - Q_INT32 row() const { return m_row; } + TQ_INT32 col() const { return m_col; } + TQ_INT32 row() const { return m_row; } const DeletedTile *next() const { return m_next; } private: - Q_INT32 m_col; - Q_INT32 m_row; + TQ_INT32 m_col; + TQ_INT32 m_row; const DeletedTile *m_next; }; @@ -81,7 +81,7 @@ private: ~DeletedTileList(); - void addTile(Q_INT32 col, Q_INT32 row) + void addTile(TQ_INT32 col, TQ_INT32 row) { DeletedTile *d = new DeletedTile(col, row, m_firstDeletedTile); Q_CHECK_PTR(d); @@ -100,7 +100,7 @@ private: DeletedTile *m_firstDeletedTile; }; - void addTileToDeleteOnRedo(Q_INT32 col, Q_INT32 row) + void addTileToDeleteOnRedo(TQ_INT32 col, TQ_INT32 row) { m_redoDelTilesList.addTile(col, row); } @@ -115,7 +115,7 @@ private: m_redoDelTilesList.clear(); } - void addTileToDeleteOnUndo(Q_INT32 col, Q_INT32 row) + void addTileToDeleteOnUndo(TQ_INT32 col, TQ_INT32 row) { m_undoDelTilesList.addTile(col, row); } @@ -133,12 +133,12 @@ private: friend class KisTiledDataManager; KisTiledDataManager *originator; KisTile **m_hashTable; - Q_UINT32 m_numTiles; + TQ_UINT32 m_numTiles; KisTile **m_redoHashTable; DeletedTileList m_redoDelTilesList; DeletedTileList m_undoDelTilesList; - Q_UINT8 *m_defPixel; - Q_UINT8 *m_redoDefPixel; + TQ_UINT8 *m_defPixel; + TQ_UINT8 *m_redoDefPixel; void deleteAll(KisTile *tile); bool m_valid; diff --git a/krita/core/tiles/kis_tile.cc b/krita/core/tiles/kis_tile.cc index 49d20cf6..86d55128 100644 --- a/krita/core/tiles/kis_tile.cc +++ b/krita/core/tiles/kis_tile.cc @@ -23,11 +23,11 @@ #include "kis_tileddatamanager.h" #include "kis_tilemanager.h" -const Q_INT32 KisTile::WIDTH = 64; -const Q_INT32 KisTile::HEIGHT = 64; +const TQ_INT32 KisTile::WIDTH = 64; +const TQ_INT32 KisTile::HEIGHT = 64; -KisTile::KisTile(Q_INT32 pixelSize, Q_INT32 col, Q_INT32 row, const Q_UINT8 *defPixel) +KisTile::KisTile(TQ_INT32 pixelSize, TQ_INT32 col, TQ_INT32 row, const TQ_UINT8 *defPixel) { m_pixelSize = pixelSize; m_data = 0; @@ -43,7 +43,7 @@ KisTile::KisTile(Q_INT32 pixelSize, Q_INT32 col, Q_INT32 row, const Q_UINT8 *def setData(defPixel); } -KisTile::KisTile(const KisTile& rhs, Q_INT32 col, Q_INT32 row) +KisTile::KisTile(const KisTile& rhs, TQ_INT32 col, TQ_INT32 row) { if (this != &rhs) { m_pixelSize = rhs.m_pixelSize; @@ -55,7 +55,7 @@ KisTile::KisTile(const KisTile& rhs, Q_INT32 col, Q_INT32 row) // Assure we have data to copy rhs.addReader(); - memcpy(m_data, rhs.m_data, WIDTH * HEIGHT * m_pixelSize * sizeof(Q_UINT8)); + memcpy(m_data, rhs.m_data, WIDTH * HEIGHT * m_pixelSize * sizeof(TQ_UINT8)); rhs.removeReader(); m_col = col; @@ -78,7 +78,7 @@ KisTile::KisTile(const KisTile& rhs) allocate(); rhs.addReader(); - memcpy(m_data, rhs.m_data, WIDTH * HEIGHT * m_pixelSize * sizeof(Q_UINT8)); + memcpy(m_data, rhs.m_data, WIDTH * HEIGHT * m_pixelSize * sizeof(TQ_UINT8)); rhs.removeReader(); KisTileManager::instance()->registerTile(this); @@ -111,7 +111,7 @@ void KisTile::setNext(KisTile *n) m_nextTile = n; } -Q_UINT8 *KisTile::data(Q_INT32 x, Q_INT32 y ) const +TQ_UINT8 *KisTile::data(TQ_INT32 x, TQ_INT32 y ) const { addReader(); removeReader(); @@ -122,10 +122,10 @@ Q_UINT8 *KisTile::data(Q_INT32 x, Q_INT32 y ) const return m_data + m_pixelSize * ( y * WIDTH + x ); } -void KisTile::setData(const Q_UINT8 *pixel) +void KisTile::setData(const TQ_UINT8 *pixel) { addReader(); - Q_UINT8 *dst = m_data; + TQ_UINT8 *dst = m_data; for(int i=0; i <WIDTH * HEIGHT;i++) { memcpy(dst, pixel, m_pixelSize); diff --git a/krita/core/tiles/kis_tile.h b/krita/core/tiles/kis_tile.h index d80b6e2c..f2d6f1e9 100644 --- a/krita/core/tiles/kis_tile.h +++ b/krita/core/tiles/kis_tile.h @@ -18,21 +18,21 @@ #ifndef KIS_TILE_H_ #define KIS_TILE_H_ -#include <qglobal.h> -#include <qrect.h> +#include <tqglobal.h> +#include <tqrect.h> class KisTiledDataManager; class KisTiledIterator; /** - * Provides abstraction to a tile. A tile contains + * Provides abstraction to a tile. A tile tqcontains * a part of a PaintDevice, but only the individual pixels * are accesable and that only via iterators. */ class KisTile { public: - KisTile(Q_INT32 pixelSize, Q_INT32 col, Q_INT32 row, const Q_UINT8 *defPixel); - KisTile(const KisTile& rhs, Q_INT32 col, Q_INT32 row); + KisTile(TQ_INT32 pixelSize, TQ_INT32 col, TQ_INT32 row, const TQ_UINT8 *defPixel); + KisTile(const KisTile& rhs, TQ_INT32 col, TQ_INT32 row); KisTile(const KisTile& rhs); ~KisTile(); @@ -40,18 +40,18 @@ public: void release(); void allocate(); - Q_UINT8 *data(Q_INT32 xoff, Q_INT32 yoff) const; - Q_UINT8 *data() const { return m_data; } + TQ_UINT8 *data(TQ_INT32 xoff, TQ_INT32 yoff) const; + TQ_UINT8 *data() const { return m_data; } - void setData(const Q_UINT8 *pixel); + void setData(const TQ_UINT8 *pixel); - Q_INT32 refCount() const; + TQ_INT32 refCount() const; void ref(); - Q_INT32 getRow() const { return m_row; } - Q_INT32 getCol() const { return m_col; } + TQ_INT32 getRow() const { return m_row; } + TQ_INT32 getCol() const { return m_col; } - QRect extent() const { return QRect(m_col * WIDTH, m_row * HEIGHT, WIDTH, HEIGHT); } + TQRect extent() const { return TQRect(m_col * WIDTH, m_row * HEIGHT, WIDTH, HEIGHT); } void setNext(KisTile *); KisTile *getNext() const { return m_nextTile; } @@ -61,7 +61,7 @@ public: // access to a tile in a const enviroment (like copyconstructor and so)! void addReader() const; void removeReader() const; - Q_INT32 readers() { return m_nReadlock; } + TQ_INT32 readers() { return m_nReadlock; } friend class KisTiledIterator; friend class KisTiledDataManager; @@ -71,16 +71,16 @@ private: KisTile& operator=(const KisTile&); private: - Q_UINT8 *m_data; - mutable Q_INT32 m_nReadlock; - Q_INT32 m_row; - Q_INT32 m_col; - Q_INT32 m_pixelSize; + TQ_UINT8 *m_data; + mutable TQ_INT32 m_nReadlock; + TQ_INT32 m_row; + TQ_INT32 m_col; + TQ_INT32 m_pixelSize; KisTile *m_nextTile; public: - static const Q_INT32 WIDTH; - static const Q_INT32 HEIGHT; + static const TQ_INT32 WIDTH; + static const TQ_INT32 HEIGHT; }; #endif // KIS_TILE_H_ diff --git a/krita/core/tiles/kis_tiled_random_accessor.cc b/krita/core/tiles/kis_tiled_random_accessor.cc index 52ec8634..159faf18 100644 --- a/krita/core/tiles/kis_tiled_random_accessor.cc +++ b/krita/core/tiles/kis_tiled_random_accessor.cc @@ -18,9 +18,9 @@ #include "kis_tiled_random_accessor.h" -const Q_UINT32 KisTiledRandomAccessor::CACHESIZE = 4; // Define the number of tiles we keep in cache +const TQ_UINT32 KisTiledRandomAccessor::CACHESIZE = 4; // Define the number of tiles we keep in cache -KisTiledRandomAccessor::KisTiledRandomAccessor(KisTiledDataManager *ktm, Q_INT32 x, Q_INT32 y, bool writable) : m_ktm(ktm), m_tilesCache(new KisTileInfo*[4]), m_tilesCacheSize(0), m_pixelSize (m_ktm->pixelSize()), m_writable(writable) +KisTiledRandomAccessor::KisTiledRandomAccessor(KisTiledDataManager *ktm, TQ_INT32 x, TQ_INT32 y, bool writable) : m_ktm(ktm), m_tilesCache(new KisTileInfo*[4]), m_tilesCacheSize(0), m_pixelSize (m_ktm->pixelSize()), m_writable(writable) { Q_ASSERT(ktm != 0); moveTo(x, y); @@ -37,7 +37,7 @@ KisTiledRandomAccessor::~KisTiledRandomAccessor() delete m_tilesCache; } -void KisTiledRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) +void KisTiledRandomAccessor::moveTo(TQ_INT32 x, TQ_INT32 y) { // Look in the cache if the tile if the data is available for( uint i = 0; i < m_tilesCacheSize; i++) @@ -46,7 +46,7 @@ void KisTiledRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) y >= m_tilesCache[i]->area_y1 && y <= m_tilesCache[i]->area_y2 ) { KisTileInfo* kti = m_tilesCache[i]; - Q_UINT32 offset = x - kti->area_x1 + (y -kti->area_y1) * KisTile::WIDTH; + TQ_UINT32 offset = x - kti->area_x1 + (y -kti->area_y1) * KisTile::WIDTH; offset *= m_pixelSize; m_data = kti->data + offset; m_oldData = kti->oldData + offset; @@ -67,10 +67,10 @@ void KisTiledRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) } else { m_tilesCacheSize++; } - Q_UINT32 col = xToCol( x ); - Q_UINT32 row = yToRow( y ); + TQ_UINT32 col = xToCol( x ); + TQ_UINT32 row = yToRow( y ); KisTileInfo* kti = fetchTileData(col, row); - Q_UINT32 offset = x - kti->area_x1 + (y - kti->area_y1) * KisTile::WIDTH; + TQ_UINT32 offset = x - kti->area_x1 + (y - kti->area_y1) * KisTile::WIDTH; offset *= m_pixelSize; m_data = kti->data + offset; m_oldData = kti->oldData + offset; @@ -79,13 +79,13 @@ void KisTiledRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y) } -Q_UINT8 * KisTiledRandomAccessor::rawData() const +TQ_UINT8 * KisTiledRandomAccessor::rawData() const { return m_data; } -const Q_UINT8 * KisTiledRandomAccessor::oldRawData() const +const TQ_UINT8 * KisTiledRandomAccessor::oldRawData() const { #ifdef DEBUG kdWarning(!m_ktm->hasCurrentMemento(), DBG_AREA_TILES) << "Accessing oldRawData() when no transaction is in progress.\n"; @@ -93,7 +93,7 @@ const Q_UINT8 * KisTiledRandomAccessor::oldRawData() const return m_oldData; } -KisTiledRandomAccessor::KisTileInfo* KisTiledRandomAccessor::fetchTileData(Q_INT32 col, Q_INT32 row) +KisTiledRandomAccessor::KisTileInfo* KisTiledRandomAccessor::fetchTileData(TQ_INT32 col, TQ_INT32 row) { KisTileInfo* kti = new KisTileInfo; kti->tile = m_ktm->getTile(col, row, m_writable); diff --git a/krita/core/tiles/kis_tiled_random_accessor.h b/krita/core/tiles/kis_tiled_random_accessor.h index 7766f75c..23768ee6 100644 --- a/krita/core/tiles/kis_tiled_random_accessor.h +++ b/krita/core/tiles/kis_tiled_random_accessor.h @@ -18,8 +18,8 @@ #ifndef KIS_TILED_RANDOM_ACCESSOR_H #define KIS_TILED_RANDOM_ACCESSOR_H -#include <qrect.h> -#include <qvaluelist.h> +#include <tqrect.h> +#include <tqvaluelist.h> #include <ksharedptr.h> @@ -31,35 +31,35 @@ class KisTiledRandomAccessor : public KShared { struct KisTileInfo { KisTile* tile; KisTile* oldtile; - Q_UINT8* data; - const Q_UINT8* oldData; - Q_INT32 area_x1, area_y1, area_x2, area_y2; + TQ_UINT8* data; + const TQ_UINT8* oldData; + TQ_INT32 area_x1, area_y1, area_x2, area_y2; }; public: - KisTiledRandomAccessor(KisTiledDataManager *ktm, Q_INT32 x, Q_INT32 y, bool writable); + KisTiledRandomAccessor(KisTiledDataManager *ktm, TQ_INT32 x, TQ_INT32 y, bool writable); ~KisTiledRandomAccessor(); private: - inline Q_UINT32 xToCol(Q_UINT32 x) const { if (m_ktm) return m_ktm->xToCol(x); else return 0; }; - inline Q_UINT32 yToRow(Q_UINT32 y) const { if (m_ktm) return m_ktm->yToRow(y); else return 0; }; - KisTileInfo* fetchTileData(Q_INT32 col, Q_INT32 row); + inline TQ_UINT32 xToCol(TQ_UINT32 x) const { if (m_ktm) return m_ktm->xToCol(x); else return 0; }; + inline TQ_UINT32 yToRow(TQ_UINT32 y) const { if (m_ktm) return m_ktm->yToRow(y); else return 0; }; + KisTileInfo* fetchTileData(TQ_INT32 col, TQ_INT32 row); public: /// Move to a given x,y position, fetch tiles and data - void moveTo(Q_INT32 x, Q_INT32 y); - Q_UINT8* rawData() const; - const Q_UINT8* oldRawData() const; + void moveTo(TQ_INT32 x, TQ_INT32 y); + TQ_UINT8* rawData() const; + const TQ_UINT8* oldRawData() const; private: KisTiledDataManager *m_ktm; KisTileInfo** m_tilesCache; - Q_UINT32 m_tilesCacheSize; - Q_INT32 m_pixelSize; - Q_UINT8* m_data; - const Q_UINT8* m_oldData; + TQ_UINT32 m_tilesCacheSize; + TQ_INT32 m_pixelSize; + TQ_UINT8* m_data; + const TQ_UINT8* m_oldData; bool m_writable; - static const Q_UINT32 CACHESIZE; // Define the number of tiles we keep in cache + static const TQ_UINT32 CACHESIZE; // Define the number of tiles we keep in cache }; diff --git a/krita/core/tiles/kis_tileddatamanager.cc b/krita/core/tiles/kis_tileddatamanager.cc index 4372e487..629b1b38 100644 --- a/krita/core/tiles/kis_tileddatamanager.cc +++ b/krita/core/tiles/kis_tileddatamanager.cc @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qvaluevector.h> +#include <tqvaluevector.h> #include <kdebug.h> @@ -36,11 +36,11 @@ * Even though the matrix has grown it may still not contain tiles at specific positions. They are created on demand */ -KisTiledDataManager::KisTiledDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defPixel) +KisTiledDataManager::KisTiledDataManager(TQ_UINT32 pixelSize, const TQ_UINT8 *defPixel) { m_pixelSize = pixelSize; - m_defPixel = new Q_UINT8[m_pixelSize]; + m_defPixel = new TQ_UINT8[m_pixelSize]; Q_CHECK_PTR(m_defPixel); memcpy(m_defPixel, defPixel, m_pixelSize); @@ -54,10 +54,10 @@ KisTiledDataManager::KisTiledDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defP m_hashTable [i] = 0; m_numTiles = 0; m_currentMemento = 0; - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; } KisTiledDataManager::KisTiledDataManager(const KisTiledDataManager & dm) @@ -65,7 +65,7 @@ KisTiledDataManager::KisTiledDataManager(const KisTiledDataManager & dm) { m_pixelSize = dm.m_pixelSize; - m_defPixel = new Q_UINT8[m_pixelSize]; + m_defPixel = new TQ_UINT8[m_pixelSize]; Q_CHECK_PTR(m_defPixel); memcpy(m_defPixel, dm.m_defPixel, m_pixelSize); @@ -123,7 +123,7 @@ KisTiledDataManager::~KisTiledDataManager() delete [] m_defPixel; } -void KisTiledDataManager::setDefaultPixel(const Q_UINT8 *defPixel) +void KisTiledDataManager::setDefaultPixel(const TQ_UINT8 *defPixel) { if (defPixel == 0) return; @@ -170,9 +170,9 @@ bool KisTiledDataManager::read(KoStore *store) //Q_ASSERT(store != 0); char str[80]; - Q_INT32 x,y,w,h; + TQ_INT32 x,y,w,h; - QIODevice *stream = store->device(); + TQIODevice *stream = store->device(); if (stream == 0) return false; //Q_ASSERT(stream != 0); @@ -180,7 +180,7 @@ bool KisTiledDataManager::read(KoStore *store) sscanf(str,"%u",&m_numTiles); - for(Q_UINT32 i = 0; i < m_numTiles; i++) + for(TQ_UINT32 i = 0; i < m_numTiles; i++) { stream->readLine(str, 79); sscanf(str,"%d,%d,%d,%d",&x,&y,&w,&h); @@ -188,9 +188,9 @@ bool KisTiledDataManager::read(KoStore *store) // the following is only correct as long as tile size is not changed // The first time we change tilesize the dimensions just read needs to be respected // but for now we just assume that tiles are the same size as ever. - Q_INT32 row = yToRow(y); - Q_INT32 col = xToCol(x); - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_INT32 row = yToRow(y); + TQ_INT32 col = xToCol(x); + TQ_UINT32 tileHash = calcTileHash(col, row); KisTile *tile = new KisTile(m_pixelSize, col, row, m_defPixel); Q_CHECK_PTR(tile); @@ -207,7 +207,7 @@ bool KisTiledDataManager::read(KoStore *store) return true; } -void KisTiledDataManager::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const +void KisTiledDataManager::extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { x = m_extentMinX; y = m_extentMinY; @@ -225,27 +225,27 @@ void KisTiledDataManager::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) } } -QRect KisTiledDataManager::extent() const +TQRect KisTiledDataManager::extent() const { - Q_INT32 x; - Q_INT32 y; - Q_INT32 w; - Q_INT32 h; + TQ_INT32 x; + TQ_INT32 y; + TQ_INT32 w; + TQ_INT32 h; extent(x, y, w, h); - return QRect(x, y, w, h); + return TQRect(x, y, w, h); } -void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::setExtent(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { - QRect newRect = QRect(x, y, w, h).normalize(); + TQRect newRect = TQRect(x, y, w, h).normalize(); //printRect("newRect", newRect); - QRect oldRect = QRect(m_extentMinX, m_extentMinY, m_extentMaxX - m_extentMinX + 1, m_extentMaxY - m_extentMinY + 1).normalize(); + TQRect oldRect = TQRect(m_extentMinX, m_extentMinY, m_extentMaxX - m_extentMinX + 1, m_extentMaxY - m_extentMinY + 1).normalize(); //printRect("oldRect", oldRect); // Do nothing if the desired size is bigger than we currently are: that is handled by the autoextending automatically - if (newRect.contains(oldRect)) return; + if (newRect.tqcontains(oldRect)) return; // Loop through all tiles, if a tile is wholly outside the extent, add to the memento, then delete it, // if the tile is partially outside the extent, clear the outside pixels to the default pixel. @@ -256,10 +256,10 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) while(tile) { - QRect tileRect = QRect(tile->getCol() * KisTile::WIDTH, tile->getRow() * KisTile::HEIGHT, KisTile::WIDTH, KisTile::HEIGHT); + TQRect tileRect = TQRect(tile->getCol() * KisTile::WIDTH, tile->getRow() * KisTile::HEIGHT, KisTile::WIDTH, KisTile::HEIGHT); //printRect("tileRect", tileRect); - if (newRect.contains(tileRect)) { + if (newRect.tqcontains(tileRect)) { // Completely inside, do nothing previousTile = tile; tile = tile->getNext(); @@ -270,7 +270,7 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) if (newRect.intersects(tileRect)) { // Create the intersection of the tile and new rect - QRect intersection = newRect.intersect(tileRect); + TQRect intersection = newRect.intersect(tileRect); //printRect("intersection", intersection); intersection.setRect(intersection.x() - tileRect.x(), intersection.y() - tileRect.y(), intersection.width(), intersection.height()); @@ -279,8 +279,8 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) tile->addReader(); for (int y = 0; y < KisTile::HEIGHT; ++y) { for (int x = 0; x < KisTile::WIDTH; ++x) { - if (!intersection.contains(x,y)) { - Q_UINT8 * ptr = tile->data(x, y); + if (!intersection.tqcontains(x,y)) { + TQ_UINT8 * ptr = tile->data(x, y); memcpy(ptr, m_defPixel, m_pixelSize); } } @@ -314,10 +314,10 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) void KisTiledDataManager::recalculateExtent() { - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; // Loop through all tiles. for (int tileHash = 0; tileHash < 1024; tileHash++) @@ -332,29 +332,29 @@ void KisTiledDataManager::recalculateExtent() } } -void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UINT8 clearValue) +void KisTiledDataManager::clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, TQ_UINT8 clearValue) { if (w < 1 || h < 1) { return; } - Q_INT32 firstColumn = xToCol(x); - Q_INT32 lastColumn = xToCol(x + w - 1); + TQ_INT32 firstColumn = xToCol(x); + TQ_INT32 lastColumn = xToCol(x + w - 1); - Q_INT32 firstRow = yToRow(y); - Q_INT32 lastRow = yToRow(y + h - 1); + TQ_INT32 firstRow = yToRow(y); + TQ_INT32 lastRow = yToRow(y + h - 1); - QRect clearRect(x, y, w, h); + TQRect clearRect(x, y, w, h); - const Q_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; + const TQ_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; - for (Q_INT32 row = firstRow; row <= lastRow; ++row) { - for (Q_INT32 column = firstColumn; column <= lastColumn; ++column) { + for (TQ_INT32 row = firstRow; row <= lastRow; ++row) { + for (TQ_INT32 column = firstColumn; column <= lastColumn; ++column) { KisTile *tile = getTile(column, row, true); - QRect tileRect = tile->extent(); + TQRect tileRect = tile->extent(); - QRect clearTileRect = clearRect & tileRect; + TQRect clearTileRect = clearRect & tileRect; tile->addReader(); if (clearTileRect == tileRect) { @@ -362,8 +362,8 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UI memset(tile->data(), clearValue, KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize); } else { - Q_UINT32 rowsRemaining = clearTileRect.height(); - Q_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); + TQ_UINT32 rowsRemaining = clearTileRect.height(); + TQ_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); while (rowsRemaining > 0) { memset(dst, clearValue, clearTileRect.width() * m_pixelSize); @@ -376,7 +376,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UI } } -void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *clearPixel) +void KisTiledDataManager::clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *clearPixel) { Q_ASSERT(clearPixel != 0); @@ -386,7 +386,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons bool pixelBytesAreTheSame = true; - for (Q_UINT32 i = 0; i < m_pixelSize; ++i) { + for (TQ_UINT32 i = 0; i < m_pixelSize; ++i) { if (clearPixel[i] != clearPixel[0]) { pixelBytesAreTheSame = false; break; @@ -397,25 +397,25 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons clear(x, y, w, h, clearPixel[0]); } else { - Q_INT32 firstColumn = xToCol(x); - Q_INT32 lastColumn = xToCol(x + w - 1); + TQ_INT32 firstColumn = xToCol(x); + TQ_INT32 lastColumn = xToCol(x + w - 1); - Q_INT32 firstRow = yToRow(y); - Q_INT32 lastRow = yToRow(y + h - 1); + TQ_INT32 firstRow = yToRow(y); + TQ_INT32 lastRow = yToRow(y + h - 1); - QRect clearRect(x, y, w, h); + TQRect clearRect(x, y, w, h); - const Q_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; + const TQ_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; - Q_UINT8 *clearPixelData = 0; + TQ_UINT8 *clearPixelData = 0; if (w >= KisTile::WIDTH && h >= KisTile::HEIGHT) { // There might be a whole tile to be cleared so generate a cleared tile. - clearPixelData = new Q_UINT8[KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize]; + clearPixelData = new TQ_UINT8[KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize]; - Q_UINT8 *dst = clearPixelData; - Q_UINT32 pixelsRemaining = KisTile::WIDTH; + TQ_UINT8 *dst = clearPixelData; + TQ_UINT32 pixelsRemaining = KisTile::WIDTH; // Generate one row while (pixelsRemaining > 0) { @@ -424,7 +424,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons --pixelsRemaining; } - Q_UINT32 rowsRemaining = KisTile::HEIGHT - 1; + TQ_UINT32 rowsRemaining = KisTile::HEIGHT - 1; // Copy to the rest of the rows. while (rowsRemaining > 0) { @@ -436,12 +436,12 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons } else { // Generate one row - Q_UINT32 maxRunLength = QMIN(w, KisTile::WIDTH); + TQ_UINT32 maxRunLength = TQMIN(w, KisTile::WIDTH); - clearPixelData = new Q_UINT8[maxRunLength * m_pixelSize]; + clearPixelData = new TQ_UINT8[maxRunLength * m_pixelSize]; - Q_UINT8 *dst = clearPixelData; - Q_UINT32 pixelsRemaining = maxRunLength; + TQ_UINT8 *dst = clearPixelData; + TQ_UINT32 pixelsRemaining = maxRunLength; while (pixelsRemaining > 0) { memcpy(dst, clearPixel, m_pixelSize); @@ -450,13 +450,13 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons } } - for (Q_INT32 row = firstRow; row <= lastRow; ++row) { - for (Q_INT32 column = firstColumn; column <= lastColumn; ++column) { + for (TQ_INT32 row = firstRow; row <= lastRow; ++row) { + for (TQ_INT32 column = firstColumn; column <= lastColumn; ++column) { KisTile *tile = getTile(column, row, true); - QRect tileRect = tile->extent(); + TQRect tileRect = tile->extent(); - QRect clearTileRect = clearRect & tileRect; + TQRect clearTileRect = clearRect & tileRect; if (clearTileRect == tileRect) { @@ -466,9 +466,9 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons tile->removeReader(); } else { - Q_UINT32 rowsRemaining = clearTileRect.height(); + TQ_UINT32 rowsRemaining = clearTileRect.height(); tile->addReader(); - Q_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); + TQ_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); while (rowsRemaining > 0) { memcpy(dst, clearPixelData, clearTileRect.width() * m_pixelSize); @@ -506,21 +506,21 @@ void KisTiledDataManager::clear() m_numTiles = 0; // Set the extent correctly - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; } -void KisTiledDataManager::paste(KisDataManagerSP data, Q_INT32 sx, Q_INT32 sy, Q_INT32 dx, Q_INT32 dy, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::paste(KisDataManagerSP data, TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 dx, TQ_INT32 dy, + TQ_INT32 w, TQ_INT32 h) { //CBR_MISSING sx=sy=dx=dy=w=h;data=0; } -Q_UINT32 KisTiledDataManager::calcTileHash(Q_INT32 col, Q_INT32 row) +TQ_UINT32 KisTiledDataManager::calcTileHash(TQ_INT32 col, TQ_INT32 row) { return ((row << 5) + (col & 0x1F)) & 0x3FF; } @@ -692,7 +692,7 @@ void KisTiledDataManager::deleteTiles(const KisMemento::DeletedTile *d) { while (d) { - Q_UINT32 tileHash = calcTileHash(d->col(), d->row()); + TQ_UINT32 tileHash = calcTileHash(d->col(), d->row()); KisTile *curTile = m_hashTable[tileHash]; KisTile *preTile = 0; while(curTile) @@ -721,7 +721,7 @@ void KisTiledDataManager::deleteTiles(const KisMemento::DeletedTile *d) recalculateExtent(); } -void KisTiledDataManager::ensureTileMementoed(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash, const KisTile *refTile) +void KisTiledDataManager::ensureTileMementoed(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash, const KisTile *refTile) { if (refTile == 0) return; //Q_ASSERT(refTile != 0); @@ -751,7 +751,7 @@ void KisTiledDataManager::ensureTileMementoed(Q_INT32 col, Q_INT32 row, Q_UINT32 m_currentMemento->m_numTiles++; } -void KisTiledDataManager::updateExtent(Q_INT32 col, Q_INT32 row) +void KisTiledDataManager::updateExtent(TQ_INT32 col, TQ_INT32 row) { if(m_extentMinX > col * KisTile::WIDTH) m_extentMinX = col * KisTile::WIDTH; @@ -763,9 +763,9 @@ void KisTiledDataManager::updateExtent(Q_INT32 col, Q_INT32 row) m_extentMaxY = (row+1) * KisTile::HEIGHT - 1; } -KisTile *KisTiledDataManager::getTile(Q_INT32 col, Q_INT32 row, bool writeAccess) +KisTile *KisTiledDataManager::getTile(TQ_INT32 col, TQ_INT32 row, bool writeAccess) { - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_UINT32 tileHash = calcTileHash(col, row); // Lookup tile in hash table KisTile *tile = m_hashTable[tileHash]; @@ -806,7 +806,7 @@ KisTile *KisTiledDataManager::getTile(Q_INT32 col, Q_INT32 row, bool writeAccess return tile; } -KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) +KisTile *KisTiledDataManager::getOldTile(TQ_INT32 col, TQ_INT32 row, KisTile *def) { KisTile *tile = 0; @@ -816,7 +816,7 @@ KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) if (!m_currentMemento->valid()) return def; //Q_ASSERT(m_currentMemento->valid()); - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_UINT32 tileHash = calcTileHash(col, row); tile = m_currentMemento->m_hashTable[tileHash]; while (tile != 0) { @@ -833,48 +833,48 @@ KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) return tile; } -Q_UINT8* KisTiledDataManager::pixelPtr(Q_INT32 x, Q_INT32 y, bool writable) +TQ_UINT8* KisTiledDataManager::pixelPtr(TQ_INT32 x, TQ_INT32 y, bool writable) { // Ahem, this is a bit not as good. The point is, this function needs the tile data, // but it might be swapped out. This code swaps it in, but at function exit it might - // be swapped out again! THIS MAKES THE RETURNED POINTER QUITE VOLATILE + // be swapped out again! THIS MAKES THE RETURNED POINTER TQUITE VOLATILE return pixelPtrSafe(x, y, writable) -> data(); } -KisTileDataWrapperSP KisTiledDataManager::pixelPtrSafe(Q_INT32 x, Q_INT32 y, bool writable) { - Q_INT32 row = yToRow(y); - Q_INT32 col = xToCol(x); +KisTileDataWrapperSP KisTiledDataManager::pixelPtrSafe(TQ_INT32 x, TQ_INT32 y, bool writable) { + TQ_INT32 row = yToRow(y); + TQ_INT32 col = xToCol(x); // calc limits within the tile - Q_INT32 yInTile = y - row * KisTile::HEIGHT; - Q_INT32 xInTile = x - col * KisTile::WIDTH; - Q_INT32 offset = m_pixelSize * (yInTile * KisTile::WIDTH + xInTile); + TQ_INT32 yInTile = y - row * KisTile::HEIGHT; + TQ_INT32 xInTile = x - col * KisTile::WIDTH; + TQ_INT32 offset = m_pixelSize * (yInTile * KisTile::WIDTH + xInTile); KisTile *tile = getTile(col, row, writable); return new KisTileDataWrapper(tile, offset); } -const Q_UINT8* KisTiledDataManager::pixel(Q_INT32 x, Q_INT32 y) +const TQ_UINT8* KisTiledDataManager::pixel(TQ_INT32 x, TQ_INT32 y) { return pixelPtr(x, y, false); } -Q_UINT8* KisTiledDataManager::writablePixel(Q_INT32 x, Q_INT32 y) +TQ_UINT8* KisTiledDataManager::writablePixel(TQ_INT32 x, TQ_INT32 y) { return pixelPtr(x, y, true); } -void KisTiledDataManager::setPixel(Q_INT32 x, Q_INT32 y, const Q_UINT8 * data) +void KisTiledDataManager::setPixel(TQ_INT32 x, TQ_INT32 y, const TQ_UINT8 * data) { - Q_UINT8 *pixel = pixelPtr(x, y, true); + TQ_UINT8 *pixel = pixelPtr(x, y, true); memcpy(pixel, data, m_pixelSize); } -void KisTiledDataManager::readBytes(Q_UINT8 * data, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::readBytes(TQ_UINT8 * data, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h) { if (data == 0) return; //Q_ASSERT(data != 0); @@ -884,33 +884,33 @@ void KisTiledDataManager::readBytes(Q_UINT8 * data, if (h < 0) h = 0; - Q_INT32 dstY = 0; - Q_INT32 srcY = y; - Q_INT32 rowsRemaining = h; + TQ_INT32 dstY = 0; + TQ_INT32 srcY = y; + TQ_INT32 rowsRemaining = h; while (rowsRemaining > 0) { - Q_INT32 dstX = 0; - Q_INT32 srcX = x; - Q_INT32 columnsRemaining = w; - Q_INT32 numContiguousSrcRows = numContiguousRows(srcY, srcX, srcX + w - 1); + TQ_INT32 dstX = 0; + TQ_INT32 srcX = x; + TQ_INT32 columnsRemaining = w; + TQ_INT32 numContiguousSrcRows = numContiguousRows(srcY, srcX, srcX + w - 1); - Q_INT32 rows = QMIN(numContiguousSrcRows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousSrcRows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousSrcColumns = numContiguousColumns(srcX, srcY, srcY + rows - 1); + TQ_INT32 numContiguousSrcColumns = numContiguousColumns(srcX, srcY, srcY + rows - 1); - Q_INT32 columns = QMIN(numContiguousSrcColumns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousSrcColumns, columnsRemaining); KisTileDataWrapperSP tileData = pixelPtrSafe(srcX, srcY, false); - const Q_UINT8 *srcData = tileData -> data(); - Q_INT32 srcRowStride = rowStride(srcX, srcY); + const TQ_UINT8 *srcData = tileData -> data(); + TQ_INT32 srcRowStride = rowStride(srcX, srcY); - Q_UINT8 *dstData = data + ((dstX + (dstY * w)) * m_pixelSize); - Q_INT32 dstRowStride = w * m_pixelSize; + TQ_UINT8 *dstData = data + ((dstX + (dstY * w)) * m_pixelSize); + TQ_INT32 dstRowStride = w * m_pixelSize; - for (Q_INT32 row = 0; row < rows; row++) { + for (TQ_INT32 row = 0; row < rows; row++) { memcpy(dstData, srcData, columns * m_pixelSize); dstData += dstRowStride; srcData += srcRowStride; @@ -929,9 +929,9 @@ void KisTiledDataManager::readBytes(Q_UINT8 * data, } -void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::writeBytes(const TQ_UINT8 * bytes, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h) { if (bytes == 0) return; //Q_ASSERT(bytes != 0); @@ -943,34 +943,34 @@ void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, if (h < 0) h = 0; - Q_INT32 srcY = 0; - Q_INT32 dstY = y; - Q_INT32 rowsRemaining = h; + TQ_INT32 srcY = 0; + TQ_INT32 dstY = y; + TQ_INT32 rowsRemaining = h; while (rowsRemaining > 0) { - Q_INT32 srcX = 0; - Q_INT32 dstX = x; - Q_INT32 columnsRemaining = w; - Q_INT32 numContiguousdstRows = numContiguousRows(dstY, dstX, dstX + w - 1); + TQ_INT32 srcX = 0; + TQ_INT32 dstX = x; + TQ_INT32 columnsRemaining = w; + TQ_INT32 numContiguousdstRows = numContiguousRows(dstY, dstX, dstX + w - 1); - Q_INT32 rows = QMIN(numContiguousdstRows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousdstRows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousdstColumns = numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousdstColumns = numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 columns = QMIN(numContiguousdstColumns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousdstColumns, columnsRemaining); - //Q_UINT8 *dstData = writablePixel(dstX, dstY); + //TQ_UINT8 *dstData = writablePixel(dstX, dstY); KisTileDataWrapperSP tileData = pixelPtrSafe(dstX, dstY, true); - Q_UINT8 *dstData = tileData->data(); - Q_INT32 dstRowStride = rowStride(dstX, dstY); + TQ_UINT8 *dstData = tileData->data(); + TQ_INT32 dstRowStride = rowStride(dstX, dstY); - const Q_UINT8 *srcData = bytes + ((srcX + (srcY * w)) * m_pixelSize); - Q_INT32 srcRowStride = w * m_pixelSize; + const TQ_UINT8 *srcData = bytes + ((srcX + (srcY * w)) * m_pixelSize); + TQ_INT32 srcRowStride = w * m_pixelSize; - for (Q_INT32 row = 0; row < rows; row++) { + for (TQ_INT32 row = 0; row < rows; row++) { memcpy(dstData, srcData, columns * m_pixelSize); srcData += srcRowStride; dstData += dstRowStride; @@ -987,9 +987,9 @@ void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, } } -Q_INT32 KisTiledDataManager::numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT32 maxY) +TQ_INT32 KisTiledDataManager::numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY) { - Q_INT32 numColumns; + TQ_INT32 numColumns; Q_UNUSED(minY); Q_UNUSED(maxY); @@ -1003,9 +1003,9 @@ Q_INT32 KisTiledDataManager::numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT return numColumns; } -Q_INT32 KisTiledDataManager::numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 maxX) +TQ_INT32 KisTiledDataManager::numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX) { - Q_INT32 numRows; + TQ_INT32 numRows; Q_UNUSED(minX); Q_UNUSED(maxX); @@ -1019,7 +1019,7 @@ Q_INT32 KisTiledDataManager::numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 return numRows; } -Q_INT32 KisTiledDataManager::rowStride(Q_INT32 x, Q_INT32 y) +TQ_INT32 KisTiledDataManager::rowStride(TQ_INT32 x, TQ_INT32 y) { Q_UNUSED(x); Q_UNUSED(y); @@ -1027,12 +1027,12 @@ Q_INT32 KisTiledDataManager::rowStride(Q_INT32 x, Q_INT32 y) return KisTile::WIDTH * m_pixelSize; } -Q_INT32 KisTiledDataManager::numTiles(void) const +TQ_INT32 KisTiledDataManager::numTiles(void) const { return m_numTiles; } -KisTileDataWrapper::KisTileDataWrapper(KisTile* tile, Q_INT32 offset) +KisTileDataWrapper::KisTileDataWrapper(KisTile* tile, TQ_INT32 offset) : m_tile(tile), m_offset(offset) { m_tile->addReader(); diff --git a/krita/core/tiles/kis_tileddatamanager.h b/krita/core/tiles/kis_tileddatamanager.h index d4976080..20d78085 100644 --- a/krita/core/tiles/kis_tileddatamanager.h +++ b/krita/core/tiles/kis_tileddatamanager.h @@ -18,8 +18,8 @@ #ifndef KIS_TILEDDATAMANAGER_H_ #define KIS_TILEDDATAMANAGER_H_ -#include <qglobal.h> -#include <qvaluevector.h> +#include <tqglobal.h> +#include <tqvaluevector.h> #include <ksharedptr.h> @@ -39,11 +39,11 @@ class KoStore; class KisTileDataWrapper : public KShared { KisTile* m_tile; - Q_INT32 m_offset; + TQ_INT32 m_offset; public: - KisTileDataWrapper(KisTile* tile, Q_INT32 offset); + KisTileDataWrapper(KisTile* tile, TQ_INT32 offset); virtual ~KisTileDataWrapper(); - Q_UINT8* data() const { return m_tile->data() + m_offset; } + TQ_UINT8* data() const { return m_tile->data() + m_offset; } }; typedef KSharedPtr<KisTileDataWrapper> KisTileDataWrapperSP; @@ -61,13 +61,13 @@ typedef KSharedPtr<KisTileDataWrapper> KisTileDataWrapperSP; * that may allow deferred loading. * * A datamanager knows nothing about the type of pixel data except - * how many Q_UINT8's a single pixel takes. + * how many TQ_UINT8's a single pixel takes. */ class KisTiledDataManager : public KShared { protected: - KisTiledDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defPixel); + KisTiledDataManager(TQ_UINT32 pixelSize, const TQ_UINT8 *defPixel); ~KisTiledDataManager(); KisTiledDataManager(const KisTiledDataManager &dm); KisTiledDataManager & operator=(const KisTiledDataManager &dm); @@ -81,8 +81,8 @@ protected: protected: - void setDefaultPixel(const Q_UINT8 *defPixel); - const Q_UINT8 * defaultPixel() const { return m_defPixel;}; + void setDefaultPixel(const TQ_UINT8 *defPixel); + const TQ_UINT8 * defaultPixel() const { return m_defPixel;}; KisMementoSP getMemento(); void rollback(KisMementoSP memento); @@ -101,24 +101,24 @@ protected: protected: - Q_UINT32 pixelSize(); + TQ_UINT32 pixelSize(); - void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; - QRect extent() const; + void extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const; + TQRect extent() const; - void setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h); + void setExtent(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h); protected: - void clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UINT8 clearValue); - void clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *clearPixel); + void clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, TQ_UINT8 clearValue); + void clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *clearPixel); void clear(); protected: - void paste(KisDataManagerSP data, Q_INT32 sx, Q_INT32 sy, Q_INT32 dx, Q_INT32 dy, - Q_INT32 w, Q_INT32 h); + void paste(KisDataManagerSP data, TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 dx, TQ_INT32 dy, + TQ_INT32 w, TQ_INT32 h); protected: @@ -127,87 +127,87 @@ protected: /** * Get a read-only pointer to pixel (x, y). */ - const Q_UINT8* pixel(Q_INT32 x, Q_INT32 y); + const TQ_UINT8* pixel(TQ_INT32 x, TQ_INT32 y); /** * Get a read-write pointer to pixel (x, y). */ - Q_UINT8* writablePixel(Q_INT32 x, Q_INT32 y); + TQ_UINT8* writablePixel(TQ_INT32 x, TQ_INT32 y); /** * write the specified data to x, y. There is no checking on pixelSize! */ - void setPixel(Q_INT32 x, Q_INT32 y, const Q_UINT8 * data); + void setPixel(TQ_INT32 x, TQ_INT32 y, const TQ_UINT8 * data); /** * Copy the bytes in the specified rect to a vector. The caller is responsible * for managing the vector. */ - void readBytes(Q_UINT8 * bytes, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h); + void readBytes(TQ_UINT8 * bytes, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h); /** * Copy the bytes in the vector to the specified rect. If there are bytes left * in the vector after filling the rect, they will be ignored. If there are * not enough bytes, the rest of the rect will be filled with the default value * given (by default, 0); */ - void writeBytes(const Q_UINT8 * bytes, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h); + void writeBytes(const TQ_UINT8 * bytes, + 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); // For debugging use - Q_INT32 numTiles() const; + TQ_INT32 numTiles() const; private: - Q_UINT32 m_pixelSize; - Q_UINT32 m_numTiles; + TQ_UINT32 m_pixelSize; + TQ_UINT32 m_numTiles; KisTile *m_defaultTile; KisTile **m_hashTable; KisMementoSP m_currentMemento; - Q_INT32 m_extentMinX; - Q_INT32 m_extentMinY; - Q_INT32 m_extentMaxX; - Q_INT32 m_extentMaxY; - Q_UINT8 *m_defPixel; + TQ_INT32 m_extentMinX; + TQ_INT32 m_extentMinY; + TQ_INT32 m_extentMaxX; + TQ_INT32 m_extentMaxY; + TQ_UINT8 *m_defPixel; private: - void ensureTileMementoed(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash, const KisTile *refTile); - KisTile *getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def); - KisTile *getTile(Q_INT32 col, Q_INT32 row, bool writeAccess); - Q_UINT32 calcTileHash(Q_INT32 col, Q_INT32 row); - void updateExtent(Q_INT32 col, Q_INT32 row); + void ensureTileMementoed(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash, const KisTile *refTile); + KisTile *getOldTile(TQ_INT32 col, TQ_INT32 row, KisTile *def); + KisTile *getTile(TQ_INT32 col, TQ_INT32 row, bool writeAccess); + TQ_UINT32 calcTileHash(TQ_INT32 col, TQ_INT32 row); + void updateExtent(TQ_INT32 col, TQ_INT32 row); void recalculateExtent(); void deleteTiles(const KisMemento::DeletedTile *deletedTileList); - Q_INT32 xToCol(Q_INT32 x) const; - Q_INT32 yToRow(Q_INT32 y) const; - void getContiguousColumnsAndRows(Q_INT32 x, Q_INT32 y, Q_INT32 *columns, Q_INT32 *rows); - Q_UINT8* pixelPtr(Q_INT32 x, Q_INT32 y, bool writable); - KisTileDataWrapperSP pixelPtrSafe(Q_INT32 x, Q_INT32 y, bool writable); + TQ_INT32 xToCol(TQ_INT32 x) const; + TQ_INT32 yToRow(TQ_INT32 y) const; + void getContiguousColumnsAndRows(TQ_INT32 x, TQ_INT32 y, TQ_INT32 *columns, TQ_INT32 *rows); + TQ_UINT8* pixelPtr(TQ_INT32 x, TQ_INT32 y, bool writable); + KisTileDataWrapperSP pixelPtrSafe(TQ_INT32 x, TQ_INT32 y, bool writable); }; -inline Q_UINT32 KisTiledDataManager::pixelSize() +inline TQ_UINT32 KisTiledDataManager::pixelSize() { return m_pixelSize; } -inline Q_INT32 KisTiledDataManager::xToCol(Q_INT32 x) const +inline TQ_INT32 KisTiledDataManager::xToCol(TQ_INT32 x) const { if (x >= 0) { return x / KisTile::WIDTH; @@ -216,7 +216,7 @@ inline Q_INT32 KisTiledDataManager::xToCol(Q_INT32 x) const } } -inline Q_INT32 KisTiledDataManager::yToRow(Q_INT32 y) const +inline TQ_INT32 KisTiledDataManager::yToRow(TQ_INT32 y) const { if (y >= 0) { return y / KisTile::HEIGHT; diff --git a/krita/core/tiles/kis_tiledhlineiterator.cc b/krita/core/tiles/kis_tiledhlineiterator.cc index 37a1195e..cf023c1e 100644 --- a/krita/core/tiles/kis_tiledhlineiterator.cc +++ b/krita/core/tiles/kis_tiledhlineiterator.cc @@ -22,7 +22,7 @@ #include "kis_tile_global.h" #include "kis_tilediterator.h" -KisTiledHLineIterator::KisTiledHLineIterator( KisTiledDataManager *ndevice, Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable) : +KisTiledHLineIterator::KisTiledHLineIterator( KisTiledDataManager *ndevice, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable) : KisTiledIterator(ndevice), m_right(x+w-1), m_left(x) { @@ -137,7 +137,7 @@ void KisTiledHLineIterator::prevTile() } } -Q_INT32 KisTiledHLineIterator::nConseqHPixels() const +TQ_INT32 KisTiledHLineIterator::nConseqHPixels() const { return m_rightInTile - m_xInTile + 1; } diff --git a/krita/core/tiles/kis_tilediterator.cc b/krita/core/tiles/kis_tilediterator.cc index 5806a82a..b60e9a50 100644 --- a/krita/core/tiles/kis_tilediterator.cc +++ b/krita/core/tiles/kis_tilediterator.cc @@ -89,13 +89,13 @@ KisTiledIterator& KisTiledIterator::operator=(const KisTiledIterator& rhs) return *this; } -Q_UINT8 * KisTiledIterator::rawData() const +TQ_UINT8 * KisTiledIterator::rawData() const { return m_data + m_offset; } -const Q_UINT8 * KisTiledIterator::oldRawData() const +const TQ_UINT8 * KisTiledIterator::oldRawData() const { #ifdef DEBUG // Warn if we're misusing oldRawData(). If there's no memento, oldRawData is the same @@ -105,7 +105,7 @@ const Q_UINT8 * KisTiledIterator::oldRawData() const return m_oldData + m_offset; } -void KisTiledIterator::fetchTileData(Q_INT32 col, Q_INT32 row) +void KisTiledIterator::fetchTileData(TQ_INT32 col, TQ_INT32 row) { if (m_tile) m_tile->removeReader(); diff --git a/krita/core/tiles/kis_tilediterator.h b/krita/core/tiles/kis_tilediterator.h index 02431f4b..958876cd 100644 --- a/krita/core/tiles/kis_tilediterator.h +++ b/krita/core/tiles/kis_tilediterator.h @@ -18,7 +18,7 @@ #ifndef KIS_TILED_ITERATOR_H_ #define KIS_TILED_ITERATOR_H_ -#include <qglobal.h> +#include <tqglobal.h> #include <ksharedptr.h> @@ -32,22 +32,22 @@ class KRITACORE_EXPORT KisTiledIterator : public KShared { protected: KisTiledDataManager *m_ktm; - Q_INT32 m_pixelSize; // bytes per pixel - Q_INT32 m_x; // current x position - Q_INT32 m_y; // cirrent y position - Q_INT32 m_row; // row in tilemgr - Q_INT32 m_col; // col in tilemgr - Q_UINT8 *m_data; - Q_UINT8 *m_oldData; - Q_INT32 m_offset; + TQ_INT32 m_pixelSize; // bytes per pixel + TQ_INT32 m_x; // current x position + TQ_INT32 m_y; // cirrent y position + TQ_INT32 m_row; // row in tilemgr + TQ_INT32 m_col; // col in tilemgr + TQ_UINT8 *m_data; + TQ_UINT8 *m_oldData; + TQ_INT32 m_offset; KisTile *m_tile; KisTile* m_oldTile; bool m_writable; protected: - inline Q_UINT32 xToCol(Q_UINT32 x) const { if (m_ktm) return m_ktm->xToCol(x); else return 0; }; - inline Q_UINT32 yToRow(Q_UINT32 y) const { if (m_ktm) return m_ktm->yToRow(y); else return 0; }; - void fetchTileData(Q_INT32 col, Q_INT32 row); + inline TQ_UINT32 xToCol(TQ_UINT32 x) const { if (m_ktm) return m_ktm->xToCol(x); else return 0; }; + inline TQ_UINT32 yToRow(TQ_UINT32 y) const { if (m_ktm) return m_ktm->yToRow(y); else return 0; }; + void fetchTileData(TQ_INT32 col, TQ_INT32 row); public: KisTiledIterator( KisTiledDataManager *ktm); @@ -57,16 +57,16 @@ public: public: // current x position - Q_INT32 x() const { return m_x; }; + TQ_INT32 x() const { return m_x; }; // cirrent y position - Q_INT32 y() const { return m_y; }; + TQ_INT32 y() const { return m_y; }; /// Returns a pointer to the pixel data. Do NOT interpret the data - leave that to a colorstrategy - Q_UINT8 *rawData() const; + TQ_UINT8 *rawData() const; /// Returns a pointer to the pixel data as it was at the moment tof he last memento creation. - const Q_UINT8 * oldRawData() const; + const TQ_UINT8 * oldRawData() const; }; /** @@ -78,13 +78,13 @@ class KRITACORE_EXPORT KisTiledRectIterator : public KisTiledIterator public: /// do not call constructor directly use factory method in KisDataManager instead. - KisTiledRectIterator( KisTiledDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, bool writable); + KisTiledRectIterator( KisTiledDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, bool writable); KisTiledRectIterator(const KisTiledRectIterator&); KisTiledRectIterator& operator=(const KisTiledRectIterator&); ~KisTiledRectIterator(); public: - Q_INT32 nConseqPixels() const; + TQ_INT32 nConseqPixels() const; /// Advances a number of pixels until it reaches the end of the rect KisTiledRectIterator & operator+=(int n); @@ -100,20 +100,20 @@ public: protected: - Q_INT32 m_left; - Q_INT32 m_top; - Q_INT32 m_w; - Q_INT32 m_h; - Q_INT32 m_topRow; - Q_INT32 m_bottomRow; - Q_INT32 m_leftCol; - Q_INT32 m_rightCol; - Q_INT32 m_xInTile; - Q_INT32 m_yInTile; - Q_INT32 m_leftInTile; - Q_INT32 m_rightInTile; - Q_INT32 m_topInTile; - Q_INT32 m_bottomInTile; + TQ_INT32 m_left; + TQ_INT32 m_top; + TQ_INT32 m_w; + TQ_INT32 m_h; + TQ_INT32 m_topRow; + TQ_INT32 m_bottomRow; + TQ_INT32 m_leftCol; + TQ_INT32 m_rightCol; + TQ_INT32 m_xInTile; + TQ_INT32 m_yInTile; + TQ_INT32 m_leftInTile; + TQ_INT32 m_rightInTile; + TQ_INT32 m_topInTile; + TQ_INT32 m_bottomInTile; bool m_beyondEnd; private: @@ -129,7 +129,7 @@ class KRITACORE_EXPORT KisTiledHLineIterator : public KisTiledIterator public: /// do not call constructor directly use factory method in KisDataManager instead. - KisTiledHLineIterator( KisTiledDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, bool writable); + KisTiledHLineIterator( KisTiledDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable); KisTiledHLineIterator(const KisTiledHLineIterator&); KisTiledHLineIterator& operator=(const KisTiledHLineIterator&); ~KisTiledHLineIterator(); @@ -140,7 +140,7 @@ public: /// Returns the number of consequtive horizontal pixels that we point at /// This is useful for optimizing - Q_INT32 nConseqHPixels() const; + TQ_INT32 nConseqHPixels() const; /// Advances a number of pixels until it reaches the end of the line KisTiledHLineIterator & operator+=(int); @@ -155,14 +155,14 @@ public: void nextRow(); protected: - Q_INT32 m_right; - Q_INT32 m_left; - Q_INT32 m_leftCol; - Q_INT32 m_rightCol; - Q_INT32 m_xInTile; - Q_INT32 m_yInTile; - Q_INT32 m_leftInTile; - Q_INT32 m_rightInTile; + TQ_INT32 m_right; + TQ_INT32 m_left; + TQ_INT32 m_leftCol; + TQ_INT32 m_rightCol; + TQ_INT32 m_xInTile; + TQ_INT32 m_yInTile; + TQ_INT32 m_leftInTile; + TQ_INT32 m_rightInTile; private: void nextTile(); @@ -178,7 +178,7 @@ class KRITACORE_EXPORT KisTiledVLineIterator : public KisTiledIterator public: /// do not call constructor directly use factory method in KisDataManager instead. - KisTiledVLineIterator( KisTiledDataManager *dm, Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable); + KisTiledVLineIterator( KisTiledDataManager *dm, TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable); KisTiledVLineIterator(const KisTiledVLineIterator&); KisTiledVLineIterator& operator=(const KisTiledVLineIterator&); ~KisTiledVLineIterator(); @@ -197,14 +197,14 @@ public: void nextCol(); protected: - Q_INT32 m_top; - Q_INT32 m_bottom; - Q_INT32 m_topRow; - Q_INT32 m_bottomRow; - Q_INT32 m_xInTile; - Q_INT32 m_yInTile; - Q_INT32 m_topInTile; - Q_INT32 m_bottomInTile; + TQ_INT32 m_top; + TQ_INT32 m_bottom; + TQ_INT32 m_topRow; + TQ_INT32 m_bottomRow; + TQ_INT32 m_xInTile; + TQ_INT32 m_yInTile; + TQ_INT32 m_topInTile; + TQ_INT32 m_bottomInTile; private: void nextTile(); diff --git a/krita/core/tiles/kis_tiledrectiterator.cc b/krita/core/tiles/kis_tiledrectiterator.cc index 73146504..8f0f7ed1 100644 --- a/krita/core/tiles/kis_tiledrectiterator.cc +++ b/krita/core/tiles/kis_tiledrectiterator.cc @@ -22,8 +22,8 @@ #include "kis_tile_global.h" #include "kis_tilediterator.h" -KisTiledRectIterator::KisTiledRectIterator( KisTiledDataManager *ndevice, Q_INT32 nleft, - Q_INT32 ntop, Q_INT32 nw, Q_INT32 nh, bool writable) : +KisTiledRectIterator::KisTiledRectIterator( KisTiledDataManager *ndevice, TQ_INT32 nleft, + TQ_INT32 ntop, TQ_INT32 nw, TQ_INT32 nh, bool writable) : KisTiledIterator(ndevice), m_left(nleft), m_top(ntop), @@ -118,7 +118,7 @@ KisTiledRectIterator::~KisTiledRectIterator( ) { } -Q_INT32 KisTiledRectIterator::nConseqPixels() const +TQ_INT32 KisTiledRectIterator::nConseqPixels() const { if(m_leftInTile || (m_rightInTile != KisTile::WIDTH - 1)) return m_rightInTile - m_xInTile + 1; diff --git a/krita/core/tiles/kis_tiledvlineiterator.cc b/krita/core/tiles/kis_tiledvlineiterator.cc index 5b6270e1..bcd85d70 100644 --- a/krita/core/tiles/kis_tiledvlineiterator.cc +++ b/krita/core/tiles/kis_tiledvlineiterator.cc @@ -22,7 +22,7 @@ #include "kis_tile_global.h" #include "kis_tilediterator.h" -KisTiledVLineIterator::KisTiledVLineIterator( KisTiledDataManager *ndevice, Q_INT32 x, Q_INT32 y, Q_INT32 h, bool writable) : +KisTiledVLineIterator::KisTiledVLineIterator( KisTiledDataManager *ndevice, TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable) : KisTiledIterator(ndevice), m_bottom(y + h - 1) { diff --git a/krita/core/tiles/kis_tilemanager.cc b/krita/core/tiles/kis_tilemanager.cc index 0ac968fd..49fe7f06 100644 --- a/krita/core/tiles/kis_tilemanager.cc +++ b/krita/core/tiles/kis_tilemanager.cc @@ -25,9 +25,9 @@ #include <string.h> #include <fcntl.h> -#include <qmutex.h> -#include <qthread.h> -#include <qfile.h> +#include <tqmutex.h> +#include <tqthread.h> +#include <tqfile.h> #include <kstaticdeleter.h> #include <kglobal.h> @@ -54,8 +54,8 @@ KisTileManager::KisTileManager() { // Hardcoded (at the moment only?): 4 pools of 1000 tiles each m_tilesPerPool = 1000; - m_pools = new Q_UINT8*[4]; - m_poolPixelSizes = new Q_INT32[4]; + m_pools = new TQ_UINT8*[4]; + m_poolPixelSizes = new TQ_INT32[4]; m_poolFreeList = new PoolFreeList[4]; for (int i = 0; i < 4; i++) { m_pools[i] = 0; @@ -74,8 +74,8 @@ KisTileManager::KisTileManager() { counter = 0; - m_poolMutex = new QMutex(true); - m_swapMutex = new QMutex(true); + m_poolMutex = new TQMutex(true); + m_swapMutex = new TQMutex(true); } KisTileManager::~KisTileManager() { @@ -157,11 +157,11 @@ void KisTileManager::deregisterTile(KisTile* tile) { m_swapMutex->lock(); - if (!m_tileMap.contains(tile)) { + if (!m_tileMap.tqcontains(tile)) { m_swapMutex->unlock(); return; } - // Q_ASSERT(m_tileMap.contains(tile)); + // Q_ASSERT(m_tileMap.tqcontains(tile)); TileInfo* info = m_tileMap[tile]; @@ -352,16 +352,16 @@ void KisTileManager::toSwap(TileInfo* info) { } //memcpy(data, tile->m_data, info->size); - QFile* file = info->file->file(); + TQFile* file = info->file->file(); if(!file) { - kdWarning() << "Opening the file as QFile failed" << endl; + kdWarning() << "Opening the file as TQFile failed" << endl; m_swapForbidden = true; m_swapMutex->unlock(); return; } int fd = file->handle(); - Q_UINT8* data = 0; + TQ_UINT8* data = 0; if (!kritaMmap(data, 0, info->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, info->filePos)) { kdWarning() << "Initial mmap failed" << endl; @@ -411,9 +411,9 @@ void KisTileManager::doSwapping() #if 1 // enable this to enable swapping - Q_UINT32 count = QMIN(m_swappableList.size(), m_swappiness); + TQ_UINT32 count = TQMIN(m_swappableList.size(), m_swappiness); - for (Q_UINT32 i = 0; i < count && !m_swapForbidden; i++) { + for (TQ_UINT32 i = 0; i < count && !m_swapForbidden; i++) { toSwap(m_swappableList.front()); m_swappableList.front()->validNode = false; m_swappableList.pop_front(); @@ -449,20 +449,20 @@ void KisTileManager::printInfo() kdDebug(DBG_AREA_TILES) << endl; } -Q_UINT8* KisTileManager::requestTileData(Q_INT32 pixelSize) +TQ_UINT8* KisTileManager::requestTileData(TQ_INT32 pixelSize) { m_swapMutex->lock(); - Q_UINT8* data = findTileFor(pixelSize); + TQ_UINT8* data = findTileFor(pixelSize); if ( data ) { m_swapMutex->unlock(); return data; } m_swapMutex->unlock(); - return new Q_UINT8[m_tileSize * pixelSize]; + return new TQ_UINT8[m_tileSize * pixelSize]; } -void KisTileManager::dontNeedTileData(Q_UINT8* data, Q_INT32 pixelSize) +void KisTileManager::dontNeedTileData(TQ_UINT8* data, TQ_INT32 pixelSize) { m_poolMutex->lock(); if (isPoolTile(data, pixelSize)) { @@ -472,14 +472,14 @@ void KisTileManager::dontNeedTileData(Q_UINT8* data, Q_INT32 pixelSize) m_poolMutex->unlock(); } -Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) +TQ_UINT8* KisTileManager::findTileFor(TQ_INT32 pixelSize) { m_poolMutex->lock(); for (int i = 0; i < 4; i++) { if (m_poolPixelSizes[i] == pixelSize) { if (!m_poolFreeList[i].isEmpty()) { - Q_UINT8* data = m_poolFreeList[i].front(); + TQ_UINT8* data = m_poolFreeList[i].front(); m_poolFreeList[i].pop_front(); m_poolMutex->unlock(); return data; @@ -488,7 +488,7 @@ Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) if (m_pools[i] == 0) { // allocate new pool m_poolPixelSizes[i] = pixelSize; - m_pools[i] = new Q_UINT8[pixelSize * m_tileSize * m_tilesPerPool]; + m_pools[i] = new TQ_UINT8[pixelSize * m_tileSize * m_tilesPerPool]; // j = 1 because we return the first element, so no need to add it to the freelist for (int j = 1; j < m_tilesPerPool; j++) m_poolFreeList[i].append(&m_pools[i][j * pixelSize * m_tileSize]); @@ -501,7 +501,7 @@ Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) return 0; } -bool KisTileManager::isPoolTile(Q_UINT8* data, Q_INT32 pixelSize) { +bool KisTileManager::isPoolTile(TQ_UINT8* data, TQ_INT32 pixelSize) { if (data == 0) return false; @@ -521,7 +521,7 @@ bool KisTileManager::isPoolTile(Q_UINT8* data, Q_INT32 pixelSize) { return false; } -void KisTileManager::reclaimTileToPool(Q_UINT8* data, Q_INT32 pixelSize) { +void KisTileManager::reclaimTileToPool(TQ_UINT8* data, TQ_INT32 pixelSize) { m_poolMutex->lock(); for (int i = 0; i < 4; i++) { if (m_poolPixelSizes[i] == pixelSize) @@ -543,12 +543,12 @@ void KisTileManager::configChanged() { m_swapMutex->unlock(); } -bool KisTileManager::kritaMmap(Q_UINT8*& result, void *start, size_t length, +bool KisTileManager::kritaMmap(TQ_UINT8*& result, void *start, size_t length, int prot, int flags, int fd, off_t offset) { - result = (Q_UINT8*) mmap(start, length, prot, flags, fd, offset); + result = (TQ_UINT8*) mmap(start, length, prot, flags, fd, offset); // Same here for warning and GUI - if (result == (Q_UINT8*)-1) { + if (result == (TQ_UINT8*)-1) { kdWarning(DBG_AREA_TILES) << "mmap failed: errno is " << errno << "; we're probably going to crash very soon now...\n"; // Try to ignore what happened and carry on, but unlikely that we'll get diff --git a/krita/core/tiles/kis_tilemanager.h b/krita/core/tiles/kis_tilemanager.h index a66ca634..bce60ca4 100644 --- a/krita/core/tiles/kis_tilemanager.h +++ b/krita/core/tiles/kis_tilemanager.h @@ -20,10 +20,10 @@ #include <sys/types.h> -#include <qglobal.h> -#include <qmap.h> -#include <qvaluelist.h> -#include <qmutex.h> +#include <tqglobal.h> +#include <tqmap.h> +#include <tqvaluelist.h> +#include <tqmutex.h> #include <ktempfile.h> @@ -54,8 +54,8 @@ public: // Tile management void maySwapTile(const KisTile* tile); public: // Pool management - Q_UINT8* requestTileData(Q_INT32 pixelSize); - void dontNeedTileData(Q_UINT8* data, Q_INT32 pixelSize); + TQ_UINT8* requestTileData(TQ_INT32 pixelSize); + void dontNeedTileData(TQ_UINT8* data, TQ_INT32 pixelSize); public: // Configuration void configChanged(); @@ -84,37 +84,37 @@ private: // being used in the swap for this tile (may be larger!) // The file points to 0 if it is not swapped, and to the relevant TempFile otherwise struct TileInfo { KisTile *tile; KTempFile* file; off_t filePos; int size; int fsize; - QValueList<TileInfo*>::iterator node; + TQValueList<TileInfo*>::iterator node; bool inMem; bool onFile; bool mmapped; bool validNode; }; typedef struct { KTempFile* file; off_t filePos; int size; } FreeInfo; - typedef QMap<const KisTile*, TileInfo*> TileMap; - typedef QValueList<TileInfo*> TileList; - typedef QValueList<FreeInfo*> FreeList; - typedef QValueVector<FreeList> FreeListList; - typedef QValueList<Q_UINT8*> PoolFreeList; - typedef QValueList<TempFile> FileList; + typedef TQMap<const KisTile*, TileInfo*> TileMap; + typedef TQValueList<TileInfo*> TileList; + typedef TQValueList<FreeInfo*> FreeList; + typedef TQValueVector<FreeList> FreeListList; + typedef TQValueList<TQ_UINT8*> PoolFreeList; + typedef TQValueList<TempFile> FileList; TileMap m_tileMap; TileList m_swappableList; FreeListList m_freeLists; FileList m_files; - Q_INT32 m_maxInMem; - Q_INT32 m_currentInMem; - Q_UINT32 m_swappiness; - Q_INT32 m_tileSize; // size of a tile if it used 1 byte per pixel + TQ_INT32 m_maxInMem; + TQ_INT32 m_currentInMem; + TQ_UINT32 m_swappiness; + TQ_INT32 m_tileSize; // size of a tile if it used 1 byte per pixel unsigned long m_bytesInMem; unsigned long m_bytesTotal; - Q_UINT8 **m_pools; - Q_INT32 *m_poolPixelSizes; - Q_INT32 m_tilesPerPool; + TQ_UINT8 **m_pools; + TQ_INT32 *m_poolPixelSizes; + TQ_INT32 m_tilesPerPool; PoolFreeList *m_poolFreeList; - QMutex * m_poolMutex; - QMutex * m_swapMutex; + TQMutex * m_poolMutex; + TQMutex * m_swapMutex; // This is the constant that we will use to see if we want to add a new tempfile - // We use 1<<30 (one gigabyte) because apparently 32bit systems don't really like very + // We use 1<<30 (one gigabyte) because aptqparently 32bit systems don't really like very // large files. static const long MaxSwapFileSize = 1<<30; // For debugging purposes: 1<<20 is a megabyte @@ -126,13 +126,13 @@ private: void toSwap(TileInfo* info); void doSwapping(); void printInfo(); - Q_UINT8* findTileFor(Q_INT32 pixelSize); - bool isPoolTile(Q_UINT8* data, Q_INT32 pixelSize); - void reclaimTileToPool(Q_UINT8* data, Q_INT32 pixelSize); + TQ_UINT8* findTileFor(TQ_INT32 pixelSize); + bool isPoolTile(TQ_UINT8* data, TQ_INT32 pixelSize); + void reclaimTileToPool(TQ_UINT8* data, TQ_INT32 pixelSize); // Mmap wrapper that prints warnings on error. The result is stored in the *& result // the return value is true on succes, false on failure. Other args as in man mmap - bool kritaMmap(Q_UINT8*& result, void *start, size_t length, + bool kritaMmap(TQ_UINT8*& result, void *start, size_t length, int prot, int flags, int fd, off_t offset); }; diff --git a/krita/core/tiles/tests/kis_tiled_data_tester.cpp b/krita/core/tiles/tests/kis_tiled_data_tester.cpp index 2d7fbe05..15d3e50b 100644 --- a/krita/core/tiles/tests/kis_tiled_data_tester.cpp +++ b/krita/core/tiles/tests/kis_tiled_data_tester.cpp @@ -30,27 +30,27 @@ KUNITTEST_MODULE_REGISTER_TESTER( KisTiledDataTester ); #define TEST_PIXEL_SIZE 4 -static Q_UINT8 defaultPixel[TEST_PIXEL_SIZE] = {0, 0, 0, OPACITY_TRANSPARENT}; +static TQ_UINT8 defaultPixel[TEST_PIXEL_SIZE] = {0, 0, 0, OPACITY_TRANSPARENT}; void KisTiledDataTester::allTests() { KisDataManager *dm = new KisDataManager(TEST_PIXEL_SIZE, defaultPixel); - Q_INT32 extentX; - Q_INT32 extentY; - Q_INT32 extentWidth; - Q_INT32 extentHeight; + TQ_INT32 extentX; + TQ_INT32 extentY; + TQ_INT32 extentWidth; + TQ_INT32 extentHeight; dm->extent(extentX, extentY, extentWidth, extentHeight); CHECK(extentWidth, 0); CHECK(extentHeight, 0); - const Q_UINT8 *readOnlyPixel = dm->pixel(KisTile::WIDTH/2, KisTile::HEIGHT/2); + const TQ_UINT8 *readOnlyPixel = dm->pixel(KisTile::WIDTH/2, KisTile::HEIGHT/2); dm->extent(extentX, extentY, extentWidth, extentHeight); CHECK(extentWidth, 0); CHECK(extentHeight, 0); - Q_UINT8 *writablePixel = dm->writablePixel(KisTile::WIDTH/2, KisTile::HEIGHT/2); + TQ_UINT8 *writablePixel = dm->writablePixel(KisTile::WIDTH/2, KisTile::HEIGHT/2); dm->extent(extentX, extentY, extentWidth, extentHeight); CHECK(extentX, 0); CHECK(extentY, 0); |