- Warnings completely suppressed for the included TinyXML and gzstream libraries - Parentheses warnings are now errors, since there were several that looked like bugs - Ditto for dangling else warnings Some of these warnings were actually bugs: - Town wandering monsters would have never spawned, because the code to do so was accidentally nested within a check for overall_mode == MODE_OUTDOORS ---> boe.monster.cpp, lines 105-137 - Monster's behaviour with respect to elemental fields did not correctly depend on their immunities (this is the same precedence issue Sylae messed up fixing in the Windows code) ---> boe.monsters.cpp, lines 345-359 - Display of damage blocked by armour appeared to be incorrect (needs verification) ---> boe.newgraph.cpp, line 1079 - Three-choice dialogs probably weren't dealing with unusual button types correctly, though that's a minor point since they aren't expected to use such buttons
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
//
|
|
// pc.appleevents.mm
|
|
// BoE
|
|
//
|
|
// Created by Celtic Minstrel on 14-04-16.
|
|
//
|
|
//
|
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
extern bool verify_restore_quit(bool mode);
|
|
extern bool All_Done;
|
|
|
|
typedef NSAppleEventDescriptor AEDescr;
|
|
|
|
@interface AppleEventHandler : NSObject
|
|
-(void)handleOpenDoc:(AEDescr*)theAppleEvent withReply: (AEDescr*)reply;
|
|
-(void)handleQuit:(AEDescr*)theAppleEvent withReply: (AEDescr*)reply;
|
|
@end
|
|
|
|
void set_up_apple_events(); // Suppress "no prototype" warning
|
|
void set_up_apple_events() {
|
|
AppleEventHandler* aeHandler = [[AppleEventHandler alloc] init];
|
|
NSAppleEventManager* AEmgr = [NSAppleEventManager sharedAppleEventManager];
|
|
[AEmgr setEventHandler: aeHandler andSelector: @selector(handleOpenDoc:withReply:)
|
|
forEventClass: kCoreEventClass andEventID: kAEOpenDocuments];
|
|
[AEmgr setEventHandler: aeHandler andSelector: @selector(handleQuit:withReply:)
|
|
forEventClass: kCoreEventClass andEventID: kAEQuitApplication];
|
|
}
|
|
|
|
@implementation AppleEventHandler
|
|
-(void)handleOpenDoc:(AEDescr*)theAppleEvent withReply: (AEDescr*)reply {
|
|
(void) theAppleEvent; // Suppress "unused parameter" warning
|
|
(void) reply;
|
|
// TODO: Handle this
|
|
}
|
|
-(void)handleQuit:(AEDescr*)theAppleEvent withReply: (AEDescr*)reply {
|
|
(void) theAppleEvent; // Suppress "unused parameter" warning
|
|
(void) reply;
|
|
All_Done = verify_restore_quit(0);
|
|
}
|
|
@end
|
|
|