1# Copyright 2013 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
5{
6  'variables': {
7    'chromium_code': 1,
8  },
9  'targets': [
10    {
11      # GN version: //ui/events:dom4_keycode_converter
12      'target_name': 'dom4_keycode_converter',
13      'type': 'static_library',
14      'dependencies': [
15        '<(DEPTH)/base/base.gyp:base',
16      ],
17      'sources': [
18        # Note: sources list duplicated in GN build.
19        'keycodes/dom4/keycode_converter.cc',
20        'keycodes/dom4/keycode_converter.h',
21        'keycodes/dom4/keycode_converter_data.h',
22      ],
23    },
24    {
25      # GN version: //ui/events:events_base
26      'target_name': 'events_base',
27      'type': '<(component)',
28      'dependencies': [
29        '<(DEPTH)/base/base.gyp:base',
30        '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
31        '<(DEPTH)/skia/skia.gyp:skia',
32        '../gfx/gfx.gyp:gfx',
33        '../gfx/gfx.gyp:gfx_geometry',
34        'dom4_keycode_converter',
35      ],
36      'defines': [
37        'EVENTS_BASE_IMPLEMENTATION',
38      ],
39      'sources': [
40        # Note: sources list duplicated in GN build.
41        'device_data_manager.cc',
42        'device_data_manager.h',
43        'device_hotplug_event_observer.h',
44        'event_constants.h',
45        'event_switches.cc',
46        'event_switches.h',
47        'events_base_export.h',
48        'gesture_event_details.cc',
49        'gesture_event_details.h',
50        'gestures/fling_curve.cc',
51        'gestures/fling_curve.h',
52        'gestures/gesture_configuration.cc',
53        'gestures/gesture_configuration.h',
54        'keycodes/keyboard_code_conversion.cc',
55        'keycodes/keyboard_code_conversion.h',
56        'keycodes/keyboard_code_conversion_android.cc',
57        'keycodes/keyboard_code_conversion_android.h',
58        'keycodes/keyboard_code_conversion_mac.h',
59        'keycodes/keyboard_code_conversion_mac.mm',
60        'keycodes/keyboard_code_conversion_win.cc',
61        'keycodes/keyboard_code_conversion_win.h',
62        'keycodes/keyboard_code_conversion_x.cc',
63        'keycodes/keyboard_code_conversion_x.h',
64        'keycodes/keyboard_codes.h',
65        'latency_info.cc',
66        'latency_info.h',
67        'touchscreen_device.cc',
68        'touchscreen_device.h',
69        'x/device_data_manager_x11.cc',
70        'x/device_data_manager_x11.h',
71        'x/device_list_cache_x.cc',
72        'x/device_list_cache_x.h',
73        'x/hotplug_event_handler_x11.cc',
74        'x/hotplug_event_handler_x11.h',
75        'x/keysym_to_unicode.cc',
76        'x/keysym_to_unicode.h',
77        'x/touch_factory_x11.cc',
78        'x/touch_factory_x11.h',
79      ],
80      'export_dependent_settings': [
81        '../../ui/gfx/gfx.gyp:gfx',
82      ],
83      'conditions': [
84        ['use_x11==1', {
85          'dependencies': [
86            '../../build/linux/system.gyp:x11',
87            '../gfx/x/gfx_x11.gyp:gfx_x11',
88          ],
89        }],
90      ],
91    },
92    {
93      # GN version: //ui/events
94      'target_name': 'events',
95      'type': '<(component)',
96      'dependencies': [
97        '<(DEPTH)/base/base.gyp:base',
98        '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
99        '<(DEPTH)/skia/skia.gyp:skia',
100        '../gfx/gfx.gyp:gfx',
101        '../gfx/gfx.gyp:gfx_geometry',
102        'events_base',
103        'gesture_detection',
104      ],
105      'defines': [
106        'EVENTS_IMPLEMENTATION',
107      ],
108      'sources': [
109        # Note: sources list duplicated in GN build.
110        'cocoa/cocoa_event_utils.h',
111        'cocoa/cocoa_event_utils.mm',
112        'cocoa/events_mac.mm',
113        'event.cc',
114        'event.h',
115        'event_dispatcher.cc',
116        'event_dispatcher.h',
117        'event_handler.cc',
118        'event_handler.h',
119        'event_processor.cc',
120        'event_processor.h',
121        'event_rewriter.h',
122        'event_source.cc',
123        'event_source.h',
124        'event_target.cc',
125        'event_target.h',
126        'event_target_iterator.h',
127        'event_targeter.cc',
128        'event_targeter.h',
129        'event_utils.cc',
130        'event_utils.h',
131        'events_export.h',
132        'events_stub.cc',
133        'gestures/gesture_provider_aura.cc',
134        'gestures/gesture_provider_aura.h',
135        'gestures/gesture_recognizer.h',
136        'gestures/gesture_recognizer_impl.cc',
137        'gestures/gesture_recognizer_impl.h',
138        'gestures/gesture_recognizer_impl_mac.cc',
139        'gestures/gesture_types.h',
140        'gestures/motion_event_aura.cc',
141        'gestures/motion_event_aura.h',
142        'ozone/events_ozone.cc',
143        'win/events_win.cc',
144        'x/events_x.cc',
145        'linux/text_edit_command_auralinux.cc',
146        'linux/text_edit_command_auralinux.h',
147        'linux/text_edit_key_bindings_delegate_auralinux.cc',
148        'linux/text_edit_key_bindings_delegate_auralinux.h',
149      ],
150      'conditions': [
151        ['use_x11==1', {
152          'dependencies': [
153            '../../build/linux/system.gyp:x11',
154          ],
155        }],
156        ['use_aura==0', {
157          'sources!': [
158            'gestures/gesture_provider_aura.cc',
159            'gestures/gesture_provider_aura.h',
160            'gestures/gesture_recognizer.h',
161            'gestures/gesture_recognizer_impl.cc',
162            'gestures/gesture_recognizer_impl.h',
163            'gestures/gesture_types.h',
164            'gestures/motion_event_aura.cc',
165            'gestures/motion_event_aura.h',
166          ],
167        }],
168        # We explicitly enumerate the platforms we _do_ provide native cracking
169        # for here.
170        ['OS=="win" or OS=="mac" or use_x11==1 or use_ozone==1', {
171          'sources!': [
172            'events_stub.cc',
173          ],
174        }],
175        ['chromeos==1', {
176          'sources!': [
177            'linux/text_edit_command_auralinux.cc',
178            'linux/text_edit_command_auralinux.h',
179            'linux/text_edit_key_bindings_delegate_auralinux.cc',
180            'linux/text_edit_key_bindings_delegate_auralinux.h',
181          ],
182        }],
183      ],
184    },
185    {
186      # GN version: //ui/events:gesture_detection
187      'target_name': 'gesture_detection',
188      'type': '<(component)',
189      'dependencies': [
190        '<(DEPTH)/base/base.gyp:base',
191        '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
192        '../gfx/gfx.gyp:gfx',
193        '../gfx/gfx.gyp:gfx_geometry',
194        'events_base',
195      ],
196      'defines': [
197        'GESTURE_DETECTION_IMPLEMENTATION',
198      ],
199      'sources': [
200        # Note: sources list duplicated in GN build.
201        'gesture_detection/bitset_32.h',
202        'gesture_detection/filtered_gesture_provider.cc',
203        'gesture_detection/filtered_gesture_provider.h',
204        'gesture_detection/gesture_config_helper.h',
205        'gesture_detection/gesture_config_helper_android.cc',
206        'gesture_detection/gesture_config_helper_aura.cc',
207        'gesture_detection/gesture_detection_export.h',
208        'gesture_detection/gesture_detector.cc',
209        'gesture_detection/gesture_detector.h',
210        'gesture_detection/gesture_event_data.cc',
211        'gesture_detection/gesture_event_data.h',
212        'gesture_detection/gesture_event_data_packet.cc',
213        'gesture_detection/gesture_event_data_packet.h',
214        'gesture_detection/gesture_provider.cc',
215        'gesture_detection/gesture_provider.h',
216        'gesture_detection/gesture_touch_uma_histogram.cc',
217        'gesture_detection/gesture_touch_uma_histogram.h',
218        'gesture_detection/motion_event.cc',
219        'gesture_detection/motion_event.h',
220        'gesture_detection/motion_event_buffer.cc',
221        'gesture_detection/motion_event_buffer.h',
222        'gesture_detection/motion_event_generic.cc',
223        'gesture_detection/motion_event_generic.h',
224        'gesture_detection/scale_gesture_detector.cc',
225        'gesture_detection/scale_gesture_detector.h',
226        'gesture_detection/snap_scroll_controller.cc',
227        'gesture_detection/snap_scroll_controller.h',
228        'gesture_detection/touch_disposition_gesture_filter.cc',
229        'gesture_detection/touch_disposition_gesture_filter.h',
230        'gesture_detection/velocity_tracker_state.cc',
231        'gesture_detection/velocity_tracker_state.h',
232        'gesture_detection/velocity_tracker.cc',
233        'gesture_detection/velocity_tracker.h',
234      ],
235      'conditions': [
236        ['use_aura!=1 and OS!="android"', {
237          'sources': [
238            'gesture_detection/gesture_config_helper.cc',
239          ],
240        }],
241      ],
242    },
243    {
244      # GN version: //ui/events:test_support
245      'target_name': 'events_test_support',
246      'type': 'static_library',
247      'dependencies': [
248        '<(DEPTH)/base/base.gyp:base',
249        '<(DEPTH)/skia/skia.gyp:skia',
250        '../gfx/gfx.gyp:gfx_geometry',
251        'events',
252        'events_base',
253        'gesture_detection',
254        'platform/events_platform.gyp:events_platform',
255      ],
256      'sources': [
257        # Note: sources list duplicated in GN build.
258        'test/cocoa_test_event_utils.h',
259        'test/cocoa_test_event_utils.mm',
260        'test/event_generator.cc',
261        'test/event_generator.h',
262        'test/events_test_utils.cc',
263        'test/events_test_utils.h',
264        'test/events_test_utils_x11.cc',
265        'test/events_test_utils_x11.h',
266        'test/mock_motion_event.cc',
267        'test/mock_motion_event.h',
268        'test/platform_event_waiter.cc',
269        'test/platform_event_waiter.h',
270        'test/test_event_handler.cc',
271        'test/test_event_handler.h',
272        'test/test_event_processor.cc',
273        'test/test_event_processor.h',
274        'test/test_event_target.cc',
275        'test/test_event_target.h',
276      ],
277      'conditions': [
278        ['OS=="ios"', {
279          # The cocoa files don't apply to iOS.
280          'sources/': [['exclude', 'cocoa']],
281        }],
282      ],
283    },
284    {
285      # GN version: //ui/events:events_unittests
286      'target_name': 'events_unittests',
287      'type': '<(gtest_target_type)',
288      'dependencies': [
289        '<(DEPTH)/base/base.gyp:base',
290        '<(DEPTH)/base/base.gyp:run_all_unittests',
291        '<(DEPTH)/base/base.gyp:test_support_base',
292        '<(DEPTH)/skia/skia.gyp:skia',
293        '<(DEPTH)/testing/gtest.gyp:gtest',
294        '../gfx/gfx.gyp:gfx',
295        '../gfx/gfx.gyp:gfx_geometry',
296        '../gfx/gfx.gyp:gfx_test_support',
297        'dom4_keycode_converter',
298        'events',
299        'events_base',
300        'events_test_support',
301        'gesture_detection',
302        'platform/events_platform.gyp:events_platform',
303      ],
304      'sources': [
305        # Note: sources list duplicated in GN build.
306        'cocoa/events_mac_unittest.mm',
307        'event_dispatcher_unittest.cc',
308        'event_processor_unittest.cc',
309        'event_rewriter_unittest.cc',
310        'event_unittest.cc',
311        'gesture_detection/bitset_32_unittest.cc',
312        'gesture_detection/gesture_event_data_packet_unittest.cc',
313        'gesture_detection/gesture_provider_unittest.cc',
314        'gesture_detection/motion_event_buffer_unittest.cc',
315        'gesture_detection/motion_event_generic_unittest.cc',
316        'gesture_detection/touch_disposition_gesture_filter_unittest.cc',
317        'gesture_detection/velocity_tracker_unittest.cc',
318        'gestures/fling_curve_unittest.cc',
319        'gestures/gesture_provider_aura_unittest.cc',
320        'gestures/motion_event_aura_unittest.cc',
321        'keycodes/dom4/keycode_converter_unittest.cc',
322        'latency_info_unittest.cc',
323        'platform/platform_event_source_unittest.cc',
324        'x/events_x_unittest.cc',
325      ],
326      'conditions': [
327        ['use_x11==1', {
328          'dependencies': [
329            '../../build/linux/system.gyp:x11',
330            '../gfx/x/gfx_x11.gyp:gfx_x11',
331          ],
332        }],
333        ['use_ozone==1', {
334          'sources': [
335            'ozone/evdev/key_event_converter_evdev_unittest.cc',
336            'ozone/evdev/touch_event_converter_evdev_unittest.cc',
337          ],
338          'dependencies': [
339            'ozone/events_ozone.gyp:events_ozone',
340            'ozone/events_ozone.gyp:events_ozone_evdev',
341          ]
342        }],
343        ['use_aura==0', {
344          'sources!': [
345            'gestures/gesture_provider_aura_unittest.cc',
346            'gestures/motion_event_aura_unittest.cc',
347          ],
348        }],
349        ['OS=="linux" and use_allocator!="none"', {
350          'dependencies': [
351            '<(DEPTH)/base/allocator/allocator.gyp:allocator',
352          ],
353        }],
354        # Exclude tests that rely on event_utils.h for platforms that do not
355        # provide native cracking, i.e., platforms that use events_stub.cc.
356        ['OS!="win" and use_x11!=1 and use_ozone!=1', {
357          'sources!': [
358            'event_unittest.cc',
359          ],
360        }],
361        ['OS == "android"', {
362          'dependencies': [
363            '../../testing/android/native_test.gyp:native_test_native_code',
364          ],
365        }],
366      ],
367    },
368  ],
369  'conditions': [
370    ['OS == "android"', {
371      'targets': [
372        {
373          'target_name': 'events_unittests_apk',
374          'type': 'none',
375          'dependencies': [
376            'events_unittests',
377          ],
378          'variables': {
379            'test_suite_name': 'events_unittests',
380          },
381          'includes': [ '../../build/apk_test.gypi' ],
382        },
383      ],
384    }],
385  ],
386}
387