initial import --> to head
src/mandelbrot/mandelbrot.lisp
Sat Apr 3 19:19:09 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Replace mudballs with ASDF and support the modular Smoke.
Sun May 24 23:29:56 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Work around null pointer for references bug
Fri Apr 17 17:30:05 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Use C++ style overload resolution.
Tue Apr 14 16:32:06 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* License
Sun Apr 12 15:34:59 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Use overload by argument count for :cxx generic functions
Wed Apr 8 22:56:48 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* make kmandelbrotui.rc validate with kpartgui.dtd
Fri Apr 3 00:16:06 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* initial import
--- old-kde.examples/src/mandelbrot/mandelbrot.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-kde.examples/src/mandelbrot/mandelbrot.lisp 2014-10-30 08:41:49.000000000 +0100
@@ -0,0 +1,81 @@
+;;; Copyright (C) 2009, 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
+;;;
+;;; 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
+;;; the Free Software Foundation, either version 3 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+(in-package :cl-smoke.kde.examples)
+
+(defun make-aboutdata ()
+ (let ((app-name "kmandelbrot")
+ (catalog-name "") ;; not (null-pointer) (see smoke::conversion-pointer)
+ (program-name (kde:ki18n "KMandelbrot"))
+ (version "0.0.1")
+ (description (kde:ki18n "KDE Mandelbrot program."))
+ (copyright (kde:ki18n "Copyright (c) 2009 Tobias Rautenkranz"))
+ (text (kde:ki18n "TODO"))
+ (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))))
+ (cxx:add-author aboutdata
+ (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
+ (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)
+ "apps" resource-dir)
+ (cxx:quit (find-class 'kde:standard-action)
+ window (qt:qslot "close()")
+ (cxx:action-collection window))
+
+ (kde:make-standard-action kde:standard-action.+redisplay+
+ (cxx:action-collection window)
+ #'(lambda () (zoom mandelbrot 1d0)))
+
+ (kde:make-standard-action kde:standard-action.+zoom-in+
+ (cxx:action-collection window)
+ #'(lambda () (zoom mandelbrot 0.5d0)))
+
+ (kde:make-standard-action kde:standard-action.+zoom-out+
+ (cxx:action-collection window)
+ #'(lambda () (zoom mandelbrot 2d0)))
+
+ (cxx:set-central-widget window mandelbrot)
+ (cxx:set-focus mandelbrot)
+ (setup-slot mandelbrot)
+
+ (cxx:add-resource-dir (kde:global.dirs) "data" resource-dir)
+ (cxx:setup-gui window)
+
+ (cxx:show window)
+ (qt:exec))))