00001
00002
00003
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;
00017 Q_UINT16 headerSize;
00018 Q_UINT16 version;
00019 Q_UINT32 fileSize;
00020 Q_UINT16 numOfObjects;
00021 Q_UINT32 maxRecordSize;
00022 Q_UINT16 numOfParameters;
00023 };
00024
00025
00026 struct WmfPlaceableHeader
00027 {
00028 Q_UINT32 key;
00029 Q_UINT16 handle;
00030 Q_INT16 left;
00031 Q_INT16 top;
00032 Q_INT16 right;
00033 Q_INT16 bottom;
00034 Q_UINT16 inch;
00035 Q_UINT32 reserved;
00036 Q_UINT16 checksum;
00037 };
00038
00039
00040 struct WmfEnhMetaHeader
00041 {
00042 Q_UINT32 recordType;
00043 Q_UINT32 recordSize;
00044
00045 Q_INT32 boundsLeft;
00046 Q_INT32 boundsTop;
00047 Q_INT32 boundsRight;
00048 Q_INT32 boundsBottom;
00049 Q_INT32 frameLeft;
00050 Q_INT32 frameTop;
00051 Q_INT32 frameRight;
00052 Q_INT32 frameBottom;
00053 Q_UINT32 signature;
00054 Q_UINT32 version;
00055 Q_UINT32 size;
00056 Q_UINT32 numOfRecords;
00057 Q_UINT16 numHandles;
00058
00059 Q_UINT16 reserved;
00060 Q_UINT32 sizeOfDescription;
00061
00062 Q_UINT32 offsetOfDescription;
00063
00064 Q_UINT32 numPaletteEntries;
00065 Q_INT32 widthDevicePixels;
00066 Q_INT32 heightDevicePixels;
00067 Q_INT32 widthDeviceMM;
00068 Q_INT32 heightDeviceMM;
00069 };
00070
00071
00072 struct WmfMetaRecord
00073 {
00074 Q_UINT32 size;
00075 Q_UINT16 function;
00076 Q_UINT16 param[ 1 ];
00077 };
00078
00079
00080 struct WmfEnhMetaRecord
00081 {
00082 Q_UINT32 function;
00083 Q_UINT32 size;
00084 Q_UINT32 param[ 1 ];
00085 };
00086
00087
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,
00134 Qt::Dense4Pattern,
00135 Qt::HorPattern,
00136 Qt::VerPattern,
00137 Qt::Dense6Pattern,
00138 Qt::Dense2Pattern,
00139 Qt::Dense3Pattern
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