| {{+bindTo:partials.standard_nacl_api}} |
| <h1>pp::MouseLock Class Reference</h1> |
| <div id="doxygen-ref"> |
| {{- dummy div to appease doxygen -}} |
| <div> |
| <!-- Generated by Doxygen 1.7.6.1 --> |
| |
| |
| |
| </div> |
| <!--header--> |
| <div class="contents"> |
| <!-- doxytag: class="pp::MouseLock" --> |
| <p><a href="classpp_1_1_mouse_lock-members.html">List of all members.</a></p> |
| <h2> |
| Public Member Functions</h2><table class="memberdecls"> |
| |
| <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_mouse_lock.html#a2c304f04bbcca852cfff575595de291f">MouseLock</a> (<a class="el" href="classpp_1_1_instance.html">Instance</a> *instance)</td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_mouse_lock.html#a2ac121eb177f22d69c46066d979e06a8">~MouseLock</a> ()</td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_mouse_lock.html#a325767b75e132ae0c1ca7d4776f5d05c">MouseLockLost</a> ()=0</td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_mouse_lock.html#ad17ce49daa092ec8ec6ca56aebf5b2cc">LockMouse</a> (const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &cc)</td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_mouse_lock.html#ad896ad4a23395cc6735930437bfb92e6">UnlockMouse</a> ()</td></tr> |
| </table> |
| <hr /><a name="details" id="details"></a><h2>Detailed Description</h2> |
| <div class="textblock"><p>This class allows you to associate the <code>PPP_MouseLock</code> and <code>PPB_MouseLock</code> C-based interfaces with an object. </p> |
| <p>It associates itself with the given instance, and registers as the global handler for handling the <code>PPP_MouseLock</code> interface that the browser calls.</p> |
| <p>You would typically use this class by inheritance on your instance or by composition.</p> |
| <p><b>Example (inheritance):</b> </p> |
| <div class="fragment"><pre class="fragment"> <span class="keyword">class </span>MyInstance : <span class="keyword">public</span> pp::Instance, <span class="keyword">public</span> pp::<a class="code" href="classpp_1_1_mouse_lock.html#a2c304f04bbcca852cfff575595de291f" title="A constructor for creating a MouseLock.">MouseLock</a> { |
| <span class="keyword">class </span>MyInstance() : pp::<a class="code" href="classpp_1_1_mouse_lock.html#a2c304f04bbcca852cfff575595de291f" title="A constructor for creating a MouseLock.">MouseLock</a>(this) { |
| } |
| ... |
| }; |
| </pre></div><p><b>Example (composition):</b> </p> |
| <div class="fragment"><pre class="fragment"> <span class="keyword">class </span>MyMouseLock : <span class="keyword">public</span> pp::<a class="code" href="classpp_1_1_mouse_lock.html#a2c304f04bbcca852cfff575595de291f" title="A constructor for creating a MouseLock.">MouseLock</a> { |
| ... |
| }; |
| |
| <span class="keyword">class </span>MyInstance : <span class="keyword">public</span> pp::Instance { |
| MyInstance() : mouse_lock_(this) { |
| } |
| |
| MyMouseLock mouse_lock_; |
| }; |
| </pre></div> </div><hr /><h2>Constructor & Destructor Documentation</h2> |
| <a class="anchor" id="a2c304f04bbcca852cfff575595de291f"></a><!-- doxytag: member="pp::MouseLock::MouseLock" ref="a2c304f04bbcca852cfff575595de291f" args="(Instance *instance)" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname"><a class="el" href="classpp_1_1_mouse_lock.html#a2c304f04bbcca852cfff575595de291f">pp::MouseLock::MouseLock</a> </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classpp_1_1_instance.html">Instance</a> * </td> |
| <td class="paramname"><em>instance</em></td><td>)</td> |
| <td><code> [explicit]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| <p>A constructor for creating a <code><a class="el" href="classpp_1_1_mouse_lock.html" title="This class allows you to associate the PPP_MouseLock and PPB_MouseLock C-based interfaces with an obj...">MouseLock</a></code>. </p> |
| <dl class="params"><dt><b>Parameters:</b></dt><dd> |
| <table class="params"> |
| <tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The instance with which this resource will be associated. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| </div> |
| </div> |
| <a class="anchor" id="a2ac121eb177f22d69c46066d979e06a8"></a><!-- doxytag: member="pp::MouseLock::~MouseLock" ref="a2ac121eb177f22d69c46066d979e06a8" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual <a class="el" href="classpp_1_1_mouse_lock.html#a2ac121eb177f22d69c46066d979e06a8">pp::MouseLock::~MouseLock</a> </td> |
| <td>(</td> |
| <td class="paramname"></td><td>)</td> |
| <td><code> [virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| <p>Destructor. </p> |
| </div> |
| </div> |
| <hr /><h2>Member Function Documentation</h2> |
| <a class="anchor" id="ad17ce49daa092ec8ec6ca56aebf5b2cc"></a><!-- doxytag: member="pp::MouseLock::LockMouse" ref="ad17ce49daa092ec8ec6ca56aebf5b2cc" args="(const CompletionCallback &cc)" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int32_t <a class="el" href="classpp_1_1_mouse_lock.html#ad17ce49daa092ec8ec6ca56aebf5b2cc">pp::MouseLock::LockMouse</a> </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> & </td> |
| <td class="paramname"><em>cc</em></td><td>)</td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| <p><a class="el" href="classpp_1_1_mouse_lock.html#ad17ce49daa092ec8ec6ca56aebf5b2cc" title="LockMouse() requests the mouse to be locked.">LockMouse()</a> requests the mouse to be locked. </p> |
| <p>While the mouse is locked, the cursor is implicitly hidden from the user. Any movement of the mouse will generate a <code>PP_INPUTEVENT_TYPE_MOUSEMOVE</code> event. The <code>GetPosition()</code> function in <code>InputEvent()</code> reports the last known mouse position just as mouse lock was entered. The <code>GetMovement()</code> function provides relative movement information indicating what the change in position of the mouse would be had it not been locked.</p> |
| <p>The browser may revoke the mouse lock for reasons including (but not limited to) the user pressing the ESC key, the user activating another program using a reserved keystroke (e.g. ALT+TAB), or some other system event.</p> |
| <dl class="params"><dt><b>Parameters:</b></dt><dd> |
| <table class="params"> |
| <tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called upon completion.</td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl> |
| </div> |
| </div> |
| <a class="anchor" id="a325767b75e132ae0c1ca7d4776f5d05c"></a><!-- doxytag: member="pp::MouseLock::MouseLockLost" ref="a325767b75e132ae0c1ca7d4776f5d05c" args="()=0" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual void <a class="el" href="classpp_1_1_mouse_lock.html#a325767b75e132ae0c1ca7d4776f5d05c">pp::MouseLock::MouseLockLost</a> </td> |
| <td>(</td> |
| <td class="paramname"></td><td>)</td> |
| <td><code> [pure virtual]</code></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| <p>PPP_MouseLock functions exposed as virtual functions for you to override. </p> |
| </div> |
| </div> |
| <a class="anchor" id="ad896ad4a23395cc6735930437bfb92e6"></a><!-- doxytag: member="pp::MouseLock::UnlockMouse" ref="ad896ad4a23395cc6735930437bfb92e6" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">void <a class="el" href="classpp_1_1_mouse_lock.html#ad896ad4a23395cc6735930437bfb92e6">pp::MouseLock::UnlockMouse</a> </td> |
| <td>(</td> |
| <td class="paramname"></td><td>)</td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| <p>UnlockMouse causes the mouse to be unlocked, allowing it to track user movement again. </p> |
| <p>This is an asynchronous operation. The module instance will be notified using the <code>PPP_MouseLock</code> interface when it has lost the mouse lock. </p> |
| </div> |
| </div> |
| <hr />The documentation for this class was generated from the following file:<ul> |
| <li><a class="el" href="mouse__lock_8h.html">mouse_lock.h</a></li> |
| </ul> |
| </div><!-- contents --> |
| </div> |
| {{/partials.standard_nacl_api}} |