OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 |
| 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_EVENT_STRUCT_TRAITS_H_ |
| 6 #define COMPONENTS_MUS_PUBLIC_CPP_EVENT_STRUCT_TRAITS_H_ |
| 7 |
| 8 #include "components/mus/public/interfaces/input_events.mojom.h" |
| 9 |
| 10 namespace ui { |
| 11 class Event; |
| 12 } |
| 13 |
| 14 namespace mojo { |
| 15 |
| 16 using EventUniquePtr = std::unique_ptr<ui::Event>; |
| 17 |
| 18 template <> |
| 19 struct StructTraits<mus::mojom::Event, EventUniquePtr> { |
| 20 static int32_t action(const EventUniquePtr& event); |
| 21 static int32_t flags(const EventUniquePtr& event); |
| 22 static int64_t time_stamp(const EventUniquePtr& event); |
| 23 static bool has_key_data(const EventUniquePtr& event); |
| 24 static mus::mojom::KeyDataPtr key_data(const EventUniquePtr& event); |
| 25 static bool has_pointer_data(const EventUniquePtr& event); |
| 26 static mus::mojom::PointerDataPtr pointer_data(const EventUniquePtr& event); |
| 27 static bool Read(mus::mojom::EventDataView r, EventUniquePtr* out); |
| 28 }; |
| 29 |
| 30 } // namespace mus |
| 31 |
| 32 #endif // COMPONENTS_MUS_PUBLIC_CPP_EVENT_STRUCT_TRAITS_H_ |
OLD | NEW |