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