Multiple inheritance doc & expand tabs in programmlisting. --> 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.
diff -rN -u old-doc/chunk.xsl new-doc/chunk.xsl
--- old-doc/chunk.xsl 2014-10-30 07:10:54.000000000 +0100
+++ new-doc/chunk.xsl 2014-10-30 07:10:54.000000000 +0100
@@ -3,7 +3,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl" />
-<xsl:import href="link-apidoc.xsl" />
+<xsl:import href="nonlink-apidoc.xsl" />
<xsl:import href="video.xsl" />
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/highlight.xsl" />
diff -rN -u old-doc/introduction.xml new-doc/introduction.xml
--- old-doc/introduction.xml 2014-10-30 07:10:54.000000000 +0100
+++ new-doc/introduction.xml 2014-10-30 07:10:54.000000000 +0100
@@ -24,13 +24,13 @@
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>10 seconds startup time<footnote>
+ <listitem><para>6 seconds startup time<footnote>
<para>
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>Could be faster</para></listitem>
</itemizedlist>
@@ -49,7 +49,7 @@
<itemizedlist>
<listitem><para><ulink
url="http://techbase.kde.org/Development/Languages/Smoke">Smoke2</ulink>
- bindings from svn; r1015073 or later
+ bindings from svn.
<footnote><para>
The new smokegenerator is needed (developed by Arno Rehn for the GSOC 09).
</para></footnote>
@@ -59,15 +59,9 @@
<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>.
-</para>
-<para>
-If you prefer to use <ulink url="http://common-lisp.net/project/asdf/">ASDF</ulink> instead of Mudballs, you need these systems:
<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>
@@ -102,53 +96,34 @@
</section>
<section><title>Installation</title>
<para>
- For loading the systems you can use Mudballs or ASDF. But first get the sources:
-</para>
-<para>
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 qt.phonon kde kde.tests kde.examples repl; 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>
- </para>
- <section><title>Mudballs</title>
+ <note>
<para>
- 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>
- </section>
-
- <section><title>ASDF</title>
- <para>
- The <code>.asd</code> files are
- <ulink url="http://tobias.rautenkranz.ch/darcsweb/darcsweb.cgi?r=mudballs-to-asdf;a=summary">generated</ulink>
- from the mudballs files.
- <ulink url="http://tobias.rautenkranz.ch/lisp/cl-smoke/cl-smoke-asd.tar.bz2">Get the <code>.asd</code> files</ulink> and
- place them in the corresponding source directories. Then symlink the <code>.asd</code> files in a ASDF search path.
- You can for example run: <code>ln -s <userinput>SOME_DIR/*/*.asd</userinput> <userinput>ASDF_PATH</userinput></code>
+ There are also the following repositories: qt.svg qt.dbus kde.core kde.ui kde.tests kde.examples
+ </para>
+ </note>
</para>
<para>
- Now build and install the <package>:smoke</package> and <package>:qt</package> C wrapper libraries with:
+ 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>
- <note><para>
- Some examples get the paths for the files to load from their Mudballs system (ui and i18n) and thus will not work.
- </para></note>
- </section>
+ <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:10:54.000000000 +0100
+++ new-doc/kde.xml 2014-10-30 07:10:54.000000000 +0100
@@ -4,7 +4,11 @@
<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>
@@ -13,7 +17,7 @@
<para>
The examples can be run with:
<programlisting language="lisp">
-(mb:load <package>:kde.examples</package>)
+(asdf:oos 'asdf:load-op <package>:cl-smoke.kde.examples</package>)
</programlisting>
And then running the function of the example; e.g.:
<programlisting language="lisp">
diff -rN -u old-doc/manual.xsl new-doc/manual.xsl
--- old-doc/manual.xsl 2014-10-30 07:10:54.000000000 +0100
+++ new-doc/manual.xsl 2014-10-30 07:10:54.000000000 +0100
@@ -3,7 +3,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl"/>
-<xsl:import href="link-apidoc.xsl"/>
+<xsl:import href="nonlink-apidoc.xsl"/>
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/highlight.xsl"/>
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:10:54.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>
diff -rN -u old-doc/qt.xml new-doc/qt.xml
--- old-doc/qt.xml 2014-10-30 07:10:54.000000000 +0100
+++ new-doc/qt.xml 2014-10-30 07:10:54.000000000 +0100
@@ -4,31 +4,37 @@
<chapter id="qt">
<title>Qt</title>
<para>
-Besides the <package>:qt</package> there are these modules: 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>:qt.phonon</package>
- <ulink url="http://doc.trolltech.com/4.5/phonon.html">
- Phonon</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. 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>:qt.tests</package> system, containing
-the unit tests and <package>:qt.examples</package> for various examples.
+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 id="qapplication"><title>qt:application</title>
@@ -42,19 +48,24 @@
<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
@@ -108,8 +119,8 @@
<informalexample>
<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>
@@ -132,7 +143,7 @@
<screenshot>
<mediaobject>
<imageobject>
- <imagedata fileref="i18n-hello-world.png" format="PNG"/>
+ <imagedata fileref="i18n-hello-world.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
@@ -140,14 +151,14 @@
<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>
@@ -156,7 +167,7 @@
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> on 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>
@@ -164,7 +175,7 @@
<para>
You can run the examples with:
<programlisting language="lisp">
-(mb:load <package>:qt.examples</package>)
+(asdf:oos 'asdf:load-op <package>:cl-smoke.qt.examples</package>)
(<methodname>qt.examples:launcher</methodname>)
</programlisting>
</para>
@@ -178,38 +189,38 @@
<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 an binding is needed (e.g.:
+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>
@@ -226,34 +237,12 @@
<para>
<note>
<para>
-Because <ulink url="http://common-lisp.net/project/cl-opengl/">cl-opengl</ulink> is need to
-run the example, but is not in mudballs; the origami example is not included in the mudballs system.
-<ulink url="http://axiom-wiki.newsynthesis.org/FrontPage">Axiom</ulink> is needed for building.
+<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>
-<section id="commonqt"><title>CommonQt</title>
-<para><ulink url="http://tobias.rautenkranz.ch/darcsweb/darcsweb.cgi?r=cl-smoke/commonqt">:cl-smoke.commonqt</ulink>
-is an experimental compatibility layer to run Lisp code using the
-<ulink url="http://common-lisp.net/project/commonqt/">CommonQt</ulink> API with cl-smoke.
-It is incomplete, but implementing the missing pieces should be straight forward.
-</para>
-<screenshot>
-<mediaobject>
-<imageobject>
- <imagedata fileref="commonqt-t14.png" format="PNG"/>
-</imageobject>
-<caption>
-<para>CommonQt tutorial 14
-<filename><ulink url="http://repo.or.cz/w/commonqt.git?a=blob;f=tutorial/t14.lisp;hb=HEAD">t14.lisp</ulink></filename>
-running with <code>:cl-smoke.commonqt</code>.
-</para>
-</caption>
-</mediaobject>
-</screenshot>
-</section>
-
</chapter>
diff -rN -u old-doc/smoke.xml new-doc/smoke.xml
--- old-doc/smoke.xml 2014-10-30 07:10:54.000000000 +0100
+++ new-doc/smoke.xml 2014-10-30 07:10:54.000000000 +0100
@@ -30,14 +30,14 @@
<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> :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> :arg0 parent))
+ (make-instance '<classname>qt:object</classname> :arg0 parent))
</programlisting>
</informalexample>
</para>
@@ -46,8 +46,20 @@
<informalexample>
<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>
@@ -79,9 +91,6 @@
</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>
@@ -109,12 +118,12 @@
</para>
<informalexample>
<programlisting language="lisp">(defclass the-object-does-nothing (<classname>qt:object</classname>)
- ()
- (:metaclass <classname>cxx:class</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>
@@ -197,9 +206,23 @@
<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>.
+ 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++ 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>
@@ -215,7 +238,7 @@
</para>
<caution>
<para>
- Ownership transfer for non QObject instances is mostly unimplemented.
+ Ownership transfer for non QObject instances is mostly unimplemented.
</para>
</caution>
</section>