modular smoke & cleanup.
Sun Jan 10 09:54:26 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* modular smoke & cleanup.
diff -rN -u old-qt.examples/cl-smoke.qt.examples.asd new-qt.examples/cl-smoke.qt.examples.asd
--- old-qt.examples/cl-smoke.qt.examples.asd 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.examples/cl-smoke.qt.examples.asd 2014-10-05 16:34:24.000000000 +0200
@@ -0,0 +1,31 @@
+(defsystem :cl-smoke.qt.examples
+ :name :cl-smoke.qt.examples
+ :version (0 0 1)
+ :author "Tobias Rautenkranz"
+ :license "X11"
+ :description "Qt examples."
+ :depends-on (:cl-smoke.qt.gui :cl-smoke.qt.webkit :cl-smoke.qt.uitools
+ :cl-smoke.qt.phonon)
+ ;;:cl-opengl :cl-glu :cl-smoke.qt.opengl)
+
+ :components
+ ((:module "src"
+ :components
+ ((:file "package")
+ (:file "hello-world" :depends-on ("package"))
+ (:file "video" :depends-on ("package"))
+ (:file "hello-world-quit" :depends-on ("package"))
+ (:file "i18n-hello-world" :depends-on ("package"))
+ (:file "tick-tack-toe" :depends-on ("package"))
+ (:file "launcher" :depends-on ("package"))
+ (:file "ui" :depends-on ("package"))
+ (:file "repl" :depends-on ("package"))
+ (:file "class-browser" :depends-on ("package"))))))
+ ;;(:module "origami"
+ ;; :depends-on ("package")
+ ;; :components
+ ;; ((:file "origami" :depends-on ("tri"))
+ ;; (:file "tri")))))))
+
+(defmethod perform ((o test-op) (c (eql (find-system :cl-smoke.qt.examples))))
+ (funcall (intern (string :test-all) (string :qt.examples))))
diff -rN -u old-qt.examples/qt.examples.asd new-qt.examples/qt.examples.asd
--- old-qt.examples/qt.examples.asd 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/qt.examples.asd 1970-01-01 01:00:00.000000000 +0100
@@ -1,26 +0,0 @@
-(defpackage qt.examples-system
- (:use :cl :asdf))
-
-(in-package qt.examples-system)
-
-(asdf:defsystem :qt.examples
- :name :qt.examples
- :version (0 0 1)
- :author "Tobias Rautenkranz"
- :license "X11"
- :description "Qt examples."
- :depends-on (:qt :qt.webkit :qt.uitools :qt.phonon)
-
- :components
- ((:module "src"
- :components
- ((:file "package")
- (:file "hello-world" :depends-on ("package"))
- (:file "video" :depends-on ("package"))
- (:file "hello-world-quit" :depends-on ("package"))
- (:file "i18n-hello-world" :depends-on ("package"))
- (:file "tick-tack-toe" :depends-on ("package"))
- (:file "launcher" :depends-on ("package"))
- (:file "ui" :depends-on ("package"))
- (:file "repl" :depends-on ("package"))
- (:file "class-browser" :depends-on ("package"))))))
diff -rN -u old-qt.examples/src/class-browser.lisp new-qt.examples/src/class-browser.lisp
--- old-qt.examples/src/class-browser.lisp 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/src/class-browser.lisp 2014-10-05 16:34:24.000000000 +0200
@@ -79,7 +79,7 @@
(defun set-info (info web-view model-index)
(let* ((class (class-at model-index)))
- (cxx:load web-view (format nil "http://doc.trolltech.com/~A/~A.html"
+ (cxx:load web-view (format nil "http://doc.trolltech.com/~A/~(~A~).html"
(subseq (qt:q-version) 0 3)
(remove #\: (smoke:name class) :count 1)))
(cxx:set-text info
diff -rN -u old-qt.examples/src/hello-world-quit.lisp new-qt.examples/src/hello-world-quit.lisp
--- old-qt.examples/src/hello-world-quit.lisp 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/src/hello-world-quit.lisp 2014-10-05 16:34:24.000000000 +0200
@@ -4,7 +4,7 @@
(in-package :qt.examples)
(defun hello-world-quit ()
- "Quit on push-button click."
+ "Quit on push-button click"
(qt:with-app ()
(let ((quit (make-instance 'qt:push-button :args '("Quit")))
(font (make-instance 'qt:font :args (list "Times"
diff -rN -u old-qt.examples/src/i18n-hello-world.lisp new-qt.examples/src/i18n-hello-world.lisp
--- old-qt.examples/src/i18n-hello-world.lisp 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/src/i18n-hello-world.lisp 2014-10-05 16:34:24.000000000 +0200
@@ -6,23 +6,20 @@
(defun i18n-hello-world ()
"i18n hello world"
(qt:with-app ()
- ;; ensures that the message catalogs are found regardless
- ;; of the current directory.
- (let ((source-path *default-pathname-defaults*))
- (qt:with-translator ("hello-world"
- *default-pathname-defaults*
- source-path)
- (let ((widget (make-instance 'qt:label)))
- (setf (cxx:window-title widget) (qt:tr "Lisp Qt Example" "hello-world")
- (cxx:text widget) (format nil (qt:tr "<h1>Hello world</h1>
+ (qt:with-translator ("hello-world"
+ *default-pathname-defaults*
+ *source-path*)
+ (let ((widget (make-instance 'qt:label)))
+ (setf (cxx:window-title widget) (qt:tr "Lisp Qt Example" "hello-world")
+ (cxx:text widget) (format nil (qt:tr "<h1>Hello world</h1>
You are running ~A version ~A on a ~A ~A")
- (lisp-implementation-type)
- (lisp-implementation-version)
- (software-type)
- (software-version)))
- (cxx:show widget)
- (qt:exec))))))
+ (lisp-implementation-type)
+ (lisp-implementation-version)
+ (software-type)
+ (software-version)))
+ (cxx:show widget)
+ (qt:exec)))))
;; FIXME:
;; calling #'software-version from the qt:application event loop
diff -rN -u old-qt.examples/src/origami/origami.lisp new-qt.examples/src/origami/origami.lisp
--- old-qt.examples/src/origami/origami.lisp 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/src/origami/origami.lisp 2014-10-05 16:34:24.000000000 +0200
@@ -1,11 +1,15 @@
-;;; Pleated Hyperbolic Paraboloid
+;;; OpenGL Pleated Hyperbolic Paraboloid
;;;
;;; Construction using the method in:
+;;;
;;; (Non)existence of Pleated Folds: How Paper Folds Between Creases
-;;; 6 Existence of Triangulated Hyperbolic Paraboloid
-;;; http://arxiv.org/abs/0906.4747
;;;
-;;; depends on: :qt.examples tri.lisp :cl-opengl :cl-glu
+;;; Erik D. Demaine, Martin L. Demaine, Vi Hart, Gregory N. Price,
+;;; Tomohiro Tachi
+;;;
+;;; http://arxiv.org/abs/0906.4747
+;;;
+;;; Section 6: Existence of Triangulated Hyperbolic Paraboloid
(in-package :qt.examples)
@@ -270,3 +274,10 @@
(cxx:tick-position rings) qt:slider.+ticks-right+
(cxx:tick-interval rings) 10)))
(cxx:set-layout origami layout)))
+
+(defun origami ()
+ "OpenGL Pleated Hyperbolic Paraboloid"
+ (qt:with-app ()
+ (let ((origami (make-instance 'origami)))
+ (cxx:show origami)
+ (qt:exec))))
diff -rN -u old-qt.examples/src/origami/tri.lisp new-qt.examples/src/origami/tri.lisp
--- old-qt.examples/src/origami/tri.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.examples/src/origami/tri.lisp 2014-10-05 16:34:24.000000000 +0200
@@ -0,0 +1,174 @@
+(in-package :qt.examples)
+
+(declaim (inline ^))
+(defun ^ (base power)
+ (expt base power))
+
+
+(defun v1 (z1 z2 d1 r1 r2)
+ (values
+ (/
+ (+
+ (* (+ (* -1 z2) z1)
+ (^
+ (+
+ (+
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ z2 4))
+ (* (* (* 64 (^ d1 2)) z1) (^ z2 3)))
+ (*
+ (+ (* (* -96 (^ d1 2)) (^ z1 2))
+ (+ (* (* 32 (^ d1 2)) (^ r2 2))
+ (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* -32 (^ d1 4)))))
+ (^ z2 2)))
+ (*
+ (+ (* (* 64 (^ d1 2)) (^ z1 3))
+ (*
+ (+ (* (* -64 (^ d1 2)) (^ r2 2))
+ (+ (* (* -64 (^ d1 2)) (^ r1 2)) (* 64 (^ d1 4))))
+ z1))
+ z2))
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ z1 4))
+ (*
+ (+ (* (* 32 (^ d1 2)) (^ r2 2))
+ (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* -32 (^ d1 4))))
+ (^ z1 2)))
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ r2 4))
+ (* (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* 32 (^ d1 4))) (^ r2 2)))
+ (+ (+ (* (* -16 (^ d1 2)) (^ r1 4)) (* (* 32 (^ d1 4)) (^ r1 2)))
+ (* -16 (^ d1 6))))))
+ (/ 1 2)))
+ (+ (+ (* (* 4 (^ d1 2)) (^ z2 2)) (* (* (* -8 (^ d1 2)) z1) z2))
+ (+ (* (* 4 (^ d1 2)) (^ z1 2))
+ (+ (* (* 4 (^ d1 2)) (^ r2 2))
+ (+ (* (* -4 (^ d1 2)) (^ r1 2)) (* 4 (^ d1 4)))))))
+ (+ (+ (* (* 8 d1) (^ z2 2)) (* (* (* -16 d1) z1) z2))
+ (+ (* (* 8 d1) (^ z1 2)) (* 8 (^ d1 3)))))
+ (/
+ (+
+ (* -1
+ (^
+ (+
+ (+
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ z2 4))
+ (* (* (* 64 (^ d1 2)) z1) (^ z2 3)))
+ (*
+ (+ (* (* -96 (^ d1 2)) (^ z1 2))
+ (+ (* (* 32 (^ d1 2)) (^ r2 2))
+ (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* -32 (^ d1 4)))))
+ (^ z2 2)))
+ (*
+ (+ (* (* 64 (^ d1 2)) (^ z1 3))
+ (*
+ (+ (* (* -64 (^ d1 2)) (^ r2 2))
+ (+ (* (* -64 (^ d1 2)) (^ r1 2)) (* 64 (^ d1 4))))
+ z1))
+ z2))
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ z1 4))
+ (*
+ (+ (* (* 32 (^ d1 2)) (^ r2 2))
+ (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* -32 (^ d1 4))))
+ (^ z1 2)))
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ r2 4))
+ (* (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* 32 (^ d1 4))) (^ r2 2)))
+ (+ (+ (* (* -16 (^ d1 2)) (^ r1 4)) (* (* 32 (^ d1 4)) (^ r1 2)))
+ (* -16 (^ d1 6))))))
+ (/ 1 2)))
+ (+
+ (+ (+ (* 4 (^ z2 3)) (* (* -4 z1) (^ z2 2)))
+ (*
+ (+ (* -4 (^ z1 2))
+ (+ (* -4 (^ r2 2)) (+ (* 4 (^ r1 2)) (* 4 (^ d1 2)))))
+ z2))
+ (+ (* 4 (^ z1 3))
+ (* (+ (* 4 (^ r2 2)) (+ (* -4 (^ r1 2)) (* 4 (^ d1 2)))) z1))))
+ (+ (+ (* 8 (^ z2 2)) (* (* -16 z1) z2))
+ (+ (* 8 (^ z1 2)) (* 8 (^ d1 2)))))))
+
+(defun v2 (z1 z2 d1 r1 r2)
+ (values
+ (/
+ (+
+ (* (+ z2 (* -1 z1))
+ (^
+ (+
+ (+
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ z2 4))
+ (* (* (* 64 (^ d1 2)) z1) (^ z2 3)))
+ (*
+ (+ (* (* -96 (^ d1 2)) (^ z1 2))
+ (+ (* (* 32 (^ d1 2)) (^ r2 2))
+ (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* -32 (^ d1 4)))))
+ (^ z2 2)))
+ (*
+ (+ (* (* 64 (^ d1 2)) (^ z1 3))
+ (*
+ (+ (* (* -64 (^ d1 2)) (^ r2 2))
+ (+ (* (* -64 (^ d1 2)) (^ r1 2)) (* 64 (^ d1 4))))
+ z1))
+ z2))
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ z1 4))
+ (*
+ (+ (* (* 32 (^ d1 2)) (^ r2 2))
+ (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* -32 (^ d1 4))))
+ (^ z1 2)))
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ r2 4))
+ (* (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* 32 (^ d1 4))) (^ r2 2)))
+ (+ (+ (* (* -16 (^ d1 2)) (^ r1 4)) (* (* 32 (^ d1 4)) (^ r1 2)))
+ (* -16 (^ d1 6))))))
+ (/ 1 2)))
+ (+ (+ (* (* 4 (^ d1 2)) (^ z2 2)) (* (* (* -8 (^ d1 2)) z1) z2))
+ (+ (* (* 4 (^ d1 2)) (^ z1 2))
+ (+ (* (* 4 (^ d1 2)) (^ r2 2))
+ (+ (* (* -4 (^ d1 2)) (^ r1 2)) (* 4 (^ d1 4)))))))
+ (+ (+ (* (* 8 d1) (^ z2 2)) (* (* (* -16 d1) z1) z2))
+ (+ (* (* 8 d1) (^ z1 2)) (* 8 (^ d1 3)))))
+ (/
+ (+
+ (^
+ (+
+ (+
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ z2 4)) (* (* (* 64 (^ d1 2)) z1) (^ z2 3)))
+ (*
+ (+ (* (* -96 (^ d1 2)) (^ z1 2))
+ (+ (* (* 32 (^ d1 2)) (^ r2 2))
+ (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* -32 (^ d1 4)))))
+ (^ z2 2)))
+ (*
+ (+ (* (* 64 (^ d1 2)) (^ z1 3))
+ (*
+ (+ (* (* -64 (^ d1 2)) (^ r2 2))
+ (+ (* (* -64 (^ d1 2)) (^ r1 2)) (* 64 (^ d1 4))))
+ z1))
+ z2))
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ z1 4))
+ (*
+ (+ (* (* 32 (^ d1 2)) (^ r2 2))
+ (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* -32 (^ d1 4))))
+ (^ z1 2)))
+ (+
+ (+ (* (* -16 (^ d1 2)) (^ r2 4))
+ (* (+ (* (* 32 (^ d1 2)) (^ r1 2)) (* 32 (^ d1 4))) (^ r2 2)))
+ (+ (+ (* (* -16 (^ d1 2)) (^ r1 4)) (* (* 32 (^ d1 4)) (^ r1 2)))
+ (* -16 (^ d1 6))))))
+ (/ 1 2))
+ (+
+ (+ (+ (* 4 (^ z2 3)) (* (* -4 z1) (^ z2 2)))
+ (*
+ (+ (* -4 (^ z1 2))
+ (+ (* -4 (^ r2 2)) (+ (* 4 (^ r1 2)) (* 4 (^ d1 2)))))
+ z2))
+ (+ (* 4 (^ z1 3))
+ (* (+ (* 4 (^ r2 2)) (+ (* -4 (^ r1 2)) (* 4 (^ d1 2)))) z1))))
+ (+ (+ (* 8 (^ z2 2)) (* (* -16 z1) z2))
+ (+ (* 8 (^ z1 2)) (* 8 (^ d1 2)))))))
diff -rN -u old-qt.examples/src/package.lisp new-qt.examples/src/package.lisp
--- old-qt.examples/src/package.lisp 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/src/package.lisp 2014-10-05 16:34:24.000000000 +0200
@@ -12,9 +12,24 @@
#:tick-tack-toe
#:repl
-
#:play-video
+ ;;#:origami
#:launcher
#:load-ui-file))
+
+(in-package #:qt.examples)
+
+(defvar *source-path*
+ #.(asdf:component-pathname (asdf:find-component
+ (asdf:find-system :cl-smoke.qt.examples) "src")))
+
+(defun test-all ()
+ (let ((qt:*exec-p* nil))
+ (do-external-symbols (example :qt.examples)
+ (when (fboundp example)
+ (format *debug-io* "testing ~A~%"
+ (documentation (symbol-function example)
+ 'function))
+ (funcall (symbol-function example))))))
diff -rN -u old-qt.examples/src/ui.lisp new-qt.examples/src/ui.lisp
--- old-qt.examples/src/ui.lisp 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/src/ui.lisp 2014-10-05 16:34:24.000000000 +0200
@@ -12,6 +12,7 @@
(setf (cxx:file-name file)
(namestring
(qt:search-file "widget.ui"
+ *source-path*
*default-pathname-defaults*)))
(assert (cxx:exists file) (file)
"File ~A does not exists" (cxx:file-name file))
diff -rN -u old-qt.examples/test.lisp new-qt.examples/test.lisp
--- old-qt.examples/test.lisp 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/test.lisp 2014-10-05 16:34:24.000000000 +0200
@@ -2,7 +2,7 @@
exec -a "$0" sbcl --noinform --noprint --disable-debugger --load $0 --end-toplevel-options "$@"
|#
-(asdf:oos 'asdf:load-op :qt.examples)
-(asdf:oos 'asdf:test-op :qt.examples)
+(asdf:oos 'asdf:load-op :cl-smoke.qt.examples)
+(asdf:oos 'asdf:test-op :cl-smoke.qt.examples)
(sb-ext:quit)
diff -rN -u old-qt.examples/tests/test.lisp new-qt.examples/tests/test.lisp
--- old-qt.examples/tests/test.lisp 2014-10-05 16:34:24.000000000 +0200
+++ new-qt.examples/tests/test.lisp 1970-01-01 01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-(in-package :qt.examples)
-
-(let ((qt:*exec-p* nil))
- (do-external-symbols (example :qt.examples)
- (when (fboundp example)
- (format *debug-io* "testing ~A~%"
- (documentation (symbol-function example)
- 'function))
- (funcall (symbol-function example)))))