platform_event.h 834 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef UI_EVENTS_PLATFORM_EVENT_H_
  5. #define UI_EVENTS_PLATFORM_EVENT_H_
  6. #include "build/build_config.h"
  7. #if BUILDFLAG(IS_WIN)
  8. #include "base/win/windows_types.h"
  9. #elif BUILDFLAG(IS_APPLE)
  10. #if defined(__OBJC__)
  11. @class NSEvent;
  12. #else // __OBJC__
  13. class NSEvent;
  14. #endif // __OBJC__
  15. #endif
  16. namespace ui {
  17. class Event;
  18. }
  19. namespace ui {
  20. // Cross platform typedefs for native event types.
  21. #if defined(USE_OZONE)
  22. using PlatformEvent = ui::Event*;
  23. #elif BUILDFLAG(IS_WIN)
  24. using PlatformEvent = CHROME_MSG;
  25. #elif BUILDFLAG(IS_APPLE)
  26. using PlatformEvent = NSEvent*;
  27. #else
  28. using PlatformEvent = void*;
  29. #endif
  30. } // namespace ui
  31. #endif // UI_EVENTS_PLATFORM_EVENT_H_