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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_USER_PRIVATE_H
22 #define __WINE_USER_PRIVATE_H
31 extern WORD USER_HeapSel;
33 #define USER_HEAP_ALLOC(size) \
34 ((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) ))
35 #define USER_HEAP_REALLOC(handle,size) \
36 ((HANDLE)(ULONG_PTR)LOCAL_ReAlloc( USER_HeapSel, LOWORD(handle), (size), LMEM_FIXED ))
37 #define USER_HEAP_FREE(handle) \
38 LOCAL_Free( USER_HeapSel, LOWORD(handle) )
39 #define USER_HEAP_LIN_ADDR(handle) \
40 ((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, LOWORD(handle))) : NULL)
42 #define GET_WORD(ptr) (*(const WORD *)(ptr))
43 #define GET_DWORD(ptr) (*(const DWORD *)(ptr))
45 /* internal messages codes */
46 enum wine_internal_message
48 WM_WINE_DESTROYWINDOW = 0x80000000,
52 WM_WINE_SETWINDOWLONG,
54 WM_WINE_SETACTIVEWINDOW,
55 WM_WINE_KEYBOARD_LL_HOOK,
56 WM_WINE_MOUSE_LL_HOOK,
57 WM_WINE_FIRST_DRIVER_MSG = 0x80001000, /* range of messages reserved for the USER driver */
58 WM_WINE_LAST_DRIVER_MSG = 0x80001fff
61 struct tagCURSORICONINFO;
63 typedef struct tagUSER_DRIVER {
64 /* keyboard functions */
65 HKL (*pActivateKeyboardLayout)(HKL, UINT);
67 SHORT (*pGetAsyncKeyState)(INT);
68 INT (*pGetKeyNameText)(LONG, LPWSTR, INT);
69 HKL (*pGetKeyboardLayout)(DWORD);
70 UINT (*pGetKeyboardLayoutList)(INT, HKL *);
71 BOOL (*pGetKeyboardLayoutName)(LPWSTR);
72 HKL (*pLoadKeyboardLayout)(LPCWSTR, UINT);
73 UINT (*pMapVirtualKeyEx)(UINT, UINT, HKL);
74 UINT (*pSendInput)(UINT, LPINPUT, int);
75 INT (*pToUnicodeEx)(UINT, UINT, LPBYTE, LPWSTR, int, UINT, HKL);
76 BOOL (*pUnloadKeyboardLayout)(HKL);
77 SHORT (*pVkKeyScanEx)(WCHAR, HKL);
79 void (*pSetCursor)(struct tagCURSORICONINFO *);
80 BOOL (*pGetCursorPos)(LPPOINT);
81 BOOL (*pSetCursorPos)(INT,INT);
82 /* screen saver functions */
83 BOOL (*pGetScreenSaveActive)(void);
84 void (*pSetScreenSaveActive)(BOOL);
85 /* clipboard functions */
86 void (*pAcquireClipboard)(HWND); /* Acquire selection */
87 BOOL (*pCountClipboardFormats)(void); /* Count available clipboard formats */
88 void (*pEmptyClipboard)(BOOL); /* Empty clipboard data */
89 BOOL (*pEndClipboardUpdate)(void); /* End clipboard update */
90 BOOL (*pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */
91 BOOL (*pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */
92 BOOL (*pGetClipboardFormatName)(UINT, LPWSTR, UINT); /* Get a clipboard format name */
93 BOOL (*pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */
94 INT (*pRegisterClipboardFormat)(LPCWSTR); /* Register a clipboard format */
95 void (*pResetSelectionOwner)(HWND, BOOL);
96 BOOL (*pSetClipboardData)(UINT, HANDLE16, HANDLE, BOOL); /* Set specified selection data */
98 LONG (*pChangeDisplaySettingsExW)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
99 BOOL (*pEnumDisplaySettingsExW)(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
100 /* windowing functions */
101 BOOL (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL);
102 BOOL (*pDestroyWindow)(HWND);
103 BOOL (*pGetDC)(HWND,HDC,HRGN,DWORD);
104 DWORD (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
105 void (*pReleaseDC)(HWND,HDC);
106 BOOL (*pScrollDC)(HDC, INT, INT, const RECT *, const RECT *, HRGN, LPRECT);
107 void (*pSetFocus)(HWND);
108 HWND (*pSetParent)(HWND,HWND);
109 BOOL (*pSetWindowPos)(WINDOWPOS *);
110 int (*pSetWindowRgn)(HWND,HRGN,BOOL);
111 void (*pSetWindowIcon)(HWND,UINT,HICON);
112 void (*pSetWindowStyle)(HWND,DWORD);
113 BOOL (*pSetWindowText)(HWND,LPCWSTR);
114 BOOL (*pShowWindow)(HWND,INT);
115 void (*pSysCommandSizeMove)(HWND,WPARAM);
116 LRESULT (*pWindowMessage)(HWND,UINT,WPARAM,LPARAM);
119 extern USER_DRIVER USER_Driver;
121 extern HMODULE user32_module;
122 extern DWORD USER16_AlertableWait;
124 extern BOOL CLIPBOARD_ReleaseOwner(void);
125 extern BOOL FOCUS_MouseActivate( HWND hwnd );
126 extern BOOL HOOK_IsHooked( INT id );
127 extern void SYSCOLOR_Init(void);
128 extern HPEN SYSCOLOR_GetPen( INT index );
129 extern void SYSPARAMS_Init(void);
130 extern void USER_CheckNotLock(void);
131 extern BOOL USER_IsExitingThread( DWORD tid );
133 /* HANDLE16 <-> HANDLE conversions */
134 #define HCURSOR_16(h32) (LOWORD(h32))
135 #define HICON_16(h32) (LOWORD(h32))
136 #define HINSTANCE_16(h32) (LOWORD(h32))
138 #define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
139 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
140 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
141 #define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16))
143 #endif /* __WINE_USER_PRIVATE_H */