[4] | 1 | /*
|
---|
| 2 | * Window definitions
|
---|
| 3 | *
|
---|
| 4 | * Copyright 1993 Alexandre Julliard
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | #ifndef __WINE_WIN_H
|
---|
| 8 | #define __WINE_WIN_H
|
---|
| 9 |
|
---|
| 10 | #include "queue.h"
|
---|
| 11 | #include "class.h"
|
---|
| 12 |
|
---|
| 13 | #define WND_MAGIC 0x444e4957 /* 'WIND' */
|
---|
| 14 |
|
---|
| 15 | /* Built-in class names (see _Undocumented_Windows_ p.418) */
|
---|
[4466] | 16 | #ifndef POPUPMENU_CLASS_NAME
|
---|
[4] | 17 | #define POPUPMENU_CLASS_NAME "#32768" /* PopupMenu */
|
---|
[4466] | 18 | #endif
|
---|
| 19 | #ifndef DESKTOP_CLASS_NAME
|
---|
[4] | 20 | #define DESKTOP_CLASS_NAME "#32769" /* Desktop */
|
---|
[4466] | 21 | #endif
|
---|
| 22 | #ifndef DIALOG_CLASS_NAME
|
---|
[4] | 23 | #define DIALOG_CLASS_NAME "#32770" /* Dialog */
|
---|
[4466] | 24 | #endif
|
---|
| 25 | #ifndef WINSWITCH_CLASS_NAME
|
---|
[4] | 26 | #define WINSWITCH_CLASS_NAME "#32771" /* WinSwitch */
|
---|
[4466] | 27 | #endif
|
---|
| 28 | #ifndef ICONTITLE_CLASS_NAME
|
---|
[4] | 29 | #define ICONTITLE_CLASS_NAME "#32772" /* IconTitle */
|
---|
[4466] | 30 | #endif
|
---|
[4] | 31 |
|
---|
[4466] | 32 | #ifndef POPUPMENU_CLASS_ATOM
|
---|
[4] | 33 | #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
|
---|
[4466] | 34 | #endif
|
---|
| 35 | #ifndef DESKTOP_CLASS_ATOM
|
---|
[4] | 36 | #define DESKTOP_CLASS_ATOM ((ATOM)32769) /* Desktop */
|
---|
[4466] | 37 | #endif
|
---|
| 38 | #ifndef DIALOG_CLASS_ATOM
|
---|
[4] | 39 | #define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
|
---|
[4466] | 40 | #endif
|
---|
| 41 | #ifndef WINSWITCH_CLASS_ATOM
|
---|
[4] | 42 | #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
|
---|
[4466] | 43 | #endif
|
---|
| 44 | #ifndef ICONTITLE_CLASS_ATOM
|
---|
[4] | 45 | #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
|
---|
[4466] | 46 | #endif
|
---|
[4] | 47 |
|
---|
| 48 | /* Built-in 32-bit classes */
|
---|
| 49 | typedef enum
|
---|
| 50 | {
|
---|
| 51 | BIC32_BUTTON,
|
---|
| 52 | BIC32_EDIT,
|
---|
| 53 | BIC32_LISTBOX,
|
---|
| 54 | BIC32_COMBO,
|
---|
| 55 | BIC32_COMBOLB,
|
---|
| 56 | BIC32_POPUPMENU,
|
---|
| 57 | BIC32_STATIC,
|
---|
| 58 | BIC32_SCROLL,
|
---|
| 59 | BIC32_MDICLIENT,
|
---|
| 60 | BIC32_DESKTOP,
|
---|
| 61 | BIC32_DIALOG,
|
---|
| 62 | BIC32_ICONTITLE,
|
---|
| 63 | BIC32_NB_CLASSES
|
---|
| 64 | } BUILTIN_CLASS32;
|
---|
| 65 |
|
---|
| 66 | /* PAINT_RedrawWindow() control flags */
|
---|
| 67 | #define RDW_EX_USEHRGN 0x0001
|
---|
| 68 | #define RDW_EX_DELETEHRGN 0x0002
|
---|
| 69 | #define RDW_EX_XYWINDOW 0x0004
|
---|
| 70 | #define RDW_EX_TOPFRAME 0x0010
|
---|
| 71 |
|
---|
| 72 | struct tagCLASS;
|
---|
| 73 | struct tagDCE;
|
---|
| 74 | struct tagDC;
|
---|
| 75 | struct tagWND_DRIVER;
|
---|
| 76 |
|
---|
| 77 | typedef struct tagWND
|
---|
| 78 | {
|
---|
[6445] | 79 | struct tagWND *parent;
|
---|
| 80 | struct tagWND *child;
|
---|
| 81 | struct tagWND *next;
|
---|
| 82 | struct tagWND *owner;
|
---|
[8544] | 83 | void *pVScroll; /* Vertical scroll-bar info */
|
---|
| 84 | void *pHScroll; /* Horizontal scroll-bar info */
|
---|
[6445] | 85 | HWND hwndSelf; /* Handle of this window */
|
---|
| 86 | HINSTANCE hInstance; /* Window hInstance (from CreateWindow) */
|
---|
[4] | 87 | DWORD dwStyle; /* Window style (from CreateWindow) */
|
---|
| 88 | DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
|
---|
[6445] | 89 | UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
|
---|
| 90 | HMENU hSysMenu; /* window's copy of System Menu */
|
---|
| 91 | RECT rectClient;
|
---|
| 92 | RECT rectWindow;
|
---|
| 93 | LPWSTR text; /* Window text */
|
---|
| 94 | DWORD cbWndExtra;
|
---|
[8544] | 95 | DWORD flags;
|
---|
[6445] | 96 | DWORD wExtra[1];
|
---|
[4] | 97 | } WND;
|
---|
| 98 |
|
---|
| 99 | /* Host attributes */
|
---|
| 100 |
|
---|
| 101 | #define HAK_BITGRAVITY 1
|
---|
| 102 | #define HAK_ACCEPTFOCUS 2
|
---|
| 103 | #define HAK_ICONICSTATE 3
|
---|
| 104 |
|
---|
| 105 | /* Bit Gravity */
|
---|
| 106 |
|
---|
| 107 | #define BGForget 0
|
---|
| 108 | #define BGNorthWest 1
|
---|
| 109 | #define BGNorth 2
|
---|
| 110 | #define BGNorthEast 3
|
---|
| 111 | #define BGWest 4
|
---|
| 112 | #define BGCenter 5
|
---|
| 113 | #define BGEast 6
|
---|
| 114 | #define BGSouthWest 7
|
---|
| 115 | #define BGSouth 8
|
---|
| 116 | #define BGSouthEast 9
|
---|
| 117 | #define BGStatic 10
|
---|
| 118 |
|
---|
| 119 | typedef struct tagWND_DRIVER
|
---|
| 120 | {
|
---|
| 121 | void (*pInitialize)(WND *);
|
---|
| 122 | void (*pFinalize)(WND *);
|
---|
| 123 | BOOL (*pCreateDesktopWindow)(WND *, struct tagCLASS *, BOOL);
|
---|
| 124 | BOOL (*pCreateWindow)(WND *, struct tagCLASS *, CREATESTRUCTA *, BOOL);
|
---|
| 125 | BOOL (*pDestroyWindow)(WND *);
|
---|
| 126 | WND* (*pSetParent)(WND *, WND *);
|
---|
| 127 | void (*pForceWindowRaise)(WND *);
|
---|
| 128 | void (*pSetWindowPos)(WND *, const WINDOWPOS *, BOOL);
|
---|
| 129 | void (*pSetText)(WND *, LPCSTR);
|
---|
| 130 | void (*pSetFocus)(WND *);
|
---|
| 131 | void (*pPreSizeMove)(WND *);
|
---|
| 132 | void (*pPostSizeMove)(WND *);
|
---|
| 133 | void (*pSurfaceCopy)(WND *, struct tagDC *, INT, INT, const RECT *, BOOL);
|
---|
| 134 | void (*pSetDrawable)(WND *, struct tagDC *, WORD, BOOL);
|
---|
| 135 | BOOL (*pSetHostAttr)(WND *, INT haKey, INT value);
|
---|
| 136 | BOOL (*pIsSelfClipping)(WND *);
|
---|
| 137 | } WND_DRIVER;
|
---|
| 138 |
|
---|
| 139 | extern WND_DRIVER *WND_Driver;
|
---|
| 140 |
|
---|
| 141 | typedef struct
|
---|
| 142 | {
|
---|
| 143 | RECT16 rectNormal;
|
---|
| 144 | POINT16 ptIconPos;
|
---|
| 145 | POINT16 ptMaxPos;
|
---|
| 146 | HWND16 hwndIconTitle;
|
---|
| 147 | } INTERNALPOS, *LPINTERNALPOS;
|
---|
| 148 |
|
---|
| 149 | /* WND flags values */
|
---|
| 150 | #define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
|
---|
| 151 | #define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
|
---|
| 152 | #define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
|
---|
| 153 | #define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
|
---|
| 154 | #define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
|
---|
| 155 | #define WIN_NATIVE 0x0020 /* Directly mapped to the window provided by the driver */
|
---|
| 156 | #define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
|
---|
| 157 | #define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
|
---|
| 158 | #define WIN_MANAGED 0x0100 /* Window managed by the window system */
|
---|
| 159 | #define WIN_ISDIALOG 0x0200 /* Window is a dialog */
|
---|
| 160 | #define WIN_ISWIN32 0x0400 /* Understands Win32 messages */
|
---|
[4466] | 161 | #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0800 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
|
---|
[4] | 162 |
|
---|
| 163 | /* BuildWinArray() flags */
|
---|
| 164 | #define BWA_SKIPDISABLED 0x0001
|
---|
| 165 | #define BWA_SKIPHIDDEN 0x0002
|
---|
| 166 | #define BWA_SKIPOWNED 0x0004
|
---|
| 167 | #define BWA_SKIPICONIC 0x0008
|
---|
| 168 |
|
---|
| 169 | /* Window functions */
|
---|
| 170 | extern void WIN_LockWnds();
|
---|
| 171 | extern void WIN_UnlockWnds();
|
---|
| 172 | extern int WIN_SuspendWndsLock();
|
---|
| 173 | extern void WIN_RestoreWndsLock(int ipreviousLock);
|
---|
| 174 | extern WND* WIN_FindWndPtr( HWND hwnd );
|
---|
| 175 | extern WND* WIN_LockWndPtr(WND *wndPtr);
|
---|
| 176 | extern void WIN_ReleaseWndPtr(WND *wndPtr);
|
---|
| 177 | extern void WIN_UpdateWndPtr(WND **oldPtr,WND *newPtr);
|
---|
| 178 | extern WND* WIN_GetDesktop(void);
|
---|
| 179 | extern void WIN_ReleaseDesktop(void);
|
---|
| 180 | extern void WIN_DumpWindow( HWND hwnd );
|
---|
| 181 | extern void WIN_WalkWindows( HWND hwnd, int indent );
|
---|
| 182 | extern BOOL WIN_UnlinkWindow( HWND hwnd );
|
---|
| 183 | extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
|
---|
| 184 | extern HWND WIN_FindWinToRepaint( HWND hwnd, HQUEUE16 hQueue );
|
---|
| 185 | extern BOOL WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew);
|
---|
| 186 | extern BOOL WIN_CreateDesktopWindow(void);
|
---|
| 187 | extern HWND WIN_GetTopParent( HWND hwnd );
|
---|
| 188 | extern WND* WIN_GetTopParentPtr( WND* pWnd );
|
---|
| 189 | extern BOOL WIN_IsWindowDrawable(WND*, BOOL );
|
---|
| 190 | extern HINSTANCE WIN_GetWindowInstance( HWND hwnd );
|
---|
| 191 | extern WND** WIN_BuildWinArray( WND *wndPtr, UINT bwa, UINT* pnum );
|
---|
| 192 | extern void WIN_ReleaseWinArray(WND **wndArray);
|
---|
| 193 |
|
---|
| 194 | extern HWND CARET_GetHwnd(void);
|
---|
| 195 | extern void CARET_GetRect(LPRECT lprc); /* windows/caret.c */
|
---|
| 196 |
|
---|
| 197 | extern BOOL16 DRAG_QueryUpdate( HWND, SEGPTR, BOOL );
|
---|
| 198 | extern void DEFWND_SetText( WND *wndPtr, LPCSTR text );
|
---|
| 199 | extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT16 ctlType ); /* windows/defwnd.c */
|
---|
| 200 |
|
---|
| 201 | extern void PROPERTY_RemoveWindowProps( WND *pWnd ); /* windows/property.c */
|
---|
| 202 |
|
---|
| 203 | extern BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
|
---|
| 204 | HRGN hrgnUpdate, UINT flags,
|
---|
| 205 | UINT control ); /* windows/painting.c */
|
---|
| 206 | extern HRGN WIN_UpdateNCRgn(WND* wnd, BOOL bUpdate, BOOL bForce); /* windows/painting.c */
|
---|
| 207 |
|
---|
| 208 |
|
---|
| 209 | /* controls/widgets.c */
|
---|
| 210 | extern BOOL WIDGETS_Init( void );
|
---|
| 211 | extern BOOL WIDGETS_IsControl( WND* pWnd, BUILTIN_CLASS32 cls );
|
---|
| 212 |
|
---|
| 213 | /* controls/icontitle.c */
|
---|
[8544] | 214 | extern HWND ICONTITLE_Create( HWND );
|
---|
[4] | 215 | extern BOOL ICONTITLE_Init( void );
|
---|
| 216 |
|
---|
| 217 | /* windows/focus.c */
|
---|
| 218 | extern void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND , HWND );
|
---|
| 219 |
|
---|
[8544] | 220 |
|
---|
[4] | 221 | #endif /* __WINE_WIN_H */
|
---|