[Panel-devel] applet and data engine "management"

Matt Williams matt at milliams.com
Fri May 25 18:04:42 CEST 2007


On Friday 25 May 2007 02:20:37 Aaron J. Seigo wrote:
> On Thursday 24 May 2007, Matt Williams wrote:
> > On Friday 25 May 2007 00:07:35 Aaron J. Seigo wrote:
> > >...
> > >  - Applets, on the other hand, are managed by the container that
> > > displays them. there is no additional management that goes on, so all
> > > we need are a couple of static factories. additionally, some of the
> > > data must be global to work properly; specifically, the appletID which
> > > should be globally unique.
> >
> > That 'container' being the QGraphicsScene and therefore the Desktop
> > class? So the Desktop is in a way the AppletManager?
>
> right, for geometry and grouping. and of course panels will also be made of
> a Desktop widget. which is .. counterintuitive =) i need a new name for
> that class.

So we'll have one RootWidget loaded at any time (ignoring multi-head for now) 
and that will be controlling any number of "Desktop"s. Each of 
these "Desktop"s will be displaying something different, say one will be 
acting as the panel, another as the traditional desktop layer and so on.

Would it then make sense to rename "Desktop" to something 
like "PlasmaViewBase" (since it is, in fact, just a QGraphicsView), give it 
virtual functions for loading applets and then derive special cases from this 
for e.g. the Desktop or the Panel. All these base classes will do is handle 
their geometry differently (the panel will be mostly linear for example) and 
different rules for applet placement and Form handling.

Something vaguely like:

class PlasmaViewBase : public QGraphicsView
{
    Q_OBJECT
    public:
        PlasmaViewBase(QWidget* parent); 
        ~PlasmaViewBase();

    public Q_SLOTS:
        virtual void addPlasmoid(const QString& name);
        <et cetera>
};

class Desktop : public PlasmaViewBase
{
    Q_OBJECT
    public:
        Desktop(QWidget* parent);
        ~Desktop();

    public Q_SLOTS:
        void addPlasmoid(const QString& name); //reimplemented here to allow 
                                                 placement rules etc.
        <et cetera>
};

class Panel : public PlasmaViewBase
{
    <Same again...>
};

Or do we not want to be creating special cases for Panels or Desktops? Rather 
to treat them identically? If so, Simply renaming "Desktop" to "PlasmaView" 
would clear things up a bit?

-- 
Matt Williams
http://milliams.com


More information about the Panel-devel mailing list