ASDF & dispatch callback restarts --> to head
Sat Apr 3 21:12:53 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* KDE is split up in kde.ui and kde.core.
Sat Apr 3 21:12:32 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* C++ member variable access
Sun Jan 10 09:57:54 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* modular smoke.
Sun Dec 13 14:22:09 CET 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* remove mudballs
Wed Sep 2 14:08:06 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* cl-smoke now supports user conversions for return values.
Sun Aug 30 16:26:13 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Multiple inheritance doc & expand tabs in programmlisting.
Thu Aug 27 13:47:08 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Update for the new smokegenerator
Sun Aug 2 13:24:57 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Remove wrong note about cxx:meta-object
Thu Jul 23 00:59:59 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* add phonon repository
Thu Jul 23 00:53:41 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* phonon & :arg0
Mon Jul 6 23:51:20 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* OpenGL: origami
Fri Jul 3 00:28:43 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* cl-smoke.commonqt & Clozure CL support
Sun Jun 21 11:29:52 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Link Benchmark
Wed Jun 10 14:17:14 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* better Lisp source highlighting
Fri Jun 5 16:17:33 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Lisp syntax highlighting
Thu Jun 4 23:20:49 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* interactive development
Thu Jun 4 00:31:34 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* ASDF & dispatch callback restarts
diff -rN -u old-doc/Makefile new-doc/Makefile
--- old-doc/Makefile 2014-10-30 07:12:33.000000000 +0100
+++ new-doc/Makefile 2014-10-30 07:12:33.000000000 +0100
@@ -1,22 +1,36 @@
#
# Dependancies:
-# xmllint xsltproc docbook
+# - xmllint
+# - saxon
+# - docbook
+# - xslthl
#
+# Debian: download the xslthl jar into the doc/ directory; install the remaining dependancies with apt.
+#
+
+SAXON_JAR := /usr/share/java/saxon.jar
+XSLTHL_JAR := $(firstword $(wildcard xslthl*.jar))
+CLASSPATH := "$(SAXON_JAR):$(XSLTHL_JAR)"
+SAXON := java -classpath $(CLASSPATH) \
+ -Dxslthl.config="file://$(realpath xslthl-config.xml)" \
+ com.icl.saxon.StyleSheet
all: manual.html index.html
DEPENDANCIES := *.xml *.xsl ../qt.examples/src/*.lisp ../kde.examples/src/*.lisp *.dtd
-manual.html: $(DEPENDANCIES)
- xmllint --xinclude --postvalid manual.xml > /dev/null
- xsltproc --xinclude -o $@ manual.xsl manual.xml
-
-index.html: $(DEPENDANCIES)
-# xsltproc --xinclude --stringparam base.dir "manual/" chunk.xsl manual.xml
- xsltproc --xinclude chunk.xsl manual.xml
+# validate & process xincludes
+manual.tmp: $(DEPENDANCIES)
+ xmllint --xinclude --postvalid manual.xml > manual.tmp
+
+
+manual.html: manual.tmp
+ $(SAXON) -o manual.html manual.tmp manual.xsl
+
-
+index.html: manual.tmp
+ $(SAXON) manual.tmp chunk.xsl
.PHONY: clean
clean:
- rm -f -- *.html
+ rm -f -- *.html *.tmp
diff -rN -u old-doc/chunk.xsl new-doc/chunk.xsl
--- old-doc/chunk.xsl 2014-10-30 07:12:33.000000000 +0100
+++ new-doc/chunk.xsl 2014-10-30 07:12:33.000000000 +0100
@@ -2,13 +2,18 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/chunk.xsl"/>
-<xsl:import href="link-apidoc.xsl"/>
+<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl" />
+<xsl:import href="nonlink-apidoc.xsl" />
+
+<xsl:import href="video.xsl" />
+<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/highlight.xsl" />
+
+<xsl:param name="highlight.source" select="1" />
<!--
<xsl:param name="admon.graphics" select="1"/>
!-->
-<xsl:param name="use.id.as.filename" select="1"/>
+<xsl:param name="use.id.as.filename" select="1" />
</xsl:stylesheet>
Binary files old-doc/commonqt-t14.png and new-doc/commonqt-t14.png differ
diff -rN -u old-doc/introduction.xml new-doc/introduction.xml
--- old-doc/introduction.xml 2014-10-30 07:12:33.000000000 +0100
+++ new-doc/introduction.xml 2014-10-30 07:12:33.000000000 +0100
@@ -14,49 +14,61 @@
Lisp-CFFI-Qt4</ulink> (dead)</para></listitem>
</itemizedlist>
</section>
-<section><title>Status</title>
-<para>
-GUI creation should work and API will probably remain compatible.
-The next goal is to reorganize the argument conversion / overload resolution and to
-integrate more conversions between Lisp and C++ (<code>QList</code> etc.).
-</para>
-
-<section><title>Limitations</title>
+<section id="limitations"><title>Limitations</title>
<itemizedlist>
- <listitem><para>Limited conversions. E.g. <code>QList&lt;T&gt;</code> is missing.
- </para></listitem>
- <listitem><para>10 seconds startup time<footnote>
+ <listitem><para>Ownership transfer to / from C++ of non QObject objects is seldom known to cl-smoke.
+ E.g.: cl-smoke might delete an instance even though it is still needed by C++.
+ (One that is known is <ulink url="http://doc.qtsoftware.com/4.5-snapshot/qundostack.html#push">QUndoStack::push()</ulink>.)
+ </para></listitem>
+ <listitem><para>Limited conversions to and from C++. You will get an NO-APPLICABLE-CXX-METHOD error
+ when a Lisp to C++ conversion is missing and a pointer will be returned when there is no C++ to Lisp
+ conversion.
+ </para></listitem>
+ <listitem><para>6 seconds startup time<footnote>
<para>
- Using an image it is around 1 second.
+ Using a core image it is around 1 second.
(see <xref linkend="core-image"/>)
</para></footnote>
(for <package>qt.examples</package>) on a
- Pentium M 1.7GHz. (Compilation ~20 seconds)</para></listitem>
+ Pentium M 1.7GHz. </para></listitem>
<listitem><para>Needs to be recompiled when the Smoke library is updated.</para></listitem>
- <listitem><para>Does not recover well from errors
- <footnote><para>Thus you often need to restart the Lisp process
- during interactive development.</para></footnote>.</para></listitem>
- <listitem><para>No const-correctness</para></listitem>
+ <listitem><para>Could be faster</para></listitem>
</itemizedlist>
+<section><title>Performance</title>
+<para>
+Method calling is near 3000 times slower than native C++. The overhead is mainly in the overload
+resolution and to/from foreign object translation. Some measurements by
+<code><ulink url="http://tobias.rautenkranz.ch/darcsweb/darcsweb.cgi?r=cl-smoke/benchmark;a=summary">:cl-smoke.benchmark</ulink></code>
+are in
+<filename><ulink url="../benchmark.pdf">benchmark.pdf</ulink></filename>.
+</para>
</section>
</section>
-<section><title>Installation</title>
+<section id="installation"><title>Installation</title>
<section><title>Dependencies</title>
<itemizedlist>
<listitem><para><ulink
url="http://techbase.kde.org/Development/Languages/Smoke">Smoke2</ulink>
- bindings 4.2 or later</para></listitem>
+ bindings from svn.
+ <footnote><para>
+ The new smokegenerator is needed (developed by Arno Rehn for the GSOC 09).
+ </para></footnote>
+ </para></listitem>
<listitem><para><ulink url="http://qtsoftware.com">Qt</ulink>
(development package)</para></listitem>
<listitem><para>
<ulink url="http://cmake.org">CMake</ulink> 2.6
</para></listitem>
- <listitem><para>a make program (preferably Gnu Make)</para></listitem>
<listitem><para>a C++ compiler (GCC)</para></listitem>
</itemizedlist>
<para>
-On the Lisp side you need <ulink url="http://mudballs.com">mudballs</ulink>
-and <ulink url="http://tobias.rautenkranz.ch/lisp/sysdef.cmake">sysdef.cmake</ulink>.
+<itemizedlist>
+<listitem><para><ulink url="http://common-lisp.net/project/alexandria/">alexandria</ulink></para></listitem>
+<listitem><para><ulink url="http://common-lisp.net/project/bordeaux-threads/">bordeaux-threads</ulink></para></listitem>
+<listitem><para><ulink url="http://common-lisp.net/project/cffi/">cffi</ulink></para></listitem>
+<listitem><para><ulink url="http://common-lisp.net/project/closer/closer-mop.html">closer-mop</ulink></para></listitem>
+<listitem><para><ulink url="http://www.cliki.net/trivial-garbage">trivial-garbage</ulink></para></listitem>
+</itemizedlist>
</para>
</section>
@@ -66,14 +78,8 @@
<listitem><para>
<ulink url="http://www.sbcl.org">SBCL</ulink> on Linux x86 (and x86_64)
</para></listitem>
- </itemizedlist>
-</section>
-<section><title>Partial</title>
- <itemizedlist>
<listitem> <para>
- <ulink url="http://trac.clozure.com/openmcl">Clozure CL</ulink>
- <footnote><para>There are some test suite failures and
- it is to slow to be usable.</para></footnote>on Linux x86.
+ <ulink url="http://trac.clozure.com/openmcl">Clozure CL</ulink> on Linux x86.
</para></listitem>
</itemizedlist>
</section>
@@ -93,22 +99,31 @@
You need to checkout the darcs repositories:
<programlisting>
cd <userinput>SOME_DIR</userinput>
-for r in smoke qt qt.test qt.tests qt.examples qt.uitools qt.webkit kde kde.tests kde.examples; do
+for r in smoke qt.core qt.gui qt.network qt.test qt.tests qt.examples qt.uitools qt.webkit qt.phonon; do
darcs get "http://tobias.rautenkranz.ch/lisp/cl-smoke/$r"
done
</programlisting>
- Then add the directory <userinput>SOME_DIR</userinput> to the mudballs search paths by adding
- <programlisting>
-(push (wildcard-searcher "<userinput>SOME_DIR</userinput>/*/*.mbd")
- *custom-search-modules*)
- </programlisting>
- to <filename>~/.mudballs</filename>.
-</para>
-<note>
-<para>
- Loading the packages with <code>mb:load</code> compiles the C wrapper libraries as needed.
-</para>
-</note>
+ <note>
+ <para>
+ There are also the following repositories: qt.svg qt.dbus kde.core kde.ui kde.tests kde.examples
+ </para>
+ </note>
+ </para>
+ <para>
+ Build and install the <package>:smoke</package> and <package>:qt.core</package> C wrapper libraries with:
+ <informalexample>
+ <programlisting>cmake ./ &amp;&amp; make &amp;&amp; sudo make install</programlisting>
+ </informalexample>
+ in the <filename>smoke/</filename> and <filename>qt/</filename> directories.
+ </para>
+ <para>
+ When you have symlinked the <filename>.asd</filename> system files, you
+ should be able to load the systems. The system name has a
+ <code>:cl-smoke.</code> prefix. e.g.:
+ <informalexample>
+ <programlisting language="lisp">(asdf:oos 'asdf:load-op :cl-smoke.qt.examples) </programlisting>
+ </informalexample>
+ </para>
</section>
</section>
</chapter>
diff -rN -u old-doc/kde.xml new-doc/kde.xml
--- old-doc/kde.xml 2014-10-30 07:12:33.000000000 +0100
+++ new-doc/kde.xml 2014-10-30 07:12:33.000000000 +0100
@@ -4,19 +4,23 @@
<chapter id="kde">
<title>KDE</title>
<para>
-Besides the <package>:kde</package> package there
+To use the KDE libraries use the <package>:cl-smoke.kde.ui</package>
+(Depends on <package>:cl-smoke.kde.core</package>).
+</para>
+<para>
+Besides these packages there
is <package>:kde.tests</package> for the unit tests and
<package>:kde.examples</package> containing the examples.
</para>
-<section><title>Examples</title>
+<section id="kde_examples"><title>Examples</title>
<para>
The examples can be run with:
-<programlisting>
-(mb:load <package>:kde.examples</package>)
+<programlisting language="lisp">
+(asdf:oos 'asdf:load-op <package>:cl-smoke.kde.examples</package>)
</programlisting>
-An the running the function of the example; e.g.:
-<programlisting>
+And then running the function of the example; e.g.:
+<programlisting language="lisp">
(<methodname>kde.examples:mandelbrot</methodname>)
</programlisting>
</para>
diff -rN -u old-doc/lisp-hl.xml new-doc/lisp-hl.xml
--- old-doc/lisp-hl.xml 1970-01-01 01:00:00.000000000 +0100
+++ new-doc/lisp-hl.xml 2014-10-30 07:12:33.000000000 +0100
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Common Lisp highlighter for xslthl -->
+<highlighters>
+ <highlighter type="word">
+ <word>call-next-method</word>
+ <word>do-external-symbols</word>
+ <word>do</word>
+ <word>do*</word>
+ <word>eval-when</word>
+ <word>handler-bind</word>
+ <word>handler-case</word>
+ <word>in-package</word>
+ <word>let*</word>
+ <word>multiple-value-bind</word>
+ <word>restart-bind</word>
+ <word>restart-case</word>
+ <word>return-from</word>
+ <word>signal</word>
+ <word>unwind-protect</word>
+
+ <style>keyword</style>
+ <ignoreCase />
+ </highlighter>
+ <highlighter type="keywords">
+ <keyword>assert</keyword>
+ <keyword>block</keyword>
+ <keyword>case</keyword>
+ <keyword>catch</keyword>
+ <keyword>ccase</keyword>
+ <keyword>cerror</keyword>
+ <keyword>check-type</keyword>
+ <keyword>declaim</keyword>
+ <keyword>declare</keyword>
+ <keyword>defclass</keyword>
+ <keyword>defconstant</keyword>
+ <keyword>defgeneric</keyword>
+ <keyword>define-condition</keyword>
+ <keyword>defmacro</keyword>
+ <keyword>defmethod</keyword>
+ <keyword>defpackage</keyword>
+ <keyword>defparameter</keyword>
+ <keyword>defstruct</keyword>
+ <keyword>deftype</keyword>
+ <keyword>defun</keyword>
+ <keyword>defvar</keyword>
+ <keyword>dolist</keyword>
+ <keyword>dotimes</keyword>
+ <keyword>ecase</keyword>
+ <keyword>error</keyword>
+ <keyword>flet</keyword>
+ <keyword>go</keyword>
+ <keyword>if</keyword>
+ <keyword>labels</keyword>
+ <keyword>lambda</keyword>
+ <keyword>let</keyword>
+ <keyword>loop</keyword>
+ <keyword>proclaim</keyword>
+ <keyword>prog1</keyword>
+ <keyword>prog2</keyword>
+ <keyword>progn</keyword>
+ <keyword>progv</keyword>
+ <keyword>return</keyword>
+ <keyword>tagbody</keyword>
+ <keyword>throw</keyword>
+ <keyword>typecase</keyword>
+ <keyword>unless</keyword>
+ <keyword>warn</keyword>
+ <keyword>when</keyword>
+
+ <ignoreCase />
+ </highlighter>
+ <!-- with- -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=\()(\S+[:])?(with-\S+)</pattern>
+ <style>keyword</style>
+ </highlighter>
+
+ <!-- comments -->
+ <highlighter type="multiline-comment">
+ <start>#|</start>
+ <end>|#</end>
+ <style>comment</style>
+ </highlighter>
+ <highlighter type="oneline-comment">
+ ;
+ </highlighter>
+
+ <!-- string -->
+ <highlighter type="string">
+ <string>"</string>
+ <spanNewLines/>
+ </highlighter>
+
+ <!-- keyword package -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=[ \(])(:[^\s\)]+)</pattern>
+ <style>attribute</style>
+ </highlighter>
+
+ <!-- lambda list keywords -->
+ <highlighter type="word">
+ <word>&amp;allow-other-keys</word>
+ <word>&amp;aux</word>
+ <word>&amp;body</word>
+ <word>&amp;environment</word>
+ <word>&amp;key</word>
+ <word>&amp;optional</word>
+ <word>&amp;rest</word>
+ <word>&amp;whole</word>
+
+ <style>attribute</style>
+ <ignoreCase />
+ </highlighter>
+
+ <!-- emacs style highlighted names -->
+ <!-- defclass -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defclass\s)(\S+)</pattern>
+ <style>directive</style>
+ <flags>CASE_INSENSITIVE</flags>
+ </highlighter>
+ <!-- defun -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defun\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+ <!-- defmacro -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defmacro\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+ <!-- defgeneric -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defgeneric\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+ <!-- defmethod -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defmethod\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+ <!-- defvar -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defvar\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+ <!-- defparameter -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defparameter\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+ <!-- defparameter -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defconstant\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+ <!-- defstruct -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=defstruct\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+ <!-- define-condition -->
+ <highlighter type="regex">
+ <pattern>(?&lt;=define-condition\s)(\S+)</pattern>
+ <style>directive</style>
+ </highlighter>
+</highlighters>
diff -rN -u old-doc/manual.xsl new-doc/manual.xsl
--- old-doc/manual.xsl 2014-10-30 07:12:33.000000000 +0100
+++ new-doc/manual.xsl 2014-10-30 07:12:33.000000000 +0100
@@ -2,7 +2,13 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl"/>
-<xsl:import href="link-apidoc.xsl"/>
+<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl"/>
+<xsl:import href="nonlink-apidoc.xsl"/>
+
+<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/highlight.xsl"/>
+
+<xsl:import href="video.xsl" />
+
+<xsl:param name="highlight.source" select="1"/>
</xsl:stylesheet>
diff -rN -u old-doc/nonlink-apidoc.xsl new-doc/nonlink-apidoc.xsl
--- old-doc/nonlink-apidoc.xsl 1970-01-01 01:00:00.000000000 +0100
+++ new-doc/nonlink-apidoc.xsl 2014-10-30 07:12:33.000000000 +0100
@@ -0,0 +1,41 @@
+<?xml version='1.0'?>
+<!--
+Copyright 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+!-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+
+<xsl:template match="macro">
+ <xsl:call-template name="ulink">
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="genericfunction">
+ <xsl:call-template name="ulink">
+ </xsl:call-template>
+</xsl:template>
+
+</xsl:stylesheet>
Binary files old-doc/origami.ogg and new-doc/origami.ogg differ
Binary files old-doc/origami.png and new-doc/origami.png differ
diff -rN -u old-doc/qt.xml new-doc/qt.xml
--- old-doc/qt.xml 2014-10-30 07:12:33.000000000 +0100
+++ new-doc/qt.xml 2014-10-30 07:12:33.000000000 +0100
@@ -4,26 +4,40 @@
<chapter id="qt">
<title>Qt</title>
<para>
-Besides the <package>:qt</package> there are these packages: with
+Besides the <package>:cl-smoke.qt.gui</package> there are these modules:
<itemizedlist>
- <listitem><para>
- <package>:qt.uitools</package>
- <ulink url="http://doc.trolltech.com/4.5/qtuitools.html">
- QtUiTools</ulink></para></listitem>
- <listitem><para><package>:qt.test</package>
- <ulink url="http://doc.trolltech.com/4.5/qttest.html">
- QtTest</ulink></para></listitem>
- <listitem><para><package>:qt.webkit</package>
- <ulink url="http://doc.trolltech.com/4.5/qtwebkit.html">
- QtWebKit</ulink>
- </para></listitem>
+ <listitem><para>
+ <package>:cl-smoke.qt.uitools</package>
+ <ulink url="http://doc.trolltech.com/4.5/qtuitools.html">
+ QtUiTools</ulink></para></listitem>
+ <listitem><para><package>:cl-smoke.qt.test</package>
+ <ulink url="http://doc.trolltech.com/4.5/qttest.html">
+ QtTest</ulink></para></listitem>
+ <listitem><para><package>:cl-smoke.qt.webkit</package>
+ <ulink url="http://doc.trolltech.com/4.5/qtwebkit.html">
+ QtWebKit</ulink>
+ </para></listitem>
+ <listitem><para><package>:cl-smoke.qt.phonon</package>
+ <ulink url="http://doc.trolltech.com/4.5/phonon.html">
+ Phonon</ulink>
+ </para></listitem>
+ <listitem><para><package>:cl-smoke.qt.network</package>
+ The network classes of Qt.
+ </para></listitem>
+ <listitem><para><package>:cl-smoke.qt.core</package>
+ the nogui Qt core.
+ </para></listitem>
</itemizedlist>
-which provide bindings for their Qt module.
-Additionally there is the <package>:qt.tests</package> system, containing
-the unit tests and <package>:qt.examples</package> for various examples.
+which provide bindings for their Qt module. The class names of this modules are in
+the <package>:qt</package> package. (E.g. Phonon::VideoPlayer is <code>'qt:phonon.video-player</code>
+and QTest is <code>'qt:test</code>)
+</para>
+<para>
+Additionally there is the <package>:cl-smoke.qt.tests</package> system, containing
+the unit tests and <package>:cl-smoke.qt.examples</package> for various examples.
</para>
-<section><title>qt:application</title>
+<section id="qapplication"><title>qt:application</title>
<para>
The <classname>qt:application</classname> object should created with:
<macro>qt:with-app</macro>. In its body the event loop can be
@@ -34,17 +48,41 @@
<screenshot>
<mediaobject>
<imageobject>
- <imagedata fileref="hello-world.png" format="PNG"/>
+ <imagedata fileref="hello-world.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
<programlisting language="lisp">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../qt.examples/src/hello-world.lisp" parse="text" />
-</programlisting>
+</programlisting>
</example>
+<para>
+Subclasses of <classname>qt:paint-device</classname> (e.g. <classname>qt:widget</classname>) can only be used when
+a <classname>qt:application</classname> instance exists. When there are, for example, <classname>qt:widget</classname> instances
+at the end of <macro>qt:with-app</macro>, they are deleted by the <classname>qt:application</classname> destructor.
+</para>
+<para>
+Custom <methodname>cxx:paint-event</methodname> methods can use <macro>qt:with-painter</macro>
+to ensure that the <classname>qt:painter</classname> is deactivated at the end of the method.
+</para>
+
+<section><title>Interactive Development</title>
+<para>
+The <package>:cl-smoke.repl</package> allows you to start a <classname>qt:application</classname> event loop in the background for
+interactive development in SLIME.
+To start the event loop use <methodname>cl-smoke.repl:start-event-loop-in-background</methodname> (or
+<methodname>cl-smoke.repl:start-event-loop-in-repl</methodname>).
+<footnote>
+<para>
+Currently <code>START-EVENT-LOOP-IN-BACKGROUND</code> is recommended.
+</para>
+</footnote>
+As long as you do not kill the thread or unwind over a foreign function, you should be fine.
+</para>
+</section>
</section>
-<section><title>Signal-Slot</title>
+<section id="signal_slot"><title>Signal-Slot</title>
<para>
<genericfunction>qt:connect</genericfunction> connects a signal to a slot.
The signal is either a <classname>qt:qsignal</classname> created with
@@ -54,14 +92,15 @@
or a C++ slot a return from <methodname>qt:get-slot</methodname>.
</para>
<example><title>Quit</title>
-<programlisting>
+<programlisting language="lisp">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../qt.examples/src/hello-world-quit.lisp" parse="text" />
</programlisting>
</example>
<para>
When the argument types for a slot or signal are not specified they are determined when
the first connection is made. Note that when connecting a <classname>qt:qsignal</classname>
-to a <classname>qt:qslot</classname> at least one must have its arguments types specified.
+to a <classname>qt:qslot</classname> at least one must have its arguments types specified. Type specifier <code>T</code>
+allows to pass a Lisp object as is from a Lisp signal to a Lisp slot.
</para>
<para>
@@ -70,23 +109,24 @@
</para>
</section>
-<section><title>Properties</title>
+<section id="properties"><title>Properties</title>
<para>
<classname>qt:object</classname> properties can be accessed with
<methodname>qt:property</methodname> (setf-able).
The name of the property can be either a string in C++ style or a symbol in Lisp style.
+The predefined Qt properties can be accessed with symbols in the keyword package.
</para>
<informalexample>
-<programlisting>
+<programlisting language="lisp">
(let ((object (make-instance '<classname>qt:object</classname>)))
- (setf (<methodname>qt:property</methodname> object 'object-name) "Foo")
- (assert (string= "Foo" (<methodname>qt:property</methodname> object "objectName"))))
+ (setf (<methodname>qt:property</methodname> object :object-name) "Foo")
+ (assert (string= "Foo" (<methodname>qt:property</methodname> object "objectName"))))
</programlisting>
</informalexample>
</section>
-<section><title>Variant</title>
+<section id="variant"><title>Variant</title>
<para>
A <classname>qt:variant</classname> can be constructed with <methodname>qt:make-variant</methodname>
or to pass a Lisp object with <methodname>qt:make-lisp-variant</methodname>.
@@ -94,7 +134,7 @@
</para>
</section>
-<section><title>i18n</title>
+<section id="i18n"><title>i18n</title>
<para>
You can use <methodname>qt:tr</methodname> to translate strings.
</para>
@@ -103,22 +143,22 @@
<screenshot>
<mediaobject>
<imageobject>
- <imagedata fileref="i18n-hello-world.png" format="PNG"/>
+ <imagedata fileref="i18n-hello-world.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
-<programlisting language="po">
+<programlisting language="lisp">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../qt.examples/src/i18n-hello-world.lisp" parse="text" />
-</programlisting>
+</programlisting>
<formalpara>
<title><filename>hello-world_de.po</filename></title>
<para>
<programlisting language="po">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../qt.examples/src/hello-world_de.po" parse="text" />
-</programlisting>
+</programlisting>
</para>
</formalpara>
</example>
@@ -127,15 +167,15 @@
Gettext is used to extract the i18n strings and compile the message catalog.
See <filename><ulink url="../qt.examples/src/CMakeLists.txt">CMakeLists.txt</ulink></filename>
and <filename><ulink url="../qt.examples/src/UseClQti18n.cmake">UseClQti18n.cmake</ulink></filename>
-in the <filename class="directory">src</filename> directory of <package>:qt.examples</package> how to do this.
+in the <filename class="directory">src/</filename> directory of <package>:cl-smoke.qt.examples</package> on how to do this.
</para>
</section>
-<section><title>Examples</title>
+<section id="qt_examples"><title>Examples</title>
<para>
You can run the examples with:
-<programlisting>
-(mb:load <package>:qt.examples</package>)
+<programlisting language="lisp">
+(asdf:oos 'asdf:load-op <package>:cl-smoke.qt.examples</package>)
(<methodname>qt.examples:launcher</methodname>)
</programlisting>
</para>
@@ -149,33 +189,60 @@
<screenshot>
<mediaobject>
<imageobject>
- <imagedata fileref="repl.png" format="PNG"/>
+ <imagedata fileref="repl.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
<programlisting language="lisp">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../qt.examples/src/repl.lisp" parse="text" />
-</programlisting>
+</programlisting>
</example>
<example>
<title>Class Browser</title>
-<para>Qt Classes browser using <package>:qt.webkit</package> to display the
+<para>Qt Classes browser using <package>:cl-smoke.qt.webkit</package> to display the
API doc and a custom <classname>qt:list-model</classname>
for the <classname>qt:list-view</classname> of the available classes.
</para>
<screenshot>
<mediaobject>
<imageobject>
- <imagedata fileref="class-browser.png" format="PNG"/>
+ <imagedata fileref="class-browser.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
<programlisting language="lisp">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../qt.examples/src/class-browser.lisp" parse="text" />
-</programlisting>
+</programlisting>
</example>
</section>
+<section id="opengl"><title>OpenGL</title>
+<para>
+For OpenGL a binding is needed (e.g.:
+<ulink url="http://common-lisp.net/project/cl-opengl/">cl-opengl</ulink>).
+</para>
+<example><title>Origami</title>
+<para>
+<ulink url="http://tobias.rautenkranz.ch/darcsweb/darcsweb.cgi?r=cl-smoke/qt.examples;a=tree;f=/src/origami">Origami</ulink>
+draws a pleated hyperbolic paraboloid using the method described in
+<ulink url="http://arxiv.org/abs/0906.4747">(Non)existence of Pleated Folds: How Paper Folds Between Creases</ulink>
+</para>
+<mediaobject>
+<videoobject>
+<videodata fileref='origami.ogg'/>
+</videoobject>
+</mediaobject>
+<para>
+<note>
+<para>
+<ulink url="http://axiom-wiki.newsynthesis.org/FrontPage">Axiom</ulink> is needed to generate the lisp source to that
+calculates the vertices.
+</para>
+</note>
+</para>
+</example>
+</section>
+
</chapter>
diff -rN -u old-doc/smoke.xml new-doc/smoke.xml
--- old-doc/smoke.xml 2014-10-30 07:12:33.000000000 +0100
+++ new-doc/smoke.xml 2014-10-30 07:12:33.000000000 +0100
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="smoke">
+<chapter id="usage">
<title>Usage</title>
<para></para>
<section><title>Symbols</title>
@@ -10,82 +10,100 @@
to <code>camel-case</code>. Underscores <code>#\_</code> are replaced with
<code>#\-</code> and a leading uppercase K or Q is removed.
</para>
+<informalexample>
<para>
E.g.: <code>QHelloWorld_foo</code> becomes <code>hello-world-foo</code>.
</para>
+</informalexample>
</section>
-<section><title>Class</title>
+<section id="classes"><title>Class</title>
<para>
C++ classes have a corresponding CLOS class. The can be used like any CLOS class; E.g:
to make a <code>QObject</code> instance:
<informalexample>
-<programlisting>
+<programlisting language="lisp">
(make-instance '<classname>qt:object</classname>)
</programlisting>
</informalexample>
Supply arguments as list to the <code>:args</code> keyword:
<informalexample>
-<programlisting>
+<programlisting language="lisp">
+(let ((parent (make-instance '<classname>qt:object</classname>)))
+ (make-instance '<classname>qt:object</classname> :args (list parent)))
+</programlisting>
+</informalexample>
+or use <code>:arg0</code>, <code>:arg1</code> and <code>:arg2</code>.
+<informalexample>
+<programlisting language="lisp">
(let ((parent (make-instance '<classname>qt:object</classname>)))
- (make-instance '<classname>qt:object</classname> :args (list parent)))
+ (make-instance '<classname>qt:object</classname> :arg0 parent))
</programlisting>
</informalexample>
</para>
<para>
To extend a C++ class you have to use <classname>cxx:class</classname> as metaclass:
<informalexample>
-<programlisting>
+<programlisting language="lisp">
(defclass my-object (<classname>qt:object</classname>)
- ()
- (:metaclass <classname>cxx:class</classname>))
+ ()
+ (:metaclass <classname>cxx:class</classname>))
+
+(make-instance 'my-object)
+</programlisting>
+</informalexample>
+The first superclass must be a Smoke class. When you define a class that has several Smoke superclasses,
+they will be constructed with their default constructor. For the first Smoke superclass you can supply arguments
+with the <code>:args</code> and <code>:arg0</code> etc. keywords.
+<informalexample>
+<programlisting language="lisp">
+(defclass my-graphics-object (<classname>qt:object</classname> <classname>qt:graphics-item</classname>)
+ ()
+ (:metaclass <classname>cxx:class</classname>))
</programlisting>
</informalexample>
</para>
</section>
-<section><title>Methods</title>
+<section id="methods"><title>Methods</title>
<para>
-C++ methods are generic functions in the <code>:cxx</code> package.
+C++ methods are generic functions in the <package>:cxx</package> package.
</para>
<para>
The C++ method call: <code>myInstance->frob(1);</code> is in Lisp:
<informalexample>
-<programlisting>(frob my-instance 1)</programlisting>
+<programlisting language="lisp">(frob my-instance 1)</programlisting>
</informalexample>
</para>
<section><title>Overload Resolution</title>
<para>
C++ style overload resolution with conversion sequences is supported. For example this:
<informalexample>
-<programlisting>
+<programlisting language="lisp">
(<genericfunction>cxx:set-pen</genericfunction> (make-instance '<classname>qt:painter</classname>) (make-instance '<classname>qt:color</classname> :args '("green")))
</programlisting>
</informalexample>
is equivalent to:
<informalexample>
-<programlisting>
+<programlisting language="lisp">
(<genericfunction>cxx:set-pen</genericfunction> (make-instance '<classname>qt:painter</classname>) "green")
</programlisting>
</informalexample>
In the second case a temporary <classname>qt:color</classname> instance is implicitly created.
</para>
-<para>
-User defined conversions for return values are currently not supported (in <code>defmethods</code>).
-</para>
</section>
<section><title>Setter Methods</title>
<para>
Instead of calling a setter method that takes no additional arguments,
<informalexample>
-<programlisting>
+<programlisting language="lisp">
(<genericfunction>cxx:set-object-name</genericfunction> (make-instance '<classname>qt:object</classname>) "foo")
</programlisting>
</informalexample>
you can use its <code>setf</code>able getter.
<informalexample>
-<programlisting>
+<programlisting language="lisp">
(setf (<genericfunction>cxx:object-name</genericfunction> (make-instance '<classname>qt:object</classname>)) "foo")
</programlisting>
</informalexample>
@@ -99,13 +117,13 @@
and <code>(call-next-method)</code> are supported.
</para>
<informalexample>
-<programlisting>(defclass the-object-does-nothing (<classname>qt:object</classname>)
- ()
- (:metaclass <classname>cxx:class</classname>))
+<programlisting language="lisp">(defclass the-object-does-nothing (<classname>qt:object</classname>)
+ ()
+ (:metaclass <classname>cxx:class</classname>))
(defmethod <genericfunction>cxx:timer-event</genericfunction> ((object the-object-does-nothing) event)
- (declare (ignore object event))
- (call-next-method))
+ (declare (ignore object event))
+ (call-next-method))
</programlisting>
</informalexample>
<para>
@@ -116,6 +134,21 @@
Make sure you have the right number of arguments when adding a method; otherwise it will
not be called.
</para></note>
+<caution><para>
+The arguments of the method might have dynamic extend; i.e.: they are only valid in the body of the method.
+</para></caution>
+<section><title>Condition</title>
+<para>
+Unwinding of the C++ stack is not supported. This means that you must not invoke a restart that skips any foreign function.
+You will most likely encounter this problem when an error is signaled in a virtual method you have overwritten.
+<footnote>
+<para>
+For example an event handler that is called from the C++ library.
+</para>
+</footnote>. For this case restarts are provide that allow to return a value for the failed method,
+call the default C++ implementation instead (something like <code>#'call-next-method</code>) or retry.
+</para>
+</section>
</section>
<section><title>Operators</title>
<para>
@@ -152,54 +185,60 @@
</section>
</section>
-<section><title>Static Methods</title>
+<section id="static_methods"><title>Static Methods</title>
<para>
The static C++ method <code>QByteArray::number(int n, int base=10)</code>
can be called by:
<informalexample>
-<programlisting>(<methodname>qt:byte-array.number</methodname> 37)</programlisting>
+<programlisting language="lisp">(<methodname>qt:byte-array.number</methodname> 37)</programlisting>
</informalexample>
which is equivalent to the C++ code <code>QByteArray::number(37);</code>.
Or with:
<informalexample>
-<programlisting>(<genericfunction>cxx:number</genericfunction> (find-class '<classname>qt:byte-array</classname>) 37)</programlisting>
+<programlisting language="lisp">(<genericfunction>cxx:number</genericfunction> (find-class '<classname>qt:byte-array</classname>) 37)</programlisting>
</informalexample>
or:
<informalexample>
-<programlisting>(<genericfunction>cxx:number</genericfunction> (make-instance '<classname>qt:byte-array</classname>) 37)</programlisting>
+<programlisting language="lisp">(<genericfunction>cxx:number</genericfunction> (make-instance '<classname>qt:byte-array</classname>) 37)</programlisting>
</informalexample>
</para>
</section>
-<section><title>Constants</title>
+<section id="constants"><title>Constants</title>
+<para>
+ C++ Class enums available as constants. E.g.:
+ <code>QColor::Rgb</code> is <constant>qt:color.+rgb+</constant>.
+ See <package>:cxx-support</package>.
+</para>
+</section>
+
+<section id="members"><title>Member variables</title>
<para>
- C++ Class enums available as constants. E.g.:
- <code>QColor::Rgb</code> is <constant>qt:color.+rgb+</constant>.
- See <package>:cxx-support</package>.
+C++ member variables of an instance can be accessed by using <code>slot-value</code>; e.g.:
+<informalexample>
+<programlisting language="lisp">(slot-value (make-instance 'qt:object) :static-meta-object)</programlisting>
+</informalexample>
+or
+<informalexample>
+<programlisting language="lisp">(slot-value (find-class 'qt:object) :static-meta-object)</programlisting>
+</informalexample>
+Usually they can also be accessed using methods from the <package>:cxx</package> package.
</para>
</section>
-<section><title>Garbage Collection</title>
+<section id="gc"><title>Garbage Collection</title>
<para>
You should be able to use C++ Class instances like normal Lisp object.
</para>
<para>
-C++ classes are automatically deleted when their lisp object gets garbage collected;
+C++ classes are automatically deleted when their Lisp object gets garbage collected;
except when they (QObjects) have a parent and thus the parent is responsible for
their deletion. When a <classname>qt:object</classname> has a parent, a strong
-reference is kept to prevent its garbage collection until the parent is deleted.
+reference is kept to prevent the garbage collection removing it until the parent is deleted.
</para>
<caution>
<para>
-An instance may depend on an other one.
-It is a bad idea to do something like this:
-<programlisting>
-(defvar *meta* (<genericfunction>cxx:meta-object</genericfunction> (make-instance 'qt:object)))
-</programlisting>
-<code>*meta*</code> references a <classname>qt:meta-class</classname>
-that can become invalid at any time, since the <classname>qt:object</classname> instance can
-be garbage collected, and then the <code>QMetaObject</code> instance is deleted along
-with the <code>QObject</code>.
+ Ownership transfer for non QObject instances is mostly unimplemented.
</para>
</caution>
</section>
diff -rN -u old-doc/video.xsl new-doc/video.xsl
--- old-doc/video.xsl 1970-01-01 01:00:00.000000000 +0100
+++ new-doc/video.xsl 2014-10-30 07:12:33.000000000 +0100
@@ -0,0 +1,27 @@
+<?xml version='1.0'?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- this barely works -->
+<xsl:template match="videodata">
+ <video controls="true">
+ <xsl:attribute name="src">
+ <xsl:value-of select="@fileref" />
+ </xsl:attribute>
+ <img>
+ <xsl:attribute name="src">
+ <xsl:value-of select="concat(substring-before(@fileref, 'ogg'),'png')" />
+ </xsl:attribute>
+ </img>
+ <p>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="@fileref" />
+ </xsl:attribute>
+ <xsl:text>Download Video</xsl:text>
+ </a>
+ </p>
+ </video>
+</xsl:template>
+
+</xsl:stylesheet>
diff -rN -u old-doc/xslthl-config.xml new-doc/xslthl-config.xml
--- old-doc/xslthl-config.xml 1970-01-01 01:00:00.000000000 +0100
+++ new-doc/xslthl-config.xml 2014-10-30 07:12:33.000000000 +0100
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xslthl-config>
+ <highlighter id="lisp" file="lisp-hl.xml" />
+ <namespace prefix="xslthl" uri="http://xslthl.sf.net" />
+</xslthl-config>