blob: 3b900e831b3821e069fc20df9d714c5ad4170726 [file] [log] [blame]
# 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")
static_library("dom4_keycode_converter") {
sources = [
"keycodes/dom4/keycode_converter.cc",
"keycodes/dom4/keycode_converter.h",
"keycodes/dom4/keycode_converter_data.h",
]
deps = [ "//base" ]
}
component("events_base") {
sources = [
"device_data_manager.cc",
"device_data_manager.h",
"event_constants.h",
"event_switches.cc",
"event_switches.h",
"events_base_export.h",
"gesture_event_details.cc",
"gesture_event_details.h",
"gestures/gesture_configuration.cc",
"gestures/gesture_configuration.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_code_conversion_mac.h",
"keycodes/keyboard_code_conversion_mac.mm",
"keycodes/keyboard_code_conversion_win.cc",
"keycodes/keyboard_code_conversion_win.h",
"keycodes/keyboard_codes.h",
"latency_info.cc",
"latency_info.h",
]
defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
deps = [
":dom4_keycode_converter",
"//base",
"//base/third_party/dynamic_annotations",
"//skia",
"//ui/events/platform",
"//ui/gfx",
"//ui/gfx/geometry",
]
forward_dependent_configs_from = [ "//ui/gfx" ]
if (use_x11) {
configs += [ "//build/config/linux:x11" ]
sources += [
"keycodes/keyboard_code_conversion_x.cc",
"keycodes/keyboard_code_conversion_x.h",
"x/device_data_manager_x11.cc",
"x/device_data_manager_x11.h",
"x/device_list_cache_x.cc",
"x/device_list_cache_x.h",
"x/touch_factory_x11.cc",
"x/touch_factory_x11.h",
]
}
}
component("events") {
deps = [
":dom4_keycode_converter",
":events_base",
":gesture_detection",
"//base/third_party/dynamic_annotations",
"//skia",
"//ui/gfx",
"//ui/gfx/geometry",
]
defines = [ "EVENTS_IMPLEMENTATION" ]
sources = [
"cocoa/cocoa_event_utils.h",
"cocoa/cocoa_event_utils.mm",
"cocoa/events_mac.mm",
"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.cc",
"event_targeter.h",
"event_utils.cc",
"event_utils.h",
"events_export.h",
"events_stub.cc",
"gestures/gesture_point.cc",
"gestures/gesture_point.h",
"gestures/gesture_recognizer_impl_mac.cc",
"gestures/gesture_sequence.cc",
"gestures/gesture_sequence.h",
"gestures/gesture_types.h",
"gestures/unified_gesture_detector_enabled.cc",
"gestures/unified_gesture_detector_enabled.h",
"gestures/velocity_calculator.cc",
"gestures/velocity_calculator.h",
"win/events_win.cc",
"x/events_x.cc",
]
if (use_x11) {
configs += [
"//build/config/linux:glib",
"//build/config/linux:x11",
]
} else {
sources -= [
"x/events_x.cc",
]
}
if (!is_chromeos && is_linux) {
sources += [
"linux/text_edit_command_auralinux.cc",
"linux/text_edit_command_auralinux.h",
"linux/text_edit_key_bindings_delegate_auralinux.cc",
"linux/text_edit_key_bindings_delegate_auralinux.h",
]
}
if (use_ozone) {
sources += [
"ozone/device/udev/device_manager_udev.cc",
"ozone/device/udev/device_manager_udev.h",
"ozone/evdev/event_converter_evdev.cc",
"ozone/evdev/event_converter_evdev.h",
"ozone/evdev/event_device_info.cc",
"ozone/evdev/event_device_info.h",
"ozone/evdev/event_factory_evdev.cc",
"ozone/evdev/event_factory_evdev.h",
"ozone/evdev/event_modifiers_evdev.cc",
"ozone/evdev/event_modifiers_evdev.h",
"ozone/evdev/key_event_converter_evdev.cc",
"ozone/evdev/key_event_converter_evdev.h",
"ozone/evdev/touch_event_converter_evdev.cc",
"ozone/evdev/touch_event_converter_evdev.h",
"ozone/event_factory_ozone.cc",
"ozone/event_factory_ozone.h",
"ozone/events_ozone.cc",
]
}
if (use_aura) {
sources += [
"gestures/gesture_provider_aura.cc",
"gestures/gesture_provider_aura.h",
"gestures/motion_event_aura.cc",
"gestures/motion_event_aura.h",
"gestures/gesture_recognizer.h",
"gestures/gesture_recognizer_impl.cc",
"gestures/gesture_recognizer_impl.h",
]
}
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_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_config_helper.h",
"gesture_detection/gesture_provider.cc",
"gesture_detection/gesture_provider.h",
"gesture_detection/motion_event.h",
"gesture_detection/scale_gesture_detector.cc",
"gesture_detection/scale_gesture_detector.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_state.cc",
"gesture_detection/velocity_tracker_state.h",
"gesture_detection/velocity_tracker.cc",
"gesture_detection/velocity_tracker.h",
]
deps = [
":events_base",
"//base",
"//ui/gfx",
"//ui/gfx/geometry",
]
defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
if (is_android) {
sources += [ "gesture_detection/gesture_config_helper_android.cc" ]
} else if (use_aura) {
sources += [ "gesture_detection/gesture_config_helper_aura.cc" ]
} else {
sources += [ "gesture_detection/gesture_config_helper.cc" ]
}
}
source_set("test_support") {
sources = [
"test/cocoa_test_event_utils.h",
"test/cocoa_test_event_utils.mm",
"test/events_test_utils.cc",
"test/events_test_utils.h",
"test/events_test_utils_x11.cc",
"test/events_test_utils_x11.h",
"test/mock_motion_event.cc",
"test/mock_motion_event.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",
]
deps = [
"//skia",
":events_base",
":events",
]
if (is_ios) {
sources -= [
"test/cocoa_test_event_utils.h",
"test/cocoa_test_event_utils.mm",
]
}
if (use_x11) {
configs += [ "//build/config/linux:x11" ]
} else {
sources -= [
"test/events_test_utils_x11.cc",
"test/events_test_utils_x11.h",
]
}
}
test("events_unittests") {
sources = [
"cocoa/events_mac_unittest.mm",
"event_dispatcher_unittest.cc",
"event_processor_unittest.cc",
"event_rewriter_unittest.cc",
"event_unittest.cc",
"gestures/velocity_calculator_unittest.cc",
"gesture_detection/bitset_32_unittest.cc",
"gesture_detection/gesture_event_data_packet_unittest.cc",
"gesture_detection/gesture_provider_unittest.cc",
"gesture_detection/velocity_tracker_unittest.cc",
"gesture_detection/touch_disposition_gesture_filter_unittest.cc",
"keycodes/dom4/keycode_converter_unittest.cc",
"latency_info_unittest.cc",
"platform/platform_event_source_unittest.cc",
"x/events_x_unittest.cc",
]
if (!use_x11) {
sources -= [
"x/events_x_unittest.cc",
]
}
if (use_ozone) {
sources += [
"ozone/evdev/key_event_converter_evdev_unittest.cc",
"ozone/evdev/touch_event_converter_evdev_unittest.cc",
]
}
deps = [
":events",
":events_base",
":gesture_detection",
":test_support",
"//base",
"//base/test:run_all_unittests",
"//skia",
"//testing/gtest",
"//ui/gfx:test_support",
]
}