paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [paragui-users] Paragui redesign


From: Alexander Pipelka
Subject: Re: [paragui-users] Paragui redesign
Date: 06 May 2002 19:22:40 +0200

Am Mon, 2002-05-06 um 18.47 schrieb Andrew Ford:
> It would be nice if the loader could send the commands
> from the XML layout directly to the widget when it
> loads, i.e. size, and gradient, and position, etc... 
> But I guess every widget needs its own tags and
> therefore its own handling like you said.  Using this
> arrangement, can user widgets hand XML attributes back
> to their base-classes for processing, i.e. whatever
> attributes have nothing to do with this widget in
> particular get sent processed by a superclass.  Do we
> even need to derive from factory-object instead of
> adding a virtual parseXMLarguments function to
> PG_Widget?  The factory doesn't need it.

Right. The factory just has to create the objects. Parsing can also be
added to PG_Widget.

>   From my perspective, forcing use of a factory via
> protected constructors means that we can force the use
> of reference counters so that the user can't
> conveniently get pointers to widgets to subvert the
> counting mechanism.  They can, of course, but it makes
> it illegal by default and they'll have to work around
> it or specifically request it.

Is it a nessecity to declare constructors protected ?
That would be a bit too much of abstraction for me.

> I forgot to mention
> the unsafe thing about reference counting.  If you
> have a cyclic reference, say parent and child both
> holding a reference to the other, then you're in a
> situation where neither can be deleted.  Since the
> creator is going to get a reference, that means that
> the children will have to get temporary smrtptrs or
> use pointers to their parents.  If smrtptrs are used,
> can we deadlock getting temporary references like
> this?  Or for that matter, do we just send messages to
> our parents and not reference them directly at all?

Hmm,..
One point seem curious to me with that refcounting.
When do pointers get void (what would decrease the refcount) ?
When deleting the pointer/object ?

>   Now that I'm thinking about it, isn't parsing the
> XML attributes like sending events to the widgets, and
> if treated like that, events not handled right now are
> sent up to the super-class for handling until we get
> to PG_Widget...

Kind of. But i think virtual functions fit perfectly for that.

Alex






reply via email to

[Prev in Thread] Current Thread [Next in Thread]