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.

201 lines
7.2 KiB

  1. /*
  2. * BTTNCUR.H
  3. * Buttons & Cursors Version 1.1, March 1993
  4. *
  5. * Public include file for the Button Images and Cursor DLL, including
  6. * structures, definitions, and function prototypes.
  7. *
  8. * Copyright (c)1992-1993 Microsoft Corporation, All Rights Reserved,
  9. * as applied to redistribution of this source code in source form
  10. * License is granted to use of compiled code in shipped binaries.
  11. */
  12. #ifndef _BTTNCUR_H_
  13. #define _BTTNCUR_H_
  14. #ifdef __cplusplus
  15. extern "C"
  16. {
  17. #endif
  18. //Standard image bitmap
  19. //WARNING: Obsolete. Use the return from UIToolDisplayData
  20. #define IDB_STANDARDIMAGES 400
  21. //New values for display types
  22. #define IDB_STANDARDIMAGESMIN 400
  23. #define IDB_STANDARDIMAGES96 400
  24. #define IDB_STANDARDIMAGES72 401
  25. #define IDB_STANDARDIMAGES120 402
  26. //Image indices inside the standard bitmap.
  27. #define TOOLIMAGE_MIN 0
  28. #define TOOLIMAGE_EDITCUT 0
  29. #define TOOLIMAGE_EDITCOPY 1
  30. #define TOOLIMAGE_EDITPASTE 2
  31. #define TOOLIMAGE_FILENEW 3
  32. #define TOOLIMAGE_FILEOPEN 4
  33. #define TOOLIMAGE_FILESAVE 5
  34. #define TOOLIMAGE_FILEPRINT 6
  35. #define TOOLIMAGE_HELP 7
  36. #define TOOLIMAGE_HELPCONTEXT 8
  37. #define TOOLIMAGE_MAX 8
  38. //Additional Standard Cursors as defined in the UI Design Guide.
  39. #define IDC_NEWUICURSORMIN 500
  40. #define IDC_RIGHTARROW 500
  41. #define IDC_CONTEXTHELP 501
  42. #define IDC_MAGNIFY 502
  43. #define IDC_NODROP 503
  44. #define IDC_TABLETOP 504
  45. #define IDC_HSIZEBAR 505
  46. #define IDC_VSIZEBAR 506
  47. #define IDC_HSPLITBAR 507
  48. #define IDC_VSPLITBAR 508
  49. #define IDC_SMALLARROWS 509
  50. #define IDC_LARGEARROWS 510
  51. #define IDC_HARROWS 511
  52. #define IDC_VARROWS 512
  53. #define IDC_NESWARROWS 513
  54. #define IDC_NWSEARROWS 514
  55. #define IDC_NEWUICURSORMAX 514
  56. //Standard sizes for toolbar buttons and bitmaps on display types
  57. //WARNING: These are obsolete for version 1.0 compatibility/
  58. #define TOOLBUTTON_STDWIDTH 24
  59. #define TOOLBUTTON_STDHEIGHT 22
  60. #define TOOLBUTTON_STDIMAGEWIDTH 16
  61. #define TOOLBUTTON_STDIMAGEHEIGHT 15
  62. /*
  63. * Applications can call UIToolDisplayData to get the particular
  64. * values to use for the current display instead of using these values
  65. * directly. However, if the application has the aspect ratio already
  66. * then these are available for them.
  67. */
  68. //Sizes for 72 DPI (EGA)
  69. #define TOOLBUTTON_STD72WIDTH 24
  70. #define TOOLBUTTON_STD72HEIGHT 16
  71. #define TOOLBUTTON_STD72IMAGEWIDTH 16
  72. #define TOOLBUTTON_STD72IMAGEHEIGHT 11
  73. //Sizes for 96 DPI (VGA)
  74. #define TOOLBUTTON_STD96WIDTH 24
  75. #define TOOLBUTTON_STD96HEIGHT 22
  76. #define TOOLBUTTON_STD96IMAGEWIDTH 16
  77. #define TOOLBUTTON_STD96IMAGEHEIGHT 15
  78. //Sizes for 120 DPI (8514/a)
  79. #define TOOLBUTTON_STD120WIDTH 32
  80. #define TOOLBUTTON_STD120HEIGHT 31
  81. #define TOOLBUTTON_STD120IMAGEWIDTH 24
  82. #define TOOLBUTTON_STD120IMAGEHEIGHT 23
  83. //Sizes of a standard button bar depending on the display
  84. #define CYBUTTONBAR72 23
  85. #define CYBUTTONBAR96 29
  86. #define CYBUTTONBAR120 38
  87. /*
  88. * The low-word of the state contains the display state where each
  89. * value is mutually exclusive and contains one or more grouping bits.
  90. * Each group represents buttons that share some sub-state in common.
  91. *
  92. * The high-order byte controls which colors in the source bitmap,
  93. * black, white, gray, and dark gray, are to be converted into the
  94. * system colors COLOR_BTNTEXT, COLOR_HILIGHT, COLOR_BTNFACE, and
  95. * COLOR_BTNSHADOW. Any or all of these bits may be set to allow
  96. * the application control over specific colors.
  97. *
  98. * The actual state values are split into a command group and an
  99. * attribute group. Up, mouse down, and disabled states are identical,
  100. * but only attributes can have down, down disabled, and indeterminate
  101. * states.
  102. *
  103. * BUTTONGROUP_BLANK is defined so an application can draw only the button
  104. * without an image in the up, down, mouse down, or indeterminate
  105. * state, that is, BUTTONGROUP_BLANK is inclusive with BUTTONGROUP_DOWN
  106. * and BUTTONGROUP_LIGHTFACE.
  107. */
  108. #define BUTTONGROUP_DOWN 0x0001
  109. #define BUTTONGROUP_ACTIVE 0x0002
  110. #define BUTTONGROUP_DISABLED 0x0004
  111. #define BUTTONGROUP_LIGHTFACE 0x0008
  112. #define BUTTONGROUP_BLANK 0x0010
  113. //Command buttons only
  114. #define COMMANDBUTTON_UP (BUTTONGROUP_ACTIVE)
  115. #define COMMANDBUTTON_MOUSEDOWN (BUTTONGROUP_ACTIVE | BUTTONGROUP_DOWN)
  116. #define COMMANDBUTTON_DISABLED (BUTTONGROUP_DISABLED)
  117. //Attribute buttons only
  118. #define ATTRIBUTEBUTTON_UP (BUTTONGROUP_ACTIVE)
  119. #define ATTRIBUTEBUTTON_MOUSEDOWN (BUTTONGROUP_ACTIVE | BUTTONGROUP_DOWN)
  120. #define ATTRIBUTEBUTTON_DISABLED (BUTTONGROUP_DISABLED)
  121. #define ATTRIBUTEBUTTON_DOWN (BUTTONGROUP_ACTIVE | BUTTONGROUP_DOWN | BUTTONGROUP_LIGHTFACE)
  122. #define ATTRIBUTEBUTTON_INDETERMINATE (BUTTONGROUP_ACTIVE | BUTTONGROUP_LIGHTFACE)
  123. #define ATTRIBUTEBUTTON_DOWNDISABLED (BUTTONGROUP_DISABLED | BUTTONGROUP_DOWN | BUTTONGROUP_LIGHTFACE)
  124. //Blank buttons only
  125. #define BLANKBUTTON_UP (BUTTONGROUP_ACTIVE | BUTTONGROUP_BLANK)
  126. #define BLANKBUTTON_DOWN (BUTTONGROUP_ACTIVE | BUTTONGROUP_BLANK | BUTTONGROUP_DOWN | BUTTONGROUP_LIGHTFACE)
  127. #define BLANKBUTTON_MOUSEDOWN (BUTTONGROUP_ACTIVE | BUTTONGROUP_BLANK | BUTTONGROUP_DOWN)
  128. #define BLANKBUTTON_INDETERMINATE (BUTTONGROUP_ACTIVE | BUTTONGROUP_BLANK | BUTTONGROUP_LIGHTFACE)
  129. /*
  130. * Specific bits to prevent conversions of specific colors to system
  131. * colors. If an application uses this newer library and never specified
  132. * any bits, then they benefit from color conversion automatically.
  133. */
  134. #define PRESERVE_BLACK 0x0100
  135. #define PRESERVE_DKGRAY 0x0200
  136. #define PRESERVE_LTGRAY 0x0400
  137. #define PRESERVE_WHITE 0x0800
  138. #define PRESERVE_ALL (PRESERVE_BLACK | PRESERVE_DKGRAY | PRESERVE_LTGRAY | PRESERVE_WHITE)
  139. #define PRESERVE_NONE 0 //Backwards compatible
  140. //Structure for UIToolConfigureForDisplay
  141. typedef struct tagTOOLDISPLAYDATA
  142. {
  143. UINT uDPI; //Display driver DPI
  144. UINT cyBar; //Vertical size for a bar containing buttons.
  145. UINT cxButton; //Dimensions of a button.
  146. UINT cyButton;
  147. UINT cxImage; //Dimensions of bitmap image
  148. UINT cyImage;
  149. UINT uIDImages; //Standard resource ID for display-sensitive images
  150. } TOOLDISPLAYDATA, FAR *LPTOOLDISPLAYDATA;
  151. //Public functions in BTTNCUR.DLL
  152. HCURSOR WINAPI UICursorLoad(UINT);
  153. BOOL WINAPI UIToolConfigureForDisplay(LPTOOLDISPLAYDATA);
  154. BOOL WINAPI UIToolButtonDraw(HDC, int, int, int, int, HBITMAP, int, int, int, UINT);
  155. BOOL WINAPI UIToolButtonDrawTDD(HDC, int, int, int, int, HBITMAP, int, int, int, UINT, LPTOOLDISPLAYDATA);
  156. #ifdef __cplusplus
  157. }
  158. #endif
  159. #endif //_BTTNCUR_H_