Thun/docs/VUI-docs/build/html/core.html

234 lines
15 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Core &#8212; Joy VUI 0.1 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Display" href="display.html" />
<link rel="prev" title="Welcome to Joy VUIs documentation!" href="index.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<span class="target" id="module-joy.vui.core"></span><div class="section" id="core">
<h1>Core<a class="headerlink" href="#core" title="Permalink to this headline"></a></h1>
<p>The core module defines a bunch of system-wide “constants” (some colors
and PyGame event groups), the message classes for Oberon-style message
passing, a “world” class that holds the main context for the system, and
a mainloop class that manages the, uh, main loop (the PyGame event queue.)</p>
<dl class="data">
<dt id="joy.vui.core.ARROW_KEYS">
<code class="descclassname">joy.vui.core.</code><code class="descname">ARROW_KEYS</code><em class="property"> = frozenset([273, 274, 275, 276])</em><a class="headerlink" href="#joy.vui.core.ARROW_KEYS" title="Permalink to this definition"></a></dt>
<dd><p>PyGame arrow key events.</p>
</dd></dl>
<dl class="data">
<dt id="joy.vui.core.AVAILABLE_TASK_EVENTS">
<code class="descclassname">joy.vui.core.</code><code class="descname">AVAILABLE_TASK_EVENTS</code><em class="property"> = set([24, 25, 26, 27, 28, 29, 30, 31])</em><a class="headerlink" href="#joy.vui.core.AVAILABLE_TASK_EVENTS" title="Permalink to this definition"></a></dt>
<dd><p>Task IDs that have not been assigned to a task.</p>
</dd></dl>
<dl class="class">
<dt id="joy.vui.core.CommandMessage">
<em class="property">class </em><code class="descclassname">joy.vui.core.</code><code class="descname">CommandMessage</code><span class="sig-paren">(</span><em>sender</em>, <em>command</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#CommandMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.CommandMessage" title="Permalink to this definition"></a></dt>
<dd><p>For commands, adds <code class="docutils literal notranslate"><span class="pre">command</span></code> field.</p>
</dd></dl>
<dl class="data">
<dt id="joy.vui.core.MOUSE_EVENTS">
<code class="descclassname">joy.vui.core.</code><code class="descname">MOUSE_EVENTS</code><em class="property"> = frozenset([4, 5, 6])</em><a class="headerlink" href="#joy.vui.core.MOUSE_EVENTS" title="Permalink to this definition"></a></dt>
<dd><p>PyGame mouse events.</p>
</dd></dl>
<dl class="class">
<dt id="joy.vui.core.Message">
<em class="property">class </em><code class="descclassname">joy.vui.core.</code><code class="descname">Message</code><span class="sig-paren">(</span><em>sender</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#Message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.Message" title="Permalink to this definition"></a></dt>
<dd><p>Message base class. Contains <code class="docutils literal notranslate"><span class="pre">sender</span></code> field.</p>
</dd></dl>
<dl class="class">
<dt id="joy.vui.core.ModifyMessage">
<em class="property">class </em><code class="descclassname">joy.vui.core.</code><code class="descname">ModifyMessage</code><span class="sig-paren">(</span><em>sender</em>, <em>subject</em>, <em>**details</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#ModifyMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.ModifyMessage" title="Permalink to this definition"></a></dt>
<dd><p>For when resources are modified, adds <code class="docutils literal notranslate"><span class="pre">subject</span></code> and <code class="docutils literal notranslate"><span class="pre">details</span></code>
fields.</p>
</dd></dl>
<dl class="class">
<dt id="joy.vui.core.OpenMessage">
<em class="property">class </em><code class="descclassname">joy.vui.core.</code><code class="descname">OpenMessage</code><span class="sig-paren">(</span><em>sender</em>, <em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#OpenMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.OpenMessage" title="Permalink to this definition"></a></dt>
<dd><p>For when resources are modified, adds <code class="docutils literal notranslate"><span class="pre">name</span></code>, content_id``,
<code class="docutils literal notranslate"><span class="pre">status</span></code>, and <code class="docutils literal notranslate"><span class="pre">traceback</span></code> fields.</p>
</dd></dl>
<dl class="class">
<dt id="joy.vui.core.PersistMessage">
<em class="property">class </em><code class="descclassname">joy.vui.core.</code><code class="descname">PersistMessage</code><span class="sig-paren">(</span><em>sender</em>, <em>content_id</em>, <em>**details</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#PersistMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.PersistMessage" title="Permalink to this definition"></a></dt>
<dd><p>For when resources are modified, adds <code class="docutils literal notranslate"><span class="pre">content_id</span></code> and <code class="docutils literal notranslate"><span class="pre">details</span></code>
fields.</p>
</dd></dl>
<dl class="class">
<dt id="joy.vui.core.ShutdownMessage">
<em class="property">class </em><code class="descclassname">joy.vui.core.</code><code class="descname">ShutdownMessage</code><span class="sig-paren">(</span><em>sender</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#ShutdownMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.ShutdownMessage" title="Permalink to this definition"></a></dt>
<dd><p>Signals that the system is shutting down.</p>
</dd></dl>
<dl class="data">
<dt id="joy.vui.core.TASK_EVENTS">
<code class="descclassname">joy.vui.core.</code><code class="descname">TASK_EVENTS</code><em class="property"> = (24, 25, 26, 27, 28, 29, 30, 31)</em><a class="headerlink" href="#joy.vui.core.TASK_EVENTS" title="Permalink to this definition"></a></dt>
<dd><p>Keep track of all possible task events.</p>
</dd></dl>
<dl class="class">
<dt id="joy.vui.core.TheLoop">
<em class="property">class </em><code class="descclassname">joy.vui.core.</code><code class="descname">TheLoop</code><span class="sig-paren">(</span><em>display</em>, <em>clock</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#TheLoop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.TheLoop" title="Permalink to this definition"></a></dt>
<dd><p>The main loop manages tasks and the PyGame event queue
and framerate clock.</p>
<dl class="method">
<dt id="joy.vui.core.TheLoop.install_task">
<code class="descname">install_task</code><span class="sig-paren">(</span><em>F</em>, <em>milliseconds</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#TheLoop.install_task"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.TheLoop.install_task" title="Permalink to this definition"></a></dt>
<dd><p>Install a task to run every so many milliseconds.</p>
</dd></dl>
<dl class="method">
<dt id="joy.vui.core.TheLoop.loop">
<code class="descname">loop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#TheLoop.loop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.TheLoop.loop" title="Permalink to this definition"></a></dt>
<dd><p>The actual main loop machinery.</p>
<p>Maintain a <code class="docutils literal notranslate"><span class="pre">running</span></code> flag, pump the PyGame event queue and
handle the events (dispatching to the display), tick the clock.</p>
<p>When the loop is exited (by clicking the window close button or
pressing the <code class="docutils literal notranslate"><span class="pre">escape</span></code> key) it broadcasts a <code class="docutils literal notranslate"><span class="pre">ShutdownMessage</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="joy.vui.core.TheLoop.remove_task">
<code class="descname">remove_task</code><span class="sig-paren">(</span><em>task_event_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#TheLoop.remove_task"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.TheLoop.remove_task" title="Permalink to this definition"></a></dt>
<dd><p>Remove an installed task.</p>
</dd></dl>
<dl class="method">
<dt id="joy.vui.core.TheLoop.run_task">
<code class="descname">run_task</code><span class="sig-paren">(</span><em>task_event_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#TheLoop.run_task"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.TheLoop.run_task" title="Permalink to this definition"></a></dt>
<dd><p>Give a task its time to shine.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="joy.vui.core.World">
<em class="property">class </em><code class="descclassname">joy.vui.core.</code><code class="descname">World</code><span class="sig-paren">(</span><em>stack_id</em>, <em>stack_holder</em>, <em>dictionary</em>, <em>notify</em>, <em>log</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#World"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.World" title="Permalink to this definition"></a></dt>
<dd><p>This object contains the system context, the stack, dictionary, a
reference to the display broadcast method, and the log.</p>
<dl class="method">
<dt id="joy.vui.core.World.handle">
<code class="descname">handle</code><span class="sig-paren">(</span><em>message</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#World.handle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.World.handle" title="Permalink to this definition"></a></dt>
<dd><p>Deal with updates to the stack and commands.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="joy.vui.core.open_viewer_on_string">
<code class="descclassname">joy.vui.core.</code><code class="descname">open_viewer_on_string</code><span class="sig-paren">(</span><em>sender</em>, <em>content</em>, <em>notify</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#open_viewer_on_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.open_viewer_on_string" title="Permalink to this definition"></a></dt>
<dd><p>Helper function to open a text viewer on a string.
Typically used to show tracebacks.</p>
</dd></dl>
<dl class="function">
<dt id="joy.vui.core.push">
<code class="descclassname">joy.vui.core.</code><code class="descname">push</code><span class="sig-paren">(</span><em>sender</em>, <em>item</em>, <em>notify</em>, <em>stack_name='stack.pickle'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/vui/core.html#push"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.vui.core.push" title="Permalink to this definition"></a></dt>
<dd><p>Helper function to push an item onto the system stack with message.</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">Joy VUI</a></h1>
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Core</a></li>
<li class="toctree-l1"><a class="reference internal" href="display.html">Display</a></li>
<li class="toctree-l1"><a class="reference internal" href="viewer.html">Viewer</a></li>
<li class="toctree-l1"><a class="reference internal" href="text_viewer.html">Text Viewer</a></li>
<li class="toctree-l1"><a class="reference internal" href="stack_viewer.html">Stack Viewer</a></li>
<li class="toctree-l1"><a class="reference internal" href="persist_task.html">Persist Task</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">Welcome to Joy VUIs documentation!</a></li>
<li>Next: <a href="display.html" title="next chapter">Display</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, Simon Forman.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.5</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.9</a>
|
<a href="_sources/core.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>