Le 27/10/16 à 10:57, Guille Polito a écrit :
Something itches me from this discussion.
I somehow find myself with Glenn:
- should Bloc work with other than SDL/OSWindow?
- should SDL/OSWindow work with other than Bloc?
Merging the event hierarchy may prevent these two scenarios. And these
scenarios are not only really possible: this is what the current
scenario is. On one hand SDL and OSWindow work today with Morphic
besides Block. On the other hand Bloc is, after all, an external
library loaded on top of Pharo.
To explain better what I think:
- First I have the feeling that BIEvent and OSEvent are not the same
thing. They have the same *NAME*. But they model different concepts.
What is an event in bloc does not make sense in OSWindow and
vice-versa. Why? because OSWindow does not manage widgets nor
interactions between them.
- Second, I think that this idea of merging these hierarchies means
merging layers also, what leads also to our monolithic system. I agree
that this may impose some maintenance burden because there is the
maintenance of the two layers plus their mapping (e.g., between the
low-level events and the high-level events). But otherwise we are
tampering the modularity.
Now, I liked more the suggestion of making Bloc using SDLEvents directly.
But then, wasn't it an idea behind OSWindow that users of OSWindow
should be somehow abstracted from the backend behind. And SDL be just
a backend? Something like Athens and Cairo.
Is SDL meant to work alone or be just a backend for OSWindow? Because
if the case is the later, then maybe it makes sense to do the inverse:
SDL should generate directly OSEvents and we should not have SDLEvent.
may be.
Now I do not think that doing more than two transformations is good.
And going even further: Is OSWindow used in isolation? e.g., without
morphic or bloc.
Because then, it the problem is the runtime overhead OSWindow should
maybe not reify its events but propose a low level event handler
mechanism where we could have
MorphicOSWindowEventHandler
>> keyEvent: ...
>> mouseEvent: ...
BlocOSWindowEventHandler
>> keyEvent: ...
>> mouseEvent: ...
And each framework generates its own events from low level SDL data.
No event transformations, less duplications, and both Bloc and Morphic
are plugged on top of OSWindow but not really strongly coupled to it.
may be