[squeak-dev] Subcanvas

Michael van der Gulik mikevdg at gmail.com
Thu Jul 3 23:08:34 UTC 2008


Hi all.

I'm about to start work on a project called "Subcanvas", which will be a
refactoring of the Canvas class. The intention is that this forms a platform
for other GUI projects, including a possible future version of Morphic. It
will be a general 2-D drawing API and event handling system.

Is anybody interested in this? Does anybody have any comments on any of the
following? Are there any annoyances with the current Canvas class that
people want to rant about?

Current "design sketches" are at http://gulik.pbwiki.com/Canvas.

This API will be the main graphics / event-handling API for my SecureSqueak
project (http://gulik.pbwiki.com/SecureSqueak). It is likely that Morphic
will be ported to it at some stage. The code will be written using
Namespaces and my own Package system, and it will be the first real trial of
my Namespaces architecture.

Features of it are:
* Some canvases can have child canvases, each with a z-index. These could be
used, e.g., to implement movable windows, sprites, clipped scrollable areas,
or flyweight graphics. This will use the underlying graphics system's
capabilities.

* The Canvas will be a general abstraction for underlying 2-D vector-based
or raster-based drawing APIs - e.g. Forms/BitBlt, OpenGL, VNC.

* An event handling system will also be part of this package. Mouse events
will have a canvas (or sub-canvas) coordinate; keyboard events will be sent
to the canvas that has the "keyboard focus".

* Canvases must be "secure"; as this will be part of SecureSqueak.
Specifically:
   * Canvas methods must be locked down so that users cannot gain
unauthorised access to anything or cause destructive behaviour.
   * Drawing operations will be clipped. Having access to a canvas only
allows the user to draw in that particular area.
   * Stalled event handlers or drawOn: methods will not affect the operation
of other Canvases on the screen.

* The coordinate system will use micrometers; 0 at 0 will be at the bottom left
corner of the canvas. Each Canvas will provide a "pixelPitch" method to
return the number of micrometers in each pixel (if that Canvas has pixels
:-) ) so that pixel-based operations are possible.

I don't know how to handle fonts - I don't know what the pros/cons of having
a font API built in to the canvas is, or whether it is better to have the
font drawing done externally by each application.

Gulik.


-- 
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080704/336300fd/attachment.htm


More information about the Squeak-dev mailing list