F:/KPlato/koffice/libs/kwmf/kowmfstruct.h

Aller à la documentation de ce fichier.
00001 /* This library is distributed under the conditions of the GNU LGPL.
00002  * WMF Metafile Structures
00003  * Author: 2002/2003 thierry lorthiois
00004  */
00005 #ifndef _KOWMFSTRUCT_H_
00006 #define _KOWMFSTRUCT_H_
00007 
00008 #include <qglobal.h>
00009 #include <qnamespace.h>
00010 #include <QPainter>
00011 
00012 #define APMHEADER_KEY 0x9AC6CDD7
00013 #define ENHMETA_SIGNATURE       0x464D4520
00014 
00015 struct WmfMetaHeader
00016 {
00017   quint16  fileType;      // Type of metafile (0=memory, 1=disk)
00018   quint16  headerSize;    // always 9
00019   quint16  version;
00020   quint32  fileSize;      // Total size of the metafile in WORDs
00021   quint16  numOfObjects;    // Maximum Number of objects in the stack
00022   quint32  maxRecordSize;   // The size of largest record in WORDs
00023   quint16  numOfParameters; // not used (always 0)
00024 };
00025 
00026 
00027 struct WmfPlaceableHeader
00028 {
00029   quint32  key;        // Magic number (always 9AC6CDD7h)
00030   quint16  handle;     // Metafile HANDLE number (always 0)
00031   qint16   left;       // Left coordinate in metafile units
00032   qint16   top;
00033   qint16   right;
00034   qint16   bottom;
00035   quint16  inch;       // Number of metafile units per inch
00036   quint32  reserved;
00037   quint16  checksum;   // Checksum value for previous 10 WORDs
00038 };
00039 
00040 
00041 struct WmfEnhMetaHeader
00042 {
00043   quint32  recordType;       // Record type (is always 00000001h)
00044   quint32  recordSize;       // Record size in bytes.  This may be greater
00045                               // than the sizeof( ENHMETAHEADER ).
00046   qint32   boundsLeft;       // Inclusive-inclusive bounds in device units
00047   qint32   boundsTop;
00048   qint32   boundsRight;
00049   qint32   boundsBottom;
00050   qint32   frameLeft;        // Inclusive-inclusive Picture Frame
00051   qint32   frameTop;
00052   qint32   frameRight;
00053   qint32   frameBottom;
00054   quint32  signature;        // Signature.  Must be ENHMETA_SIGNATURE.
00055   quint32  version;          // Version number
00056   quint32  size;             // Size of the metafile in bytes
00057   quint32  numOfRecords;     // Number of records in the metafile
00058   quint16  numHandles;       // Number of handles in the handle table
00059   // Handle index zero is reserved.
00060   quint16  reserved;         // always 0
00061   quint32  sizeOfDescription;   // Number of chars in the unicode description string
00062                                  // This is 0 if there is no description string
00063   quint32  offsetOfDescription; // Offset to the metafile description record.
00064                                  // This is 0 if there is no description string
00065   quint32  numPaletteEntries;   // Number of color palette entries
00066   qint32   widthDevicePixels;   // Size of the reference device in pixels
00067   qint32   heightDevicePixels;
00068   qint32   widthDeviceMM;       // Size of the reference device in millimeters
00069   qint32   heightDeviceMM;
00070 };
00071 
00072 
00073 struct WmfMetaRecord
00074 {
00075   quint32  size;         // Total size of the record in WORDs
00076   quint16  function;     // Record function number
00077   quint16  param[ 1 ];   // quint16 array of parameters
00078 };
00079 
00080 
00081 struct WmfEnhMetaRecord
00082 {
00083   quint32  function;     // Record function number
00084   quint32  size;         // Record size in bytes
00085   quint32  param[ 1 ];   // quint32 array of parameters
00086 };
00087 
00088 // Static data
00089     static const struct OpTab
00090     {
00091         quint32  winRasterOp;
00092         QPainter::CompositionMode  qtRasterOp;
00093     } koWmfOpTab32[] =
00094     {
00095       // ### untested (conversion from Qt::RasterOp)
00096       { 0x00CC0020, QPainter::CompositionMode_Source }, // CopyROP
00097       { 0x00EE0086, QPainter::CompositionMode_SourceOver }, // OrROP
00098       { 0x008800C6, QPainter::CompositionMode_SourceIn }, // AndROP
00099       { 0x00660046, QPainter::CompositionMode_Xor }, // XorROP
00100       { 0x00440328, QPainter::CompositionMode_DestinationOut }, // AndNotROP
00101       { 0x00330008, QPainter::CompositionMode_DestinationOut }, // NotCopyROP
00102       { 0x001100A6, QPainter::CompositionMode_SourceOut }, // NandROP
00103       { 0x00C000CA, QPainter::CompositionMode_Source }, // CopyROP
00104       { 0x00BB0226, QPainter::CompositionMode_Destination }, // NotOrROP
00105       { 0x00F00021, QPainter::CompositionMode_Source }, // CopyROP
00106       { 0x00FB0A09, QPainter::CompositionMode_Source }, // CopyROP
00107       { 0x005A0049, QPainter::CompositionMode_Source }, // CopyROP
00108       { 0x00550009, QPainter::CompositionMode_DestinationOut }, // NotROP
00109       { 0x00000042, QPainter::CompositionMode_Clear }, // ClearROP
00110       { 0x00FF0062, QPainter::CompositionMode_Source } // SetROP
00111     };
00112 
00113     static const QPainter::CompositionMode koWmfOpTab16[] =
00114     {
00115       // ### untested (conversion from Qt::RasterOp)
00116       QPainter::CompositionMode_Source, // CopyROP
00117       QPainter::CompositionMode_Clear, // ClearROP
00118       QPainter::CompositionMode_SourceOut, // NandROP
00119       QPainter::CompositionMode_SourceOut, // NotAndROP
00120       QPainter::CompositionMode_DestinationOut, // NotCopyROP
00121       QPainter::CompositionMode_DestinationOut, // AndNotROP
00122       QPainter::CompositionMode_DestinationOut, // NotROP
00123       QPainter::CompositionMode_Xor, // XorROP
00124       QPainter::CompositionMode_Source, // NorROP
00125       QPainter::CompositionMode_SourceIn, // AndROP
00126       QPainter::CompositionMode_SourceIn, //NotXorROP
00127       QPainter::CompositionMode_Destination, // NopROP
00128       QPainter::CompositionMode_Destination, // NotOrROP
00129       QPainter::CompositionMode_Source, // CopyROP
00130       QPainter::CompositionMode_Source, // OrNotROP
00131       QPainter::CompositionMode_SourceOver, // OrROP
00132       QPainter::CompositionMode_Source // SetROP
00133     };
00134 
00135     static const Qt::BrushStyle koWmfHatchedStyleBrush[] =
00136     {
00137         Qt::HorPattern,
00138         Qt::VerPattern,
00139         Qt::FDiagPattern,
00140         Qt::BDiagPattern,
00141         Qt::CrossPattern,
00142         Qt::DiagCrossPattern
00143     };
00144 
00145     static const Qt::BrushStyle koWmfStyleBrush[] =
00146     { Qt::SolidPattern,
00147       Qt::NoBrush,
00148       Qt::FDiagPattern,   /* hatched */
00149       Qt::Dense4Pattern,  /* should be custom bitmap pattern */
00150       Qt::HorPattern,     /* should be BS_INDEXED (?) */
00151       Qt::VerPattern,     /* should be device-independent bitmap */
00152       Qt::Dense6Pattern,  /* should be device-independent packed-bitmap */
00153       Qt::Dense2Pattern,  /* should be BS_PATTERN8x8 */
00154       Qt::Dense3Pattern   /* should be device-independent BS_DIBPATTERN8x8 */
00155     };
00156 
00157     static const Qt::PenStyle koWmfStylePen[] =
00158     { Qt::SolidLine, Qt::DashLine, Qt::DotLine, Qt::DashDotLine, Qt::DashDotDotLine,
00159       Qt::NoPen, Qt::SolidLine };
00160 
00161 #endif
00162 

Généré le Wed Nov 22 23:41:13 2006 pour KPlato par  doxygen 1.5.1-p1