#include "wx/app.h"
#ifndef WX_PRECOMP
- #include "wx/dc.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/module.h"
#include "wx/cocoa/mbarman.h"
#include "wx/cocoa/NSApplication.h"
+#include "wx/cocoa/dc.h"
+
#import <AppKit/NSApplication.h>
#import <Foundation/NSRunLoop.h>
#import <Foundation/NSThread.h>
{
wxAutoNSAutoreleasePool pool;
- wxDC::CocoaShutdownTextSystem();
+ wxCocoaDCImpl::CocoaShutdownTextSystem();
wxMenuBarManager::DestroyInstance();
[[NSNotificationCenter defaultCenter] removeObserver:sg_cocoaAppObserver];
if(!sm_isEmbedded)
wxMenuBarManager::CreateInstance();
- wxDC::CocoaInitializeTextSystem();
+ wxCocoaDCImpl::CocoaInitializeTextSystem();
return true;
}
}
// Yield to other processes
-bool wxApp::Yield(bool onlyIfNeeded)
+bool wxApp::DoYield(bool onlyIfNeeded, long eventsToProcess)
{
- // MT-FIXME
- static bool s_inYield = false;
-
#if wxUSE_LOG
// disable log flushing from here because a call to wxYield() shouldn't
// normally result in message boxes popping up &c
wxLog::Suspend();
#endif // wxUSE_LOG
- if (s_inYield)
+ if (m_isInsideYield)
{
if ( !onlyIfNeeded )
{
return false;
}
- s_inYield = true;
+ m_isInsideYield = true;
+ m_eventsToProcessInsideYield = eventsToProcess;
// Run the event loop until it is out of events
while(1)
{
+ // TODO: implement event filtering using the eventsToProcess mask
+
wxAutoNSAutoreleasePool pool;
/* NOTE: It may be better to use something like
NSEventTrackingRunLoopMode since we don't necessarily want all
wxLog::Resume();
#endif // wxUSE_LOG
- s_inYield = false;
+ m_isInsideYield = false;
return true;
}