Brainstorm how to generate GObject Introspection data automatically, plus C header files
It should be possible to make our procedural macro generate GObject Introspection data (foo.gir
) automatically. This will let the generated code be consumed by language bindings, like if it were written in C.
While we are at it, it should also be possible to generate C header files for the generated GObject API.
I'm not sure how this should work. Should this be specified in the same place as the gobject_gen!
invocation? (Is it possible to specify attributes before a proc macro invocation?)
#[generate_gir("foo.gir")]
#[generate_c_header("foo.h")]
gobject_gen! {
"foo.gir",
"foo.h",
class Foo {
...
}
impl Foo {
...
}
}