home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / inc / bttncur.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  8KB  |  230 lines

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