Redo of D2805 (both the initial diff & the reac-ted version).
This makes it possible for JS to create & delete GUI Objects, instead of having to rely entirely on XML definitions.
Advantages:
- It's easier to do dynamic controls, e.g. the gamesetup XML currently contains N buttons, M dropdowns, P sliders, but with this code the relevant controls could just set up their own elements instead of having to hope it's there.
- Likewise, makes things like including a whole 'JS component' doable by just creating a class & letting it init its own XML (see map browser for a likely use case).
This diff in particular has one trick up its sleeve: it allows the JS code to use objects to create components instead of inline XML, which is much nicer to work with in javascript and was the biggest drawback of D2805.
As a side effect, this makes it possible to load scripts from JS.
To implement this, a JS->XMB function is implemented (somewhat WIP for now).
To make deleteChild nice, ScriptInterface::FromJSVal<IGUIObject*> is implemented. To make that safe, it checks that the argument being passed is indeed a proxy object. This changes the GUI proxy objects to all have the same class definition which seemed fine for now.
TODO:
- Would be rather nice to be able to duplicate child objects.
- Would be thrifty to parse XMB to JS, to have both-ways conversion.