I was in the process of attempting to port GtkFixed to Vala as a way to learn the language (so-to-speak implementing a custom LayoutManager).
There I’ve noticed, that the member variable “layout_child_type” (of GtkLayoutManagerClass) gets overridden by the GType created for the GtkFixedLayoutChild class.
In the vapi, this field doesn’t seem to be accessible in GtkLayoutManager.
Seeing that this is a class member, I’d guess that normally, one would use templates in C++ or generics in Vala. Now the question I’m asking myself is, which is the appropriate way of overriding this field?
Currently, I think the following would be the easiest way:
- Add layout_child_type to GtkLayoutManager vapi declaration via yet unknown vapigen mechanism (presumably .metadata files?)
- Set layout_child_type in “class construct”-block in Vala file via “typeof(GtkFixedLayoutChild)”.
What do you think?