[RFC] automatic property getters and setters



as discussed a while back[1], here's a way to remove the need for
Glib::Object::Subclass to provide GET_PROPERTY/SET_PROPERTY.  this is
step one, providing a fallback; step two is adding the per-property
setters and getters that would take precedence over [SG]ET_PROPERTY and
this fallback.

this fallback does the same as the default behavior provided by
Subclass; provide property storage in the wrapper hash.  this goes a
step further for GETting, fetching a default value for the property if
one is available.  thus, the default value you give when creating
properties actually has a purpose.  :-)

attached is the patch that adds this fallback behavior to Glib HEAD (or
1.050), and a simple driver program.  the patch as provided includes
some debugging output which i think is the cause for the warnings from
the test suite.

your comments would be greatly appreciated.


[1] the thread starts here, with jan's suggestion:
http://mail.gnome.org/archives/gtk-perl-list/2004-May/msg00037.html
after discussion, this is roughly what i'm starting to implement:
http://mail.gnome.org/archives/gtk-perl-list/2004-May/msg00048.html

Attachment: param_test.pl
Description: Text Data

Attachment: property-fallback.patch
Description: Text document



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