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.

162 lines
5.4 KiB

  1. #ifndef _NEW_WSBCONTROL_H
  2. #define _NEW_WSBCONTROL_H
  3. //
  4. // When a screen reader is running, we switch to system metrics rather
  5. // than using the app metrics. All the metrics are kept in this structure
  6. // so we can switch between them easily.
  7. //
  8. typedef struct WSBMETRICS {
  9. int cxVSBArrow; // x size of arrow for vertical scrollbar.
  10. int cxHSBArrow;
  11. int cxHSBThumb;
  12. int cyVSBArrow;
  13. int cyHSBArrow;
  14. int cyVSBThumb;
  15. } WSBMETRICS, *PWSBMETRICS;
  16. typedef struct WSBState {
  17. PWSBMETRICS pmet; // The metrics that are active
  18. int style; // Win style.
  19. // px: Current coord. Used in Tracking.
  20. int px; // Mouse message coord.
  21. int pxStart; // back to pxStart if tracking out of box.
  22. int dpxThumb; // pxThumbTop - px
  23. int pxBottom;
  24. int pxDownArrow;
  25. int pxLeft;
  26. int pxOld;
  27. int pxRight;
  28. int pxThumbBottom;
  29. int pxThumbTop;
  30. int pxTop;
  31. int pxUpArrow;
  32. int cpxThumb; // cpx: Current size.
  33. int cpxArrow;
  34. int cpxSpace;
  35. int cmdSB; // Current scroll command.
  36. int posOld; // Thumb pos of last time.
  37. int posNew; // To support GetScrollInfo with SIF_TRACKPOS
  38. int posStart; // Thumb pos when we start tracking.
  39. void ( * pfnSB )(struct WSBState *, int, WPARAM, LPARAM);
  40. BOOL fVertSB; // This variable shows if the last valid
  41. // computation is on Vertical SB.
  42. BOOL fHitOld;
  43. BOOL fTrackVert; // This variable shows which scrollbar we are
  44. // tracking.
  45. BOOL fTracking; // Critical section lock for locMouse.
  46. BOOL fVActive; // Is mouse hovering on vertical SB?
  47. BOOL fHActive;
  48. int fInDoScroll; // Are we in the middle of a DoScroll?
  49. UINT_PTR hTimerSB;
  50. UINT_PTR hTrackSB;
  51. RECT rcSB;
  52. RECT rcClient;
  53. RECT rcTrack;
  54. int vStyle; // Style.
  55. int hStyle;
  56. #define WSB_MOUSELOC_OUTSIDE 0
  57. #define WSB_MOUSELOC_ARROWUP 1
  58. #define WSB_MOUSELOC_ARROWDN 2
  59. #define WSB_MOUSELOC_V_THUMB 3
  60. #define WSB_MOUSELOC_V_GROOVE 4
  61. #define WSB_MOUSELOC_ARROWLF 5
  62. #define WSB_MOUSELOC_ARROWRG 6
  63. #define WSB_MOUSELOC_H_THUMB 7
  64. #define WSB_MOUSELOC_H_GROOVE 8
  65. POINT ptMouse; // to left-top corner of window
  66. int locMouse;
  67. COLORREF col_VSBBkg;
  68. COLORREF col_HSBBkg;
  69. HBRUSH hbr_VSBBkg;
  70. HBRUSH hbr_HSBBkg;
  71. HBRUSH hbr_Bkg;
  72. HBITMAP hbm_Bkg;
  73. HPALETTE hPalette;
  74. HWND sbHwnd;
  75. int sbFlags;
  76. int sbHMinPos;
  77. int sbHMaxPos;
  78. int sbHPage;
  79. int sbHThumbPos;
  80. int sbVMinPos;
  81. int sbVMaxPos;
  82. int sbVPage;
  83. int sbVThumbPos;
  84. int sbGutter;
  85. //
  86. // Since OLEACC assumes that all scrollbars are the standard size,
  87. // we revert to normal-sized scrollbars when a screenreader is running.
  88. // The pmet member tells us which of these two is the one to use.
  89. WSBMETRICS metApp; // The metrics the app selected
  90. WSBMETRICS metSys; // The metrics from the system
  91. } WSBState;
  92. //
  93. // These macros let you get at the current metrics without realizing that
  94. // they could be shunted between the app metrics and system metrics.
  95. //
  96. #define x_VSBArrow pmet->cxVSBArrow
  97. #define x_HSBArrow pmet->cxHSBArrow
  98. #define x_HSBThumb pmet->cxHSBThumb
  99. #define y_VSBArrow pmet->cyVSBArrow
  100. #define y_HSBArrow pmet->cyHSBArrow
  101. #define y_VSBThumb pmet->cyVSBThumb
  102. #define WSB_HORZ_LF 0x0001 // Represents the Left arrow of the horizontal scroll bar.
  103. #define WSB_HORZ_RT 0x0002 // Represents the Right arrow of the horizontal scroll bar.
  104. #define WSB_VERT_UP 0x0004 // Represents the Up arrow of the vert scroll bar.
  105. #define WSB_VERT_DN 0x0008 // Represents the Down arrow of the vert scroll bar.
  106. #define WSB_VERT (WSB_VERT_UP | WSB_VERT_DN)
  107. #define WSB_HORZ (WSB_HORZ_LF | WSB_HORZ_RT)
  108. #define LTUPFLAG 0x0001
  109. #define RTDNFLAG 0x0002
  110. #define WFVPRESENT 0x00000002L
  111. #define WFHPRESENT 0x00000004L
  112. #define SBO_MIN 0
  113. #define SBO_MAX 1
  114. #define SBO_PAGE 2
  115. #define SBO_POS 3
  116. #define TestSTYLE(STYLE, MASK) ((STYLE) & (MASK))
  117. #define DMultDiv(A, B, C) (((C) == 0)? (A):(MulDiv((A), (B), (C))))
  118. #define VMODE(WSTATE) ((WSTATE)->vStyle == FSB_FLAT_MODE) ? (WSTATE)->vMode \
  119. :(((WSTATE)->vStyle == FSB_ENCARTA_MODE)? \
  120. WSB_2D_MODE : WSB_3D_MODE))
  121. #define HMODE(WSTATE) ((WSTATE)->hStyle == FSB_FLAT_MODE) ? (WSTATE)->hMode \
  122. :(((WSTATE)->hStyle == FSB_ENCARTA_MODE)? \
  123. WSB_2D_MODE : WSB_3D_MODE))
  124. #define ISINACTIVE(WSTATE) ((WSTATE) == WSB_UNINIT_HANDLE || (WSTATE)->fScreenRead)
  125. // This IDSYS_SCROLL has the same value we used in 'user' code.
  126. #define IDSYS_SCROLL 0x0000FFFEL
  127. // Following ID is for tracking. I hope it won't conflict with
  128. // interest of anybody else.
  129. // IDWSB_TRACK is now following the ID_MOUSExxxx we use in TrackMe.c
  130. #define IDWSB_TRACK 0xFFFFFFF2L
  131. #define MINITHUMBSIZE 10
  132. #define WSB_SYS_FONT TEXT("MARLETT")
  133. #define WSB_UNINIT_HANDLE ((WSBState *)-1)
  134. #endif // _NEW_WSBCONTROL_H