⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 group__nanox__event.html

📁 Nano-x的设计架及相关文档----这是网上下载的中文翻译版本, E文的可以在其网站上下载.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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>Nano-X events API.</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center><hr><h1>Nano-X events API.<br><small>[<a class="el" href="group__nanox.html">Nano-X public API</a>]</small></h1>The Nano-X event mechanism. <a href="#_details">More...</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a0">GrRegisterInput</a> (int fd)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Register an extra file descriptor to monitor in the main select() call.</em> <a href="#a0"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a1">GrUnregisterInput</a> (int fd)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Stop monitoring a file descriptor previously registered with <a class="el" href="group__nanox__event.html#a0">GrRegisterInput()</a>.</em> <a href="#a1"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a2">GrPrepareSelect</a> (int *maxfd, void *rfdset)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Prepare for the client to call select().</em> <a href="#a2"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a3">GrServiceSelect</a> (void *rfdset, GR_FNCALLBACKEVENT fncb)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Handles events after the client has done a select() call.</em> <a href="#a3"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a4">GrMainLoop</a> (GR_FNCALLBACKEVENT fncb)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">An infinite loop that dispatches events.</em> <a href="#a4"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a5">GrGetNextEvent</a> (<a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *ep)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Gets the next event from the event queue.</em> <a href="#a5"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a6">GrGetNextEventTimeout</a> (<a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *ep, GR_TIMEOUT timeout)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Gets the next event from the event queue, with a time limit.</em> <a href="#a6"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a7">GrPeekEvent</a> (<a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *ep)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Gets a copy of the next event on the queue, without actually removing it from the queue.</em> <a href="#a7"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a8">GrPeekWaitEvent</a> (<a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *ep)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Wait until an event is available for a client, and then peek at it.</em> <a href="#a8"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a9">GrCheckNextEvent</a> (<a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *ep)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Gets the next event from the event queue if there is one.</em> <a href="#a9"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a10">GrGetTypedEvent</a> (GR_WINDOW_ID wid, GR_EVENT_MASK mask, GR_UPDATE_TYPE update, <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *ep, GR_BOOL block)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Fills in the specified event structure with a copy of the next event on the queue that matches the type parameters passed and removes it from the queue.</em> <a href="#a10"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a11">GrGetTypedEventPred</a> (GR_WINDOW_ID wid, GR_EVENT_MASK mask, GR_UPDATE_TYPE update, <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *ep, GR_BOOL block, GR_TYPED_EVENT_CALLBACK matchfn, void *arg)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">The specified callback function is called with the passed event type parameters for each event on the queue, until the callback function CheckFunction returns GR_TRUE.</em> <a href="#a11"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a12">GrSelectEvents</a> (GR_WINDOW_ID wid, GR_EVENT_MASK eventmask)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Select the event types which should be returned for the specified window.</em> <a href="#a12"></a><em></em><br><br></td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group__nanox__event.html#a13">GrQueueLength</a> (void)</td></tr><tr><td>&nbsp;</td><td><em class="mdesc">Returns the current length of the client side queue.</em> <a href="#a13"></a><em></em><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>The Nano-X event mechanism.<p><hr><h2>Function Documentation</h2><a name="a9" doxytag="nano-X.h::GrCheckNextEvent"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void GrCheckNextEvent </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>ep</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Gets the next event from the event queue if there is one.<p>Returns immediately with an event type of GR_EVENT_TYPE_NONE if the queue is empty.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign=top><em>ep</em>&nbsp;</td><td>Pointer to the <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> structure to return the event in. </td></tr>  </table></dl>    </td>  </tr></table><a name="a5" doxytag="nano-X.h::GrGetNextEvent"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void GrGetNextEvent </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>ep</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Gets the next event from the event queue.<p>If the queue is currently empty, sleeps until the next event arrives from the server or input is read on a file descriptor previously specified by <a class="el" href="group__nanox__event.html#a0">GrRegisterInput()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign=top><em>ep</em>&nbsp;</td><td>Pointer to the <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> structure to return the event in. </td></tr>  </table></dl>    </td>  </tr></table><a name="a6" doxytag="nano-X.h::GrGetNextEventTimeout"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void GrGetNextEventTimeout </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>ep</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>GR_TIMEOUT&nbsp;</td>          <td class="mdname" nowrap> <em>timeout</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Gets the next event from the event queue, with a time limit.<p>If the queue is currently empty, we sleep until the next event arrives from the server, input is read on a file descriptor previously specified by <a class="el" href="group__nanox__event.html#a0">GrRegisterInput()</a>, or a timeout occurs.<p>Note that a value of 0 for the timeout parameter doesn't mean "timeout after 0 milliseconds" but is in fact a magic number meaning "never time out".<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign=top><em>ep</em>&nbsp;</td><td>Pointer to the <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> structure to return the event in. </td></tr>    <tr><td valign=top><em>timeout</em>&nbsp;</td><td>The number of milliseconds to wait before timing out, or 0 for forever. </td></tr>  </table></dl>    </td>  </tr></table><a name="a10" doxytag="nano-X.h::GrGetTypedEvent"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> int GrGetTypedEvent </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">GR_WINDOW_ID&nbsp;</td>          <td class="mdname" nowrap> <em>wid</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>GR_EVENT_MASK&nbsp;</td>          <td class="mdname" nowrap> <em>mask</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>GR_UPDATE_TYPE&nbsp;</td>          <td class="mdname" nowrap> <em>update</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>ep</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>GR_BOOL&nbsp;</td>          <td class="mdname" nowrap> <em>block</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Fills in the specified event structure with a copy of the next event on the queue that matches the type parameters passed and removes it from the queue.<p>If block is GR_TRUE, the call will block until a matching event is found. Otherwise, only the local queue is searched, and an event type of GR_EVENT_TYPE_NONE is returned if the a match is not found.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign=top><em>wid</em>&nbsp;</td><td>Window id for which to check events. 0 means no window. </td></tr>    <tr><td valign=top><em>mask</em>&nbsp;</td><td>Event mask of events for which to check. 0 means no check for mask. </td></tr>    <tr><td valign=top><em>update</em>&nbsp;</td><td>Update event subtype when event mask is GR_EVENT_MASK_UPDATE. </td></tr>    <tr><td valign=top><em>ep</em>&nbsp;</td><td>Pointer to the <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> structure to return the event in. </td></tr>    <tr><td valign=top><em>block</em>&nbsp;</td><td>Specifies whether or not to block, GR_TRUE blocks, GR_FALSE does not. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>GR_EVENT_TYPE if an event was returned, or GR_EVENT_TYPE_NONE if no events match. </dd></dl>    </td>  </tr></table><a name="a11" doxytag="nano-X.h::GrGetTypedEventPred"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> int GrGetTypedEventPred </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">GR_WINDOW_ID&nbsp;</td>          <td class="mdname" nowrap> <em>wid</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>GR_EVENT_MASK&nbsp;</td>          <td class="mdname" nowrap> <em>mask</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>GR_UPDATE_TYPE&nbsp;</td>          <td class="mdname" nowrap> <em>update</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="unionGR__EVENT.html">GR_EVENT</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>ep</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>GR_BOOL&nbsp;</td>          <td class="mdname" nowrap> <em>block</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>GR_TYPED_EVENT_CALLBACK&nbsp;</td>          <td class="mdname" nowrap> <em>matchfn</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>void *&nbsp;</td>          <td class="mdname" nowrap> <em>arg</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>The specified callback function is called with the passed event type parameters for each event on the queue, until the callback function CheckFunction returns GR_TRUE.<p>The event is then removed from the queue and returned. If block is GR_TRUE, the call will block until a matching event is found. Otherwise, only the local queue is searched, and an event type of GR_EVENT_TYPE_NONE is returned if the a match is not found.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign=top><em>wid</em>&nbsp;</td><td>Window id for which to check events. 0 means no window. </td></tr>    <tr><td valign=top><em>mask</em>&nbsp;</td><td>Event mask of events for which to check. 0 means no check for mask. </td></tr>    <tr><td valign=top><em>update</em>&nbsp;</td><td>Update event subtype when event mask is GR_EVENT_MASK_UPDATE. </td></tr>    <tr><td valign=top><em>ep</em>&nbsp;</td><td>Pointer to the <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> structure to return the event in. </td></tr>    <tr><td valign=top><em>block</em>&nbsp;</td><td>Specifies whether or not to block, GR_TRUE blocks, GR_FALSE does not. </td></tr>    <tr><td valign=top><em>matchfn</em>&nbsp;</td><td>Specifies the callback function called for matching. </td></tr>    <tr><td valign=top><em>arg</em>&nbsp;</td><td>A programmer-specified argument passed to the callback function. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>GR_EVENT_TYPE if an event was returned, or GR_EVENT_TYPE_NONE if no events match. </dd></dl>    </td>  </tr></table><a name="a4" doxytag="nano-X.h::GrMainLoop"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void GrMainLoop </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">GR_FNCALLBACKEVENT&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>fncb</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -