Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "cinder/gl/gl.h"
00025
00026 #import <Cocoa/Cocoa.h>
00027
00028 #import "cinder/app/AppBasic.h"
00029 #import "cinder/app/CinderView.h"
00030 #import "cinder/Stream.h"
00031 #import "cinder/Display.h"
00032
00033 #include "cinder/app/TouchEvent.h"
00034
00035 #include <list>
00036
00037 @class CinderWindow;
00038 @class WindowImplBasicCocoa;
00039
00040 @interface AppImplCocoaBasic : NSObject <NSApplicationDelegate,NSWindowDelegate> {
00041 @public
00042 NSTimer *mAnimationTimer;
00043 class cinder::app::AppBasic *mApp;
00044
00045 BOOL mNeedsUpdate;
00046 BOOL mFrameRateEnabled;
00047 float mFrameRate;
00048
00049 NSMutableArray *mWindows;
00050 WindowImplBasicCocoa *mActiveWindow;
00051 }
00052
00053 @property(retain, nonatomic) NSMutableArray *windows;
00054
00055 - (id)init:(cinder::app::AppBasic*)aApp;
00056 - (void)setApplicationMenu: (NSString*) applicationName;
00057 - (void)startAnimationTimer;
00058 - (void)applicationWillTerminate:(NSNotification *)notification;
00059 - (void)quit;
00060
00061 - (cinder::app::WindowRef)createWindow:(cinder::app::Window::Format)format;
00062
00063 - (float)getFrameRate;
00064 - (void)setFrameRate:(float)aFrameRate;
00065 - (void)disableFrameRate;
00066 - (bool)isFrameRateEnabled;
00067 - (std::string)getAppPath;
00068 - (void)quit;
00069
00070 - (cinder::app::RendererRef)findSharedRenderer:(cinder::app::RendererRef)match;
00071 - (cinder::app::WindowRef)getWindow;
00072 - (cinder::app::WindowRef)getForegroundWindow;
00073 - (size_t)getNumWindows;
00074 - (cinder::app::WindowRef)getWindowIndex:(size_t)index;
00075 - (void)setActiveWindow:(WindowImplBasicCocoa*)win;
00076 - (WindowImplBasicCocoa*)findWindowImpl:(NSWindow*)window;
00077
00078 @end
00079
00081
00082 @interface WindowImplBasicCocoa : NSObject<NSWindowDelegate,CinderViewDelegate,WindowImplCocoa> {
00083 @public
00084 AppImplCocoaBasic *mAppImpl;
00085 NSWindow *mWin;
00086 CinderView *mCinderView;
00087 cinder::app::WindowRef mWindowRef;
00088 cinder::DisplayRef mDisplay;
00089 cinder::Vec2i mSize, mPos;
00090 BOOL mResizable, mBorderless, mAlwaysOnTop, mHidden;
00091 }
00092
00093
00094
00095 - (void)dealloc;
00096 - (BOOL)isFullScreen;
00097 - (void)setFullScreen:(BOOL)fullScreen options:(const cinder::app::FullScreenOptions *)options;
00098 - (cinder::Vec2i)getSize;
00099 - (void)setSize:(cinder::Vec2i)size;
00100 - (cinder::Vec2i)getPos;
00101 - (float)getContentScale;
00102 - (void)setPos:(cinder::Vec2i)pos;
00103 - (float)getContentScale;
00104 - (void)close;
00105 - (NSString *)getTitle;
00106 - (void)setTitle:(NSString *)title;
00107 - (BOOL)isBorderless;
00108 - (void)setBorderless:(BOOL)borderless;
00109 - (bool)isAlwaysOnTop;
00110 - (void)setAlwaysOnTop:(bool)alwaysOnTop;
00111 - (void)hide;
00112 - (void)show;
00113 - (BOOL)isHidden;
00114 - (cinder::DisplayRef)getDisplay;
00115 - (cinder::app::RendererRef)getRenderer;
00116 - (void*)getNative;
00117
00118 - (void)windowMovedNotification:(NSNotification*)inNotification;
00119 - (void)windowWillCloseNotification:(NSNotification*)inNotification;
00120
00121
00122 - (void)resize;
00123 - (void)draw;
00124 - (void)mouseDown:(cinder::app::MouseEvent*)event;
00125 - (void)mouseDrag:(cinder::app::MouseEvent*)event;
00126 - (void)mouseUp:(cinder::app::MouseEvent*)event;
00127 - (void)mouseMove:(cinder::app::MouseEvent*)event;
00128 - (void)mouseWheel:(cinder::app::MouseEvent*)event;
00129 - (void)keyDown:(cinder::app::KeyEvent*)event;
00130 - (void)keyUp:(cinder::app::KeyEvent*)event;
00131 - (void)touchesBegan:(cinder::app::TouchEvent*)event;
00132 - (void)touchesMoved:(cinder::app::TouchEvent*)event;
00133 - (void)touchesEnded:(cinder::app::TouchEvent*)event;
00134 - (const std::vector<cinder::app::TouchEvent::Touch>&)getActiveTouches;
00135 - (void)fileDrop:(cinder::app::FileDropEvent*)event;
00136 - (cinder::app::WindowRef)getWindowRef;
00137
00138 + (WindowImplBasicCocoa*)instantiate:(cinder::app::Window::Format)winFormat withAppImpl:(AppImplCocoaBasic*)appImpl withRetina:(BOOL)retinaEnabled;
00139
00140 @end