Re: g_object_ref_sink and GUnowned

On Dec 31, 2005, at 7:56 AM, Emmanuele Bassi wrote:


On Wed, 2005-12-28 at 12:45 -0500, Havoc Pennington wrote:
On Thu, 2005-12-22 at 19:02 +0100, Tim Janik wrote:
in fact, there is no technical reason for this.

Not that it's all that relevant ;-) but I also thought a flag in the
class would be fine (and I thought a separate class would be fine too),...

Instead of having a useless class, there just for making it obvious that
the object is floating, can't we add a class flag, like:

Pardon me butting in with my possible stupidity, but what's wrong with leaving GtkObject alone and adding GFloatableObject/ GInitiallyUnowned/GSomeGoodNameForObjectWithFloatingFlag as a sibling, a child of GObject?

I fully understand the desire to provide the floating semantic implementation in a common place to avoid multiple reimplementations. However, trying to changing the underlying implementation of GtkObject in the middle of a stable API / ABI series is difficult and dangerous! Given this, is it absolutely, unavoidably necessary to push the implementation of GtkObject's floating flag down to GObject? Is it really so terrible to have two floating implementations in existence, a reusable one in libgobject, and a legacy one in libgtk?

- Changing the ancestry of an object can break old code and encodes the implicit knowledge of the ancestry, so adding GInitiallyUnowned between GObject and GtkObject is bad.

- Adding floating machinery and semantics to GObject is confusing because it adds ambiguity to the semantics of usage of GObjects, so just adding a floating flag to GObject itself is bad.

Sounds to me like the best solution is

   GObject       (non-floating, unchanged from current impl)
+--- GtkObject (adds floating and flags, unchanged from current impl)
    +--- GFloater   (new object, adds floating semantics)

And then, in gtk+ 3.x, GtkObject can be removed altogether and replaced with GFloater, or whatever it's called.

However, like all drugs, PANEXA can produce some notable side effects, all of which are probably really, really terrific and nothing that anyone should be concerned about, let alone notify any medical regulatory commission about.

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