From: Stefan Csomor Date: Fri, 14 May 2004 09:19:09 +0000 (+0000) Subject: moving wxMacWakeUp to utils, as macnotify will soon be removed X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/73280e055362c69fa837bf44efc125a0db219c0b moving wxMacWakeUp to utils, as macnotify will soon be removed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/macnotfy.cpp b/src/mac/carbon/macnotfy.cpp index 690f83b214..2962de20f5 100644 --- a/src/mac/carbon/macnotfy.cpp +++ b/src/mac/carbon/macnotfy.cpp @@ -28,35 +28,7 @@ struct wxMacNotificationEvents typedef struct wxMacNotificationEvents wxMacNotificationEvents ; static wxMacNotificationEvents gMacNotificationEvents ; -static ProcessSerialNumber gAppProcess ; - -void wxMacWakeUp() -{ - ProcessSerialNumber psn ; - Boolean isSame ; - psn.highLongOfPSN = 0 ; - psn.lowLongOfPSN = kCurrentProcess ; - SameProcess( &gAppProcess , &psn , &isSame ) ; - if ( isSame ) - { -#if TARGET_CARBON - EventRef dummyEvent ; - OSStatus err = MacCreateEvent(nil, 'WXMC', 'WXMC', GetCurrentEventTime(), - kEventAttributeNone, &dummyEvent); - if (err == noErr) - { - err = PostEventToQueue(GetMainEventQueue(), dummyEvent, - kEventPriorityHigh); - } -#else - PostEvent( nullEvent , 0 ) ; -#endif - } - else - { - WakeUpProcess( &gAppProcess ) ; - } -} +ProcessSerialNumber gAppProcess ; void wxMacCreateNotifierTable() { diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index eff9beaca2..bdaab9b20c 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -1224,6 +1224,40 @@ void wxMacConvertNewlines10To13( wxChar * data ) } #endif +// ---------------------------------------------------------------------------- +// Common Event Support +// ---------------------------------------------------------------------------- + +extern ProcessSerialNumber gAppProcess ; + +void wxMacWakeUp() +{ + ProcessSerialNumber psn ; + Boolean isSame ; + psn.highLongOfPSN = 0 ; + psn.lowLongOfPSN = kCurrentProcess ; + SameProcess( &gAppProcess , &psn , &isSame ) ; + if ( isSame ) + { +#if TARGET_CARBON + EventRef dummyEvent ; + OSStatus err = MacCreateEvent(nil, 'WXMC', 'WXMC', GetCurrentEventTime(), + kEventAttributeNone, &dummyEvent); + if (err == noErr) + { + err = PostEventToQueue(GetMainEventQueue(), dummyEvent, + kEventPriorityHigh); + } +#else + PostEvent( nullEvent , 0 ) ; +#endif + } + else + { + WakeUpProcess( &gAppProcess ) ; + } +} + // ---------------------------------------------------------------------------- // Carbon Event Support // ----------------------------------------------------------------------------