dearimgui / dear_bindings

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

Add parsing of callback functions #4

Closed emoon closed 2 years ago

emoon commented 2 years ago

Currently callback functions doesn't get parsed so they end up like this is in the metadata

                {
                    "name": "alloc_func",
                    "type": "void* (*alloc_func)(size_t sz, void* user_data)",
                    "is_array": false,
                    "is_varargs": false
                },

It would be great to parse out the arguments and such for the callback as well. While the consumer of the metadata can do it themselves I think it would be better if the metadata could provide it (as it already has a C/C++ header parser in place)

ShironekoBen commented 2 years ago

Yeah, that sounds like it would be very useful. I've added a type_details key to function pointer types that contains the expanded internal representation of the type data. Thanks!

emoon commented 2 years ago

Looks good!