[Vala] generated c code and properties



Hi all,
I've searched high and low for some information, but have been unable to find 
any on this particular situation.

Hand coding GObjects in C allows for one get and one set function that take 
property id as an input. For example:

object_set_property (GObject * object, guint property_id, Gvalue, GParamSpec);

And then a switch case statement inside the set function uses the property_id 
to decide which property to set. the property_id values are defined with an 
enum.

When coding GObjects in vala, however, each property is given its own get and 
set function in the C code.  The funny thing is I still see a property value 
enum (that does not get filled out), as well as the generic get and set 
functions with empty (default only) switch case statements.

I already have gobject bindings that use the generic get/set functions. I'd 
rather not have to edit the vala-generated C code to use them.

My question is, is there a way to get vala to automatically generate the 
enums, and switch case statements? If not, is there a recommended approach?

I love the idea of not having to write all the GObject boilerplate and writing 
in vala rather than C. I really hope that I'm just missing something. Any help 
or ideas are much appreciated.

Brian



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