File: classCEGUI_1_1Event.html

package info (click to toggle)
cegui-mk2 0.7.6-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 105,384 kB
  • sloc: cpp: 142,729; ansic: 27,984; sh: 11,010; makefile: 2,275; python: 916; xml: 17
file content (265 lines) | stat: -rw-r--r-- 20,519 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Crazy Eddies GUI System: CEGUI::Event Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Crazy Eddies GUI System&#160;<span id="projectnumber">0.7.6</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceCEGUI.html">CEGUI</a>      </li>
      <li class="navelem"><a class="el" href="classCEGUI_1_1Event.html">Event</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">CEGUI::Event Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="CEGUI::Event" -->
<p>Defines an 'event' which can be subscribed to by interested parties.  
 <a href="classCEGUI_1_1Event.html#details">More...</a></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png"/> Collaboration diagram for CEGUI::Event:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classCEGUI_1_1Event__coll__graph.gif" border="0" usemap="#CEGUI_1_1Event_coll__map" alt="Collaboration graph"/></div>
<map name="CEGUI_1_1Event_coll__map" id="CEGUI_1_1Event_coll__map">
<area shape="rect" id="node2" href="classCEGUI_1_1String.html" title="String class used within the GUI system." alt="" coords="5,5,112,35"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classCEGUI_1_1Event-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event_1_1ScopedConnection.html">ScopedConnection</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classCEGUI_1_1Event.html#a67bc40ba6d8f7fec9c2dff68a6c8cb09" title="Connection object. This is a thin &#39;smart pointer&#39; wrapper around the actual BoundSlot that represents...">Event::Connection</a> wrapper that automatically disconnects the connection when the object is deleted (or goes out of scope).  <a href="classCEGUI_1_1Event_1_1ScopedConnection.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a67bc40ba6d8f7fec9c2dff68a6c8cb09"></a><!-- doxytag: member="CEGUI::Event::Connection" ref="a67bc40ba6d8f7fec9c2dff68a6c8cb09" args="" -->
typedef <a class="el" href="classCEGUI_1_1RefCounted.html">RefCounted</a>&lt; <a class="el" href="classCEGUI_1_1BoundSlot.html">BoundSlot</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#a67bc40ba6d8f7fec9c2dff68a6c8cb09">Connection</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Connection object. This is a thin 'smart pointer' wrapper around the actual <a class="el" href="classCEGUI_1_1BoundSlot.html" title="Class that tracks a SubscriberSlot, its group, and the Event to which it was subscribed. This is effectively what gets returned from the calls to the Event::subscribe members, though BoundSlot is always wrapped in a reference counted pointer. When a BoundSlot is deleted, the connection is unsubscribed and the SubscriberSlot is deleted.">BoundSlot</a> that represents the connection. You can use this object to inspect the current connection state and also to disconnect from the event. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0ef19f1fda5ea2eb9dac93d7f6bb6537"></a><!-- doxytag: member="CEGUI::Event::Subscriber" ref="a0ef19f1fda5ea2eb9dac93d7f6bb6537" args="" -->
typedef <a class="el" href="classCEGUI_1_1SubscriberSlot.html">CEGUI::SubscriberSlot</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#a0ef19f1fda5ea2eb9dac93d7f6bb6537">Subscriber</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Subscriber object type. This is now just a typedef to <a class="el" href="classCEGUI_1_1SubscriberSlot.html" title="SubscriberSlot class which is used when subscribing to events.">SubscriberSlot</a>, the use of the name <a class="el" href="classCEGUI_1_1Event.html#a0ef19f1fda5ea2eb9dac93d7f6bb6537" title="Subscriber object type. This is now just a typedef to SubscriberSlot, the use of the name Event::Subs...">Event::Subscriber</a> is maintained for hostorical and compatability reasons. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae8d893b984caa6aead199b2c0d60fd9f"></a><!-- doxytag: member="CEGUI::Event::Group" ref="ae8d893b984caa6aead199b2c0d60fd9f" args="" -->
typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#ae8d893b984caa6aead199b2c0d60fd9f">Group</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Type for a subscriber group. You can use the subscriber group to order calls to multiple subscribers. Groups are called in ascending order, with subscribers with no group called last. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab468e754c555242af622f255001918d8"></a><!-- doxytag: member="CEGUI::Event::Event" ref="ab468e754c555242af622f255001918d8" args="(const String &amp;name)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#ab468e754c555242af622f255001918d8">Event</a> (const <a class="el" href="classCEGUI_1_1String.html">String</a> &amp;name)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a> object with the specified name. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="addd8e11bb0054b3ce716e3ea135eb6b2"></a><!-- doxytag: member="CEGUI::Event::~Event" ref="addd8e11bb0054b3ce716e3ea135eb6b2" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#addd8e11bb0054b3ce716e3ea135eb6b2">~Event</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor for <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a> objects. Note that this is non-virtual and so you should not sub-class <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classCEGUI_1_1String.html">String</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#a43f764d3c36ed8cb38151a9f1ceabd99">getName</a> (void) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the name given to this <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a> object when it was created.  <a href="#a43f764d3c36ed8cb38151a9f1ceabd99"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCEGUI_1_1RefCounted.html">Connection</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#abeac1e02b2d10a8359ea91cec3103b2e">subscribe</a> (const <a class="el" href="classCEGUI_1_1SubscriberSlot.html">Subscriber</a> &amp;slot)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Subscribes some function or object to the <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a>.  <a href="#abeac1e02b2d10a8359ea91cec3103b2e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCEGUI_1_1RefCounted.html">Connection</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#aaed365eef74cd60c5df8829e52f6404a">subscribe</a> (<a class="el" href="classCEGUI_1_1Event.html#ae8d893b984caa6aead199b2c0d60fd9f">Group</a> group, const <a class="el" href="classCEGUI_1_1SubscriberSlot.html">Subscriber</a> &amp;slot)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Subscribes some function or object to the <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a>.  <a href="#aaed365eef74cd60c5df8829e52f6404a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCEGUI_1_1Event.html#a252ffbf26141037e530b129f82937c18">operator()</a> (<a class="el" href="classCEGUI_1_1EventArgs.html">EventArgs</a> &amp;args)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fires the event. All event subscribers get called in the appropriate sequence.  <a href="#a252ffbf26141037e530b129f82937c18"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae1ccf076922f55a62f97a5cbe26ea725"></a><!-- doxytag: member="CEGUI::Event::CEGUI::BoundSlot::disconnect" ref="ae1ccf076922f55a62f97a5cbe26ea725" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>CEGUI::BoundSlot::disconnect</b> ()</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Defines an 'event' which can be subscribed to by interested parties. </p>
<p>An <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a> can be subscribed by a function, a member function, or a function object. Whichever option is taken, the function signature needs to be as follows: </p>
<dl class="user"><dt><b></b></dt><dd><em>bool function_name(const EventArgs&amp; args);</em> </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>An <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a> object may not be copied. </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a43f764d3c36ed8cb38151a9f1ceabd99"></a><!-- doxytag: member="CEGUI::Event::getName" ref="a43f764d3c36ed8cb38151a9f1ceabd99" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classCEGUI_1_1String.html">String</a>&amp; CEGUI::Event::getName </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the name given to this <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a> object when it was created. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="classCEGUI_1_1String.html" title="String class used within the GUI system.">String</a> object containing the name of the <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a> object. </dd></dl>

</div>
</div>
<a class="anchor" id="a252ffbf26141037e530b129f82937c18"></a><!-- doxytag: member="CEGUI::Event::operator()" ref="a252ffbf26141037e530b129f82937c18" args="(EventArgs &amp;args)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CEGUI::Event::operator() </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCEGUI_1_1EventArgs.html">EventArgs</a> &amp;&#160;</td>
          <td class="paramname"><em>args</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Fires the event. All event subscribers get called in the appropriate sequence. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">args</td><td>An object derived from <a class="el" href="classCEGUI_1_1EventArgs.html" title="Base class used as the argument to all subscribers Event object.">EventArgs</a> to be passed to each event subscriber. The 'handled' field will be set to true if any of the called subscribers return that they handled the event.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Nothing. </dd></dl>

</div>
</div>
<a class="anchor" id="aaed365eef74cd60c5df8829e52f6404a"></a><!-- doxytag: member="CEGUI::Event::subscribe" ref="aaed365eef74cd60c5df8829e52f6404a" args="(Group group, const Subscriber &amp;slot)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCEGUI_1_1RefCounted.html">Connection</a> CEGUI::Event::subscribe </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCEGUI_1_1Event.html#ae8d893b984caa6aead199b2c0d60fd9f">Group</a>&#160;</td>
          <td class="paramname"><em>group</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classCEGUI_1_1SubscriberSlot.html">Subscriber</a> &amp;&#160;</td>
          <td class="paramname"><em>slot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Subscribes some function or object to the <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">group</td><td>The <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a> group to subscribe to, subscription groups are called in ascending order, followed by subscriptions with no group. Note that calling order of connections to the same group is unspecified.</td></tr>
    <tr><td class="paramname">subscriber</td><td>A function, static member function, or function object, with the signature void function_name(const EventArgs&amp; args). To subscribe a member function you should explicitly create an <a class="el" href="classCEGUI_1_1Event.html#a0ef19f1fda5ea2eb9dac93d7f6bb6537" title="Subscriber object type. This is now just a typedef to SubscriberSlot, the use of the name Event::Subs...">Event::Subscriber</a> as this parameter.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A Connection object which can be used to disconnect (unsubscribe) from the <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a>, and also to check the connection state. </dd></dl>

</div>
</div>
<a class="anchor" id="abeac1e02b2d10a8359ea91cec3103b2e"></a><!-- doxytag: member="CEGUI::Event::subscribe" ref="abeac1e02b2d10a8359ea91cec3103b2e" args="(const Subscriber &amp;slot)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCEGUI_1_1RefCounted.html">Connection</a> CEGUI::Event::subscribe </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classCEGUI_1_1SubscriberSlot.html">Subscriber</a> &amp;&#160;</td>
          <td class="paramname"><em>slot</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Subscribes some function or object to the <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">subscriber</td><td>A function, static member function, or function object, with the signature void function_name(const EventArgs&amp; args). To subscribe a member function you should explicitly create an <a class="el" href="classCEGUI_1_1Event.html#a0ef19f1fda5ea2eb9dac93d7f6bb6537" title="Subscriber object type. This is now just a typedef to SubscriberSlot, the use of the name Event::Subs...">Event::Subscriber</a> as this parameter.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A Connection object which can be used to disconnect (unsubscribe) from the <a class="el" href="classCEGUI_1_1Event.html" title="Defines an &#39;event&#39; which can be subscribed to by interested parties.">Event</a>, and also to check the connection state. </dd></dl>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Sun Jan 22 2012 16:07:40 for Crazy Eddies GUI System by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>