Renamed the COMCTL32_* functions to use the exported name.
[wine] / include / user.h
1 /*
2  * USER definitions
3  *
4  * Copyright 1993 Alexandre Julliard
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #ifndef __WINE_USER_H
22 #define __WINE_USER_H
23
24 #include <stdarg.h>
25 #include <windef.h>
26 #include <winbase.h>
27 #include <wingdi.h>
28 #include <winuser.h>
29
30 #include <local.h>
31
32 extern WORD USER_HeapSel;
33
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)
42
43 #define GET_WORD(ptr)  (*(WORD *)(ptr))
44 #define GET_DWORD(ptr) (*(DWORD *)(ptr))
45
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
51
52 struct tagCURSORICONINFO;
53
54 /* internal messages codes */
55 enum wine_internal_message
56 {
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
66 };
67
68 /* internal SendInput codes (FIXME) */
69 #define WINE_INTERNAL_INPUT_MOUSE    (16+INPUT_MOUSE)
70 #define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD)
71
72 typedef struct tagUSER_DRIVER {
73     /* keyboard functions */
74     void   (*pInitKeyboard)(LPBYTE);
75     WORD   (*pVkKeyScan)(CHAR);
76     UINT   (*pMapVirtualKey)(UINT,UINT);
77     INT    (*pGetKeyNameText)(LONG,LPSTR,INT);
78     INT    (*pToUnicode)(UINT, UINT, LPBYTE, LPWSTR, int, UINT);
79     void   (*pBeep)(void);
80     /* mouse functions */
81     void   (*pInitMouse)(LPBYTE);
82     void   (*pSetCursor)(struct tagCURSORICONINFO *);
83     void   (*pGetCursorPos)(LPPOINT);
84     void   (*pSetCursorPos)(INT,INT);
85     /* screen saver functions */
86     BOOL   (*pGetScreenSaveActive)(void);
87     void   (*pSetScreenSaveActive)(BOOL);
88     /* clipboard functions */
89     void   (*pAcquireClipboard)(HWND);                     /* Acquire selection */
90     BOOL   (*pCountClipboardFormats)(void);                /* Count available clipboard formats */
91     void   (*pEmptyClipboard)(void);                       /* Empty clipboard data */
92     BOOL   (*pEndClipboardUpdate)(void);                   /* End clipboard update */
93     BOOL   (*pEnumClipboardFormats)(UINT);                 /* Enumerate clipboard formats */
94     BOOL   (*pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */
95     BOOL   (*pGetClipboardFormatName)(UINT, LPSTR, UINT);  /* Get a clipboard format name */
96     BOOL   (*pIsClipboardFormatAvailable)(UINT);           /* Check if specified format is available */
97     INT    (*pRegisterClipboardFormat)(LPCSTR);            /* Register a clipboard format */
98     void   (*pResetSelectionOwner)(HWND, BOOL);
99     BOOL   (*pSetClipboardData)(UINT, HANDLE16, HANDLE);   /* Set specified selection data */
100     /* display modes */
101     LONG   (*pChangeDisplaySettingsExW)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
102     BOOL   (*pEnumDisplaySettingsExW)(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
103     /* windowing functions */
104     BOOL   (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL);
105     BOOL   (*pDestroyWindow)(HWND);
106     BOOL   (*pGetDC)(HWND,HDC,HRGN,DWORD);
107     void   (*pForceWindowRaise)(HWND);
108     DWORD  (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
109     void   (*pReleaseDC)(HWND,HDC);
110     BOOL   (*pScrollDC)(HDC,INT,INT,const RECT*,const RECT*,HRGN,LPRECT);
111     INT    (*pScrollWindowEx)(HWND,INT,INT,const RECT*,const RECT*,HRGN,LPRECT,UINT);
112     void   (*pSetFocus)(HWND);
113     HWND   (*pSetParent)(HWND,HWND);
114     BOOL   (*pSetWindowPos)(WINDOWPOS *);
115     int    (*pSetWindowRgn)(HWND,HRGN,BOOL);
116     HICON  (*pSetWindowIcon)(HWND,HICON,BOOL);
117     void   (*pSetWindowStyle)(HWND,DWORD);
118     BOOL   (*pSetWindowText)(HWND,LPCWSTR);
119     BOOL   (*pShowWindow)(HWND,INT);
120     void   (*pSysCommandSizeMove)(HWND,WPARAM);
121 } USER_DRIVER;
122
123 extern USER_DRIVER USER_Driver;
124
125 /* user lock */
126 extern void USER_Lock(void);
127 extern void USER_Unlock(void);
128 extern void USER_CheckNotLock(void);
129
130 extern BOOL USER_IsExitingThread( DWORD tid );
131
132 /* Wine look */
133
134 typedef enum
135 {
136     WIN31_LOOK,
137     WIN95_LOOK,
138     WIN98_LOOK
139 } WINE_LOOK;
140
141 extern WINE_LOOK TWEAK_WineLook;
142
143 /* gray brush cache */
144 extern HBRUSH CACHE_GetPattern55AABrush(void);
145
146 /* hook.c */
147 extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode );
148 extern BOOL HOOK_IsHooked( INT id );
149
150 /* input.c */
151 extern BYTE InputKeyStateTable[256];
152 extern BYTE AsyncKeyStateTable[256];
153
154 /* syscolor.c */
155 extern void SYSCOLOR_Init(void);
156 extern HPEN SYSCOLOR_GetPen( INT index );
157
158 /* sysmetrics.c */
159 extern void SYSMETRICS_Init(void);
160 extern INT SYSMETRICS_Set( INT index, INT value );
161
162 /* Wine extensions */
163 #define SM_WINE_BPP (SM_CMETRICS+1)  /* screen bpp */
164 #define SM_WINE_CMETRICS SM_WINE_BPP
165
166 /* sysparams.c */
167 extern void SYSPARAMS_GetDoubleClickSize( INT *width, INT *height );
168 extern INT SYSPARAMS_GetMouseButtonSwap( void );
169
170 extern HPALETTE WINAPI SelectPalette( HDC hDC, HPALETTE hPal, BOOL bForceBackground );
171
172 extern BOOL CLIPBOARD_ReleaseOwner(void);
173
174 extern DWORD USER16_AlertableWait;
175
176 /* HANDLE16 <-> HANDLE conversions */
177 #define HCURSOR_16(h32)    (LOWORD(h32))
178 #define HICON_16(h32)      (LOWORD(h32))
179 #define HINSTANCE_16(h32)  (LOWORD(h32))
180
181 #define HCURSOR_32(h16)    ((HCURSOR)(ULONG_PTR)(h16))
182 #define HICON_32(h16)      ((HICON)(ULONG_PTR)(h16))
183 #define HINSTANCE_32(h16)  ((HINSTANCE)(ULONG_PTR)(h16))
184 #define HMODULE_32(h16)    ((HMODULE)(ULONG_PTR)(h16))
185
186 #endif  /* __WINE_USER_H */