Re: [Vala] generated c code and properties



Sorry I've read your post several times, but I don't understand what Vala
generated code is missing. Can you please provide vala code and say what
the generated C code is missing?


On Fri, Jun 6, 2014 at 6:19 PM, Brian <thebutterknife gmail com> wrote:

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

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list




-- 
www.debian.org - The Universal Operating System


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