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