A peak at the future windowing

From time to time things are happening in Pharo that are not mentioned in the mailing-lists because there are experiences or just work in progress. We want to share one with you.

Ronie Salgado and Igor Stasenko wanted to accelerate the Cairo, openGL and other renderings.

So they started to create at the image level a way to access all the OS elements for windowings (events and properties) and as such shortcut the old VM code. They can now create windows on X11 and get all the events. They convert the OS events into Morphic events and everything works. This is interesting because it is probably the architecture of future Pharo. We will need to define similar primitives to other platforms and to define some new Events and logic at the image level. They designed a OSWindow abstraction and new event hierarchies.

And this is really exciting.

Here is one of the mails that they sent internally:

Today we worked on translating most basic events like mouse and keyboard.

Things vent quite smooth and we managed to make most of things working:

– mouse movement

– mouse buttons

– and even mouse wheel events without much hassle

Keyboard was also relatively easy to convert, up to the point that most of basic keys work including control ones. But it is not quite complete..

As a bonus, now we can receive separate events generated from pressing keys like shitf/ctrl etc… the only thing which makes me sad is that morphic events tend to obscure and obfuscate things…

We do 2-step translation:

X11 event hierarchy -> OSEvent hierarchy -> Morphic event hierarchy

The OSEvent will be our new platform-neutral evens, which is similar what we did with Stef for SystemEvent(s), except that it doesn’t relies on VM and tries to preserve all of the information which original event(s) has.

Like that there is always a way to deal with special cases if extra information is needed.

Morphic events is a big mess, and translation is lossy, but we just want to make things work more or less fine, and deal with problems step by step.

What is fun, that all this event handling stuff written purely with smalltalk, with FFI and system quite responsive and there is no noticeable lags/whatever.




3 thoughts on “A peak at the future windowing

  1. Carl Gundel says:

    Great to hear about this. Screenshots? 🙂

    What about Mars? Is there any overlap with this project?

  2. So far we get exactly the same. What you will be more interested in is Athens because Pharo will be fully vector graphics. We can already get all the basic elements in vector graphics except the texteditor which is currently reimplemented. This is a bit related to Mars in the sense that we will get information directly from the OS. We will have to see this evolves.

  3. Carl Gundel says:

    Hi Stephane,
    To me the most essential thing is native window frames, and access to the common dialogs for printing, file open/close, font selection, color selection, etc.
    Native widgets inside the window frames would also be nice, but less important.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: