1 /* xscreensaver, Copyright (c) 2006-2015 Jamie Zawinski <jwz@jwz.org>
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation. No representations are made about the suitability of this
8 * software for any purpose. It is provided "as is" without express or
13 # import <Foundation/Foundation.h>
14 # import <UIKit/UIKit.h>
15 # import <OpenGLES/EAGL.h>
16 # import <OpenGLES/ES1/gl.h>
17 # import <OpenGLES/ES1/glext.h>
18 # import <QuartzCore/QuartzCore.h>
19 # define NSView UIView
20 # define NSRect CGRect
21 # define NSSize CGSize
22 # define NSColor UIColor
23 # define NSImage UIImage
24 # define NSEvent UIEvent
25 # define NSWindow UIWindow
26 # define NSButton UIButton
27 # define NSApplication UIApplication
28 # define NSScreen UIScreen
30 # import <Cocoa/Cocoa.h>
31 # import <ScreenSaver/ScreenSaver.h>
34 #import <XScreenSaverView.h>
40 @interface SaverViewController : UIViewController
44 XScreenSaverView *_saverView;
46 /* When a the SaverViewController is presented, iOS automatically changes
47 the status bar orientation. (And, by extension, the notification center
48 orientation.) But there's no willPresentAsModal: event for a
49 UIViewController so that it knows when this is going to happen, and the
50 other event handlers occur after the status bar is changed. So save the
51 orientation just before the view controller is modal-presented, and
52 restore the proper status bar orientation just before the saverView is
53 created so it can pick it up in didRotate:. */
54 // UIInterfaceOrientation _storedOrientation;
61 @property(nonatomic, retain) NSString *saverName;
67 @interface SaverRunner : NSObject
69 <XScreenSaverViewDelegate>
72 NSString *saverName; // the one currently loaded
73 NSArray *saverNames; // Names of available savers
74 NSString *saverDir; // Where we find saver bundles
78 NSBundle *saverBundle;
80 IBOutlet NSMenu *menubar;
85 UINavigationController *rotating_nav; // Hierarchy 1 (UI)
86 IBOutlet UIWindow *window;
87 IBOutlet UIView *view;
89 SaverViewController *nonrotating_controller; // Hierarchy 2 (savers)
91 UIImage *saved_screenshot;
96 - (XScreenSaverView *) newSaverView: (NSString *) module
97 withSize: (NSSize) size;
98 - (void) loadSaver: (NSString *)name;
99 - (void) selectedSaverDidChange:(NSDictionary *)change;
102 - (void) openPreferences: (id)sender;
104 - (void) openPreferences: (NSString *)which;
105 - (UIImage *) screenshot;
106 - (NSString *) makeDesc:(NSString *)saver
107 yearOnly:(BOOL) yearp;