Added an implementation of iphlpapi.dll; most Get* functions
[wine.git] / include / user.h
blob752ecc16b05b5e521dc0547a3ad4d5f2c7013811
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 "winbase.h"
25 #include "wingdi.h"
26 #include "winuser.h"
28 #include "local.h"
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,
56 WM_WINE_SETWINDOWPOS,
57 WM_WINE_SHOWWINDOW,
58 WM_WINE_SETPARENT,
59 WM_WINE_SETWINDOWLONG,
60 WM_WINE_ENABLEWINDOW,
61 WM_WINE_SETACTIVEWINDOW
64 /* internal SendInput codes (FIXME) */
65 #define WINE_INTERNAL_INPUT_MOUSE (16+INPUT_MOUSE)
66 #define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD)
68 typedef struct tagUSER_DRIVER {
69 /* keyboard functions */
70 void (*pInitKeyboard)(LPBYTE);
71 WORD (*pVkKeyScan)(CHAR);
72 UINT (*pMapVirtualKey)(UINT,UINT);
73 INT (*pGetKeyNameText)(LONG,LPSTR,INT);
74 INT (*pToUnicode)(UINT, UINT, LPBYTE, LPWSTR, int, UINT);
75 void (*pBeep)(void);
76 /* mouse functions */
77 void (*pInitMouse)(LPBYTE);
78 void (*pSetCursor)(struct tagCURSORICONINFO *);
79 void (*pGetCursorPos)(LPPOINT);
80 void (*pSetCursorPos)(INT,INT);
81 /* screen saver functions */
82 BOOL (*pGetScreenSaveActive)(void);
83 void (*pSetScreenSaveActive)(BOOL);
84 /* clipboard functions */
85 void (*pAcquireClipboard)(void); /* Acquire selection */
86 void (*pReleaseClipboard)(void); /* Release selection */
87 void (*pSetClipboardData)(UINT); /* Set specified selection data */
88 BOOL (*pGetClipboardData)(UINT); /* Get specified selection data */
89 BOOL (*pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */
90 INT (*pRegisterClipboardFormat)(LPCSTR); /* Register a clipboard format */
91 BOOL (*pGetClipboardFormatName)(UINT, LPSTR, UINT); /* Get a clipboard format name */
92 BOOL (*pIsSelectionOwner)(void); /* Check if we own the selection */
93 void (*pResetSelectionOwner)(HWND, BOOL);
94 /* display modes */
95 LONG (*pChangeDisplaySettingsExW)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
96 BOOL (*pEnumDisplaySettingsExW)(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
97 /* windowing functions */
98 BOOL (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL);
99 BOOL (*pDestroyWindow)(HWND);
100 BOOL (*pGetDC)(HWND,HDC,HRGN,DWORD);
101 void (*pForceWindowRaise)(HWND);
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 INT (*pScrollWindowEx)(HWND,INT,INT,const RECT*,const RECT*,HRGN,LPRECT,UINT);
106 void (*pSetFocus)(HWND);
107 HWND (*pSetParent)(HWND,HWND);
108 BOOL (*pSetWindowPos)(WINDOWPOS *);
109 int (*pSetWindowRgn)(HWND,HRGN,BOOL);
110 HICON (*pSetWindowIcon)(HWND,HICON,BOOL);
111 void (*pSetWindowStyle)(HWND,DWORD);
112 BOOL (*pSetWindowText)(HWND,LPCWSTR);
113 BOOL (*pShowWindow)(HWND,INT);
114 void (*pSysCommandSizeMove)(HWND,WPARAM);
115 } USER_DRIVER;
117 extern USER_DRIVER USER_Driver;
119 WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID,
120 DWORD dwFlags, HMODULE16 hModule );
122 /* user lock */
123 extern void USER_Lock(void);
124 extern void USER_Unlock(void);
125 extern void USER_CheckNotLock(void);
127 extern BOOL USER_IsExitingThread( DWORD tid );
129 /* Wine look */
131 typedef enum
133 WIN31_LOOK,
134 WIN95_LOOK,
135 WIN98_LOOK
136 } WINE_LOOK;
138 extern WINE_LOOK TWEAK_WineLook;
140 /* gray brush cache */
141 extern HBRUSH CACHE_GetPattern55AABrush(void);
143 /* hook.c */
144 extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode );
145 extern BOOL HOOK_IsHooked( INT id );
147 /* input.c */
148 extern BYTE InputKeyStateTable[256];
149 extern BYTE AsyncKeyStateTable[256];
151 /* syscolor.c */
152 extern void SYSCOLOR_Init(void);
153 extern HPEN SYSCOLOR_GetPen( INT index );
155 /* sysmetrics.c */
156 extern void SYSMETRICS_Init(void);
157 extern INT SYSMETRICS_Set( INT index, INT value );
159 /* Wine extensions */
160 #define SM_WINE_BPP (SM_CMETRICS+1) /* screen bpp */
161 #define SM_WINE_CMETRICS SM_WINE_BPP
163 /* sysparams.c */
164 extern void SYSPARAMS_GetDoubleClickSize( INT *width, INT *height );
165 extern INT SYSPARAMS_GetMouseButtonSwap( void );
167 extern HPALETTE WINAPI SelectPalette( HDC hDC, HPALETTE hPal, BOOL bForceBackground );
169 extern DWORD USER16_AlertableWait;
171 /* HANDLE16 <-> HANDLE conversions */
172 #define HCURSOR_16(h32) (LOWORD(h32))
173 #define HICON_16(h32) (LOWORD(h32))
174 #define HINSTANCE_16(h32) (LOWORD(h32))
176 #define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
177 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
178 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
179 #define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16))
181 #endif /* __WINE_USER_H */