Roll DEPS for libelf clang compilation fix.
[chromium-blink-merge.git] / ui / events / BUILD.gn
blob64860d553c0fab0d65cd7c4f77974c8f0e6441a7
1 # Copyright 2014 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.
5 import("//build/config/ui.gni")
7 static_library("dom4_keycode_converter") {
8   sources = [
9     "keycodes/dom4/keycode_converter.cc",
10     "keycodes/dom4/keycode_converter.h",
11     "keycodes/dom4/keycode_converter_data.h",
12   ]
14   deps = [ "//base" ]
17 component("events_base") {
18   sources = [
19     "device_data_manager.cc",
20     "device_data_manager.h",
21     "event_constants.h",
22     "event_switches.cc",
23     "event_switches.h",
24     "events_base_export.h",
25     "gesture_event_details.cc",
26     "gesture_event_details.h",
27     "gestures/gesture_configuration.cc",
28     "gestures/gesture_configuration.h",
29     "keycodes/keyboard_code_conversion.cc",
30     "keycodes/keyboard_code_conversion.h",
31     "keycodes/keyboard_code_conversion_android.cc",
32     "keycodes/keyboard_code_conversion_android.h",
33     "keycodes/keyboard_code_conversion_mac.h",
34     "keycodes/keyboard_code_conversion_mac.mm",
35     "keycodes/keyboard_code_conversion_win.cc",
36     "keycodes/keyboard_code_conversion_win.h",
37     "keycodes/keyboard_codes.h",
38     "latency_info.cc",
39     "latency_info.h",
40   ]
42   defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
44   deps = [
45     ":dom4_keycode_converter",
46     "//base",
47     "//base/third_party/dynamic_annotations",
48     "//skia",
49     "//ui/events/platform",
50     "//ui/gfx",
51     "//ui/gfx/geometry",
52   ]
54   forward_dependent_configs_from = [ "//ui/gfx" ]
56   if (use_x11) {
57     configs += [ "//build/config/linux:x11" ]
59     sources += [
60       "keycodes/keyboard_code_conversion_x.cc",
61       "keycodes/keyboard_code_conversion_x.h",
62       "x/device_data_manager_x11.cc",
63       "x/device_data_manager_x11.h",
64       "x/device_list_cache_x.cc",
65       "x/device_list_cache_x.h",
66       "x/touch_factory_x11.cc",
67       "x/touch_factory_x11.h",
68     ]
69   }
72 component("events") {
73   deps = [
74     ":dom4_keycode_converter",
75     ":events_base",
76     ":gesture_detection",
77     "//skia",
78     "//ui/gfx",
79     "//ui/gfx/geometry",
80   ]
82   defines = [ "EVENTS_IMPLEMENTATION" ]
84   sources = [
85     "cocoa/cocoa_event_utils.h",
86     "cocoa/cocoa_event_utils.mm",
87     "cocoa/events_mac.mm",
88     "event.cc",
89     "event.h",
90     "event_dispatcher.cc",
91     "event_dispatcher.h",
92     "event_handler.cc",
93     "event_handler.h",
94     "event_processor.cc",
95     "event_processor.h",
96     "event_rewriter.h",
97     "event_source.cc",
98     "event_source.h",
99     "event_target.cc",
100     "event_target.h",
101     "event_target_iterator.h",
102     "event_targeter.cc",
103     "event_targeter.h",
104     "event_utils.cc",
105     "event_utils.h",
106     "events_export.h",
107     "events_stub.cc",
108     "gestures/gesture_point.cc",
109     "gestures/gesture_point.h",
110     "gestures/gesture_recognizer_impl_mac.cc",
111     "gestures/gesture_sequence.cc",
112     "gestures/gesture_sequence.h",
113     "gestures/gesture_types.h",
114     "gestures/unified_gesture_detector_enabled.cc",
115     "gestures/unified_gesture_detector_enabled.h",
116     "gestures/velocity_calculator.cc",
117     "gestures/velocity_calculator.h",
118     "platform/x11/x11_event_source.cc",
119     "platform/x11/x11_event_source.h",
120     "win/events_win.cc",
121     "x/events_x.cc",
122   ]
124   if (use_x11) {
125     configs += [
126       "//build/config/linux:glib",
127       "//build/config/linux:x11",
128     ]
129   } else {
130     sources -= [
131       "platform/x11/x11_event_source.cc",
132       "platform/x11/x11_event_source.h",
133       "x/events_x.cc",
134     ]
135   }
137   if (!is_chromeos && is_linux) {
138     sources += [
139       "linux/text_edit_command_auralinux.cc",
140       "linux/text_edit_command_auralinux.h",
141       "linux/text_edit_key_bindings_delegate_auralinux.cc",
142       "linux/text_edit_key_bindings_delegate_auralinux.h",
143     ]
144   }
146   if (use_ozone) {
147     sources += [
148       "ozone/device/udev/device_manager_udev.cc",
149       "ozone/device/udev/device_manager_udev.h",
150       "ozone/evdev/event_converter_evdev.cc",
151       "ozone/evdev/event_converter_evdev.h",
152       "ozone/evdev/event_device_info.cc",
153       "ozone/evdev/event_device_info.h",
154       "ozone/evdev/event_factory_evdev.cc",
155       "ozone/evdev/event_factory_evdev.h",
156       "ozone/evdev/event_modifiers_evdev.cc",
157       "ozone/evdev/event_modifiers_evdev.h",
158       "ozone/evdev/key_event_converter_evdev.cc",
159       "ozone/evdev/key_event_converter_evdev.h",
160       "ozone/evdev/touch_event_converter_evdev.cc",
161       "ozone/evdev/touch_event_converter_evdev.h",
162       "ozone/event_factory_ozone.cc",
163       "ozone/event_factory_ozone.h",
164       "ozone/events_ozone.cc",
165     ]
166   }
168   if (use_aura) {
169     sources += [
170       "gestures/gesture_provider_aura.cc",
171       "gestures/gesture_provider_aura.h",
172       "gestures/motion_event_aura.cc",
173       "gestures/motion_event_aura.h",
174       "gestures/gesture_recognizer.h",
175       "gestures/gesture_recognizer_impl.cc",
176       "gestures/gesture_recognizer_impl.h",
177     ]
178   }
180   if (is_win || is_mac || use_x11 || use_ozone) {
181     sources -= [ "events_stub.cc" ]
182   }
185 component("gesture_detection") {
186   sources = [
187     "gesture_detection/bitset_32.h",
188     "gesture_detection/filtered_gesture_provider.cc",
189     "gesture_detection/filtered_gesture_provider.h",
190     "gesture_detection/gesture_detection_export.h",
191     "gesture_detection/gesture_detector.cc",
192     "gesture_detection/gesture_detector.h",
193     "gesture_detection/gesture_event_data.cc",
194     "gesture_detection/gesture_event_data.h",
195     "gesture_detection/gesture_event_data_packet.cc",
196     "gesture_detection/gesture_event_data_packet.h",
197     "gesture_detection/gesture_config_helper.h",
198     "gesture_detection/gesture_provider.cc",
199     "gesture_detection/gesture_provider.h",
200     "gesture_detection/motion_event.h",
201     "gesture_detection/scale_gesture_detector.cc",
202     "gesture_detection/scale_gesture_detector.h",
203     "gesture_detection/snap_scroll_controller.cc",
204     "gesture_detection/snap_scroll_controller.h",
205     "gesture_detection/touch_disposition_gesture_filter.cc",
206     "gesture_detection/touch_disposition_gesture_filter.h",
207     "gesture_detection/velocity_tracker_state.cc",
208     "gesture_detection/velocity_tracker_state.h",
209     "gesture_detection/velocity_tracker.cc",
210     "gesture_detection/velocity_tracker.h",
211   ]
213   deps = [
214     ":events_base",
215     "//base",
216     "//ui/gfx",
217     "//ui/gfx/geometry",
218   ]
220   defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
222   if (is_android) {
223     sources += [ "gesture_detection/gesture_config_helper_android.cc" ]
224   } else if (use_aura) {
225     sources += [ "gesture_detection/gesture_config_helper_aura.cc" ]
226   } else {
227     sources += [ "gesture_detection/gesture_config_helper.cc" ]
228   }
231 source_set("events_test_support") {
232   sources = [
233     "test/cocoa_test_event_utils.h",
234     "test/cocoa_test_event_utils.mm",
235     "test/events_test_utils.cc",
236     "test/events_test_utils.h",
237     "test/events_test_utils_x11.cc",
238     "test/events_test_utils_x11.h",
239     "test/mock_motion_event.cc",
240     "test/mock_motion_event.h",
241     "test/platform_event_waiter.cc",
242     "test/platform_event_waiter.h",
243     "test/test_event_handler.cc",
244     "test/test_event_handler.h",
245     "test/test_event_processor.cc",
246     "test/test_event_processor.h",
247     "test/test_event_target.cc",
248     "test/test_event_target.h",
249   ]
251   deps = [
252     "//skia",
253     ":events_base",
254     ":events",
255   ]
257   if (is_ios) {
258     sources -= [
259       "test/cocoa_test_event_utils.h",
260       "test/cocoa_test_event_utils.mm",
261     ]
262   }
264   if (use_x11) {
265     configs += [ "//build/config/linux:x11" ]
266   } else {
267     sources -= [
268       "test/events_test_utils_x11.cc",
269       "test/events_test_utils_x11.h",
270     ]
271   }
274 test("events_unittests") {
275   sources = [
276     "cocoa/events_mac_unittest.mm",
277     "event_dispatcher_unittest.cc",
278     "event_processor_unittest.cc",
279     "event_rewriter_unittest.cc",
280     "event_unittest.cc",
281     "gestures/velocity_calculator_unittest.cc",
282     "gesture_detection/bitset_32_unittest.cc",
283     "gesture_detection/gesture_provider_unittest.cc",
284     "gesture_detection/velocity_tracker_unittest.cc",
285     "gesture_detection/touch_disposition_gesture_filter_unittest.cc",
286     "keycodes/dom4/keycode_converter_unittest.cc",
287     "latency_info_unittest.cc",
288     "platform/platform_event_source_unittest.cc",
289     "x/events_x_unittest.cc",
290   ]
292   if (!use_x11) {
293     sources -= [
294       "x/events_x_unittest.cc",
295     ]
296   }
298   if (use_ozone) {
299     sources += [
300       "ozone/evdev/key_event_converter_evdev_unittest.cc",
301       "ozone/evdev/touch_event_converter_evdev_unittest.cc",
302     ]
303   }
305   deps = [
306     ":events",
307     ":events_base",
308     ":events_test_support",
309     ":gesture_detection",
310     "//base",
311     "//base/test:run_all_unittests",
312     "//skia",
313     "//testing/gtest",
314     "//ui/gfx:gfx_test_support",
315   ]