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.

129 lines
5.1 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: lines.h
  3. *
  4. * Line drawing constants and structures.
  5. *
  6. * Copyright (c) 1992-1995 Microsoft Corporation
  7. \**************************************************************************/
  8. // This is the default QVision line command for drawing integer lines.
  9. //
  10. // The line command register is sticky, meaning that the settings for
  11. // the current line will affect any future point-to-point lines, so
  12. // we want to always keep our preferred values for doing integer
  13. // point-to-point lines:
  14. #define DEFAULT_LINE_CMD (USE_AXIAL_WHEN_ZERO | \
  15. RETAIN_PATTERN_PTR | \
  16. NO_KEEP_X0_Y0 | \
  17. CALC_ONLY | \
  18. START_LINE)
  19. typedef struct _PDEV PDEV; // Handy forward declaration
  20. typedef LONG STYLEPOS;
  21. #define STYLE_MAX_COUNT 16
  22. #define STYLE_MAX_VALUE 0x3fffL
  23. #define RUN_MAX 20
  24. #define STRIP_MAX 100
  25. #define STYLE_DENSITY 3
  26. // Flip and round flags:
  27. #define FL_H_ROUND_DOWN 0x00000080L // .... .... 1... ....
  28. #define FL_V_ROUND_DOWN 0x00008000L // 1... .... .... ....
  29. #define FL_FLIP_D 0x00000005L // .... .... .... .1.1
  30. #define FL_FLIP_V 0x00000008L // .... .... .... 1...
  31. #define FL_FLIP_SLOPE_ONE 0x00000010L // .... .... ...1 ....
  32. #define FL_FLIP_HALF 0x00000002L // .... .... .... ..1.
  33. #define FL_FLIP_H 0x00000200L // .... ..1. .... ....
  34. #define FL_ROUND_MASK 0x0000001CL // .... .... ...1 11..
  35. #define FL_ROUND_SHIFT 2
  36. #define FL_RECTLCLIP_MASK 0x0000000CL // .... .... .... 11..
  37. #define FL_RECTLCLIP_SHIFT 2
  38. #define FL_STRIP_MASK 0x00000003L // .... .... .... ..11
  39. #define FL_STRIP_SHIFT 0
  40. #define FL_SIMPLE_CLIP 0x00000020 // .... .... ..1. ....
  41. #define FL_COMPLEX_CLIP 0x00000040 // .... .... .1.. ....
  42. #define FL_CLIP (FL_SIMPLE_CLIP | FL_COMPLEX_CLIP)
  43. #define FL_STYLED 0x00000400L // .... .1.. .... ....
  44. #define FL_ALTERNATESTYLED 0x00001000L // ...1 .... .... ....
  45. #define FL_STYLE_MASK 0x00000400L
  46. #define FL_STYLE_SHIFT 10
  47. #define FL_LAST_PEL_INCLUSIVE 0x00002000L // ..1. .... .... ....
  48. // Miscellaneous DDA defines:
  49. #define LROUND(x, flRoundDown) (((x) + F/2 - ((flRoundDown) > 0)) >> 4)
  50. #define F 16
  51. #define FLOG2 4
  52. #define LFLOOR(x) ((x) >> 4)
  53. #define FXFRAC(x) ((x) & (F - 1))
  54. ////////////////////////////////////////////////////////////////////////////
  55. // NOTE: The following structures must exactly match those declared in
  56. // lines.inc!
  57. typedef struct _STRIP {
  58. LONG cStrips; // # of strips in array
  59. LONG flFlips; // Indicates if line goes up or down
  60. POINTL ptlStart; // first point
  61. LONG alStrips[STRIP_MAX]; // Array of strips
  62. } STRIP;
  63. typedef struct _LINESTATE {
  64. STYLEPOS* pspStart; // Pointer to start of style array
  65. STYLEPOS* pspEnd; // Pointer to end of style array
  66. STYLEPOS* psp; // Pointer to current style entry
  67. STYLEPOS spRemaining; // To go in current style
  68. STYLEPOS spTotal; // Sum of style array
  69. STYLEPOS spTotal2; // Twice sum of style array
  70. STYLEPOS spNext; // Style state at start of next line
  71. STYLEPOS spComplex; // Style state at start of complex clip line
  72. STYLEPOS* aspRtoL; // Style array in right-to-left order
  73. STYLEPOS* aspLtoR; // Style array in left-to-right order
  74. ULONG ulStyleMask; // Are we working on a gap in the style?
  75. // 0xff if yes, 0x0 if not
  76. ULONG xyDensity; // Density of style
  77. ULONG cStyle; // Size of style array
  78. ULONG ulStyleMaskLtoR;// Original style mask, left-to-right order
  79. ULONG ulStyleMaskRtoL;// Original style mask, right-to-left order
  80. BOOL ulStartMask; // Determines if first element in style
  81. // array is for a gap or a dash
  82. } LINESTATE; /* ls */
  83. // Strip drawer prototype:
  84. typedef VOID (*PFNSTRIP)(PDEV*, STRIP*, LINESTATE*);
  85. // Strip drawers:
  86. VOID vIoStripSolidHorizontal(PDEV*, STRIP*, LINESTATE*);
  87. VOID vIoStripSolidVertical(PDEV*, STRIP*, LINESTATE*);
  88. VOID vIoStripSolidDiagonalHorizontal(PDEV*, STRIP*, LINESTATE*);
  89. VOID vIoStripSolidDiagonalVertical(PDEV*, STRIP*, LINESTATE*);
  90. VOID vIoStripStyledHorizontal(PDEV*, STRIP*, LINESTATE*);
  91. VOID vIoStripStyledVertical(PDEV*, STRIP*, LINESTATE*);
  92. VOID vMmStripSolidHorizontal(PDEV*, STRIP*, LINESTATE*);
  93. VOID vMmStripSolidVertical(PDEV*, STRIP*, LINESTATE*);
  94. VOID vMmStripSolidDiagonalHorizontal(PDEV*, STRIP*, LINESTATE*);
  95. VOID vMmStripSolidDiagonalVertical(PDEV*, STRIP*, LINESTATE*);
  96. VOID vMmStripStyledHorizontal(PDEV*, STRIP*, LINESTATE*);
  97. VOID vMmStripStyledVertical(PDEV*, STRIP*, LINESTATE*);