GNOME Bugzilla – Bug 72426
AtkRelation can not be instantiated with only g_object_new()
Last modified: 2004-12-22 21:47:04 UTC
*_new() methods should be only convenience functions which call g_object_new() with appropriate properties. This is necessary for language bindings.
If I understand you correctly, AtkRelation needs to define two properties, "relation_type" and "targets" so that an AtkRelation can be created using a call to g_object_new(). Is this correct? Are you asking that the signature of the function atk_relation_new() be changed?
Yes, it's normal to have properties which can be supplied to g_object_new(). Another alternative that's acceptable for some language bindings but not for all, and not for glade-like RAD systems is to add a _construct() function that's called by the _new() function. No, I'm not asking for the signature of atk_relation_new() to be changed. We (gtkmm) don't use atk_relation_new().
Created attachment 6860 [details] [review] Proposed patch to fix problem
I have attached a patch to fix the problem. Is this the type of change you had in mind?
Yes, though I think people will frown upon the use of a bare void* property. I think that there may be more structured alternative property types, but I'm not sure. Adding properties _is_ an API change, by the way.
This is still better than nothing, and should be applied.
I think a patch like this (preferably with a structured type for the "targets" list, as Murray suggests) should be applied. It will require RT review I believe, and it's not clear whether it should go to HEAD or an ATK 1.X branch.
I do not see an existeing type I can use; perhaps I need to define a new type.
Created attachment 13558 [details] [review] Updated patch
I have attached an alternative patch which uses GValueArray as property value for the array of objects in the relationship. I propose to commit this once we branch after GNOME 2.2.
Patch has been applied to CVS HEAD after branch for gnome-2-2.