X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2FCWindow.cpp;h=55c24823c7dad6553b0cf12c97f9677bcdd6ec27;hb=8b16265b4394af76f64c30393e27d08c294c4bac;hp=79308cc4286bea432d1b2abbca887ba75b398b67;hpb=340e7923b1e95c39ac85a4b22af7f1b53b315cd9;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/CWindow.cpp b/Usermode/Applications/axwin4_src/Server/CWindow.cpp index 79308cc4..55c24823 100644 --- a/Usermode/Applications/axwin4_src/Server/CWindow.cpp +++ b/Usermode/Applications/axwin4_src/Server/CWindow.cpp @@ -6,15 +6,21 @@ * - Window */ #include +#include +#include +#include namespace AxWin { -CWindow::CWindow(CClient& client, const ::std::string& name): +CWindow::CWindow(CCompositor& compositor, CClient& client, const ::std::string& name, unsigned int id): + m_surface(0,0,0,0), + m_compositor(compositor), m_client(client), + m_id(id), m_name(name), - m_rect(0,0,0,0) + m_is_shown(false) { - + _SysDebug("CWindow::CWindow()"); } CWindow::~CWindow() @@ -23,7 +29,67 @@ CWindow::~CWindow() void CWindow::Repaint(const CRect& rect) { + if( m_is_shown ) + { + CRect outrect( + m_surface.m_rect.m_x + rect.m_x, + m_surface.m_rect.m_y + rect.m_y, + rect.m_w, rect.m_h + ); + m_compositor.DamageArea(outrect); + } +} + +void CWindow::Show(bool bShow) +{ + if( m_is_shown == bShow ) + return; + if( bShow ) + m_compositor.ShowWindow( this ); + else + m_compositor.HideWindow( this ); + m_is_shown = bShow; +} + +void CWindow::Move(int X, int Y) +{ + m_surface.m_rect.Move(X, Y); +} +void CWindow::Resize(unsigned int W, unsigned int H) +{ + m_surface.Resize(W, H); + IPC::SendMessage_NotifyDims(m_client, W, H); +} +void CWindow::SetFlags(uint32_t Flags) +{ + // TODO: CWindow::SetFlags + _SysDebug("TOOD: CWindow::SetFlags"); +} +uint64_t CWindow::ShareSurface() +{ + assert(!"TODO: CWindow::ShareSurface"); + return 0; +} + +void CWindow::MouseButton(int ButtonID, int X, int Y, bool Down) +{ +} + +void CWindow::MouseMove(int NewX, int NewY) +{ +} + +void CWindow::KeyEvent(::uint32_t Scancode, const ::std::string &Translated, bool Down) +{ +} + + +void CWindow::DrawScanline(unsigned int row, unsigned int x, unsigned int w, const uint8_t *data) +{ + m_surface.DrawScanline(row, x, w, data); + CRect damaged( m_surface.m_rect.m_x+x, m_surface.m_rect.m_y+row, w, 1 ); + m_compositor.DamageArea(damaged); } };