EventDispatcher.js 488 B

123456789101112131415161718192021
  1. require('Polycode/EventHandler')
  2. function EventDispatcher() {
  3. if(arguments[0] != "__skip_ptr__") {
  4. this.__ptr = Polycode.EventDispatcher()
  5. }
  6. }
  7. EventDispatcher.prototype = Object.create(EventHandler.prototype)
  8. Duktape.fin(EventDispatcher.prototype, function (x) {
  9. if (x === EventDispatcher.prototype) {
  10. return;
  11. }
  12. Polycode.EventDispatcher__delete(x.__ptr)
  13. })
  14. EventDispatcher.prototype.removeAllHandlers = function() {
  15. Polycode.EventDispatcher_removeAllHandlers(this.__ptr)
  16. }