BUILD.gn revision 5c02ac1a9c1b504631c0a3d2b6e737b5d738bae1
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. 4 5import("//build/config/ui.gni") 6 7static_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 ] 13 14 deps = [ "//base" ] 15} 16 17component("events_base") { 18 sources = [ 19 "event_constants.h", 20 "event_switches.cc", 21 "event_switches.h", 22 "events_base_export.h", 23 "gesture_event_details.cc", 24 "gesture_event_details.h", 25 "keycodes/keyboard_code_conversion.cc", 26 "keycodes/keyboard_code_conversion.h", 27 "keycodes/keyboard_code_conversion_android.cc", 28 "keycodes/keyboard_code_conversion_android.h", 29 "keycodes/keyboard_code_conversion_mac.h", 30 "keycodes/keyboard_code_conversion_mac.mm", 31 "keycodes/keyboard_code_conversion_win.cc", 32 "keycodes/keyboard_code_conversion_win.h", 33 "keycodes/keyboard_codes.h", 34 "latency_info.cc", 35 "latency_info.h", 36 ] 37 38 defines = [ "EVENTS_BASE_IMPLEMENTATION" ] 39 40 deps = [ 41 ":dom4_keycode_converter", 42 "//base", 43 "//base/third_party/dynamic_annotations", 44 "//ui/gfx", 45 "//ui/gfx/geometry", 46 ] 47 48 if (use_x11) { 49 configs += [ "//build/config/linux:x11" ] 50 51 sources += [ 52 "keycodes/keyboard_code_conversion_x.cc", 53 "keycodes/keyboard_code_conversion_x.h", 54 "x/device_data_manager.cc", 55 "x/device_data_manager.h", 56 "x/device_list_cache_x.cc", 57 "x/device_list_cache_x.h", 58 "x/touch_factory_x11.cc", 59 "x/touch_factory_x11.h", 60 ] 61 } 62} 63 64component("events") { 65 deps = [ 66 ":dom4_keycode_converter", 67 ":events_base", 68 "//skia", 69 "//ui/gfx", 70 "//ui/gfx/geometry", 71 ] 72 73 defines = [ "EVENTS_IMPLEMENTATION" ] 74 75 sources = [ 76 "cocoa/cocoa_event_utils.h", 77 "cocoa/cocoa_event_utils.mm", 78 "event.cc", 79 "event.h", 80 "event_dispatcher.cc", 81 "event_dispatcher.h", 82 "event_handler.cc", 83 "event_handler.h", 84 "event_processor.cc", 85 "event_processor.h", 86 "event_rewriter.h", 87 "event_source.cc", 88 "event_source.h", 89 "event_target.cc", 90 "event_target.h", 91 "event_target_iterator.h", 92 "event_targeter.cc", 93 "event_targeter.h", 94 "event_utils.cc", 95 "event_utils.h", 96 "events_export.h", 97 "events_stub.cc", 98 "gestures/gesture_configuration.cc", 99 "gestures/gesture_configuration.h", 100 "gestures/gesture_point.cc", 101 "gestures/gesture_point.h", 102 "gestures/gesture_recognizer.h", 103 "gestures/gesture_recognizer_impl.cc", 104 "gestures/gesture_recognizer_impl.h", 105 "gestures/gesture_sequence.cc", 106 "gestures/gesture_sequence.h", 107 "gestures/gesture_types.h", 108 "gestures/velocity_calculator.cc", 109 "gestures/velocity_calculator.h", 110 "platform/platform_event_dispatcher.h", 111 "platform/platform_event_observer.h", 112 "platform/platform_event_source.cc", 113 "platform/platform_event_source.h", 114 "platform/platform_event_source_stub.cc", 115 "platform/platform_event_types.h", 116 "platform/scoped_event_dispatcher.cc", 117 "platform/scoped_event_dispatcher.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 ] 123 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 } 136 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 } 145 146 if (use_ozone) { 147 sources += [ 148 "ozone/evdev/device_manager_evdev.cc", 149 "ozone/evdev/device_manager_evdev.h", 150 "ozone/evdev/device_manager_udev.cc", 151 "ozone/evdev/device_manager_udev.h", 152 "ozone/evdev/event_converter_evdev.cc", 153 "ozone/evdev/event_converter_evdev.h", 154 "ozone/evdev/event_device_info.cc", 155 "ozone/evdev/event_device_info.h", 156 "ozone/evdev/event_factory_evdev.cc", 157 "ozone/evdev/event_factory_evdev.h", 158 "ozone/evdev/event_modifiers_evdev.cc", 159 "ozone/evdev/event_modifiers_evdev.h", 160 "ozone/evdev/key_event_converter_evdev.cc", 161 "ozone/evdev/key_event_converter_evdev.h", 162 "ozone/evdev/touch_event_converter_evdev.cc", 163 "ozone/evdev/touch_event_converter_evdev.h", 164 "ozone/event_factory_ozone.cc", 165 "ozone/event_factory_ozone.h", 166 "ozone/events_ozone.cc", 167 ] 168 } 169 170 if (is_win || use_x11 || use_ozone) { 171 sources -= [ "events_stub.cc" ] 172 } 173} 174 175component("gesture_detection") { 176 sources = [ 177 "gesture_detection/bitset_32.h", 178 "gesture_detection/filtered_gesture_provider.cc", 179 "gesture_detection/filtered_gesture_provider.h", 180 "gesture_detection/gesture_detection_export.h", 181 "gesture_detection/gesture_detector.cc", 182 "gesture_detection/gesture_detector.h", 183 "gesture_detection/gesture_event_data.cc", 184 "gesture_detection/gesture_event_data.h", 185 "gesture_detection/gesture_event_data_packet.cc", 186 "gesture_detection/gesture_event_data_packet.h", 187 "gesture_detection/gesture_config_helper.h", 188 "gesture_detection/gesture_config_helper_aura.cc", 189 "gesture_detection/gesture_config_helper_android.cc", 190 "gesture_detection/gesture_provider.cc", 191 "gesture_detection/gesture_provider.h", 192 "gesture_detection/motion_event.h", 193 "gesture_detection/scale_gesture_detector.cc", 194 "gesture_detection/scale_gesture_detector.h", 195 "gesture_detection/snap_scroll_controller.cc", 196 "gesture_detection/snap_scroll_controller.h", 197 "gesture_detection/touch_disposition_gesture_filter.cc", 198 "gesture_detection/touch_disposition_gesture_filter.h", 199 "gesture_detection/velocity_tracker_state.cc", 200 "gesture_detection/velocity_tracker_state.h", 201 "gesture_detection/velocity_tracker.cc", 202 "gesture_detection/velocity_tracker.h", 203 ] 204 205 deps = [ 206 ":events_base", 207 "//base", 208 "//ui/gfx", 209 "//ui/gfx/geometry", 210 ] 211 212 defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ] 213 214 if (use_aura) { 215 deps += [ ":events" ] 216 } 217 218 if (!use_aura && !is_android) { 219 sources -= [ "gesture_detection/gesture_config_helper_aura.cc" ] 220 } 221} 222 223source_set("events_test_support") { 224 sources = [ 225 "test/cocoa_test_event_utils.h", 226 "test/cocoa_test_event_utils.mm", 227 "test/events_test_utils.cc", 228 "test/events_test_utils.h", 229 "test/events_test_utils_x11.cc", 230 "test/events_test_utils_x11.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 ] 240 241 deps = [ 242 ":events_base", 243 ":events", 244 ] 245 246 if (is_ios) { 247 sources -= [ 248 "test/cocoa_test_event_utils.h", 249 "test/cocoa_test_event_utils.mm", 250 ] 251 } 252 253 if (use_x11) { 254 configs += [ "//build/config/linux:x11" ] 255 } else { 256 sources -= [ 257 "test/events_test_utils_x11.cc", 258 "test/events_test_utils_x11.h", 259 ] 260 } 261} 262 263test("events_unittests") { 264 sources = [ 265 "cocoa/cocoa_event_utils_unittest.mm", 266 "event_dispatcher_unittest.cc", 267 "event_processor_unittest.cc", 268 "event_rewriter_unittest.cc", 269 "event_unittest.cc", 270 "gestures/velocity_calculator_unittest.cc", 271 "gesture_detection/bitset_32_unittest.cc", 272 "gesture_detection/gesture_provider_unittest.cc", 273 "gesture_detection/mock_motion_event.h", 274 "gesture_detection/mock_motion_event.cc", 275 "gesture_detection/velocity_tracker_unittest.cc", 276 "gesture_detection/touch_disposition_gesture_filter_unittest.cc", 277 "keycodes/dom4/keycode_converter_unittest.cc", 278 "latency_info_unittest.cc", 279 "platform/platform_event_source_unittest.cc", 280 "x/events_x_unittest.cc", 281 ] 282 283 if (!use_x11) { 284 sources -= [ 285 "x/events_x_unittest.cc", 286 ] 287 } 288 289 if (use_ozone) { 290 sources += [ 291 "ozone/evdev/key_event_converter_evdev_unittest.cc", 292 "ozone/evdev/touch_event_converter_evdev_unittest.cc", 293 ] 294 } 295 296 deps = [ 297 ":events", 298 ":events_base", 299 ":events_test_support", 300 ":gesture_detection", 301 "//base", 302 "//base/test:run_all_unittests", 303 "//testing/gtest", 304 "//ui/gfx:gfx_test_support", 305 ] 306} 307