[Vala] Property accessors in bindings



Hi,
  last month I posted this message [1] in this list but, as you can see, it
went unanswered. As it was a some time ago, I'm writing to see if someone
can answer it now.

  Since my first post I've figured out that what I need to do is make
vapigen not to use the [NoAccessorMethod] property attribute, but I've
found nothing about this attribute in the GIR metadata format [2] or in the
GObjectIntrospection annotations [3] documentation. What I found is that
the GIDL metadata format has a way to set property attributes [4]. But as
far as I know and according to my tests, this format is not working with
the version 0.20 of vala.

  Also, I've seen that there are some properties generated without the
[NoAccessorMethod] attribute and are translated using the accessor methods
I created for these. I don't notice any difference between these and the
ones with the attribute set in the C code. I don't know how to tell vapigen
wich methods to use for each property neither, so I guess it's done using
method names like {get | set}_property_name in C.

  I have to note that the *_{get | set}_property methods of my classes call
my accessors methods so the execution result I have now will be the same,
but what I want is to avoid the extra work done by the call to
g_object_{get | set} when I have a method written to do the same, that can
also increase the readability of the generated vala code.

Regards,
  Alex

PS: I also asked in stackoverflow [5], with almost the same results.

[1] https://mail.gnome.org/archives/vala-list/2013-July/msg00043.html
[2] https://wiki.gnome.org/Vala/Manual/GIR%20metadata%20format
[3] https://wiki.gnome.org/GObjectIntrospection/Annotations
[4]
https://wiki.gnome.org/Vala/Manual/GIDL%20metadata%20format#Properties_Reference
[5]
http://stackoverflow.com/questions/18308629/how-to-tell-vala-which-getters-and-setters-to-use-using-gobjectintrospection-and


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