Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
2.1 KiB

  1. /*
  2. * Event
  3. */
  4. #ifndef DUI_CORE_EVENT_H_INCLUDED
  5. #define DUI_CORE_EVENT_H_INCLUDED
  6. #pragma once
  7. namespace DirectUI
  8. {
  9. class Element;
  10. ////////////////////////////////////////////////////////
  11. // Generic event structures
  12. // Eventing system is based on DU's messaging system
  13. // All DUI events are packaged into a DU message
  14. #define GM_DUIEVENT GM_USER - 2
  15. struct Event
  16. {
  17. // TODO: cbSize
  18. Element* peTarget;
  19. UID uidType;
  20. bool fHandled;
  21. UINT nStage;
  22. };
  23. BEGIN_STRUCT(GMSG_DUIEVENT, EventMsg)
  24. Event* pEvent;
  25. END_STRUCT(GMSG_DUIEVENT)
  26. ////////////////////////////////////////////////////////
  27. // System event structures
  28. ////////////////////////////////////////////////////////
  29. // Input event type
  30. struct InputEvent
  31. {
  32. Element* peTarget;
  33. bool fHandled;
  34. UINT nStage;
  35. UINT nDevice;
  36. UINT nCode;
  37. UINT uModifiers;
  38. };
  39. // Input event GINPUT_MOUSE nCode extra fields
  40. struct MouseEvent : InputEvent
  41. {
  42. POINT ptClientPxl;
  43. BYTE bButton;
  44. UINT nFlags;
  45. };
  46. struct MouseDragEvent: MouseEvent
  47. {
  48. SIZE sizeDelta;
  49. BOOL fWithin;
  50. };
  51. struct MouseClickEvent: MouseEvent
  52. {
  53. UINT cClicks;
  54. };
  55. struct MouseWheelEvent: MouseEvent
  56. {
  57. short sWheel;
  58. };
  59. // Input event GINPUT_KEYBOARD nCode extra fields
  60. struct KeyboardEvent : InputEvent
  61. {
  62. WCHAR ch;
  63. WORD cRep;
  64. WORD wFlags;
  65. };
  66. ////////////////////////////////////////////////////////
  67. // Action event type
  68. // TODO
  69. struct KeyboardNavigateEvent : Event
  70. {
  71. int iNavDir;
  72. };
  73. ////////////////////////////////////////////////////////
  74. // DUI Element query message
  75. // Eventing system is based on DU's messaging system
  76. // All DUI events are packaged into a DU message
  77. #define GM_DUIGETELEMENT GM_USER - 3
  78. BEGIN_STRUCT(GMSG_DUIGETELEMENT, EventMsg)
  79. Element* pe;
  80. END_STRUCT(GMSG_DUIGETELEMENT)
  81. ////////////////////////////////////////////////////////
  82. // DUI Accessibility default action
  83. // Accessibility default actions are always async
  84. #define GM_DUIACCDEFACTION GM_USER - 4
  85. } // namespace DirectUI
  86. #endif // DUI_CORE_EVENT_H_INCLUDED