long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
long wxApp::s_macPreferencesMenuItemId = 0 ;
long wxApp::s_macExitMenuItemId = wxID_EXIT ;
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
long wxApp::s_macPreferencesMenuItemId = 0 ;
long wxApp::s_macExitMenuItemId = wxID_EXIT ;
err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList);
if (err != noErr)
return err;
err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList);
if (err != noErr)
return err;
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
PSN.lowLongOfPSN = kCurrentProcess ;
SetFrontProcess( &PSN ) ;
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
PSN.lowLongOfPSN = kCurrentProcess ;
SetFrontProcess( &PSN ) ;
for (i = 1; i <= itemsInList; i++) {
AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,
(Ptr) & theSpec, sizeof(theSpec), &actualSize);
for (i = 1; i <= itemsInList; i++) {
AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,
(Ptr) & theSpec, sizeof(theSpec), &actualSize);
err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList);
if (err != noErr)
return err;
err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList);
if (err != noErr)
return err;
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
PSN.lowLongOfPSN = kCurrentProcess ;
SetFrontProcess( &PSN ) ;
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
PSN.lowLongOfPSN = kCurrentProcess ;
SetFrontProcess( &PSN ) ;
for (i = 1; i <= itemsInList; i++) {
AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,
(Ptr) & theSpec, sizeof(theSpec), &actualSize);
for (i = 1; i <= itemsInList; i++) {
AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,
(Ptr) & theSpec, sizeof(theSpec), &actualSize);
{
{ kEventClassCommand, kEventProcessCommand } ,
{ kEventClassCommand, kEventCommandUpdateStatus } ,
{
{ kEventClassCommand, kEventProcessCommand } ,
{ kEventClassCommand, kEventCommandUpdateStatus } ,
{ kEventClassApplication , kEventAppActivated } ,
{ kEventClassApplication , kEventAppDeactivated } ,
// handling the quit event is not recommended by apple
// rather using the quit apple event - which we do
{ kEventClassApplication , kEventAppActivated } ,
{ kEventClassApplication , kEventAppDeactivated } ,
// handling the quit event is not recommended by apple
// rather using the quit apple event - which we do
// but have to use ReceiveNextEvent dealing with events manually, therefore we also have
// deal with clicks in the menu bar explicitely
static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
OSStatus result = eventNotHandledErr ;
// but have to use ReceiveNextEvent dealing with events manually, therefore we also have
// deal with clicks in the menu bar explicitely
static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
OSStatus result = eventNotHandledErr ;
GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL,
sizeof( Point ), NULL, &point );
short windowPart = ::FindWindow(point, &window);
GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL,
sizeof( Point ), NULL, &point );
short windowPart = ::FindWindow(point, &window);
GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL,
sizeof( HICommand ), NULL, &command );
MenuCommand id = command.commandID ;
if ( id == kHICommandPreferences )
id = wxApp::s_macPreferencesMenuItemId ;
GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL,
sizeof( HICommand ), NULL, &command );
MenuCommand id = command.commandID ;
if ( id == kHICommandPreferences )
id = wxApp::s_macPreferencesMenuItemId ;
- GetwxAppEventHandlerUPP(),
- GetEventTypeCount(eventList), eventList, wxTheApp, &((EventHandlerRef)wxTheApp->m_macEventHandler));
+ GetwxAppEventHandlerUPP(),
+ GetEventTypeCount(eventList), eventList, wxTheApp, &((EventHandlerRef)wxTheApp->m_macEventHandler));
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments ,
NewAEEventHandlerUPP(AEHandleODoc) ,
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments ,
NewAEEventHandlerUPP(AEHandleODoc) ,
+#if wxUSE_UNICODE
+ wxTheApp->argv = new wxChar*[argc+1];
+ int mb_argc ;
+ for ( mb_argc = 0; mb_argc < argc; mb_argc++ )
+ {
+ wxTheApp->argv[mb_argc] = wxStrdup(wxConvLocal.cMB2WX(argv[mb_argc]));
+ }
+ wxTheApp->argv[mb_argc] = (wxChar *)NULL;
+#else
// Deleting one object may have deleted other pending
// objects, so start from beginning of list again.
// Deleting one object may have deleted other pending
// objects, so start from beginning of list again.
s_inReceiveEvent = true ;
status = ReceiveNextEvent(0, NULL,kEventDurationNoWait,true,&theEvent) ;
s_inReceiveEvent = false ;
s_inReceiveEvent = true ;
status = ReceiveNextEvent(0, NULL,kEventDurationNoWait,true,&theEvent) ;
s_inReceiveEvent = false ;
// having a larger value here leads to large performance slowdowns
// so we cannot give background apps more processor time here
// we do so however having a large sleep value in the main event loop
// having a larger value here leads to large performance slowdowns
// so we cannot give background apps more processor time here
// we do so however having a large sleep value in the main event loop
while ( !IsExiting() && WaitNextEvent(everyEvent, &event,sleepTime, (RgnHandle) wxApp::s_macCursorRgn))
{
while ( !IsExiting() && WaitNextEvent(everyEvent, &event,sleepTime, (RgnHandle) wxApp::s_macCursorRgn))
{
while (node)
{
wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data();
win->MacActivate( ((EventRecord*) MacGetCurrentEvent())->when , false ) ;
while (node)
{
wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data();
win->MacActivate( ((EventRecord*) MacGetCurrentEvent())->when , false ) ;
::ShowFloatingWindows() ;
// raise modal dialogs in case a non modal window was selected to activate the app
::ShowFloatingWindows() ;
// raise modal dialogs in case a non modal window was selected to activate the app
- win->SetSize( newContentRect.left , newContentRect.top ,
- newContentRect.right - newContentRect.left ,
+ win->SetSize( newContentRect.left , newContentRect.top ,
+ newContentRect.right - newContentRect.left ,
long wxMacTranslateKey(unsigned char key, unsigned char code) ;
long wxMacTranslateKey(unsigned char key, unsigned char code)
long wxMacTranslateKey(unsigned char key, unsigned char code) ;
long wxMacTranslateKey(unsigned char key, unsigned char code)
if ( MacSendKeyDownEvent( focus , ev->message , ev->modifiers , ev->when , ev->where.h , ev->where.v ) == false )
{
// has not been handled -> perform default
if ( MacSendKeyDownEvent( focus , ev->message , ev->modifiers , ev->when , ev->where.h , ev->where.v ) == false )
{
// has not been handled -> perform default
if ( modifiers & ( controlKey|shiftKey|optionKey ) )
{
// control interferes with some built-in keys like pgdown, return etc. therefore we remove the controlKey modifier
if ( modifiers & ( controlKey|shiftKey|optionKey ) )
{
// control interferes with some built-in keys like pgdown, return etc. therefore we remove the controlKey modifier
item = mbar->FindItem( id , &menu ) ;
}
wxCHECK_RET( item != NULL && menu != NULL && mbar != NULL, wxT("error in menu item callback") );
item = mbar->FindItem( id , &menu ) ;
}
wxCHECK_RET( item != NULL && menu != NULL && mbar != NULL, wxT("error in menu item callback") );