Usermode/AxWin4 - Code now compiling (if STL is present)
[tpg/acess2.git] / Usermode / Applications / axwin4_src / Server / compositor.cpp
1 /*
2  * Acess2 GUI v4
3  * - By John Hodge (thePowersGang)
4  *
5  * compositor.cpp
6  * - Window compositor
7  */
8 #include <video.hpp>
9 #include <compositor.hpp>
10 #include <CCompositor.hpp>
11
12 namespace AxWin {
13
14 CCompositor::CCompositor()
15 {
16         // 
17 }
18
19 CWindow* CCompositor::CreateWindow(CClient& client)
20 {
21         return new CWindow(client, "TODO");
22 }
23
24 void CCompositor::Redraw()
25 {
26         // Redraw the screen and clear damage rects
27         if( m_damageRects.empty() )
28                 return ;
29         
30         // Build up foreground grid (Rects and windows)
31         // - This should already be built (mutated on window move/resize/reorder)
32         
33         // For all windows, check for intersection with damage rects
34         for( auto rect : m_damageRects )
35         {
36                 for( auto window : m_windows )
37                 {
38                         if( rect.Contains( window->m_rect ) )
39                         {
40                                 window->Repaint( rect );
41                         }
42                 }
43         }
44
45         m_damageRects.clear();
46 }
47
48 void CCompositor::DamageArea(const CRect& area)
49 {
50         // 1. Locate intersection with any existing damaged areas
51         // 2. Append after removing intersections
52 }
53
54 }       // namespace AxWin
55

UCC git Repository :: git.ucc.asn.au