Don't use constructors for ntdll and kernel32 initialization.
[wine/multimedia.git] / include / user.h
blob46756b278257d8db52fc311b0e3c7cfc5c4a7d2e
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 BOOL (*pScrollDC)(HDC,INT,INT,const RECT*,const RECT*,HRGN,LPRECT);
117 INT (*pScrollWindowEx)(HWND,INT,INT,const RECT*,const RECT*,HRGN,LPRECT,UINT);
118 void (*pSetFocus)(HWND);
119 HWND (*pSetParent)(HWND,HWND);
120 BOOL (*pSetWindowPos)(WINDOWPOS *);
121 int (*pSetWindowRgn)(HWND,HRGN,BOOL);
122 void (*pSetWindowIcon)(HWND,UINT,HICON);
123 void (*pSetWindowStyle)(HWND,DWORD);
124 BOOL (*pSetWindowText)(HWND,LPCWSTR);
125 BOOL (*pShowWindow)(HWND,INT);
126 void (*pSysCommandSizeMove)(HWND,WPARAM);
127 } USER_DRIVER;
129 extern USER_DRIVER USER_Driver;
131 /* user lock */
132 extern void USER_Lock(void);
133 extern void USER_Unlock(void);
134 extern void USER_CheckNotLock(void);
136 extern BOOL USER_IsExitingThread( DWORD tid );
138 /* Wine look */
140 typedef enum
142 WIN31_LOOK,
143 WIN95_LOOK,
144 WIN98_LOOK
145 } WINE_LOOK;
147 extern WINE_LOOK TWEAK_WineLook;
149 /* gray brush cache */
150 extern HBRUSH CACHE_GetPattern55AABrush(void);
152 /* hook.c */
153 extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode );
154 extern BOOL HOOK_IsHooked( INT id );
156 /* input.c */
157 extern BYTE InputKeyStateTable[256];
158 extern BYTE AsyncKeyStateTable[256];
160 /* syscolor.c */
161 extern void SYSCOLOR_Init(void);
162 extern HPEN SYSCOLOR_GetPen( INT index );
164 /* sysmetrics.c */
165 extern void SYSMETRICS_Init(void);
166 extern INT SYSMETRICS_Set( INT index, INT value );
168 /* Wine extensions */
169 #define SM_WINE_BPP (SM_CMETRICS+1) /* screen bpp */
170 #define SM_WINE_CMETRICS SM_WINE_BPP
172 /* sysparams.c */
173 extern void SYSPARAMS_GetDoubleClickSize( INT *width, INT *height );
174 extern INT SYSPARAMS_GetMouseButtonSwap( void );
176 extern HPALETTE WINAPI SelectPalette( HDC hDC, HPALETTE hPal, BOOL bForceBackground );
178 extern BOOL CLIPBOARD_ReleaseOwner(void);
180 extern DWORD USER16_AlertableWait;
182 /* HANDLE16 <-> HANDLE conversions */
183 #define HCURSOR_16(h32) (LOWORD(h32))
184 #define HICON_16(h32) (LOWORD(h32))
185 #define HINSTANCE_16(h32) (LOWORD(h32))
187 #define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
188 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
189 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
190 #define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16))
192 #endif /* __WINE_USER_H */