Skip to content

Commit 20aa69b

Browse files
author
Darcy Liu
committed
add ExternalDisplay
1 parent d6f65b6 commit 20aa69b

30 files changed

Lines changed: 4834 additions & 1 deletion

ExternalDisplay.zip

97.2 KB
Binary file not shown.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
3+
File: ExternalDisplayAppDelegate.h
4+
5+
Abstract: Basics of how to show content on an external display.
6+
7+
Version: 1.0
8+
9+
Disclaimer: IMPORTANT: This Apple software is supplied to you by
10+
Apple Inc. ("Apple") in consideration of your agreement to the
11+
following terms, and your use, installation, modification or
12+
redistribution of this Apple software constitutes acceptance of these
13+
terms. If you do not agree with these terms, please do not use,
14+
install, modify or redistribute this Apple software.
15+
16+
In consideration of your agreement to abide by the following terms, and
17+
subject to these terms, Apple grants you a personal, non-exclusive
18+
license, under Apple's copyrights in this original Apple software (the
19+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
20+
Software, with or without modifications, in source and/or binary forms;
21+
provided that if you redistribute the Apple Software in its entirety and
22+
without modifications, you must retain this notice and the following
23+
text and disclaimers in all such redistributions of the Apple Software.
24+
Neither the name, trademarks, service marks or logos of Apple Inc.
25+
may be used to endorse or promote products derived from the Apple
26+
Software without specific prior written permission from Apple. Except
27+
as expressly stated in this notice, no other rights or licenses, express
28+
or implied, are granted by Apple herein, including but not limited to
29+
any patent rights that may be infringed by your derivative works or by
30+
other works in which the Apple Software may be incorporated.
31+
32+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
33+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
34+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
35+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
36+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
37+
38+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
39+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
42+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
43+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
44+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
45+
POSSIBILITY OF SUCH DAMAGE.
46+
47+
Copyright (C) 2011 Apple Inc. All Rights Reserved.
48+
49+
*/
50+
51+
#import <UIKit/UIKit.h>
52+
53+
@interface ExternalDisplayAppDelegate : NSObject <UIApplicationDelegate>
54+
{
55+
UIWindow *window;
56+
UINavigationController *navigationController;
57+
}
58+
59+
@property (nonatomic, retain) IBOutlet UIWindow *window;
60+
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
61+
62+
@end
63+
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*
2+
3+
File: ExternalDisplayAppDelegate.m
4+
5+
Abstract: Basics of how to show content on an external display.
6+
7+
Version: 1.0
8+
9+
Disclaimer: IMPORTANT: This Apple software is supplied to you by
10+
Apple Inc. ("Apple") in consideration of your agreement to the
11+
following terms, and your use, installation, modification or
12+
redistribution of this Apple software constitutes acceptance of these
13+
terms. If you do not agree with these terms, please do not use,
14+
install, modify or redistribute this Apple software.
15+
16+
In consideration of your agreement to abide by the following terms, and
17+
subject to these terms, Apple grants you a personal, non-exclusive
18+
license, under Apple's copyrights in this original Apple software (the
19+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
20+
Software, with or without modifications, in source and/or binary forms;
21+
provided that if you redistribute the Apple Software in its entirety and
22+
without modifications, you must retain this notice and the following
23+
text and disclaimers in all such redistributions of the Apple Software.
24+
Neither the name, trademarks, service marks or logos of Apple Inc.
25+
may be used to endorse or promote products derived from the Apple
26+
Software without specific prior written permission from Apple. Except
27+
as expressly stated in this notice, no other rights or licenses, express
28+
or implied, are granted by Apple herein, including but not limited to
29+
any patent rights that may be infringed by your derivative works or by
30+
other works in which the Apple Software may be incorporated.
31+
32+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
33+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
34+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
35+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
36+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
37+
38+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
39+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
42+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
43+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
44+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
45+
POSSIBILITY OF SUCH DAMAGE.
46+
47+
Copyright (C) 2011 Apple Inc. All Rights Reserved.
48+
49+
*/
50+
51+
#import "ExternalDisplayAppDelegate.h"
52+
#import "ExternalDisplayViewController.h"
53+
54+
55+
@implementation ExternalDisplayAppDelegate
56+
57+
@synthesize window;
58+
@synthesize navigationController;
59+
60+
61+
#pragma mark -
62+
#pragma mark Application lifecycle
63+
64+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
65+
{
66+
67+
// Override point for customization after application launch.
68+
69+
// Add the navigation controller's view to the window and display.
70+
[window addSubview:navigationController.view];
71+
[window makeKeyAndVisible];
72+
73+
return YES;
74+
}
75+
76+
77+
- (void)applicationWillResignActive:(UIApplication *)application
78+
{
79+
/*
80+
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
81+
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
82+
*/
83+
}
84+
85+
86+
- (void)applicationDidEnterBackground:(UIApplication *)application
87+
{
88+
/*
89+
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
90+
If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
91+
*/
92+
}
93+
94+
95+
- (void)applicationWillEnterForeground:(UIApplication *)application
96+
{
97+
/*
98+
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
99+
*/
100+
}
101+
102+
103+
- (void)applicationDidBecomeActive:(UIApplication *)application
104+
{
105+
/*
106+
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
107+
*/
108+
}
109+
110+
111+
- (void)applicationWillTerminate:(UIApplication *)application
112+
{
113+
/*
114+
Called when the application is about to terminate.
115+
See also applicationDidEnterBackground:.
116+
*/
117+
}
118+
119+
120+
#pragma mark -
121+
#pragma mark Memory management
122+
123+
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
124+
{
125+
/*
126+
Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
127+
*/
128+
}
129+
130+
131+
- (void)dealloc
132+
{
133+
[navigationController release];
134+
[window release];
135+
[super dealloc];
136+
}
137+
138+
139+
@end
140+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
3+
File: ExternalDisplayViewController.h
4+
5+
Abstract: Basics of how to show content on an external display.
6+
7+
Version: 1.0
8+
9+
Disclaimer: IMPORTANT: This Apple software is supplied to you by
10+
Apple Inc. ("Apple") in consideration of your agreement to the
11+
following terms, and your use, installation, modification or
12+
redistribution of this Apple software constitutes acceptance of these
13+
terms. If you do not agree with these terms, please do not use,
14+
install, modify or redistribute this Apple software.
15+
16+
In consideration of your agreement to abide by the following terms, and
17+
subject to these terms, Apple grants you a personal, non-exclusive
18+
license, under Apple's copyrights in this original Apple software (the
19+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
20+
Software, with or without modifications, in source and/or binary forms;
21+
provided that if you redistribute the Apple Software in its entirety and
22+
without modifications, you must retain this notice and the following
23+
text and disclaimers in all such redistributions of the Apple Software.
24+
Neither the name, trademarks, service marks or logos of Apple Inc.
25+
may be used to endorse or promote products derived from the Apple
26+
Software without specific prior written permission from Apple. Except
27+
as expressly stated in this notice, no other rights or licenses, express
28+
or implied, are granted by Apple herein, including but not limited to
29+
any patent rights that may be infringed by your derivative works or by
30+
other works in which the Apple Software may be incorporated.
31+
32+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
33+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
34+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
35+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
36+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
37+
38+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
39+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
42+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
43+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
44+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
45+
POSSIBILITY OF SUCH DAMAGE.
46+
47+
Copyright (C) 2011 Apple Inc. All Rights Reserved.
48+
49+
*/
50+
51+
#import <UIKit/UIKit.h>
52+
#import "PresoModeViewController.h"
53+
54+
@interface ExternalDisplayViewController : UIViewController <UIPopoverControllerDelegate, PresoModeViewDelegate>
55+
{
56+
UITextView *consoleLog;
57+
UIBarButtonItem *presoModeBarButton;
58+
UIViewController *presoModeViewController;
59+
UIPopoverController *popoverController;
60+
UIImageView *mainView;
61+
UIImageView *extView;
62+
UIWindow *extWindow;
63+
}
64+
65+
@property (nonatomic, retain) IBOutlet UITextView *consoleLog;
66+
@property (nonatomic, retain) IBOutlet UIBarButtonItem *presoModeBarButton;
67+
@property (nonatomic, retain) IBOutlet UIViewController *presoModeViewController;
68+
@property (nonatomic, retain) UIPopoverController *popoverController;
69+
@property (nonatomic, retain) IBOutlet UIImageView *mainView;
70+
@property (nonatomic, retain) IBOutlet UIImageView *extView;
71+
@property (nonatomic, retain) UIWindow *extWindow;
72+
73+
- (IBAction)barButtonAction:(id)sender;
74+
75+
@end
76+

0 commit comments

Comments
 (0)