summaryrefslogtreecommitdiff
path: root/chromium/blimp/common/proto/input.proto
blob: 0905884dd000dfafb5b5a314499787c7971a116c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright 2015 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.
//
// Message definitions for the input subprotocol.
//
// The InputMessage protobuf generally carries web gesture events.  Currently we
// just serialize the blink::WebGestureEvent POD struct.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package blimp;

message GestureCommon {
  optional int64 x = 1;
  optional int64 y = 2;
  optional int64 global_x = 3;
  optional int64 global_y = 4;
}

message GestureScrollBegin {
  optional float delta_x_hint = 1;
  optional float delta_y_hint = 2;
  optional bool target_viewport = 3;
}

message GestureScrollUpdate {
  optional float delta_x = 1;
  optional float delta_y = 2;
  optional float velocity_x = 3;
  optional float velocity_y = 4;
  optional bool previous_update_in_sequence_prevented = 5;
  optional bool prevent_propagation = 6;
  optional bool inertial = 7;
}

message GestureFlingStart {
  optional float velocity_x = 1;
  optional float velocity_y = 2;
  optional bool target_viewport = 3;
}

message GestureFlingCancel {
  optional bool prevent_boosting = 1;
}

message GestureTap {
  optional int32 tap_count = 1;
  optional float width = 2;
  optional float height = 3;
}

message GesturePinchUpdate {
  optional bool zoom_disabled = 1;
  optional float scale = 2;
}

message InputMessage {
  enum Type {
    UNKNOWN = 0;

    // This is a subset of WebGestureType events.  We only support a small set
    // of these with the existing protocol.
    // TODO(dtrainor): Modify these enum values to be consistent with the rest
    // of BlimpMessage subtype enums.
    Type_GestureScrollBegin = 1;
    Type_GestureScrollEnd = 2;
    Type_GestureScrollUpdate = 3;
    Type_GestureFlingStart = 4;
    Type_GestureFlingCancel = 5;
    Type_GestureTap = 6;
    Type_GesturePinchBegin = 7;
    Type_GesturePinchEnd = 8;
    Type_GesturePinchUpdate = 9;
  }

  optional Type type = 1;

  // An ID that corresponds to RenderWidgetMessage.render_widget_id.
  optional int32 render_widget_id = 10;

  // Seconds since client platform start (boot) with millisecond resolution.
  // On Android, this is based off of the client's SystemClock#uptimeMillis().
  optional double timestamp_seconds = 2;

  optional GestureCommon gesture_common = 3;

  // Input event specific messages follow.
  // Only one of these fields may be set per InputMessage.
  // TODO(dtrainor): use a 'oneof' union when it's supported in Chromium.  See
  // crbug.com/570371.
  optional GestureScrollBegin gesture_scroll_begin = 4;
  optional GestureScrollUpdate gesture_scroll_update = 5;
  optional GestureFlingStart gesture_fling_start = 6;
  optional GestureFlingCancel gesture_fling_cancel = 7;
  optional GestureTap gesture_tap = 8;
  optional GesturePinchUpdate gesture_pinch_update = 9;
}