dearimgui / dear_bindings

C header (and language binding metadata) generator for Dear ImGui
MIT License
221 stars 12 forks source link

Forward declaration of structs missing in metadata #2

Closed emoon closed 2 years ago

emoon commented 2 years ago

Hi,

I'm currently using the metadata output to generate new Rust bindings for Dear Imgui. On thing that I noticed was missing in the metadata output is forward declaration of structs that are just forward declaration.

On example is ImGuiContext that is used in

            "name": "ImGuiCreateContextEx",
            "original_fully_qualified_name": "ImGui::CreateContext",
            "return_type": "ImGuiContext*",
            "arguments": [
                {
                    "name": "shared_font_atlas",
                    "type": "ImFontAtlas*",
                    "is_array": false,
                    "is_varargs": false,
                    "default_value": "NULL"
                }
            ],

For example. ImGuiContext is just an internal type and that is all fine, but I think it would make sense to include it in the metadata so user of the metadata knows about.

ShironekoBen commented 2 years ago

Yeah, that's a very good thought - I've added forward-declarations to the metadata, marked by forward_declaration being set to true. Does that look like it would help with your use-case?

emoon commented 2 years ago

Yeah that should be all fine. Thanks!