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        'dom4_keycode_converter',
29      ],
30      'defines': [
31        'EVENTS_BASE_IMPLEMENTATION',
32      ],
33      'sources': [
34        'events_base_export.h',
35        'event_switches.cc',
36        'event_switches.h',
37        'keycodes/keyboard_code_conversion.cc',
38        'keycodes/keyboard_code_conversion.h',
39        'keycodes/keyboard_code_conversion_android.cc',
40        'keycodes/keyboard_code_conversion_android.h',
41        'keycodes/keyboard_code_conversion_gtk.cc',
42        'keycodes/keyboard_code_conversion_gtk.h',
43        'keycodes/keyboard_code_conversion_mac.h',
44        'keycodes/keyboard_code_conversion_mac.mm',
45        'keycodes/keyboard_code_conversion_win.cc',
46        'keycodes/keyboard_code_conversion_win.h',
47        'keycodes/keyboard_code_conversion_x.cc',
48        'keycodes/keyboard_code_conversion_x.h',
49        'keycodes/keyboard_codes.h',
50        'latency_info.cc',
51        'latency_info.h',
52        'x/device_list_cache_x.cc',
53        'x/device_list_cache_x.h',
54        'x/device_data_manager.cc',
55        'x/device_data_manager.h',
56        'x/touch_factory_x11.cc',
57        'x/touch_factory_x11.h',
58      ],
59      'conditions': [
60        ['use_x11==1', {
61          'dependencies': [
62            '<(DEPTH)/build/linux/system.gyp:x11',
63          ],
64        }],
65      ],
66    },
67    {
68      'target_name': 'events',
69      'type': '<(component)',
70      'dependencies': [
71        '<(DEPTH)/base/base.gyp:base',
72        '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
73        '<(DEPTH)/skia/skia.gyp:skia',
74        '../gfx/gfx.gyp:gfx',
75        'events_base',
76      ],
77      'defines': [
78        'EVENTS_IMPLEMENTATION',
79      ],
80      'sources': [
81        'event.cc',
82        'event.h',
83        'event_constants.h',
84        'event_dispatcher.cc',
85        'event_dispatcher.h',
86        'event_handler.cc',
87        'event_handler.h',
88        'event_processor.cc',
89        'event_processor.h',
90        'event_source.cc',
91        'event_source.h',
92        'event_target.cc',
93        'event_target.h',
94        'event_target_iterator.h',
95        'event_targeter.cc',
96        'event_targeter.h',
97        'event_utils.cc',
98        'event_utils.h',
99        'events_export.h',
100        'events_stub.cc',
101        'gestures/gesture_configuration.cc',
102        'gestures/gesture_configuration.h',
103        'gestures/gesture_point.cc',
104        'gestures/gesture_point.h',
105        'gestures/gesture_recognizer.h',
106        'gestures/gesture_recognizer_impl.cc',
107        'gestures/gesture_recognizer_impl.h',
108        'gestures/gesture_sequence.cc',
109        'gestures/gesture_sequence.h',
110        'gestures/gesture_types.cc',
111        'gestures/gesture_types.h',
112        'gestures/gesture_util.cc',
113        'gestures/gesture_util.h',
114        'gestures/velocity_calculator.cc',
115        'gestures/velocity_calculator.h',
116        'ozone/evdev/event_device_info.cc',
117        'ozone/evdev/event_device_info.h',
118        'ozone/evdev/event_factory.cc',
119        'ozone/evdev/event_factory.h',
120        'ozone/evdev/event_modifiers.cc',
121        'ozone/evdev/event_modifiers.h',
122        'ozone/evdev/key_event_converter.cc',
123        'ozone/evdev/key_event_converter.h',
124        'ozone/evdev/touch_event_converter.cc',
125        'ozone/evdev/touch_event_converter.h',
126        'ozone/event_converter_ozone.cc',
127        'ozone/event_converter_ozone.h',
128        'ozone/event_factory_ozone.cc',
129        'ozone/event_factory_ozone.h',
130        'ozone/events_ozone.cc',
131        'win/events_win.cc',
132        'x/events_x.cc',
133      ],
134      'conditions': [
135        # We explicitly enumerate the platforms we _do_ provide native cracking
136        # for here.
137        ['OS=="win" or use_x11==1 or use_ozone==1', {
138          'sources!': [
139            'events_stub.cc',
140          ],
141        }],
142        ['use_x11==1', {
143          'dependencies': [
144            '<(DEPTH)/build/linux/system.gyp:x11',
145          ],
146        }],
147        ['use_ozone_evdev==1', {
148          'defines': ['USE_OZONE_EVDEV=1'],
149        }],
150      ],
151    },
152    {
153      'target_name': 'events_test_support',
154      'type': 'static_library',
155      'dependencies': [
156        'events',
157        'events_base',
158      ],
159      'sources': [
160        'test/events_test_utils.cc',
161        'test/events_test_utils.h',
162        'test/events_test_utils_x11.cc',
163        'test/events_test_utils_x11.h',
164        'test/test_event_processor.cc',
165        'test/test_event_processor.h',
166        'test/test_event_target.cc',
167        'test/test_event_target.h',
168      ],
169      'conditions': [
170        ['use_x11==1', {
171          'dependencies': [
172            '<(DEPTH)/build/linux/system.gyp:x11',
173          ],
174        }],
175      ],
176    },
177    {
178      'target_name': 'events_unittests',
179      'type': '<(gtest_target_type)',
180      'dependencies': [
181        '<(DEPTH)/base/base.gyp:base',
182        '<(DEPTH)/base/base.gyp:test_support_base',
183        '<(DEPTH)/testing/gtest.gyp:gtest',
184        '../gfx/gfx.gyp:gfx',
185        'dom4_keycode_converter',
186        'events_base',
187        'events',
188        'events_test_support',
189      ],
190      'sources': [
191        'event_dispatcher_unittest.cc',
192        'event_processor_unittest.cc',
193        'event_unittest.cc',
194        'gestures/velocity_calculator_unittest.cc',
195        'keycodes/dom4/keycode_converter_unittest.cc',
196        'latency_info_unittest.cc',
197        'test/run_all_unittests.cc',
198        'test/test_suite.cc',
199        'test/test_suite.h',
200        'ozone/evdev/key_event_converter_unittest.cc',
201        'ozone/evdev/touch_event_converter_unittest.cc',
202        'x/events_x_unittest.cc',
203      ],
204      'conditions': [
205        ['OS=="linux" and linux_use_tcmalloc==1', {
206          'dependencies': [
207            '<(DEPTH)/base/allocator/allocator.gyp:allocator',
208          ],
209        }],
210      ],
211    },
212  ],
213}
214