Moved queue paint count to the server. Removed a few no longer used
[wine] / include / win.h
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 "windef.h"
11 #include "winbase.h"
12 #include "wingdi.h"
13 #include "winproc.h"
14 #include "winuser.h"
15 #include "wine/windef16.h"
16
17 #define WND_MAGIC     0x444e4957  /* 'WIND' */
18
19 struct tagCLASS;
20 struct tagDCE;
21 struct tagMESSAGEQUEUE;
22 struct tagWND_DRIVER;
23
24 typedef struct tagWND
25 {
26     struct tagWND *next;          /* Next sibling */
27     struct tagWND *child;         /* First child */
28     struct tagWND *parent;        /* Window parent (from CreateWindow) */
29     struct tagWND *owner;         /* Window owner */
30     struct tagCLASS *class;       /* Window class */
31     HWINDOWPROC    winproc;       /* Window procedure */
32     DWORD          dwMagic;       /* Magic number (must be WND_MAGIC) */
33     HWND         hwndSelf;      /* Handle of this window */
34     HINSTANCE    hInstance;     /* Window hInstance (from CreateWindow) */
35     RECT         rectClient;    /* Client area rel. to parent client area */
36     RECT         rectWindow;    /* Whole window rel. to parent client area */
37     LPWSTR        text;           /* Window text */
38     void          *pVScroll;      /* Vertical scroll-bar info */
39     void          *pHScroll;      /* Horizontal scroll-bar info */
40     void          *pProp;         /* Pointer to properties list */
41     struct tagDCE *dce;           /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
42     HGLOBAL16      hmemTaskQ;     /* Task queue global memory handle */
43     HRGN16         hrgnUpdate;    /* Update region */
44     HRGN           hrgnWnd;       /* window's region */
45     HWND           hwndLastActive;/* Last active popup hwnd */
46     DWORD          dwStyle;       /* Window style (from CreateWindow) */
47     DWORD          dwExStyle;     /* Extended style (from CreateWindowEx) */
48     DWORD          clsStyle;      /* Class style at window creation */
49     UINT           wIDmenu;       /* ID or hmenu (from CreateWindow) */
50     DWORD          helpContext;   /* Help context ID */
51     WORD           flags;         /* Misc. flags (see below) */
52     HMENU16        hSysMenu;      /* window's copy of System Menu */
53     int            cbWndExtra;    /* class cbWndExtra at window creation */
54     int            irefCount;     /* window's reference count*/
55     DWORD          userdata;      /* User private data */
56     struct tagWND_DRIVER *pDriver;  /* Window driver */
57     void          *pDriverData;   /* Window driver data */
58     DWORD          wExtra[1];     /* Window extra bytes */
59 } WND;
60
61 typedef struct tagWND_DRIVER
62 {
63     void   (*pForceWindowRaise)(WND *);
64 } WND_DRIVER;
65
66 extern WND_DRIVER *WND_Driver;
67
68 typedef struct
69 {
70     RECT16         rectNormal;
71     POINT16        ptIconPos;
72     POINT16        ptMaxPos;
73     HWND16         hwndIconTitle;
74 } INTERNALPOS, *LPINTERNALPOS;
75
76   /* WND flags values */
77 #define WIN_NEEDS_BEGINPAINT   0x0001 /* WM_PAINT sent to window */
78 #define WIN_NEEDS_ERASEBKGND   0x0002 /* WM_ERASEBKGND must be sent to window*/
79 #define WIN_NEEDS_NCPAINT      0x0004 /* WM_NCPAINT must be sent to window */
80 #define WIN_RESTORE_MAX        0x0008 /* Maximize when restoring */
81 #define WIN_INTERNAL_PAINT     0x0010 /* Internal WM_PAINT message pending */
82 #define WIN_NEED_SIZE          0x0040 /* Internal WM_SIZE is needed */
83 #define WIN_NCACTIVATED        0x0080 /* last WM_NCACTIVATE was positive */
84 #define WIN_ISDIALOG           0x0200 /* Window is a dialog */
85 #define WIN_ISWIN32            0x0400 /* Understands Win32 messages */
86 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0800 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
87 #define WIN_NEEDS_INTERNALSOP  0x1000 /* Window was hidden by WIN_InternalShowOwnedPopups */
88
89   /* BuildWinArray() flags */
90 #define BWA_SKIPDISABLED        0x0001
91 #define BWA_SKIPHIDDEN          0x0002
92 #define BWA_SKIPOWNED           0x0004
93 #define BWA_SKIPICONIC          0x0008
94
95   /* Window functions */
96 extern void   WIN_LockWnds( void );
97 extern void   WIN_UnlockWnds( void );
98 extern int    WIN_SuspendWndsLock( void );
99 extern void   WIN_RestoreWndsLock(int ipreviousLock);
100 extern WND*   WIN_FindWndPtr( HWND hwnd );
101 extern WND*   WIN_LockWndPtr(WND *wndPtr);
102 extern void   WIN_ReleaseWndPtr(WND *wndPtr);
103 extern void   WIN_UpdateWndPtr(WND **oldPtr,WND *newPtr);
104 extern WND*   WIN_GetDesktop(void);
105 extern void   WIN_ReleaseDesktop(void);
106 extern void   WIN_DumpWindow( HWND hwnd );
107 extern void   WIN_WalkWindows( HWND hwnd, int indent );
108 extern BOOL WIN_UnlinkWindow( HWND hwnd );
109 extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
110 extern HWND WIN_FindWinToRepaint( HWND hwnd );
111 extern BOOL WIN_DestroyThreadWindows( HWND hwnd );
112 extern BOOL WIN_CreateDesktopWindow(void);
113 extern HWND WIN_GetTopParent( HWND hwnd );
114 extern WND*   WIN_GetTopParentPtr( WND* pWnd );
115 extern BOOL WIN_IsWindowDrawable(WND*, BOOL );
116 extern WND**  WIN_BuildWinArray( WND *wndPtr, UINT bwa, UINT* pnum );
117 extern void   WIN_ReleaseWinArray(WND **wndArray);
118 extern BOOL WIN_InternalShowOwnedPopups( HWND owner, BOOL fShow, BOOL unmanagedOnly );
119
120 extern HWND CARET_GetHwnd(void);
121 extern void CARET_GetRect(LPRECT lprc);  /* windows/caret.c */
122
123 extern BOOL16 DRAG_QueryUpdate( HWND, SEGPTR, BOOL );
124 extern void DEFWND_SetTextA( WND *wndPtr, LPCSTR text );
125 extern void DEFWND_SetTextW( WND *wndPtr, LPCWSTR text );
126 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType );  /* windows/defwnd.c */
127
128 extern void PROPERTY_RemoveWindowProps( WND *pWnd );                  /* windows/property.c */
129
130 /* Classes functions */
131 struct tagCLASS;  /* opaque structure */
132 struct builtin_class_descr;
133 extern ATOM CLASS_RegisterBuiltinClass( const struct builtin_class_descr *descr );
134 extern struct tagCLASS *CLASS_AddWindow( ATOM atom, HINSTANCE inst, WINDOWPROCTYPE type,
135                                          INT *winExtra, WNDPROC *winproc,
136                                          DWORD *style, struct tagDCE **dce );
137 extern void CLASS_RemoveWindow( struct tagCLASS *cls );
138 extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
139
140 /* windows/focus.c */
141 extern void FOCUS_SwitchFocus( struct tagMESSAGEQUEUE *pMsgQ, HWND , HWND );
142
143 #endif  /* __WINE_WIN_H */