blob: 0642cb92a7022e7214f0cd84b0df88db305c7d63 [file] [log] [blame]
<!--
Documentation/_templates/layout.html
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership. The
ASF licenses this file to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the
License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NX &mdash; NuttX latest documentation</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/sphinx_tabs/semantic-ui-2.4.1/segment.min.css" type="text/css" />
<link rel="stylesheet" href="../../_static/sphinx_tabs/semantic-ui-2.4.1/menu.min.css" type="text/css" />
<link rel="stylesheet" href="../../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.css" type="text/css" />
<link rel="stylesheet" href="../../_static/sphinx_tabs/tabs.css" type="text/css" />
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
<link rel="shortcut icon" href="../../_static/favicon.ico"/>
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="NX Tool Kit (NXTK)" href="nxtk.html" />
<link rel="prev" title="NX Graphics Library (NXGL)" href="nxgl.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home"> NuttX
<img src="../../_static/NuttX.png" class="logo" alt="Logo"/>
</a>
<!-- this version selector is quite ugly, should be probably replaced by something
more modern -->
<div class="version-selector">
<select onchange="javascript:location.href = this.value;">
<option value="../../../latest" selected="selected">latest</option>
<option value="../../../10.0.0" >10.0.0</option>
<option value="../../../10.0.1" >10.0.1</option>
<option value="../../../10.1.0" >10.1.0</option>
<option value="../../../10.2.0" >10.2.0</option>
<option value="../../../10.3.0" >10.3.0</option>
<option value="../../../11.0.0" >11.0.0</option>
<option value="../../../12.0.0" >12.0.0</option>
<option value="../../../12.1.0" >12.1.0</option>
<option value="../../../12.2.0" >12.2.0</option>
<option value="../../../12.2.1" >12.2.1</option>
<option value="../../../12.3.0" >12.3.0</option>
<option value="../../../12.4.0" >12.4.0</option>
<option value="../../../12.5.0" >12.5.0</option>
<option value="../../../12.5.1" >12.5.1</option>
<option value="../../../12.6.0" >12.6.0</option>
<option value="../../../12.7.0" >12.7.0</option>
<option value="../../../12.8.0" >12.8.0</option>
<option value="../../../12.9.0" >12.9.0</option>
<option value="../../../12.10.0" >12.10.0</option>
<option value="../../../12.11.0" >12.11.0</option>
</select>
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Table of Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../introduction/index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../introduction/inviolables.html">The Inviolable Principles of NuttX</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../quickstart/index.html">Getting Started</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">OS Components</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../nsh/index.html">NuttShell (NSH)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../power.html">Power Management</a></li>
<li class="toctree-l2"><a class="reference internal" href="../socketcan.html">SocketCAN Device Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../syslog.html">SYSLOG</a></li>
<li class="toctree-l2"><a class="reference internal" href="../binfmt.html">Binary Loader</a></li>
<li class="toctree-l2"><a class="reference internal" href="../drivers/index.html">Device Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../filesystem.html">NuttX File System</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nxflat.html">NXFLAT</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">NX Graphics Subsystem</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="index.html#objectives">Objectives</a></li>
<li class="toctree-l3"><a class="reference internal" href="index.html#organization">Organization</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="index.html#nx-header-files">NX Header Files</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="nxgl.html">NX Graphics Library (<code class="docutils literal notranslate"><span class="pre">NXGL</span></code>)</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="#">NX</a></li>
<li class="toctree-l4"><a class="reference internal" href="nxtk.html">NX Tool Kit (<code class="docutils literal notranslate"><span class="pre">NXTK</span></code>)</a></li>
<li class="toctree-l4"><a class="reference internal" href="nxfonts.html">NX Fonts Support (<code class="docutils literal notranslate"><span class="pre">NXFONTS</span></code>)</a></li>
<li class="toctree-l4"><a class="reference internal" href="nxcursor.html">NX Cursor Support (<code class="docutils literal notranslate"><span class="pre">NXCURSOR</span></code>)</a></li>
<li class="toctree-l4"><a class="reference internal" href="sample.html">Sample Code</a></li>
<li class="toctree-l4"><a class="reference internal" href="appendix.html">Appendix</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../nxwidgets.html">NxWidgets</a></li>
<li class="toctree-l2"><a class="reference internal" href="../paging.html">On-Demand Paging</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../applications/index.html">Applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../boards/index.html">Supported Boards</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../reference/index.html">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../guides/index.html">Guides</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/index.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contributing/index.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary.html">Glossary</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">NuttX</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><a href="../index.html">OS Components</a> &raquo;</li>
<li><a href="index.html">NX Graphics Subsystem</a> &raquo;</li>
<li>NX</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/components/nxgraphics/nx.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="nx">
<h1>NX<a class="headerlink" href="#nx" title="Permalink to this headline"></a></h1>
<div class="section" id="pre-processor-definitions">
<h2>Pre-Processor Definitions<a class="headerlink" href="#pre-processor-definitions" title="Permalink to this headline"></a></h2>
<p>The default server message queue name used by the <a class="reference internal" href="#c.nx_run" title="nx_run"><code class="xref c c-macro docutils literal notranslate"><span class="pre">nx_run</span></code></a> macro:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#define NX_DEFAULT_SERVER_MQNAME &quot;/dev/nxs&quot;</span>
</pre></div>
</div>
<p>Mouse button bits:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#define NX_MOUSE_NOBUTTONS 0x00</span>
<span class="cp">#define NX_MOUSE_LEFTBUTTON 0x01</span>
<span class="cp">#define NX_MOUSE_CENTERBUTTON 0x02</span>
<span class="cp">#define NX_MOUSE_RIGHTBUTTON 0x04</span>
</pre></div>
</div>
</div>
<div class="section" id="nx-types">
<h2>NX Types<a class="headerlink" href="#nx-types" title="Permalink to this headline"></a></h2>
<p>The interface to the NX server is managed using a opaque handle:</p>
<dl class="c type">
<dt id="c.NXHANDLE">
<em class="property">typedef </em>FAR void *<code class="sig-name descname">NXHANDLE</code><a class="headerlink" href="#c.NXHANDLE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>
<p>The interface to a specific window is managed using an opaque handle:</p>
<dl class="c type">
<dt id="c.NXWINDOW">
<em class="property">typedef </em>FAR void *<code class="sig-name descname">NXWINDOW</code><a class="headerlink" href="#c.NXWINDOW" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>
<p>These define callbacks that must be provided to <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>.
These callbacks will be invoked as part of the processing performed by
<a class="reference internal" href="#c.nx_eventhandler" title="nx_eventhandler"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_eventhandler()</span></code></a>.</p>
<dl class="c struct">
<dt id="c.nx_callback_s">
<em class="property">struct </em><code class="sig-name descname">nx_callback_s</code><a class="headerlink" href="#c.nx_callback_s" title="Permalink to this definition"></a><br /></dt>
<dd><div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">struct</span> <span class="n">nx_callback_s</span>
<span class="p">{</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">redraw</span><span class="p">)(</span><span class="n">NXWINDOW</span> <span class="n">hwnd</span><span class="p">,</span> <span class="n">FAR</span> <span class="k">const</span> <span class="k">struct</span> <span class="n">nxgl_rect_s</span> <span class="o">*</span><span class="n">rect</span><span class="p">,</span>
<span class="kt">bool</span> <span class="n">more</span><span class="p">,</span> <span class="n">FAR</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">);</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">position</span><span class="p">)(</span><span class="n">NXWINDOW</span> <span class="n">hwnd</span><span class="p">,</span> <span class="n">FAR</span> <span class="k">const</span> <span class="k">struct</span> <span class="n">nxgl_size_s</span> <span class="o">*</span><span class="n">size</span><span class="p">,</span>
<span class="n">FAR</span> <span class="k">const</span> <span class="k">struct</span> <span class="n">nxgl_point_s</span> <span class="o">*</span><span class="n">pos</span><span class="p">,</span>
<span class="n">FAR</span> <span class="k">const</span> <span class="k">struct</span> <span class="n">nxgl_rect_s</span> <span class="o">*</span><span class="n">bounds</span><span class="p">,</span>
<span class="n">FAR</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">);</span>
<span class="cp">#ifdef CONFIG_NX_XYINPUT</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">mousein</span><span class="p">)(</span><span class="n">NXWINDOW</span> <span class="n">hwnd</span><span class="p">,</span> <span class="n">FAR</span> <span class="k">const</span> <span class="k">struct</span> <span class="n">nxgl_point_s</span> <span class="o">*</span><span class="n">pos</span><span class="p">,</span>
<span class="kt">uint8_t</span> <span class="n">buttons</span><span class="p">,</span> <span class="n">FAR</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">);</span>
<span class="cp">#endif</span>
<span class="cp">#ifdef CONFIG_NX_KBD</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">kbdin</span><span class="p">)(</span><span class="n">NXWINDOW</span> <span class="n">hwnd</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">nch</span><span class="p">,</span> <span class="n">FAR</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">ch</span><span class="p">,</span> <span class="n">FAR</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">);</span>
<span class="cp">#endif</span>
<span class="p">};</span>
</pre></div>
</div>
</dd></dl>
</div>
<div class="section" id="starting-the-nx-server">
<h2>Starting the NX Server<a class="headerlink" href="#starting-the-nx-server" title="Permalink to this headline"></a></h2>
<p>The <em>NX Server</em> is a kernel daemon that receives and serializes graphic
commands. Before you can use the NX graphics system, you must first
start this daemon. There are two ways that this can be done:</p>
<ol class="arabic">
<li><p>The NX server may be started in your board startup logic by simply
calling the function <code class="docutils literal notranslate"><span class="pre">nxmu_start()</span></code>. The board startup logic
usually resides the the <code class="docutils literal notranslate"><span class="pre">boards/arch/chip/board/src</span></code> directory. The
board startup logic can run automatically during the early system if
<code class="docutils literal notranslate"><span class="pre">CONFIG_BOARD_LATE_INITIALIZE</span></code> is defined in the configuration. Or,
the board startup logic can execute under control of the application
by calling <a class="reference internal" href="../../reference/os/boardctl.html#c.boardctl" title="boardctl"><code class="xref c c-func docutils literal notranslate"><span class="pre">boardctl()</span></code></a> as:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">boardctl</span><span class="p">(</span><span class="n">BOARDIOC_INIT</span><span class="p">,</span> <span class="n">arg</span><span class="p">)</span>
</pre></div>
</div>
<p>The board initialization logic will run in either case and the simple
call to <code class="docutils literal notranslate"><span class="pre">nxmu_start()</span></code> will start the NX server.</p>
</li>
<li><p>The NX server may also be started later by the application via
<a class="reference internal" href="../../reference/os/boardctl.html#c.boardctl" title="boardctl"><code class="xref c c-func docutils literal notranslate"><span class="pre">boardctl()</span></code></a> as:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">boardctl</span><span class="p">(</span><span class="n">BOARDIOC_NX_START</span><span class="p">,</span> <span class="n">arg</span><span class="p">)</span>
</pre></div>
</div>
</li>
</ol>
<dl class="c function">
<dt id="c.nxmu_start">
int <code class="sig-name descname">nxmu_start</code><span class="sig-paren">(</span>int <em>display</em>, int <em>plane</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxmu_start" title="Permalink to this definition"></a><br /></dt>
<dd><p>Provides a wrapper function to
simplify and standardize the starting of the NX server.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>display</strong> – The display number to be served by this new NXMU instance.</p></li>
<li><p><strong>plane</strong> – The plane number to use to get information about the display geometry and color format.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) is returned on success. This indicates
that the NX server has been successfully started, is running, and
waiting to accept connections from NX clients.
A negated <code class="docutils literal notranslate"><span class="pre">errno</span></code> value is returned on failure. The <code class="docutils literal notranslate"><span class="pre">errno</span></code> value
indicates the nature of the failure.</p>
</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="nx-server-callbacks">
<h2>NX Server Callbacks<a class="headerlink" href="#nx-server-callbacks" title="Permalink to this headline"></a></h2>
<dl class="c function">
<dt id="c.redraw">
void <code class="sig-name descname">redraw</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_rect_s" title="nxgl_rect_s">nxgl_rect_s</a> *<em>rect</em>, bool <em>more</em>, FAR void *<em>arg</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.redraw" title="Permalink to this definition"></a><br /></dt>
<dd><p>NX requests that the client re-draw the portion of the
window within with rectangle.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle created by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>rect</strong> – The rectangle that needs to be re-drawn (in window relative
coordinates)</p></li>
<li><p><strong>more</strong> – true: More re-draw requests will follow</p></li>
<li><p><strong>arg</strong> – User provided argument (see <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>)</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.position">
void <code class="sig-name descname">position</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_size_s" title="nxgl_size_s">nxgl_size_s</a> *<em>size</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_point_s" title="nxgl_point_s">nxgl_point_s</a> *<em>pos</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_rect_s" title="nxgl_rect_s">nxgl_rect_s</a> *<em>bounds</em>, FAR void *<em>arg</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.position" title="Permalink to this definition"></a><br /></dt>
<dd><p>The size or position of the window has changed (or the
window was just created with zero size.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle created by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>size</strong> – The size of the window</p></li>
<li><p><strong>pos</strong> – The position of the upper left hand corner of the window on the
overall display</p></li>
<li><p><strong>bounds</strong> – The bounding rectangle that the describes the entire display</p></li>
<li><p><strong>arg</strong> – User provided argument (see <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>)</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.mousein">
void <code class="sig-name descname">mousein</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_point_s" title="nxgl_point_s">nxgl_point_s</a> *<em>pos</em>, uint8_t <em>buttons</em>, FAR void *<em>arg</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.mousein" title="Permalink to this definition"></a><br /></dt>
<dd><p>New mouse data is available for the window</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle created by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>pos</strong> – The (x,y) position of the mouse</p></li>
<li><p><strong>buttons</strong> – See <code class="docutils literal notranslate"><span class="pre">NX_MOUSE_*</span></code> definitions</p></li>
<li><p><strong>arg</strong> – User provided argument (see <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>)</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt id="c.kbdin">
void (*<code class="sig-name descname">kbdin</code>)<span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> hwnd, uint8_t nch, FAR <em class="property">const</em> uint8_t *ch, FAR void *arg<span class="sig-paren">)</span>;<a class="headerlink" href="#c.kbdin" title="Permalink to this definition"></a><br /></dt>
<dd><p>New keyboard/keypad data is available for the window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle created by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>nch</strong> – The number of characters that are available in ch[]</p></li>
<li><p><strong>ch</strong> – The array of characters</p></li>
<li><p><strong>arg</strong> – User provided argument (see <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>)</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt id="c.event">
void (*<code class="sig-name descname">event</code>)<span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> hwnd, <em class="property">enum</em> nx_event_e event, FAR void *arg1, FAR void *arg2<span class="sig-paren">)</span>;<a class="headerlink" href="#c.event" title="Permalink to this definition"></a><br /></dt>
<dd><p>This callback is used to communicate server events to the window listener.</p>
<ul class="simple">
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">NXEVENT_BLOCKED</span></code>: Window messages are blocked.</dt><dd><p>This callback is the response from <a class="reference internal" href="#c.nx_block" title="nx_block"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_block()</span></code></a>,
<a class="reference internal" href="nxtk.html#c.nxtk_block" title="nxtk_block"><code class="xref c c-func docutils literal notranslate"><span class="pre">nxtk_block()</span></code></a>. Those blocking interfaces are used
to assure that no further messages are directed to the window.
Receipt of the blocked callback signifies that (1) there are no
further pending callbacks and (2) that the window is now <em>defunct</em>
and will receive no further callbacks. This callback supports
coordinated destruction of a window. In the multi-user mode, the
client window logic must stay intact until all of the queued
callbacks are processed. Then the window may be safely closed.
Closing the window prior with pending callbacks can lead to bad
behavior when the callback is executed.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">NXEVENT_SYNCHED</span></code>: Synchronization handshake</dt><dd><p>This completes the handshake started by
<a class="reference internal" href="#c.nx_synch" title="nx_synch"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_synch()</span></code></a>, or <a class="reference internal" href="nxtk.html#c.nxtk_synch" title="nxtk_synch"><code class="xref c c-func docutils literal notranslate"><span class="pre">nxtk_synch()</span></code></a>.
Those interfaces send a synchronization messages to the NX server
which responds with this event. The sleeping client is awakened and
continues graphics processing, completing the handshake. Due to the
highly asynchronous nature of client-server communications,
synchronization is sometimes necessary to assure that the client and
server are working together properly.</p>
</dd>
</dl>
</li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – TWindow handle of window receiving the event</p></li>
<li><p><strong>event</strong> – The server event</p></li>
<li><p><strong>arg1</strong> – User provided argument (see <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>,
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>, or <a class="reference internal" href="nxtk.html#c.nxtk_opentoolbar" title="nxtk_opentoolbar"><code class="xref c c-func docutils literal notranslate"><span class="pre">nxtk_opentoolbar()</span></code></a>)</p></li>
<li><p><strong>arg2</strong> – TUser provided argument (see <a class="reference internal" href="#c.nx_block" title="nx_block"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_block()</span></code></a>, <a class="reference internal" href="nxtk.html#c.nxtk_block" title="nxtk_block"><code class="xref c c-func docutils literal notranslate"><span class="pre">nxtk_block()</span></code></a>,
<a class="reference internal" href="#c.nx_synch" title="nx_synch"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_synch()</span></code></a>, or <a class="reference internal" href="nxtk.html#c.nxtk_synch" title="nxtk_synch"><code class="xref c c-func docutils literal notranslate"><span class="pre">nxtk_synch()</span></code></a>)</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt id="c.nx_run">
<code class="sig-name descname">nx_run</code><span class="sig-paren">(</span><em>fb</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_run" title="Permalink to this definition"></a><br /></dt>
<dd><div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#define nx_run(fb) nx_runinstance(NX_DEFAULT_SERVER_MQNAME, dev)</span>
</pre></div>
</div>
</dd></dl>
<dl class="c function">
<dt id="c.nx_runinstance">
int <code class="sig-name descname">nx_runinstance</code><span class="sig-paren">(</span>FAR <em class="property">const</em> char *<em>mqname</em>, FAR <em class="property">struct</em> fb_vtable_s *<em>fb</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_runinstance" title="Permalink to this definition"></a><br /></dt>
<dd><p>This is the server entry point. It does not return; the
calling thread is dedicated to supporting NX server.</p>
<p>NOTE that multiple instances of the NX server may run at the same time,
with different callback and message queue names. <code class="docutils literal notranslate"><span class="pre">nx_run()</span></code> is simply
a macro that can be used when only one server instance is required. In
that case, a default server name is used.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mqname</strong> – The name for the server incoming message queue</p></li>
<li><p><strong>dev</strong> – Framebuffer or LCD driver “object” to be used</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>This function usually does not return. If it does
return, it will return <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> and <code class="docutils literal notranslate"><span class="pre">errno</span></code> will be set
appropriately.</p>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt id="c.nx_connect">
<code class="sig-name descname">nx_connect</code><span class="sig-paren">(</span><em>cb</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_connect" title="Permalink to this definition"></a><br /></dt>
<dd><div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#define nx_connect(cb) nx_connectinstance(NX_DEFAULT_SERVER_MQNAME)</span>
</pre></div>
</div>
</dd></dl>
<dl class="c function">
<dt id="c.nx_connectinstance">
<a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <code class="sig-name descname">nx_connectinstance</code><span class="sig-paren">(</span>FAR <em class="property">const</em> char *<em>svrmqname</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_connectinstance" title="Permalink to this definition"></a><br /></dt>
<dd><p>Open a connection from a client to the NX server. One
one client connection is normally needed per thread as each connection
can host multiple windows.</p>
<p>NOTES:</p>
<ul class="simple">
<li><p>This function returns before the connection is fully instantiated. it
is necessary to wait for the connection event before using the
returned handle.</p></li>
<li><p>Multiple instances of the NX server may run at the same time, each
with different message queue names.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">nx_connect()</span></code> is simply a macro that can be used when only one
server instance is required. In that case, a default server name is
used.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>svrmqname</strong> – The name for the server incoming message queue</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Success: A non-NULL handle used with subsequent NX accesses
Failure: NULL is returned and errno is set appropriately.</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_disconnect">
void <code class="sig-name descname">nx_disconnect</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_disconnect" title="Permalink to this definition"></a><br /></dt>
<dd><p>Disconnect a client from the NX server and/or free
resources reserved by <a class="reference internal" href="#c.nx_connect" title="nx_connect"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_connect()</span></code></a>/c:func:<cite>nx_connectinstance</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>handle</strong> – The handle returned by <a class="reference internal" href="#c.nx_connectinstance" title="nx_connectinstance"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_connectinstance()</span></code></a>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_eventhandler">
int <code class="sig-name descname">nx_eventhandler</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_eventhandler" title="Permalink to this definition"></a><br /></dt>
<dd><p>The client code must call this function periodically to
process incoming messages from the server. If <code class="docutils literal notranslate"><span class="pre">CONFIG_NX_BLOCKING</span></code> is
defined, then this function not return until a server message is
received.</p>
<p>When <code class="docutils literal notranslate"><span class="pre">CONFIG_NX_BLOCKING</span></code> is not defined, the client must exercise
caution in the looping to assure that it does not eat up all of the CPU
bandwidth calling nx_eventhandler repeatedly.
<code class="docutils literal notranslate"><span class="pre">`nx_eventnotify()</span></code> &lt;#nxeventnotify&gt;`__ may be called to get a signal
event whenever a new incoming server event is available.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>handle</strong> – The handle returned by <code class="docutils literal notranslate"><span class="pre">`nx_connect()</span></code> &lt;#nxconnectinstance&gt;`__.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">OK</span></code>: No errors occurred. If <code class="docutils literal notranslate"><span class="pre">CONFIG_NX_BLOCKING</span></code> is defined,
then one or more server messages were processed.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ERROR</span></code>: An error occurred and <code class="docutils literal notranslate"><span class="pre">errno</span></code> has been set
appropriately. Of particular interest, it will return
<code class="docutils literal notranslate"><span class="pre">errno</span> <span class="pre">==</span> <span class="pre">EHOSTDOWN</span></code> when the server is disconnected. After that
event, the handle can no longer be used.</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_eventnotify">
int <code class="sig-name descname">nx_eventnotify</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em>, int <em>signo</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_eventnotify" title="Permalink to this definition"></a><br /></dt>
<dd><p>Rather than calling <a class="reference internal" href="#c.nx_eventhandler" title="nx_eventhandler"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_eventhandler()</span></code></a> periodically, the client may
register to receive a signal when a server event is available. The
client can then call :c:func:nx_eventhandler` only
when incoming events are available.</p>
<p>The underlying implementation used <code class="docutils literal notranslate"><span class="pre">mq_notifiy()</span></code> and, as a result,
the client must observe the rules for using <code class="docutils literal notranslate"><span class="pre">mq_notifiy()</span></code>:</p>
<ul class="simple">
<li><p>Only one event is signalled. Upon receipt of the signal, if the
client wishes further notifications, it must call
<code class="docutils literal notranslate"><span class="pre">nx_eventnotify()</span></code> again.</p></li>
<li><p>The signal will only be issued when the message queue transitions
from empty to not empty.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>handle</strong> – The handle returned by <code class="docutils literal notranslate"><span class="pre">`nx_connect()</span></code> &lt;#nxconnectinstance&gt;`__.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_block">
int <code class="sig-name descname">nx_block</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR void *<em>arg</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_block" title="Permalink to this definition"></a><br /></dt>
<dd><p>The response to this function call is two things: (1)
any queued callback messages to the window are ‘blocked’ and then (2)
also subsequent window messaging is blocked.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">event</span></code> callback with the <code class="docutils literal notranslate"><span class="pre">NXEVENT_BLOCKED</span></code> event is the
response from <code class="docutils literal notranslate"><span class="pre">nx_block()</span></code>. This blocking interface is used to assure
that no further messages are are directed to the window. Receipt of the
<code class="docutils literal notranslate"><span class="pre">NXEVENT_BLOCKED</span></code> event signifies that (1) there are no further
pending callbacks and (2) that the window is now <em>defunct</em> and will
receive no further callbacks.</p>
<p>This callback supports coordinated destruction of a window. The client
window logic must stay intact until all of the queued callbacks are
processed. Then the window may be safely closed. Closing the window
prior with pending callbacks can lead to bad behavior when the callback
is executed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>wnd</strong> – The window to be blocked</p></li>
<li><p><strong>arg</strong> – An argument that will accompany the block messages (This is <code class="docutils literal notranslate"><span class="pre">arg2</span></code> in
the event callback).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OK on success; ERROR on failure with errno set
appropriately.</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_synch">
int <code class="sig-name descname">nx_synch</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR void *<em>arg</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_synch" title="Permalink to this definition"></a><br /></dt>
<dd><p>This interface can be used to synchronize the window
client with the NX server. It really just implements an <em>echo</em>: A synch
message is sent from the window client to the server which then responds
immediately by sending the <code class="docutils literal notranslate"><span class="pre">NXEVENT_SYNCHED</span></code> back to the windows
client.</p>
<p>Due to the highly asynchronous nature of client-server communications,
<code class="docutils literal notranslate"><span class="pre">nx_synch()</span></code> is sometimes necessary to assure that the client and
server are fully synchronized in time.</p>
<p>Usage by the window client might be something like this:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">extern</span> <span class="kt">bool</span> <span class="n">g_synched</span><span class="p">;</span>
<span class="k">extern</span> <span class="n">sem_t</span> <span class="n">g_synch_sem</span><span class="p">;</span>
<span class="n">g_synched</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span>
<span class="n">ret</span> <span class="o">=</span> <span class="n">nx_synch</span><span class="p">(</span><span class="n">hwnd</span><span class="p">,</span> <span class="n">handle</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">ret</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span>
<span class="p">{</span>
<span class="o">--</span> <span class="n">Handle</span> <span class="n">the</span> <span class="n">error</span> <span class="o">--</span>
<span class="p">}</span>
<span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">g_synched</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">ret</span> <span class="o">=</span> <span class="n">sem_wait</span><span class="p">(</span><span class="o">&amp;</span><span class="n">g_sync_sem</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">ret</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span>
<span class="p">{</span>
<span class="o">--</span> <span class="n">Handle</span> <span class="n">the</span> <span class="n">error</span> <span class="o">--</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>When the window listener thread receives the <code class="docutils literal notranslate"><span class="pre">NXEVENT_SYNCHED</span></code> event,
it would set <code class="docutils literal notranslate"><span class="pre">g_synched</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> and post <code class="docutils literal notranslate"><span class="pre">g_synch_sem</span></code>, waking
up the above loop.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>wnd</strong> – The window to be synched</p></li>
<li><p><strong>arg</strong> – An argument that will accompany the synch messages (This is <code class="docutils literal notranslate"><span class="pre">arg2</span></code> in the event callback).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OK on success; ERROR on failure with errno set
appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_openwindow">
<a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <code class="sig-name descname">nx_openwindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em>, uint8_t <em>flags</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="#c.nx_callback_s" title="nx_callback_s">nx_callback_s</a> *<em>cb</em>, FAR void *<em>arg</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_openwindow" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a new window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>handle</strong> – The handle returned by <code class="docutils literal notranslate"><span class="pre">`nx_connect()</span></code> &lt;#nxconnectinstance&gt;`__.</p></li>
<li><p><strong>flags</strong> – Optional flags. These include:
- <code class="docutils literal notranslate"><span class="pre">NXBE_WINDOW_RAMBACKED</span></code>: Creates a RAM backed window. This option is only valid if <code class="docutils literal notranslate"><span class="pre">CONFIG_NX_RAMBACKED</span></code> is enabled.
- <code class="docutils literal notranslate"><span class="pre">NXBE_WINDOW_HIDDEN</span></code>: The window is create in the HIDDEN state and can be made visible later with <code class="docutils literal notranslate"><span class="pre">nx_setvisibility()</span></code>.</p></li>
<li><p><strong>cb</strong> – Callbacks used to process window events</p></li>
<li><p><strong>arg</strong> – User provided value that will be returned with NX callbacks.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Success: A non-NULL handle used with subsequent NX accesses
Failure: NULL is returned and errno is set appropriately.</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_closewindow">
int <code class="sig-name descname">nx_closewindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_closewindow" title="Permalink to this definition"></a><br /></dt>
<dd><p>Destroy a window created by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <code class="docutils literal notranslate"><span class="pre">`nx_openwindow()</span></code> &lt;#nxopenwindow&gt;`__ that
identifies the window to be destroyed. This handle must not have been
one returned by <code class="docutils literal notranslate"><span class="pre">`nx_requestbkgd()</span></code> &lt;#nxrequestbkgd&gt;`__.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_requestbkgd">
int <code class="sig-name descname">nx_requestbkgd</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="#c.nx_callback_s" title="nx_callback_s">nx_callback_s</a> *<em>cb</em>, FAR void *<em>arg</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_requestbkgd" title="Permalink to this definition"></a><br /></dt>
<dd><p>NX normally controls a separate window called the
background window. It repaints the window as necessary using only a
solid color fill. The background window always represents the entire
screen and is always below other windows. It is useful for an
application to control the background window in the following
conditions:</p>
<ul class="simple">
<li><p>If you want to implement a windowless solution. The single screen can
be used to create a truly simple graphic environment.</p></li>
<li><p>When you want more on the background than a solid color. For example,
if you want an image in the background, or animations in the
background, or live video, etc.</p></li>
</ul>
<p>This API only requests the handle of the background window. That handle
will be returned asynchronously in a subsequent position and redraw
callbacks.</p>
<p>Cautions:</p>
<ul class="simple">
<li><p>The following should never be called using the background window.
They are guaranteed to cause severe crashes: <a class="reference internal" href="#c.nx_setposition" title="nx_setposition"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_setposition()</span></code></a>,
<a class="reference internal" href="#c.nx_setsize" title="nx_setsize"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_setsize()</span></code></a>, <a class="reference internal" href="#c.nx_raise" title="nx_raise"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_raise()</span></code></a>, or <a class="reference internal" href="#c.nx_lower" title="nx_lower"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_lower()</span></code></a>,
<a class="reference internal" href="#c.nx_modal" title="nx_modal"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_modal()</span></code></a>, <a class="reference internal" href="#c.nx_setvisibility" title="nx_setvisibility"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_setvisibility()</span></code></a>.</p></li>
<li><p>Neither <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a> nor <a class="reference internal" href="#c.nx_releasebkgd" title="nx_releasebkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_releasebkgd()</span></code></a>
should be called more than once. Multiple instances of the
background window are not supported.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>handle</strong> – The handle returned by <code class="docutils literal notranslate"><span class="pre">`nx_connect()</span></code> &lt;#nxconnectinstance&gt;`__.</p></li>
<li><p><strong>cb</strong> – Callbacks to use for processing background window events</p></li>
<li><p><strong>arg</strong> – User provided argument (see <code class="docutils literal notranslate"><span class="pre">`nx_openwindow()</span></code> &lt;#nxopenwindow&gt;`__)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_releasebkgd">
int <code class="sig-name descname">nx_releasebkgd</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_releasebkgd" title="Permalink to this definition"></a><br /></dt>
<dd><p>Release the background window previously acquired using
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a> and return control of the background to NX.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>handle</strong> – The handle returned indirectly by <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>.
This handle must not have been one created by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with <code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_getposition">
int <code class="sig-name descname">nx_getposition</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_getposition" title="Permalink to this definition"></a><br /></dt>
<dd><p>Request the position and size information for the
selected window. The values will be return asynchronously through the
client callback function pointer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with <code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_setposition">
int <code class="sig-name descname">nx_setposition</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_point_s" title="nxgl_point_s">nxgl_point_s</a> *<em>pos</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_setposition" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the position and size for the selected window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>. This
handle must not have been created by <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>.</p></li>
<li><p><strong>pos</strong> – The new position of the window</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_setsize">
int <code class="sig-name descname">nx_setsize</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_size_s" title="nxgl_size_s">nxgl_size_s</a> *<em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_setsize" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the size of the selected window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>. This
handle must not have been created by <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>.</p></li>
<li><p><strong>size</strong> – The new size of the window (in pixels).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_raise">
int <code class="sig-name descname">nx_raise</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_raise" title="Permalink to this definition"></a><br /></dt>
<dd><p>Bring the specified window to the top of the display.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>. This
handle must not have been created by <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with <code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_lower">
int <code class="sig-name descname">nx_lower</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_lower" title="Permalink to this definition"></a><br /></dt>
<dd><p>Lower the specified window to the bottom of the display.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>. This
handle must not have been created by <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_modal">
int <code class="sig-name descname">nx_modal</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, bool <em>modal</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_modal" title="Permalink to this definition"></a><br /></dt>
<dd><p>May be used to either (1) raise a window to the top of
the display and select modal behavior, or (2) disable modal behavior.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>. This
handle must not have been created by <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>.</p></li>
<li><p><strong>modal</strong> – True: enter modal state; False: leave modal state</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_setvisibility">
int <code class="sig-name descname">nx_setvisibility</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, bool <em>hide</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_setvisibility" title="Permalink to this definition"></a><br /></dt>
<dd><p>Select if the window is visible or hidden. A hidden
window is still present and will update normally, but will not be
visible on the display until it is unhidden.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a>. This
handle must not have been created by <a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a>.</p></li>
<li><p><strong>hide</strong> – True: Window will be hidden; false: Window will be visible</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_ishidden">
bool <code class="sig-name descname">nx_ishidden</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_ishidden" title="Permalink to this definition"></a><br /></dt>
<dd><p>Return true if the window is hidden.</p>
<p><strong>NOTE</strong>: There will be a delay between the time that the visibility of
the window is changed via <code class="xref c c-func docutils literal notranslate"><span class="pre">nx_setvisibily()</span></code>
before that new setting is reported by <a class="reference internal" href="#c.nx_ishidden" title="nx_ishidden"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_ishidden()</span></code></a>. <code class="docutils literal notranslate"><span class="pre">nx_synch()</span></code>
may be used if temporal synchronization is required.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> that
identifies the window to be queried.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>True</em>: the window is hidden, <em>false</em>: the window is
visible</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_fill">
int <code class="sig-name descname">nx_fill</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_rect_s" title="nxgl_rect_s">nxgl_rect_s</a> *<em>rect</em>, <a class="reference internal" href="nxgl.html#c.nxgl_mxpixel_t" title="nxgl_mxpixel_t">nxgl_mxpixel_t</a> <em>color</em>[<em>CONFIG_NX_NPLANES</em>]<span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_fill" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill the specified rectangle in the window with the
specified color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <code class="docutils literal notranslate"><span class="pre">`nx_openwindow()</span></code> &lt;#nxopenwindow&gt;`__ or
<code class="docutils literal notranslate"><span class="pre">`nx_requestbkgd()</span></code> &lt;#nxrequestbkgd&gt;`__</p></li>
<li><p><strong>rect</strong> – The location to be filled</p></li>
<li><p><strong>color</strong> – The color to use in the fill</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_getrectangle">
void <code class="sig-name descname">nx_getrectangle</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_rect_s" title="nxgl_rect_s">nxgl_rect_s</a> *<em>rect</em>, unsigned int <em>plane</em>, FAR uint8_t *<em>dest</em>, unsigned int <em>deststride</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_getrectangle" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the raw contents of graphic memory within a
rectangular region. NOTE: Since raw graphic memory is returned, the
returned memory content may be the memory of windows above this one and
may not necessarily belong to this window unless you assure that this is
the top window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>rect</strong> – The location to be copied</p></li>
<li><p><strong>plane</strong> – Specifies the color plane to get from</p></li>
<li><p><strong>dest</strong> – The location to copy the memory region</p></li>
<li><p><strong>deststride</strong> – The width, in bytes, of the dest memory</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_filltrapezoid">
int <code class="sig-name descname">nx_filltrapezoid</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_rect_s" title="nxgl_rect_s">nxgl_rect_s</a> *<em>clip</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_trapezoid_s" title="nxgl_trapezoid_s">nxgl_trapezoid_s</a> *<em>trap</em>, <a class="reference internal" href="nxgl.html#c.nxgl_mxpixel_t" title="nxgl_mxpixel_t">nxgl_mxpixel_t</a> <em>color</em>[<em>CONFIG_NX_NPLANES</em>]<span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_filltrapezoid" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill the specified trapezoidal region in the window
with the specified color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>clip</strong> – Clipping rectangle relative to window (may be null)</p></li>
<li><p><strong>trap</strong> – The trapezoidal region to be filled</p></li>
<li><p><strong>color</strong> – The color to use in the fill</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_drawline">
int <code class="sig-name descname">nx_drawline</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">struct</em> nxgl_vector_s *<em>vector</em>, <a class="reference internal" href="nxgl.html#c.nxgl_coord_t" title="nxgl_coord_t">nxgl_coord_t</a> <em>width</em>, <a class="reference internal" href="nxgl.html#c.nxgl_mxpixel_t" title="nxgl_mxpixel_t">nxgl_mxpixel_t</a> <em>color</em>[<em>CONFIG_NX_NPLANES</em>], uint8_t <em>caps</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_drawline" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill the specified trapezoidal region in the window
with the specified color. Fill the specified line in the window with the
specified color. This is simply a wrapper that uses <a class="reference internal" href="nxgl.html#c.nxgl_splitline" title="nxgl_splitline"><code class="xref c c-func docutils literal notranslate"><span class="pre">nxgl_splitline()</span></code></a>
to break the line into trapezoids and then calls <a class="reference internal" href="#c.nx_filltrapezoid" title="nx_filltrapezoid"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_filltrapezoid()</span></code></a>
to render the line.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>vector</strong> – Describes the line to be drawn.</p></li>
<li><p><strong>width</strong> – The width of the line</p></li>
<li><p><strong>color</strong> – The color to use to fill the line</p></li>
<li><p><strong>caps</strong><p>Draw a circular cap on the ends of the line to support better line
joins. One of:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>/* Line caps */
#define NX_LINECAP_NONE 0x00, /* No line caps */
#define NX_LINECAP_PT1 0x01 /* Line cap on pt1 on of the vector only */
#define NX_LINECAP_PT2 0x02 /* Line cap on pt2 on of the vector only */
#define NX_LINECAP_BOTH 0x03 /* Line cap on both ends of the vector only */
</pre></div>
</div>
</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_drawcircle">
int <code class="sig-name descname">nx_drawcircle</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_point_s" title="nxgl_point_s">nxgl_point_s</a> *<em>center</em>, <a class="reference internal" href="nxgl.html#c.nxgl_coord_t" title="nxgl_coord_t">nxgl_coord_t</a> <em>radius</em>, <a class="reference internal" href="nxgl.html#c.nxgl_coord_t" title="nxgl_coord_t">nxgl_coord_t</a> <em>width</em>, <a class="reference internal" href="nxgl.html#c.nxgl_mxpixel_t" title="nxgl_mxpixel_t">nxgl_mxpixel_t</a> <em>color</em>[<em>CONFIG_NX_NPLANES</em>]<span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_drawcircle" title="Permalink to this definition"></a><br /></dt>
<dd><p>Draw a circular outline using the specified line
thickness and color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>center</strong> – A pointer to the point that is the center of the circle.</p></li>
<li><p><strong>radius</strong> – The radius of the circle in pixels.</p></li>
<li><p><strong>width</strong> – The width of the line</p></li>
<li><p><strong>color</strong> – The color to use to fill the line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_fillcircle">
int <code class="sig-name descname">nx_fillcircle</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_point_s" title="nxgl_point_s">nxgl_point_s</a> *<em>center</em>, <a class="reference internal" href="nxgl.html#c.nxgl_coord_t" title="nxgl_coord_t">nxgl_coord_t</a> <em>radius</em>, <a class="reference internal" href="nxgl.html#c.nxgl_mxpixel_t" title="nxgl_mxpixel_t">nxgl_mxpixel_t</a> <em>color</em>[<em>CONFIG_NX_NPLANES</em>]<span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_fillcircle" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill a circular region using the specified color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p></li>
<li><p><strong>center</strong> – A pointer to the point that is the center of the circle.</p></li>
<li><p><strong>radius</strong> – The width of the line</p></li>
<li><p><strong>color</strong> – The color to use to fill the circle</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_setbgcolor">
int <code class="sig-name descname">nx_setbgcolor</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em>, <a class="reference internal" href="nxgl.html#c.nxgl_mxpixel_t" title="nxgl_mxpixel_t">nxgl_mxpixel_t</a> <em>color</em>[<em>CONFIG_NX_NPLANES</em>]<span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_setbgcolor" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>
<p>Set the color of the background.</p>
<dl class="field-list simple">
<dt class="field-odd">param handle</dt>
<dd class="field-odd"><p>The handle created by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a></p>
</dd>
<dt class="field-even">param color</dt>
<dd class="field-even"><p>The color to use in the background</p>
</dd>
<dt class="field-odd">return</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
<dl class="c function">
<dt id="c.nx_move">
int <code class="sig-name descname">nx_move</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_rect_s" title="nxgl_rect_s">nxgl_rect_s</a> *<em>rect</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_point_s" title="nxgl_point_s">nxgl_point_s</a> *<em>offset</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_move" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>
<p>Move a rectangular region within the window.</p>
<dl class="field-list simple">
<dt class="field-odd">param hwnd</dt>
<dd class="field-odd"><p>The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a> that specifies the window within which the move is to be done</p>
</dd>
<dt class="field-even">param rect</dt>
<dd class="field-even"><p>Describes the (source) rectangular region to move</p>
</dd>
<dt class="field-odd">param offset</dt>
<dd class="field-odd"><p>The offset to move the region</p>
</dd>
<dt class="field-even">return</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with <code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
<dl class="c function">
<dt id="c.nx_bitmap">
int <code class="sig-name descname">nx_bitmap</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_rect_s" title="nxgl_rect_s">nxgl_rect_s</a> *<em>dest</em>, FAR <em class="property">const</em> void *<em>src</em>[<em>CONFIG_NX_NPLANES</em>], FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nxgl.html#c.nxgl_point_s" title="nxgl_point_s">nxgl_point_s</a> *<em>origin</em>, unsigned int <em>stride</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_bitmap" title="Permalink to this definition"></a><br /></dt>
<dd><p>Copy a rectangular region of a larger image into the
rectangle in the specified window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – The handle returned by <a class="reference internal" href="#c.nx_openwindow" title="nx_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_openwindow()</span></code></a> or
<a class="reference internal" href="#c.nx_requestbkgd" title="nx_requestbkgd"><code class="xref c c-func docutils literal notranslate"><span class="pre">nx_requestbkgd()</span></code></a> that specifies the window that will receive the bitmap image.</p></li>
<li><p><strong>dest</strong> – Describes the rectangular on the display that will receive the bit map.</p></li>
<li><p><strong>src</strong> – The start of the source image. This is an array source images of size <code class="docutils literal notranslate"><span class="pre">CONFIG_NX_NPLANES</span></code> (probably 1).</p></li>
<li><p><strong>origin</strong> – The origin of the upper, left-most corner of the full bitmap. Both
dest and origin are in window coordinates, however, the origin may
lie outside of the display.</p></li>
<li><p><strong>stride</strong> – The width of the full source image in bytes.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with <code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_kbdchin">
int <code class="sig-name descname">nx_kbdchin</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em>, uint8_t <em>ch</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_kbdchin" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>
<dl class="c function">
<dt id="c.nx_kbdin">
int <code class="sig-name descname">nx_kbdin</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em>, uint8_t <em>nch</em>, FAR <em class="property">const</em> uint8_t *<em>ch</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nx_kbdin" title="Permalink to this definition"></a><br /></dt>
<dd><p>Used by a thread or interrupt handler that manages some
kind of keypad hardware to report text information to the NX server.
That text data will be routed by the NX server to the appropriate window
client.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nx_mousein">
int <code class="sig-name descname">nx_mousein</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXHANDLE" title="NXHANDLE">NXHANDLE</a> <em>handle</em>, <a class="reference internal" href="nxgl.html#c.nxgl_coord_t" title="nxgl_coord_t">nxgl_coord_t</a> <em>x</em>, <a class="reference internal" href="nxgl.html#c.nxgl_coord_t" title="nxgl_coord_t">nxgl_coord_t</a> <em>y</em>, uint8_t <em>buttons</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nx_mousein" title="Permalink to this definition"></a><br /></dt>
<dd><p>Used by a thread or interrupt handler that manages some
kind of pointing hardware to report new positional data to the NX
server. That positional data will be routed by the NX server to the
appropriate window client.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">OK</span></code> on success; <code class="docutils literal notranslate"><span class="pre">ERROR</span></code> on failure with
<code class="docutils literal notranslate"><span class="pre">errno</span></code> set appropriately</p>
</dd>
</dl>
</dd></dl>
<span class="target" id="nx-tool-kit-nxtk-1"></span></div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, The Apache Software Foundation
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>