Mercurial > hg > indyvon
changeset 111:441fe457fc2b
Coverted defs to Clojure 1.3 syntax.
author | Mikhail Kryshen <mikhail@kryshen.net> |
---|---|
date | Fri, 04 Nov 2011 00:13:50 +0300 |
parents | f3dedece38f3 |
children | 2bd613007e97 |
files | src/net/kryshen/indyvon/core.clj src/net/kryshen/indyvon/layers.clj |
diffstat | 2 files changed, 24 insertions(+), 40 deletions(-) [+] |
line diff
1.1 --- a/src/net/kryshen/indyvon/core.clj Mon Oct 10 01:58:35 2011 +0300 1.2 +++ b/src/net/kryshen/indyvon/core.clj Fri Nov 04 00:13:50 2011 +0300 1.3 @@ -32,48 +32,32 @@ 1.4 ;; Layer context 1.5 ;; 1.6 1.7 -(def ^{:dynamic true 1.8 - :tag Graphics2D} 1.9 - *graphics*) 1.10 +(def ^:dynamic ^Graphics2D *graphics*) 1.11 1.12 -(def ^{:dynamic true 1.13 - :tag FontRenderContext} 1.14 - *font-context*) 1.15 +(def ^:dynamic ^FontRenderContext *font-context*) 1.16 1.17 -(def ^{:dynamic true 1.18 - :doc "Width of the rendering area."} 1.19 - *width*) 1.20 +(def ^:dynamic *width* 1.21 + "Width of the rendering area.") 1.22 1.23 -(def ^{:dynamic true 1.24 - :doc "Height of the rendering area."} 1.25 - *height*) 1.26 +(def ^:dynamic *height* 1.27 + "Height of the rendering area.") 1.28 1.29 -(def ^{:dynamic true 1.30 - :tag Shape} 1.31 - *clip*) 1.32 +(def ^:dynamic ^Shape *clip*) 1.33 1.34 -(def ^{:dynamic true 1.35 - :doc "Time in nanoseconds when the rendering of the current 1.36 - frame starts."} 1.37 - *time*) 1.38 +(def ^:dynamic *time* 1.39 + "Timestamp of the current frame (in nanoseconds).") 1.40 1.41 -(def ^{:dynamic true 1.42 - :doc "Encloses state that should be retained between repaints."} 1.43 - *scene*) 1.44 +(def ^:dynamic *scene* 1.45 + "Encloses state that should be retained between repaints.") 1.46 1.47 -(def ^{:dynamic true} 1.48 - *event-dispatcher*) 1.49 +(def ^:dynamic *event-dispatcher*) 1.50 1.51 -(def ^{:dynamic true 1.52 - :tag AffineTransform 1.53 - :doc "Initial transform associated with the graphics context."} 1.54 - *initial-transform*) 1.55 +(def ^:dynamic ^AffineTransform *initial-transform* 1.56 + "Initial transform associated with the graphics context.") 1.57 1.58 -(def ^{:dynamic true 1.59 - :tag AffineTransform 1.60 - :doc "Inversion of the initial transform associated with 1.61 - the graphics context."} 1.62 - *inverse-initial-transform*) 1.63 +(def ^:dynamic ^AffineTransform *inverse-initial-transform* 1.64 + "Inversion of the initial transform associated with the graphics 1.65 + context.") 1.66 1.67 (defrecord Theme [fore-color back-color alt-back-color border-color 1.68 shadow-color font]) 1.69 @@ -87,7 +71,7 @@ 1.70 (Color. 0x44 0x44 0x44) 1.71 (Font. "Sans" Font/PLAIN 12))) 1.72 1.73 -(def ^{:dynamic true} *theme* (default-theme)) 1.74 +(def ^:dynamic *theme* (default-theme)) 1.75 1.76 ;; 1.77 ;; Core protocols and types
2.1 --- a/src/net/kryshen/indyvon/layers.clj Mon Oct 10 01:58:35 2011 +0300 2.2 +++ b/src/net/kryshen/indyvon/layers.clj Fri Nov 04 00:13:50 2011 +0300 2.3 @@ -249,7 +249,7 @@ 2.4 height (if (pos? height) height 1)] 2.5 (->Size width height)))))) 2.6 2.7 -(def ^{:dynamic true} *miniature-thread-priority* 2) 2.8 +(def ^:dynamic *miniature-thread-priority* 2) 2.9 2.10 (defn- scaling 2.11 [width height max-width max-height] 2.12 @@ -291,9 +291,9 @@ 2.13 (doto (AffineTransform/getTranslateInstance x y) 2.14 (.concatenate transform)))) 2.15 2.16 -(def ^{:dynamic true} *viewport-scaling-step* (double 3/4)) 2.17 -(def ^{:dynamic true} *viewport-min-scale* 1E-6) 2.18 -(def ^{:dynamic true} *viewport-max-scale* 1E6) 2.19 +(def ^:dynamic *viewport-scaling-step* (double 3/4)) 2.20 +(def ^:dynamic *viewport-min-scale* 1E-6) 2.21 +(def ^:dynamic *viewport-max-scale* 1E6) 2.22 2.23 (defrecord Viewport [content h-align v-align 2.24 ;; State (refs) 2.25 @@ -475,7 +475,7 @@ 2.26 ;; Measuring time 2.27 ;; 2.28 2.29 -(def ^{:dynamic true} *interval*) 2.30 +(def ^:dynamic *interval*) 2.31 2.32 (defn interval-layer 2.33 "Creates layer that measures time between repaints ant draws it's 2.34 @@ -520,7 +520,7 @@ 2.35 ;; Overlayer. 2.36 ;; 2.37 2.38 -(def ^{:private true :dynamic true} *above*) 2.39 +(def ^:private ^:dynamic *above*) 2.40 2.41 (defn- overlay* [f & args] 2.42 (var-set #'*above* (conj *above* (apply partial f args))))