[cello-devel] Cello: defmd geometry-node ...

Frank Goenninger frgo at me.com
Tue May 19 20:19:04 UTC 2009


Hi Kenny,

I now have a conceptual model of a geometry-capable "view" that  
matches the concepts of page 4 in my PPT:

(defmd geometry-node (cello-base)

   px
   py
   pz

   width
   height

   ll
   lt
   lr
   lb
   lh
   lw
   l-box

   border-width

   inset-delta-left
   inset-delta-right
   inset-delta-top
   inset-delta-bottom

   viewport/clipping-ll
   viewport/clipping-lr
   viewport/clipping-lt
   viewport/clipping-lb

   outset-delta-h
   outset-delta-v

   kid-spacing-h
   kid-spacing-v

   ;; Default values

   :md-name (gensym "CELLO-GEOMETRY-NODE-")

   :px (c-in 0)
   :py (c-in 0)
   :pz (c-in 0)

   :border-width (c-in 0)

   :inset-delta-left       (c-in 1) ;; Should be at least 1 pixel to  
stay away
   :inset-delta-right     (c-in 1) ;; from border ...
   :inset-delta-top       (c-in 1) ;; ...
   :inset-delta-bottom (c-in 1) ;; ...

   ;; Values calculated for ordinary geometry-node, but most likely
   ;; be assigned rules for specific kid handling (like justifying)

   :ll (c? (+ (^px)
              (^border-width)
              (^inset-delta-left)))
   :lt (c? (+ (^py)
              (^height)
              (- (^border-width))
              (- (^inset-delta-top))))
   :lr (c? (+ (^px)
              (^width)
              (- (^border-width))
              (- (^inset-delta-right))))
   :lb (c? (+ (^py)
              (^border-width)
              (^inset-delta-bottom)))

   ;; Calculated values

   :lh (c? (l-height self))
   :lw (c? (l-width self))

   :viewport/clipping-ll (c? (+ (^px)
                                (^border-width)
                                (^inset-delta-left)))

   :viewport/clipping-lr (c? (+ (^px)
                                (^width)
                                (- (^border-width))
                                (- (^inset-delta-right))))

   :viewport/clipping-lt (c? (+ (^py)
                                (^height)
                                (- (^border-width))
                                (- (^inset-delta-top))))

   :viewport/clipping-lb (c? (+ (^py)
                                (^border-width)
                                (^inset-delta-bottom)))

   :l-box (c? (make-lbox (^ll) (^lr) (^lt) (^lb)))

   )

The default way is to give px, py, width, height to a make-instance  
call and the view is establish with all boundaries in place. It is  
possible to specify a border width which affects the inner area in  
which the contents may be drawn. The default cells rules are specified  
to move the content drawing origin as soon as a border width change  
occurs.

The viewport/clipping stuff establishes the rectangle that is the  
remaining drawing area (no drawing outside of this area allowed).

Inset-delta-... let's one specify distances between border and content  
that must be kept even if the content is "growing" or changes its  
drawing origin.

As we have cells rules in all those places any subclass is free to  
change these rules to match container of kids, justification and  
dynamically sized controls based on kids etc.

On to Outset - strictly according to the master's voice ;-)

BTW on page 4 of the PPT there is a poing P4 which is a non-zero ll /  
lb control content.

As for diagramming ... I'm a bit lazy currently - as it keeps me  
creating paper and not code.... Not that I might not do a further  
diagram and ask for feedback ;-)

Thanks again.

Frank

--
   Frank Goenninger

   Cell: 	+49 175 4321058
   E-Mail: 	frgo at me.com





-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2227 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cello-devel/attachments/20090519/e4271e85/attachment.bin>


More information about the cello-devel mailing list