From 008bd109f8fce3bd73426726dbfd178ddbdfe8e1 Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 19 Nov 2012 08:40:52 +0000 Subject: [PATCH] CtrlCore: Refactored MT for Win32 git-svn-id: svn://ultimatepp.org/upp/trunk@5560 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/DrawTextX11.cpp | 3 +++ uppsrc/CtrlCore/TopWin32.cpp | 7 +------ uppsrc/CtrlCore/Win32Ctrl.cpp | 2 +- uppsrc/CtrlCore/Win32DnD.cpp | 4 ++-- uppsrc/CtrlCore/Win32Top.h | 1 - uppsrc/CtrlCore/Win32Wnd.cpp | 10 ++++------ 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/uppsrc/CtrlCore/DrawTextX11.cpp b/uppsrc/CtrlCore/DrawTextX11.cpp index ddab92e26..170b63075 100644 --- a/uppsrc/CtrlCore/DrawTextX11.cpp +++ b/uppsrc/CtrlCore/DrawTextX11.cpp @@ -146,6 +146,9 @@ GlyphInfo XftGetGlyphInfoSys(Font font, int chr) } INITBLOCK { + // it is probably not quite required as Xft is based on FC, but to be sure to have + // consistent metrics hook Xft metrics into Draw/FontFc.cpp + extern CommonFontInfo (*GetFontInfoSysXft)(Font font); extern GlyphInfo (*GetGlyphInfoSysXft)(Font font, int chr); diff --git a/uppsrc/CtrlCore/TopWin32.cpp b/uppsrc/CtrlCore/TopWin32.cpp index 1c365d667..3fa4c7ffa 100644 --- a/uppsrc/CtrlCore/TopWin32.cpp +++ b/uppsrc/CtrlCore/TopWin32.cpp @@ -84,7 +84,7 @@ void TopWindow::SyncTitle0() ::SetWindowText(hwnd, ToSystemCharset(title.ToString())); } -void TopWindow::DeleteIco0() +void TopWindow::DeleteIco() { GuiLock __; LLOG("TopWindow::DeleteIco " << UPP::Name(this)); @@ -95,11 +95,6 @@ void TopWindow::DeleteIco0() ico = lico = NULL; } -void TopWindow::DeleteIco() -{ - ICall(THISBACK(DeleteIco0)); -} - void TopWindow::SyncCaption0() { GuiLock __; diff --git a/uppsrc/CtrlCore/Win32Ctrl.cpp b/uppsrc/CtrlCore/Win32Ctrl.cpp index d118b799c..97be8f5c9 100644 --- a/uppsrc/CtrlCore/Win32Ctrl.cpp +++ b/uppsrc/CtrlCore/Win32Ctrl.cpp @@ -150,7 +150,7 @@ String Ctrl::Name() const { void Ctrl::WndCreateCaret(const Rect& cr) { - ICall(THISBACK1(WndCreateCaret0, cr)); + Call(THISBACK1(WndCreateCaret0, cr)); } END_UPP_NAMESPACE diff --git a/uppsrc/CtrlCore/Win32DnD.cpp b/uppsrc/CtrlCore/Win32DnD.cpp index 910de959d..cdb8d5131 100644 --- a/uppsrc/CtrlCore/Win32DnD.cpp +++ b/uppsrc/CtrlCore/Win32DnD.cpp @@ -501,11 +501,11 @@ int Ctrl::DoDragAndDrop(const char *fmts, const Image& sample, dword actions, if(actions & DND_MOVE) dsrc->move = actions & DND_EXACTIMAGE ? sample : MakeDragImage(CtrlCoreImg::DndMove(), CtrlCoreImg::DndMove98(), sample); sDnDSource = this; - int level = LeaveGMutexAll(); + int level = LeaveGuiMutexAll(); HRESULT r = DoDragDrop(obj, dsrc, (actions & DND_COPY ? DROPEFFECT_COPY : 0) | (actions & DND_MOVE ? DROPEFFECT_MOVE : 0), &result); - EnterGMutex(level); + EnterGuiMutex(level); DWORD re = obj->effect; obj->Release(); dsrc->Release(); diff --git a/uppsrc/CtrlCore/Win32Top.h b/uppsrc/CtrlCore/Win32Top.h index 969ea547d..7b7643e46 100644 --- a/uppsrc/CtrlCore/Win32Top.h +++ b/uppsrc/CtrlCore/Win32Top.h @@ -7,7 +7,6 @@ private: dword exstyle; HICON ico, lico; - void DeleteIco0(); void DeleteIco(); void CenterRect(HWND owner, int center); diff --git a/uppsrc/CtrlCore/Win32Wnd.cpp b/uppsrc/CtrlCore/Win32Wnd.cpp index e659433cf..042c99bf3 100644 --- a/uppsrc/CtrlCore/Win32Wnd.cpp +++ b/uppsrc/CtrlCore/Win32Wnd.cpp @@ -492,7 +492,7 @@ void Ctrl::Create(HWND parent, DWORD style, DWORD exstyle, bool savebits, int sh cr.savebits = savebits; cr.show = show; cr.dropshadow = dropshadow; - ICall(callback1(this, &Ctrl::Create0, &cr)); + Call(callback1(this, &Ctrl::Create0, &cr)); } #if 0 @@ -842,8 +842,6 @@ bool Ctrl::IsWaitingEvent() bool Ctrl::ProcessEvent(bool *quit) { ASSERT(IsMainThread()); - if(DoCall()) - return false; if(!GetMouseLeft() && !GetMouseRight() && !GetMouseMiddle()) ReleaseCtrlCapture(); MSG msg; @@ -909,7 +907,7 @@ void Ctrl::GuiSleep0(int ms) GuiLock __; ASSERT(IsMainThread()); ELOG("GuiSleep"); - int level = LeaveGMutexAll(); + int level = LeaveGuiMutexAll(); #if !defined(flagDLL) && !defined(PLATFORM_WINCE) if(!OverwatchThread) { DWORD dummy; @@ -924,7 +922,7 @@ void Ctrl::GuiSleep0(int ms) #else MsgWaitForMultipleObjects(0, NULL, FALSE, ms, QS_ALLINPUT); #endif - EnterGMutex(level); + EnterGuiMutex(level); } void Ctrl::WndDestroyCaret() @@ -1197,7 +1195,7 @@ bool Ctrl::HasWndCapture() const return hwnd && hwnd == ::GetCapture(); } -void Ctrl::WndInvalidateRect0(const Rect& r) +void Ctrl::WndInvalidateRect(const Rect& r) { GuiLock __; LLOG("WndInvalidateRect " << UPP::Name(this));