<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Crystal Space 1.2.1: csplugincommon/macosx/OSXDelegate2D.h Source File (Crystal Space 1.2.1 Public API Reference)</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <table border="0" cellpadding="0" cellspacing="0" width="100%" class="head"> <tr height="59"> <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td> <td class="head"><h2>Public API Reference</h2></td> </tr> <tr height="11"> <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td> </tr> </table> <div class="content"> <!-- Generated by Doxygen 1.5.3 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <h1>csplugincommon/macosx/OSXDelegate2D.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span> <a name="l00002"></a>00002 <span class="comment">// OSXDelegate2D.h</span> <a name="l00003"></a>00003 <span class="comment">//</span> <a name="l00004"></a>00004 <span class="comment">//</span> <a name="l00005"></a>00005 <span class="comment">// Created by mreda on Wed Oct 31 2001.</span> <a name="l00006"></a>00006 <span class="comment">// Copyright (c) 2001 Matt Reda. All rights reserved.</span> <a name="l00007"></a>00007 <span class="comment">//</span> <a name="l00008"></a>00008 <a name="l00009"></a>00009 <span class="preprocessor">#ifndef __CS_OSXDELEGATE2D_H__</span> <a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __CS_OSXDELEGATE2D_H__</span> <a name="l00011"></a>00011 <span class="preprocessor"></span> <a name="l00012"></a>00012 <span class="preprocessor">#include "csextern_osx.h"</span> <a name="l00013"></a>00013 <span class="preprocessor">#include "<a class="code" href="cursor_8h.html" title="Mouse cursor IDs.">ivideo/cursor.h</a>"</span> <a name="l00014"></a>00014 <a name="l00015"></a>00015 <span class="preprocessor">#include <OpenGL/OpenGL.h></span> <a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="comment">// Part of this API must be callable from C++ code. So we have to generate a C</span> <a name="l00018"></a>00018 <span class="comment">// API that provides access to this class</span> <a name="l00019"></a>00019 <span class="preprocessor">#if !defined(__cplusplus)</span> <a name="l00020"></a>00020 <span class="preprocessor"></span> <a name="l00021"></a>00021 <span class="preprocessor">#import <Cocoa/Cocoa.h></span> <a name="l00022"></a>00022 <span class="preprocessor">#import "OSXDriver2D.h"</span> <a name="l00023"></a>00023 <a name="l00024"></a><a class="code" href="interfaceOSXDelegate2D.html">00024</a> <span class="keyword">@interface </span><a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a> : NSObject <a name="l00025"></a>00025 { <a name="l00027"></a><a class="code" href="interfaceOSXDelegate2D.html#fe2cc349584bff81ce95f17e39efd861">00027</a> NSTrackingRectTag <a class="code" href="interfaceOSXDelegate2D.html#fe2cc349584bff81ce95f17e39efd861" title="Keep track of mouse tracking state.">trackingMouseTag</a>; <a name="l00028"></a><a class="code" href="interfaceOSXDelegate2D.html#a4c924c11b4d6cb89dcc8d3eddc4d730">00028</a> BOOL <a class="code" href="interfaceOSXDelegate2D.html#a4c924c11b4d6cb89dcc8d3eddc4d730">trackingMouse</a>; <a name="l00030"></a><a class="code" href="interfaceOSXDelegate2D.html#fe9d0188b753a0a08b6e12deaa34fdc9">00030</a> BOOL <a class="code" href="interfaceOSXDelegate2D.html#fe9d0188b753a0a08b6e12deaa34fdc9" title="YES if mouse is not visible.">hideMouse</a>; <a name="l00031"></a>00031 <a name="l00036"></a><a class="code" href="interfaceOSXDelegate2D.html#f697dda07835587306b9b2ba949ece60">00036</a> NSWindow *<a class="code" href="interfaceOSXDelegate2D.html#f697dda07835587306b9b2ba949ece60" title="Window - created even in fullscreen mode to get events (but with a different style)...">window</a>; <a name="l00037"></a><a class="code" href="interfaceOSXDelegate2D.html#3d97115e8ab9faf50bbcb99b3175e29f">00037</a> <span class="keywordtype">int</span> <a class="code" href="interfaceOSXDelegate2D.html#3d97115e8ab9faf50bbcb99b3175e29f">style</a>; <a name="l00038"></a><a class="code" href="interfaceOSXDelegate2D.html#d065388b1dae1964e3b1f067b9d5b02d">00038</a> NSString *<a class="code" href="interfaceOSXDelegate2D.html#d065388b1dae1964e3b1f067b9d5b02d">title</a>, *<a class="code" href="interfaceOSXDelegate2D.html#c05e0ae754a4f5905cea8f3f5cd494aa">pausedTitle</a>; <a name="l00039"></a>00039 <a name="l00041"></a><a class="code" href="interfaceOSXDelegate2D.html#e4f19e52280980616f3a8dab2c610ab5">00041</a> BOOL <a class="code" href="interfaceOSXDelegate2D.html#e4f19e52280980616f3a8dab2c610ab5" title="Is window paused (out of focus, etc).">isPaused</a>; <a name="l00042"></a>00042 <a name="l00044"></a><a class="code" href="interfaceOSXDelegate2D.html#bc4a036f0feeba0e3ade5314b2fb0efd">00044</a> OSXDriver2D <a class="code" href="interfaceOSXDelegate2D.html#bc4a036f0feeba0e3ade5314b2fb0efd" title="Driver that this object works with.">driver</a>; <a name="l00045"></a>00045 <a name="l00047"></a><a class="code" href="interfaceOSXDelegate2D.html#d28969ed37a6ca172aeaf334fd4d212e">00047</a> <span class="keywordtype">int</span> <a class="code" href="interfaceOSXDelegate2D.html#d28969ed37a6ca172aeaf334fd4d212e" title="Last processed event type.">lastEventType</a>; <a name="l00048"></a>00048 } <a name="l00049"></a>00049 <a name="l00051"></a>00051 - (id) initWithDriver:(OSXDriver2D) drv; <a name="l00052"></a>00052 <a name="l00054"></a>00054 - (void) dealloc; <a name="l00055"></a>00055 <a name="l00057"></a>00057 - (BOOL) openWindow:(const <span class="keywordtype">char</span> *) winTitle width:(<span class="keywordtype">int</span>) w height:(<span class="keywordtype">int</span>) h <a name="l00058"></a>00058 depth:(<span class="keywordtype">int</span>) d fullscreen:(BOOL) fs onDisplay:(CGDirectDisplayID) <a name="l00059"></a>00059 display onScreen:(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) screen; <a name="l00060"></a>00060 <a name="l00062"></a>00062 - (void) setTitle:(<span class="keywordtype">char</span> *) newTitle; <a name="l00063"></a>00063 <a name="l00065"></a>00065 - (BOOL) setMouseCursor:(<a class="code" href="group__gfx2d.html#g80b85f64d5f129faf7a2cd4c2825147e" title="Standard mouse cursor IDs.">csMouseCursorID</a>) cursor; <a name="l00066"></a>00066 <a name="l00068"></a>00068 - (void) startTrackingMouse; <a name="l00069"></a>00069 - (void) stopTrackingMouse; <a name="l00070"></a>00070 <a name="l00072"></a>00072 - (void) mouseEntered:(NSEvent *) ev; <a name="l00073"></a>00073 - (void) mouseExited:(NSEvent *) ev; <a name="l00074"></a>00074 <a name="l00076"></a>00076 - (void) closeWindow; <a name="l00077"></a>00077 <a name="l00079"></a>00079 - (void) focusChanged:(BOOL) focused shouldPause:(BOOL) pause; <a name="l00080"></a>00080 <a name="l00082"></a>00082 - (void) dispatchEvent:(NSEvent *) ev forView:(NSView *) view; <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="keyword">@end</span> <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="preprocessor">#else // __cplusplus</span> <a name="l00087"></a>00087 <span class="preprocessor"></span> <a name="l00088"></a>00088 <span class="preprocessor">#include <ApplicationServices/ApplicationServices.h></span> <a name="l00089"></a>00089 <a name="l00090"></a>00090 <span class="preprocessor">#define DEL2D_FUNC(ret, func) __private_extern__ "C" ret OSXDelegate2D_##func</span> <a name="l00091"></a>00091 <span class="preprocessor"></span> <a name="l00092"></a>00092 <span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>; <a name="l00093"></a>00093 <span class="keyword">typedef</span> <span class="keywordtype">void</span> *csGraphics2DHandle; <a name="l00094"></a>00094 <a name="l00095"></a>00095 <span class="comment">// C API to driver delegate class</span> <a name="l00096"></a>00096 DEL2D_FUNC(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>, <span class="keyword">new</span>)(csGraphics2DHandle drv); <a name="l00097"></a>00097 DEL2D_FUNC(<span class="keywordtype">void</span>, <span class="keyword">delete</span>)(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>); <a name="l00098"></a>00098 DEL2D_FUNC(<span class="keywordtype">bool</span>, openWindow)(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>,<span class="keyword">const</span> <span class="keywordtype">char</span> *title, <span class="keywordtype">int</span> w, <span class="keywordtype">int</span> h, <a name="l00099"></a>00099 <span class="keywordtype">int</span> d, <span class="keywordtype">bool</span> fs, CGDirectDisplayID display, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> screen); <a name="l00100"></a>00100 DEL2D_FUNC(<span class="keywordtype">void</span>, closeWindow)(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>); <a name="l00101"></a>00101 DEL2D_FUNC(<span class="keywordtype">void</span>, setTitle)(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>, <span class="keywordtype">char</span> *title); <a name="l00102"></a>00102 DEL2D_FUNC(<span class="keywordtype">bool</span>, setMouseCursor)(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>, <a class="code" href="group__gfx2d.html#g80b85f64d5f129faf7a2cd4c2825147e" title="Standard mouse cursor IDs.">csMouseCursorID</a>); <a name="l00103"></a>00103 DEL2D_FUNC(<span class="keywordtype">void</span>, focusChanged)(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>, <span class="keywordtype">bool</span> focused, <span class="keywordtype">bool</span> shouldPause); <a name="l00104"></a>00104 DEL2D_FUNC(<span class="keywordtype">void</span>, setLevel)(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>, <span class="keywordtype">int</span> level); <a name="l00105"></a>00105 DEL2D_FUNC(<span class="keywordtype">void</span>, setMousePosition)(<a class="code" href="interfaceOSXDelegate2D.html">OSXDelegate2D</a>, CGPoint point); <a name="l00106"></a>00106 <a name="l00107"></a>00107 <span class="preprocessor">#undef DEL2D_FUNC</span> <a name="l00108"></a>00108 <span class="preprocessor"></span> <a name="l00109"></a>00109 <span class="preprocessor">#endif // __cplusplus</span> <a name="l00110"></a>00110 <span class="preprocessor"></span> <a name="l00111"></a>00111 <span class="preprocessor">#endif // __CS_OSXDELEGATE2D_H__</span> </pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by <a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 </small></address> </div></body> </html>