source: OGRE/trunk/ogrenew/Docs/api/html/OgreMouseEvent_8h-source.html @ 657

Revision 657, 15.1 KB checked in by mattausch, 18 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1<html>
2<head>
3<title>OgreMouseEvent.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
4<link type="text/css" rel="stylesheet" href="style.css">
5</head>
6
7<body>
8<!-- Generated by Doxygen 1.3.6 -->
9<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
10<h1>OgreMouseEvent.h</h1><a href="OgreMouseEvent_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
1100002 <span class="comment">-----------------------------------------------------------------------------</span>
1200003 <span class="comment">This source file is part of OGRE</span>
1300004 <span class="comment">    (Object-oriented Graphics Rendering Engine)</span>
1400005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span>
1500006 <span class="comment"></span>
1600007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span>
1700008 <span class="comment">Also see acknowledgements in Readme.html</span>
1800009 <span class="comment"></span>
1900010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span>
2000011 <span class="comment">the terms of the GNU Lesser General  License as published by the Free Software</span>
2100012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span>
2200013 <span class="comment">version.</span>
2300014 <span class="comment"></span>
2400015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span>
2500016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
2600017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General  License for more details.</span>
2700018 <span class="comment"></span>
2800019 <span class="comment">You should have received a copy of the GNU Lesser General  License along with</span>
2900020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span>
3000021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span>
3100022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span>
3200023 <span class="comment">-----------------------------------------------------------------------------</span>
3300024 <span class="comment">*/</span>
3400025 <span class="comment">/***************************************************************************</span>
3500026 <span class="comment">OgreMouseEvent.h  -  </span>
3600027 <span class="comment"> * An event which indicates that a mouse action occurred in a MouseTarget (e.g. MouseTarget).</span>
3700028 <span class="comment"> * This event is used both for mouse events (click, enter, exit) and mouse </span>
3800029 <span class="comment"> * motion events (moves and drags). </span>
3900030 <span class="comment"> * &lt;P&gt;</span>
4000031 <span class="comment"> * This low-level event is generated by a MouseTarget object for:</span>
4100032 <span class="comment"> * &lt;ul&gt;</span>
4200033 <span class="comment"> * &lt;li&gt;Mouse Events</span>
4300034 <span class="comment"> *     &lt;ul&gt;</span>
4400035 <span class="comment"> *     &lt;li&gt;a mouse button is pressed</span>
4500036 <span class="comment"> *     &lt;li&gt;a mouse button is released</span>
4600037 <span class="comment"> *     &lt;li&gt;a mouse button is clicked (pressed and released)</span>
4700038 <span class="comment"> *     &lt;li&gt;the mouse cursor enters a MouseTarget</span>
4800039 <span class="comment"> *     &lt;li&gt;the mouse cursor exits a MouseTarget</span>
4900040 <span class="comment"> *     &lt;/ul&gt;</span>
5000041 <span class="comment"> * &lt;li&gt; Mouse Motion Events</span>
5100042 <span class="comment"> *     &lt;ul&gt;</span>
5200043 <span class="comment"> *     &lt;li&gt;the mouse is moved</span>
5300044 <span class="comment"> *     &lt;li&gt;the mouse is dragged</span>
5400045 <span class="comment"> *     &lt;/ul&gt;</span>
5500046 <span class="comment"> * &lt;/ul&gt;</span>
5600047 <span class="comment"> * &lt;P&gt;</span>
5700048 <span class="comment"> * A MouseEvent object is passed to every MouseListener</span>
5800049 <span class="comment"> * object which registered to receive </span>
5900050 <span class="comment"> * the "interesting" mouse events using MouseTarget's </span>
6000051 <span class="comment"> * &lt;code&gt;addMouseListener&lt;/code&gt; method.</span>
6100052 <span class="comment"> *</span>
6200053 <span class="comment"> * A MouseEvent object is also passed to every MouseMotionListener</span>
6300054 <span class="comment"> * object which registered to receive </span>
6400055 <span class="comment"> * mouse motion events using the MouseTarget's addMouseMotionListener</span>
6500056 <span class="comment"> * method</span>
6600057 <span class="comment"> *</span>
6700058 <span class="comment"> * When a mouse button is clicked, events are generated and sent to the</span>
6800059 <span class="comment"> * registered MouseListeners, with the button mask set in the modifier field.</span>
6900060 <span class="comment"> * For example, if the first mouse button is pressed, events are sent in the</span>
7000061 <span class="comment"> * following order:</span>
7100062 <span class="comment"> * &lt;PRE&gt;</span>
7200063 <span class="comment"> *    MOUSE_PRESSED:  BUTTON1_MASK</span>
7300064 <span class="comment"> *    MOUSE_RELEASED: BUTTON1_MASK</span>
7400065 <span class="comment"> *    MOUSE_CLICKED:  BUTTON1_MASK</span>
7500066 <span class="comment"> * &lt;/PRE&gt;</span>
7600067 <span class="comment"> * When multiple mouse buttons are pressed, each press, release, and click</span>
7700068 <span class="comment"> * results in a separate event. The button mask in the modifier field reflects</span>
7800069 <span class="comment"> * only the button that changed state, not the current state of all buttons.</span>
7900070 <span class="comment"> * &lt;P&gt; </span>
8000071 <span class="comment"> * For example, if the user presses button 1 followed by button 2 and</span>
8100072 <span class="comment"> * releases them in the same order, the following sequence of events is</span>
8200073 <span class="comment"> * generated:</span>
8300074 <span class="comment"> * &lt;PRE&gt;</span>
8400075 <span class="comment"> *    MOUSE_PRESSED:  BUTTON1_MASK</span>
8500076 <span class="comment"> *    MOUSE_PRESSED:  BUTTON2_MASK</span>
8600077 <span class="comment"> *    MOUSE_RELEASED: BUTTON1_MASK</span>
8700078 <span class="comment"> *    MOUSE_CLICKED:  BUTTON1_MASK</span>
8800079 <span class="comment"> *    MOUSE_RELEASED: BUTTON2_MASK</span>
8900080 <span class="comment"> *    MOUSE_CLICKED:  BUTTON2_MASK</span>
9000081 <span class="comment"> * &lt;/PRE&gt;</span>
9100082 <span class="comment"> * If button2 is released first, the MOUSE_RELEASED/MOUSE_CLICKED pair</span>
9200083 <span class="comment"> * for BUTTON2_MASK arrives first, followed by the pair for BUTTON1_MASK.</span>
9300084 <span class="comment"> *</span>
9400085 <span class="comment">-------------------</span>
9500086 <span class="comment">begin                : Dec 03 2002</span>
9600087 <span class="comment">copyright            : (C) 2002 by Kenny Sabir</span>
9700088 <span class="comment">email                : kenny@sparksuit.com</span>
9800089 <span class="comment">***************************************************************************/</span>
9900090 <span class="preprocessor">#ifndef __MouseEvent_H__</span>
10000091 <span class="preprocessor"></span><span class="preprocessor">#define __MouseEvent_H__</span>
10100092 <span class="preprocessor"></span>
10200093 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span>
10300094 <span class="preprocessor">#include "<a class="code" href="OgreInputEvent_8h.html">OgreInputEvent.h</a>"</span>
10400095
10500096 <span class="keyword">namespace </span>Ogre {
10600097
107<a name="l00158"></a><a class="code" href="classOgre_1_1MouseEvent.html">00158</a>     <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> MouseEvent : <span class="keyword">public</span> <a class="code" href="classOgre_1_1InputEvent.html">InputEvent</a>
10800159     {
10900160     <span class="keyword">protected</span>:
110<a name="l00166"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp0">00166</a>         <a class="code" href="namespaceOgre.html#a420">Real</a> mX;
111<a name="l00172"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp1">00172</a>         <a class="code" href="namespaceOgre.html#a420">Real</a> mY;
11200173
113<a name="l00179"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp2">00179</a>         <a class="code" href="namespaceOgre.html#a420">Real</a> mZ;
11400180
11500181
116<a name="l00182"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp3">00182</a>         <a class="code" href="namespaceOgre.html#a420">Real</a> mRelX;
117<a name="l00183"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp4">00183</a>         <a class="code" href="namespaceOgre.html#a420">Real</a> mRelY;
118<a name="l00184"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp5">00184</a>         <a class="code" href="namespaceOgre.html#a420">Real</a> mRelZ;
11900185
120<a name="l00190"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp6">00190</a>         <span class="keywordtype">int</span> mButtonID;
121<a name="l00194"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp7">00194</a>         <span class="keywordtype">int</span> mClickCount;
12200195
12300196
12400197
12500198
12600199     <span class="keyword">public</span>:
12700200
12800201         <span class="keyword">enum</span>
12900202         {
13000203             ME_FIRST_EVENT = 500,
13100204             ME_LAST_EVENT = 510
13200205         };
13300206
13400207         <span class="keyword">enum</span>
13500208         {
13600209             ME_MOUSE_CLICKED    = ME_FIRST_EVENT,
13700210             ME_MOUSE_PRESSED,
13800211             ME_MOUSE_RELEASED,
13900212             ME_MOUSE_MOVED,
14000213             ME_MOUSE_ENTERED,
14100214             ME_MOUSE_EXITED,
14200215             ME_MOUSE_DRAGGED,
14300216
14400217       ME_MOUSE_DRAGENTERED,
14500218       ME_MOUSE_DRAGEXITED,
14600219       ME_MOUSE_DRAGMOVED,
14700220       ME_MOUSE_DRAGDROPPED
14800221         };
14900222
15000236         MouseEvent(PositionTarget* source, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> whichButton, <a class="code" href="namespaceOgre.html#a420">Real</a> when, <span class="keywordtype">int</span> modifiers,
15100237             <a class="code" href="namespaceOgre.html#a420">Real</a> x, <a class="code" href="namespaceOgre.html#a420">Real</a> y, <a class="code" href="namespaceOgre.html#a420">Real</a> z, <span class="keywordtype">int</span> clickCount);
15200238
15300239         MouseEvent(PositionTarget* source, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> whichButton, <a class="code" href="namespaceOgre.html#a420">Real</a> when, <span class="keywordtype">int</span> modifiers,
15400240             <a class="code" href="namespaceOgre.html#a420">Real</a> x, <a class="code" href="namespaceOgre.html#a420">Real</a> y, <a class="code" href="namespaceOgre.html#a420">Real</a> z, <a class="code" href="namespaceOgre.html#a420">Real</a> relx, <a class="code" href="namespaceOgre.html#a420">Real</a> rely, <a class="code" href="namespaceOgre.html#a420">Real</a> relz, <span class="keywordtype">int</span> clickCount);
15500241         
15600247          <span class="keywordtype">int</span> getClickCount();
15700248
15800256          <a class="code" href="namespaceOgre.html#a420">Real</a> getX() <span class="keyword">const</span>;
15900257
16000265          <a class="code" href="namespaceOgre.html#a420">Real</a> getY() <span class="keyword">const</span>;
16100266
16200274          <a class="code" href="namespaceOgre.html#a420">Real</a> getZ() <span class="keyword">const</span>;
16300275
164<a name="l00277"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventa6">00277</a>          <a class="code" href="namespaceOgre.html#a420">Real</a> getRelX()<span class="keyword"> const </span>{<span class="keywordflow">return</span> mRelX;}
16500278         
166<a name="l00280"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventa7">00280</a>          <a class="code" href="namespaceOgre.html#a420">Real</a> getRelY()<span class="keyword"> const </span>{<span class="keywordflow">return</span> mRelY;}
16700281         
168<a name="l00283"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventa8">00283</a>          <a class="code" href="namespaceOgre.html#a420">Real</a> getRelZ()<span class="keyword"> const </span>{<span class="keywordflow">return</span> mRelZ;}
16900284
17000291          <a class="code" href="namespaceOgre.html#a426">String</a> paramString() <span class="keyword">const</span>;
17100292
17200300          <span class="keywordtype">void</span> translatePoint(<a class="code" href="namespaceOgre.html#a420">Real</a> x, <a class="code" href="namespaceOgre.html#a420">Real</a> y);
17300301
17400303          <span class="keywordtype">int</span> getButtonID() <span class="keyword">const</span>;
17500304     };
17600305
17700306
17800307 }
17900308
18000309
18100310 <span class="preprocessor">#endif </span>
18200311 <span class="preprocessor"></span>
183</pre></div><hr>
184<p>
185Copyright &copy; 2000-2005 by The OGRE Team<br />
186<!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/>
187This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/>
188                <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
189                <Work rdf:about="">
190                        <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" />
191        <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
192                </Work>
193                <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> -->
194
195Last modified Sun Feb 12 12:59:48 2006
196</p>
197</body>
198</html>
Note: See TracBrowser for help on using the repository browser.