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