JSI_GUIMouse:rP666 introduced the GUI <-> JS Interface.rP8657 removed the only use of JSI_GUIMouse, and because nowadays SDL events are converted to JS and since it doesn't really make sense to create a Mouse object in JS and send it to C++, the class should
be considered obsolete and removed.

JSI_IGUIObject::constructrP666 also introduced the constructor of JSI_IGUIObjects. But that constructor is (at least nowadays) only called form JS and adding new GUI objects from JS is something we
don't have a use case for yet, it would likely add to messy code. It is good to have every JS object defined in XML prior before they are accessed, leaving the new reader with a clear summary of which
objects exist before they start to dig into the code. If we ever run into a use case where we want to add a GUIObject by JS, there will have to be much more code, updating the GUI page with the new
object and such. Conclusively this constructor is unused and merely confusing the reader by pretending to be relevant.
Notice that JSI_GUISize and JSI_GUIColor actually are created from JS and passed to JS, so it makes sense to have these JSClasses.

Cleanup:

The headers are rectified a bit.

The JS functions receive the JSPROP_ENUMERATE, JSPROP_READONLY, JSPROP_PERMANENT flags, so that JS can't mess with them.

{ 0 } -> JS_PS_END

Rename init to RegisterScriptClass for more transparency and consistency in

JSInterface_IGUIObject ought to be JSInterface_GUIObject for consistency with the other JSInterface_GUIfoo.

JSInterface_GUITypes.cpp should be split into JSInterface_GUISize.cpp and JSInterface_GUIColor.cpp, so it is easier to add new types and one doesn't have to read all types to understand one

file, but only one type.

Test Plan

Read the spidermonkey doc. Compile with this patch and notice that "everything still works". Possibly add debug_printfs to see that the removed code is never called and donate athttps://play0ad.com/community/donate/.

Also this is the only place that uses toPrivate. The code looks kind of wrong: where would that IGUIObject instance created (if not ConstructObject in Xeromyces_ReadObject)? The two statements look like it would would parse the existing private value to an IGUIObject pointer and set that pointer back to the private object, i.e. noop with at most errors occuring.