Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1145)

Unified Diff: ui/events/ipc/event_param_traits_macros.h

Issue 1695783002: IPC::ParamTraits for ui::Event (towards ui::Events over mojo IPC) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/ipc/event_param_traits_macros.h
diff --git a/ui/events/ipc/event_param_traits_macros.h b/ui/events/ipc/event_param_traits_macros.h
new file mode 100644
index 0000000000000000000000000000000000000000..848690a18ff37dfa9306b9ba6285dea7b5d489ea
--- /dev/null
+++ b/ui/events/ipc/event_param_traits_macros.h
@@ -0,0 +1,100 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ipc/ipc_message_utils.h"
+#include "ipc/param_traits_macros.h"
+#include "ui/events/event.h"
+#include "ui/events/event_constants.h"
+#include "ui/events/ipc/events_ipc_export.h"
+
+#undef IPC_MESSAGE_EXPORT
+#define IPC_MESSAGE_EXPORT EVENTS_IPC_EXPORT
+
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::EventType,
+ ui::EventType::ET_UNKNOWN,
+ ui::EventType::ET_LAST)
+
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::EventResult,
+ ui::EventResult::ER_UNHANDLED,
+ ui::EventResult::ER_DISABLE_SYNC_HANDLING)
+
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::EventPhase,
+ ui::EventPhase::EP_PREDISPATCH,
+ ui::EventPhase::EP_POSTDISPATCH)
+
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::EventPointerType,
+ ui::EventPhase::EP_PREDISPATCH,
+ ui::EventPhase::EP_POSTDISPATCH)
+
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::KeyboardCode,
+ ui::KeyboardCode::VKEY_UNKNOWN, /* 0x00 */
+ ui::KeyboardCode::VKEY_OEM_CLEAR /* 0xFE */)
+
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::DomCode, 0, 0x0c028c)
+
+IPC_STRUCT_TRAITS_BEGIN(ui::PointerDetails)
+ IPC_STRUCT_TRAITS_MEMBER(pointer_type)
+ IPC_STRUCT_TRAITS_MEMBER(radius_x)
+ IPC_STRUCT_TRAITS_MEMBER(radius_y)
+ IPC_STRUCT_TRAITS_MEMBER(force)
+ IPC_STRUCT_TRAITS_MEMBER(tilt_x)
+ IPC_STRUCT_TRAITS_MEMBER(tilt_y)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::LocatedEvent)
+ IPC_STRUCT_TRAITS_MEMBER(location_)
+ IPC_STRUCT_TRAITS_MEMBER(root_location_)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::MouseEvent)
+ IPC_STRUCT_TRAITS_PARENT(ui::LocatedEvent)
+ IPC_STRUCT_TRAITS_MEMBER(changed_button_flags_)
+ IPC_STRUCT_TRAITS_MEMBER(pointer_details_)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::MouseWheelEvent)
+ IPC_STRUCT_TRAITS_PARENT(ui::MouseEvent)
+ IPC_STRUCT_TRAITS_MEMBER(offset_)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::TouchEvent)
+ IPC_STRUCT_TRAITS_PARENT(ui::LocatedEvent)
+ IPC_STRUCT_TRAITS_MEMBER(touch_id_)
+ IPC_STRUCT_TRAITS_MEMBER(unique_event_id_)
+ IPC_STRUCT_TRAITS_MEMBER(rotation_angle_)
+ IPC_STRUCT_TRAITS_MEMBER(may_cause_scrolling_)
+ IPC_STRUCT_TRAITS_MEMBER(pointer_details_)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::DomKey)
+ IPC_STRUCT_TRAITS_MEMBER(value_)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::KeyEvent)
+ IPC_STRUCT_TRAITS_MEMBER(is_char_)
+ IPC_STRUCT_TRAITS_MEMBER(key_code_)
+ IPC_STRUCT_TRAITS_MEMBER(code_)
+ IPC_STRUCT_TRAITS_MEMBER(key_)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::ScrollEvent)
+ IPC_STRUCT_TRAITS_PARENT(ui::MouseEvent)
+ IPC_STRUCT_TRAITS_MEMBER(x_offset_)
+ IPC_STRUCT_TRAITS_MEMBER(y_offset_)
+ IPC_STRUCT_TRAITS_MEMBER(x_offset_ordinal_)
+ IPC_STRUCT_TRAITS_MEMBER(y_offset_ordinal_)
+ IPC_STRUCT_TRAITS_MEMBER(finger_count_)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::GestureEventDetails)
+ IPC_STRUCT_TRAITS_MEMBER(type_)
+ IPC_STRUCT_TRAITS_MEMBER(data_)
+ IPC_STRUCT_TRAITS_MEMBER(touch_points_)
+ IPC_STRUCT_TRAITS_MEMBER(bounding_box_)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ui::GestureEvent)
+ IPC_STRUCT_TRAITS_PARENT(ui::LocatedEvent)
+ IPC_STRUCT_TRAITS_MEMBER(details_)
+IPC_STRUCT_TRAITS_END()

Powered by Google App Engine
This is Rietveld 408576698