3 * - By John Hodge (thePowersGang)
9 #include <CCompositor.hpp>
15 CWindow::CWindow(CCompositor& compositor, CClient& client, const ::std::string& name, unsigned int id):
17 m_compositor(compositor),
23 _SysDebug("CWindow::CWindow()");
30 void CWindow::Repaint(const CRect& rect)
35 m_surface.m_rect.m_x + rect.m_x,
36 m_surface.m_rect.m_y + rect.m_y,
39 m_compositor.DamageArea(outrect);
43 void CWindow::Show(bool bShow)
45 if( m_is_shown == bShow )
49 m_compositor.ShowWindow( this );
51 m_compositor.HideWindow( this );
55 void CWindow::Move(int X, int Y)
57 m_surface.m_rect.Move(X, Y);
59 void CWindow::Resize(unsigned int W, unsigned int H)
61 m_surface.Resize(W, H);
62 IPC::SendMessage_NotifyDims(m_client, m_id, W, H);
64 void CWindow::SetFlags(uint32_t Flags)
66 // TODO: CWindow::SetFlags
67 _SysDebug("TOOD: CWindow::SetFlags");
69 uint64_t CWindow::ShareSurface()
71 assert(!"TODO: CWindow::ShareSurface");
75 void CWindow::MouseButton(int ButtonID, int X, int Y, bool Down)
77 IPC::SendMessage_MouseButton(m_client, m_id, X, Y, ButtonID, Down);
80 void CWindow::MouseMove(int NewX, int NewY)
82 // TODO: Only enable move events if client requests them
83 //IPC::SendMessage_MouseMove(m_client, m_id, NewX, NewY);
86 void CWindow::KeyEvent(::uint32_t Scancode, const ::std::string &Translated, bool Down)
88 IPC::SendMessage_KeyEvent(m_client, m_id, Scancode, Down, Translated.c_str());
92 void CWindow::DrawScanline(unsigned int row, unsigned int x, unsigned int w, const uint8_t *data)
94 m_surface.DrawScanline(row, x, w, data);
95 CRect damaged( m_surface.m_rect.m_x+x, m_surface.m_rect.m_y+row, w, 1 );
96 m_compositor.DamageArea(damaged);
99 void CWindow::FillScanline(unsigned int row, unsigned int x, unsigned int w, const uint32_t colour)
101 m_surface.FillScanline(row, x, w, colour);
102 CRect damaged( m_surface.m_rect.m_x+x, m_surface.m_rect.m_y+row, w, 1 );
103 m_compositor.DamageArea(damaged);