Window activation cleanups.
[wine] / include / user.h
1 /*
2  * USER definitions
3  *
4  * Copyright 1993 Alexandre Julliard
5  */
6
7 #ifndef __WINE_USER_H
8 #define __WINE_USER_H
9
10 #include "winbase.h"
11 #include "wingdi.h"
12 #include "winuser.h"
13
14 #include "local.h"
15
16 extern WORD USER_HeapSel;
17
18 #define USER_HEAP_ALLOC(size) \
19             LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) )
20 #define USER_HEAP_REALLOC(handle,size) \
21             LOCAL_ReAlloc( USER_HeapSel, (handle), (size), LMEM_FIXED )
22 #define USER_HEAP_FREE(handle) \
23             LOCAL_Free( USER_HeapSel, (handle) )
24 #define USER_HEAP_LIN_ADDR(handle)  \
25          ((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, (handle))) : NULL)
26
27 #define USUD_LOCALALLOC        0x0001
28 #define USUD_LOCALFREE         0x0002
29 #define USUD_LOCALCOMPACT      0x0003
30 #define USUD_LOCALHEAP         0x0004
31 #define USUD_FIRSTCLASS        0x0005
32
33 struct tagCURSORICONINFO;
34
35 /* internal messages codes */
36 enum wine_internal_message
37 {
38     WM_WINE_DESTROYWINDOW = 0x80000000,
39     WM_WINE_SETWINDOWPOS,
40     WM_WINE_SHOWWINDOW,
41     WM_WINE_SETPARENT,
42     WM_WINE_SETWINDOWLONG,
43     WM_WINE_ENABLEWINDOW
44 };
45
46 /* internal SendInput codes (FIXME) */
47 #define WINE_INTERNAL_INPUT_MOUSE    (16+INPUT_MOUSE)
48 #define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD)
49
50 typedef struct tagUSER_DRIVER {
51     /* keyboard functions */
52     void   (*pInitKeyboard)(LPBYTE);
53     WORD   (*pVkKeyScan)(CHAR);
54     UINT   (*pMapVirtualKey)(UINT,UINT);
55     INT    (*pGetKeyNameText)(LONG,LPSTR,INT);
56     INT    (*pToUnicode)(UINT, UINT, LPBYTE, LPWSTR, int, UINT);
57     void   (*pBeep)(void);
58     /* mouse functions */
59     void   (*pInitMouse)(LPBYTE);
60     void   (*pSetCursor)(struct tagCURSORICONINFO *);
61     void   (*pGetCursorPos)(LPPOINT);
62     void   (*pSetCursorPos)(INT,INT);
63     /* screen saver functions */
64     BOOL   (*pGetScreenSaveActive)(void);
65     void   (*pSetScreenSaveActive)(BOOL);
66     int    (*pGetScreenSaveTimeout)(void);
67     void   (*pSetScreenSaveTimeout)(int);
68     /* resource functions */
69     HANDLE (*pLoadOEMResource)(WORD,WORD);
70     /* clipboard functions */
71     void   (*pAcquireClipboard)(void);            /* Acquire selection */
72     void   (*pReleaseClipboard)(void);            /* Release selection */
73     void   (*pSetClipboardData)(UINT);            /* Set specified selection data */
74     BOOL   (*pGetClipboardData)(UINT);            /* Get specified selection data */
75     BOOL   (*pIsClipboardFormatAvailable)(UINT);  /* Check if specified format is available */
76     BOOL   (*pRegisterClipboardFormat)(LPCSTR);   /* Register a clipboard format */
77     BOOL   (*pIsSelectionOwner)(void);            /* Check if we own the selection */
78     void   (*pResetSelectionOwner)(HWND, BOOL);
79
80     /* windowing functions */
81     BOOL   (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL);
82     BOOL   (*pDestroyWindow)(HWND);
83     BOOL   (*pGetDC)(HWND,HDC,HRGN,DWORD);
84     void   (*pForceWindowRaise)(HWND);
85     DWORD  (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
86     BOOL   (*pScrollDC)(HDC,INT,INT,const RECT*,const RECT*,HRGN,LPRECT);
87     INT    (*pScrollWindowEx)(HWND,INT,INT,const RECT*,const RECT*,HRGN,LPRECT,UINT);
88     void   (*pSetFocus)(HWND);
89     HWND   (*pSetParent)(HWND,HWND);
90     BOOL   (*pSetWindowPos)(WINDOWPOS *);
91     int    (*pSetWindowRgn)(HWND,HRGN,BOOL);
92     HICON  (*pSetWindowIcon)(HWND,HICON,BOOL);
93     void   (*pSetWindowStyle)(HWND,DWORD);
94     BOOL   (*pSetWindowText)(HWND,LPCWSTR);
95     BOOL   (*pShowWindow)(HWND,INT);
96     void   (*pSysCommandSizeMove)(HWND,WPARAM);
97 } USER_DRIVER;
98
99 extern USER_DRIVER USER_Driver;
100
101 WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID,
102                             DWORD dwFlags, HMODULE16 hModule );
103
104 /* user lock */
105 extern void USER_Lock(void);
106 extern void USER_Unlock(void);
107 extern void USER_CheckNotLock(void);
108
109 extern BOOL USER_IsExitingThread( DWORD tid );
110
111 /* Wine look */
112
113 typedef enum
114 {
115     WIN31_LOOK,
116     WIN95_LOOK,
117     WIN98_LOOK
118 } WINE_LOOK;
119
120 extern WINE_LOOK TWEAK_WineLook;
121
122 /* gray brush cache */
123 extern HBRUSH CACHE_GetPattern55AABrush(void);
124
125 #endif  /* __WINE_USER_H */