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
,
59 struct tagCURSORICONINFO
;
61 typedef struct tagUSER_DRIVER
{
62 /* keyboard functions */
63 void (*pInitKeyboard
)(LPBYTE
);
64 SHORT (*pVkKeyScanEx
)(WCHAR
, HKL
);
65 UINT (*pMapVirtualKeyEx
)(UINT
, UINT
, HKL
);
66 INT (*pGetKeyNameText
)(LONG
, LPWSTR
, INT
);
67 INT (*pToUnicodeEx
)(UINT
, UINT
, LPBYTE
, LPWSTR
, int, UINT
, HKL
);
68 UINT (*pGetKeyboardLayoutList
)(INT
, HKL
*);
69 HKL (*pGetKeyboardLayout
)(DWORD
);
70 BOOL (*pGetKeyboardLayoutName
)(LPWSTR
);
71 HKL (*pLoadKeyboardLayout
)(LPCWSTR
, UINT
);
72 HKL (*pActivateKeyboardLayout
)(HKL
, UINT
);
73 BOOL (*pUnloadKeyboardLayout
)(HKL
);
76 void (*pInitMouse
)(LPBYTE
);
77 void (*pSetCursor
)(struct tagCURSORICONINFO
*);
78 void (*pGetCursorPos
)(LPPOINT
);
79 void (*pSetCursorPos
)(INT
,INT
);
80 /* screen saver functions */
81 BOOL (*pGetScreenSaveActive
)(void);
82 void (*pSetScreenSaveActive
)(BOOL
);
83 /* clipboard functions */
84 void (*pAcquireClipboard
)(HWND
); /* Acquire selection */
85 BOOL (*pCountClipboardFormats
)(void); /* Count available clipboard formats */
86 void (*pEmptyClipboard
)(BOOL
); /* Empty clipboard data */
87 BOOL (*pEndClipboardUpdate
)(void); /* End clipboard update */
88 BOOL (*pEnumClipboardFormats
)(UINT
); /* Enumerate clipboard formats */
89 BOOL (*pGetClipboardData
)(UINT
, HANDLE16
*, HANDLE
*); /* Get specified selection data */
90 BOOL (*pGetClipboardFormatName
)(UINT
, LPWSTR
, UINT
); /* Get a clipboard format name */
91 BOOL (*pIsClipboardFormatAvailable
)(UINT
); /* Check if specified format is available */
92 INT (*pRegisterClipboardFormat
)(LPCWSTR
); /* Register a clipboard format */
93 void (*pResetSelectionOwner
)(HWND
, BOOL
);
94 BOOL (*pSetClipboardData
)(UINT
, HANDLE16
, HANDLE
, BOOL
); /* Set specified selection data */
96 LONG (*pChangeDisplaySettingsExW
)(LPCWSTR
,LPDEVMODEW
,HWND
,DWORD
,LPVOID
);
97 BOOL (*pEnumDisplaySettingsExW
)(LPCWSTR
,DWORD
,LPDEVMODEW
,DWORD
);
98 /* windowing functions */
99 BOOL (*pCreateWindow
)(HWND
,CREATESTRUCTA
*,BOOL
);
100 BOOL (*pDestroyWindow
)(HWND
);
101 BOOL (*pGetDC
)(HWND
,HDC
,HRGN
,DWORD
);
102 DWORD (*pMsgWaitForMultipleObjectsEx
)(DWORD
,const HANDLE
*,DWORD
,DWORD
,DWORD
);
103 void (*pReleaseDC
)(HWND
,HDC
);
104 BOOL (*pScrollDC
)(HDC
, INT
, INT
, const RECT
*, const RECT
*, HRGN
, LPRECT
);
105 void (*pSetFocus
)(HWND
);
106 HWND (*pSetParent
)(HWND
,HWND
);
107 BOOL (*pSetWindowPos
)(WINDOWPOS
*);
108 int (*pSetWindowRgn
)(HWND
,HRGN
,BOOL
);
109 void (*pSetWindowIcon
)(HWND
,UINT
,HICON
);
110 void (*pSetWindowStyle
)(HWND
,DWORD
);
111 BOOL (*pSetWindowText
)(HWND
,LPCWSTR
);
112 BOOL (*pShowWindow
)(HWND
,INT
);
113 void (*pSysCommandSizeMove
)(HWND
,WPARAM
);
116 extern USER_DRIVER USER_Driver
;
118 extern HMODULE user32_module
;
119 extern BYTE InputKeyStateTable
[256];
120 extern BYTE AsyncKeyStateTable
[256];
121 extern DWORD USER16_AlertableWait
;
123 extern BOOL
CLIPBOARD_ReleaseOwner(void);
124 extern BOOL
FOCUS_MouseActivate( HWND hwnd
);
125 extern BOOL
HOOK_IsHooked( INT id
);
126 extern void SYSCOLOR_Init(void);
127 extern HPEN
SYSCOLOR_GetPen( INT index
);
128 extern void SYSPARAMS_Init(void);
129 extern void USER_CheckNotLock(void);
130 extern BOOL
USER_IsExitingThread( DWORD tid
);
132 /* HANDLE16 <-> HANDLE conversions */
133 #define HCURSOR_16(h32) (LOWORD(h32))
134 #define HICON_16(h32) (LOWORD(h32))
135 #define HINSTANCE_16(h32) (LOWORD(h32))
137 #define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
138 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
139 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
140 #define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16))
142 #endif /* __WINE_USER_PRIVATE_H */