Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: views/events/event_x.cc

Issue 6591120: Update MouseEvent (initial pass). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/events/event_win.cc ('k') | views/widget/root_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "views/events/event.h" 5 #include "views/events/event.h"
6 6
7 #include <gdk/gdkx.h> 7 #include <gdk/gdkx.h>
8 #if defined(HAVE_XINPUT2) 8 #if defined(HAVE_XINPUT2)
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #endif 10 #endif
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 : Event(native_event_2, 255 : Event(native_event_2,
256 EventTypeFromNative(native_event_2), 256 EventTypeFromNative(native_event_2),
257 GetEventFlagsFromXState(native_event_2->xkey.state), 257 GetEventFlagsFromXState(native_event_2->xkey.state),
258 from_native), 258 from_native),
259 key_code_(ui::KeyboardCodeFromXKeyEvent(native_event_2)) { 259 key_code_(ui::KeyboardCodeFromXKeyEvent(native_event_2)) {
260 } 260 }
261 261
262 //////////////////////////////////////////////////////////////////////////////// 262 ////////////////////////////////////////////////////////////////////////////////
263 // MouseEvent, public: 263 // MouseEvent, public:
264 264
265 MouseEvent::MouseEvent(XEvent* xev) 265 MouseEvent::MouseEvent(NativeEvent native_event)
266 : LocatedEvent(EventTypeFromNative(xev), 266 : LocatedEvent(native_event) {
267 GetMouseEventLocation(xev), 267 }
268 GetMouseEventFlags(xev)) { 268
269 MouseEvent::MouseEvent(NativeEvent2 native_event_2,
270 FromNativeEvent2 from_native)
271 : LocatedEvent(native_event_2, from_native) {
269 } 272 }
270 273
271 //////////////////////////////////////////////////////////////////////////////// 274 ////////////////////////////////////////////////////////////////////////////////
272 // MouseWheelEvent, public: 275 // MouseWheelEvent, public:
273 276
274 MouseWheelEvent::MouseWheelEvent(NativeEvent2 native_event_2, 277 MouseWheelEvent::MouseWheelEvent(NativeEvent2 native_event_2,
275 FromNativeEvent2 from_native) 278 FromNativeEvent2 from_native)
276 : LocatedEvent(native_event_2, from_native), 279 : LocatedEvent(native_event_2, from_native),
277 offset_(GetMouseWheelOffset(native_event_2)) { 280 offset_(GetMouseWheelOffset(native_event_2)) {
278 } 281 }
279 282
280 //////////////////////////////////////////////////////////////////////////////// 283 ////////////////////////////////////////////////////////////////////////////////
281 // TouchEvent, public: 284 // TouchEvent, public:
282 285
283 #if defined(HAVE_XINPUT2) 286 #if defined(HAVE_XINPUT2)
284 TouchEvent::TouchEvent(XEvent* xev) 287 TouchEvent::TouchEvent(XEvent* xev)
285 : LocatedEvent(GetTouchEventType(xev), 288 : LocatedEvent(GetTouchEventType(xev),
286 GetTouchEventLocation(xev), 289 GetTouchEventLocation(xev),
287 GetTouchEventFlags(xev)), 290 GetTouchEventFlags(xev)),
288 touch_id_(GetTouchIDFromXEvent(xev)) { 291 touch_id_(GetTouchIDFromXEvent(xev)) {
289 } 292 }
290 #endif 293 #endif
291 294
292 } // namespace views 295 } // namespace views
OLDNEW
« no previous file with comments | « views/events/event_win.cc ('k') | views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698