Squeak needs printing capabilities

Boris G. Chr. Shingarov usib6tfj at pol.ru
Thu Apr 9 03:02:22 UTC 1998


Tim Rowledge wrote:

> Sorry Reiner, but I disagree with your sentiment very strongly.
> Complicated things ( and printing is often complicated) ought to be
> in the image, since Smalltalk is good at handling complicated things.
> There is no need for _users_ of the facility to have to worry about
> the platform details, but that does not mean that the implementation
> has to be buried in the VM. In much the same way that filenaming
> details are handled (albeit poorly at the moment) by having platform
> specific subclasses, platform specific printing can  be catered for
> by having subclasses of some printing-interface class. Some parts may
> involve platform specific primitives, or better yet, systemcall code
> which avoids too much complication of the VM code. There need not be
> any troubling image size problem if the code is dynamically loaded.
> 
> The VM is already _way_ too complicated and convoluted. Let's avoid
> making it worse.

I *completely* agree with Tim.  WRT platform _independency_, I can
think of a way similar to what I do in Cheese: when the user wants to
open a window, the underlying Cheese code uses Smalltalk>>vmPlatform
to see what platform it's running on, and takes the action appropriate
for that platform.  WRT technical possibility to print without VM
support, I see absolutely no difficulty here.  On Unix we can write
to the device file.  On systems with dynamic linking we can link to
everything from Smalltalk.  SqDLL on OS/2 and SqAPI in Win32 do just
that.  For example Cheese paints native windows without VM support,
and I don't believe printing is more platform-specific than painting
native widgets.  In fact I think the low-level stuff is pretty obvious
and easy to implement once we decide on what things should look like
from the user's perspective, i.e. what functionality we want at high
level.  Something immediately coming to my mind, make Printer understand
the protocol for Stream and print like, myText printOn: lj.  The
printer to print on may be selected programmatically or through a
'global preference'.  I don't know what highlevel approaches do other
Smalltalks use, I only used IBM's Common Printing whose approach
is absolutely terrible - no no no I want something simple / more
surveyable.

Boris





More information about the Squeak-dev mailing list