From 8a3883f8172cbdaf7dc2431775a7bdcc1fe0e2cc Mon Sep 17 00:00:00 2001 From: unodgs Date: Mon, 19 Nov 2012 09:47:14 +0000 Subject: [PATCH] WinGL: Adjustment to new MT changes git-svn-id: svn://ultimatepp.org/upp/trunk@5561 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- rainbow/WinGl/Ctrl.cpp | 13 ++++++++----- rainbow/WinGl/Ctrl.h | 1 + rainbow/WinGl/Image.cpp | 31 ------------------------------- rainbow/WinGl/Wnd.cpp | 12 +++++------- 4 files changed, 14 insertions(+), 43 deletions(-) diff --git a/rainbow/WinGl/Ctrl.cpp b/rainbow/WinGl/Ctrl.cpp index df4120b84..0504f4eb4 100644 --- a/rainbow/WinGl/Ctrl.cpp +++ b/rainbow/WinGl/Ctrl.cpp @@ -6,13 +6,9 @@ NAMESPACE_UPP -void WakeUpGuiThread(void) -{ -} - void Ctrl::GuiPlatformConstruct() { - cliptobounds = true; + cliptobounds = true; } void Ctrl::GuiPlatformRemove() @@ -69,6 +65,13 @@ void GuiPlatformAfterMenuPopUp() { } +void Ctrl::ApplyLayout() +{ + GuiLock __; + for(Ctrl *q = GetFirstChild(); q; q = q->GetNext()) + q->ApplyLayout(); +} + String Ctrl::Name() const { GuiLock __; #ifdef CPU_64 diff --git a/rainbow/WinGl/Ctrl.h b/rainbow/WinGl/Ctrl.h index ab97cf745..a049cd0fb 100644 --- a/rainbow/WinGl/Ctrl.h +++ b/rainbow/WinGl/Ctrl.h @@ -67,6 +67,7 @@ public: virtual void ApplyTransform(TransformState state) {} virtual void PostPaint(Draw& w) {} + virtual void ApplyLayout(); void DragRectDraw(const Rect& rect1, const Rect& rect2, const Rect& clip, int n, Color color, int type, int animation); diff --git a/rainbow/WinGl/Image.cpp b/rainbow/WinGl/Image.cpp index f9fd60f63..fc8752ab6 100644 --- a/rainbow/WinGl/Image.cpp +++ b/rainbow/WinGl/Image.cpp @@ -16,37 +16,6 @@ void SetSurface(SystemDraw& w, const Rect& dest, const RGBA *pixels, Size psz, P GuiLock __; } -struct Image::Data::SystemData { -}; - -void Image::Data::SysInitImp() -{ - SystemData& sd = Sys(); -} - -void Image::Data::SysReleaseImp() -{ - SystemData& sd = Sys(); -} - -Image::Data::SystemData& Image::Data::Sys() const -{ - ASSERT(sizeof(system_buffer) >= sizeof(SystemData)); - return *(SystemData *)system_buffer; -} - -int Image::Data::GetResCountImp() const -{ - SystemData& sd = Sys(); - return 0; -} - -void Image::Data::PaintImp(SystemDraw& w, int x, int y, const Rect& src, Color c) -{ - GuiLock __; - SystemData& sd = Sys(); -} - Image ImageDraw::Get(bool pm) const { ImageBuffer result(image.GetSize()); diff --git a/rainbow/WinGl/Wnd.cpp b/rainbow/WinGl/Wnd.cpp index bab4addff..dd72a44b9 100644 --- a/rainbow/WinGl/Wnd.cpp +++ b/rainbow/WinGl/Wnd.cpp @@ -195,10 +195,6 @@ void Ctrl::SyncTopWindows() bool Ctrl::ProcessEvent(bool *quit) { ASSERT(IsMainThread()); - if(DoCall()) { - SyncTopWindows(); - return false; - } if(!GetMouseLeft() && !GetMouseRight() && !GetMouseMiddle()) ReleaseCtrlCapture(); if(GlProcessEvent(quit)) { @@ -224,8 +220,10 @@ void Ctrl::DrawScreen() int64 t0 = GetHighTickCount(); frameInfo.curr_tick_count = t0; painting = true; + desktop->ApplyLayout(); desktop->ApplyTransform(TS_BEFORE_SCREEN); for(int i = 0; i < topctrl.GetCount(); i++) { + topctrl[i]->ApplyLayout(); topctrl[i]->ApplyTransform(TS_BEFORE_SCREEN); } Rect clip = desktop->GetRect(); @@ -385,9 +383,9 @@ void Ctrl::GuiSleep0(int ms) { GuiLock __; ASSERT(IsMainThread()); - int level = LeaveGMutexAll(); + int level = LeaveGuiMutexAll(); GlSleep(ms); - EnterGMutex(level); + EnterGuiMutex(level); } Rect Ctrl::GetWndScreenRect() const @@ -572,7 +570,7 @@ bool Ctrl::HasWndCapture() const return captureCtrl && captureCtrl->GetTopCtrl() == this; } -void Ctrl::WndInvalidateRect0(const Rect& r) +void Ctrl::WndInvalidateRect(const Rect& r) { GuiLock __; //::InvalidateRect(glHwnd, NULL, false);