Commit 62ae8c93 authored by David O'Toole's avatar David O'Toole

revise

parent 8f85a81b
This diff is collapsed.
doc/class-diagram.png

89.6 KB | W: | H:

doc/class-diagram.png

112 KB | W: | H:

doc/class-diagram.png
doc/class-diagram.png
doc/class-diagram.png
doc/class-diagram.png
  • 2-up
  • Swipe
  • Onion skin
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2017-04-12 Wed 16:47 -->
<!-- 2017-04-13 Thu 06:01 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Xelf: The Graphical User Interface Toolkit</title>
......@@ -308,7 +308,7 @@ for the JavaScript code in this tag.
<ul>
<li><a href="#orgdbfedaf">Overview</a></li>
<li><a href="#org3f85182">Package declaration</a></li>
<li><a href="#org65ce9b7">Buffer wrapper class</a>
<li><a href="#org561cbef">Buffer class</a>
<ul>
<li><a href="#orgf3bc667">Class declaration</a></li>
<li><a href="#org8d9f508">Initialization</a></li>
......@@ -355,15 +355,15 @@ for the JavaScript code in this tag.
<li><a href="#orgeda495b">Data entry prompt</a></li>
<li><a href="#org897bacb">System terminal</a></li>
<li><a href="#org6c5a725">Rendering Smalltalk style controls</a></li>
<li><a href="#org1e84110">Layout</a></li>
<li><a href="#orgc8c5c02">Duplicating a node&#xa0;&#xa0;&#xa0;<span class="tag"><span class="ccl">ccl</span>&#xa0;<span class="sbcl">sbcl</span></span></a></li>
<li><a href="#org826bf0b">Layout</a></li>
<li><a href="#orgc8c5c02">Duplicating a node&#xa0;&#xa0;&#xa0;<span class="tag"><span class="ccl">ccl</span>&#xa0;<span class="sbcl">sbcl</span>&#xa0;<span class="ecl">ecl</span></span></a></li>
<li><a href="#org1dfda0a">Visual Lisp lists</a>
<ul>
<li><a href="#orgf62e941">Phrase class</a></li>
<li><a href="#org692626f">Manipulability</a></li>
<li><a href="#orgd511959">Orientation</a></li>
<li><a href="#org6b6c188">Inputs</a></li>
<li><a href="#org826bf0b">Layout</a></li>
<li><a href="#org7108c4c">Layout</a></li>
<li><a href="#org896c5ce">Phrase / S-expression correspondence</a></li>
</ul>
</li>
......@@ -448,6 +448,19 @@ before creating your buffer:
<p>
Then create your buffer and press Alt-X to enter the Shell.
</p>
<p>
It is also recommended to set
</p>
<pre class="example">
(setf xelf:*scale-output-to-window* nil)
</pre>
<p>
before opening your game window, so that enlarging the window shows
more of the buffer.
</p>
</div>
</div>
......@@ -461,15 +474,15 @@ Then create your buffer and press Alt-X to enter the Shell.
</div>
</div>
<div id="outline-container-org65ce9b7" class="outline-2">
<h2 id="org65ce9b7">Buffer wrapper class</h2>
<div class="outline-text-2" id="text-org65ce9b7">
<div id="outline-container-org561cbef" class="outline-2">
<h2 id="org561cbef">Buffer class</h2>
<div class="outline-text-2" id="text-org561cbef">
<p>
The basic QBUFFER class (defined above) covers collision detection and
updating; here we implement a wrapper class with more
functionality. The class BUFFER includes graphics utilities, smooth
scrolling/zooming, drag-and-drop GUI and map editing functionality
(experimental, see GUI section below.)
The basic QBUFFER class (defined in the <a href="xelf.html">parent document</a>) covers
collision detection and updating; here we implement a wrapper class
with more functionality. The class BUFFER includes graphics utilities,
smooth scrolling/zooming, drag-and-drop GUI and map editing
functionality (experimental, see GUI section below.)
</p>
<p>
......@@ -3340,9 +3353,9 @@ hybrid GUI inspired by MIT Scratch and its derivatives.
</div>
</div>
<div id="outline-container-org1e84110" class="outline-2">
<h2 id="org1e84110">Layout</h2>
<div class="outline-text-2" id="text-org1e84110">
<div id="outline-container-org826bf0b" class="outline-2">
<h2 id="org826bf0b">Layout</h2>
<div class="outline-text-2" id="text-org826bf0b">
<div class="org-src-container">
<pre class="src src-lisp"> (<span style="color: #f47321;">defmethod</span> <span style="color: #9370db;">draw-ghost</span> ((self node))
(<span style="color: #f47321;">with-slots</span> (x y width height) self
......@@ -3503,8 +3516,15 @@ hybrid GUI inspired by MIT Scratch and its derivatives.
</div>
<div id="outline-container-orgc8c5c02" class="outline-2">
<h2 id="orgc8c5c02">Duplicating a node&#xa0;&#xa0;&#xa0;<span class="tag"><span class="ccl">ccl</span>&#xa0;<span class="sbcl">sbcl</span></span></h2>
<h2 id="orgc8c5c02">Duplicating a node&#xa0;&#xa0;&#xa0;<span class="tag"><span class="ccl">ccl</span>&#xa0;<span class="sbcl">sbcl</span>&#xa0;<span class="ecl">ecl</span></span></h2>
<div class="outline-text-2" id="text-orgc8c5c02">
<p>
We need some MOP (Meta-Object Protocol) tricks to make this work:
SLOT-DEFINITION-NAME and CLASS-SLOTS. The block below uses conditional
compilation directives to choose the right MOP package for each
supported compiler.
</p>
<div class="org-src-container">
<pre class="src src-lisp"> (<span style="color: #f47321;">defmethod</span> <span style="color: #9370db;">duplicate</span> ((node node) <span style="color: #83a525;">&amp;rest</span> initargs <span style="color: #83a525;">&amp;key</span> <span style="color: #83a525;">&amp;allow-other-keys</span>)
(<span style="color: #f47321;">let*</span> ((class (class-of node))
......@@ -3654,9 +3674,9 @@ hybrid GUI inspired by MIT Scratch and its derivatives.
</div>
</div>
<div id="outline-container-org826bf0b" class="outline-3">
<h3 id="org826bf0b">Layout</h3>
<div class="outline-text-3" id="text-org826bf0b">
<div id="outline-container-org7108c4c" class="outline-3">
<h3 id="org7108c4c">Layout</h3>
<div class="outline-text-3" id="text-org7108c4c">
<div class="org-src-container">
<pre class="src src-lisp"> (<span style="color: #f47321;">defmethod</span> <span style="color: #9370db;">header-height</span> ((self phrase)) 0)
......@@ -5854,7 +5874,7 @@ hybrid GUI inspired by MIT Scratch and its derivatives.
</div>
<div id="postamble" class="status">
<p class="author">Author: David O'Toole &lt;dto@xelf.me&gt;</p>
<p class="date">Created: 2017-04-12 Wed 16:47</p>
<p class="date">Created: 2017-04-13 Thu 06:01</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
......
This diff is collapsed.
......@@ -2874,7 +2874,12 @@ See sidebar for more commands to try.
(defmethod special-collision ((self node)) nil)
;; Layout:1 ends here
;; Duplicating a node :ccl:sbcl:
;; Duplicating a node :ccl:sbcl:ecl:
;; We need some MOP (Meta-Object Protocol) tricks to make this work:
;; SLOT-DEFINITION-NAME and CLASS-SLOTS. The block below uses conditional
;; compilation directives to choose the right MOP package for each
;; supported compiler.
;; [[file:~/xelf/gui.org::*Duplicating%20a%20node][Duplicating a node:1]]
......
......@@ -47,13 +47,13 @@ more of the buffer.
(in-package :xelf)
#+end_src
* Buffer wrapper class
* Buffer class
The basic QBUFFER class (defined above) covers collision detection and
updating; here we implement a wrapper class with more
functionality. The class BUFFER includes graphics utilities, smooth
scrolling/zooming, drag-and-drop GUI and map editing functionality
(experimental, see GUI section below.)
The basic QBUFFER class (defined in the [[file:xelf.html][parent document]]) covers
collision detection and updating; here we implement a wrapper class
with more functionality. The class BUFFER includes graphics utilities,
smooth scrolling/zooming, drag-and-drop GUI and map editing
functionality (experimental, see GUI section below.)
The buffers you create should all subclass from BUFFER. (Notice that
every BUFFER is also a NODE.)
......@@ -2884,7 +2884,12 @@ hybrid GUI inspired by MIT Scratch and its derivatives.
(defmethod special-collision ((self node)) nil)
#+end_src
* Duplicating a node :ccl:sbcl:
* Duplicating a node :ccl:sbcl:ecl:
We need some MOP (Meta-Object Protocol) tricks to make this work:
SLOT-DEFINITION-NAME and CLASS-SLOTS. The block below uses conditional
compilation directives to choose the right MOP package for each
supported compiler.
#+begin_src lisp
(defmethod duplicate ((node node) &rest initargs &key &allow-other-keys)
......
......@@ -1253,7 +1253,7 @@ Returns a newly allocated list."
(southeast :initform nil :accessor quadtree-southeast :initarg :southeast)))
;; Data structure:1 ends here
;; Object base class for collidables
;; Quadrille: base class for collidable objects
;; A QUADRILLE is an object which maintains a constant relationship to
;; the currently active quadtree. With the classes QUADTREE and QUADRILLE
......@@ -1261,7 +1261,7 @@ Returns a newly allocated list."
;; [[file:dictionary/_QUADTREE_.html][*QUADTREE*]] and the section "Object base class operations" below.
;; [[file:~/xelf/xelf.org::*Object%20base%20class%20for%20collidables][Object base class for collidables:1]]
;; [[file:~/xelf/xelf.org::*Quadrille:%20base%20class%20for%20collidable%20objects][Quadrille: base class for collidable objects:1]]
(defclass quadrille ()
((quadtree-node :initform nil :initarg :quadtree-node :accessor quadtree-node)
(collision-type :initform t :initarg :collision-type :accessor collision-type)
......@@ -1275,7 +1275,7 @@ Returns a newly allocated list."
(last-x :initform nil :accessor last-x)
(last-y :initform nil :accessor last-y)
(last-z :initform nil :accessor last-z)))
;; Object base class for collidables:1 ends here
;; Quadrille: base class for collidable objects:1 ends here
;; Finding collidable objects by UUID
......@@ -3358,7 +3358,7 @@ Returns a newly allocated list."
`(defresource ,@entries))
;; Defining resources with DEFRESOURCE:1 ends here
;; TODO Project utilities
;; Project utilities
;; [[file:~/xelf/xelf.org::*Project%20utilities][Project utilities:1]]
......@@ -5188,7 +5188,7 @@ Returns a newly allocated list."
(shut-down)))
;; Shutdown:1 ends here
;; Node wrapper class
;; Node class
;; The NODE class builds upon the basic collidable object QUADRILLE
;; defined above. NODE adds event keybindings, extended graphics property
......@@ -5202,7 +5202,7 @@ Returns a newly allocated list."
;; subclasses.)
;; [[file:~/xelf/xelf.org::*Node%20wrapper%20class][Node wrapper class:1]]
;; [[file:~/xelf/xelf.org::*Node%20class][Node class:1]]
(defclass node (quadrille)
((tags :initform nil :accessor tags :initarg :tags)
(events :initform nil :accessor events :initarg :events :documentation "Event bindings, if any. See also `bind-event'.")
......@@ -5241,7 +5241,7 @@ Returns a newly allocated list."
(tasks :initform nil)
(read-only :initform nil :accessor read-only :initarg :read-only)
(image :initform nil :accessor image :initarg :image :documentation "Name of texture to be displayed, if any.")))
;; Node wrapper class:1 ends here
;; Node class:1 ends here
;; Destruction
......
......@@ -50,7 +50,8 @@ tags.
The following diagram shows the inheritance hierarchy for most of the
classes in Xelf. It may be useful to refer back to this diagram when
reading about the classes' implementations.
reading about the classes' implementations. You may also visit the [[file:class-diagram-paths-only.svg][SVG
(Scalable Vector Graphic) version]].
file:class-diagram.png
......@@ -1288,7 +1289,7 @@ bounding box will automatically trigger its re-insertion into the
quadtree at the proper bucket location.
(This is handled transparently by all objects in the wrapper class
NODE. See "Node wrapper class" below.)
NODE. See "Node class" below.)
** The active quadtree
......@@ -1326,7 +1327,7 @@ nodes.
(southeast :initform nil :accessor quadtree-southeast :initarg :southeast)))
#+end_src
** Object base class for collidables
** Quadrille: base class for collidable objects
A QUADRILLE is an object which maintains a constant relationship to
the currently active quadtree. With the classes QUADTREE and QUADRILLE
......@@ -1600,7 +1601,7 @@ pressing Alt-X.
,@body))
#+end_src
* Buffer base class
* QBuffer: base class for groups of colliding objects
The base class QBUFFER implements a collection of QUADRILLE objects
and collides them within an associated quadtree. (Later we will
......@@ -1790,7 +1791,7 @@ them into the quadtree system by managing QUADRILLE objects.
,@body)))))
#+end_src
* Object base class operations
* Quadrille operations
** Using UUIDs
......@@ -3376,7 +3377,7 @@ increases.
#+end_src
** TODO Project utilities
** Project utilities
#+begin_src lisp
(defun directory-samples (dir)
......@@ -5180,7 +5181,7 @@ See also the included file "xelf/standard/index.xelf".
(shut-down)))
#+end_src
* Node wrapper class
* Node class
The NODE class builds upon the basic collidable object QUADRILLE
defined above. NODE adds event keybindings, extended graphics property
......@@ -6135,9 +6136,9 @@ See the section on Pathfinding below.
;; defclass lower-command
#+end_src
* Buffer wrapper class
* Buffer class
The Buffer wrapper class documentation continues in on the [[file:gui.html][GUI page]].
The Buffer class documentation continues on the [[file:gui.html][GUI page]].
* Graphical User Interface
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment