Source code of Windows XP (NT5)
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.

154 lines
3.5 KiB

  1. /****************************************************************************
  2. Unit Cache; Interface
  3. *****************************************************************************
  4. Module Prefix: Ca
  5. *****************************************************************************/
  6. #define CaEmpty 0
  7. #define CaLine 1
  8. #define CaRectangle 2
  9. #define CaRoundRect 3
  10. #define CaEllipse 4
  11. #define CaArc 5
  12. #define CaPie 6
  13. #define CaPolygon 7
  14. #define CaPolyLine 8
  15. typedef struct
  16. {
  17. Word type;
  18. Word verb;
  19. union
  20. {
  21. struct
  22. {
  23. Point start;
  24. Point end;
  25. Point pnSize;
  26. } line;
  27. struct
  28. {
  29. Rect bbox;
  30. Point oval;
  31. } rect;
  32. struct
  33. {
  34. Rect bbox;
  35. Point start;
  36. Point end;
  37. } arc;
  38. struct
  39. {
  40. Integer numPoints;
  41. Point far * pointList;
  42. Point pnSize;
  43. } poly;
  44. } a;
  45. } CaPrimitive, far * CaPrimitiveLPtr;
  46. /*********************** Exported Function Definitions **********************/
  47. void CaInit( Handle metafile );
  48. /* initialize the gdi cache module */
  49. void CaFini( void );
  50. /* close down the cache module */
  51. void CaSetMetafileDefaults( void );
  52. /* Set up any defaults that will be used throughout the metafile context */
  53. Word CaGetCachedPrimitive( void );
  54. /* return the current cached primitive type */
  55. void CaSamePrimitive( Boolean same );
  56. /* indicate whether next primitive is the same or new */
  57. void CaMergePen( Word verb );
  58. /* indicate that next pen should be merged with previous logical pen */
  59. void CaCachePrimitive( CaPrimitiveLPtr primLPtr );
  60. /* Cache the primitive passed down. This includes the current pen and brush. */
  61. void CaFlushCache( void );
  62. /* Flush the current primitive stored in the cache */
  63. void CaFlushAttributes( void );
  64. /* flush any pending attribute elements */
  65. void CaCreatePenIndirect( LOGPEN far * newLogPen );
  66. /* create a new pen */
  67. void CaCreateBrushIndirect( LOGBRUSH far * newLogBrush );
  68. /* Create a new logical brush using structure passed in */
  69. void CaCreateFontIndirect( LOGFONT far * newLogFont );
  70. /* create the logical font passed as paramter */
  71. void CaSetBkMode( Word mode );
  72. /* set the backgound transfer mode */
  73. void CaSetROP2( Word ROP2Code );
  74. /* set the transfer ROP mode according to ROP2Code */
  75. void CaSetStretchBltMode( Word mode );
  76. /* stretch blt mode - how to preserve scanlines using StretchDIBits() */
  77. void CaSetTextAlign( Word txtAlign );
  78. /* set text alignment according to parameter */
  79. void CaSetTextColor( RGBColor txtColor );
  80. /* set the text color if different from current setting */
  81. void CaSetTextCharacterExtra( Integer chExtra );
  82. /* set the character extra spacing */
  83. void CaSetBkColor( RGBColor bkColor );
  84. /* set background color if different from current setting */
  85. Boolean CaIntersectClipRect( Rect rect );
  86. /* Create new clipping rectangle - return FALSE if drawing is disabled */
  87. void CaSetClipRect( Rect rect );
  88. /* set the current cliprectangle to be equal to rect */
  89. Rect far * CaGetClipRect( void );
  90. /* return the current cached clip rectangle */
  91. void CaNonRectangularClip( void );
  92. /* notify cache that a non-rectangular clipping region was set */
  93. void CaSaveDC( void );
  94. /* save the current device context - used to set up clipping rects */
  95. void CaRestoreDC( void );
  96. /* restore the device context and invalidate cached attributes */