From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / OSX / SaverRunner.h
1 /* xscreensaver, Copyright (c) 2006-2013 Jamie Zawinski <jwz@jwz.org>
2  *
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 
9  * implied warranty.
10  */
11
12 #ifdef USE_IPHONE
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
29 #else
30 # import <Cocoa/Cocoa.h>
31 # import <ScreenSaver/ScreenSaver.h>
32 #endif
33
34 @class ScreenSaverView;
35
36 @interface SaverRunner : NSObject
37 {
38   NSString *saverName;          // the one currently loaded
39   NSArray  *saverNames;         // Names of available savers
40   NSString *saverDir;           // Where we find saver bundles
41
42 # ifndef USE_IPHONE
43
44   NSBundle *saverBundle;
45   NSArray  *windows;
46   IBOutlet NSMenu *menubar;
47
48 # else  // USE_IPHONE
49
50   ScreenSaverView *saverView;
51   UIView *backgroundView;
52   UINavigationController *rootViewController;
53   IBOutlet UIWindow *window;
54   EAGLContext *eagl_ctx;
55   GLuint gl_framebuffer, gl_renderbuffer;
56   IBOutlet UIView *view;
57   UIImage *saved_screenshot;
58   UIView *aboutBox;
59   NSTimer *splashTimer;
60
61 # endif // USE_IPHONE
62 }
63
64 - (void) loadSaver: (NSString *)name launch:(BOOL)launch;
65 - (void) loadSaver: (NSString *)name;
66 - (void) selectedSaverDidChange:(NSDictionary *)change;
67 - (void) aboutPanel: (id)sender;
68
69 #ifndef USE_IPHONE
70 - (void) openPreferences: (id)sender;
71 #else  // USE_IPHONE
72 - (void) openPreferences: (NSString *)which;
73 - (UIImage *) screenshot;
74 #endif // USE_IPHONE
75
76 @end