5 #include "GraphicsContext.h"
7 #include <win/WindowFlags.h>
9 using namespace os::gui
;
14 Window(int id
, port_id eventPort
, Renderer
*renderer
= 0);
16 void AddChild(const Rect
& frame
, Window
*window
, window_flags flags
= WINDOW_FLAG_NONE
);
17 void RemoveChild(Window
*window
);
19 inline int ID() const;
21 Window
*ChildAtPoint(int x
, int y
);
23 Rect
LocalToScreen(const Rect
&) const;
24 Rect
ScreenToLocal(const Rect
&) const;
26 void SetVisibleRegion(const Region
&);
27 inline const Rect
& Frame() const;
28 inline Rect
Bounds() const;
30 const Region
& InvalidRegion() const;
31 const Region
& ClipRegion() const;
32 void Invalidate(const Region
&);
33 void Invalidate(const Rect
&); // rect in screen coords
34 void BeginPaint(Rect
&out_invalidRect
);
36 GraphicsContext
& GC();
38 bool IsVisible() const;
39 color888
Color() const;
40 void SetColor(color888
);
43 void PostEvent(Event
*);
45 void DumpChildList(int level
= 0);
47 void MoveTo(long, long);
48 void MoveBy(long, long);
49 void ResizeTo(long, long);
51 inline window_flags
Flags() const;
52 inline Window
*GetTopLevelWindow() const;
55 void UpdateClipRegion();
59 Window
**fPreviousSibling
;
62 Window
*fToplevelWindow
;
65 Region fInvalidRegion
;
66 Region fCurrentRedrawRegion
;
68 // The visible region represents what part of this window is not
69 // obscured by siblings of my parent. I maintain this
70 // when recomputing clipping for my children.
71 Region fVisibleRegion
;
73 // The clip region is the visible region, minus parts of my window
74 // that are obscured by my children.
86 inline int Window::ID() const
91 inline const Rect
& Window::Frame() const
96 inline Rect
Window::Bounds() const
103 inline window_flags
Window::Flags() const
108 inline Window
*Window::GetTopLevelWindow() const
110 return fToplevelWindow
;
113 inline const Region
& Window::InvalidRegion() const
115 return fInvalidRegion
;