GNOME Bugzilla – Bug 166707
GnomeCanvasItem: Enable GObject contruction properties
Last modified: 2014-08-02 12:52:47 UTC
Version details: And 2.8.x Distribution/Version: Debian sid GnomeCanvasItem does not allow for the use of GObject construction properties with gnome_canvas_item_new() due to the two-phase mechanism of object construction. The object properties are set in the second phase, after the initial construction. All properties must therefore be writable post-construction. The attached patch reworks things to use a GObject constructor to replace item_post_create_setup() and removes the need for gnome_canvas_item_construct() by making the parent item and canvas into construction properties. For backwards-compatibility and convenience, gnome_canvas_item_new() sets the "canvas" and "parent" properties automatically, and puts them and the user-supplied properties into a GParameter list to pass to g_object_newv() (the va_list handling is taken from g_object_new_valist()). However, it's now possible to fully-construct canvas items using g_object_new alone, so it's far less crufty than before. For ABI compatibility, it might be necessary to retain gnome_canvas_item_construct(), but stub it out so it simply wraps g_object_set_valist (ignoring the parent argument, since this is construct-only). If you apply this, it should subsequently be possible to make the derived GnomeCanvasItem properties into construction parameters, and (if required) make them construct only. Regards, Roger
Created attachment 37196 [details] [review] Mend GnomeCanvasItem construction so g_object_new works Applies to the CVS mainline or 2.8.0. Regards, Roger
This should also make it easier to language bindings which can't use gnome_canvas_item_new directly.
Created attachment 37209 [details] [review] As before, but construct correctly when no paramters are given When gnome_canvas_item_new is given no extra parameters, set the parent and canvas properties correctly.
Is there a problem with this patch, or can it be applied? Is there anything else I can do? Regards, Roger
There's the problem that gnome-canvas has been mostly unmaintained for years. I'll see if I can find someone to look at the patches.
Thanks. I'll be happy to redo the patches if they need extra work.
It is a valid issue. Also the patch looks good as such.
The last libgnomecanvas code changes took place in January 2011: https://git.gnome.org/browse/archive/libgnomecanvas/log/ This project is not under active development anymore. This project got recently archived in GNOME Git. It is currently unlikely that there will be any further active development. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this bug report in the future if anyone takes the responsibility for active development again. If you are interested in maintainership, inform https://mail.gnome.org/mailman/listinfo/desktop-devel-list