Skip to content

Include the default value of a property in the GIR data

Emmanuele Bassi requested to merge ebassi/property-default-value into main

We use g_param_spec_get_default_value() to get the default GValue of a GParamSpec, and then we serialize it into a string according to the value's own contents and type.

The default value is stored inside the GIR data, as the conversion to a string is lossy by definition, and will rarely (if ever) round-trip.

To allow for property values that do not allow transformations to a string, we add a freeform default-value annotation.

Fixes: #4 (closed)

Edited by Emmanuele Bassi

Merge request reports