OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 // Message definitions for the input subprotocol. | |
6 // | |
7 // The InputMessage protobuf generally carries web gesture events. Currently we | |
8 // just serialize the blink::WebGestureEvent POD struct. | |
9 | |
10 syntax = "proto2"; | |
11 | |
12 option optimize_for = LITE_RUNTIME; | |
13 | |
14 package blimp; | |
15 | |
16 message GestureCommon { | |
17 optional int64 x = 1; | |
18 optional int64 y = 2; | |
19 optional int64 global_x = 3; | |
20 optional int64 global_y = 4; | |
21 } | |
22 | |
23 message GestureScrollBegin { | |
24 optional float delta_x_hint = 1; | |
25 optional float delta_y_hint = 2; | |
26 optional bool target_viewport = 3; | |
27 } | |
28 | |
29 message GestureScrollUpdate { | |
30 optional float delta_x = 1; | |
31 optional float delta_y = 2; | |
32 optional float velocity_x = 3; | |
33 optional float velocity_y = 4; | |
34 optional bool previous_update_in_sequence_prevented = 5; | |
35 optional bool prevent_propagation = 6; | |
36 optional bool inertial = 7; | |
37 } | |
38 | |
39 message GestureFlingStart { | |
40 optional float velocity_x = 1; | |
41 optional float velocity_y = 2; | |
42 optional bool target_viewport = 3; | |
43 } | |
44 | |
45 message GestureFlingCancel { | |
46 optional bool prevent_boosting = 1; | |
47 } | |
48 | |
49 message GestureTap { | |
50 optional int32 tap_count = 1; | |
51 optional float width = 2; | |
52 optional float height = 3; | |
53 } | |
54 | |
55 message GesturePinchUpdate { | |
56 optional bool zoom_disabled = 1; | |
57 optional float scale = 2; | |
58 } | |
59 | |
60 message GestureTapDown { | |
61 optional float width = 1; | |
62 optional float height = 2; | |
63 } | |
64 | |
65 message GestureShowPress { | |
66 optional float width = 1; | |
67 optional float height = 2; | |
68 } | |
69 | |
70 message InputMessage { | |
71 enum Type { | |
72 UNKNOWN = 0; | |
73 | |
74 // This is a subset of WebGestureType events. We only support a small set | |
75 // of these with the existing protocol. | |
76 // TODO(dtrainor): Modify these enum values to be consistent with the rest | |
77 // of BlimpMessage subtype enums. | |
78 Type_GestureScrollBegin = 1; | |
79 Type_GestureScrollEnd = 2; | |
80 Type_GestureScrollUpdate = 3; | |
81 Type_GestureFlingStart = 4; | |
82 Type_GestureFlingCancel = 5; | |
83 Type_GestureTap = 6; | |
84 Type_GesturePinchBegin = 7; | |
85 Type_GesturePinchEnd = 8; | |
86 Type_GesturePinchUpdate = 9; | |
87 Type_GestureTapDown = 10; | |
88 Type_GestureTapCancel = 11; | |
89 Type_GestureTapUnconfirmed = 12; | |
90 Type_GestureShowPress = 13; | |
91 } | |
92 | |
93 optional Type type = 1; | |
94 | |
95 // An ID that corresponds to RenderWidgetMessage.render_widget_id. | |
96 optional int32 render_widget_id = 2; | |
97 | |
98 // Seconds since client platform start (boot) with millisecond resolution. | |
99 // On Android, this is based off of the client's SystemClock#uptimeMillis(). | |
100 optional double timestamp_seconds = 3; | |
101 | |
102 optional GestureCommon gesture_common = 4; | |
103 | |
104 // Input event specific messages follow. | |
105 // Only one of these fields may be set per InputMessage. | |
106 // TODO(dtrainor): use a 'oneof' union when it's supported in Chromium. See | |
107 // crbug.com/570371. | |
108 optional GestureScrollBegin gesture_scroll_begin = 5; | |
109 optional GestureScrollUpdate gesture_scroll_update = 6; | |
110 optional GestureFlingStart gesture_fling_start = 7; | |
111 optional GestureFlingCancel gesture_fling_cancel = 8; | |
112 optional GestureTap gesture_tap = 9; | |
113 optional GesturePinchUpdate gesture_pinch_update = 10; | |
114 optional GestureTapDown gesture_tap_down = 11; | |
115 optional GestureShowPress gesture_show_press = 12; | |
116 } | |
OLD | NEW |