3 * - By John Hodge (thePowersGang)
9 #include <CCompositor.hpp>
15 CWindow::CWindow(CCompositor& compositor, CClient& client, const ::std::string& name):
17 m_compositor(compositor),
21 _SysDebug("CWindow::CWindow()");
28 void CWindow::Repaint(const CRect& rect)
31 for( auto rgn : m_regions )
33 if( rect.Contains(rgn->m_rect) )
35 CRect rel_rect(rect, rgn->m_rect);
36 rgn->Repaint(m_surface, rel_rect);
42 void CWindow::Show(bool bShow)
44 if( m_is_shown == bShow )
48 m_compositor.ShowWindow( this );
50 m_compositor.HideWindow( this );
54 void CWindow::Move(int X, int Y)
56 m_surface.m_rect.Move(X, Y);
58 void CWindow::Resize(unsigned int W, unsigned int H)
60 m_surface.Resize(W, H);
61 IPC::SendNotify_Dims(m_client, W, H);
63 uint64_t CWindow::ShareSurface()
65 assert(!"TODO: CWindow::ShareSurface");
69 void CWindow::MouseButton(int ButtonID, int X, int Y, bool Down)
73 void CWindow::MouseMove(int NewX, int NewY)
77 void CWindow::KeyEvent(::uint32_t Scancode, const ::std::string &Translated, bool Down)
82 void CWindow::DrawScanline(unsigned int row, unsigned int x, unsigned int w, const uint8_t *data)
84 m_surface.DrawScanline(row, x, w, data);
85 CRect damaged( m_surface.m_rect.m_x+x, m_surface.m_rect.m_y+row, w, 1 );
86 m_compositor.DamageArea(damaged);