user32: Remove the no longer used WIN_ISWIN32 flag.
[wine/wine-gecko.git] / dlls / user32 / controls.h
blobe8c7bdbbdaac3a99b0bd96a358f0dc80c18feed2
1 /*
2 * User controls definitions
4 * Copyright 2000 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_CONTROLS_H
22 #define __WINE_CONTROLS_H
24 #include "winuser.h"
25 #include "wine/winbase16.h"
27 /* Built-in class names (see _Undocumented_Windows_ p.418) */
28 #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
29 #define DESKTOP_CLASS_ATOM MAKEINTATOM(32769) /* Desktop */
30 #define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
31 #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
32 #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
34 enum builtin_winprocs
36 /* dual A/W procs */
37 WINPROC_BUTTON = 0,
38 WINPROC_COMBO,
39 WINPROC_DEFWND,
40 WINPROC_DIALOG,
41 WINPROC_EDIT,
42 WINPROC_LISTBOX,
43 WINPROC_MDICLIENT,
44 WINPROC_SCROLLBAR,
45 WINPROC_STATIC,
46 /* unicode-only procs */
47 WINPROC_DESKTOP,
48 WINPROC_ICONTITLE,
49 WINPROC_MENU,
50 WINPROC_MESSAGE,
51 NB_BUILTIN_WINPROCS,
52 NB_BUILTIN_AW_WINPROCS = WINPROC_DESKTOP
55 #define WINPROC_HANDLE (~0u >> 16)
56 #define BUILTIN_WINPROC(index) ((WNDPROC)(ULONG_PTR)((index) | (WINPROC_HANDLE << 16)))
58 /* Built-in class descriptor */
59 struct builtin_class_descr
61 LPCWSTR name; /* class name */
62 UINT style; /* class style */
63 enum builtin_winprocs proc;
64 INT extra; /* window extra bytes */
65 ULONG_PTR cursor; /* cursor id */
66 HBRUSH brush; /* brush or system color */
69 extern const struct builtin_class_descr BUTTON_builtin_class DECLSPEC_HIDDEN;
70 extern const struct builtin_class_descr COMBO_builtin_class DECLSPEC_HIDDEN;
71 extern const struct builtin_class_descr COMBOLBOX_builtin_class DECLSPEC_HIDDEN;
72 extern const struct builtin_class_descr DIALOG_builtin_class DECLSPEC_HIDDEN;
73 extern const struct builtin_class_descr DESKTOP_builtin_class DECLSPEC_HIDDEN;
74 extern const struct builtin_class_descr EDIT_builtin_class DECLSPEC_HIDDEN;
75 extern const struct builtin_class_descr ICONTITLE_builtin_class DECLSPEC_HIDDEN;
76 extern const struct builtin_class_descr LISTBOX_builtin_class DECLSPEC_HIDDEN;
77 extern const struct builtin_class_descr MDICLIENT_builtin_class DECLSPEC_HIDDEN;
78 extern const struct builtin_class_descr MENU_builtin_class DECLSPEC_HIDDEN;
79 extern const struct builtin_class_descr MESSAGE_builtin_class DECLSPEC_HIDDEN;
80 extern const struct builtin_class_descr SCROLL_builtin_class DECLSPEC_HIDDEN;
81 extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN;
83 extern LRESULT WINAPI DesktopWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
84 extern LRESULT WINAPI IconTitleWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
85 extern LRESULT WINAPI PopupMenuWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
86 extern LRESULT WINAPI MessageWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
88 /* Wow handlers */
90 struct wow_handlers16
92 LRESULT (*button_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
93 LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
94 LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
95 LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
96 LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
97 LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
98 LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
99 HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL);
100 LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
101 LRESULT (*call_dialog_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
102 HICON (*alloc_icon_handle)(UINT);
103 struct tagCURSORICONINFO *(*get_icon_ptr)(HICON);
104 void (*release_icon_ptr)(HICON,struct tagCURSORICONINFO*);
105 int (*free_icon_handle)(HICON);
108 struct wow_handlers32
110 LRESULT (*button_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
111 LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
112 LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
113 LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
114 LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
115 LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
116 LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
117 HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL);
118 HWND (*get_win_handle)(HWND);
119 WNDPROC (*alloc_winproc)(WNDPROC,BOOL);
120 struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL);
121 INT (*dialog_box_loop)(HWND,HWND);
124 extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN;
126 extern LRESULT ButtonWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
127 extern LRESULT ComboWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
128 extern LRESULT EditWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
129 extern LRESULT ListBoxWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
130 extern LRESULT MDIClientWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
131 extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
132 extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
134 /* 16-bit support */
135 extern struct wow_handlers32 wow_handlers32 DECLSPEC_HIDDEN;
136 extern HWND create_window16(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL) DECLSPEC_HIDDEN;
137 extern void free_module_classes(HINSTANCE16) DECLSPEC_HIDDEN;
138 extern void register_wow_handlers(void) DECLSPEC_HIDDEN;
139 extern void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new,
140 struct wow_handlers32 *orig );
141 static inline HWND WIN_Handle32( HWND16 hwnd16 )
143 return wow_handlers32.get_win_handle( (HWND)(ULONG_PTR)hwnd16 );
147 /* Class functions */
148 struct tagCLASS; /* opaque structure */
149 struct tagWND;
150 extern ATOM get_int_atom_value( LPCWSTR name ) DECLSPEC_HIDDEN;
151 extern void CLASS_RegisterBuiltinClasses(void) DECLSPEC_HIDDEN;
152 extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN;
153 extern struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
154 extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
156 /* defwnd proc */
157 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
159 /* desktop */
160 extern BOOL DESKTOP_SetPattern( LPCWSTR pattern ) DECLSPEC_HIDDEN;
162 /* icon title */
163 extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN;
165 /* menu controls */
166 extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
167 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
168 INT orgX, INT orgY ) DECLSPEC_HIDDEN;
169 extern BOOL MENU_SetMenu(HWND, HMENU) DECLSPEC_HIDDEN;
170 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDEN;
171 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar ) DECLSPEC_HIDDEN;
172 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
173 HWND hwnd, BOOL suppress_draw ) DECLSPEC_HIDDEN;
174 extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN;
176 /* nonclient area */
177 extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN;
178 extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
179 extern LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) DECLSPEC_HIDDEN;
180 extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
181 extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
182 extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN;
183 extern LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
184 extern LRESULT NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
185 extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ) DECLSPEC_HIDDEN;
186 extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ) DECLSPEC_HIDDEN;
188 /* scrollbar */
189 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior ) DECLSPEC_HIDDEN;
190 extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt ) DECLSPEC_HIDDEN;
191 extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
192 int hMin, int hMax, int hPos ) DECLSPEC_HIDDEN;
194 /* combo box */
196 #define ID_CB_LISTBOX 1000
197 #define ID_CB_EDIT 1001
199 /* internal flags */
200 #define CBF_DROPPED 0x0001
201 #define CBF_BUTTONDOWN 0x0002
202 #define CBF_NOROLLUP 0x0004
203 #define CBF_MEASUREITEM 0x0008
204 #define CBF_FOCUSED 0x0010
205 #define CBF_CAPTURE 0x0020
206 #define CBF_EDIT 0x0040
207 #define CBF_NORESIZE 0x0080
208 #define CBF_NOTIFY 0x0100
209 #define CBF_NOREDRAW 0x0200
210 #define CBF_SELCHANGE 0x0400
211 #define CBF_NOEDITNOTIFY 0x1000
212 #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
213 #define CBF_EUI 0x8000
215 /* combo state struct */
216 typedef struct
218 HWND self;
219 HWND owner;
220 UINT dwStyle;
221 HWND hWndEdit;
222 HWND hWndLBox;
223 UINT wState;
224 HFONT hFont;
225 RECT textRect;
226 RECT buttonRect;
227 RECT droppedRect;
228 INT droppedIndex;
229 INT fixedOwnerDrawHeight;
230 INT droppedWidth; /* last two are not used unless set */
231 INT editHeight; /* explicitly */
232 } HEADCOMBO,*LPHEADCOMBO;
234 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL ) DECLSPEC_HIDDEN;
236 /* Dialog info structure */
237 typedef struct tagDIALOGINFO
239 HWND hwndFocus; /* Current control with focus */
240 HFONT hUserFont; /* Dialog font */
241 HMENU hMenu; /* Dialog menu */
242 UINT xBaseUnit; /* Dialog units (depends on the font) */
243 UINT yBaseUnit;
244 INT idResult; /* EndDialog() result / default pushbutton ID */
245 UINT flags; /* EndDialog() called for this dialog */
246 } DIALOGINFO;
248 #define DF_END 0x0001
249 #define DF_OWNERENABLED 0x0002
251 extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN;
252 extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN;
254 #endif /* __WINE_CONTROLS_H */