changeset 18:740b9d2bbc45

Anchored protocol and viewport stub.
author Mikhail Kryshen <mikhail@kryshen.net>
date Thu, 17 Jun 2010 18:54:22 +0400
parents 31382464ef27
children 43f0d78057a9
files src/indyvon/core.clj
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/src/indyvon/core.clj	Thu Jun 17 05:42:05 2010 +0400
     1.2 +++ b/src/indyvon/core.clj	Thu Jun 17 18:54:22 2010 +0400
     1.3 @@ -137,3 +137,18 @@
     1.4                   width (text-width layouts)
     1.5                   height (text-height layouts)]
     1.6               [width height]))))))
     1.7 +
     1.8 +(defprotocol Anchored
     1.9 +  "Provide anchor point for Layers. Used by viewport."
    1.10 +  (anchor [this] "Anchor point: [x y]"))
    1.11 +
    1.12 +;; Default implementation of Anchored for any Layer.
    1.13 +(extend-protocol Anchored
    1.14 +  indyvon.core.Layer
    1.15 +  (anchor [this] [0 0]))
    1.16 +
    1.17 +(defn viewport
    1.18 +  "Creates scrollable viewport layer."
    1.19 +  [content]
    1.20 +  ;; TODO
    1.21 +  )