summaryrefslogtreecommitdiffstats
path: root/ktnef/gui/wmfstruct.h
blob: 7400e896e289286b41ef867a3dcb129f05e2b20c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* WMF Metafile Structures
 * Author: Stefan Taferner <taferner@kde.org>
 */
#ifndef wmfstruct_h
#define wmfstruct_h

typedef short WORD;
typedef int DWORD;
typedef TQ_INT32 LONG;
typedef void* _HANDLE;

typedef struct _RECT
{
    WORD left;
    WORD top;
    WORD right;
    WORD bottom;
} RECT;

typedef struct _RECTL
{
    LONG left;
    LONG top;
    LONG right;
    LONG bottom;
} RECTL;

typedef struct _SIZE
{
    WORD width;
    WORD height;
} SIZE;

typedef struct _SIZEL
{
    LONG width;
    LONG height;
} SIZEL;


struct WmfEnhMetaHeader
{
    DWORD   iType;              // Record type EMR_HEADER
    DWORD   nSize;              // Record size in bytes.  This may be greater
    // than the sizeof( ENHMETAHEADER ).
    RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
    RECTL   rclFrame;           // Inclusive-inclusive Picture Frame of metafile
    // in .01 mm units
    DWORD   dSignature;         // Signature.  Must be ENHMETA_SIGNATURE.
    DWORD   nVersion;           // Version number
    DWORD   nBytes;             // Size of the metafile in bytes
    DWORD   nRecords;           // Number of records in the metafile
    WORD    nHandles;           // Number of handles in the handle table
    // Handle index zero is reserved.
    WORD    sReserved;          // Reserved.  Must be zero.
    DWORD   nDescription;       // Number of chars in the unicode description string
    // This is 0 if there is no description string
    DWORD   offDescription;     // Offset to the metafile description record.
    // This is 0 if there is no description string
    DWORD   nPalEntries;        // Number of entries in the metafile palette.
    SIZEL   szlDevice;          // Size of the reference device in pels
    SIZEL   szlMillimeters;     // Size of the reference device in millimeters
};
#define ENHMETA_SIGNATURE       0x464D4520


struct WmfMetaHeader
{
    WORD        mtType;
    WORD        mtHeaderSize;
    WORD        mtVersion;
    DWORD       mtSize;
    WORD        mtNoObjects;
    DWORD       mtMaxRecord;
    WORD        mtNoParameters;
};


struct WmfPlaceableHeader
{
    DWORD key;
    WORD hmf;
    RECT bbox;
    WORD inch;
    DWORD reserved;
    WORD checksum;
};
#define APMHEADER_KEY 0x9AC6CDD7


struct WmfMetaRecord
{
    DWORD rdSize;       // Record size ( in words ) of the function
    WORD  rdFunction;   // Record function number
    WORD  rdParm[ 1 ];  // WORD array of parameters
};


struct WmfEnhMetaRecord
{
    DWORD iType;        // Record type EMR_xxx
    DWORD nSize;        // Record size in bytes
    DWORD dParm[ 1 ];   // DWORD array of parameters
};


#endif /*wmfstruct_h*/