Hi,
I was wondering if there was any way to have WebIDL generate bindings for
static methods? Here is my .idl:
[Prefix="Panther::"]
interface World {
void addScene(Scene scene);
Scene getScene(DOMString sceneName);
Scene removeScene(DOMString sceneName);
Scene getCurrentScene();
void transitionScene(DOMString sceneName);
void process();
void start();
void pause();
static World getInstance();
static void processInstance();
static void setFps(long fps);
};
[Prefix="Panther::"]
interface Scene {
};
The three static methods are generated as instance methods. Here is an
example:
void EMSCRIPTEN_KEEPALIVE emscripten_bind_World_setFps_1(Panther::World*
self, int arg0) {
self->setFps(arg0);
}
I was able to change the generated code to make these static by editing
glue.cpp and glue.js to be something like this:
void EMSCRIPTEN_KEEPALIVE emscripten_bind_World_setFps_1(Panther::World*
self, int arg0) {
Panther::World::setFps(arg0);
}
World.__proto__.setFps = function(arg0) {
var self = this.ptr;
if (arg0 && typeof arg0 === 'object') arg0 = arg0.ptr;
else arg0 = ensureString(arg0);
_emscripten_bind_World_setFps_1(self, arg0);
};
Is there any way to generate this? If not, I would be interested in adding
this feature.
Thanks
Joe
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.