<!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: iutil/eventh.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>iutil/eventh.h</h1><a href="eventh_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> Copyright (C) 2001 by Jorrit Tyberghein</span> <a name="l00003"></a>00003 <span class="comment"></span> <a name="l00004"></a>00004 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00005"></a>00005 <span class="comment"> modify it under the terms of the GNU Library General Public</span> <a name="l00006"></a>00006 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00007"></a>00007 <span class="comment"> version 2 of the License, or (at your option) any later version.</span> <a name="l00008"></a>00008 <span class="comment"> </span> <a name="l00009"></a>00009 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00010"></a>00010 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00011"></a>00011 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00012"></a>00012 <span class="comment"> Library General Public License for more details.</span> <a name="l00013"></a>00013 <span class="comment"> </span> <a name="l00014"></a>00014 <span class="comment"> You should have received a copy of the GNU Library General Public</span> <a name="l00015"></a>00015 <span class="comment"> License along with this library; if not, write to the Free</span> <a name="l00016"></a>00016 <span class="comment"> Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00017"></a>00017 <span class="comment">*/</span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="preprocessor">#ifndef __CS_IUTIL_EVENTH_H__</span> <a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __CS_IUTIL_EVENTH_H__</span> <a name="l00021"></a>00021 <span class="preprocessor"></span> <a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="scf__interface_8h.html" title="Crystal Space Shared Class Facility (SCF) - interface creation support.">csutil/scf_interface.h</a>"</span> <a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="iutil_2eventnames_8h.html" title="General event name resolver interface.">iutil/eventnames.h</a>"</span> <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="iutil_2eventhandlers_8h.html" title="General event handler naming, name management, indexing, and instantiation interface...">iutil/eventhandlers.h</a>"</span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="keyword">struct </span><a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a>; <a name="l00034"></a>00034 <a name="l00035"></a>00035 <a name="l00039"></a><a class="code" href="structiEventHandler.html">00039</a> <span class="keyword">struct </span><a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a> <a name="l00040"></a>00040 { <a name="l00041"></a>00041 SCF_INTERFACE(<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a>, 2,0,0); <a name="l00054"></a>00054 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiEventHandler.html#4b3885c2c5dc59fc4ecf32c089f0973a" title="This is the basic event handling function.">HandleEvent</a> (<a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a>&) = 0; <a name="l00055"></a>00055 <a name="l00080"></a>00080 <a class="code" href="cssysdef_8h.html#66bba4b4bdb4b6dadd37563abc499d48" title="Use the CS_CONST_METHOD macro in front of method declarations to indicate that they...">CS_CONST_METHOD</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="structiEventHandler.html#7880f6a777bc255ec58c42e4292e5071" title="This function returns a string which &quot;names&quot; this event handler generically...">GenericName</a>() <span class="keyword">const</span> = 0; <span class="comment">/* really is "static" */</span> <a name="l00081"></a>00081 <a name="l00093"></a>00093 <a class="code" href="cssysdef_8h.html#66bba4b4bdb4b6dadd37563abc499d48" title="Use the CS_CONST_METHOD macro in front of method declarations to indicate that they...">CS_CONST_METHOD</a> <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> <a class="code" href="structiEventHandler.html#5770ffedf51bb5b1d203ac2b1c1b9e40" title="This function returns a csHandlerID corresponding with GenericName, i.e., it should...">GenericID</a> ( <a name="l00094"></a>00094 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventHandlerRegistry></a> &) <span class="keyword">const</span> = 0; <a name="l00095"></a>00095 <span class="comment">// wish the above could be "virtual static"</span> <a name="l00096"></a>00096 <a name="l00108"></a>00108 <a class="code" href="cssysdef_8h.html#66bba4b4bdb4b6dadd37563abc499d48" title="Use the CS_CONST_METHOD macro in front of method declarations to indicate that they...">CS_CONST_METHOD</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> * <a class="code" href="structiEventHandler.html#553f18803da012da45ce762ef029ee21" title="This function takes a csEventID as an argument and returns an array of csHandlerIDs...">GenericPrec</a> ( <a name="l00109"></a>00109 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventHandlerRegistry></a> &, <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventNameRegistry></a> &, <a name="l00110"></a>00110 <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a>) <span class="keyword">const</span> = 0; <a name="l00111"></a>00111 <a name="l00123"></a>00123 <a class="code" href="cssysdef_8h.html#66bba4b4bdb4b6dadd37563abc499d48" title="Use the CS_CONST_METHOD macro in front of method declarations to indicate that they...">CS_CONST_METHOD</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> * <a class="code" href="structiEventHandler.html#c0e742aaaf86a619966bd30c0751e94d" title="This function takes a csEventID as an argument and returns an array of csHandlerIDs...">GenericSucc</a> ( <a name="l00124"></a>00124 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventHandlerRegistry></a> &, <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventNameRegistry></a> &, <a name="l00125"></a>00125 <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a>) <span class="keyword">const</span> = 0; <a name="l00126"></a>00126 <a name="l00139"></a>00139 <a class="code" href="cssysdef_8h.html#b3427ad7a206cd0ebf118b9d40084164" title="Use the CS_PURE_METHOD macro in front of method declarations to indicate that they...">CS_PURE_METHOD</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> * <a class="code" href="structiEventHandler.html#7e05b4d4abf9c9d90f6cd665fabd4f2c" title="This function takes a csEventID as an argument and returns an array of csHandlerIDs...">InstancePrec</a> ( <a name="l00140"></a>00140 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventHandlerRegistry></a> &, <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventNameRegistry></a> &, <a name="l00141"></a>00141 <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a>) <span class="keyword">const</span> = 0; <a name="l00142"></a>00142 <a name="l00155"></a>00155 <a class="code" href="cssysdef_8h.html#b3427ad7a206cd0ebf118b9d40084164" title="Use the CS_PURE_METHOD macro in front of method declarations to indicate that they...">CS_PURE_METHOD</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> * <a class="code" href="structiEventHandler.html#9df347d0041fcc47255ae27089da245b" title="This function takes a csEventID as an argument and returns an array of csHandlerIDs...">InstanceSucc</a> ( <a name="l00156"></a>00156 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventHandlerRegistry></a> &, <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventNameRegistry></a> &, <a name="l00157"></a>00157 <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a>) <span class="keyword">const</span> = 0; <a name="l00158"></a>00158 }; <a name="l00159"></a>00159 <a name="l00165"></a><a class="code" href="group__event__handling.html#g4f7b2a21cfb5997a2bb258920fafc61f">00165</a> <span class="preprocessor">#define CS_EVENTHANDLER_NAMES(x) \</span> <a name="l00166"></a>00166 <span class="preprocessor"> CS_CONST_METHOD static const char * StaticHandlerName() \</span> <a name="l00167"></a>00167 <span class="preprocessor"> { return (x); } \</span> <a name="l00168"></a>00168 <span class="preprocessor"> CS_CONST_METHOD static const csHandlerID StaticID(csRef<iEventHandlerRegistry> &reg) \</span> <a name="l00169"></a>00169 <span class="preprocessor"> {return reg->GetGenericID(StaticHandlerName()); } \</span> <a name="l00170"></a>00170 <span class="preprocessor"> CS_CONST_METHOD virtual const char * GenericName() const \</span> <a name="l00171"></a>00171 <span class="preprocessor"> { return StaticHandlerName(); } \</span> <a name="l00172"></a>00172 <span class="preprocessor"> CS_CONST_METHOD virtual csHandlerID GenericID(csRef<iEventHandlerRegistry> &reg) const \</span> <a name="l00173"></a>00173 <span class="preprocessor"> { return StaticID(reg); }</span> <a name="l00174"></a>00174 <span class="preprocessor"></span> <a name="l00178"></a><a class="code" href="group__event__handling.html#gfa413bca2b161c7d43cb38f46ec73a7b">00178</a> <span class="preprocessor">#define CS_EVENTHANDLER_NIL_CONSTRAINTS \</span> <a name="l00179"></a>00179 <span class="preprocessor"> CS_EVENTHANDLER_NIL_GENERIC_CONSTRAINTS \</span> <a name="l00180"></a>00180 <span class="preprocessor"> CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS </span> <a name="l00181"></a>00181 <span class="preprocessor"></span> <a name="l00185"></a><a class="code" href="group__event__handling.html#g8474b7e6ea936afa16000f4e74ac65d2">00185</a> <span class="preprocessor">#define CS_EVENTHANDLER_NIL_GENERIC_CONSTRAINTS \</span> <a name="l00186"></a>00186 <span class="preprocessor"> CS_CONST_METHOD virtual const csHandlerID * GenericPrec ( \</span> <a name="l00187"></a>00187 <span class="preprocessor"> csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &, \</span> <a name="l00188"></a>00188 <span class="preprocessor"> csEventID) const { return 0; } \</span> <a name="l00189"></a>00189 <span class="preprocessor"> CS_CONST_METHOD virtual const csHandlerID * GenericSucc ( \</span> <a name="l00190"></a>00190 <span class="preprocessor"> csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &, \</span> <a name="l00191"></a>00191 <span class="preprocessor"> csEventID) const { return 0; }</span> <a name="l00192"></a>00192 <span class="preprocessor"></span> <a name="l00196"></a><a class="code" href="group__event__handling.html#g3b8588d425823594019243398b3d4447">00196</a> <span class="preprocessor">#define CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS \</span> <a name="l00197"></a>00197 <span class="preprocessor"> CS_CONST_METHOD virtual const csHandlerID * InstancePrec ( \</span> <a name="l00198"></a>00198 <span class="preprocessor"> csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2, \</span> <a name="l00199"></a>00199 <span class="preprocessor"> csEventID e) const { return GenericPrec(r1, r2, e); } \</span> <a name="l00200"></a>00200 <span class="preprocessor"> CS_CONST_METHOD virtual const csHandlerID * InstanceSucc ( \</span> <a name="l00201"></a>00201 <span class="preprocessor"> csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2, \</span> <a name="l00202"></a>00202 <span class="preprocessor"> csEventID e) const { return GenericSucc(r1, r2, e); }</span> <a name="l00203"></a>00203 <span class="preprocessor"></span> <a name="l00206"></a>00206 <span class="preprocessor">#endif // __CS_IUTIL_EVENTH_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>