vdom_event.km 932 B

12345678910111213141516171819202122232425262728
  1. type EventPayload native; // *qt.WebUiEventPayload (contains a C++ pointer)
  2. type EventHandler native; // *vdom.EventHandler
  3. function EventHandler:[T]
  4. &(Sink[T], &(EventPayload) => T) => EventHandler
  5. native 'ui-dom-event-handler';
  6. function getter-callback:[T]
  7. &(String, (&(EventPayload,String) => T), (&(T) => EventPayloadConsumer)) => EventPayloadConsumer
  8. &(prop,getter,k) => { |EventPayloadConsumer| &(ev) =>
  9. let val := { getter (ev,prop) },
  10. let next := { k val },
  11. { next(ev) } };
  12. function get-string:
  13. &(EventPayload, String) => String
  14. native 'ui-event-payload-get-string';
  15. function get-float:
  16. &(EventPayload, String) => NormalFloat
  17. native 'ui-event-payload-get-float';
  18. function get-integer:
  19. &(EventPayload, String) => Integer
  20. native 'ui-event-payload-get-integer';
  21. function get-bool:
  22. &(EventPayload, String) => Bool
  23. native 'ui-event-payload-get-bool';