EventDispatcher.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. function EventDispatcher() {
  2. }
  3. Duktape.fin(EventDispatcher.prototype, function (x) {
  4. if (x === EventDispatcher.prototype) {
  5. return;
  6. }
  7. Polycode.EventDispatcher__delete(x.__ptr)
  8. })
  9. EventDispatcher.prototype.removeAllHandlers = function() {
  10. Polycode.EventDispatcher_removeAllHandlers(this.__ptr)
  11. }
  12. EventDispatcher.prototype.removeAllHandlersForListener = function(handler) {
  13. Polycode.EventDispatcher_removeAllHandlersForListener(this.__ptr, handler)
  14. }
  15. EventDispatcher.prototype.addEventListener = function(handler,eventCode) {
  16. Polycode.EventDispatcher_addEventListener(this.__ptr, handler,eventCode)
  17. }
  18. EventDispatcher.prototype.addEventListenerUnique = function(handler,eventCode) {
  19. Polycode.EventDispatcher_addEventListenerUnique(this.__ptr, handler,eventCode)
  20. }
  21. EventDispatcher.prototype.hasEventListener = function(handler,eventCode) {
  22. return Polycode.EventDispatcher_hasEventListener(this.__ptr, handler,eventCode)
  23. }
  24. EventDispatcher.prototype.removeEventListener = function(handler,eventCode) {
  25. Polycode.EventDispatcher_removeEventListener(this.__ptr, handler,eventCode)
  26. }
  27. EventDispatcher.prototype.__dispatchEvent = function(event,eventCode) {
  28. Polycode.EventDispatcher___dispatchEvent(this.__ptr, event,eventCode)
  29. }
  30. EventDispatcher.prototype.dispatchEvent = function(event,eventCode) {
  31. Polycode.EventDispatcher_dispatchEvent(this.__ptr, event,eventCode)
  32. }
  33. EventDispatcher.prototype.dispatchEventNoDelete = function(event,eventCode) {
  34. Polycode.EventDispatcher_dispatchEventNoDelete(this.__ptr, event,eventCode)
  35. }