Review Request: State machine architecture for PMC

Alessandro Diaferia alediaferia at
Thu Apr 8 18:59:06 CEST 2010

2010/4/8 Aaron J. Seigo <aseigo at>

> On April 8, 2010, Christophe Olinger wrote:
> > One thing missing is the layout of the actual subComponents in the
> applets.
> > Currently they are just added in a row. For this we need the API. The
> > layout should recognize which type of applet arrives and lay it out
> > accordingly. That means lots of if/thens within tha applet code. This
> also
> > means adding new states with new subcomponents would mean adding if/tehns
> > to the actual addToLayout functions in the applets.
> what i'd recommend is to provide a way to tag subcomponents with values
> (e.g.
> an enum) that says something about what they do.
> divide up each MainComponent into "zones" (navigation, media playing,
> status,
> whatever :) and then each sub component can be tagged by the creator of the
> sub component (e.g. a state) with what it is.
> then the main components will know which zone they belong in.
> from there, i'd go with a naive implementation, at least at first, that
> just
> puts things into the respective zones on a first-come-first-placed basis.

This makes me thinking about the MediaLayout object. Now it resides inside
the containment implementation.
Probably we should have something that specifies wher the subComponent is
suggested to be placed; this
can likely be:
- Fullscreen
- AppearingFromLeftEdge
- AppearingFromTopEdge
- AppearingFromBottomEdge
- AppearingFromRightEdge
- Invisible

Then the layout object should place them accordingly. Those are just my 2
cents. Better ideas are welcome :-)


> this alleviates the needs for if/else and odd interactions between state
> plugins and the main components that need to lay out a plugin's custom sub
> components.
> --
> Aaron J. Seigo
> humru othro a kohnu se
> GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43
> KDE core developer sponsored by Qt Development Frameworks
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at

Alessandro Diaferia
KDE Developer
KDE e.V. member
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Plasma-devel mailing list