[UI] Call to arms
Alain Plantec
alain.plantec at univ-brest.fr
Sun Mar 30 12:53:04 UTC 2008
...
>
> Loaded.
> Tried examples.. Except couple of bugs, all is working well.
>
> Can you describe the essential features of your framework?
Well, here is a short explanation made on the fly. I will take the time to
make a more complete one later somewhere in a wiki.
Miro is based on 4 classes hierarchies: scene, director, announce handler and
actor.
a scene is responsible for the view and basic input events: a scene displays
some content on a canvas and receives mouse and keyboard events.
Miro is made so that it should be possible to use any scene hierarchy.
For now, used root scene class is MiroScene. It is still Morph2 compatible (a
Morph fork). As you can see, only four scene classes are used: MiroImage,
MiroCompositeScene, MiroTransformScene and MiroTextScene. (of course,
HandMorph and PasteUpMorph are also reused).
I think (hope) that it should be possible to use another root scene class
based on Tweak or some Gtk wrapper.
Actor hierarchy represent an abstract widgets hierarchy with button,
scrollbar, scrolled text, text field, ...
Actors are responsible for data management (model management). As an example,
with a text field one can manage a string data, with a radio button one can
manage a boolean...
A director is a mediator between a scene and an actor. Is is responsible for
the composition of the view: a director can be made of a set of directors. as
an example, a scrollbar director is made of a scroller director and of two
repeat button directors. A director is also responsible for the management of
an announcer and of a set of announce handlers.
An announce handler is used to respond to announces. Several announce handlers
can be dynamically assigned to a director in order to do something when an
announce is received. Basically, the set of announce handlers assigned to one
director is fixed by construction (see Director>>setUpAnnounceHandlers).
But, there are some cases where an announce handler is really dynamically
attached to one director. As an example, when a radio button is added to one
container (a box) then, a MiroRadioButtonsBoxSceneHandler is created and
assigned to that box in order to control its set of radio buttons (when a
radio button is checked then all others in the box are unchecked). see
MiroMorphicSceneBuildingHandler>>whenSceneOwnedAnnounce: aMiroAnnounce
The only objects that a client application is manipulating are the actors. the
link between an actor and a director is primarily established by the theme
(see Theme>>directorsRootClass and Theme>>directorClassFor: anActor).
These explanations are certainly incomplete and maybe difficult to follow.
Sorry for that but I can't spend to much time on it now. Hope it helps a
little.
alain
More information about the UI
mailing list