After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 116734 - object properties should not be G_TYPE_POINTER
object properties should not be G_TYPE_POINTER
Status: RESOLVED FIXED
Product: libgnomecanvas
Classification: Deprecated
Component: core
CVS HEAD
Other All
: High normal
: ---
Assigned To: libgnomecanvas maintainers
Federico Mena Quintero
: 131280 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-07-05 00:38 UTC by muppet
Modified: 2005-05-19 13:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add boxed type support for GnomeCanvasPathDef and use it in GnomeCanvasBpath. (3.31 KB, patch)
2004-01-26 03:40 UTC, muppet
none Details | Review

Description muppet 2003-07-05 00:38:44 UTC
i'm writing perl bindings for libgnomecanvas (http://gtk2-perl.sourceforge.net/); these 
bindings rely on proper argument types (e.g., double, boxed, object, etc) for values to pass 
correctly through g_object_set, including gnome_canvas_item_new, which uses g_object_set.

however, some object properties (GnomeCanvasItem's bpath property, 
GnomeCanvasClipGroup's bpath property, and GnomeCanvasShape's dash property) are 
declared as G_TYPE_POINTER properties; this means that no type-checking can be done, no 
destructors or indeed any type-based code can be used for these properties, which means i 
can't bind them to perl.

in general, G_TYPE_POINTER is dangerous and should not be used, as it makes life difficult 
in non-C languages.  there needs to be GBoxed wrappers for the various datatypes involved.


this situation exists in 2.0.5 and in cvs HEAD as of 4july03 (according to cvs.gnome.org).
Comment 1 Kjartan Maraas 2004-01-20 13:55:24 UTC
I see only one G_TYPE_POINTER reference in the sources now and that's
render_background. 
Comment 2 Kjartan Maraas 2004-01-20 14:06:52 UTC
*** Bug 131280 has been marked as a duplicate of this bug. ***
Comment 3 muppet 2004-01-26 02:59:26 UTC
g_param_spec_pointer() creates properties of G_TYPE_POINTER.  see
libgnomecanvas/libgnomecanvas/gnome-canvas-bpath.c:103:

	g_object_class_install_property (gobject_class,
                                         PROP_BPATH,
                                         g_param_spec_pointer
("bpath", NULL, NULL,
                                                              
(G_PARAM_READABLE | G_PARAM_WRITABLE)));


a boxed trivial boxed wrapper for the struct would save a lot of grief.
Comment 4 muppet 2004-01-26 03:40:22 UTC
Created attachment 23746 [details] [review]
Add boxed type support for GnomeCanvasPathDef and use it in GnomeCanvasBpath.
Comment 5 Tim Janik 2005-05-16 14:04:23 UTC
This patch should be applied. it is an API change technically, but it doeasn't
have   any mallicious effects in practice (g_object_set() statements will
continue to work). 
Comment 6 Kjartan Maraas 2005-05-19 13:11:30 UTC
Applied. Thanks.