diff options
Diffstat (limited to 'filters/karbon/xcf')
-rw-r--r-- | filters/karbon/xcf/xcfexport.cc | 244 | ||||
-rw-r--r-- | filters/karbon/xcf/xcfexport.h | 9 |
2 files changed, 127 insertions, 126 deletions
diff --git a/filters/karbon/xcf/xcfexport.cc b/filters/karbon/xcf/xcfexport.cc index fde8bbd5..d5a0c71b 100644 --- a/filters/karbon/xcf/xcfexport.cc +++ b/filters/karbon/xcf/xcfexport.cc @@ -17,12 +17,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qcstring.h> -#include <qdatastream.h> -#include <qdom.h> -#include <qfile.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <kgenericfactory.h> #include <KoFilter.h> @@ -45,15 +45,15 @@ typedef KGenericFactory<XcfExport, KoFilter> XcfExportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonxcfexport, XcfExportFactory( "kofficefilters" ) ) -XcfExport::XcfExport( KoFilter*, const char*, const QStringList& ) +XcfExport::XcfExport( KoFilter*, const char*, const TQStringList& ) : KoFilter() { m_zoomX = 1.0; m_zoomY = 1.0; } -KoFilter::ConversionStatus -XcfExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +XcfExport::convert( const TQCString& from, const TQCString& to ) { if( to != "image/x-xcf-gimp" || from != "application/x-karbon" ) { @@ -67,17 +67,17 @@ XcfExport::convert( const QCString& from, const QCString& to ) return KoFilter::StupidError; - QFile fileOut( m_chain->outputFile() ); + TQFile fileOut( m_chain->outputFile() ); if( !fileOut.open( IO_WriteOnly ) ) return KoFilter::StupidError; - QDomDocument domIn; + TQDomDocument domIn; domIn.setContent( storeIn ); - QDomElement docNode = domIn.documentElement(); + TQDomElement docNode = domIn.documentElement(); - m_stream = new QDataStream( &fileOut ); + m_stream = new TQDataStream( &fileOut ); // Load the document. @@ -98,9 +98,9 @@ void XcfExport::visitVDocument( VDocument& document ) { // Offsets. - QIODevice::Offset current = 0; - QIODevice::Offset start = 0; - QIODevice::Offset end = 0; + TQIODevice::Offset current = 0; + TQIODevice::Offset start = 0; + TQIODevice::Offset end = 0; // Save width and height for layer saving. m_width = static_cast<unsigned>( document.width() * m_zoomX ); @@ -111,27 +111,27 @@ XcfExport::visitVDocument( VDocument& document ) m_stream->writeRawBytes( "gimp xcf file", 14 ); // Image width. - *m_stream << static_cast<Q_UINT32>( m_width ); + *m_stream << static_cast<TQ_UINT32>( m_width ); // Image height. - *m_stream << static_cast<Q_UINT32>( m_height ); + *m_stream << static_cast<TQ_UINT32>( m_height ); // Image type = RGB. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Do not save any properties currently. *m_stream // "END". - << static_cast<Q_UINT32>( 0 ) + << static_cast<TQ_UINT32>( 0 ) // Property size in bytes. - << static_cast<Q_UINT32>( 0 ); + << static_cast<TQ_UINT32>( 0 ); // Save current offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Leave space for layer and channel offsets. - m_stream->device()->at( + m_stream->tqdevice()->at( // current position + (number layers + number channels + 2) * 4. current + ( document.layers().count() + 3 + 2 ) * 4 ); @@ -142,7 +142,7 @@ XcfExport::visitVDocument( VDocument& document ) for( ; itr.current(); ++itr ) { // Save start offset. - start = m_stream->device()->at(); + start = m_stream->tqdevice()->at(); // Write layer. @@ -150,142 +150,142 @@ XcfExport::visitVDocument( VDocument& document ) // Save end offset. - end = m_stream->device()->at(); + end = m_stream->tqdevice()->at(); // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Save layer offset. *m_stream << start; // Increment offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Return to end offset. - m_stream->device()->at( end ); + m_stream->tqdevice()->at( end ); } // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Append a zero offset to indicate end of layer offsets. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Return to end offset. - m_stream->device()->at( end ); + m_stream->tqdevice()->at( end ); // Append a zero offset to indicate end of channel offsets. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); } void XcfExport::visitVLayer( VLayer& layer ) { // Layer width = image width. - *m_stream << static_cast<Q_UINT32>( m_width ); + *m_stream << static_cast<TQ_UINT32>( m_width ); // Layer height = image height. - *m_stream << static_cast<Q_UINT32>( m_height ); + *m_stream << static_cast<TQ_UINT32>( m_height ); // Layer type = RGBA. - *m_stream << static_cast<Q_UINT32>( 1 ); + *m_stream << static_cast<TQ_UINT32>( 1 ); // Layer name. *m_stream << layer.name().latin1(); // Layer opacity. - *m_stream << static_cast<Q_UINT32>( 6 ); + *m_stream << static_cast<TQ_UINT32>( 6 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // Fully opaque = 255. - *m_stream << static_cast<Q_UINT32>( 255 ); + *m_stream << static_cast<TQ_UINT32>( 255 ); // Layer visible? - *m_stream << static_cast<Q_UINT32>( 8 ); + *m_stream << static_cast<TQ_UINT32>( 8 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // True. - *m_stream << static_cast<Q_UINT32>( 1 ); + *m_stream << static_cast<TQ_UINT32>( 1 ); // Layer linked? - *m_stream << static_cast<Q_UINT32>( 9 ); + *m_stream << static_cast<TQ_UINT32>( 9 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Preserve transparency? - *m_stream << static_cast<Q_UINT32>( 10 ); + *m_stream << static_cast<TQ_UINT32>( 10 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); - // Apply mask? - *m_stream << static_cast<Q_UINT32>( 11 ); + // Apply tqmask? + *m_stream << static_cast<TQ_UINT32>( 11 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); - // Edit mask? - *m_stream << static_cast<Q_UINT32>( 12 ); + // Edit tqmask? + *m_stream << static_cast<TQ_UINT32>( 12 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); - // Show mask? - *m_stream << static_cast<Q_UINT32>( 13 ); + // Show tqmask? + *m_stream << static_cast<TQ_UINT32>( 13 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Layer offsets. - *m_stream << static_cast<Q_UINT32>( 15 ); + *m_stream << static_cast<TQ_UINT32>( 15 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 8 ); + *m_stream << static_cast<TQ_UINT32>( 8 ); // X-Offset. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Y-Offset. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Layer mode. - *m_stream << static_cast<Q_UINT32>( 7 ); + *m_stream << static_cast<TQ_UINT32>( 7 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // Normal mode. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // TODO: Tattoo. - *m_stream << static_cast<Q_UINT32>( 20 ); + *m_stream << static_cast<TQ_UINT32>( 20 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Layer properties end. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Offsets. - QIODevice::Offset current = 0; - QIODevice::Offset start = 0; - QIODevice::Offset end = 0; + TQIODevice::Offset current = 0; + TQIODevice::Offset start = 0; + TQIODevice::Offset end = 0; // Save current offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Leave space for hierarchy offsets. - m_stream->device()->at( current + 8 ); + m_stream->tqdevice()->at( current + 8 ); // Save start offset. - start = m_stream->device()->at(); + start = m_stream->tqdevice()->at(); // Write hierarchy. @@ -293,26 +293,26 @@ XcfExport::visitVLayer( VLayer& layer ) // Save end offset. - end = m_stream->device()->at(); + end = m_stream->tqdevice()->at(); // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Save hierarchy offset. *m_stream << start; - // Append a zero offset to indicate end of layer mask offsets. - *m_stream << static_cast<Q_UINT32>( 0 ); + // Append a zero offset to indicate end of layer tqmask offsets. + *m_stream << static_cast<TQ_UINT32>( 0 ); } void XcfExport::writeHierarchy() { // Offsets. - QIODevice::Offset current = 0; - QIODevice::Offset start = 0; - QIODevice::Offset end = 0; + TQIODevice::Offset current = 0; + TQIODevice::Offset start = 0; + TQIODevice::Offset end = 0; // Width (again?). *m_stream << m_width; @@ -321,27 +321,27 @@ XcfExport::writeHierarchy() *m_stream << m_height; // Color depth. - *m_stream << static_cast<Q_UINT32>( 3 ); + *m_stream << static_cast<TQ_UINT32>( 3 ); // Calculate level number. int levX = levels( m_width, m_tileWidth ); int levY = levels( m_height, m_tileHeight ); - int levels = QMAX( levX, levY ); + int levels = TQMAX( levX, levY ); int width = m_width; int height = m_height; // Save current offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Leave space for level offsets. - m_stream->device()->at( current + ( levels + 1 ) * 4 ); + m_stream->tqdevice()->at( current + ( levels + 1 ) * 4 ); for( int i = 0; i < levels; ++i ) { // Save start offset. - start = m_stream->device()->at(); + start = m_stream->tqdevice()->at(); if( i == 0 ) { @@ -354,90 +354,90 @@ XcfExport::writeHierarchy() width /= 2; height /= 2; - *m_stream << static_cast<Q_UINT32>( width ); - *m_stream << static_cast<Q_UINT32>( height ); - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( width ); + *m_stream << static_cast<TQ_UINT32>( height ); + *m_stream << static_cast<TQ_UINT32>( 0 ); } // Save end offset. - end = m_stream->device()->at(); + end = m_stream->tqdevice()->at(); // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Save level offset. *m_stream << start; // Increment offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Return to end offset. - m_stream->device()->at( end ); + m_stream->tqdevice()->at( end ); } // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Append a zero offset to indicate end of level offsets. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); } void XcfExport::writeLevel() { // Offsets. - QIODevice::Offset current = 0; - QIODevice::Offset start = 0; - QIODevice::Offset end = 0; + TQIODevice::Offset current = 0; + TQIODevice::Offset start = 0; + TQIODevice::Offset end = 0; - *m_stream << static_cast<Q_UINT32>( m_width ); - *m_stream << static_cast<Q_UINT32>( m_height ); + *m_stream << static_cast<TQ_UINT32>( m_width ); + *m_stream << static_cast<TQ_UINT32>( m_height ); int rows = ( m_height + m_tileHeight - 1 ) / m_tileHeight; int cols = ( m_width + m_tileWidth - 1 ) / m_tileWidth; int tiles = rows * cols; // Save current offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Leave space for tile offsets. - m_stream->device()->at( current + ( tiles + 1 ) * 4 ); + m_stream->tqdevice()->at( current + ( tiles + 1 ) * 4 ); for( int i = 0; i < tiles; ++i ) { // Save start offset. - start = m_stream->device()->at(); + start = m_stream->tqdevice()->at(); // TODO: Save tile. - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); // Save end offset. - end = m_stream->device()->at(); + end = m_stream->tqdevice()->at(); // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Save tile offset. *m_stream << start; // Increment offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Return to end offset. - m_stream->device()->at( end ); + m_stream->tqdevice()->at( end ); } } diff --git a/filters/karbon/xcf/xcfexport.h b/filters/karbon/xcf/xcfexport.h index 92913cb4..0c60dd4e 100644 --- a/filters/karbon/xcf/xcfexport.h +++ b/filters/karbon/xcf/xcfexport.h @@ -26,7 +26,7 @@ #include "vvisitor.h" -class QDataStream; +class TQDataStream; class VDocument; class VLayer; @@ -34,12 +34,13 @@ class VLayer; class XcfExport : public KoFilter, private VVisitor { Q_OBJECT + TQ_OBJECT public: - XcfExport( KoFilter* parent, const char* name, const QStringList& ); + XcfExport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~XcfExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); virtual void visitVDocument( VDocument& document ); virtual void visitVLayer( VLayer& layer ); @@ -70,7 +71,7 @@ private: /** * Output stream. */ - QDataStream* m_stream; + TQDataStream* m_stream; /** * Image width. |