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

Side by Side Diff: views/events/event.h

Issue 7942004: Consolidate/cleanup event cracking code; single out GdkEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows event code consolidation. Created 9 years, 3 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
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 #ifndef VIEWS_EVENTS_EVENT_H_ 5 #ifndef VIEWS_EVENTS_EVENT_H_
6 #define VIEWS_EVENTS_EVENT_H_ 6 #define VIEWS_EVENTS_EVENT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 14 matching lines...) Expand all
25 25
26 namespace views { 26 namespace views {
27 27
28 class View; 28 class View;
29 29
30 namespace internal { 30 namespace internal {
31 class NativeWidgetView; 31 class NativeWidgetView;
32 class RootView; 32 class RootView;
33 } 33 }
34 34
35 #if defined(OS_WIN) || defined(USE_AURA)
36 VIEWS_EXPORT bool IsClientMouseEvent(const views::NativeEvent& native_event);
37 VIEWS_EXPORT bool IsNonClientMouseEvent(const views::NativeEvent& native_event);
38 #endif
39
40 //////////////////////////////////////////////////////////////////////////////// 35 ////////////////////////////////////////////////////////////////////////////////
41 // 36 //
42 // Event class 37 // Event class
43 // 38 //
44 // An event encapsulates an input event that can be propagated into view 39 // An event encapsulates an input event that can be propagated into view
45 // hierarchies. An event has a type, some flags and a time stamp. 40 // hierarchies. An event has a type, some flags and a time stamp.
46 // 41 //
47 // Each major event type has a corresponding Event subclass. 42 // Each major event type has a corresponding Event subclass.
48 // 43 //
49 // Events are immutable but support copy 44 // Events are immutable but support copy
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 76 }
82 77
83 bool IsTouchEvent() const { 78 bool IsTouchEvent() const {
84 return type_ == ui::ET_TOUCH_RELEASED || 79 return type_ == ui::ET_TOUCH_RELEASED ||
85 type_ == ui::ET_TOUCH_PRESSED || 80 type_ == ui::ET_TOUCH_PRESSED ||
86 type_ == ui::ET_TOUCH_MOVED || 81 type_ == ui::ET_TOUCH_MOVED ||
87 type_ == ui::ET_TOUCH_STATIONARY || 82 type_ == ui::ET_TOUCH_STATIONARY ||
88 type_ == ui::ET_TOUCH_CANCELLED; 83 type_ == ui::ET_TOUCH_CANCELLED;
89 } 84 }
90 85
91 #if defined(OS_WIN) && !defined(USE_AURA)
92 // Returns the EventFlags in terms of windows flags.
93 int GetWindowsFlags() const;
94 #elif defined(OS_LINUX)
95 // Get the views::Event flags from a native GdkEvent.
96 static int GetFlagsFromGdkEvent(NativeEvent native_event);
97 #endif
98
99 protected: 86 protected:
100 Event(ui::EventType type, int flags); 87 Event(ui::EventType type, int flags);
101 Event(NativeEvent native_event, ui::EventType type, int flags); 88 Event(NativeEvent native_event, ui::EventType type, int flags);
102 // Because the world is complicated, sometimes we have two different kinds of 89 // Because the world is complicated, sometimes we have two different kinds of
103 // NativeEvent in play in the same executable. See native_types.h for the tale 90 // NativeEvent in play in the same executable. See native_types.h for the tale
104 // of woe. 91 // of woe.
105 Event(NativeEvent2 native_event, ui::EventType type, int flags, 92 Event(NativeEvent2 native_event, ui::EventType type, int flags,
106 FromNativeEvent2); 93 FromNativeEvent2);
107 94
108 Event(const Event& model) 95 Event(const Event& model)
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 417
431 // Bitmask of supported ui::DragDropTypes::DragOperation by the source. 418 // Bitmask of supported ui::DragDropTypes::DragOperation by the source.
432 int source_operations_; 419 int source_operations_;
433 420
434 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); 421 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent);
435 }; 422 };
436 423
437 } // namespace views 424 } // namespace views
438 425
439 #endif // VIEWS_EVENTS_EVENT_H_ 426 #endif // VIEWS_EVENTS_EVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698