ifdef guard TCHAR declaration like PSDK does.
[wine.git] / include / user.h
blobcf48024ba7c1d63993397e6e3b8bf109d7a18642
1 /*
2 * USER 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_USER_H
22 #define __WINE_USER_H
24 #include <stdarg.h>
25 #include <windef.h>
26 #include <winbase.h>
27 #include <wingdi.h>
28 #include <winuser.h>
30 #include <local.h>
32 extern WORD USER_HeapSel;
34 #define USER_HEAP_ALLOC(size) \
35 ((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) ))
36 #define USER_HEAP_REALLOC(handle,size) \
37 ((HANDLE)(ULONG_PTR)LOCAL_ReAlloc( USER_HeapSel, LOWORD(handle), (size), LMEM_FIXED ))
38 #define USER_HEAP_FREE(handle) \
39 LOCAL_Free( USER_HeapSel, LOWORD(handle) )
40 #define USER_HEAP_LIN_ADDR(handle) \
41 ((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, LOWORD(handle))) : NULL)
43 #define GET_WORD(ptr) (*(WORD *)(ptr))
44 #define GET_DWORD(ptr) (*(DWORD *)(ptr))
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
52 struct tagCURSORICONINFO;
54 /* internal messages codes */
55 enum wine_internal_message
57 WM_WINE_DESTROYWINDOW = 0x80000000,
58 WM_WINE_SETWINDOWPOS,
59 WM_WINE_SHOWWINDOW,
60 WM_WINE_SETPARENT,
61 WM_WINE_SETWINDOWLONG,
62 WM_WINE_ENABLEWINDOW,
63 WM_WINE_SETACTIVEWINDOW,
64 WM_WINE_KEYBOARD_LL_HOOK,
65 WM_WINE_MOUSE_LL_HOOK
68 /* internal SendInput codes (FIXME) */
69 #define WINE_INTERNAL_INPUT_MOUSE (16+INPUT_MOUSE)
70 #define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD)
72 typedef struct tagUSER_DRIVER {
73 /* keyboard functions */
74 void (*pInitKeyboard)(LPBYTE);
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);
85 void (*pBeep)(void);
86 /* mouse functions */
87 void (*pInitMouse)(LPBYTE);
88 void (*pSetCursor)(struct tagCURSORICONINFO *);
89 void (*pGetCursorPos)(LPPOINT);
90 void (*pSetCursorPos)(INT,INT);
91 /* screen saver functions */
92 BOOL (*pGetScreenSaveActive)(void);
93 void (*pSetScreenSaveActive)(BOOL);
94 /* clipboard functions */
95 void (*pAcquireClipboard)(HWND); /* Acquire selection */
96 BOOL (*pCountClipboardFormats)(void); /* Count available clipboard formats */
97 void (*pEmptyClipboard)(void); /* Empty clipboard data */
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 */
104 void (*pResetSelectionOwner)(HWND, BOOL);
105 BOOL (*pSetClipboardData)(UINT, HANDLE16, HANDLE); /* Set specified selection data */
106 /* display modes */
107 LONG (*pChangeDisplaySettingsExW)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
108 BOOL (*pEnumDisplaySettingsExW)(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
109 /* windowing functions */
110 BOOL (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL);
111 BOOL (*pDestroyWindow)(HWND);
112 BOOL (*pGetDC)(HWND,HDC,HRGN,DWORD);
113 void (*pForceWindowRaise)(HWND);
114 DWORD (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
115 void (*pReleaseDC)(HWND,HDC);
116 INT (*pScrollWindowEx)(HWND,INT,INT,const RECT*,const RECT*,HRGN,LPRECT,UINT);
117 void (*pSetFocus)(HWND);
118 HWND (*pSetParent)(HWND,HWND);
119 BOOL (*pSetWindowPos)(WINDOWPOS *);
120 int (*pSetWindowRgn)(HWND,HRGN,BOOL);
121 void (*pSetWindowIcon)(HWND,UINT,HICON);
122 void (*pSetWindowStyle)(HWND,DWORD);
123 BOOL (*pSetWindowText)(HWND,LPCWSTR);
124 BOOL (*pShowWindow)(HWND,INT);
125 void (*pSysCommandSizeMove)(HWND,WPARAM);
126 } USER_DRIVER;
128 extern USER_DRIVER USER_Driver;
130 extern HMODULE user32_module;
132 /* user lock */
133 extern void USER_Lock(void);
134 extern void USER_Unlock(void);
135 extern void USER_CheckNotLock(void);
137 extern BOOL USER_IsExitingThread( DWORD tid );
139 /* gray brush cache */
140 extern HBRUSH CACHE_GetPattern55AABrush(void);
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 );
146 /* input.c */
147 extern BYTE InputKeyStateTable[256];
148 extern BYTE AsyncKeyStateTable[256];
150 /* syscolor.c */
151 extern void SYSCOLOR_Init(void);
152 extern HPEN SYSCOLOR_GetPen( INT index );
154 /* sysmetrics.c */
155 extern void SYSMETRICS_Init(void);
156 extern INT SYSMETRICS_Set( INT index, INT value );
158 /* sysparams.c */
159 extern void SYSPARAMS_GetDoubleClickSize( INT *width, INT *height );
160 extern INT SYSPARAMS_GetMouseButtonSwap( void );
162 extern HPALETTE WINAPI SelectPalette( HDC hDC, HPALETTE hPal, BOOL bForceBackground );
164 extern BOOL CLIPBOARD_ReleaseOwner(void);
166 extern DWORD USER16_AlertableWait;
168 /* HANDLE16 <-> HANDLE conversions */
169 #define HCURSOR_16(h32) (LOWORD(h32))
170 #define HICON_16(h32) (LOWORD(h32))
171 #define HINSTANCE_16(h32) (LOWORD(h32))
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))
178 #endif /* __WINE_USER_H */