1/*
2    Copyright (c) 2005-2021 Intel Corporation
3
4    Licensed under the Apache License, Version 2.0 (the "License");
5    you may not use this file except in compliance with the License.
6    You may obtain a copy of the License at
7
8        http://www.apache.org/licenses/LICENSE-2.0
9
10    Unless required by applicable law or agreed to in writing, software
11    distributed under the License is distributed on an "AS IS" BASIS,
12    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    See the License for the specific language governing permissions and
14    limitations under the License.
15*/
16
17#import "tbbAppDelegate.h"
18
19#if TARGET_OS_IPHONE
20
21@implementation tbbAppDelegate
22
23- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
24{
25    return YES;
26}
27
28- (void)applicationDidEnterBackground:(UIApplication *)application
29{
30    exit(EXIT_SUCCESS);
31}
32
33@end
34
35#elif TARGET_OS_MAC
36
37@implementation tbbAppDelegate
38
39@synthesize window = _window;
40
41//declared in macvideo.cpp file
42extern int g_sizex, g_sizey;
43
44- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
45{
46    // Insert code here to initialize your application
47    NSRect windowSize;
48    windowSize.size.height = g_sizey;
49    windowSize.size.width = g_sizex;
50    windowSize.origin=_window.frame.origin;
51    [_window setFrame:windowSize display:YES];
52
53}
54
55- (BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication *) sender
56{
57    return YES;
58}
59
60@end
61
62#endif
63