Add overrides to project configuration
In some cases we want to be able to add overrides or more meta-information to the introspection data from the project configuration.
Use cases
Ignored symbols
By necessity, everything in the introspection data is public. At most, you can mark structure fields as private, but things like signals or properties are always visible.
Example: GtkStyleProvider::gtk-private-changed
.
Symbol classification
It would be interesting to provide annotations that classify a symbol or an identifier for different audiences. For instance: gtk_widget_set_parent()
/gtk_widget_unparent()
are meant to be used by widget implementors, not by application developers; additional tags would allow creating sub-indices, or could change the searching results. This information is not useful for the introspection data, since all API needs to be exposed anyway.
Search weights
When searching for show
, it's likely we want something like gtk_widget_show()
to have more relevance than gtk_show_about_dialog()
. Adding weights to symbols has nothing to do with the introspection data, but it can be useful for the API reference.
Strawman implementation
The project configuration file could get a new section, similar to the GIR tool from the gtk-rs project. For instance:
[[object]]
name = "StyleProvider"
tags = ["css", "style", "widget-devs",]
[[object.signal]]
name = "gtk-private-changed"
hidden = true
[[object]]
name = "Widget"
[[object.method]]
name = "show"
weight = 1.2
[[object.method]]
name = "set_parent"
tags = ["widget-devs",]
[[object.method]]
name = "unparent"
tags = ["widget-devs",]
The data would then be part of the configuration object propagated to the template, and we could use it when generating the HTML.