git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33138
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include "wx/gdicmn.h"
#include "wx/event.h"
#include "wx/gdicmn.h"
#include "wx/event.h"
-#ifdef __DARWIN__
-#include <CoreFoundation/CoreFoundation.h>
-#else
-#include <CoreFoundation.h>
+#ifdef __WXMAC_OSX__
+#include <CoreFoundation/CFRunLoop.h>
#endif
class WXDLLEXPORT wxFrame;
#endif
class WXDLLEXPORT wxFrame;
WXEVENTHANDLERREF m_macEventHandler ;
WXEVENTHANDLERCALLREF m_macCurrentEventHandlerCallRef ;
WXEVENTREF m_macCurrentEvent ;
WXEVENTHANDLERREF m_macEventHandler ;
WXEVENTHANDLERCALLREF m_macCurrentEventHandlerCallRef ;
WXEVENTREF m_macCurrentEvent ;
CFRunLoopSourceRef m_macEventPosted ;
CFRunLoopSourceRef m_macEventPosted ;
public:
static bool s_macSupportPCMenuShortcuts ;
public:
static bool s_macSupportPCMenuShortcuts ;
extern "C" {
/* m_macEventPosted run loop source callback: */
extern "C" {
/* m_macEventPosted run loop source callback: */
- void macPostedEventCallback(void *unused) { wxTheApp->ProcessPendingEvents(); }
+ void macPostedEventCallback(void *unused);
+void macPostedEventCallback(void *unused) {
+ wxTheApp->ProcessPendingEvents(); }
+#endif
+
bool wxApp::Initialize(int& argc, wxChar **argv)
{
// Mac-specific
bool wxApp::Initialize(int& argc, wxChar **argv)
{
// Mac-specific
wxMacCreateNotifierTable() ;
wxMacCreateNotifierTable() ;
/* connect posted events to common-mode run loop so that wxPostEvent events
are handled even while we're in the menu or on a scrollbar */
CFRunLoopSourceContext event_posted_context = {0};
event_posted_context.perform = macPostedEventCallback;
m_macEventPosted = CFRunLoopSourceCreate(NULL,0,&event_posted_context);
CFRunLoopAddSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
/* connect posted events to common-mode run loop so that wxPostEvent events
are handled even while we're in the menu or on a scrollbar */
CFRunLoopSourceContext event_posted_context = {0};
event_posted_context.perform = macPostedEventCallback;
m_macEventPosted = CFRunLoopSourceCreate(NULL,0,&event_posted_context);
CFRunLoopAddSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
wxToolTip::RemoveToolTips() ;
#endif
wxToolTip::RemoveToolTips() ;
#endif
if (m_macEventPosted)
{
CFRelease(m_macEventPosted);
}
m_macEventPosted = NULL;
if (m_macEventPosted)
{
CFRelease(m_macEventPosted);
}
m_macEventPosted = NULL;
// One last chance for pending objects to be cleaned up
wxTheApp->DeletePendingObjects();
// One last chance for pending objects to be cleaned up
wxTheApp->DeletePendingObjects();
- m_printMode = wxPRINT_WINDOWS;
+ m_printMode = wxPRINT_WINDOWS;
- m_macCurrentEvent = NULL ;
- m_macCurrentEventHandlerCallRef = NULL ;
- m_macEventPosted = NULL ;
+ m_macCurrentEvent = NULL ;
+ m_macCurrentEventHandlerCallRef = NULL ;
+#ifdef __WXMAC_OSX__
+ m_macEventPosted = NULL ;
+#endif
void wxApp::WakeUpIdle()
{
void wxApp::WakeUpIdle()
{
if (m_macEventPosted)
{
CFRunLoopSourceSignal(m_macEventPosted);
}
if (m_macEventPosted)
{
CFRunLoopSourceSignal(m_macEventPosted);
}