repos
/
kde.examples
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
headblob
|
headfilediff
|
filehistory
normal
|
plain
|
shade
|
zebra
Replace mudballs with ASDF and support the modular Smoke.
Annotate for file src/mandelbrot/mandelbrot.lisp
2010-04-03 tobias
1
;;; Copyright (C) 2009, 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
2009-04-14 tobias
2
;;;
14:32:06 '
3
;;; This program is free software: you can redistribute it and/or modify
'
4
;;; it under the terms of the GNU General Public License as published by
'
5
;;; the Free Software Foundation, either version 3 of the License, or
'
6
;;; (at your option) any later version.
'
7
;;;
'
8
;;; This program is distributed in the hope that it will be useful,
'
9
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
'
10
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'
11
;;; GNU General Public License for more details.
'
12
;;;
'
13
;;; You should have received a copy of the GNU General Public License
'
14
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
'
15
2010-04-03 tobias
16
(in-package :cl-smoke.kde.examples)
2009-04-02 tobias
17
22:16:06 '
18
(defun make-aboutdata ()
2009-04-17 tobias
19
(let ((app-name "kmandelbrot")
2009-05-24 tobias
20
(catalog-name "") ;; not (null-pointer) (see smoke::conversion-pointer)
2009-04-02 tobias
21
(program-name (kde:ki18n "KMandelbrot"))
2009-04-17 tobias
22
(version "0.0.1")
2009-04-02 tobias
23
(description (kde:ki18n "KDE Mandelbrot program."))
22:16:06 '
24
(copyright (kde:ki18n "Copyright (c) 2009 Tobias Rautenkranz"))
'
25
(text (kde:ki18n "TODO"))
2009-04-17 tobias
26
(homepage "http://tobias.rautenkranz.ch/lisp/cl-smoke/")
15:30:05 '
27
(email "bugs@tobias.rautenkranz.ch"))
2009-04-02 tobias
28
(let ((aboutdata
2009-05-24 tobias
29
(make-instance 'kde:about-data
21:29:56 '
30
:args (list
'
31
app-name catalog-name program-name
'
32
version description
'
33
kde:about-data.+license-lgpl-v2+
'
34
copyright text homepage email))))
2009-04-02 tobias
35
(cxx:add-author aboutdata
2009-05-24 tobias
36
(kde:ki18n "Tobias Rautenkranz")
21:29:56 '
37
(make-instance 'kde:localized-string)
'
38
"tobias@rautenkranz.ch")
2009-04-02 tobias
39
aboutdata)))
22:16:06 '
40
'
41
(defun mandelbrot ()
2010-04-03 tobias
42
"KDE Mandelbrot example"
2009-04-02 tobias
43
(kde:with-app (make-aboutdata)
22:16:06 '
44
(let* ((window (make-instance 'kde:xml-gui-window))
'
45
(mandelbrot (make-instance 'mandelbrotwidget))
2010-04-03 tobias
46
(resource-dir
17:19:09 '
47
(namestring
'
48
(asdf:component-pathname
'
49
(asdf:find-component
'
50
(asdf:find-component (asdf:find-system :cl-smoke.kde.examples)
'
51
"src")
'
52
"kmandelbrot")))))
2009-04-02 tobias
53
(cxx:add-resource-dir (kde:global.dirs)
22:16:06 '
54
"icon" resource-dir)
'
55
(cxx:add-resource-dir (kde:global.dirs)
'
56
"apps" resource-dir)
'
57
(cxx:quit (find-class 'kde:standard-action)
'
58
window (qt:qslot "close()")
'
59
(cxx:action-collection window))
'
60
'
61
(kde:make-standard-action kde:standard-action.+redisplay+
'
62
(cxx:action-collection window)
'
63
#'(lambda () (zoom mandelbrot 1d0)))
'
64
'
65
(kde:make-standard-action kde:standard-action.+zoom-in+
'
66
(cxx:action-collection window)
'
67
#'(lambda () (zoom mandelbrot 0.5d0)))
'
68
'
69
(kde:make-standard-action kde:standard-action.+zoom-out+
'
70
(cxx:action-collection window)
'
71
#'(lambda () (zoom mandelbrot 2d0)))
'
72
'
73
(cxx:set-central-widget window mandelbrot)
'
74
(cxx:set-focus mandelbrot)
'
75
(setup-slot mandelbrot)
'
76
2009-05-24 tobias
77
(cxx:add-resource-dir (kde:global.dirs) "data" resource-dir)
2009-04-02 tobias
78
(cxx:setup-gui window)
22:16:06 '
79
'
80
(cxx:show window)
2010-04-03 tobias
81
(qt:exec))))