summaryrefslogtreecommitdiff
path: root/chromium/ui/events/ozone/BUILD.gn
blob: f9a33289569ce3e58420cf3d008b3f0b29c99174 (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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# Copyright 2014 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/features.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//ui/base/ui_features.gni")

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

if (use_xkbcommon) {
  pkg_config("xkbcommon") {
    packages = [ "xkbcommon" ]
  }
}

if (use_ozone) {
  component("events_ozone") {
    sources = [
      "chromeos/cursor_controller.cc",
      "chromeos/cursor_controller.h",
      "device/device_event.cc",
      "device/device_event.h",
      "device/device_event_observer.h",
      "device/device_manager.cc",
      "device/device_manager.h",
      "device/device_manager_manual.cc",
      "device/device_manager_manual.h",
      "device/udev/device_manager_udev.cc",
      "device/udev/device_manager_udev.h",
      "events_ozone_export.h",
      "keyboard/event_auto_repeat_handler.cc",
      "keyboard/event_auto_repeat_handler.h",
    ]

    deps = [
      "//base",
      "//base/third_party/dynamic_annotations",
      "//ui/display",
      "//ui/events",
      "//ui/events:events_base",
      "//ui/gfx",
    ]

    defines = [ "EVENTS_OZONE_IMPLEMENTATION" ]

    if (!use_udev) {
      sources -= [
        "device/udev/device_manager_udev.cc",
        "device/udev/device_manager_udev.h",
      ]
    }

    if (use_ozone && use_udev) {
      deps += [ "//device/udev_linux" ]
    }
  }

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

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

  component("events_ozone_evdev") {
    sources = [
      "evdev/device_event_dispatcher_evdev.cc",
      "evdev/device_event_dispatcher_evdev.h",
      "evdev/event_converter_evdev.cc",
      "evdev/event_converter_evdev.h",
      "evdev/event_converter_evdev_impl.cc",
      "evdev/event_converter_evdev_impl.h",
      "evdev/event_device_info.cc",
      "evdev/event_device_info.h",
      "evdev/event_factory_evdev.cc",
      "evdev/event_factory_evdev.h",
      "evdev/event_thread_evdev.cc",
      "evdev/event_thread_evdev.h",
      "evdev/events_ozone_evdev_export.h",
      "evdev/gamepad_event_converter_evdev.cc",
      "evdev/gamepad_event_converter_evdev.h",
      "evdev/input_controller_evdev.cc",
      "evdev/input_controller_evdev.h",
      "evdev/input_device_factory_evdev.cc",
      "evdev/input_device_factory_evdev.h",
      "evdev/input_device_factory_evdev_proxy.cc",
      "evdev/input_device_factory_evdev_proxy.h",
      "evdev/input_device_settings_evdev.cc",
      "evdev/input_device_settings_evdev.h",
      "evdev/input_injector_evdev.cc",
      "evdev/input_injector_evdev.h",
      "evdev/keyboard_evdev.cc",
      "evdev/keyboard_evdev.h",
      "evdev/keyboard_util_evdev.cc",
      "evdev/keyboard_util_evdev.h",
      "evdev/mouse_button_map_evdev.cc",
      "evdev/mouse_button_map_evdev.h",
      "evdev/tablet_event_converter_evdev.cc",
      "evdev/tablet_event_converter_evdev.h",
      "evdev/touch_evdev_debug_buffer.cc",
      "evdev/touch_evdev_debug_buffer.h",
      "evdev/touch_evdev_types.cc",
      "evdev/touch_evdev_types.h",
      "evdev/touch_event_converter_evdev.cc",
      "evdev/touch_event_converter_evdev.h",
      "evdev/touch_filter/edge_touch_filter.cc",
      "evdev/touch_filter/edge_touch_filter.h",
      "evdev/touch_filter/false_touch_finder.cc",
      "evdev/touch_filter/false_touch_finder.h",
      "evdev/touch_filter/far_apart_taps_touch_noise_filter.cc",
      "evdev/touch_filter/far_apart_taps_touch_noise_filter.h",
      "evdev/touch_filter/horizontally_aligned_touch_noise_filter.cc",
      "evdev/touch_filter/horizontally_aligned_touch_noise_filter.h",
      "evdev/touch_filter/single_position_touch_noise_filter.cc",
      "evdev/touch_filter/single_position_touch_noise_filter.h",
      "evdev/touch_filter/touch_filter.h",
      "gamepad/gamepad_event.cc",
      "gamepad/gamepad_event.h",
      "gamepad/gamepad_mapping.cc",
      "gamepad/gamepad_mapping.h",
      "gamepad/gamepad_observer.h",
      "gamepad/gamepad_provider_ozone.cc",
      "gamepad/gamepad_provider_ozone.h",
      "gamepad/generic_gamepad_mapping.cc",
      "gamepad/generic_gamepad_mapping.h",
      "gamepad/static_gamepad_mapping.cc",
      "gamepad/static_gamepad_mapping.h",
      "gamepad/webgamepad_constants.h",
    ]

    defines = [ "EVENTS_OZONE_EVDEV_IMPLEMENTATION" ]

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

    public_configs = [ ":evdev" ]

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

      deps += [
        "//third_party/gestures",
        "//third_party/libevdev",
      ]

      public_configs += [ ":evdev_gestures" ]
    }
  }
}

component("events_ozone_layout") {
  sources = [
    "layout/events_ozone_layout_export.h",
    "layout/keyboard_layout_engine.h",
    "layout/keyboard_layout_engine_manager.cc",
    "layout/keyboard_layout_engine_manager.h",
    "layout/layout_util.cc",
    "layout/layout_util.h",
    "layout/no/no_keyboard_layout_engine.cc",
    "layout/no/no_keyboard_layout_engine.h",
    "layout/stub/stub_keyboard_layout_engine.cc",
    "layout/stub/stub_keyboard_layout_engine.h",
  ]

  defines = [ "EVENTS_OZONE_LAYOUT_IMPLEMENTATION" ]

  deps = [
    "//base",
    "//ui/events:dom_keycode_converter",
    "//ui/events:events_base",
  ]

  if (use_xkbcommon) {
    configs += [ ":xkbcommon" ]

    sources += [
      "layout/xkb/xkb_evdev_codes.cc",
      "layout/xkb/xkb_evdev_codes.h",
      "layout/xkb/xkb_key_code_converter.h",
      "layout/xkb/xkb_keyboard_layout_engine.cc",
      "layout/xkb/xkb_keyboard_layout_engine.h",
    ]

    deps += [ "//ui/events/keycodes:xkb" ]
  }
}