Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * USER definitions |
| 3 | * |
| 4 | * Copyright 1993 Alexandre Julliard |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 5 | * |
| 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. |
| 10 | * |
| 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. |
| 15 | * |
| 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 19 | */ |
| 20 | |
Alexandre Julliard | c6c0944 | 1997-01-12 18:32:19 +0000 | [diff] [blame] | 21 | #ifndef __WINE_USER_H |
| 22 | #define __WINE_USER_H |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 23 | |
Alexandre Julliard | e37c6e1 | 2003-09-05 23:08:26 +0000 | [diff] [blame] | 24 | #include <stdarg.h> |
| 25 | #include <windef.h> |
Dimitrie O. Paun | 53f9c21 | 2003-08-28 21:43:34 +0000 | [diff] [blame] | 26 | #include <winbase.h> |
| 27 | #include <wingdi.h> |
| 28 | #include <winuser.h> |
Alexandre Julliard | 9ae0fe5 | 2001-04-24 23:28:52 +0000 | [diff] [blame] | 29 | |
Dimitrie O. Paun | 53f9c21 | 2003-08-28 21:43:34 +0000 | [diff] [blame] | 30 | #include <local.h> |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 31 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 32 | extern WORD USER_HeapSel; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 33 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 34 | #define USER_HEAP_ALLOC(size) \ |
Alexandre Julliard | 7521a42 | 2002-10-19 00:55:34 +0000 | [diff] [blame] | 35 | ((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) )) |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 36 | #define USER_HEAP_REALLOC(handle,size) \ |
Alexandre Julliard | 7521a42 | 2002-10-19 00:55:34 +0000 | [diff] [blame] | 37 | ((HANDLE)(ULONG_PTR)LOCAL_ReAlloc( USER_HeapSel, LOWORD(handle), (size), LMEM_FIXED )) |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 38 | #define USER_HEAP_FREE(handle) \ |
Alexandre Julliard | 7521a42 | 2002-10-19 00:55:34 +0000 | [diff] [blame] | 39 | LOCAL_Free( USER_HeapSel, LOWORD(handle) ) |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 40 | #define USER_HEAP_LIN_ADDR(handle) \ |
Alexandre Julliard | 7521a42 | 2002-10-19 00:55:34 +0000 | [diff] [blame] | 41 | ((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, LOWORD(handle))) : NULL) |
Alexandre Julliard | fb9a919 | 1994-03-01 19:48:04 +0000 | [diff] [blame] | 42 | |
Alexandre Julliard | 7fbd74e | 2002-05-23 02:53:10 +0000 | [diff] [blame] | 43 | #define GET_WORD(ptr) (*(WORD *)(ptr)) |
| 44 | #define GET_DWORD(ptr) (*(DWORD *)(ptr)) |
| 45 | |
Alexandre Julliard | a69b88b | 1998-03-15 20:29:56 +0000 | [diff] [blame] | 46 | #define USUD_LOCALALLOC 0x0001 |
| 47 | #define USUD_LOCALFREE 0x0002 |
| 48 | #define USUD_LOCALCOMPACT 0x0003 |
| 49 | #define USUD_LOCALHEAP 0x0004 |
| 50 | #define USUD_FIRSTCLASS 0x0005 |
| 51 | |
Alexandre Julliard | 28c3a1b | 2000-03-20 18:21:19 +0000 | [diff] [blame] | 52 | struct tagCURSORICONINFO; |
Alexandre Julliard | 2b5d564 | 2000-06-08 04:57:22 +0000 | [diff] [blame] | 53 | |
Alexandre Julliard | fb0ff05 | 2001-10-16 21:58:58 +0000 | [diff] [blame] | 54 | /* internal messages codes */ |
| 55 | enum wine_internal_message |
| 56 | { |
| 57 | WM_WINE_DESTROYWINDOW = 0x80000000, |
| 58 | WM_WINE_SETWINDOWPOS, |
| 59 | WM_WINE_SHOWWINDOW, |
Alexandre Julliard | ddc3317 | 2001-10-22 19:08:33 +0000 | [diff] [blame] | 60 | WM_WINE_SETPARENT, |
| 61 | WM_WINE_SETWINDOWLONG, |
Alexandre Julliard | 5030bda | 2002-10-11 23:41:06 +0000 | [diff] [blame] | 62 | WM_WINE_ENABLEWINDOW, |
Alexandre Julliard | ca3ac8f | 2003-07-11 21:55:58 +0000 | [diff] [blame] | 63 | WM_WINE_SETACTIVEWINDOW, |
| 64 | WM_WINE_KEYBOARD_LL_HOOK, |
| 65 | WM_WINE_MOUSE_LL_HOOK |
Alexandre Julliard | fb0ff05 | 2001-10-16 21:58:58 +0000 | [diff] [blame] | 66 | }; |
Alexandre Julliard | 42d20f9 | 2000-08-10 01:16:19 +0000 | [diff] [blame] | 67 | |
Alexandre Julliard | 32fb580 | 2001-10-18 21:38:59 +0000 | [diff] [blame] | 68 | /* internal SendInput codes (FIXME) */ |
| 69 | #define WINE_INTERNAL_INPUT_MOUSE (16+INPUT_MOUSE) |
| 70 | #define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD) |
| 71 | |
Patrik Stridvall | b87fe2e | 1999-04-01 08:16:08 +0000 | [diff] [blame] | 72 | typedef struct tagUSER_DRIVER { |
Alexandre Julliard | 28c3a1b | 2000-03-20 18:21:19 +0000 | [diff] [blame] | 73 | /* keyboard functions */ |
Alexandre Julliard | 4b62618 | 2001-10-17 17:50:02 +0000 | [diff] [blame] | 74 | void (*pInitKeyboard)(LPBYTE); |
Dmitry Timoshkov | b0c2e54 | 2003-11-14 03:32:43 +0000 | [diff] [blame] | 75 | SHORT (*pVkKeyScanEx)(WCHAR, HKL); |
| 76 | UINT (*pMapVirtualKeyEx)(UINT, UINT, HKL); |
| 77 | INT (*pGetKeyNameText)(LONG, LPWSTR, INT); |
| 78 | INT (*pToUnicodeEx)(UINT, UINT, LPBYTE, LPWSTR, int, UINT, HKL); |
| 79 | UINT (*pGetKeyboardLayoutList)(INT, HKL *); |
| 80 | HKL (*pGetKeyboardLayout)(DWORD); |
| 81 | BOOL (*pGetKeyboardLayoutName)(LPWSTR); |
| 82 | HKL (*pLoadKeyboardLayout)(LPCWSTR, UINT); |
| 83 | HKL (*pActivateKeyboardLayout)(HKL, UINT); |
| 84 | BOOL (*pUnloadKeyboardLayout)(HKL); |
Alexandre Julliard | 28c3a1b | 2000-03-20 18:21:19 +0000 | [diff] [blame] | 85 | void (*pBeep)(void); |
Alexandre Julliard | 28c3a1b | 2000-03-20 18:21:19 +0000 | [diff] [blame] | 86 | /* mouse functions */ |
Alexandre Julliard | 32fb580 | 2001-10-18 21:38:59 +0000 | [diff] [blame] | 87 | void (*pInitMouse)(LPBYTE); |
Alexandre Julliard | 28c3a1b | 2000-03-20 18:21:19 +0000 | [diff] [blame] | 88 | void (*pSetCursor)(struct tagCURSORICONINFO *); |
Ove Kaaven | 624f14e | 2001-06-21 00:44:09 +0000 | [diff] [blame] | 89 | void (*pGetCursorPos)(LPPOINT); |
| 90 | void (*pSetCursorPos)(INT,INT); |
Alexandre Julliard | 7f3418f | 2000-03-25 17:30:13 +0000 | [diff] [blame] | 91 | /* screen saver functions */ |
| 92 | BOOL (*pGetScreenSaveActive)(void); |
| 93 | void (*pSetScreenSaveActive)(BOOL); |
Alexandre Julliard | 42d20f9 | 2000-08-10 01:16:19 +0000 | [diff] [blame] | 94 | /* clipboard functions */ |
Ulrich Czekalla | b2df5f9 | 2003-06-23 23:02:02 +0000 | [diff] [blame] | 95 | void (*pAcquireClipboard)(HWND); /* Acquire selection */ |
| 96 | BOOL (*pCountClipboardFormats)(void); /* Count available clipboard formats */ |
Ulrich Czekalla | b41466b | 2004-05-06 23:40:30 +0000 | [diff] [blame] | 97 | void (*pEmptyClipboard)(BOOL); /* Empty clipboard data */ |
Ulrich Czekalla | b2df5f9 | 2003-06-23 23:02:02 +0000 | [diff] [blame] | 98 | BOOL (*pEndClipboardUpdate)(void); /* End clipboard update */ |
| 99 | BOOL (*pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */ |
| 100 | BOOL (*pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */ |
| 101 | BOOL (*pGetClipboardFormatName)(UINT, LPSTR, UINT); /* Get a clipboard format name */ |
| 102 | BOOL (*pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */ |
| 103 | INT (*pRegisterClipboardFormat)(LPCSTR); /* Register a clipboard format */ |
Alexandre Julliard | 4ff32c8 | 2001-08-18 18:08:26 +0000 | [diff] [blame] | 104 | void (*pResetSelectionOwner)(HWND, BOOL); |
Ulrich Czekalla | b41466b | 2004-05-06 23:40:30 +0000 | [diff] [blame] | 105 | BOOL (*pSetClipboardData)(UINT, HANDLE16, HANDLE, BOOL); /* Set specified selection data */ |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 106 | /* display modes */ |
| 107 | LONG (*pChangeDisplaySettingsExW)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID); |
| 108 | BOOL (*pEnumDisplaySettingsExW)(LPCWSTR,DWORD,LPDEVMODEW,DWORD); |
Alexandre Julliard | 9ae0fe5 | 2001-04-24 23:28:52 +0000 | [diff] [blame] | 109 | /* windowing functions */ |
Gerard Patel | ad36303 | 2001-06-06 21:26:50 +0000 | [diff] [blame] | 110 | BOOL (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL); |
Alexandre Julliard | 9ae0fe5 | 2001-04-24 23:28:52 +0000 | [diff] [blame] | 111 | BOOL (*pDestroyWindow)(HWND); |
| 112 | BOOL (*pGetDC)(HWND,HDC,HRGN,DWORD); |
Alexandre Julliard | ed15fc7 | 2001-06-29 01:26:41 +0000 | [diff] [blame] | 113 | void (*pForceWindowRaise)(HWND); |
Alexandre Julliard | 51ab43b | 2001-05-18 22:51:56 +0000 | [diff] [blame] | 114 | DWORD (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD); |
Alexandre Julliard | 3f61afb | 2002-11-14 22:30:20 +0000 | [diff] [blame] | 115 | void (*pReleaseDC)(HWND,HDC); |
Alexandre Julliard | e3fe9f2 | 2001-05-10 03:23:59 +0000 | [diff] [blame] | 116 | INT (*pScrollWindowEx)(HWND,INT,INT,const RECT*,const RECT*,HRGN,LPRECT,UINT); |
Alexandre Julliard | 9ae0fe5 | 2001-04-24 23:28:52 +0000 | [diff] [blame] | 117 | void (*pSetFocus)(HWND); |
| 118 | HWND (*pSetParent)(HWND,HWND); |
| 119 | BOOL (*pSetWindowPos)(WINDOWPOS *); |
Alexandre Julliard | ddc3317 | 2001-10-22 19:08:33 +0000 | [diff] [blame] | 120 | int (*pSetWindowRgn)(HWND,HRGN,BOOL); |
Alexandre Julliard | 446d832 | 2003-12-31 23:51:52 +0000 | [diff] [blame] | 121 | void (*pSetWindowIcon)(HWND,UINT,HICON); |
Gerard Patel | 94ce2a3 | 2001-10-03 18:44:02 +0000 | [diff] [blame] | 122 | void (*pSetWindowStyle)(HWND,DWORD); |
Alexandre Julliard | 9ae0fe5 | 2001-04-24 23:28:52 +0000 | [diff] [blame] | 123 | BOOL (*pSetWindowText)(HWND,LPCWSTR); |
Alexandre Julliard | dc4fe77 | 2001-06-04 21:55:17 +0000 | [diff] [blame] | 124 | BOOL (*pShowWindow)(HWND,INT); |
Alexandre Julliard | 3abeae8 | 2001-05-09 17:21:04 +0000 | [diff] [blame] | 125 | void (*pSysCommandSizeMove)(HWND,WPARAM); |
Patrik Stridvall | b87fe2e | 1999-04-01 08:16:08 +0000 | [diff] [blame] | 126 | } USER_DRIVER; |
| 127 | |
Alexandre Julliard | 42d20f9 | 2000-08-10 01:16:19 +0000 | [diff] [blame] | 128 | extern USER_DRIVER USER_Driver; |
Patrik Stridvall | b87fe2e | 1999-04-01 08:16:08 +0000 | [diff] [blame] | 129 | |
Alexandre Julliard | a2e2e18 | 2004-02-12 00:35:01 +0000 | [diff] [blame] | 130 | extern HMODULE user32_module; |
| 131 | |
Alexandre Julliard | 6837b9c | 2001-08-16 18:14:22 +0000 | [diff] [blame] | 132 | /* user lock */ |
| 133 | extern void USER_Lock(void); |
| 134 | extern void USER_Unlock(void); |
| 135 | extern void USER_CheckNotLock(void); |
| 136 | |
Alexandre Julliard | fb0ff05 | 2001-10-16 21:58:58 +0000 | [diff] [blame] | 137 | extern BOOL USER_IsExitingThread( DWORD tid ); |
| 138 | |
Alexandre Julliard | a41b2cf | 2001-01-15 20:12:55 +0000 | [diff] [blame] | 139 | /* gray brush cache */ |
| 140 | extern HBRUSH CACHE_GetPattern55AABrush(void); |
| 141 | |
Alexandre Julliard | 0286135 | 2002-10-29 00:41:42 +0000 | [diff] [blame] | 142 | /* hook.c */ |
| 143 | extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ); |
| 144 | extern BOOL HOOK_IsHooked( INT id ); |
| 145 | |
Alexandre Julliard | 18d0297 | 2002-12-03 23:34:52 +0000 | [diff] [blame] | 146 | /* input.c */ |
| 147 | extern BYTE InputKeyStateTable[256]; |
| 148 | extern BYTE AsyncKeyStateTable[256]; |
| 149 | |
Alexandre Julliard | 4344c36 | 2002-05-20 18:15:28 +0000 | [diff] [blame] | 150 | /* syscolor.c */ |
Alexandre Julliard | 18d0297 | 2002-12-03 23:34:52 +0000 | [diff] [blame] | 151 | extern void SYSCOLOR_Init(void); |
Alexandre Julliard | 4344c36 | 2002-05-20 18:15:28 +0000 | [diff] [blame] | 152 | extern HPEN SYSCOLOR_GetPen( INT index ); |
| 153 | |
Alexandre Julliard | 18d0297 | 2002-12-03 23:34:52 +0000 | [diff] [blame] | 154 | /* sysmetrics.c */ |
| 155 | extern void SYSMETRICS_Init(void); |
| 156 | extern INT SYSMETRICS_Set( INT index, INT value ); |
| 157 | |
Alexandre Julliard | 18d0297 | 2002-12-03 23:34:52 +0000 | [diff] [blame] | 158 | /* sysparams.c */ |
| 159 | extern void SYSPARAMS_GetDoubleClickSize( INT *width, INT *height ); |
| 160 | extern INT SYSPARAMS_GetMouseButtonSwap( void ); |
| 161 | |
Alexandre Julliard | 0ccb9fe | 2002-10-18 04:05:49 +0000 | [diff] [blame] | 162 | extern HPALETTE WINAPI SelectPalette( HDC hDC, HPALETTE hPal, BOOL bForceBackground ); |
| 163 | |
Ulrich Czekalla | b2df5f9 | 2003-06-23 23:02:02 +0000 | [diff] [blame] | 164 | extern BOOL CLIPBOARD_ReleaseOwner(void); |
| 165 | |
Mike McCormack | 096524c | 2001-12-26 19:46:40 +0000 | [diff] [blame] | 166 | extern DWORD USER16_AlertableWait; |
| 167 | |
Michael Stefaniuc | 4a75c5c | 2002-08-28 00:39:39 +0000 | [diff] [blame] | 168 | /* HANDLE16 <-> HANDLE conversions */ |
Alexandre Julliard | a8a422f | 2002-11-22 20:43:01 +0000 | [diff] [blame] | 169 | #define HCURSOR_16(h32) (LOWORD(h32)) |
| 170 | #define HICON_16(h32) (LOWORD(h32)) |
| 171 | #define HINSTANCE_16(h32) (LOWORD(h32)) |
Michael Stefaniuc | bc54d78 | 2002-10-10 21:22:09 +0000 | [diff] [blame] | 172 | |
Alexandre Julliard | a8a422f | 2002-11-22 20:43:01 +0000 | [diff] [blame] | 173 | #define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16)) |
| 174 | #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16)) |
| 175 | #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16)) |
| 176 | #define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16)) |
Michael Stefaniuc | 4a75c5c | 2002-08-28 00:39:39 +0000 | [diff] [blame] | 177 | |
Alexandre Julliard | c6c0944 | 1997-01-12 18:32:19 +0000 | [diff] [blame] | 178 | #endif /* __WINE_USER_H */ |