summaryrefslogtreecommitdiff
path: root/chromium/ui/events/ozone/evdev/BUILD.gn
blob: ce0d32fc9282ffc28074e966021bb2ddf9f8a539 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Copyright 2019 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.

import("//build/config/chromeos/args.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")

assert(use_ozone && (is_linux || is_chromeos))

visibility = [ ":*" ]

declare_args() {
  # Support ChromeOS touchpad gestures with ozone.
  use_evdev_gestures = is_chromeos_device
}

config("evdev_config") {
  defines = [ "USE_EVDEV" ]
}

if (use_evdev_gestures) {
  pkg_config("libevdev-cros") {
    packages = [ "libevdev-cros" ]
  }

  pkg_config("libgestures") {
    packages = [ "libgestures" ]
  }

  config("evdev_gestures_config") {
    defines = [ "USE_EVDEV_GESTURES" ]
  }
}

component("evdev") {
  output_name = "events_ozone_evdev"

  sources = [
    "device_event_dispatcher_evdev.cc",
    "device_event_dispatcher_evdev.h",
    "event_converter_evdev.cc",
    "event_converter_evdev.h",
    "event_converter_evdev_impl.cc",
    "event_converter_evdev_impl.h",
    "event_device_info.cc",
    "event_device_info.h",
    "event_factory_evdev.cc",
    "event_factory_evdev.h",
    "event_thread_evdev.cc",
    "event_thread_evdev.h",
    "gamepad_event_converter_evdev.cc",
    "gamepad_event_converter_evdev.h",
    "input_controller_evdev.cc",
    "input_controller_evdev.h",
    "input_device_factory_evdev.cc",
    "input_device_factory_evdev.h",
    "input_device_factory_evdev_proxy.cc",
    "input_device_factory_evdev_proxy.h",
    "input_device_settings_evdev.cc",
    "input_device_settings_evdev.h",
    "input_injector_evdev.cc",
    "input_injector_evdev.h",
    "keyboard_evdev.cc",
    "keyboard_evdev.h",
    "mouse_button_map_evdev.cc",
    "mouse_button_map_evdev.h",
    "stylus_button_event_converter_evdev.cc",
    "stylus_button_event_converter_evdev.h",
    "tablet_event_converter_evdev.cc",
    "tablet_event_converter_evdev.h",
    "touch_evdev_debug_buffer.cc",
    "touch_evdev_debug_buffer.h",
    "touch_evdev_types.cc",
    "touch_evdev_types.h",
    "touch_event_converter_evdev.cc",
    "touch_event_converter_evdev.h",
    "touch_filter/edge_touch_filter.cc",
    "touch_filter/edge_touch_filter.h",
    "touch_filter/false_touch_finder.cc",
    "touch_filter/false_touch_finder.h",
    "touch_filter/heuristic_stylus_palm_detection_filter.cc",
    "touch_filter/heuristic_stylus_palm_detection_filter.h",
    "touch_filter/neural_stylus_palm_detection_filter.cc",
    "touch_filter/neural_stylus_palm_detection_filter.h",
    "touch_filter/neural_stylus_palm_detection_filter_model.cc",
    "touch_filter/neural_stylus_palm_detection_filter_model.h",
    "touch_filter/neural_stylus_palm_detection_filter_util.cc",
    "touch_filter/neural_stylus_palm_detection_filter_util.h",
    "touch_filter/neural_stylus_palm_report_filter.cc",
    "touch_filter/neural_stylus_palm_report_filter.h",
    "touch_filter/open_palm_detection_filter.cc",
    "touch_filter/open_palm_detection_filter.h",
    "touch_filter/palm_detection_filter.cc",
    "touch_filter/palm_detection_filter.h",
    "touch_filter/palm_detection_filter_factory.cc",
    "touch_filter/palm_detection_filter_factory.h",
    "touch_filter/palm_model/onedevice_train_palm_detection_filter_inference.cc",
    "touch_filter/palm_model/onedevice_train_palm_detection_filter_inference.h",
    "touch_filter/palm_model/onedevice_train_palm_detection_filter_model.cc",
    "touch_filter/palm_model/onedevice_train_palm_detection_filter_model.h",
    "touch_filter/shared_palm_detection_filter_state.h",
    "touch_filter/touch_filter.h",
  ]

  defines = [ "IS_EVDEV_IMPL" ]

  deps = [
    "//base",
    "//ui/display",
    "//ui/events",
    "//ui/events:dom_keycode_converter",
    "//ui/events:events_base",
    "//ui/events/devices",
    "//ui/events/ozone",
    "//ui/events/ozone/layout",
    "//ui/events/platform",
    "//ui/gfx",
    "//ui/ozone:ozone_base",
  ]

  public_configs = [ ":evdev_config" ]

  if (use_evdev_gestures) {
    sources += [
      "libgestures_glue/event_reader_libevdev_cros.cc",
      "libgestures_glue/event_reader_libevdev_cros.h",
      "libgestures_glue/gesture_feedback.cc",
      "libgestures_glue/gesture_feedback.h",
      "libgestures_glue/gesture_interpreter_libevdev_cros.cc",
      "libgestures_glue/gesture_interpreter_libevdev_cros.h",
      "libgestures_glue/gesture_logging.cc",
      "libgestures_glue/gesture_logging.h",
      "libgestures_glue/gesture_properties_service.cc",
      "libgestures_glue/gesture_properties_service.h",
      "libgestures_glue/gesture_property_provider.cc",
      "libgestures_glue/gesture_property_provider.h",
      "libgestures_glue/gesture_timer_provider.cc",
      "libgestures_glue/gesture_timer_provider.h",
    ]

    deps += [ "//ui/ozone/public/mojom:gesture_properties_service" ]

    configs += [
      ":libevdev-cros",
      ":libgestures",
    ]

    public_configs += [ ":evdev_gestures_config" ]
  }

  visibility += [
    "//ui/chromeos/*",
    "//ui/ozone/*",
  ]
}

source_set("unittests") {
  testonly = true

  sources = [
    "event_converter_evdev_impl_unittest.cc",
    "event_converter_test_util.cc",
    "event_converter_test_util.h",
    "event_device_info_unittest.cc",
    "event_device_test_util.cc",
    "event_device_test_util.h",
    "event_factory_evdev_unittest.cc",
    "gamepad_event_converter_evdev_unittest.cc",
    "input_injector_evdev_unittest.cc",
    "stylus_button_event_converter_evdev_unittest.cc",
    "tablet_event_converter_evdev_unittest.cc",
    "testing/fake_cursor_delegate_evdev.h",
    "touch_event_converter_evdev_unittest.cc",
    "touch_filter/false_touch_finder_unittest.cc",
    "touch_filter/heuristic_stylus_palm_detection_filter_unittest.cc",
    "touch_filter/neural_stylus_palm_detection_filter_unittest.cc",
    "touch_filter/neural_stylus_palm_detection_filter_util_unittest.cc",
    "touch_filter/neural_stylus_palm_report_filter_unittest.cc",
    "touch_filter/open_palm_detection_filter_unittest.cc",
    "touch_filter/palm_detection_filter_factory_unittest.cc",
  ]

  deps = [
    ":evdev",
    "//base",
    "//base/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/events",
    "//ui/events:dom_keycode_converter",
    "//ui/events/devices",
    "//ui/events/ozone",
    "//ui/events/ozone/layout",
    "//ui/gfx/geometry",
  ]

  visibility += [ "//ui/events/ozone:unittests" ]
}