home *** CD-ROM | disk | FTP | other *** search
/ DTP Toolbox / DTPToolbox.iso / utilities / archiveutils / wmf.lha / src / wmf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-22  |  4.9 KB  |  199 lines

  1. /* 
  2. * $Log: wmf.h,v $
  3. * Revision 1.7  1994/06/26  18:03:53  JFusco
  4. * Fixed RGB_color_t type.  My documentation appears to be in error.
  5. *
  6. * Revision 1.6  1994/06/25  02:28:03  JFusco
  7. * Better fills (?).  Tries to match luminance of color values.
  8. *
  9. * Revision 1.5  1994/06/18  03:11:10  JFusco
  10. * Added enumerated types and more objects.  Deleted the global variable
  11. * declaration here and moved it into wmf.c where it belonged anyway.
  12. *
  13. * Revision 1.4  94/06/16  23:30:38  JFusco
  14. * Most structures are now types, added some new ones.
  15. * Revision 1.3  94/06/13  22:14:49  JFusco
  16. * Added more structures and corrected spelling.
  17. * Revision 1.2  94/06/13  07:47:59  JFusco
  18. * Added a function lookup table and removed test function prototypes.
  19. * Revision 1.1  94/06/12  23:04:50  JFusco
  20. * Initial revision
  21. */
  22.  
  23. #ifndef WMF_WMF_INC
  24. #define WMF_WMF_INC 1
  25. typedef unsigned short USHORT;
  26. typedef unsigned char  UBYTE;
  27. typedef unsigned long  ULONG;
  28.  
  29. #define WMF_Null                0
  30. #define WMF_AnimatePalette    0x436
  31. #define WMF_Arc            0x817
  32. #define WMF_BitBlt        0x922
  33. #define WMF_BitBlt3        0x940
  34. #define WMF_Chord        0x830
  35. #define WMF_CreateBrushIndirect    0x2fc
  36. #define WMF_CreateFontIndirect    0x2fb
  37. #define WMF_CreatePalette    0xf7
  38. #define WMF_CreatePatternBrush    0x1f9
  39. #define WMF_CreatePatternBrush3    0x142
  40. #define WMF_CreatePenIndirect    0x2fa
  41. #define WMF_CreateRegion    0x6ff
  42. #define WMF_DeleteObject    0x1f0
  43. #define WMF_DrawText        0x62f
  44. #define WMF_Ellipse        0x418
  45. #define WMF_Escape        0x626
  46. #define WMF_ExcludeClipRect    0x415
  47. #define WMF_ExtTextOut        0xa32
  48. #define WMF_FloodFill        0x419
  49. #define WMF_InsertClipRect    0x416
  50. #define WMF_LineTo        0x213
  51. #define WMF_MoveTo        0x214
  52. #define WMF_OffsetClipRgn    0x220
  53. #define WMF_OffsetViewportOrg    0x211
  54. #define WMF_OffsetWindowOrg    0x20f
  55. #define WMF_PatBlt        0x61d
  56. #define WMF_Pie            0x81a
  57. #define WMF_Polygon        0x324
  58. #define WMF_Polyline        0x325
  59. #define WMF_PolyPolygon        0x538
  60. #define WMF_RealizePalette    0x35
  61. #define WMF_Rectangle        0x41b
  62. #define WMF_ResizePalette    0x139
  63. #define WMF_RestoreDC        0x127
  64. #define WMF_RoundRect        0x61c
  65. #define WMF_SaveDC        0x01e
  66. #define WMF_ScaleViewportExt    0x412
  67. #define WMF_ScaleWindowExt    0x400
  68. #define WMF_SelectClipRgn    0x12c
  69. #define WMF_SelectObject    0x12d
  70. #define WMF_SelectPalette    0x234
  71. #define WMF_SetBkColor        0x201
  72. #define WMF_SetBkMode        0x102
  73. #define WMF_SetDIBitsToDevice    0xd33
  74. #define WMF_SetMapMode        0x103
  75. #define WMF_SetMapperFlags    0x231
  76. #define WMF_SetPaletteEntries    0x037
  77. #define WMF_SetPixel        0x41f
  78. #define WMF_SetPolyFillMode    0x106
  79. #define WMF_SetROP2        0x104
  80. #define WMF_SetStretchBltMode    0x107
  81. #define WMF_SetTextAlign    0x12e
  82. #define WMF_SetTextCharExtra    0x108
  83. #define WMF_SetTextColor    0x209
  84. #define WMF_SetTextJustification 0x20a
  85. #define WMF_SetViewportExt    0x20e
  86. #define WMF_SetViewportOrg    0x20d
  87. #define WMF_SetWindowExt    0x20c
  88. #define WMF_SetWindowOrg    0x20b
  89. #define WMF_StretchBlt        0xb23
  90. #define WMF_StretchBlt3        0xb41
  91. #define WMF_StretchDIBits    0xf43
  92. #define WMF_TextOut        0x521
  93.  
  94. typedef struct yx_pair {
  95.   short Y, X;
  96. } yx_pair_t;
  97.  
  98. struct xy_pair {
  99.   short X, Y;
  100. };
  101.  
  102. typedef struct RGB_color_ {
  103.   UBYTE Type, Blue, Green, Red;
  104. } RGB_color_t;
  105.  
  106. typedef struct Indexed_color_ {
  107.   UBYTE Type, garbage;
  108.   USHORT Index;
  109. } Indexed_color_t;
  110.  
  111. typedef union wmf_color_ {
  112.   RGB_color_t     RGB;
  113.   Indexed_color_t IDX;
  114. } wmf_color_t;
  115.  
  116. typedef struct wmf_hdr {
  117.   USHORT Type, 
  118.          Hsize, 
  119.          Ver;
  120.   ULONG  Fsize;
  121.   USHORT numHandles;
  122.   ULONG  Largest;
  123.   USHORT Notused;
  124. } wmf_hdr_t;
  125.  
  126. typedef struct wmf_place_hdr {
  127.   ULONG        ID;
  128.   short        unused0, Left, Top, Right, Bottom;
  129.   USHORT    pixelsPerInch;
  130.   ULONG        unused1;
  131.   USHORT    Checksum;
  132. } wmf_place_hdr_t;
  133.  
  134. struct rec_tmpl {
  135.   ULONG  Size;
  136.   USHORT Func;
  137.   short  Data[1];
  138. };
  139.  
  140. typedef struct poly_point_tmpl_ {
  141.   USHORT numPoints;
  142.   struct xy_pair Point[1];
  143. } poly_point_tmpl_t;
  144.  
  145. /* WMF Object Type definitions. */
  146.  
  147. typedef struct pen_ {
  148.   USHORT Style, Width, unused;
  149.   wmf_color_t  Color;
  150. } pen_t;
  151.  
  152. typedef struct brush_ {
  153.   USHORT Style;
  154.   wmf_color_t  Color;
  155.   USHORT HatchType;
  156. } brush_t;
  157.  
  158. typedef struct font_ {
  159.   USHORT Height, Width, 
  160.          Escapement, Orientation, Weight;
  161.   UBYTE  Italic, Underline, Strikeout,
  162.          CharacterSet, OutputPrecision, ClippingPrecision,
  163.          OutputQuality, PitchAndType, Name[32];
  164. } font_t;
  165.  
  166. typedef struct palette_ {
  167.   USHORT Version, NumEntries;
  168.   ULONG  *ColorReg;
  169. } palette_t;
  170.  
  171. typedef struct pattern_brush_ {
  172.   USHORT BitsWide, BitsHigh,   /* Bitmap is in an even number of bytes. */
  173.          BytesWide, BytesHigh, /* Always even. */
  174.          NumPlanes, 
  175.          PixelBitsPerPlane,    /* Always 1 ? */
  176.          unusedPointer;        /* Bitmap data follows!!! */
  177.   UBYTE  *Bitmap;
  178. } pattern_brush_t;
  179.  
  180. typedef struct pattern_brush3_ {
  181.   USHORT Type, Usage, 
  182.          *BitMapInfo; /* Lazzzzzzzzzzzzzzzzzy. */
  183. } pattern_brush3_t;
  184.  
  185. typedef enum wmf_objects_ { 
  186.          NOTANOBJ, BRUSH, FONT, PALETTE, PATTERNBRUSH, PATTERNBRUSH3, PEN
  187. } wmf_objects;
  188.  
  189. typedef struct wmf_handle_ {
  190.   USHORT      *Data;
  191.   wmf_objects Type;
  192. } wmf_handle_t;
  193.  
  194. #endif /* WMF_WMF_INC */
  195.