OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/event.h" | 5 #include "ui/events/event.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/keysym.h> | 9 #include <X11/keysym.h> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const unsigned int kAllStateMask = | 103 const unsigned int kAllStateMask = |
104 Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask | | 104 Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask | |
105 Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask | ShiftMask | | 105 Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask | ShiftMask | |
106 LockMask | ControlMask | AnyModifier; | 106 LockMask | ControlMask | AnyModifier; |
107 return event && (event->xkey.state & ~kAllStateMask) != 0; | 107 return event && (event->xkey.state & ~kAllStateMask) != 0; |
108 #else | 108 #else |
109 return false; | 109 return false; |
110 #endif | 110 #endif |
111 } | 111 } |
112 | 112 |
113 unsigned long long get_next_touch_event_id() { | 113 uint64 get_next_touch_event_id() { |
114 static unsigned long long id = 0; | 114 // Set the first touch_event_id to 1 because we set id to 0 for other types |
| 115 // of events. |
| 116 static uint64 id = 1; |
| 117 if (id==0) |
| 118 id++; |
| 119 DCHECK_NE(id, 0UL); |
115 return id++; | 120 return id++; |
116 } | 121 } |
117 | 122 |
118 } // namespace | 123 } // namespace |
119 | 124 |
120 namespace ui { | 125 namespace ui { |
121 | 126 |
122 //////////////////////////////////////////////////////////////////////////////// | 127 //////////////////////////////////////////////////////////////////////////////// |
123 // Event | 128 // Event |
124 | 129 |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 gfx::PointF(x, y), | 989 gfx::PointF(x, y), |
985 time_stamp, | 990 time_stamp, |
986 flags | EF_FROM_TOUCH), | 991 flags | EF_FROM_TOUCH), |
987 details_(details) { | 992 details_(details) { |
988 } | 993 } |
989 | 994 |
990 GestureEvent::~GestureEvent() { | 995 GestureEvent::~GestureEvent() { |
991 } | 996 } |
992 | 997 |
993 } // namespace ui | 998 } // namespace ui |
OLD | NEW |