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
30 extern WORD USER_HeapSel
;
32 #define USER_HEAP_ALLOC(size) \
33 ((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) ))
34 #define USER_HEAP_REALLOC(handle,size) \
35 ((HANDLE)(ULONG_PTR)LOCAL_ReAlloc( USER_HeapSel, LOWORD(handle), (size), LMEM_FIXED ))
36 #define USER_HEAP_FREE(handle) \
37 LOCAL_Free( USER_HeapSel, LOWORD(handle) )
38 #define USER_HEAP_LIN_ADDR(handle) \
39 ((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, LOWORD(handle))) : NULL)
41 #define GET_WORD(ptr) (*(WORD *)(ptr))
42 #define GET_DWORD(ptr) (*(DWORD *)(ptr))
44 #define USUD_LOCALALLOC 0x0001
45 #define USUD_LOCALFREE 0x0002
46 #define USUD_LOCALCOMPACT 0x0003
47 #define USUD_LOCALHEAP 0x0004
48 #define USUD_FIRSTCLASS 0x0005
50 struct tagCURSORICONINFO
;
52 /* internal messages codes */
53 enum wine_internal_message
55 WM_WINE_DESTROYWINDOW
= 0x80000000,
59 WM_WINE_SETWINDOWLONG
,
61 WM_WINE_SETACTIVEWINDOW
,
62 WM_WINE_KEYBOARD_LL_HOOK
,
66 /* internal SendInput codes (FIXME) */
67 #define WINE_INTERNAL_INPUT_MOUSE (16+INPUT_MOUSE)
68 #define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD)
70 typedef struct tagUSER_DRIVER
{
71 /* keyboard functions */
72 void (*pInitKeyboard
)(LPBYTE
);
73 WORD (*pVkKeyScan
)(CHAR
);
74 UINT (*pMapVirtualKey
)(UINT
,UINT
);
75 INT (*pGetKeyNameText
)(LONG
,LPSTR
,INT
);
76 INT (*pToUnicode
)(UINT
, UINT
, LPBYTE
, LPWSTR
, int, UINT
);
79 void (*pInitMouse
)(LPBYTE
);
80 void (*pSetCursor
)(struct tagCURSORICONINFO
*);
81 void (*pGetCursorPos
)(LPPOINT
);
82 void (*pSetCursorPos
)(INT
,INT
);
83 /* screen saver functions */
84 BOOL (*pGetScreenSaveActive
)(void);
85 void (*pSetScreenSaveActive
)(BOOL
);
86 /* clipboard functions */
87 void (*pAcquireClipboard
)(HWND
); /* Acquire selection */
88 BOOL (*pCountClipboardFormats
)(void); /* Count available clipboard formats */
89 void (*pEmptyClipboard
)(void); /* Empty clipboard data */
90 BOOL (*pEndClipboardUpdate
)(void); /* End clipboard update */
91 BOOL (*pEnumClipboardFormats
)(UINT
); /* Enumerate clipboard formats */
92 BOOL (*pGetClipboardData
)(UINT
, HANDLE16
*, HANDLE
*); /* Get specified selection data */
93 BOOL (*pGetClipboardFormatName
)(UINT
, LPSTR
, UINT
); /* Get a clipboard format name */
94 BOOL (*pIsClipboardFormatAvailable
)(UINT
); /* Check if specified format is available */
95 INT (*pRegisterClipboardFormat
)(LPCSTR
); /* Register a clipboard format */
96 void (*pResetSelectionOwner
)(HWND
, BOOL
);
97 BOOL (*pSetClipboardData
)(UINT
, HANDLE16
, HANDLE
); /* Set specified selection data */
99 LONG (*pChangeDisplaySettingsExW
)(LPCWSTR
,LPDEVMODEW
,HWND
,DWORD
,LPVOID
);
100 BOOL (*pEnumDisplaySettingsExW
)(LPCWSTR
,DWORD
,LPDEVMODEW
,DWORD
);
101 /* windowing functions */
102 BOOL (*pCreateWindow
)(HWND
,CREATESTRUCTA
*,BOOL
);
103 BOOL (*pDestroyWindow
)(HWND
);
104 BOOL (*pGetDC
)(HWND
,HDC
,HRGN
,DWORD
);
105 void (*pForceWindowRaise
)(HWND
);
106 DWORD (*pMsgWaitForMultipleObjectsEx
)(DWORD
,const HANDLE
*,DWORD
,DWORD
,DWORD
);
107 void (*pReleaseDC
)(HWND
,HDC
);
108 BOOL (*pScrollDC
)(HDC
,INT
,INT
,const RECT
*,const RECT
*,HRGN
,LPRECT
);
109 INT (*pScrollWindowEx
)(HWND
,INT
,INT
,const RECT
*,const RECT
*,HRGN
,LPRECT
,UINT
);
110 void (*pSetFocus
)(HWND
);
111 HWND (*pSetParent
)(HWND
,HWND
);
112 BOOL (*pSetWindowPos
)(WINDOWPOS
*);
113 int (*pSetWindowRgn
)(HWND
,HRGN
,BOOL
);
114 HICON (*pSetWindowIcon
)(HWND
,HICON
,BOOL
);
115 void (*pSetWindowStyle
)(HWND
,DWORD
);
116 BOOL (*pSetWindowText
)(HWND
,LPCWSTR
);
117 BOOL (*pShowWindow
)(HWND
,INT
);
118 void (*pSysCommandSizeMove
)(HWND
,WPARAM
);
121 extern USER_DRIVER USER_Driver
;
124 extern void USER_Lock(void);
125 extern void USER_Unlock(void);
126 extern void USER_CheckNotLock(void);
128 extern BOOL
USER_IsExitingThread( DWORD tid
);
139 extern WINE_LOOK TWEAK_WineLook
;
141 /* gray brush cache */
142 extern HBRUSH
CACHE_GetPattern55AABrush(void);
145 extern LRESULT
HOOK_CallHooks( INT id
, INT code
, WPARAM wparam
, LPARAM lparam
, BOOL unicode
);
146 extern BOOL
HOOK_IsHooked( INT id
);
149 extern BYTE InputKeyStateTable
[256];
150 extern BYTE AsyncKeyStateTable
[256];
153 extern void SYSCOLOR_Init(void);
154 extern HPEN
SYSCOLOR_GetPen( INT index
);
157 extern void SYSMETRICS_Init(void);
158 extern INT
SYSMETRICS_Set( INT index
, INT value
);
160 /* Wine extensions */
161 #define SM_WINE_BPP (SM_CMETRICS+1) /* screen bpp */
162 #define SM_WINE_CMETRICS SM_WINE_BPP
165 extern void SYSPARAMS_GetDoubleClickSize( INT
*width
, INT
*height
);
166 extern INT
SYSPARAMS_GetMouseButtonSwap( void );
168 extern HPALETTE WINAPI
SelectPalette( HDC hDC
, HPALETTE hPal
, BOOL bForceBackground
);
170 extern BOOL
CLIPBOARD_ReleaseOwner(void);
172 extern DWORD USER16_AlertableWait
;
174 /* HANDLE16 <-> HANDLE conversions */
175 #define HCURSOR_16(h32) (LOWORD(h32))
176 #define HICON_16(h32) (LOWORD(h32))
177 #define HINSTANCE_16(h32) (LOWORD(h32))
179 #define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
180 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
181 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
182 #define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16))
184 #endif /* __WINE_USER_H */