blob: 973888037e10a0f07f1106eff5532035300ba4e1 [file] [log] [blame]
Alexandre Julliard75a839a1993-07-15 11:13:45 +00001/*
2 * Window definitions
3 *
4 * Copyright 1993 Alexandre Julliard
5 */
6
7#ifndef WIN_H
8#define WIN_H
9
Alexandre Julliardcdd09231994-01-12 11:12:51 +000010#include <X11/Xlib.h>
Alexandre Julliard75a839a1993-07-15 11:13:45 +000011
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000012#include "ldt.h"
Alexandre Julliardaca05781994-10-17 18:12:41 +000013#include "class.h"
Alexandre Julliard75a839a1993-07-15 11:13:45 +000014
15#define WND_MAGIC 0x444e4957 /* 'WIND' */
16
Alexandre Julliardfb9a9191994-03-01 19:48:04 +000017 /* 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 */
Alexandre Julliard75a839a1993-07-15 11:13:45 +000023
Alexandre Julliard808cb041995-08-17 17:11:36 +000024#define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
25#define DESKTOP_CLASS_ATOM MAKEINTATOM(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
Alexandre Julliard75a839a1993-07-15 11:13:45 +000030typedef struct tagWND
31{
Alexandre Julliard2ace16a1996-04-28 15:09:19 +000032 struct tagWND *next; /* Next sibling */
33 struct tagWND *child; /* First child */
34 struct tagWND *parent; /* Window parent (from CreateWindow) */
35 struct tagWND *owner; /* Window owner */
36 CLASS *class; /* Window class */
37 DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
38 HWND hwndSelf; /* Handle of this window */
39 HANDLE hInstance; /* Window hInstance (from CreateWindow) */
40 RECT rectClient; /* Client area rel. to parent client area */
41 RECT rectWindow; /* Whole window rel. to parent client area */
42 RECT rectNormal; /* Window rect. when in normal state */
43 POINT ptIconPos; /* Icon position */
44 POINT ptMaxPos; /* Maximized window position */
45 HGLOBAL hmemTaskQ; /* Task queue global memory handle */
46 HRGN hrgnUpdate; /* Update region */
47 HWND hwndLastActive;/* Last active popup hwnd */
48 WNDPROC lpfnWndProc; /* Window procedure */
49 DWORD dwStyle; /* Window style (from CreateWindow) */
50 DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
51 HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
52 HANDLE hVScroll; /* Vertical scroll-bar info */
53 HANDLE hHScroll; /* Horizontal scroll-bar info */
54 UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
55 HANDLE hText; /* Handle of window text */
56 WORD flags; /* Misc. flags (see below) */
57 Window window; /* X window (only for top-level windows) */
58 HMENU hSysMenu; /* window's copy of System Menu */
59 HANDLE hProp; /* Handle of Properties List */
60 WORD wExtra[1]; /* Window extra bytes */
Alexandre Julliard75a839a1993-07-15 11:13:45 +000061} WND;
62
Alexandre Julliard401710d1993-09-04 10:09:32 +000063 /* WND flags values */
Alexandre Julliard0c126c71996-02-18 18:44:41 +000064#define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
65#define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
66#define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
67#define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
68#define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
69#define WIN_NO_REDRAW 0x0020 /* WM_SETREDRAW called for this window */
70#define WIN_GOT_SIZEMSG 0x0040 /* WM_SIZE has been sent to the window */
71#define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
72#define WIN_MANAGED 0x0100 /* Window managed by the X wm */
Alexandre Julliardaca05781994-10-17 18:12:41 +000073
Alexandre Julliardf0b23541993-09-29 12:21:49 +000074 /* Window functions */
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000075extern WND *WIN_FindWndPtr( HWND hwnd );
Alexandre Julliard59730ae1996-03-24 16:20:51 +000076extern WND *WIN_GetDesktop(void);
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000077extern void WIN_DumpWindow( HWND hwnd );
78extern void WIN_WalkWindows( HWND hwnd, int indent );
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000079extern Window WIN_GetXWindow( HWND hwnd );
80extern BOOL WIN_UnlinkWindow( HWND hwnd );
81extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
Alexandre Julliardc981d0b1996-03-31 16:40:13 +000082extern HWND WIN_FindWinToRepaint( HWND hwnd, HQUEUE hQueue );
Alexandre Julliardaf0bae51995-10-03 17:06:08 +000083extern void WIN_SendParentNotify( HWND hwnd, WORD event,
84 WORD idChild, LONG lValue );
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000085extern BOOL WIN_CreateDesktopWindow(void);
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000086extern HWND WIN_GetTopParent( HWND hwnd );
Alexandre Julliardaf0bae51995-10-03 17:06:08 +000087extern HINSTANCE WIN_GetWindowInstance( HWND hwnd );
Alexandre Julliard75a839a1993-07-15 11:13:45 +000088
Alexandre Julliardfb9a9191994-03-01 19:48:04 +000089extern Display * display;
90extern Screen * screen;
Alexandre Julliard8d24ae61994-04-05 21:42:43 +000091extern Window rootWindow;
Alexandre Julliard75a839a1993-07-15 11:13:45 +000092
93#endif /* WIN_H */