[squeak-dev] What is the task of NullEncoder?

Tobias Pape Das.Linux at gmx.de
Fri Sep 29 14:37:16 UTC 2017


Hi Hannes

> On 29.09.2017, at 15:21, H. Hirzel <hannes.hirzel at gmail.com> wrote:
> 
> And there is no 'FlattenEncoder' in Pharo 6

> 
> 
> On 9/29/17, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>> We have
>> 
>> NullEncoder
>>    FlattenEncoder
>>        Canvas

So here's the Thing: I looked in 3.8, and there's: 

Object
 NullEncoder 		- Morphic-Postscript Filters
  FlattenEncoder	- Morphic-Postscript Filters
   Canvas		- Morphic-Support
    PostscriptCanvas	- Morphic-Postscript Canvases

But also note that they all have a callback via class>>filterSelector:

NullEncoder>>filterSelector		^ #writeOnFilterStream:
FlattenEncoder>>filterSelector		^ #flattenOnStream:
Canvas>>filterSelector			^ #drawOnCanvas:
PostscriptCanvas>>filterSelector	^ #fullDrawPostscriptOn:

I think part of that happened because this all shared common functionallity, In the sense that all those things "Put objects onto another thing with encoding inbetween".
Thinking of things like a n-dimensonal stream or so…

I checked and It is like that even in Squeak 3.6, 3.0, 2.8. 
Squeak 1.13 does not have any of those, and it has no Morphic.

Self Morphic does not have such Encoders, tho.

In the end it all seems to be related to the PostScript Canvas, which, understandably, has to have access to certain objects and actually has to "encode" them into a file.

Best regards
	-Tobias



>> 
>> there are no direct users of NullEncoder and FlattenEncoder.
>> 
>> FlattenEncoder class comment is just
>> 
>>    'The simplest possible encoding:  leave the objects as is.'
>> 
>> a bit terse. Does not really say what the issue is about.
>> 
>> 
>> 
>> On 9/29/17, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>> P.S.
>>> 
>>> There is no NullEncoder in Pharo.
>>> 
>>> The class Canvas is not in a package 'Morphic-Support' but in a
>>> package 'Graphics-Canvas'.
>>> 
>>> There is no 'Graphics-Canvas' package in Squeak. [2]
>>> 
>>> Seems like a good idea to move Canvas and subclasses to a package
>>> 'Graphics-Canvas' as well.
>>> 
>>> 
>>> [2] Graphics package in Squeak 6.0a-17405
>>> 
>>> Graphics-Display Objects
>>> Graphics-External-Ffenestri
>>> Graphics-Files
>>> Graphics-Fonts
>>> Graphics-Primitives
>>> Graphics-Text
>>> Graphics-Transformations
>>> GraphicsTests-Files
>>> GraphicsTests-Primitives
>>> GraphicsTests-Text
>>> 
>>> On 9/29/17, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>>> Hello
>>>> 
>>>> NullEncoder is subclass of object ([1] for full hierachy). It is a
>>>> superclass of Canvas.
>>>> 
>>>> What is the function of NullEncoder. No class comment so far?
>>>> 
>>>> Regards
>>>> Hannes
>>>> 
>>>> 
>>>> -------------------------------------------------------------------------------------------------------------------------------
>>>> 
>>>> [1] NullEncoder printHierarchy '
>>>> ProtoObject #()
>>>> 	Object #()
>>>> 		NullEncoder #(''target'' ''filterSelector'')
>>>> 			FlattenEncoder #()
>>>> 				ByteEncoder #()
>>>> 					PrintableEncoder #()
>>>> 						PostscriptEncoder #()
>>>> 							PostscriptEncoderToDisk #()
>>>> 						PropertyListEncoder #()
>>>> 				Canvas #()
>>>> 					ColorMappingCanvas #(''myCanvas'')
>>>> 						AlphaBlendingCanvas #(''alpha'')
>>>> 						ShadowDrawingCanvas #(''shadowColor'')
>>>> 					FormCanvas #(''origin'' ''clipRect'' ''form'' ''port''
>>>> ''shadowColor'')
>>>> 						BalloonCanvas #(''transform'' ''colorTransform'' ''engine''
>>>> ''aaLevel'' ''deferred'')
>>>> 						BlueFormCanvas #()
>>>> 						ColorPatchCanvas #(''stopMorph'' ''foundMorph'' ''doStop'')
>>>> 						MultiResolutionCanvas #(''deferredMorphs'')
>>>> 					PluggableCanvas #()
>>>> 						BufferedCanvas #(''remote'' ''previousVersion'' ''lastTick''
>>>> ''dirtyRect'' ''mirrorOfScreen'')
>>>> 						CachingCanvas #(''cacheCanvas'' ''mainCanvas'')
>>>> 						ClippingCanvas #(''canvas'' ''clipRect'')
>>>> 						MultiCanvas #(''canvases'' ''extent'' ''depth'')
>>>> 						NullCanvas #()
>>>> 					PostscriptCanvas #(''origin'' ''clipRect'' ''currentColor''
>>>> ''shadowColor'' ''currentFont'' ''morphLevel'' ''gstateStack''
>>>> ''fontMap'' ''usedFonts'' ''psBounds'' ''topLevelMorph''
>>>> ''initialScale'' ''savedMorphExtent'' ''currentTransformation''
>>>> ''printSpecs'' ''pages'')
>>>> 						DSCPostscriptCanvas #()
>>>> 							DSCPostscriptCanvasToDisk #()
>>>> 						EPSCanvas #()
>>>> 					RemoteCanvas #(''innerClipRect'' ''outerClipRect'' ''transform''
>>>> ''connection'' ''shadowColor'')'
>>>> 
>>> 
>> 
> 



More information about the Squeak-dev mailing list