Exposing NoesisGui C++ API to scripting language
Posted: 25 Jul 2019, 23:21
Hello all,
I recently learned about existence of Noesis and I really like what I see so far. I've been through MANY GUI libraries and this one seems to give all the functionality I need. There is just one problem - my project relies heavily on scripting (Angelscript) and Noesis C++ API relies heavily on reflection and templating. I'd like to be able to create a script-side class that would describe some data structure that I could then bind as a data source to XAML. Or create a converter etc. I'm not sure where to begin or even if this is possible. Has anyone tried to implement a scripting bindings where main language is C++ and somehow glued these two worlds together? I have full reflection in my scripting language and I can even use meta data annotations for my props so I could easily turn them into Noesis-enabled properties etc. - the problem is that Noesis expects me to register C++ classes through templated interfaces and it doesn't play with runtime-based scripting.
I'm thinking of some way to wrap it into a single "ScriptComponent" class that would somehow work as a bag containing script instance that has some props, and then expose these props through something that is known to Noesis. But all I see is heavily macroed/templated stuff. Is there some way into the API that would allow me to provide such functionality in a more passive way - where Noesis queries props rather than expecting me to set them through C++ reflection system, which I'm not sure I can mimic and tie to my script classes :/
Any input welcome!
I recently learned about existence of Noesis and I really like what I see so far. I've been through MANY GUI libraries and this one seems to give all the functionality I need. There is just one problem - my project relies heavily on scripting (Angelscript) and Noesis C++ API relies heavily on reflection and templating. I'd like to be able to create a script-side class that would describe some data structure that I could then bind as a data source to XAML. Or create a converter etc. I'm not sure where to begin or even if this is possible. Has anyone tried to implement a scripting bindings where main language is C++ and somehow glued these two worlds together? I have full reflection in my scripting language and I can even use meta data annotations for my props so I could easily turn them into Noesis-enabled properties etc. - the problem is that Noesis expects me to register C++ classes through templated interfaces and it doesn't play with runtime-based scripting.
I'm thinking of some way to wrap it into a single "ScriptComponent" class that would somehow work as a bag containing script instance that has some props, and then expose these props through something that is known to Noesis. But all I see is heavily macroed/templated stuff. Is there some way into the API that would allow me to provide such functionality in a more passive way - where Noesis queries props rather than expecting me to set them through C++ reflection system, which I'm not sure I can mimic and tie to my script classes :/
Any input welcome!