Sat Apr 3 19:19:09 CEST 2010 Tobias Rautenkranz * Replace mudballs with ASDF and support the modular Smoke. Sun May 24 23:29:56 CEST 2009 Tobias Rautenkranz * Work around null pointer for references bug Fri Apr 17 17:30:05 CEST 2009 Tobias Rautenkranz * Use C++ style overload resolution. diff -rN -u old-kde.examples/kde.examples.mbd new-kde.examples/kde.examples.mbd --- old-kde.examples/kde.examples.mbd 2014-10-30 08:40:02.000000000 +0100 +++ new-kde.examples/kde.examples.mbd 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- - -(in-package :sysdef-user) - -(define-system :kde.examples () - (:version 0 0 1) - (:documentation "KDE examples.") - (:keywords "KDE") - (:author "Tobias Rautenkranz") - (:license "GPL") - (:needs :kde) - (:components - ("src" module - (:components - "package" - ("hello-world" (:needs "package")) - ("mandelbrot" module - (:needs "package") - (:components - "render" - ("mandelbrotwidget" (:needs "render")) - ("mandelbrot" (:needs "mandelbrotwidget")))))))) diff -rN -u old-kde.examples/src/hello-world.lisp new-kde.examples/src/hello-world.lisp --- old-kde.examples/src/hello-world.lisp 2014-10-30 08:40:02.000000000 +0100 +++ new-kde.examples/src/hello-world.lisp 2014-10-30 08:40:02.000000000 +0100 @@ -1,9 +1,10 @@ ;;; Copyright 2009 Tobias Rautenkranz ;;; License: X11 license -(in-package :kde.examples) +(in-package :cl-smoke.kde.examples) (defun hello-world () + "KDE Hello World" (kde:with-kde ("khelloworld" "Hello World" "0.1") (let* ((window (make-instance 'kde:push-button :args '("Hello world")))) (cxx:show window) diff -rN -u old-kde.examples/src/kmandelbrot/kmandelbrotui.rc new-kde.examples/src/kmandelbrot/kmandelbrotui.rc --- old-kde.examples/src/kmandelbrot/kmandelbrotui.rc 2014-10-30 08:40:02.000000000 +0100 +++ new-kde.examples/src/kmandelbrot/kmandelbrotui.rc 2014-10-30 08:40:02.000000000 +0100 @@ -21,7 +21,7 @@ Main Toolbar diff -rN -u old-kde.examples/src/mandelbrot/mandelbrot.lisp new-kde.examples/src/mandelbrot/mandelbrot.lisp --- old-kde.examples/src/mandelbrot/mandelbrot.lisp 2014-10-30 08:40:02.000000000 +0100 +++ new-kde.examples/src/mandelbrot/mandelbrot.lisp 2014-10-30 08:40:02.000000000 +0100 @@ -1,4 +1,4 @@ -;;; Copyright (C) 2009 Tobias Rautenkranz +;;; Copyright (C) 2009, 2010 Tobias Rautenkranz ;;; ;;; This program is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by @@ -13,42 +13,43 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . -(in-package :kde.examples) - -(declaim (optimize (debug 3))) +(in-package :cl-smoke.kde.examples) (defun make-aboutdata () - (let ((app-name (make-instance 'qt:byte-array :args '("kmandelbrot"))) - (catalog-name (make-instance 'qt:byte-array)) + (let ((app-name "kmandelbrot") + (catalog-name "") ;; not (null-pointer) (see smoke::conversion-pointer) (program-name (kde:ki18n "KMandelbrot")) - (version (make-instance 'qt:byte-array :args '("0.0.1"))) + (version "0.0.1") (description (kde:ki18n "KDE Mandelbrot program.")) (copyright (kde:ki18n "Copyright (c) 2009 Tobias Rautenkranz")) (text (kde:ki18n "TODO")) - (homepage (make-instance 'qt:byte-array - :args '("http://tobias.rautenkranz.ch"))) - (email (make-instance 'qt:byte-array - :args '("bugs@tobias.rautenkranz.ch")))) + (homepage "http://tobias.rautenkranz.ch/lisp/cl-smoke/") + (email "bugs@tobias.rautenkranz.ch")) (let ((aboutdata - (make-instance 'kde:about-data :args (list - app-name catalog-name program-name - version description - kde:about-data.+license-lgpl-v2+ - copyright text homepage email)))) + (make-instance 'kde:about-data + :args (list + app-name catalog-name program-name + version description + kde:about-data.+license-lgpl-v2+ + copyright text homepage email)))) (cxx:add-author aboutdata - (kde:ki18n "Tobias Rautenkranz") - (make-instance 'kde:localized-string) - (make-instance 'qt:byte-array :args '("tobias@rautenkranz.ch"))) + (kde:ki18n "Tobias Rautenkranz") + (make-instance 'kde:localized-string) + "tobias@rautenkranz.ch") aboutdata))) (defun mandelbrot () + "KDE Mandelbrot example" (kde:with-app (make-aboutdata) (let* ((window (make-instance 'kde:xml-gui-window)) (mandelbrot (make-instance 'mandelbrotwidget)) - (resource-dir (directory-namestring - (mb.sysdef:component-pathname - (mb.sysdef:find-component :kde.examples "src"))))) - + (resource-dir + (namestring + (asdf:component-pathname + (asdf:find-component + (asdf:find-component (asdf:find-system :cl-smoke.kde.examples) + "src") + "kmandelbrot"))))) (cxx:add-resource-dir (kde:global.dirs) "icon" resource-dir) (cxx:add-resource-dir (kde:global.dirs) @@ -73,8 +74,7 @@ (cxx:set-focus mandelbrot) (setup-slot mandelbrot) - (cxx:add-resource-dir (kde:global.dirs) - "data" resource-dir) + (cxx:add-resource-dir (kde:global.dirs) "data" resource-dir) (cxx:setup-gui window) (cxx:show window) diff -rN -u old-kde.examples/src/mandelbrot/mandelbrotwidget.lisp new-kde.examples/src/mandelbrot/mandelbrotwidget.lisp --- old-kde.examples/src/mandelbrot/mandelbrotwidget.lisp 2014-10-30 08:40:02.000000000 +0100 +++ new-kde.examples/src/mandelbrot/mandelbrotwidget.lisp 2014-10-30 08:40:02.000000000 +0100 @@ -13,8 +13,7 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . -(in-package :kde.examples) -(declaim (optimize (debug 3))) +(in-package :cl-smoke.kde.examples) (defun zoom-in-factor () 0.8) @@ -53,8 +52,7 @@ qt:+queued-connection+)) (defun draw-rendering (painter widget) - (cxx:set-pen painter (make-instance 'qt:color - :args (list qt:+white+))) + (cxx:set-pen painter #xFFFFFF) ;; FIXME make qt:+white+ work (cxx:draw-text painter (cxx:rect widget) (value qt:+align-center+) "Rendering initial image, please wait...")) @@ -93,8 +91,7 @@ (declare (ignore event)) (qt:with-painter (painter widget) (cxx:fill-rect painter (cxx:rect widget) - (make-instance 'qt:brush :args (list - (make-instance 'qt:color :args (list qt:+black+))))) + #x000) ;; FIXME qt:+black+ (if (null (pixmap widget)) (draw-rendering painter widget) (draw-pixmap painter widget)))) @@ -130,7 +127,8 @@ (zoom widget (expt (zoom-in-factor) (/ (cxx:delta event) (* 8 15.0))))) (defmethod cxx:mouse-move-event ((widget mandelbrotwidget) event) - (when (logand (cxx:buttons event) (value qt:+left-button+)) + (when (and (logand (cxx:buttons event) (value qt:+left-button+)) + (last-drag-pos widget)) (incf (pixmap-offset widget) (- (complex (cxx:x event) (cxx:y event)) diff -rN -u old-kde.examples/src/mandelbrot/render.lisp new-kde.examples/src/mandelbrot/render.lisp --- old-kde.examples/src/mandelbrot/render.lisp 2014-10-30 08:40:02.000000000 +0100 +++ new-kde.examples/src/mandelbrot/render.lisp 2014-10-30 08:40:02.000000000 +0100 @@ -14,7 +14,7 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . -(in-package :kde.examples) +(in-package :cl-smoke.kde.examples) (defun make-image (width height) (make-instance 'qt:image :args (list width height diff -rN -u old-kde.examples/src/package.lisp new-kde.examples/src/package.lisp --- old-kde.examples/src/package.lisp 2014-10-30 08:40:02.000000000 +0100 +++ new-kde.examples/src/package.lisp 2014-10-30 08:40:02.000000000 +0100 @@ -21,7 +21,19 @@ ;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ;;; OTHER DEALINGS IN THE SOFTWARE. -(defpackage :kde.examples +(defpackage :cl-smoke.kde.examples (:use #:cl :bordeaux-threads #:cxx-support) + (:nicknames :kde.examples) (:export #:hello-world #:mandelbrot)) + +(in-package :cl-smoke.kde.examples) + +(defun test-all () + (let ((qt:*exec-p* nil)) + (do-external-symbols (example :cl-smoke.kde.examples) + (when (fboundp example) + (format *debug-io* "testing ~A~%" + (documentation (symbol-function example) + 'function)) + (funcall (symbol-function example)))))) diff -rN -u old-kde.examples/test.lisp new-kde.examples/test.lisp --- old-kde.examples/test.lisp 1970-01-01 01:00:00.000000000 +0100 +++ new-kde.examples/test.lisp 2014-10-30 08:40:02.000000000 +0100 @@ -0,0 +1,9 @@ +#| +exec -a "$0" sbcl --noinform --noprint --disable-debugger --load $0 --end-toplevel-options "$@" +# Used for testing on darcs record. +|# + +(asdf:operate 'asdf:load-op :cl-smoke.kde.examples) +(asdf:operate 'asdf:test-op :cl-smoke.kde.examples) + +(sb-ext:quit)