;;; 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 ;;; 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 . (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))))