win32u: Move NtUserSetTimer implementation from user32.
[wine.git] / dlls / user32 / user_private.h
blob465522e54dca257e705c793cd7aed85fafe9c329
1 /*
2 * USER private definitions
4 * Copyright 1993 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_USER_PRIVATE_H
22 #define __WINE_USER_PRIVATE_H
24 #include <stdarg.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "../win32u/ntuser_private.h"
29 #include "winreg.h"
30 #include "winternl.h"
31 #include "hidusage.h"
32 #include "wine/gdi_driver.h"
33 #include "wine/heap.h"
35 #define GET_WORD(ptr) (*(const WORD *)(ptr))
36 #define GET_DWORD(ptr) (*(const DWORD *)(ptr))
37 #define GET_LONG(ptr) (*(const LONG *)(ptr))
39 #define WM_SYSTIMER 0x0118
40 #define WM_POPUPSYSTEMMENU 0x0313
42 #define WINE_MOUSE_HANDLE ((HANDLE)1)
43 #define WINE_KEYBOARD_HANDLE ((HANDLE)2)
45 struct window_surface;
47 extern const struct user_driver_funcs *USER_Driver DECLSPEC_HIDDEN;
49 extern void USER_unload_driver(void) DECLSPEC_HIDDEN;
51 struct received_message_info;
53 /* type of message-sending functions that need special WM_CHAR handling */
54 enum wm_char_mapping
56 WMCHAR_MAP_POSTMESSAGE,
57 WMCHAR_MAP_SENDMESSAGE,
58 WMCHAR_MAP_SENDMESSAGETIMEOUT,
59 WMCHAR_MAP_RECVMESSAGE,
60 WMCHAR_MAP_DISPATCHMESSAGE,
61 WMCHAR_MAP_CALLWINDOWPROC,
62 WMCHAR_MAP_COUNT,
63 WMCHAR_MAP_NOMAPPING = WMCHAR_MAP_COUNT
66 /* data to store state for A/W mappings of WM_CHAR */
67 struct wm_char_mapping_data
69 BYTE lead_byte[WMCHAR_MAP_COUNT];
70 MSG get_msg;
73 /* on windows the buffer capacity is quite large as well, enough to */
74 /* hold up to 10s of 1kHz mouse rawinput events */
75 #define RAWINPUT_BUFFER_SIZE (512*1024)
77 struct rawinput_thread_data
79 UINT hw_id; /* current rawinput message id */
80 RAWINPUT buffer[1]; /* rawinput message data buffer */
83 extern BOOL (WINAPI *imm_register_window)(HWND) DECLSPEC_HIDDEN;
84 extern void (WINAPI *imm_unregister_window)(HWND) DECLSPEC_HIDDEN;
86 static inline struct user_thread_info *get_user_thread_info(void)
88 return (struct user_thread_info *)NtCurrentTeb()->Win32ClientInfo;
91 extern HMODULE user32_module DECLSPEC_HIDDEN;
93 struct dce;
94 struct tagWND;
96 struct hardware_msg_data;
97 extern BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_msg_data *msg_data);
98 extern BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage);
99 extern struct rawinput_thread_data *rawinput_thread_data(void);
100 extern void rawinput_update_device_list(void);
102 extern void create_offscreen_window_surface( const RECT *visible_rect, struct window_surface **surface ) DECLSPEC_HIDDEN;
104 extern void CLIPBOARD_ReleaseOwner( HWND hwnd ) DECLSPEC_HIDDEN;
105 extern BOOL FOCUS_MouseActivate( HWND hwnd ) DECLSPEC_HIDDEN;
106 extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN;
107 extern HDC get_display_dc(void) DECLSPEC_HIDDEN;
108 extern void release_display_dc( HDC hdc ) DECLSPEC_HIDDEN;
109 extern void move_window_bits( HWND hwnd, struct window_surface *old_surface,
110 struct window_surface *new_surface,
111 const RECT *visible_rect, const RECT *old_visible_rect,
112 const RECT *window_rect, const RECT *valid_rects ) DECLSPEC_HIDDEN;
113 extern void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect,
114 const RECT *valid_rects ) DECLSPEC_HIDDEN;
115 extern void wait_graphics_driver_ready(void) DECLSPEC_HIDDEN;
116 extern void *get_hook_proc( void *proc, const WCHAR *module, HMODULE *free_module ) DECLSPEC_HIDDEN;
117 extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN;
118 extern RECT get_primary_monitor_rect(void) DECLSPEC_HIDDEN;
119 extern DWORD get_input_codepage( void ) DECLSPEC_HIDDEN;
120 extern BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
121 extern NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT flags ) DECLSPEC_HIDDEN;
122 extern LRESULT WINAPI MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid,
123 UINT msg, WPARAM wparam, LPARAM lparam,
124 UINT flags, UINT timeout, PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN;
125 extern HPEN SYSCOLOR_GetPen( INT index ) DECLSPEC_HIDDEN;
126 extern HBRUSH SYSCOLOR_Get55AABrush(void) DECLSPEC_HIDDEN;
127 extern void SYSPARAMS_Init(void) DECLSPEC_HIDDEN;
128 extern void USER_CheckNotLock(void) DECLSPEC_HIDDEN;
129 extern BOOL USER_IsExitingThread( DWORD tid ) DECLSPEC_HIDDEN;
131 typedef LRESULT (*winproc_callback_t)( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
132 LRESULT *result, void *arg );
134 extern WNDPROC WINPROC_GetProc( WNDPROC proc, BOOL unicode ) DECLSPEC_HIDDEN;
135 extern WNDPROC WINPROC_AllocProc( WNDPROC func, BOOL unicode ) DECLSPEC_HIDDEN;
136 extern BOOL WINPROC_IsUnicode( WNDPROC proc, BOOL def_val ) DECLSPEC_HIDDEN;
138 extern LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg,
139 WPARAM wParam, LPARAM lParam, LRESULT *result, void *arg,
140 enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
142 extern INT_PTR WINPROC_CallDlgProcA( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
143 extern INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
144 extern BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
145 LRESULT *result, BOOL unicode, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
146 extern void winproc_init(void) DECLSPEC_HIDDEN;
148 extern ATOM get_class_info( HINSTANCE instance, const WCHAR *name, WNDCLASSEXW *info,
149 UNICODE_STRING *name_str, BOOL ansi ) DECLSPEC_HIDDEN;
151 /* kernel callbacks */
153 BOOL WINAPI User32CallEnumDisplayMonitor( struct enum_display_monitor_params *params, ULONG size );
154 BOOL WINAPI User32CallWinEventHook( const struct win_event_hook_params *params, ULONG size );
155 BOOL WINAPI User32CallWindowsHook( const struct win_hook_params *params, ULONG size );
157 /* message spy definitions */
159 #define SPY_DISPATCHMESSAGE 0x0100
160 #define SPY_SENDMESSAGE 0x0101
161 #define SPY_DEFWNDPROC 0x0102
163 #define SPY_RESULT_OK 0x0001
164 #define SPY_RESULT_DEFWND 0x0002
166 extern const char *SPY_GetMsgName( UINT msg, HWND hWnd ) DECLSPEC_HIDDEN;
167 extern const char *SPY_GetVKeyName(WPARAM wParam) DECLSPEC_HIDDEN;
168 extern void SPY_EnterMessage( INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
169 extern void SPY_ExitMessage( INT iFlag, HWND hwnd, UINT msg,
170 LRESULT lReturn, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
172 #include "pshpack1.h"
174 typedef struct
176 BYTE bWidth;
177 BYTE bHeight;
178 BYTE bColorCount;
179 BYTE bReserved;
180 } ICONRESDIR;
182 typedef struct
184 WORD wWidth;
185 WORD wHeight;
186 } CURSORDIR;
188 typedef struct
189 { union
190 { ICONRESDIR icon;
191 CURSORDIR cursor;
192 } ResInfo;
193 WORD wPlanes;
194 WORD wBitCount;
195 DWORD dwBytesInRes;
196 WORD wResId;
197 } CURSORICONDIRENTRY;
199 typedef struct
201 WORD idReserved;
202 WORD idType;
203 WORD idCount;
204 CURSORICONDIRENTRY idEntries[1];
205 } CURSORICONDIR;
207 typedef struct {
208 BYTE bWidth;
209 BYTE bHeight;
210 BYTE bColorCount;
211 BYTE bReserved;
212 WORD xHotspot;
213 WORD yHotspot;
214 DWORD dwDIBSize;
215 DWORD dwDIBOffset;
216 } CURSORICONFILEDIRENTRY;
218 typedef struct
220 WORD idReserved;
221 WORD idType;
222 WORD idCount;
223 CURSORICONFILEDIRENTRY idEntries[1];
224 } CURSORICONFILEDIR;
226 #include "poppack.h"
228 extern int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) DECLSPEC_HIDDEN;
229 extern BOOL get_icon_size( HICON handle, SIZE *size ) DECLSPEC_HIDDEN;
231 extern struct user_api_hook *user_api DECLSPEC_HIDDEN;
232 LRESULT WINAPI USER_DefDlgProc(HWND, UINT, WPARAM, LPARAM, BOOL) DECLSPEC_HIDDEN;
233 LRESULT WINAPI USER_ScrollBarProc(HWND, UINT, WPARAM, LPARAM, BOOL) DECLSPEC_HIDDEN;
234 void WINAPI USER_ScrollBarDraw(HWND, HDC, INT, enum SCROLL_HITTEST,
235 const struct SCROLL_TRACKING_INFO *, BOOL, BOOL, RECT *, INT, INT,
236 INT, BOOL) DECLSPEC_HIDDEN;
237 void WINAPI SCROLL_SetStandardScrollPainted(HWND hwnd, INT bar, BOOL visible);
239 #endif /* __WINE_USER_PRIVATE_H */