Mercurial > hg > indyvon
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 wrap: on
line diff
--- a/src/indyvon/core.clj Thu Jun 17 05:42:05 2010 +0400 +++ b/src/indyvon/core.clj Thu Jun 17 18:54:22 2010 +0400 @@ -137,3 +137,18 @@ width (text-width layouts) height (text-height layouts)] [width height])))))) + +(defprotocol Anchored + "Provide anchor point for Layers. Used by viewport." + (anchor [this] "Anchor point: [x y]")) + +;; Default implementation of Anchored for any Layer. +(extend-protocol Anchored + indyvon.core.Layer + (anchor [this] [0 0])) + +(defn viewport + "Creates scrollable viewport layer." + [content] + ;; TODO + )