X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2FCWindow.cpp;h=32ff4f6b62d97a94d81abc2899792f6c57b3551f;hb=4d0188930e7d0e571db78d1d2e3c4d9b3f0fe8fb;hp=bd952aa0eb5ae4b081e36b1aa0f0e364ef80adc4;hpb=47296e890b2b09cbc46db30d7fe2aeeae11a6d4a;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/CWindow.cpp b/Usermode/Applications/axwin4_src/Server/CWindow.cpp index bd952aa0..32ff4f6b 100644 --- a/Usermode/Applications/axwin4_src/Server/CWindow.cpp +++ b/Usermode/Applications/axwin4_src/Server/CWindow.cpp @@ -8,6 +8,7 @@ #include #include #include +#include namespace AxWin { @@ -17,7 +18,7 @@ CWindow::CWindow(CCompositor& compositor, CClient& client, const ::std::string& m_client(client), m_name(name) { - + _SysDebug("CWindow::CWindow()"); } CWindow::~CWindow() @@ -26,30 +27,37 @@ CWindow::~CWindow() void CWindow::Repaint(const CRect& rect) { - #if 0 - for( auto rgn : m_regions ) + if( m_is_shown ) { - if( rect.Contains(rgn->m_rect) ) - { - CRect rel_rect(rect, rgn->m_rect); - rgn->Repaint(m_surface, rel_rect); - } + 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); } - #endif } void CWindow::Show(bool bShow) { - assert(!"TODO: CWindow::Show"); + 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) { - assert(!"TODO: CWindow::Move"); + m_surface.m_rect.Move(X, Y); } void CWindow::Resize(unsigned int W, unsigned int H) { - assert(!"TODO: CWindow::Resize"); + m_surface.Resize(W, H); + IPC::SendMessage_NotifyDims(m_client, W, H); } uint64_t CWindow::ShareSurface() { @@ -69,5 +77,13 @@ void CWindow::KeyEvent(::uint32_t Scancode, const ::std::string &Translated, boo { } + +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); +} + };