[Grace-core] Grace Graphics API?

Marco Servetto marco.servetto at gmail.com
Thu May 23 01:16:10 PDT 2013


Can you please outline the
"language extensions -- or, if you prefer to call them -- magic methods"
that you had to add?
I'm lately trying to understand what is the minimum set of "system
functionality"
that a language has to offer to be system complete (in a sort of efficient way)

On 23 May 2013 19:13, Michael Homer <mwh at ecs.vuw.ac.nz> wrote:
> On Thu, May 23, 2013 at 6:55 PM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
>> On 22/05/2013, at 23:46 PM, Michael Homer <Michael.Homer at ecs.vuw.ac.nz> wrote:
>>> No it doesn't, it uses a canvas, which is implicitly double-buffered.
>>> The GTK one isn't, but it could be (patches welcome!). See
>>> sample/js/simplegraphics.grace and grace-gtk:simplegraphics.grace. The
>>> actual API is fundamentally the same up to spelling. There are no
>>> elements added and it does the drawing itself.
>>
>> the simplegraphics API surely is retained: in the GTK version the simplegraphics
>> module itself maintains a display list ("instructions") that is drawn by the module in response to
>> "draw" events; there doesn't seem to be a "clear" command but there could be....
>>
>> The JS api (again, I assume) just adds things to the canvas (OK so they're not DOM "elements"?
>> or am I missing something?)   but doesn't have to worry about redrawing
>> (or, again, about clearing)
> It paints onto the canvas, using a fairly standard 2D drawing API that
> maps almost directly onto Cairo, which is what GTK uses. There are no
> elements and no adding, but it is double-buffered, so it survives
> being obscured. There's no reason you couldn't have the GTK version
> paint onto an off-screen pixbuf and then the draw event handler just
> paint that pixbuf onto the DrawingArea; I just didn't do that.
>
> The problems of interaction and starting the synchronous event loop
> remain though.
> -Michael
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core


More information about the Grace-core mailing list