diff options
Diffstat (limited to 'libraries/irrlicht-1.8.1/source/Irrlicht/MacOSX/AppDelegate.mm')
-rw-r--r-- | libraries/irrlicht-1.8.1/source/Irrlicht/MacOSX/AppDelegate.mm | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8.1/source/Irrlicht/MacOSX/AppDelegate.mm b/libraries/irrlicht-1.8.1/source/Irrlicht/MacOSX/AppDelegate.mm new file mode 100644 index 0000000..14a7f86 --- /dev/null +++ b/libraries/irrlicht-1.8.1/source/Irrlicht/MacOSX/AppDelegate.mm | |||
@@ -0,0 +1,79 @@ | |||
1 | // Copyright (C) 2005-2006 Etienne Petitjean | ||
2 | // Copyright (C) 2007-2012 Christian Stehno | ||
3 | // This file is part of the "Irrlicht Engine". | ||
4 | // For conditions of distribution and use, see copyright notice in Irrlicht.h | ||
5 | |||
6 | #import "AppDelegate.h" | ||
7 | |||
8 | #ifdef _IRR_COMPILE_WITH_OSX_DEVICE_ | ||
9 | |||
10 | @implementation AppDelegate | ||
11 | |||
12 | - (id)initWithDevice:(irr::CIrrDeviceMacOSX *)device | ||
13 | { | ||
14 | self = [super init]; | ||
15 | if (self) _device = device; | ||
16 | return (self); | ||
17 | } | ||
18 | |||
19 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification | ||
20 | { | ||
21 | _quit = FALSE; | ||
22 | } | ||
23 | |||
24 | - (void)orderFrontStandardAboutPanel:(id)sender | ||
25 | { | ||
26 | [NSApp orderFrontStandardAboutPanel:sender]; | ||
27 | } | ||
28 | |||
29 | - (void)unhideAllApplications:(id)sender | ||
30 | { | ||
31 | [NSApp unhideAllApplications:sender]; | ||
32 | } | ||
33 | |||
34 | - (void)hide:(id)sender | ||
35 | { | ||
36 | [NSApp hide:sender]; | ||
37 | } | ||
38 | |||
39 | - (void)hideOtherApplications:(id)sender | ||
40 | { | ||
41 | [NSApp hideOtherApplications:sender]; | ||
42 | } | ||
43 | |||
44 | - (void)terminate:(id)sender | ||
45 | { | ||
46 | _quit = TRUE; | ||
47 | } | ||
48 | |||
49 | - (void)windowWillClose:(id)sender | ||
50 | { | ||
51 | _quit = TRUE; | ||
52 | } | ||
53 | |||
54 | - (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize | ||
55 | { | ||
56 | if (_device->isResizable()) | ||
57 | return proposedFrameSize; | ||
58 | else | ||
59 | return [window frame].size; | ||
60 | } | ||
61 | |||
62 | - (void)windowDidResize:(NSNotification *)aNotification | ||
63 | { | ||
64 | NSWindow *window; | ||
65 | NSRect frame; | ||
66 | |||
67 | window = [aNotification object]; | ||
68 | frame = [window frame]; | ||
69 | _device->setResize((int)frame.size.width,(int)frame.size.height); | ||
70 | } | ||
71 | |||
72 | - (BOOL)isQuit | ||
73 | { | ||
74 | return (_quit); | ||
75 | } | ||
76 | |||
77 | @end | ||
78 | |||
79 | #endif // _IRR_COMPILE_WITH_OSX_DEVICE_ | ||