| # 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/ui.gni") |
| import("//testing/test.gni") |
| |
| static_library("dom_keycode_converter") { |
| sources = [ |
| "keycodes/dom/dom_code.h", |
| "keycodes/dom/dom_key.h", |
| "keycodes/dom/dom_key_data.inc", |
| "keycodes/dom/keycode_converter.cc", |
| "keycodes/dom/keycode_converter.h", |
| "keycodes/dom/keycode_converter_data.inc", |
| ] |
| |
| deps = [ |
| "//base", |
| ] |
| } |
| |
| component("events_base") { |
| sources = [ |
| "base_event_utils.cc", |
| "base_event_utils.h", |
| "event_constants.h", |
| "event_switches.cc", |
| "event_switches.h", |
| "events_base_export.h", |
| "gesture_curve.h", |
| "gesture_event_details.cc", |
| "gesture_event_details.h", |
| "gestures/fling_curve.cc", |
| "gestures/fling_curve.h", |
| "keycodes/dom_us_layout_data.h", |
| "keycodes/keyboard_code_conversion.cc", |
| "keycodes/keyboard_code_conversion.h", |
| "keycodes/keyboard_code_conversion_android.cc", |
| "keycodes/keyboard_code_conversion_android.h", |
| "keycodes/keyboard_codes.h", |
| "latency_info.cc", |
| "latency_info.h", |
| ] |
| |
| defines = [ "EVENTS_BASE_IMPLEMENTATION" ] |
| |
| deps = [ |
| ":dom_keycode_converter", |
| "//base/third_party/dynamic_annotations", |
| "//skia", |
| ] |
| |
| public_deps = [ |
| "//base", |
| "//ui/events/platform", |
| "//ui/gfx", |
| "//ui/gfx/geometry", |
| ] |
| |
| if (use_x11) { |
| configs += [ "//build/config/linux:x11" ] |
| |
| sources += [ |
| "keycodes/keyboard_code_conversion_x.cc", |
| "keycodes/keyboard_code_conversion_x.h", |
| "x/keysym_to_unicode.cc", |
| "x/keysym_to_unicode.h", |
| ] |
| |
| deps += [ "//ui/gfx/x" ] |
| } |
| |
| if (use_x11) { |
| sources += [ |
| "keycodes/keyboard_code_conversion_xkb.cc", |
| "keycodes/keyboard_code_conversion_xkb.h", |
| "keycodes/xkb_keysym.h", |
| ] |
| } |
| } |
| |
| component("events") { |
| sources = [ |
| "event.cc", |
| "event.h", |
| "event_dispatcher.cc", |
| "event_dispatcher.h", |
| "event_handler.cc", |
| "event_handler.h", |
| "event_processor.cc", |
| "event_processor.h", |
| "event_rewriter.h", |
| "event_source.cc", |
| "event_source.h", |
| "event_target.cc", |
| "event_target.h", |
| "event_target_iterator.h", |
| "event_targeter.h", |
| "event_utils.cc", |
| "event_utils.h", |
| "events_export.h", |
| "events_stub.cc", |
| "gestures/gesture_provider_impl.cc", |
| "gestures/gesture_provider_impl.h", |
| "gestures/gesture_recognizer.h", |
| "gestures/gesture_recognizer_impl.cc", |
| "gestures/gesture_recognizer_impl.h", |
| "gestures/gesture_types.h", |
| "gestures/motion_event_impl.cc", |
| "gestures/motion_event_impl.h", |
| "null_event_targeter.cc", |
| "null_event_targeter.h", |
| ] |
| |
| defines = [ "EVENTS_IMPLEMENTATION" ] |
| |
| public_deps = [ |
| ":events_base", |
| ] |
| deps = [ |
| ":dom_keycode_converter", |
| ":gesture_detection", |
| "//base/third_party/dynamic_annotations", |
| "//skia", |
| "//ui/gfx", |
| "//ui/gfx/geometry", |
| ] |
| |
| if (use_x11) { |
| sources += [ "x/events_x.cc" ] |
| configs += [ "//build/config/linux:x11" ] |
| deps += [ |
| "//ui/events/devices", |
| "//ui/gfx/x", |
| ] |
| } |
| |
| if (use_ozone) { |
| sources += [ "ozone/events_ozone.cc" ] |
| deps += [ "//ui/events/ozone:events_ozone_layout" ] |
| } |
| |
| if (is_win || is_mac || use_x11 || use_ozone) { |
| sources -= [ "events_stub.cc" ] |
| } |
| } |
| |
| component("gesture_detection") { |
| sources = [ |
| "gesture_detection/bitset_32.h", |
| "gesture_detection/filtered_gesture_provider.cc", |
| "gesture_detection/filtered_gesture_provider.h", |
| "gesture_detection/gesture_configuration.cc", |
| "gesture_detection/gesture_configuration.h", |
| "gesture_detection/gesture_detection_export.h", |
| "gesture_detection/gesture_detector.cc", |
| "gesture_detection/gesture_detector.h", |
| "gesture_detection/gesture_event_data.cc", |
| "gesture_detection/gesture_event_data.h", |
| "gesture_detection/gesture_event_data_packet.cc", |
| "gesture_detection/gesture_event_data_packet.h", |
| "gesture_detection/gesture_listeners.cc", |
| "gesture_detection/gesture_listeners.h", |
| "gesture_detection/gesture_provider.cc", |
| "gesture_detection/gesture_provider.h", |
| "gesture_detection/gesture_provider_config_helper.cc", |
| "gesture_detection/gesture_provider_config_helper.h", |
| "gesture_detection/gesture_touch_uma_histogram.cc", |
| "gesture_detection/gesture_touch_uma_histogram.h", |
| "gesture_detection/motion_event.cc", |
| "gesture_detection/motion_event.h", |
| "gesture_detection/motion_event_buffer.cc", |
| "gesture_detection/motion_event_buffer.h", |
| "gesture_detection/motion_event_generic.cc", |
| "gesture_detection/motion_event_generic.h", |
| "gesture_detection/scale_gesture_detector.cc", |
| "gesture_detection/scale_gesture_detector.h", |
| "gesture_detection/scale_gesture_listeners.cc", |
| "gesture_detection/scale_gesture_listeners.h", |
| "gesture_detection/snap_scroll_controller.cc", |
| "gesture_detection/snap_scroll_controller.h", |
| "gesture_detection/touch_disposition_gesture_filter.cc", |
| "gesture_detection/touch_disposition_gesture_filter.h", |
| "gesture_detection/velocity_tracker.cc", |
| "gesture_detection/velocity_tracker.h", |
| "gesture_detection/velocity_tracker_state.cc", |
| "gesture_detection/velocity_tracker_state.h", |
| ] |
| |
| deps = [ |
| ":events_base", |
| "//base", |
| "//base/third_party/dynamic_annotations", |
| "//ui/gfx", |
| "//ui/gfx/geometry", |
| ] |
| |
| defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ] |
| |
| if (is_android) { |
| sources += [ "gesture_detection/gesture_configuration_android.cc" ] |
| } else { |
| sources += [ "gesture_detection/gesture_configuration_default.cc" ] |
| } |
| } |
| |
| source_set("test_support") { |
| sources = [ |
| "test/event_generator.cc", |
| "test/event_generator.h", |
| "test/events_test_utils.cc", |
| "test/events_test_utils.h", |
| "test/motion_event_test_utils.cc", |
| "test/motion_event_test_utils.h", |
| "test/platform_event_waiter.cc", |
| "test/platform_event_waiter.h", |
| "test/test_event_handler.cc", |
| "test/test_event_handler.h", |
| "test/test_event_processor.cc", |
| "test/test_event_processor.h", |
| "test/test_event_target.cc", |
| "test/test_event_target.h", |
| "test/test_event_targeter.cc", |
| "test/test_event_targeter.h", |
| ] |
| |
| public_deps = [ |
| ":events", |
| ":events_base", |
| ":gesture_detection", |
| ] |
| deps = [ |
| "//base", |
| "//skia", |
| "//ui/events/platform", |
| "//ui/gfx/geometry", |
| ] |
| |
| if (use_x11) { |
| sources += [ |
| "test/events_test_utils_x11.cc", |
| "test/events_test_utils_x11.h", |
| ] |
| deps += [ |
| "//ui/events/devices", |
| "//ui/gfx/x", |
| ] |
| } |
| } |
| |
| test("events_unittests") { |
| sources = [ |
| "devices/x11/device_data_manager_x11_unittest.cc", |
| "event_dispatcher_unittest.cc", |
| "event_processor_unittest.cc", |
| "event_rewriter_unittest.cc", |
| "event_unittest.cc", |
| "gesture_detection/bitset_32_unittest.cc", |
| "gesture_detection/filtered_gesture_provider_unittest.cc", |
| "gesture_detection/gesture_event_data_packet_unittest.cc", |
| "gesture_detection/gesture_provider_unittest.cc", |
| "gesture_detection/motion_event_buffer_unittest.cc", |
| "gesture_detection/motion_event_generic_unittest.cc", |
| "gesture_detection/snap_scroll_controller_unittest.cc", |
| "gesture_detection/touch_disposition_gesture_filter_unittest.cc", |
| "gesture_detection/velocity_tracker_unittest.cc", |
| "gestures/fling_curve_unittest.cc", |
| "gestures/gesture_provider_impl_unittest.cc", |
| "keycodes/dom/keycode_converter_unittest.cc", |
| "keycodes/keyboard_code_conversion_unittest.cc", |
| "latency_info_unittest.cc", |
| "platform/platform_event_source_unittest.cc", |
| "x/events_x_unittest.cc", |
| ] |
| |
| deps = [ |
| ":dom_keycode_converter", |
| ":events", |
| ":events_base", |
| ":gesture_detection", |
| ":test_support", |
| "//base", |
| "//base/test:run_all_unittests", |
| "//skia", |
| "//testing/gtest", |
| "//ui/events/devices", |
| "//ui/events/platform", |
| "//ui/gfx:test_support", |
| "//testing/gmock:gmock", |
| ] |
| |
| include_dirs = [ "//testing/gmock/include" ] |
| |
| if (use_x11) { |
| configs += [ "//build/config/linux:x11" ] |
| deps += [ "//ui/gfx/x" ] |
| } else { |
| sources -= [ |
| "devices/x11/device_data_manager_x11_unittest.cc", |
| "x/events_x_unittest.cc", |
| ] |
| } |
| |
| if (use_ozone) { |
| sources += [ |
| "ozone/chromeos/cursor_controller_unittest.cc", |
| "ozone/evdev/event_converter_evdev_impl_unittest.cc", |
| "ozone/evdev/event_converter_test_util.cc", |
| "ozone/evdev/event_device_info_unittest.cc", |
| "ozone/evdev/event_device_test_util.cc", |
| "ozone/evdev/input_injector_evdev_unittest.cc", |
| "ozone/evdev/tablet_event_converter_evdev_unittest.cc", |
| "ozone/evdev/touch_event_converter_evdev_unittest.cc", |
| "ozone/evdev/touch_noise/touch_noise_finder_unittest.cc", |
| ] |
| if (use_x11) { |
| sources += [ "ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc" ] |
| } |
| deps += [ |
| "//ui/events/ozone:events_ozone", |
| "//ui/events/ozone:events_ozone_evdev", |
| "//ui/events/ozone:events_ozone_layout", |
| ] |
| } |
| } |
| |
| if (is_nacl) { |
| source_set("latency_info") { |
| sources = [ |
| "ipc/latency_info_param_traits.cc", |
| "ipc/latency_info_param_traits.h", |
| "latency_info.cc", |
| "latency_info.h", |
| ] |
| } |
| } |