c94598e76db32c88d8b9109c130d6d7e3718c2eb
[reactos.git] / reactos / include / win32k / ntusrtyp.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Win32 Graphical Subsystem (WIN32K)
4 * FILE: include/win32k/ntusrtyp.h
5 * PURPOSE: Win32 Shared USER Types for NtUser*
6 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 #ifndef _NTUSRTYP_
12 #define _NTUSRTYP_
13
14 /* ENUMERATIONS **************************************************************/
15
16 /* TYPES *********************************************************************/
17
18 typedef struct _PATRECT
19 {
20 RECT r;
21 HBRUSH hBrush;
22 } PATRECT, * PPATRECT;
23
24 /* Structures for reading icon/cursor files and resources */
25 typedef struct _ICONIMAGE
26 {
27 BITMAPINFOHEADER icHeader; // DIB header
28 RGBQUAD icColors[1]; // Color table
29 BYTE icXOR[1]; // DIB bits for XOR mask
30 BYTE icAND[1]; // DIB bits for AND mask
31 } ICONIMAGE, *LPICONIMAGE;
32
33 typedef struct _CURSORIMAGE
34 {
35 BITMAPINFOHEADER icHeader; // DIB header
36 RGBQUAD icColors[1]; // Color table
37 BYTE icXOR[1]; // DIB bits for XOR mask
38 BYTE icAND[1]; // DIB bits for AND mask
39 } CURSORIMAGE, *LPCURSORIMAGE;
40
41 typedef struct
42 {
43 BYTE bWidth;
44 BYTE bHeight;
45 BYTE bColorCount;
46 BYTE bReserved;
47 } ICONRESDIR;
48
49 typedef struct
50 {
51 WORD wWidth;
52 WORD wHeight;
53 } CURSORRESDIR;
54
55 typedef struct
56 {
57 WORD wPlanes; // Number of Color Planes in the XOR image
58 WORD wBitCount; // Bits per pixel in the XOR image
59 } ICONDIR;
60
61 typedef struct
62 {
63 WORD wXHotspot; // Number of Color Planes in the XOR image
64 WORD wYHotspot; // Bits per pixel in the XOR image
65 } CURSORDIR;
66
67 typedef struct
68 {
69 BYTE bWidth; // Width, in pixels, of the icon image
70 BYTE bHeight; // Height, in pixels, of the icon image
71 BYTE bColorCount; // Number of colors in image (0 if >=8bpp)
72 BYTE bReserved; // Reserved ( must be 0)
73 union
74 {
75 ICONDIR icon;
76 CURSORDIR cursor;
77 } Info;
78 DWORD dwBytesInRes; // How many bytes in this resource?
79 DWORD dwImageOffset; // Where in the file is this image?
80 } CURSORICONDIRENTRY;
81
82 typedef struct
83 {
84 WORD idReserved; // Reserved (must be 0)
85 WORD idType; // Resource Type (1 for icons, 0 for cursors)
86 WORD idCount; // How many images?
87 CURSORICONDIRENTRY idEntries[1];// An entry for idCount number of images
88 } CURSORICONDIR;
89
90 typedef struct
91 {
92 union
93 {
94 ICONRESDIR icon;
95 CURSORRESDIR cursor;
96 } ResInfo;
97 WORD wPlanes; // Color Planes
98 WORD wBitCount; // Bits per pixel
99 DWORD dwBytesInRes; // how many bytes in this resource?
100 WORD nID; // the ID
101 } GRPCURSORICONDIRENTRY;
102
103 typedef struct
104 {
105 WORD idReserved; // Reserved (must be 0)
106 WORD idType; // Resource type (1 for icons)
107 WORD idCount; // How many images?
108 GRPCURSORICONDIRENTRY idEntries[1]; // The entries for each image
109 } GRPCURSORICONDIR;
110
111 typedef struct _THRDCARETINFO
112 {
113 HWND hWnd;
114 HBITMAP Bitmap;
115 POINT Pos;
116 SIZE Size;
117 BYTE Visible;
118 BYTE Showing;
119 } THRDCARETINFO, *PTHRDCARETINFO;
120
121 typedef struct tagROSMENUINFO
122 {
123 /* ----------- MENUINFO ----------- */
124 DWORD cbSize;
125 DWORD fMask;
126 DWORD dwStyle;
127 UINT cyMax;
128 HBRUSH hbrBack;
129 DWORD dwContextHelpID;
130 ULONG_PTR dwMenuData;
131 /* ----------- Extra ----------- */
132 HMENU Self; /* Handle of this menu */
133 WORD Flags; /* Menu flags (MF_POPUP, MF_SYSMENU) */
134 UINT FocusedItem; /* Currently focused item */
135 UINT MenuItemCount; /* Number of items in the menu */
136 HWND Wnd; /* Window containing the menu */
137 WORD Width; /* Width of the whole menu */
138 WORD Height; /* Height of the whole menu */
139 HWND WndOwner; /* window receiving the messages for ownerdraw */
140 BOOL TimeToHide; /* Request hiding when receiving a second click in the top-level menu item */
141 SIZE maxBmpSize; /* Maximum size of the bitmap items in MIIM_BITMAP state */
142 } ROSMENUINFO, *PROSMENUINFO;
143
144 /* (other FocusedItem values give the position of the focused item) */
145 #define NO_SELECTED_ITEM 0xffff
146
147 typedef struct tagROSMENUITEMINFO
148 {
149 /* ----------- MENUITEMINFOW ----------- */
150 UINT cbSize;
151 UINT fMask;
152 UINT fType;
153 UINT fState;
154 UINT wID;
155 HMENU hSubMenu;
156 HBITMAP hbmpChecked;
157 HBITMAP hbmpUnchecked;
158 DWORD dwItemData;
159 LPWSTR dwTypeData;
160 UINT cch;
161 HBITMAP hbmpItem;
162 /* ----------- Extra ----------- */
163 RECT Rect; /* Item area (relative to menu window) */
164 UINT XTab; /* X position of text after Tab */
165 } ROSMENUITEMINFO, *PROSMENUITEMINFO;
166
167 #endif