Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 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 #include "views/test/test_event_utils.h" | |
| 6 | |
| 7 #include <X11/extensions/XInput.h> | |
| 8 #include <X11/extensions/XInput2.h> | |
|
rjkroege
2011/11/12 16:11:35
FYI: It has been the case that not all the builder
Gajen
2011/11/14 12:10:17
AFAIK, USE_XI2_MT flag switch on X2.1 and X2.0 is
| |
| 9 | |
| 10 #include "ui/base/x/x11_util.h" | |
| 11 | |
| 12 namespace views { | |
| 13 | |
| 14 base::NativeEvent GetNativeEventForTesting() { | |
| 15 XEvent* event = new XEvent; | |
| 16 memset(event, 0, sizeof(*event)); | |
| 17 XGenericEventCookie* cookie = &(event->xcookie); | |
| 18 cookie->type = GenericEvent; | |
| 19 XIDeviceEvent* dev_event = new XIDeviceEvent; | |
| 20 memset(dev_event, 0, sizeof(*dev_event)); | |
| 21 cookie->data = dev_event; | |
| 22 return event; | |
| 23 } | |
| 24 | |
| 25 void SetNativeEventLocationForTesting(const base::NativeEvent& native_event, | |
| 26 int x, int y) { | |
| 27 XIDeviceEvent* xievent = | |
| 28 static_cast<XIDeviceEvent*>(native_event->xcookie.data); | |
| 29 xievent->event_x = x; | |
| 30 xievent->event_y = y; | |
| 31 return; | |
| 32 } | |
| 33 | |
| 34 } // namespace views | |
| OLD | NEW |