Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / ui / events / BUILD.gn
blob44398a6e1fc803082bcf0147432440dbc45d4d21
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     "android/scroller.cc",
20     "android/scroller.h",
21     "event_constants.h",
22     "event_switches.cc",
23     "event_switches.h",
24     "events_base_export.h",
25     "gesture_curve.h",
26     "gesture_event_details.cc",
27     "gesture_event_details.h",
28     "gestures/fling_curve.cc",
29     "gestures/fling_curve.h",
30     "keycodes/keyboard_code_conversion.cc",
31     "keycodes/keyboard_code_conversion.h",
32     "keycodes/keyboard_code_conversion_android.cc",
33     "keycodes/keyboard_code_conversion_android.h",
34     "keycodes/keyboard_code_conversion_mac.h",
35     "keycodes/keyboard_code_conversion_mac.mm",
36     "keycodes/keyboard_code_conversion_win.cc",
37     "keycodes/keyboard_code_conversion_win.h",
38     "keycodes/keyboard_codes.h",
39     "latency_info.cc",
40     "latency_info.h",
41   ]
43   defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
45   deps = [
46     ":dom4_keycode_converter",
47     "//base/third_party/dynamic_annotations",
48     "//skia",
49   ]
51   public_deps = [
52     "//base",
53     "//ui/events/platform",
54     "//ui/gfx",
55     "//ui/gfx/geometry",
56   ]
58   if (use_x11) {
59     configs += [ "//build/config/linux:x11" ]
61     sources += [
62       "keycodes/keyboard_code_conversion_x.cc",
63       "keycodes/keyboard_code_conversion_x.h",
64       "x/keysym_to_unicode.cc",
65       "x/keysym_to_unicode.h",
66     ]
68     deps += [ "//ui/gfx/x" ]
69   }
72 component("events") {
73   sources = [
74     "cocoa/cocoa_event_utils.h",
75     "cocoa/cocoa_event_utils.mm",
76     "cocoa/events_mac.mm",
77     "event.cc",
78     "event.h",
79     "event_dispatcher.cc",
80     "event_dispatcher.h",
81     "event_handler.cc",
82     "event_handler.h",
83     "event_processor.cc",
84     "event_processor.h",
85     "event_rewriter.h",
86     "event_source.cc",
87     "event_source.h",
88     "event_target.cc",
89     "event_target.h",
90     "event_target_iterator.h",
91     "event_targeter.cc",
92     "event_targeter.h",
93     "event_utils.cc",
94     "event_utils.h",
95     "events_export.h",
96     "events_stub.cc",
97     "gestures/gesture_recognizer_impl_mac.cc",
98     "gestures/gesture_types.h",
99     "win/events_win.cc",
100   ]
102   defines = [ "EVENTS_IMPLEMENTATION" ]
104   public_deps = [
105     ":events_base",
106   ]
107   deps = [
108     ":dom4_keycode_converter",
109     ":gesture_detection",
110     "//base/third_party/dynamic_annotations",
111     "//skia",
112     "//ui/gfx",
113     "//ui/gfx/geometry",
114   ]
116   if (use_x11) {
117     sources += [ "x/events_x.cc" ]
118     configs += [
119       "//build/config/linux:glib",
120       "//build/config/linux:x11",
121     ]
122     deps += [
123       "//ui/events/devices",
124       "//ui/gfx/x",
125     ]
126   }
128   if (!is_chromeos && is_linux) {
129     sources += [
130       "linux/text_edit_command_auralinux.cc",
131       "linux/text_edit_command_auralinux.h",
132       "linux/text_edit_key_bindings_delegate_auralinux.cc",
133       "linux/text_edit_key_bindings_delegate_auralinux.h",
134     ]
135   }
137   if (use_ozone) {
138     sources += [
139       "ozone/events_ozone.cc",
140     ]
141   }
143   if (use_aura) {
144     sources += [
145       "gestures/gesture_provider_aura.cc",
146       "gestures/gesture_provider_aura.h",
147       "gestures/motion_event_aura.cc",
148       "gestures/motion_event_aura.h",
149       "gestures/gesture_recognizer.h",
150       "gestures/gesture_recognizer_impl.cc",
151       "gestures/gesture_recognizer_impl.h",
152     ]
153   }
155   if (is_win || is_mac || use_x11 || use_ozone) {
156     sources -= [ "events_stub.cc" ]
157   }
160 component("gesture_detection") {
161   sources = [
162     "gesture_detection/bitset_32.h",
163     "gesture_detection/filtered_gesture_provider.cc",
164     "gesture_detection/filtered_gesture_provider.h",
165     "gesture_detection/gesture_configuration.cc",
166     "gesture_detection/gesture_configuration.h",
167     "gesture_detection/gesture_detection_export.h",
168     "gesture_detection/gesture_detector.cc",
169     "gesture_detection/gesture_detector.h",
170     "gesture_detection/gesture_event_data.cc",
171     "gesture_detection/gesture_event_data.h",
172     "gesture_detection/gesture_event_data_packet.cc",
173     "gesture_detection/gesture_event_data_packet.h",
174     "gesture_detection/gesture_listeners.cc",
175     "gesture_detection/gesture_listeners.h",
176     "gesture_detection/gesture_provider.cc",
177     "gesture_detection/gesture_provider.h",
178     "gesture_detection/gesture_provider_config_helper.cc",
179     "gesture_detection/gesture_provider_config_helper.h",
180     "gesture_detection/gesture_touch_uma_histogram.cc",
181     "gesture_detection/gesture_touch_uma_histogram.h",
182     "gesture_detection/motion_event.cc",
183     "gesture_detection/motion_event.h",
184     "gesture_detection/motion_event_buffer.cc",
185     "gesture_detection/motion_event_buffer.h",
186     "gesture_detection/motion_event_generic.cc",
187     "gesture_detection/motion_event_generic.h",
188     "gesture_detection/scale_gesture_detector.cc",
189     "gesture_detection/scale_gesture_detector.h",
190     "gesture_detection/scale_gesture_listeners.cc",
191     "gesture_detection/scale_gesture_listeners.h",
192     "gesture_detection/snap_scroll_controller.cc",
193     "gesture_detection/snap_scroll_controller.h",
194     "gesture_detection/touch_disposition_gesture_filter.cc",
195     "gesture_detection/touch_disposition_gesture_filter.h",
196     "gesture_detection/velocity_tracker_state.cc",
197     "gesture_detection/velocity_tracker_state.h",
198     "gesture_detection/velocity_tracker.cc",
199     "gesture_detection/velocity_tracker.h",
200   ]
202   deps = [
203     ":events_base",
204     "//base",
205     "//base/third_party/dynamic_annotations",
206     "//ui/gfx",
207     "//ui/gfx/geometry",
208   ]
210   defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
212   if (is_android) {
213     sources += [ "gesture_detection/gesture_configuration_android.cc" ]
214   } else if (use_aura) {
215     sources += [ "gesture_detection/gesture_configuration_aura.cc" ]
216   } else {
217     sources += [ "gesture_detection/gesture_configuration_default.cc" ]
218   }
221 source_set("test_support") {
222   sources = [
223     "test/cocoa_test_event_utils.h",
224     "test/cocoa_test_event_utils.mm",
225     "test/event_generator.cc",
226     "test/event_generator.h",
227     "test/events_test_utils.cc",
228     "test/events_test_utils.h",
229     "test/motion_event_test_utils.cc",
230     "test/motion_event_test_utils.h",
231     "test/platform_event_waiter.cc",
232     "test/platform_event_waiter.h",
233     "test/test_event_handler.cc",
234     "test/test_event_handler.h",
235     "test/test_event_processor.cc",
236     "test/test_event_processor.h",
237     "test/test_event_target.cc",
238     "test/test_event_target.h",
239   ]
241   public_deps = [
242     ":events",
243     ":events_base",
244     ":gesture_detection",
245   ]
246   deps = [
247     "//base",
248     "//skia",
249     "//ui/events/platform",
250     "//ui/gfx/geometry",
251   ]
253   if (is_ios) {
254     sources -= [
255       "test/cocoa_test_event_utils.h",
256       "test/cocoa_test_event_utils.mm",
257     ]
258   }
260   if (use_x11) {
261     sources += [
262       "test/events_test_utils_x11.cc",
263       "test/events_test_utils_x11.h",
264     ]
265     deps += [
266       "//ui/events/devices",
267       "//ui/gfx/x",
268     ]
269   }
272 test("events_unittests") {
273   sources = [
274     "android/scroller_unittest.cc",
275     "cocoa/events_mac_unittest.mm",
276     "devices/x11/device_data_manager_x11_unittest.cc",
277     "event_dispatcher_unittest.cc",
278     "event_processor_unittest.cc",
279     "event_rewriter_unittest.cc",
280     "event_unittest.cc",
281     "gesture_detection/bitset_32_unittest.cc",
282     "gesture_detection/gesture_event_data_packet_unittest.cc",
283     "gesture_detection/gesture_provider_unittest.cc",
284     "gesture_detection/motion_event_buffer_unittest.cc",
285     "gesture_detection/motion_event_generic_unittest.cc",
286     "gesture_detection/snap_scroll_controller_unittest.cc",
287     "gesture_detection/touch_disposition_gesture_filter_unittest.cc",
288     "gesture_detection/velocity_tracker_unittest.cc",
289     "gestures/fling_curve_unittest.cc",
290     "keycodes/dom4/keycode_converter_unittest.cc",
291     "latency_info_unittest.cc",
292     "platform/platform_event_source_unittest.cc",
293     "x/events_x_unittest.cc",
294   ]
296   deps = [
297     ":dom4_keycode_converter",
298     ":events",
299     ":events_base",
300     ":gesture_detection",
301     ":test_support",
302     "//base",
303     "//base/test:run_all_unittests",
304     "//skia",
305     "//testing/gtest",
306     "//ui/events/devices",
307     "//ui/events/platform",
308     "//ui/gfx:test_support",
309   ]
311   if (use_x11) {
312     configs += [ "//build/config/linux:x11" ]
313     deps += [ "//ui/gfx/x" ]
314   } else {
315     sources -= [
316       "devices/x11/device_data_manager_x11_unittest.cc",
317       "x/events_x_unittest.cc",
318     ]
319   }
321   if (use_ozone) {
322     sources += [
323       "ozone/evdev/event_converter_evdev_impl_unittest.cc",
324       "ozone/evdev/tablet_event_converter_evdev_unittest.cc",
325       "ozone/evdev/touch_event_converter_evdev_unittest.cc",
326     ]
327     deps += [
328       "//ui/events/ozone:events_ozone",
329       "//ui/events/ozone:events_ozone_evdev",
330     ]
331   }
333   if (use_aura) {
334     sources += [
335       "gestures/gesture_provider_aura_unittest.cc",
336     ]
337   }