mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlCore: Developing Cocoa
git-svn-id: svn://ultimatepp.org/upp/trunk@12088 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
a84c24d4e1
commit
f10f1521b8
15 changed files with 497 additions and 199 deletions
|
|
@ -79,92 +79,6 @@ void Ctrl::UnregisterSystemHotKey(int id)
|
|||
}*/
|
||||
}
|
||||
|
||||
bool Ctrl::IsWaitingEvent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Ctrl::ProcessEvent(bool *quit)
|
||||
{
|
||||
ASSERT(IsMainThread());
|
||||
return false;
|
||||
}
|
||||
|
||||
void SweepMkImageCache();
|
||||
|
||||
bool Ctrl::ProcessEvents(bool *quit)
|
||||
{
|
||||
/* if(ProcessEvent(quit)) {
|
||||
while(ProcessEvent(quit) && (!LoopCtrl || LoopCtrl->InLoop())); // LoopCtrl-MF 071008
|
||||
TimerProc(GetTickCount());
|
||||
SweepMkImageCache();
|
||||
return true;
|
||||
}
|
||||
SweepMkImageCache();
|
||||
TimerProc(GetTickCount());*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Ctrl::EventLoop(Ctrl *ctrl)
|
||||
{
|
||||
GuiLock __;
|
||||
/* ASSERT(IsMainThread());
|
||||
ASSERT(LoopLevel == 0 || ctrl);
|
||||
LoopLevel++;
|
||||
LLOG("Entering event loop at level " << LoopLevel << BeginIndent);
|
||||
Ptr<Ctrl> ploop;
|
||||
if(ctrl) {
|
||||
ploop = LoopCtrl;
|
||||
LoopCtrl = ctrl;
|
||||
ctrl->inloop = true;
|
||||
}
|
||||
|
||||
bool quit = false;
|
||||
ProcessEvents(&quit);
|
||||
while(!EndSession() && !quit && ctrl ? ctrl->IsOpen() && ctrl->InLoop() : GetTopCtrls().GetCount())
|
||||
{
|
||||
// LLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": EventLoop / GuiSleep");
|
||||
SyncCaret();
|
||||
GuiSleep(1000);
|
||||
if(EndSession()) break;
|
||||
// LLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": EventLoop / ProcessEvents");
|
||||
ProcessEvents(&quit);
|
||||
// LLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": EventLoop / after ProcessEvents");
|
||||
}
|
||||
|
||||
if(ctrl)
|
||||
LoopCtrl = ploop;
|
||||
LoopLevel--;
|
||||
LLOG(EndIndent << "Leaving event loop ");*/
|
||||
}
|
||||
|
||||
void Ctrl::GuiSleep(int ms)
|
||||
{
|
||||
GuiLock __;
|
||||
/* ASSERT(IsMainThread());
|
||||
ELOG("GuiSleep");
|
||||
if(EndSession())
|
||||
return;
|
||||
ELOG("GuiSleep 2");
|
||||
int level = LeaveGMutexAll();
|
||||
#if !defined(flagDLL) && !defined(PLATFORM_WINCE)
|
||||
if(!OverwatchThread) {
|
||||
DWORD dummy;
|
||||
OverwatchThread = CreateThread(NULL, 0x100000, Win32OverwatchThread, NULL, 0, &dummy);
|
||||
ELOG("ExitLoopEventWait 1");
|
||||
ExitLoopEvent.Wait();
|
||||
}
|
||||
HANDLE h[1];
|
||||
*h = ExitLoopEvent.GetHandle();
|
||||
ELOG("ExitLoopEventWait 2 " << (void *)*h);
|
||||
MsgWaitForMultipleObjects(1, h, FALSE, ms, QS_ALLINPUT);
|
||||
#else
|
||||
MsgWaitForMultipleObjects(0, NULL, FALSE, ms, QS_ALLINPUT);
|
||||
#endif
|
||||
EnterGMutex(level);*/
|
||||
}
|
||||
|
||||
Rect Ctrl::GetWndScreenRect() const
|
||||
{
|
||||
GuiLock __;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue