~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to source/Irrlicht/MacOSX/AppDelegate.mm

  • Committer: Mantas Kriaučiūnas
  • Date: 2011-07-18 13:06:25 UTC
  • Revision ID: mantas@akl.lt-20110718130625-c5pvifp61e7kj1ol
Included whole irrlicht SVN libraries to work around launchpad recipe issue with quilt, see https://answers.launchpad.net/launchpad/+question/165193

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2005-2006 Etienne Petitjean
 
2
// Copyright (C) 2007-2011 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_