Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
4.9 KiB

  1. /****************************************************************************
  2. Module Quickdrw; Interface
  3. *****************************************************************************
  4. This is the main module interface to the data stream interpreter. As such,
  5. it will read individual opcode elements and the appropriate data
  6. parameters associated with that opocode. These are either placed into
  7. the CGrafPort structure or calls are made to the Gdi module to issue
  8. the correct metafile function.
  9. Module prefix: QD
  10. ****************************************************************************/
  11. /*--- Source transfer modes ---*/
  12. #define QDSrcCopy 0
  13. #define QDSrcOr 1
  14. #define QDSrcXor 2
  15. #define QDSrcBic 3
  16. #define QDNotSrcCopy 4
  17. #define QDNotSrcOr 5
  18. #define QDNotSrcXor 6
  19. #define QDNotSrcBic 7
  20. /*--- Pattern transfer modes ---*/
  21. #define QDPatCopy 8
  22. #define QDPatOr 9
  23. #define QDPatXor 10
  24. #define QDPatBic 11
  25. #define QDNotPatCopy 12
  26. #define QDNotPatOr 13
  27. #define QDNotPatXor 14
  28. #define QDNotPatBic 15
  29. /*--- Arithmetic transfer modes ---*/
  30. #define QDBlend 32
  31. #define QDAddPin 33
  32. #define QDAddOver 34
  33. #define QDSubPin 35
  34. #define QDTransparent 36
  35. #define QDAdMax 37
  36. #define QDSubOver 38
  37. #define QDAdMin 39
  38. /*--- Undocumented hidden transfer mode ---*/
  39. #define QDHidePen 23
  40. /*--- Font styles ---*/
  41. #define QDTxBold 0x01
  42. #define QDTxItalic 0x02
  43. #define QDTxUnderline 0x04
  44. #define QDTxOutline 0x08
  45. #define QDTxShadow 0x10
  46. #define QDTxCondense 0x20
  47. #define QDTxExtend 0x40
  48. /*--- LaserWriter Text attributes ---*/
  49. #define QDAlignNone 0x00
  50. #define QDAlignLeft 0x01
  51. #define QDAlignCenter 0x02
  52. #define QDAlignRight 0x03
  53. #define QDAlignJustified 0x04
  54. #define QDFlipNone 0x00
  55. #define QDFlipHorizontal 0x01
  56. #define QDFlipVertical 0x02
  57. /*--- Polygon and Region structure sizes ---*/
  58. #define PolyHeaderSize (sizeofMacWord + sizeofMacRect)
  59. #define RgnHeaderSize (sizeofMacWord + sizeofMacRect)
  60. /*--- PixelMap structure ---*/
  61. #define PixelMapBit 0x8000
  62. #define RowBytesMask 0x7FFF
  63. typedef struct
  64. {
  65. Integer rowBytes;
  66. Rect bounds;
  67. Integer pmVersion;
  68. Word packType;
  69. LongInt packSize;
  70. Fixed hRes;
  71. Fixed vRes;
  72. Integer pixelType;
  73. Integer pixelSize;
  74. Integer cmpCount;
  75. Integer cmpSize;
  76. LongInt planeBytes;
  77. Handle pmTable;
  78. Word pmTableSlop;
  79. LongInt pmReserved;
  80. } PixMap, far * PixMapLPtr;
  81. /*--- Pixel Pattern structure ---*/
  82. #define QDOldPat 0
  83. #define QDNewPat 1
  84. #define QDDitherPat 2
  85. typedef Byte Pattern[8];
  86. typedef struct
  87. {
  88. Integer patType;
  89. PixMap patMap;
  90. Handle patData;
  91. Pattern pat1Data;
  92. } PixPat, far * PixPatLPtr;
  93. /*--- Miscellaneous type declarations ---*/
  94. #define RgnHandle Handle
  95. #define PixPatHandle Handle
  96. #define RGBColor COLORREF
  97. /*--- Color Table structure ---*/
  98. typedef struct
  99. {
  100. LongInt ctSeed;
  101. Word ctFlags;
  102. Word ctSize;
  103. RGBColor ctColors[1];
  104. } ColorTable, far * ColorTableLPtr;
  105. /*--- QuickDraw grafPort simulation ---*/
  106. typedef struct
  107. {
  108. Integer portVersion;
  109. Integer chExtra;
  110. Integer pnLocHFrac;
  111. Rect portRect;
  112. RgnHandle clipRgn;
  113. PixPat bkPixPat;
  114. RGBColor rgbFgColor;
  115. RGBColor rgbBkColor;
  116. Point pnLoc;
  117. Point pnSize;
  118. Integer pnMode;
  119. PixPat pnPixPat;
  120. PixPat fillPixPat;
  121. Integer pnVis;
  122. Integer txFont;
  123. Byte txFace;
  124. Integer txMode;
  125. Integer txSize;
  126. Fixed spExtra;
  127. Handle rgnSave;
  128. Handle polySave;
  129. Byte txFontName[32];
  130. Point txLoc;
  131. Point txNumerator;
  132. Point txDenominator;
  133. Integer txRotation;
  134. Byte txFlip;
  135. } CGrafPort, far * CGrafPortLPtr;
  136. /**************************** Exported Operations ***************************/
  137. void QDConvertPicture( Handle dialogHandle );
  138. /* create a Windows metafile using the previously set parameters, returning
  139. the converted picture information in the pictResult structure. */
  140. void QDGetPort( CGrafPort far * far * port );
  141. /* return handle to grafPort structure */
  142. void QDCopyBytes( Byte far * src, Byte far * dest, Integer numBytes );
  143. /* copy a data from source to destination */