TForms and TFormManager question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

TForms and TFormManager question

David Faught
Hi,

I've been reading Howard's description of off-island resources on the
Consortium wiki, and looking at the class comments for TForm and
TFormManager.  The TForm comments say that dynamically generated
TForms (such as those produced by TPainter) are the same as
themselves.  That is, they cannot really generate thumbnails.

Is there any particular reason why?  Forms generated by something like
TPainter that are relatively static could easily use the same
mechanisms by encoding them with something like (from
PNGReadWriterTest>#encodeAndDecode):

        stream := ByteArray new writeStream.
        (PNGReadWriter on: stream) nextPutImage: original; close.
        bytes := stream contents.

and then adding a method to TFormManager similar to
#addFile:mipmap:shrinkFit:extension: but taking the "bytes" above as
an argument instead of a filename.

Wouldn't this be the "right" way to handle it?
Reply | Threaded
Open this post in threaded view
|

Re: TForms and TFormManager question

Howard Stearns
The comment says "NOTE: Dynamically generated TForms (those not  
loaded from elsewhere) are the same as themselves. ..."

In my opinion, it's up to the programmer what this applies to.  
#make3DObject:from:player:rotateBy:replaceOldCostume: does not  
currently use the form manager, but I feel it could.

The KSharedMediaCache is a generalization of TFormManager, and it  
handles even "more dynamic" forms -- movies.  KMovieTargetForm is a  
subclass of TForm that uses a guid as key, not a sha of the contents  
of the (perpetually changing) Form.

On Apr 14, 2007, at 7:58 AM, David Faught wrote:

> Hi,
>
> I've been reading Howard's description of off-island resources on the
> Consortium wiki, and looking at the class comments for TForm and
> TFormManager.  The TForm comments say that dynamically generated
> TForms (such as those produced by TPainter) are the same as
> themselves.  That is, they cannot really generate thumbnails.
>
> Is there any particular reason why?  Forms generated by something like
> TPainter that are relatively static could easily use the same
> mechanisms by encoding them with something like (from
> PNGReadWriterTest>#encodeAndDecode):
>
> stream := ByteArray new writeStream.
> (PNGReadWriter on: stream) nextPutImage: original; close.
> bytes := stream contents.
>
> and then adding a method to TFormManager similar to
> #addFile:mipmap:shrinkFit:extension: but taking the "bytes" above as
> an argument instead of a filename.
>
> Wouldn't this be the "right" way to handle it?