blob: 1844412e1e196f1dbda3b97360e647f4d1f3a629 [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 Tool Kit (NXTK) &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 Fonts Support (NXFONTS)" href="nxfonts.html" />
<link rel="prev" title="NX" href="nx.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"><a class="reference internal" href="nx.html">NX</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="#">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 Tool Kit (<code class="docutils literal notranslate"><span class="pre">NXTK</span></code>)</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/components/nxgraphics/nxtk.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-tool-kit-nxtk">
<h1>NX Tool Kit (<code class="docutils literal notranslate"><span class="pre">NXTK</span></code>)<a class="headerlink" href="#nx-tool-kit-nxtk" title="Permalink to this headline"></a></h1>
<p>NXTK implements where the <em>framed window</em>. NX framed windows consist of
three components within one NX window:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>The window <em>border</em>,</p></li>
<li><p>The main <em>client window</em> area, and</p></li>
<li><p>A <em>toolbar</em> area</p></li>
</ol>
</div></blockquote>
<p>Each sub-window represents a region within one window. <a class="reference external" href="#screenshot">Figure
1</a> shows some simple NX framed windows. NXTK allows
these sub-windows to be managed more-or-less independently:</p>
<blockquote>
<div><ul class="simple">
<li><p>Each component has its own callbacks for redraw and position events
as well as mouse and keyboard inputs. The client sub-window callbacks
are registered when the framed window is created with a call to
<a class="reference internal" href="#c.nxtk_openwindow" title="nxtk_openwindow"><code class="xref c c-func docutils literal notranslate"><span class="pre">nxtk_openwindow()</span></code></a>; Separate toolbar
sub-window callbacks are reigistered when the toolbar is added using
<a class="reference internal" href="#c.nxtk_opentoolbar" title="nxtk_opentoolbar"><code class="xref c c-func docutils literal notranslate"><span class="pre">nxtk_opentoolbar()</span></code></a>. (NOTES: (1) only the
client sub-window receives keyboard input and, (2) border callbacks
are not currently accessible by the user).</p></li>
<li><p>All position informational provided within the callback is relative
to the specific sub-window. That is, the origin (0,0) of the
coordinate system for each sub-window begins at the top left
corner of the subwindow. This means that toolbar logic need not
be concerned about client window geometry (and vice versa) and,
for example, common toolbar logic can be used with different windows.</p></li>
</ul>
</div></blockquote>
<dl class="c type">
<dt id="c.NXTKWINDOW">
<em class="property">typedef </em>FAR void *<code class="sig-name descname">NXTKWINDOW</code><a class="headerlink" href="#c.NXTKWINDOW" title="Permalink to this definition"></a><br /></dt>
<dd><p>This is the handle that can be used to access the window data region.</p>
</dd></dl>
<dl class="c function">
<dt id="c.nxtk_block">
int <code class="sig-name descname">nxtk_block</code><span class="sig-paren">(</span><a class="reference internal" href="nx.html#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR void *<em>arg</em><span class="sig-paren">)</span><a class="headerlink" href="#c.nxtk_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">nxtk_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.nxtk_synch">
int <code class="sig-name descname">nxtk_synch</code><span class="sig-paren">(</span><a class="reference internal" href="nx.html#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, FAR void *<em>arg</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_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">nxtk_synch</span><span class="p">(</span><span class="n">hfwnd</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.nxtk_openwindow">
<a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <code class="sig-name descname">nxtk_openwindow</code><span class="sig-paren">(</span><a class="reference internal" href="nx.html#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="nx.html#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.nxtk_openwindow" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a new, framed 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><p>Optional flags. These include:</p>
<ul>
<li><p><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.</p></li>
<li><p><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">nxtk_setvisibility()</span></code>.</p></li>
</ul>
</p></li>
<li><p><strong>cb</strong> – Callbacks used to process 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>Success: A non-NULL handle used with subsequent NXTK window accesses
Failure: NULL is returned and errno is set appropriately.</p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt id="c.nxtk_closewindow">
int <code class="sig-name descname">nxtk_closewindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_closewindow" title="Permalink to this definition"></a><br /></dt>
<dd><p>Close the window opened by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&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.nxtk_getposition">
int <code class="sig-name descname">nxtk_getposition</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_getposition" title="Permalink to this definition"></a><br /></dt>
<dd><p>Request the position and size information for the
selected framed window. The size/position for the client window and
toolbar 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&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.nxtk_setposition">
int <code class="sig-name descname">nxtk_setposition</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_setposition" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the position for the selected client window. This
position does not include the offsets for the borders nor for any
toolbar. Those offsets will be added in to set the full window position.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>pos</strong> – The new position of the client sub-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.nxtk_setsize">
int <code class="sig-name descname">nxtk_setsize</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_setsize" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the size for the selected client window. This size
does not include the sizes of the borders nor for any toolbar. Those
sizes will be added in to set the full window size.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>size</strong> – The new size of the client sub-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.nxtk_raise">
int <code class="sig-name descname">nxtk_raise</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_raise" title="Permalink to this definition"></a><br /></dt>
<dd><p>Bring the window containing the specified client
sub-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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__ specifying the window to
be raised.</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.nxtk_lower">
int <code class="sig-name descname">nxtk_lower</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_lower" title="Permalink to this definition"></a><br /></dt>
<dd><p>Lower the window containing the specified client
sub-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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__ specifying the window to
be lowered.</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.nxtk_modal">
int <code class="sig-name descname">nxtk_modal</code><span class="sig-paren">(</span><a class="reference internal" href="nx.html#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, bool <em>modal</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_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 <code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__
specifying the window to be modified.</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.nxtk_setvisibility">
int <code class="sig-name descname">nxtk_setvisibility</code><span class="sig-paren">(</span><a class="reference internal" href="nx.html#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hwnd</em>, bool <em>hide</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_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 <code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__
specifying the window to be modified.</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.nxtk_ishidden">
bool <code class="sig-name descname">nxtk_ishidden</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_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="docutils literal notranslate"><span class="pre">`nxtk_setvisibily()</span></code> &lt;#nxtksetvisibility&gt;`__ before that new setting
is reported by <code class="docutils literal notranslate"><span class="pre">nxtk_ishidden()</span></code>. <code class="docutils literal notranslate"><span class="pre">nxtk_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>hfwnd</strong> – The handle returned by <code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__
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.nxtk_fillwindow">
int <code class="sig-name descname">nxtk_fillwindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_fillwindow" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill the specified rectangle in the client 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>rect</strong> – The location within the client window 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.nxtk_getwindow">
void <code class="sig-name descname">nxtk_getwindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_getwindow" 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>rect</strong> – The location within the client window to be retrieved.</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.nxtk_filltrapwindow">
int <code class="sig-name descname">nxtk_filltrapwindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_filltrapwindow" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill the specified trapezoid in the client 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</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.nxtk_drawlinewindow">
int <code class="sig-name descname">nxtk_drawlinewindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_drawlinewindow" 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 <code class="docutils literal notranslate"><span class="pre">nxgl_splitline()</span></code>
to break the line into trapezoids and then calls
<code class="docutils literal notranslate"><span class="pre">nxtk_filltrapwindow()</span></code> 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</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> – Draw a circular cap on the ends of the line to support better line
joins. One of:</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.nxtk_drawcirclewindow">
int <code class="sig-name descname">nxtk_drawcirclewindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_drawcirclewindow" 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</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.nxtk_fillcirclewindow">
int <code class="sig-name descname">nxtk_fillcirclewindow</code><span class="sig-paren">(</span><a class="reference internal" href="nx.html#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hfwnd</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.nxtk_fillcirclewindow" 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</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.nxtk_movewindow">
int <code class="sig-name descname">nxtk_movewindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_movewindow" title="Permalink to this definition"></a><br /></dt>
<dd><p>Move a rectangular region within the client sub-window
of a framed window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__ specifying the client
sub-window within which the move is to be done.</p></li>
<li><p><strong>rect</strong> – Describes the rectangular region relative to the client sub-window to
move.</p></li>
<li><p><strong>offset</strong> – The offset to move the region</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.nxtk_bitmapwindow">
int <code class="sig-name descname">nxtk_bitmapwindow</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_bitmapwindow" title="Permalink to this definition"></a><br /></dt>
<dd><p>Copy a rectangular region of a larger image into the
rectangle in the specified client sub-window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__ specifying the client
sub-window that will receive the bitmap.</p></li>
<li><p><strong>dest</strong> – Describes the rectangular region on in the client sub-window will
receive the bit map.</p></li>
<li><p><strong>src</strong> – The start of the source image(s). 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 sub-window coordinates, however, the origin
may lie outside of the sub-window display.</p></li>
<li><p><strong>stride</strong> – The width of the full source image 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.nxtk_opentoolbar">
int <code class="sig-name descname">nxtk_opentoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</em>, <a class="reference internal" href="nxgl.html#c.nxgl_coord_t" title="nxgl_coord_t">nxgl_coord_t</a> <em>height</em>, FAR <em class="property">const</em> <em class="property">struct</em> <a class="reference internal" href="nx.html#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.nxtk_opentoolbar" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a tool bar at the top of the specified framed
window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>height</strong> – The requested height of the toolbar in pixels.</p></li>
<li><p><strong>cb</strong> – Callbacks used to process toolbar events.</p></li>
<li><p><strong>arg</strong> – User provided value that will be returned with toolbar callbacks.</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.nxtk_closetoolbar">
int <code class="sig-name descname">nxtk_closetoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</em><span class="sig-paren">)</span>;<a class="headerlink" href="#c.nxtk_closetoolbar" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove the tool bar at the top of the specified framed
window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&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.nxtk_filltoolbar">
int <code class="sig-name descname">nxtk_filltoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_filltoolbar" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill the specified rectangle in the toolbar sub-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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>rect</strong> – The location within the toolbar window 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.nxtk_gettoolbar">
int <code class="sig-name descname">nxtk_gettoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_gettoolbar" 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>rect</strong> – The location within the toolbar window to be retrieved.</p></li>
<li><p><strong>plane</strong> – TSpecifies the color plane to get from.</p></li>
<li><p><strong>dest</strong> – TThe 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.nxtk_filltraptoolbar">
int <code class="sig-name descname">nxtk_filltraptoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_filltraptoolbar" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill the specified trapezoid in the toolbar sub-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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</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.nxtk_drawlinetoolbar">
int <code class="sig-name descname">nxtk_drawlinetoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_drawlinetoolbar" title="Permalink to this definition"></a><br /></dt>
<dd><p>Fill the specified line in the toolbar sub-window with
the specified color. This is simply a wrapper that uses
<code class="docutils literal notranslate"><span class="pre">nxgl_splitline()</span></code> to break the line into trapezoids and then calls
<code class="docutils literal notranslate"><span class="pre">nxtk_filltraptoolbar()</span></code> 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</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-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/* Line caps */</span>
<span class="cp">#define NX_LINECAP_NONE 0x00, </span><span class="cm">/* No line caps */</span><span class="cp"></span>
<span class="cp">#define NX_LINECAP_PT1 0x01 </span><span class="cm">/* Line cap on pt1 on of the vector only */</span><span class="cp"></span>
<span class="cp">#define NX_LINECAP_PT2 0x02 </span><span class="cm">/* Line cap on pt2 on of the vector only */</span><span class="cp"></span>
<span class="cp">#define NX_LINECAP_BOTH 0x03 </span><span class="cm">/* Line cap on both ends of the vector only */</span><span class="cp"></span>
</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.nxtk_drawcircletoolbar">
int <code class="sig-name descname">nxtk_drawcircletoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_drawcircletoolbar" 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</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.nxtk_fillcircletoolbar">
int <code class="sig-name descname">nxtk_fillcircletoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="nx.html#c.NXWINDOW" title="NXWINDOW">NXWINDOW</a> <em>hfwnd</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.nxtk_fillcircletoolbar" 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>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</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.nxtk_movetoolbar">
int <code class="sig-name descname">nxtk_movetoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_movetoolbar" title="Permalink to this definition"></a><br /></dt>
<dd><p>Move a rectangular region within the toolbar sub-window
of a framed window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle identifying sub-window containing the toolbar within which
the move is to be done. This handle must have previously been
returned by <code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>rect</strong> – Describes the rectangular region relative to the toolbar sub-window
to move.</p></li>
<li><p><strong>offset</strong> – The offset to move the region</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.nxtk_bitmaptoolbar">
int <code class="sig-name descname">nxtk_bitmaptoolbar</code><span class="sig-paren">(</span><a class="reference internal" href="#c.NXTKWINDOW" title="NXTKWINDOW">NXTKWINDOW</a> <em>hfwnd</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.nxtk_bitmaptoolbar" title="Permalink to this definition"></a><br /></dt>
<dd><p>Copy a rectangular region of a larger image into the
rectangle in the specified toolbar sub-window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hfwnd</strong> – A handle previously returned by
<code class="docutils literal notranslate"><span class="pre">`nxtk_openwindow()</span></code> &lt;#nxtkopenwindow&gt;`__.</p></li>
<li><p><strong>dest</strong> – Describes the rectangular region on in the toolbar sub-window will
receive the bit map.</p></li>
<li><p><strong>src</strong> – The start of the source image.</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 sub-window coordinates, however, the origin
may lie outside of the sub-window 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>
<span class="target" id="nx-fonts-support-nxfonts-1"></span></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>