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.

110 lines
4.3 KiB

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