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 wrap: on
line diff
--- a/src/net/kryshen/indyvon/core.clj Mon Oct 10 01:58:35 2011 +0300 +++ b/src/net/kryshen/indyvon/core.clj Fri Nov 04 00:13:50 2011 +0300 @@ -32,48 +32,32 @@ ;; Layer context ;; -(def ^{:dynamic true - :tag Graphics2D} - *graphics*) +(def ^:dynamic ^Graphics2D *graphics*) -(def ^{:dynamic true - :tag FontRenderContext} - *font-context*) +(def ^:dynamic ^FontRenderContext *font-context*) -(def ^{:dynamic true - :doc "Width of the rendering area."} - *width*) +(def ^:dynamic *width* + "Width of the rendering area.") -(def ^{:dynamic true - :doc "Height of the rendering area."} - *height*) +(def ^:dynamic *height* + "Height of the rendering area.") -(def ^{:dynamic true - :tag Shape} - *clip*) +(def ^:dynamic ^Shape *clip*) -(def ^{:dynamic true - :doc "Time in nanoseconds when the rendering of the current - frame starts."} - *time*) +(def ^:dynamic *time* + "Timestamp of the current frame (in nanoseconds).") -(def ^{:dynamic true - :doc "Encloses state that should be retained between repaints."} - *scene*) +(def ^:dynamic *scene* + "Encloses state that should be retained between repaints.") -(def ^{:dynamic true} - *event-dispatcher*) +(def ^:dynamic *event-dispatcher*) -(def ^{:dynamic true - :tag AffineTransform - :doc "Initial transform associated with the graphics context."} - *initial-transform*) +(def ^:dynamic ^AffineTransform *initial-transform* + "Initial transform associated with the graphics context.") -(def ^{:dynamic true - :tag AffineTransform - :doc "Inversion of the initial transform associated with - the graphics context."} - *inverse-initial-transform*) +(def ^:dynamic ^AffineTransform *inverse-initial-transform* + "Inversion of the initial transform associated with the graphics + context.") (defrecord Theme [fore-color back-color alt-back-color border-color shadow-color font]) @@ -87,7 +71,7 @@ (Color. 0x44 0x44 0x44) (Font. "Sans" Font/PLAIN 12))) -(def ^{:dynamic true} *theme* (default-theme)) +(def ^:dynamic *theme* (default-theme)) ;; ;; Core protocols and types
--- a/src/net/kryshen/indyvon/layers.clj Mon Oct 10 01:58:35 2011 +0300 +++ b/src/net/kryshen/indyvon/layers.clj Fri Nov 04 00:13:50 2011 +0300 @@ -249,7 +249,7 @@ height (if (pos? height) height 1)] (->Size width height)))))) -(def ^{:dynamic true} *miniature-thread-priority* 2) +(def ^:dynamic *miniature-thread-priority* 2) (defn- scaling [width height max-width max-height] @@ -291,9 +291,9 @@ (doto (AffineTransform/getTranslateInstance x y) (.concatenate transform)))) -(def ^{:dynamic true} *viewport-scaling-step* (double 3/4)) -(def ^{:dynamic true} *viewport-min-scale* 1E-6) -(def ^{:dynamic true} *viewport-max-scale* 1E6) +(def ^:dynamic *viewport-scaling-step* (double 3/4)) +(def ^:dynamic *viewport-min-scale* 1E-6) +(def ^:dynamic *viewport-max-scale* 1E6) (defrecord Viewport [content h-align v-align ;; State (refs) @@ -475,7 +475,7 @@ ;; Measuring time ;; -(def ^{:dynamic true} *interval*) +(def ^:dynamic *interval*) (defn interval-layer "Creates layer that measures time between repaints ant draws it's @@ -520,7 +520,7 @@ ;; Overlayer. ;; -(def ^{:private true :dynamic true} *above*) +(def ^:private ^:dynamic *above*) (defn- overlay* [f & args] (var-set #'*above* (conj *above* (apply partial f args))))