lib Library API Documentation

kowmfstruct.h

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 00011 #define APMHEADER_KEY 0x9AC6CDD7 00012 #define ENHMETA_SIGNATURE 0x464D4520 00013 00014 struct WmfMetaHeader 00015 { 00016 Q_UINT16 fileType; // Type of metafile (0=memory, 1=disk) 00017 Q_UINT16 headerSize; // always 9 00018 Q_UINT16 version; 00019 Q_UINT32 fileSize; // Total size of the metafile in WORDs 00020 Q_UINT16 numOfObjects; // Maximum Number of objects in the stack 00021 Q_UINT32 maxRecordSize; // The size of largest record in WORDs 00022 Q_UINT16 numOfParameters; // not used (always 0) 00023 }; 00024 00025 00026 struct WmfPlaceableHeader 00027 { 00028 Q_UINT32 key; // Magic number (always 9AC6CDD7h) 00029 Q_UINT16 handle; // Metafile HANDLE number (always 0) 00030 Q_INT16 left; // Left coordinate in metafile units 00031 Q_INT16 top; 00032 Q_INT16 right; 00033 Q_INT16 bottom; 00034 Q_UINT16 inch; // Number of metafile units per inch 00035 Q_UINT32 reserved; 00036 Q_UINT16 checksum; // Checksum value for previous 10 WORDs 00037 }; 00038 00039 00040 struct WmfEnhMetaHeader 00041 { 00042 Q_UINT32 recordType; // Record type (is always 00000001h) 00043 Q_UINT32 recordSize; // Record size in bytes. This may be greater 00044 // than the sizeof( ENHMETAHEADER ). 00045 Q_INT32 boundsLeft; // Inclusive-inclusive bounds in device units 00046 Q_INT32 boundsTop; 00047 Q_INT32 boundsRight; 00048 Q_INT32 boundsBottom; 00049 Q_INT32 frameLeft; // Inclusive-inclusive Picture Frame 00050 Q_INT32 frameTop; 00051 Q_INT32 frameRight; 00052 Q_INT32 frameBottom; 00053 Q_UINT32 signature; // Signature. Must be ENHMETA_SIGNATURE. 00054 Q_UINT32 version; // Version number 00055 Q_UINT32 size; // Size of the metafile in bytes 00056 Q_UINT32 numOfRecords; // Number of records in the metafile 00057 Q_UINT16 numHandles; // Number of handles in the handle table 00058 // Handle index zero is reserved. 00059 Q_UINT16 reserved; // always 0 00060 Q_UINT32 sizeOfDescription; // Number of chars in the unicode description string 00061 // This is 0 if there is no description string 00062 Q_UINT32 offsetOfDescription; // Offset to the metafile description record. 00063 // This is 0 if there is no description string 00064 Q_UINT32 numPaletteEntries; // Number of color palette entries 00065 Q_INT32 widthDevicePixels; // Size of the reference device in pixels 00066 Q_INT32 heightDevicePixels; 00067 Q_INT32 widthDeviceMM; // Size of the reference device in millimeters 00068 Q_INT32 heightDeviceMM; 00069 }; 00070 00071 00072 struct WmfMetaRecord 00073 { 00074 Q_UINT32 size; // Total size of the record in WORDs 00075 Q_UINT16 function; // Record function number 00076 Q_UINT16 param[ 1 ]; // Q_UINT16 array of parameters 00077 }; 00078 00079 00080 struct WmfEnhMetaRecord 00081 { 00082 Q_UINT32 function; // Record function number 00083 Q_UINT32 size; // Record size in bytes 00084 Q_UINT32 param[ 1 ]; // Q_UINT32 array of parameters 00085 }; 00086 00087 // Static data 00088 static const struct OpTab 00089 { 00090 Q_UINT32 winRasterOp; 00091 Qt::RasterOp qtRasterOp; 00092 } koWmfOpTab32[] = 00093 { 00094 { 0x00CC0020, Qt::CopyROP }, 00095 { 0x00EE0086, Qt::OrROP }, 00096 { 0x008800C6, Qt::AndROP }, 00097 { 0x00660046, Qt::XorROP }, 00098 { 0x00440328, Qt::AndNotROP }, 00099 { 0x00330008, Qt::NotCopyROP }, 00100 { 0x001100A6, Qt::NandROP }, 00101 { 0x00C000CA, Qt::CopyROP }, 00102 { 0x00BB0226, Qt::NotOrROP }, 00103 { 0x00F00021, Qt::CopyROP }, 00104 { 0x00FB0A09, Qt::CopyROP }, 00105 { 0x005A0049, Qt::CopyROP }, 00106 { 0x00550009, Qt::NotROP }, 00107 { 0x00000042, Qt::ClearROP }, 00108 { 0x00FF0062, Qt::SetROP } 00109 }; 00110 00111 static const Qt::RasterOp koWmfOpTab16[] = 00112 { 00113 Qt::CopyROP, 00114 Qt::ClearROP, Qt::NandROP, Qt::NotAndROP, Qt::NotCopyROP, 00115 Qt::AndNotROP, Qt::NotROP, Qt::XorROP, Qt::NorROP, 00116 Qt::AndROP, Qt::NotXorROP, Qt::NopROP, Qt::NotOrROP, 00117 Qt::CopyROP, Qt::OrNotROP, Qt::OrROP, Qt::SetROP 00118 }; 00119 00120 static const Qt::BrushStyle koWmfHatchedStyleBrush[] = 00121 { 00122 Qt::HorPattern, 00123 Qt::VerPattern, 00124 Qt::FDiagPattern, 00125 Qt::BDiagPattern, 00126 Qt::CrossPattern, 00127 Qt::DiagCrossPattern 00128 }; 00129 00130 static const Qt::BrushStyle koWmfStyleBrush[] = 00131 { Qt::SolidPattern, 00132 Qt::NoBrush, 00133 Qt::FDiagPattern, /* hatched */ 00134 Qt::Dense4Pattern, /* should be custom bitmap pattern */ 00135 Qt::HorPattern, /* should be BS_INDEXED (?) */ 00136 Qt::VerPattern, /* should be device-independent bitmap */ 00137 Qt::Dense6Pattern, /* should be device-independent packed-bitmap */ 00138 Qt::Dense2Pattern, /* should be BS_PATTERN8x8 */ 00139 Qt::Dense3Pattern /* should be device-independent BS_DIBPATTERN8x8 */ 00140 }; 00141 00142 static const Qt::PenStyle koWmfStylePen[] = 00143 { Qt::SolidLine, Qt::DashLine, Qt::DotLine, Qt::DashDotLine, Qt::DashDotDotLine, 00144 Qt::NoPen, Qt::SolidLine }; 00145 00146 #endif 00147
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 28 04:04:03 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003