summaryrefslogtreecommitdiff
path: root/giscanner/girwriter.py
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2021-06-17 13:07:35 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2021-08-05 17:47:29 +0100
commitb058ccaedad3c4d353abf3c1d0b490579e246fd0 (patch)
tree901cd1f0f85adbc14fbd5023354e1dd27da4738d /giscanner/girwriter.py
parent63eeaf114b3bf1e946671eaf28312e8c2d3cc891 (diff)
downloadgobject-introspection-b058ccaedad3c4d353abf3c1d0b490579e246fd0.tar.gz
Add introspection data for property accessors
A GObject property can be accessed generically through the GObject API, e.g. g_object_set_property() and g_object_get_property(). Properties typically also have public accessor functions, which are (according to our own best practices) called through the generic API. The introspection data is currently missing the relation between a property and its public accessor functions. With this information, a language binding could, for instance, avoid exposing the C API entirely, thus minimizing the chances of collisions between property names and accessor functions; alternatively, a binding could call the C API directly instead of going through the generic GObject API, thus avoiding the boxing and unboxing from a native type to a GIArgument and finally into a GValue, and vice versa. In the GIR, we add two new attributes to the `property` element: - setter="SYMBOL" - getter="SYMBOL" where "symbol" is the C function identifier of the setter and getter functions, respectively. The `setter` attribute is only applied to writable, non-construct-only properties; the `getter` attribute is only applied to readable properties. We maintain the ABI compatibility of the typelib data by using 20 bits of the 25 reserved bits inside the PropertyBlob structure. The data is exposed through two new GIPropertyInfo methods: - g_property_info_get_setter() - g_property_info_get_getter() which return the GIFunctionInfo for the setter and getter functions, respectively.
Diffstat (limited to 'giscanner/girwriter.py')
0 files changed, 0 insertions, 0 deletions