Don't hang on the last child if it's not wanted.
[wine/gsoc_dplay.git] / include / win.h
blobfad66763111b2891defc18fbdb29ddd0c923a472
1 /*
2 * Window definitions
4 * Copyright 1993 Alexandre Julliard
5 */
7 #ifndef __WINE_WIN_H
8 #define __WINE_WIN_H
10 #include "queue.h"
11 #include "class.h"
13 #define WND_MAGIC 0x444e4957 /* 'WIND' */
15 /* Built-in class names (see _Undocumented_Windows_ p.418) */
16 #define POPUPMENU_CLASS_NAME "#32768" /* PopupMenu */
17 #define DESKTOP_CLASS_NAME "#32769" /* Desktop */
18 #define DIALOG_CLASS_NAME "#32770" /* Dialog */
19 #define WINSWITCH_CLASS_NAME "#32771" /* WinSwitch */
20 #define ICONTITLE_CLASS_NAME "#32772" /* IconTitle */
22 #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
23 #define DESKTOP_CLASS_ATOM ((ATOM)32769) /* Desktop */
24 #define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
25 #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
26 #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
28 /* Built-in 32-bit classes */
29 typedef enum
31 BIC32_BUTTON,
32 BIC32_EDIT,
33 BIC32_LISTBOX,
34 BIC32_COMBO,
35 BIC32_COMBOLB,
36 BIC32_POPUPMENU,
37 BIC32_STATIC,
38 BIC32_SCROLL,
39 BIC32_MDICLIENT,
40 BIC32_DESKTOP,
41 BIC32_DIALOG,
42 BIC32_ICONTITLE,
43 BIC32_NB_CLASSES
44 } BUILTIN_CLASS32;
46 /* PAINT_RedrawWindow() control flags */
47 #define RDW_C_USEHRGN 0x0001
48 #define RDW_C_DELETEHRGN 0x0002
50 struct tagCLASS;
51 struct tagDCE;
52 struct tagDC;
53 struct _WND_DRIVER;
55 typedef struct tagWND
57 struct tagWND *next; /* Next sibling */
58 struct tagWND *child; /* First child */
59 struct tagWND *parent; /* Window parent (from CreateWindow) */
60 struct tagWND *owner; /* Window owner */
61 struct tagCLASS *class; /* Window class */
62 HWINDOWPROC winproc; /* Window procedure */
63 DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
64 HWND32 hwndSelf; /* Handle of this window */
65 HINSTANCE32 hInstance; /* Window hInstance (from CreateWindow) */
66 RECT32 rectClient; /* Client area rel. to parent client area */
67 RECT32 rectWindow; /* Whole window rel. to parent client area */
68 LPSTR text; /* Window text */
69 void *pVScroll; /* Vertical scroll-bar info */
70 void *pHScroll; /* Horizontal scroll-bar info */
71 void *pProp; /* Pointer to properties list */
72 struct tagDCE *dce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
73 HGLOBAL16 hmemTaskQ; /* Task queue global memory handle */
74 HRGN16 hrgnUpdate; /* Update region */
75 HWND32 hwndLastActive;/* Last active popup hwnd */
76 DWORD dwStyle; /* Window style (from CreateWindow) */
77 DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
78 UINT32 wIDmenu; /* ID or hmenu (from CreateWindow) */
79 DWORD helpContext; /* Help context ID */
80 WORD flags; /* Misc. flags (see below) */
81 HMENU16 hSysMenu; /* window's copy of System Menu */
82 DWORD userdata; /* User private data */
83 struct _WND_DRIVER *pDriver; /* Window driver */
84 void *pDriverData; /* Window driver data */
85 DWORD wExtra[1]; /* Window extra bytes */
86 } WND;
88 typedef struct _WND_DRIVER
90 void (*pInitialize)(WND *);
91 void (*pFinalize)(WND *);
92 BOOL32 (*pCreateDesktopWindow)(WND *, struct tagCLASS *, BOOL32);
93 BOOL32 (*pCreateWindow)(WND *, struct tagCLASS *, CREATESTRUCT32A *, BOOL32);
94 BOOL32 (*pDestroyWindow)(WND *);
95 WND* (*pSetParent)(WND *, WND *);
96 void (*pForceWindowRaise)(WND *);
97 void (*pSetWindowPos)(WND *, const WINDOWPOS32 *, BOOL32);
98 void (*pSetText)(WND *, LPCSTR);
99 void (*pSetFocus)(WND *);
100 void (*pPreSizeMove)(WND *);
101 void (*pPostSizeMove)(WND *);
102 void (*pScrollWindow)(WND *, struct tagDC *, INT32, INT32, const RECT32 *, BOOL32);
103 void (*pSetDrawable)(WND *, struct tagDC *, WORD, BOOL32);
104 BOOL32 (*pIsSelfClipping)(WND *);
105 } WND_DRIVER;
107 typedef struct
109 RECT16 rectNormal;
110 POINT16 ptIconPos;
111 POINT16 ptMaxPos;
112 HWND16 hwndIconTitle;
113 } INTERNALPOS, *LPINTERNALPOS;
115 /* WND flags values */
116 #define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
117 #define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
118 #define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
119 #define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
120 #define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
121 /* Used to have WIN_NO_REDRAW 0x0020 here */
122 #define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
123 #define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
124 #define WIN_MANAGED 0x0100 /* Window managed by the X wm */
125 #define WIN_ISDIALOG 0x0200 /* Window is a dialog */
126 #define WIN_ISWIN32 0x0400 /* Understands Win32 messages */
127 #define WIN_SAVEUNDER_OVERRIDE 0x0800
129 /* BuildWinArray() flags */
130 #define BWA_SKIPDISABLED 0x0001
131 #define BWA_SKIPHIDDEN 0x0002
132 #define BWA_SKIPOWNED 0x0004
133 #define BWA_SKIPICONIC 0x0008
135 /* Window functions */
136 extern WND* WIN_FindWndPtr( HWND32 hwnd );
137 extern WND* WIN_GetDesktop(void);
138 extern void WIN_DumpWindow( HWND32 hwnd );
139 extern void WIN_WalkWindows( HWND32 hwnd, int indent );
140 extern BOOL32 WIN_UnlinkWindow( HWND32 hwnd );
141 extern BOOL32 WIN_LinkWindow( HWND32 hwnd, HWND32 hwndInsertAfter );
142 extern HWND32 WIN_FindWinToRepaint( HWND32 hwnd, HQUEUE16 hQueue );
143 extern BOOL32 WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew);
144 extern BOOL32 WIN_CreateDesktopWindow(void);
145 extern HWND32 WIN_GetTopParent( HWND32 hwnd );
146 extern WND* WIN_GetTopParentPtr( WND* pWnd );
147 extern BOOL32 WIN_IsWindowDrawable(WND*, BOOL32 );
148 extern HINSTANCE32 WIN_GetWindowInstance( HWND32 hwnd );
149 extern WND** WIN_BuildWinArray( WND *wndPtr, UINT32 bwa, UINT32* pnum );
151 extern HWND32 CARET_GetHwnd(void);
152 extern void CARET_GetRect(LPRECT32 lprc); /* windows/caret.c */
154 extern BOOL16 DRAG_QueryUpdate( HWND32, SEGPTR, BOOL32 );
155 extern void DEFWND_SetText( WND *wndPtr, LPCSTR text );
156 extern HBRUSH32 DEFWND_ControlColor( HDC32 hDC, UINT16 ctlType ); /* windows/defwnd.c */
158 extern void PROPERTY_RemoveWindowProps( WND *pWnd ); /* windows/property.c */
160 extern BOOL32 PAINT_RedrawWindow( HWND32 hwnd, const RECT32 *rectUpdate,
161 HRGN32 hrgnUpdate, UINT32 flags,
162 UINT32 control ); /* windows/painting.c */
164 /* controls/widgets.c */
165 extern BOOL32 WIDGETS_Init( void );
166 extern BOOL32 WIDGETS_IsControl32( WND* pWnd, BUILTIN_CLASS32 cls );
168 /* controls/icontitle.c */
169 extern HWND32 ICONTITLE_Create( WND* );
170 extern BOOL32 ICONTITLE_Init( void );
172 /* windows/focus.c */
173 extern void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND32 , HWND32 );
175 #endif /* __WINE_WIN_H */