Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 18b54cd0250a7489168a038c67771391 > files > 93

evas-devel-1.0.1-1.fc16.i686.rpm

<html>
<head>
    <title>Evas: Pointer (Mouse) Functions</title>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <meta name="author" content="Andres Blanc" >
    
    <link rel="icon" href="img/favicon.png" type="image/x-icon">
    <link rel="shortcut icon" href="img/favicon.png" type="image/x-icon">
    <link rel="icon" href="img/favicon.png" type="image/ico">
    <link rel="shortcut icon" href="img/favicon.png" type="image/ico">

    <link rel="stylesheet" type="text/css" media="screen" href="e.css">
    <link rel="stylesheet" type="text/css" media="screen" href="edoxy.css">
</head>

<body>

<div id="container">

<div id="header">
<div class="layout">
    
    <h1><span>Enlightenment</span></h1>
    <h2><span>Beauty at your fingertips</span></h2>

    <div class="menu-container">
        <div class="menu">
            <ul>
	        <li class="current"><a href="http://web.enlightenment.org/p.php?p=docs">Docs</a></li>
                <li><a href="http://trac.enlightenment.org/e">Tracker</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=contact">Contact</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=support">Support</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=download">Download</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=about">About</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=news">News</a></li>
                <li><a href="http://www.enlightenment.org/">Home</a></li>
            </ul>
        </div>
    </div>

    <div class="doxytitle">
        Evas Documentation <small>at Thu Jul 14 2011</small>
    </div>

    <div class="menu-container">
        <div class="submenu">
            <ul class="current">
                <li><a href="todo.html">Todo</a></li>
                <li><a href="files.html">Files</a></li>
                <li><a href="annotated.html">Data Structures</a></li>
                <li><a href="globals.html">Globals</a></li>
                <li><a href="modules.html">Modules</a></li>
                <li><a href="pages.html">Related Pages</a></li>
	        <li class="current"><a href="index.html">Main Page</a></li>
            </ul>
        </div>
    </div>


    <div class="clear"></div>
</div>
</div>

<div id="content">
<div class="layout">
<!-- Generated by Doxygen 1.7.4 -->
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Pointer (Mouse) Functions</div>  </div>
<div class="ingroups"><a class="el" href="group__Evas__Canvas.html">Canvas Functions</a></div></div>
<div class="contents">

<p>Functions that deal with the status of the pointer (mouse cursor).  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Evas__Pointer__Group.html#gad8e78aded475fe26ea14b7410f510a98">evas_pointer_output_xy_get</a> (const <a class="el" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043">Evas</a> *e, int *x, int *y)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the current known pointer co-ordinates.  <a href="#gad8e78aded475fe26ea14b7410f510a98"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Evas__Pointer__Group.html#ga2f7bf87c9b1268e68c85d4bb8b9e4b15">evas_pointer_canvas_xy_get</a> (const <a class="el" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043">Evas</a> *e, Evas_Coord *x, Evas_Coord *y)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the current known pointer co-ordinates.  <a href="#ga2f7bf87c9b1268e68c85d4bb8b9e4b15"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Evas__Pointer__Group.html#gaae658f627d7f31b051345e45377c3580">evas_pointer_button_down_mask_get</a> (const <a class="el" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043">Evas</a> *e)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a bitmask with the mouse buttons currently pressed, set to 1.  <a href="#gaae658f627d7f31b051345e45377c3580"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI Eina_Bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Evas__Pointer__Group.html#ga39a1840fd43442c20f321437bd5f427a">evas_pointer_inside_get</a> (const <a class="el" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043">Evas</a> *e)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the mouse pointer is logically inside the canvas.  <a href="#ga39a1840fd43442c20f321437bd5f427a"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Functions that deal with the status of the pointer (mouse cursor). </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaae658f627d7f31b051345e45377c3580"></a><!-- doxytag: member="evas_main.c::evas_pointer_button_down_mask_get" ref="gaae658f627d7f31b051345e45377c3580" args="(const Evas *e)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI int evas_pointer_button_down_mask_get </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043">Evas</a> *&#160;</td>
          <td class="paramname"><em>e</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a bitmask with the mouse buttons currently pressed, set to 1. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">e</td><td>The pointer to the Evas Canvas </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A bitmask of the currently depressed buttons on the cavas</dd></dl>
<p>Calling this function will return a 32-bit integer with the appropriate bits set to 1 that correspond to a mouse button being depressed. This limits Evas to a mouse devices with a maximum of 32 buttons, but that is generally in excess of any host system's pointing device abilities.</p>
<p>A canvas by default begins with no mouse buttons being pressed and only calls to <a class="el" href="group__Evas__Event__Feeding__Group.html#ga5c9811b87406a96ff573b83d1efd52f2" title="Mouse down event feed.">evas_event_feed_mouse_down()</a>, evas_event_feed_mouse_down_data(), <a class="el" href="group__Evas__Event__Feeding__Group.html#gacb400569d04ecfd2b89eb0f39856581c" title="Mouse up event feed.">evas_event_feed_mouse_up()</a> and evas_event_feed_mouse_up_data() will alter that.</p>
<p>The least significant bit corresponds to the first mouse button (button 1) and the most significant bit corresponds to the last mouse button (button 32).</p>
<p>If <code>e</code> is not a valid canvas, the return value is undefined.</p>
<p>Example: </p>
<div class="fragment"><pre class="fragment"> <span class="keyword">extern</span> <a class="code" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043" title="An Evas canvas handle.">Evas</a> *evas;
 <span class="keywordtype">int</span> button_mask, i;

 button_mask = <a class="code" href="group__Evas__Pointer__Group.html#gaae658f627d7f31b051345e45377c3580" title="Returns a bitmask with the mouse buttons currently pressed, set to 1.">evas_pointer_button_down_mask_get</a>(evas);
 printf(<span class="stringliteral">&quot;Buttons currently pressed:\n&quot;</span>);
 <span class="keywordflow">for</span> (i = 0; i &lt; 32; i++)
   {
     <span class="keywordflow">if</span> ((button_mask &amp; (1 &lt;&lt; i)) != 0) printf(<span class="stringliteral">&quot;Button %i\n&quot;</span>, i + 1);
   }
</pre></div> 
</div>
</div>
<a class="anchor" id="ga2f7bf87c9b1268e68c85d4bb8b9e4b15"></a><!-- doxytag: member="evas_main.c::evas_pointer_canvas_xy_get" ref="ga2f7bf87c9b1268e68c85d4bb8b9e4b15" args="(const Evas *e, Evas_Coord *x, Evas_Coord *y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI void evas_pointer_canvas_xy_get </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043">Evas</a> *&#160;</td>
          <td class="paramname"><em>e</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Evas_Coord *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Evas_Coord *&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This function returns the current known pointer co-ordinates. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">e</td><td>The pointer to the Evas Canvas </td></tr>
    <tr><td class="paramname">x</td><td>The pointer to a Evas_Coord to be filled in </td></tr>
    <tr><td class="paramname">y</td><td>The pointer to a Evas_Coord to be filled in</td></tr>
  </table>
  </dd>
</dl>
<p>This function returns the current known canvas unit co-ordinates of the mouse pointer and sets the contents of the Evas_Coords pointed to by <code>x</code> and <code>y</code> to contain these co-ordinates. If <code>e</code> is not a valid canvas the results of this function are undefined.</p>
<p>Example: </p>
<div class="fragment"><pre class="fragment"> <span class="keyword">extern</span> <a class="code" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043" title="An Evas canvas handle.">Evas</a> *evas;
 Evas_Coord mouse_x, mouse_y;

 <a class="code" href="group__Evas__Pointer__Group.html#gad8e78aded475fe26ea14b7410f510a98" title="This function returns the current known pointer co-ordinates.">evas_pointer_output_xy_get</a>(evas, &amp;mouse_x, &amp;mouse_y);
 printf(<span class="stringliteral">&quot;Mouse is at canvas position %f, %f\n&quot;</span>, mouse_x, mouse_y);
</pre></div> 
</div>
</div>
<a class="anchor" id="ga39a1840fd43442c20f321437bd5f427a"></a><!-- doxytag: member="evas_main.c::evas_pointer_inside_get" ref="ga39a1840fd43442c20f321437bd5f427a" args="(const Evas *e)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI Eina_Bool evas_pointer_inside_get </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043">Evas</a> *&#160;</td>
          <td class="paramname"><em>e</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns whether the mouse pointer is logically inside the canvas. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">e</td><td>The pointer to the Evas Canvas </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An integer that is 1 if the mouse is inside the canvas, 0 otherwise</dd></dl>
<p>When this function is called it will return a value of either 0 or 1, depending on if <a class="el" href="group__Evas__Event__Feeding__Group.html#gac9c7fada70cfee1f8124ab5446cc59ed" title="Mouse in event feed.">evas_event_feed_mouse_in()</a>, evas_event_feed_mouse_in_data(), or <a class="el" href="group__Evas__Event__Feeding__Group.html#ga64f5f2d26a018f4e6154b91251e6bb13" title="Mouse out event feed.">evas_event_feed_mouse_out()</a>, evas_event_feed_mouse_out_data() have been called to feed in a mouse enter event into the canvas.</p>
<p>A return value of 1 indicates the mouse is logically inside the canvas, and 0 implies it is logically outside the canvas.</p>
<p>A canvas begins with the mouse being assumed outside (0).</p>
<p>If <code>e</code> is not a valid canvas, the return value is undefined.</p>
<p>Example: </p>
<div class="fragment"><pre class="fragment"> <span class="keyword">extern</span> <a class="code" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043" title="An Evas canvas handle.">Evas</a> *evas;

 <span class="keywordflow">if</span> (<a class="code" href="group__Evas__Pointer__Group.html#ga39a1840fd43442c20f321437bd5f427a" title="Returns whether the mouse pointer is logically inside the canvas.">evas_pointer_inside_get</a>(evas)) printf(<span class="stringliteral">&quot;Mouse is in!\n&quot;</span>);
 <span class="keywordflow">else</span> printf(<span class="stringliteral">&quot;Mouse is out!\n&quot;</span>);
</pre></div> 
</div>
</div>
<a class="anchor" id="gad8e78aded475fe26ea14b7410f510a98"></a><!-- doxytag: member="evas_main.c::evas_pointer_output_xy_get" ref="gad8e78aded475fe26ea14b7410f510a98" args="(const Evas *e, int *x, int *y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI void evas_pointer_output_xy_get </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043">Evas</a> *&#160;</td>
          <td class="paramname"><em>e</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This function returns the current known pointer co-ordinates. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">e</td><td>The pointer to the Evas Canvas </td></tr>
    <tr><td class="paramname">x</td><td>The pointer to an integer to be filled in </td></tr>
    <tr><td class="paramname">y</td><td>The pointer to an integer to be filled in</td></tr>
  </table>
  </dd>
</dl>
<p>This function returns the current known screen/output co-ordinates of the mouse pointer and sets the contents of the integers pointed to by <code>x</code> and <code>y</code> to contain these co-ordinates. If <code>e</code> is not a valid canvas the results of this function are undefined.</p>
<p>Example: </p>
<div class="fragment"><pre class="fragment"> <span class="keyword">extern</span> <a class="code" href="group__Evas__Canvas.html#ga5ff87cc4ce6bc43e3b640a6d37f73043" title="An Evas canvas handle.">Evas</a> *evas;
 <span class="keywordtype">int</span> mouse_x, mouse_y;

 <a class="code" href="group__Evas__Pointer__Group.html#gad8e78aded475fe26ea14b7410f510a98" title="This function returns the current known pointer co-ordinates.">evas_pointer_output_xy_get</a>(evas, &amp;mouse_x, &amp;mouse_y);
 printf(<span class="stringliteral">&quot;Mouse is at screen position %i, %i\n&quot;</span>, mouse_x, mouse_y);
</pre></div> 
</div>
</div>
</div>
 
 <div id="push"></div>
 </div> <!-- #content -->
  </div> <!-- .layout -->
 
 </div> <!-- #container -->
 
 
  <div id="footer">
    <table><tr>
      <td class="poweredby"><img src="doxygen.png"></td>
      <td class="copyright">Copyright &copy;2011 Enlightenment</td>
      <td class="generated">Docs generated Thu Jul 14 2011 20:45:33</td>
    </tr></table>
  </div>


</body>
</html>