GNOME Bugzilla – Bug 778144
Allow disabling introspection for ancillary property mechanisms
Last modified: 2017-02-16 16:40:44 UTC
Currently, GTK-Doc will inspect the type of a class and apply additional introspection rules: - for GtkWidget, it will try to extract style properties - for GtkContainer, it will try to extract child properties Of course, this assumes that GTK+ will always ship with those two features. Sadly, GTK+ 4.x is in the process of deprecating and subsequently removing style properties from GtkWidget; additionally, child properties are not exceedingly loved and may be on the chopping block in a future major API development cycle. We still want GTK-Doc to generate documentation for style and child properties when dealing with GTK+ and projects based on GTK+ from the 3.x API series, but for we should also have an escape hatch for newer releases without those two sources of properties. Since this is part of the gtkdoc-scan pass, I think a good solution would be to add a command line argument to that, e.g. gtkdoc-scan \ --disable-widget-style-properties --disable-container-child-properties … A different approach would be to check for the GTK+ version currently in use, but then gtk-doc would need to maintain an internal list of what API is available, and an additional command line argument to relay the version information from the build system to gtkdoc-scan, e.g. gtkdoc-scan \ --gtk-version=3.90.1 \ …
I think adding a #if GTK_CHECK_VERSION into the generated scan code is not a big deal, since this is gtk specific already anyway. From which version on should I skip them? Are both gone in 3.90.1 already (or is it okay to ignore them starting with this version?).
(In reply to Stefan Sauer (gstreamer, gtkdoc dev) from comment #1) > I think adding a #if GTK_CHECK_VERSION into the generated scan code is not a > big deal, since this is gtk specific already anyway. > From which version on should I skip them? Are both gone in 3.90.1 already > (or is it okay to ignore them starting with this version?). I'd start from `(3, 89, 0)` to ignore the style properties, as that would allow releasing GTK+ itself without getting compiler warnings and/or errors. The function to list style properties itself was removed in: https://git.gnome.org/browse/gtk+/commit/?id=6c6ed7496c10e95ba159c141c24d57f7ccd3435f
Created attachment 345674 [details] [review] scangobj: Protect style property inspection The API to list style properties on GtkWidget was removed in GTK+ 3.89. We need to protect the call to gtk_widget_class_list_style_properties() with a version check.
this would be very nice to land; I need this patch to be able to build gtk 3.89 snapshots
Review of attachment 345674 [details] [review]: Thanks for the patch
The following fix has been pushed: 5bd7638 scangobj: Protect style property inspection
Created attachment 345965 [details] [review] scangobj: Protect style property inspection The API to list style properties on GtkWidget was removed in GTK+ 3.89. We need to protect the call to gtk_widget_class_list_style_properties() with a version check.