Hi all.<br><br>I&#39;m about to start work on a project called &quot;Subcanvas&quot;, 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.<br>
<br>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?<br><br>Current &quot;design sketches&quot; are at <a href="http://gulik.pbwiki.com/Canvas">http://gulik.pbwiki.com/Canvas</a>.<br>
<br>This API will be the main graphics / event-handling API for my SecureSqueak project (<a href="http://gulik.pbwiki.com/SecureSqueak">http://gulik.pbwiki.com/SecureSqueak</a>). 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.<br>
<br>Features of it are:<br>* 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&#39;s capabilities.<br>
<br>* The Canvas will be a general abstraction for underlying 2-D vector-based or raster-based drawing APIs - e.g. Forms/BitBlt, OpenGL, VNC.<br><br>* 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 &quot;keyboard focus&quot;.<br>
<br>* Canvases must be &quot;secure&quot;; as this will be part of SecureSqueak. Specifically:<br>&nbsp;&nbsp; * Canvas methods must be locked down so that users cannot gain unauthorised access to anything or cause destructive behaviour.<br>
&nbsp;&nbsp; * Drawing operations will be clipped. Having access to a canvas only allows the user to draw in that particular area.<br>&nbsp;&nbsp; * Stalled event handlers or drawOn: methods will not affect the operation of other Canvases on the screen.<br>
<br>* The coordinate system will use micrometers; 0@0 will be at the bottom left corner of the canvas. Each Canvas will provide a &quot;pixelPitch&quot; method to return the number of micrometers in each pixel (if that Canvas has pixels :-) ) so that pixel-based operations are possible.<br clear="all">
<br>I don&#39;t know how to handle fonts - I don&#39;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. <br><br>
Gulik.<br><br><br>-- <br><a href="http://people.squeakfoundation.org/person/mikevdg">http://people.squeakfoundation.org/person/mikevdg</a><br><a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a>