Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ui / events / events.gyp
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       'target_name': 'dom4_keycode_converter',
12       'type': 'static_library',
13       'dependencies': [
14         '<(DEPTH)/base/base.gyp:base',
15       ],
16       'sources': [
17         'keycodes/dom4/keycode_converter.cc',
18         'keycodes/dom4/keycode_converter.h',
19         'keycodes/dom4/keycode_converter_data.h',
20       ],
21     },
22     {
23       'target_name': 'events_base',
24       'type': '<(component)',
25       'dependencies': [
26         '<(DEPTH)/base/base.gyp:base',
27         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
28         '../gfx/gfx.gyp:gfx',
29         '../gfx/gfx.gyp:gfx_geometry',
30         'dom4_keycode_converter',
31       ],
32       'defines': [
33         'EVENTS_BASE_IMPLEMENTATION',
34       ],
35       'sources': [
36         'event_constants.h',
37         'event_switches.cc',
38         'event_switches.h',
39         'events_base_export.h',
40         'gesture_event_details.cc',
41         'gesture_event_details.h',
42         'gestures/gesture_configuration.cc',
43         'gestures/gesture_configuration.h',
44         'keycodes/keyboard_code_conversion.cc',
45         'keycodes/keyboard_code_conversion.h',
46         'keycodes/keyboard_code_conversion_android.cc',
47         'keycodes/keyboard_code_conversion_android.h',
48         'keycodes/keyboard_code_conversion_mac.h',
49         'keycodes/keyboard_code_conversion_mac.mm',
50         'keycodes/keyboard_code_conversion_win.cc',
51         'keycodes/keyboard_code_conversion_win.h',
52         'keycodes/keyboard_code_conversion_x.cc',
53         'keycodes/keyboard_code_conversion_x.h',
54         'keycodes/keyboard_codes.h',
55         'latency_info.cc',
56         'latency_info.h',
57         'x/device_data_manager.cc',
58         'x/device_data_manager.h',
59         'x/device_list_cache_x.cc',
60         'x/device_list_cache_x.h',
61         'x/touch_factory_x11.cc',
62         'x/touch_factory_x11.h',
63       ],
64       'conditions': [
65         ['use_x11==1', {
66           'dependencies': [
67             '../../build/linux/system.gyp:x11',
68             '../gfx/gfx.gyp:gfx_x11',
69           ],
70         }],
71       ],
72     },
73     {
74       'target_name': 'events',
75       'type': '<(component)',
76       'dependencies': [
77         '<(DEPTH)/base/base.gyp:base',
78         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
79         '<(DEPTH)/skia/skia.gyp:skia',
80         '../gfx/gfx.gyp:gfx',
81         '../gfx/gfx.gyp:gfx_geometry',
82         'events_base',
83         'gesture_detection',
84       ],
85       'defines': [
86         'EVENTS_IMPLEMENTATION',
87       ],
88       'sources': [
89         'cocoa/cocoa_event_utils.h',
90         'cocoa/cocoa_event_utils.mm',
91         'cocoa/events_mac.mm',
92         'event.cc',
93         'event.h',
94         'event_dispatcher.cc',
95         'event_dispatcher.h',
96         'event_handler.cc',
97         'event_handler.h',
98         'event_processor.cc',
99         'event_processor.h',
100         'event_rewriter.h',
101         'event_source.cc',
102         'event_source.h',
103         'event_target.cc',
104         'event_target.h',
105         'event_target_iterator.h',
106         'event_targeter.cc',
107         'event_targeter.h',
108         'event_utils.cc',
109         'event_utils.h',
110         'events_export.h',
111         'events_stub.cc',
112         'gestures/gesture_point.cc',
113         'gestures/gesture_point.h',
114         'gestures/gesture_provider_aura.cc',
115         'gestures/gesture_provider_aura.h',
116         'gestures/gesture_recognizer.h',
117         'gestures/gesture_recognizer_impl.cc',
118         'gestures/gesture_recognizer_impl.h',
119         'gestures/gesture_sequence.cc',
120         'gestures/gesture_sequence.h',
121         'gestures/gesture_types.h',
122         'gestures/motion_event_aura.cc',
123         'gestures/motion_event_aura.h',
124         'gestures/velocity_calculator.cc',
125         'gestures/velocity_calculator.h',
126         'ozone/device/device_event.cc',
127         'ozone/device/device_event.h',
128         'ozone/device/device_event_observer.h',
129         'ozone/device/device_manager.cc',
130         'ozone/device/device_manager.h',
131         'ozone/device/device_manager_manual.cc',
132         'ozone/device/device_manager_manual.h',
133         'ozone/device/udev/device_manager_udev.cc',
134         'ozone/device/udev/device_manager_udev.h',
135         'ozone/device/udev/scoped_udev.h',
136         'ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc',
137         'ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h',
138         'ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc',
139         'ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.h',
140         'ozone/evdev/libgestures_glue/gesture_logging.cc',
141         'ozone/evdev/libgestures_glue/gesture_logging.h',
142         'ozone/evdev/libgestures_glue/gesture_timer_provider.cc',
143         'ozone/evdev/libgestures_glue/gesture_timer_provider.h',
144         'ozone/evdev/event_converter_evdev.cc',
145         'ozone/evdev/event_converter_evdev.h',
146         'ozone/evdev/event_device_info.cc',
147         'ozone/evdev/event_device_info.h',
148         'ozone/evdev/event_factory_evdev.cc',
149         'ozone/evdev/event_factory_evdev.h',
150         'ozone/evdev/event_modifiers_evdev.cc',
151         'ozone/evdev/event_modifiers_evdev.h',
152         'ozone/evdev/key_event_converter_evdev.cc',
153         'ozone/evdev/key_event_converter_evdev.h',
154         'ozone/evdev/touch_event_converter_evdev.cc',
155         'ozone/evdev/touch_event_converter_evdev.h',
156         'ozone/event_factory_ozone.cc',
157         'ozone/event_factory_ozone.h',
158         'ozone/events_ozone.cc',
159         'platform/platform_event_dispatcher.h',
160         'platform/platform_event_observer.h',
161         'platform/platform_event_source.cc',
162         'platform/platform_event_source.h',
163         'platform/platform_event_source_stub.cc',
164         'platform/platform_event_types.h',
165         'platform/scoped_event_dispatcher.cc',
166         'platform/scoped_event_dispatcher.h',
167         'platform/x11/x11_event_source.cc',
168         'platform/x11/x11_event_source.h',
169         'platform/x11/x11_event_source_glib.cc',
170         'platform/x11/x11_event_source_libevent.cc',
171         'win/events_win.cc',
172         'x/events_x.cc',
173         'linux/text_edit_command_auralinux.cc',
174         'linux/text_edit_command_auralinux.h',
175         'linux/text_edit_key_bindings_delegate_auralinux.cc',
176         'linux/text_edit_key_bindings_delegate_auralinux.h',
177       ],
178       'conditions': [
179         ['use_aura==0', {
180           'sources!': [
181             'gestures/gesture_point.cc',
182             'gestures/gesture_point.h',
183             'gestures/gesture_provider_aura.cc',
184             'gestures/gesture_provider_aura.h',
185             'gestures/gesture_recognizer.h',
186             'gestures/gesture_recognizer_impl.cc',
187             'gestures/gesture_recognizer_impl.h',
188             'gestures/gesture_sequence.cc',
189             'gestures/gesture_sequence.h',
190             'gestures/gesture_types.h',
191             'gestures/motion_event_aura.cc',
192             'gestures/motion_event_aura.h',
193             'gestures/velocity_calculator.cc',
194             'gestures/velocity_calculator.h',
195           ],
196         }],
197         # We explicitly enumerate the platforms we _do_ provide native cracking
198         # for here.
199         ['OS=="win" or OS=="mac" or use_x11==1 or use_ozone==1', {
200           'sources!': [
201             'events_stub.cc',
202           ],
203         }],
204         ['chromeos==1', {
205           'sources!': [
206             'linux/text_edit_command_auralinux.cc',
207             'linux/text_edit_command_auralinux.h',
208             'linux/text_edit_key_bindings_delegate_auralinux.cc',
209             'linux/text_edit_key_bindings_delegate_auralinux.h',
210           ],
211         }],
212         ['use_x11==1', {
213           'sources!': [
214             'platform/platform_event_source_stub.cc',
215           ],
216           'dependencies': [
217             '../../build/linux/system.gyp:x11',
218             '../gfx/gfx.gyp:gfx_x11',
219           ],
220         }],
221         ['use_glib==1', {
222           'dependencies': [
223             '../../build/linux/system.gyp:glib',
224           ],
225           'sources!': [
226             'platform/x11/x11_event_source_libevent.cc',
227           ],
228         }, {
229           # use_glib == 0
230           'sources!': [
231             'platform/x11/x11_event_source_glib.cc',
232           ],
233         }],
234         ['use_ozone_evdev==1', {
235           'defines': ['USE_OZONE_EVDEV=1'],
236         }],
237         ['use_ozone_evdev==1 and use_udev==1', {
238           'dependencies': [
239             '<(DEPTH)/build/linux/system.gyp:udev',
240           ],
241         }],
242         ['use_ozone_evdev==1 and use_evdev_gestures==1', {
243           'dependencies': [
244             '<(DEPTH)/build/linux/system.gyp:libgestures',
245             '<(DEPTH)/build/linux/system.gyp:libevdev-cros',
246           ],
247           'defines': [
248             'USE_EVDEV_GESTURES',
249           ],
250         }, {
251           'sources/': [
252             ['exclude', '^ozone/evdev/libgestures_glue/'],
253           ],
254         }],
255         ['use_udev==0', {
256           'sources/': [
257             ['exclude', '_udev\\.(h|cc)$'],
258           ],
259         }],
260       ],
261     },
262     {
263       'target_name': 'gesture_detection',
264       'type': '<(component)',
265       'dependencies': [
266         '<(DEPTH)/base/base.gyp:base',
267         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
268         '../gfx/gfx.gyp:gfx',
269         '../gfx/gfx.gyp:gfx_geometry',
270         'events_base',
271       ],
272       'defines': [
273         'GESTURE_DETECTION_IMPLEMENTATION',
274       ],
275       'sources': [
276         'gesture_detection/bitset_32.h',
277         'gesture_detection/filtered_gesture_provider.cc',
278         'gesture_detection/filtered_gesture_provider.h',
279         'gesture_detection/gesture_config_helper.h',
280         'gesture_detection/gesture_config_helper_android.cc',
281         'gesture_detection/gesture_config_helper_aura.cc',
282         'gesture_detection/gesture_detection_export.h',
283         'gesture_detection/gesture_detector.cc',
284         'gesture_detection/gesture_detector.h',
285         'gesture_detection/gesture_event_data.cc',
286         'gesture_detection/gesture_event_data.h',
287         'gesture_detection/gesture_event_data_packet.cc',
288         'gesture_detection/gesture_event_data_packet.h',
289         'gesture_detection/gesture_provider.cc',
290         'gesture_detection/gesture_provider.h',
291         'gesture_detection/motion_event.h',
292         'gesture_detection/scale_gesture_detector.cc',
293         'gesture_detection/scale_gesture_detector.h',
294         'gesture_detection/snap_scroll_controller.cc',
295         'gesture_detection/snap_scroll_controller.h',
296         'gesture_detection/touch_disposition_gesture_filter.cc',
297         'gesture_detection/touch_disposition_gesture_filter.h',
298         'gesture_detection/velocity_tracker_state.cc',
299         'gesture_detection/velocity_tracker_state.h',
300         'gesture_detection/velocity_tracker.cc',
301         'gesture_detection/velocity_tracker.h',
302       ],
303       'conditions': [
304         ['use_aura!=1 and OS!="android"', {
305           'sources': [
306             'gesture_detection/gesture_config_helper.cc',
307           ],
308         }],
309       ],
310     },
311     {
312       'target_name': 'events_test_support',
313       'type': 'static_library',
314       'dependencies': [
315         'events',
316         'events_base',
317       ],
318       'sources': [
319         'test/cocoa_test_event_utils.h',
320         'test/cocoa_test_event_utils.mm',
321         'test/events_test_utils.cc',
322         'test/events_test_utils.h',
323         'test/events_test_utils_x11.cc',
324         'test/events_test_utils_x11.h',
325         'test/platform_event_waiter.cc',
326         'test/platform_event_waiter.h',
327         'test/test_event_handler.cc',
328         'test/test_event_handler.h',
329         'test/test_event_processor.cc',
330         'test/test_event_processor.h',
331         'test/test_event_target.cc',
332         'test/test_event_target.h',
333       ],
334       'conditions': [
335         ['use_x11==1', {
336           'dependencies': [
337             '../../build/linux/system.gyp:x11',
338             '../gfx/gfx.gyp:gfx_x11',
339           ],
340         }],
341         ['OS=="ios"', {
342           # The cocoa files don't apply to iOS.
343           'sources/': [['exclude', 'cocoa']],
344         }],
345       ],
346     },
347     {
348       'target_name': 'events_unittests',
349       'type': '<(gtest_target_type)',
350       'dependencies': [
351         '<(DEPTH)/base/base.gyp:base',
352         '<(DEPTH)/base/base.gyp:run_all_unittests',
353         '<(DEPTH)/base/base.gyp:test_support_base',
354         '<(DEPTH)/testing/gtest.gyp:gtest',
355         '../gfx/gfx.gyp:gfx_geometry',
356         '../gfx/gfx.gyp:gfx_test_support',
357         'dom4_keycode_converter',
358         'events',
359         'events_base',
360         'events_test_support',
361         'gesture_detection',
362       ],
363       'sources': [
364         'cocoa/events_mac_unittest.mm',
365         'event_dispatcher_unittest.cc',
366         'event_processor_unittest.cc',
367         'event_rewriter_unittest.cc',
368         'event_unittest.cc',
369         'gestures/motion_event_aura_unittest.cc',
370         'gestures/velocity_calculator_unittest.cc',
371         'gesture_detection/bitset_32_unittest.cc',
372         'gesture_detection/gesture_provider_unittest.cc',
373         'gesture_detection/mock_motion_event.h',
374         'gesture_detection/mock_motion_event.cc',
375         'gesture_detection/velocity_tracker_unittest.cc',
376         'gesture_detection/touch_disposition_gesture_filter_unittest.cc',
377         'keycodes/dom4/keycode_converter_unittest.cc',
378         'latency_info_unittest.cc',
379         'ozone/evdev/key_event_converter_evdev_unittest.cc',
380         'ozone/evdev/touch_event_converter_evdev_unittest.cc',
381         'platform/platform_event_source_unittest.cc',
382         'x/events_x_unittest.cc',
383       ],
384       'conditions': [
385         ['use_aura==0', {
386           'sources!': [
387             'gestures/motion_event_aura_unittest.cc',
388             'gestures/velocity_calculator_unittest.cc',
389           ],
390         }],
391         ['OS=="linux" and use_allocator!="none"', {
392           'dependencies': [
393             '<(DEPTH)/base/allocator/allocator.gyp:allocator',
394           ],
395         }],
396         # Exclude tests that rely on event_utils.h for platforms that do not
397         # provide native cracking, i.e., platforms that use events_stub.cc.
398         ['OS!="win" and use_x11!=1 and use_ozone!=1', {
399           'sources!': [
400             'event_unittest.cc',
401           ],
402         }],
403         ['OS == "android" and gtest_target_type == "shared_library"', {
404           'dependencies': [
405             '../../testing/android/native_test.gyp:native_test_native_code',
406           ],
407         }],
408       ],
409     },
410   ],
411   'conditions': [
412     # Special target to wrap a gtest_target_type==shared_library
413     # ui_unittests into an android apk for execution.
414     # See base.gyp for TODO(jrg)s about this strategy.
415     ['OS == "android" and gtest_target_type == "shared_library"', {
416       'targets': [
417         {
418           'target_name': 'events_unittests_apk',
419           'type': 'none',
420           'dependencies': [
421             'events_unittests',
422           ],
423           'variables': {
424             'test_suite_name': 'events_unittests',
425           },
426           'includes': [ '../../build/apk_test.gypi' ],
427         },
428       ],
429     }],
430   ],
431 }