* -------------------------------------------------------------------------
*/
+#include "wx/wx.h"
+
+#include "wx/mac/private.h"
+
#include "wx/mac/macnotfy.h"
const short kMaxEvents = 1000 ;
typedef struct wxMacNotificationEvents wxMacNotificationEvents ;
wxMacNotificationEvents gMacNotificationEvents ;
-ProcessSerialNumber gSocketProcess ;
+ProcessSerialNumber gAppProcess ;
void wxMacWakeUp()
{
Boolean isSame ;
psn.highLongOfPSN = 0 ;
psn.lowLongOfPSN = kCurrentProcess ;
- SameProcess( &gSocketProcess , &psn , &isSame ) ;
+ SameProcess( &gAppProcess , &psn , &isSame ) ;
if ( isSame )
{
PostEvent( nullEvent , 0 ) ;
}
else
{
- WakeUpProcess( &gSocketProcess ) ;
+ WakeUpProcess( &gAppProcess ) ;
}
}
void wxMacCreateNotifierTable()
{
- GetCurrentProcess(&gSocketProcess);
+ GetCurrentProcess(&gAppProcess);
gMacNotificationEvents.top = 0 ;
gMacNotificationEvents.bottom = 0 ;
for ( int i = 0 ; i < kMaxEvents ; ++i )
void wxMacDestroyNotifierTable()
{
- wxASSERT( gMacNotificationEvents.top == gMacNotificationEvents.bottom ) ;
}
wxMacNotifierTableRef wxMacGetNotifierTable()
short wakeUp )
{
wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ;
+ wxASSERT_MSG( handler != NULL , "illegal notification proc ptr" ) ;
/* this should be protected eventually */
short index = e->top++ ;
gMacNotificationEvents.events[index] = NULL ;
gMacNotificationEvents.proc[index] = NULL ;
- handler( event , data ) ;
+ if ( handler )
+ handler( event , data ) ;
}
gInProcessing = false ;
}