csplugincommon/macosx/OSXDelegate2D.h
00001 // 00002 // OSXDelegate2D.h 00003 // 00004 // 00005 // Created by mreda on Wed Oct 31 2001. 00006 // Copyright (c) 2001 Matt Reda. All rights reserved. 00007 // 00008 00009 #ifndef __CS_OSXDELEGATE2D_H__ 00010 #define __CS_OSXDELEGATE2D_H__ 00011 00012 #include "csutil/macosx/csosdefs.h" 00013 #include "csextern_osx.h" 00014 #include "ivideo/cursor.h" 00015 00016 #include <OpenGL/OpenGL.h> 00017 // OpenGL/gl.h needs to be included separately for OSX prior to version 10.5: 00018 #include <OpenGL/gl.h> 00019 00020 // Part of this API must be callable from C++ code. So we have to generate a C 00021 // API that provides access to this class 00022 #if !defined(__cplusplus) 00023 00024 #import <Cocoa/Cocoa.h> 00025 #import "OSXDriver2D.h" 00026 00027 @interface OSXDelegate2D : NSObject 00028 #ifdef CS_OSX_10_6 00029 <NSWindowDelegate> 00030 #endif 00031 { 00033 NSTrackingRectTag trackingMouseTag; 00034 BOOL trackingMouse; 00036 BOOL hideMouse; 00037 00042 NSWindow *window; 00043 int style; 00044 NSString *title, *pausedTitle; 00045 00047 BOOL isPaused; 00048 00050 OSXDriver2D driver; 00051 00053 int lastEventType; 00054 } 00055 00057 - (id) initWithDriver:(OSXDriver2D) drv; 00058 00060 - (void) dealloc; 00061 00063 - (BOOL) openWindow:(const char *) winTitle width:(int) w height:(int) h 00064 depth:(int) d fullscreen:(BOOL) fs onDisplay:(CGDirectDisplayID) 00065 display onScreen:(unsigned int) screen; 00066 00068 - (void) setTitle:(char *) newTitle; 00069 00071 - (BOOL) setMouseCursor:(csMouseCursorID) cursor; 00072 00074 - (void) startTrackingMouse; 00075 - (void) stopTrackingMouse; 00076 00078 - (void) mouseEntered:(NSEvent *) ev; 00079 - (void) mouseExited:(NSEvent *) ev; 00080 00082 - (void) closeWindow; 00083 00085 - (void) focusChanged:(BOOL) focused shouldPause:(BOOL) pause; 00086 00088 - (void) dispatchEvent:(NSEvent *) ev forView:(NSView *) view; 00089 00090 @end 00091 00092 #else // __cplusplus 00093 00094 #include <ApplicationServices/ApplicationServices.h> 00095 00096 #define DEL2D_FUNC(ret, func) __private_extern__ "C" ret OSXDelegate2D_##func 00097 00098 typedef void *OSXDelegate2D; 00099 typedef void *csGraphics2DHandle; 00100 00101 // C API to driver delegate class 00102 DEL2D_FUNC(OSXDelegate2D, new)(csGraphics2DHandle drv); 00103 DEL2D_FUNC(void, delete)(OSXDelegate2D); 00104 DEL2D_FUNC(bool, openWindow)(OSXDelegate2D,const char *title, int w, int h, 00105 int d, bool fs, CGDirectDisplayID display, unsigned int screen); 00106 DEL2D_FUNC(void, closeWindow)(OSXDelegate2D); 00107 DEL2D_FUNC(void, setTitle)(OSXDelegate2D, char *title); 00108 DEL2D_FUNC(bool, setMouseCursor)(OSXDelegate2D, csMouseCursorID); 00109 DEL2D_FUNC(void, focusChanged)(OSXDelegate2D, bool focused, bool shouldPause); 00110 DEL2D_FUNC(void, setLevel)(OSXDelegate2D, int level); 00111 DEL2D_FUNC(void, setMousePosition)(OSXDelegate2D, CGPoint point); 00112 00113 #undef DEL2D_FUNC 00114 00115 #endif // __cplusplus 00116 00117 #endif // __CS_OSXDELEGATE2D_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
