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 #pragma once
00024
00025 #include "cinder/Cinder.h"
00026 #include "cinder/app/App.h"
00027
00028 #import <AppKit/NSView.h>
00029 #import <Foundation/Foundation.h>
00030 #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
00031 #import <AppKit/NSTouch.h>
00032 #include "cinder/app/TouchEvent.h"
00033 #endif
00034
00035 #include <map>
00036
00037 #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
00038 @protocol CinderViewMultiTouchDelegate
00039 - (void)touchesBegan:(ci::app::TouchEvent*)event;
00040 - (void)touchesMoved:(ci::app::TouchEvent*)event;
00041 - (void)touchesEnded:(ci::app::TouchEvent*)event;
00042 - (void)touchesEnded:(ci::app::TouchEvent*)event;
00043 - (void)setActiveTouches:(std::vector<ci::app::TouchEvent::Touch>*)touches;
00044 @end
00045 #endif
00046
00047 @interface CinderView : NSView
00048 {
00049 @public
00050 cinder::app::App *app;
00051 BOOL stayFullScreen;
00052 BOOL appSetupCalled;
00053 BOOL receivesEvents;
00054
00055 #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
00056 NSMutableDictionary *mTouchIdMap;
00057 std::map<uint32_t,ci::Vec2f> mTouchPrevPointMap;
00058 id<CinderViewMultiTouchDelegate> mMultiTouchDelegate;
00059 #endif
00060 }
00061
00062 @property (readwrite) BOOL appSetupCalled;
00063 @property (readwrite) BOOL receivesEvents;
00064
00065 - (id)initWithFrame:(NSRect)frame app:(cinder::app::App*)aApp;
00066 - (id)initFullScreenWithApp:(cinder::app::App*)aApp;
00067 - (void)setupRenderer:(NSRect)frame;
00068
00069 - (void)draw;
00070
00071 - (void)setup:(cinder::app::App *)aApp;
00072 - (void)setApp:(cinder::app::App *)aApp;
00073
00074 - (void)applicationWillResignActive:(NSNotification *)aNotification;
00075
00076 #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
00077 - (void)setMultiTouchDelegate:(id<CinderViewMultiTouchDelegate>)multiTouchDelegate;
00078 - (uint32_t)addTouchToMap:(NSTouch *)touch withPoint:(ci::Vec2f)point;
00079 - (void)removeTouchFromMap:(NSTouch *)touch;
00080 - (std::pair<uint32_t,ci::Vec2f>)updateTouch:(NSTouch *)touch withPoint:(ci::Vec2f)point;
00081 - (void)updateActiveTouches:(NSEvent *)event;
00082 #endif
00083
00084 @end