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.

138 lines
6.0 KiB

  1. /****************************************************************************/
  2. /* acmapi.h */
  3. /* */
  4. /* Cursor Manager API Header File. */
  5. /* */
  6. /* Copyright(c) Microsoft, PictureTel 1992-1996 */
  7. /* Copyright (c) Microsoft 1997-1999 */
  8. /****************************************************************************/
  9. #ifndef _H_ACMAPI
  10. #define _H_ACMAPI
  11. // Default capabilities.
  12. #define CM_DEFAULT_TX_CACHE_ENTRIES 25
  13. #define CM_DEFAULT_RX_CACHE_ENTRIES 25
  14. /****************************************************************************/
  15. /* Maximum cursor sizes. */
  16. /****************************************************************************/
  17. #define CM_MAX_CURSOR_WIDTH 32
  18. #define CM_MAX_CURSOR_HEIGHT 32
  19. /****************************************************************************/
  20. /* This is the maximum size of the cursor data for the combined 1bpp AND */
  21. /* mask and n bpp XOR mask. We currently allow for a 32x32 cursor at */
  22. /* 32bpp. In this case the AND mask consumes 32*32/8 bytes (128) and the */
  23. /* XOR mask consumes 32*32*4 (4096) bytes. */
  24. /****************************************************************************/
  25. #define CM_MAX_CURSOR_DATA_SIZE \
  26. ((CM_MAX_CURSOR_WIDTH * CM_MAX_CURSOR_HEIGHT * 33)/8)
  27. #define CURSOR_AND_MASK_SIZE(pCursorShape) \
  28. ((pCursorShape)->hdr.cbMaskRowWidth * (pCursorShape)->hdr.cy)
  29. #define ROW_WORD_PAD(cbUnpaddedRow) \
  30. (((cbUnpaddedRow) + 1) & ~1)
  31. #define CURSOR_DIB_BITS_SIZE(cx, cy, bpp) \
  32. ((((cx) * (bpp) + 15) & ~15) / 8 * (cy))
  33. #define CURSOR_XOR_BITMAP_SIZE(pCursorShape) \
  34. (CURSOR_DIB_BITS_SIZE((pCursorShape)->hdr.cx, (pCursorShape)->hdr.cy, \
  35. (pCursorShape)->hdr.cBitsPerPel))
  36. #define CURSORSHAPE_SIZE(pCursorShape) \
  37. sizeof(CM_CURSORSHAPEHDR) + \
  38. CURSOR_AND_MASK_SIZE(pCursorShape) + \
  39. CURSOR_XOR_BITMAP_SIZE(pCursorShape)
  40. /****************************************************************************/
  41. /* Null cursor indications */
  42. /****************************************************************************/
  43. #define CM_CURSOR_IS_NULL(pCursor) ((((pCursor)->hdr.cPlanes==(BYTE)0xFF) && \
  44. (pCursor)->hdr.cBitsPerPel == (BYTE)0xFF))
  45. #define CM_SET_NULL_CURSOR(pCursor) (pCursor)->hdr.cPlanes = 0xFF; \
  46. (pCursor)->hdr.cBitsPerPel = 0xFF;
  47. /****************************************************************************/
  48. /* Windows CURSORSHAPE definitions */
  49. /****************************************************************************/
  50. typedef struct _CM_CURSORSHAPEHDR
  51. {
  52. POINT ptHotSpot;
  53. WORD cx;
  54. WORD cy;
  55. WORD cbMaskRowWidth;
  56. unsigned cbColorRowWidth;
  57. BYTE cPlanes;
  58. BYTE cBitsPerPel;
  59. } CM_CURSORSHAPEHDR, *PCM_CURSORSHAPEHDR;
  60. typedef struct _CM_CURSORSHAPE
  61. {
  62. CM_CURSORSHAPEHDR hdr;
  63. BYTE Masks[1]; /* 1bpp AND mask, followed by n bpp XOR mask */
  64. } CM_CURSORSHAPE, *PCM_CURSORSHAPE;
  65. typedef struct tagCM_CURSOR_SHAPE_DATA
  66. {
  67. CM_CURSORSHAPEHDR hdr;
  68. BYTE data[CM_MAX_CURSOR_DATA_SIZE];
  69. } CM_CURSOR_SHAPE_DATA, *PCM_CURSOR_SHAPE_DATA;
  70. /****************************************************************************/
  71. /* Structure: CM_SHARED_DATA */
  72. /* */
  73. /* Description: Shared memory data - cursor description and usage flag */
  74. /* */
  75. /* cmCursorStamp - Cursor identifier: an integer written by the */
  76. /* display driver */
  77. /* cmCacheSize - number of entries required in cursor cache */
  78. /* cmCacheHit - cursor was found in the cache */
  79. /* cmBitsWaiting - there are bits waiting to be sent - set by the DD */
  80. /* and cleared by the WD */
  81. /* cmCacheEntry - cache entry to send */
  82. /* cmCursorShapeData - Cursor definition (AND, XOR masks, etc) */
  83. /* cmCursorPos - Pointer coords */
  84. /* cmCursorMoved - Flag indicating that cursor moved */
  85. /* cmHidden - Set if cursor hidden */
  86. /* cmNativeColor - Flag indicating that can use native cursor color */
  87. /* depth */
  88. #ifdef DC_HICOLOR
  89. /* cmSendAnyColor - Flag indicating that cursors may be sent at any */
  90. /* color depth, ie including 15/16bpp */
  91. #endif
  92. /* */
  93. /****************************************************************************/
  94. typedef struct tagCM_SHARED_DATA
  95. {
  96. UINT32 cmCursorStamp;
  97. UINT32 cmCacheSize;
  98. BOOLEAN cmCacheHit;
  99. BOOLEAN cmBitsWaiting;
  100. BOOLEAN cmCursorMoved;
  101. BOOLEAN cmHidden;
  102. BOOLEAN cmNativeColor;
  103. #ifdef DC_HICOLOR
  104. BOOLEAN cmSendAnyColor;
  105. #endif
  106. UINT32 cmCacheEntry;
  107. POINTL cmCursorPos;
  108. CM_CURSOR_SHAPE_DATA cmCursorShapeData; // Needs to be last for memset in CM_InitShm()
  109. } CM_SHARED_DATA, *PCM_SHARED_DATA;
  110. #endif /* #ifndef _H_ACMAPI */