Hello list,

i managed to build a new host windows plugin which currently including
- window management
- event handling
- display/draw support

The difference between old plugin, that for each host window an image
always keeping own instance of HostWindow
and provides an easy and fast way to translate a window hanlde
(reported in events) to a corresponding HostWindow instance.

A plugin, instead of operating with a raw OS window handles, keeping
own list of open windows and lets language side operate with index in
that list.
Now, since all window handles is ordered and start counting from 0 ,
all we need is to keep a WeakArray
and that array at: windowHandle can return us the corresponding
HostWindow instance.

This will allow to direct event handling to a proper HostWindow instance.
That's where the fun begins.

But! A host window is not a Form or DisplayScreen. It having a simple
primitive which , like in old plugin, allows to blit a portion of form
to a host window surface.
Also, a plugin generates events to notify image about different things
like window dimensions has changed or portion of screen need to be
redrawn.

What i would like to ask, is how to wire Form (or some DisplayScreen
subclass) with HostWindow.
Obviously, a HostWindow acts as backend , and don't needs to know
anything about who wants to draw on it or listen for events.

I need an advice , how to bind couple of events, which HostWindow
should handle, and report them further to something which controls
what to draw in it.
Current 'interesting' number of events is quite small:
- a window size has changed (and Form/DisplayScreen need to resync
with new size, obviously)
- a portion of window should be updated/redrawn (and
Form/DisplayScreen needs to repaint the damaged region, obviously)
there, of course will be more, but first things first :)

What you think is the best way for reporting such events?

-- 
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to