win32u: Move process_sent_messages implementation from user32.
[wine.git] / dlls / user32 / user_private.h
blob2495db9336c42b4bdf0be51b7875680e43f8e720
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 WINE_MOUSE_HANDLE ((HANDLE)1)
40 #define WINE_KEYBOARD_HANDLE ((HANDLE)2)
42 struct window_surface;
44 extern const struct user_driver_funcs *USER_Driver DECLSPEC_HIDDEN;
46 extern void USER_unload_driver(void) DECLSPEC_HIDDEN;
48 struct received_message_info;
50 /* data to store state for A/W mappings of WM_CHAR */
51 struct wm_char_mapping_data
53 BYTE lead_byte[WMCHAR_MAP_COUNT];
54 MSG get_msg;
57 /* on windows the buffer capacity is quite large as well, enough to */
58 /* hold up to 10s of 1kHz mouse rawinput events */
59 #define RAWINPUT_BUFFER_SIZE (512*1024)
61 struct rawinput_thread_data
63 UINT hw_id; /* current rawinput message id */
64 RAWINPUT buffer[1]; /* rawinput message data buffer */
67 extern BOOL (WINAPI *imm_register_window)(HWND) DECLSPEC_HIDDEN;
68 extern void (WINAPI *imm_unregister_window)(HWND) DECLSPEC_HIDDEN;
70 static inline struct user_thread_info *get_user_thread_info(void)
72 return (struct user_thread_info *)NtCurrentTeb()->Win32ClientInfo;
75 extern HMODULE user32_module DECLSPEC_HIDDEN;
77 struct dce;
78 struct tagWND;
80 struct hardware_msg_data;
81 extern BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_msg_data *msg_data);
82 extern BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage);
83 extern struct rawinput_thread_data *rawinput_thread_data(void);
84 extern void rawinput_update_device_list(void);
86 extern BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data,
87 HWND hwnd_filter, UINT first, UINT last, BOOL remove ) DECLSPEC_HIDDEN;
88 extern BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
89 void **buffer, size_t size ) DECLSPEC_HIDDEN;
91 extern void CLIPBOARD_ReleaseOwner( HWND hwnd ) DECLSPEC_HIDDEN;
92 extern BOOL FOCUS_MouseActivate( HWND hwnd ) DECLSPEC_HIDDEN;
93 extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN;
94 extern HDC get_display_dc(void) DECLSPEC_HIDDEN;
95 extern void release_display_dc( HDC hdc ) DECLSPEC_HIDDEN;
96 extern void wait_graphics_driver_ready(void) DECLSPEC_HIDDEN;
97 extern void *get_hook_proc( void *proc, const WCHAR *module, HMODULE *free_module ) DECLSPEC_HIDDEN;
98 extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN;
99 extern RECT get_primary_monitor_rect(void) DECLSPEC_HIDDEN;
100 extern DWORD get_input_codepage( void ) DECLSPEC_HIDDEN;
101 extern BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
102 extern NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT flags ) DECLSPEC_HIDDEN;
103 extern LRESULT WINAPI MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid,
104 UINT msg, WPARAM wparam, LPARAM lparam,
105 UINT flags, UINT timeout, PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN;
106 extern HPEN SYSCOLOR_GetPen( INT index ) DECLSPEC_HIDDEN;
107 extern HBRUSH SYSCOLOR_Get55AABrush(void) DECLSPEC_HIDDEN;
108 extern void SYSPARAMS_Init(void) DECLSPEC_HIDDEN;
109 extern void USER_CheckNotLock(void) DECLSPEC_HIDDEN;
110 extern BOOL USER_IsExitingThread( DWORD tid ) DECLSPEC_HIDDEN;
112 typedef LRESULT (*winproc_callback_t)( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
113 LRESULT *result, void *arg );
115 extern LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg,
116 WPARAM wParam, LPARAM lParam, LRESULT *result, void *arg,
117 enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
119 extern INT_PTR WINPROC_CallDlgProcA( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
120 extern INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
121 extern void winproc_init(void) DECLSPEC_HIDDEN;
122 extern void get_winproc_params( struct win_proc_params *params ) DECLSPEC_HIDDEN;
124 extern ATOM get_class_info( HINSTANCE instance, const WCHAR *name, WNDCLASSEXW *info,
125 UNICODE_STRING *name_str, BOOL ansi ) DECLSPEC_HIDDEN;
127 /* kernel callbacks */
129 BOOL WINAPI User32CallEnumDisplayMonitor( struct enum_display_monitor_params *params, ULONG size );
130 BOOL WINAPI User32CallSendAsyncCallback( const struct send_async_params *params, ULONG size );
131 BOOL WINAPI User32CallWinEventHook( const struct win_event_hook_params *params, ULONG size );
132 BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size );
133 BOOL WINAPI User32CallWindowsHook( const struct win_hook_params *params, ULONG size );
135 /* message spy definitions */
137 extern const char *SPY_GetMsgName( UINT msg, HWND hWnd ) DECLSPEC_HIDDEN;
138 extern const char *SPY_GetVKeyName(WPARAM wParam) DECLSPEC_HIDDEN;
139 extern void SPY_EnterMessage( INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
140 extern void SPY_ExitMessage( INT iFlag, HWND hwnd, UINT msg,
141 LRESULT lReturn, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
143 #include "pshpack1.h"
145 typedef struct
147 BYTE bWidth;
148 BYTE bHeight;
149 BYTE bColorCount;
150 BYTE bReserved;
151 } ICONRESDIR;
153 typedef struct
155 WORD wWidth;
156 WORD wHeight;
157 } CURSORDIR;
159 typedef struct
160 { union
161 { ICONRESDIR icon;
162 CURSORDIR cursor;
163 } ResInfo;
164 WORD wPlanes;
165 WORD wBitCount;
166 DWORD dwBytesInRes;
167 WORD wResId;
168 } CURSORICONDIRENTRY;
170 typedef struct
172 WORD idReserved;
173 WORD idType;
174 WORD idCount;
175 CURSORICONDIRENTRY idEntries[1];
176 } CURSORICONDIR;
178 typedef struct {
179 BYTE bWidth;
180 BYTE bHeight;
181 BYTE bColorCount;
182 BYTE bReserved;
183 WORD xHotspot;
184 WORD yHotspot;
185 DWORD dwDIBSize;
186 DWORD dwDIBOffset;
187 } CURSORICONFILEDIRENTRY;
189 typedef struct
191 WORD idReserved;
192 WORD idType;
193 WORD idCount;
194 CURSORICONFILEDIRENTRY idEntries[1];
195 } CURSORICONFILEDIR;
197 #include "poppack.h"
199 extern int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) DECLSPEC_HIDDEN;
200 extern BOOL get_icon_size( HICON handle, SIZE *size ) DECLSPEC_HIDDEN;
202 extern struct user_api_hook *user_api DECLSPEC_HIDDEN;
203 LRESULT WINAPI USER_DefDlgProc(HWND, UINT, WPARAM, LPARAM, BOOL) DECLSPEC_HIDDEN;
204 LRESULT WINAPI USER_ScrollBarProc(HWND, UINT, WPARAM, LPARAM, BOOL) DECLSPEC_HIDDEN;
205 void WINAPI USER_ScrollBarDraw(HWND, HDC, INT, enum SCROLL_HITTEST,
206 const struct SCROLL_TRACKING_INFO *, BOOL, BOOL, RECT *, INT, INT,
207 INT, BOOL) DECLSPEC_HIDDEN;
208 void WINAPI SCROLL_SetStandardScrollPainted(HWND hwnd, INT bar, BOOL visible);
210 #endif /* __WINE_USER_PRIVATE_H */