00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __CS_OSXDELEGATE2D_H__
00010 #define __CS_OSXDELEGATE2D_H__
00011
00012 #include "csextern_osx.h"
00013 #include "ivideo/cursor.h"
00014
00015 #include <OpenGL/OpenGL.h>
00016
00017 #include <OpenGL/gl.h>
00018
00019
00020
00021 #if !defined(__cplusplus)
00022
00023 #import <Cocoa/Cocoa.h>
00024 #import "OSXDriver2D.h"
00025
00026 @interface OSXDelegate2D : NSObject
00027 {
00029 NSTrackingRectTag trackingMouseTag;
00030 BOOL trackingMouse;
00032 BOOL hideMouse;
00033
00038 NSWindow *window;
00039 int style;
00040 NSString *title, *pausedTitle;
00041
00043 BOOL isPaused;
00044
00046 OSXDriver2D driver;
00047
00049 int lastEventType;
00050 }
00051
00053 - (id) initWithDriver:(OSXDriver2D) drv;
00054
00056 - (void) dealloc;
00057
00059 - (BOOL) openWindow:(const char *) winTitle width:(int) w height:(int) h
00060 depth:(int) d fullscreen:(BOOL) fs onDisplay:(CGDirectDisplayID)
00061 display onScreen:(unsigned int) screen;
00062
00064 - (void) setTitle:(char *) newTitle;
00065
00067 - (BOOL) setMouseCursor:(csMouseCursorID) cursor;
00068
00070 - (void) startTrackingMouse;
00071 - (void) stopTrackingMouse;
00072
00074 - (void) mouseEntered:(NSEvent *) ev;
00075 - (void) mouseExited:(NSEvent *) ev;
00076
00078 - (void) closeWindow;
00079
00081 - (void) focusChanged:(BOOL) focused shouldPause:(BOOL) pause;
00082
00084 - (void) dispatchEvent:(NSEvent *) ev forView:(NSView *) view;
00085
00086 @end
00087
00088 #else // __cplusplus
00089
00090 #include <ApplicationServices/ApplicationServices.h>
00091
00092 #define DEL2D_FUNC(ret, func) __private_extern__ "C" ret OSXDelegate2D_##func
00093
00094 typedef void *OSXDelegate2D;
00095 typedef void *csGraphics2DHandle;
00096
00097
00098 DEL2D_FUNC(OSXDelegate2D, new)(csGraphics2DHandle drv);
00099 DEL2D_FUNC(void, delete)(OSXDelegate2D);
00100 DEL2D_FUNC(bool, openWindow)(OSXDelegate2D,const char *title, int w, int h,
00101 int d, bool fs, CGDirectDisplayID display, unsigned int screen);
00102 DEL2D_FUNC(void, closeWindow)(OSXDelegate2D);
00103 DEL2D_FUNC(void, setTitle)(OSXDelegate2D, char *title);
00104 DEL2D_FUNC(bool, setMouseCursor)(OSXDelegate2D, csMouseCursorID);
00105 DEL2D_FUNC(void, focusChanged)(OSXDelegate2D, bool focused, bool shouldPause);
00106 DEL2D_FUNC(void, setLevel)(OSXDelegate2D, int level);
00107 DEL2D_FUNC(void, setMousePosition)(OSXDelegate2D, CGPoint point);
00108
00109 #undef DEL2D_FUNC
00110
00111 #endif // __cplusplus
00112
00113 #endif // __CS_OSXDELEGATE2D_H__