events.rs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //! Virtual Events
  2. //! This module provides a wrapping of platform-specific events with a list of events easier to work with.
  3. //!
  4. //! 3rd party renderers are responsible for forming this virtual events from events
  5. //!
  6. //! The goal here is to provide a consistent event interface across all renderer types
  7. use generational_arena::Index;
  8. pub struct EventTrigger {
  9. pub component_id: Index,
  10. pub listener_id: u32,
  11. pub event: VirtualEvent,
  12. }
  13. impl EventTrigger {
  14. pub fn new() -> Self {
  15. todo!()
  16. }
  17. /// Create a new "start" event that boots up the virtual dom if it is paused
  18. pub fn start_event() -> Self {
  19. todo!()
  20. }
  21. }
  22. pub enum VirtualEvent {
  23. // the event to drain the current lifecycle queue
  24. // Used to initate the dom
  25. StartEvent,
  26. // Real events
  27. ClipboardEvent,
  28. CompositionEvent,
  29. KeyboardEvent,
  30. FocusEvent,
  31. FormEvent,
  32. GenericEvent,
  33. MouseEvent,
  34. PointerEvent,
  35. SelectionEvent,
  36. TouchEvent,
  37. UIEvent,
  38. WheelEvent,
  39. MediaEvent,
  40. ImageEvent,
  41. AnimationEvent,
  42. TransitionEvent,
  43. OtherEvent,
  44. }