OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_VIEWS_EVENT_H_ | 5 #ifndef CHROME_VIEWS_EVENT_H_ |
6 #define CHROME_VIEWS_EVENT_H_ | 6 #define CHROME_VIEWS_EVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 #if defined(OS_LINUX) | 10 #if defined(OS_LINUX) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Return the event time stamp in ticks | 63 // Return the event time stamp in ticks |
64 int GetTimeStamp() const { | 64 int GetTimeStamp() const { |
65 return time_stamp_; | 65 return time_stamp_; |
66 } | 66 } |
67 | 67 |
68 // Return the flags | 68 // Return the flags |
69 int GetFlags() const { | 69 int GetFlags() const { |
70 return flags_; | 70 return flags_; |
71 } | 71 } |
72 | 72 |
| 73 void set_flags(int flags) { |
| 74 flags_ = flags; |
| 75 } |
| 76 |
73 // Return whether the shift modifier is down | 77 // Return whether the shift modifier is down |
74 bool IsShiftDown() const { | 78 bool IsShiftDown() const { |
75 return (flags_ & EF_SHIFT_DOWN) != 0; | 79 return (flags_ & EF_SHIFT_DOWN) != 0; |
76 } | 80 } |
77 | 81 |
78 // Return whether the control modifier is down | 82 // Return whether the control modifier is down |
79 bool IsControlDown() const { | 83 bool IsControlDown() const { |
80 return (flags_ & EF_CONTROL_DOWN) != 0; | 84 return (flags_ & EF_CONTROL_DOWN) != 0; |
81 } | 85 } |
82 | 86 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 //////////////////////////////////////////////////////////////////////////////// | 163 //////////////////////////////////////////////////////////////////////////////// |
160 // | 164 // |
161 // MouseEvent class | 165 // MouseEvent class |
162 // | 166 // |
163 // A mouse event is used for any input event related to the mouse. | 167 // A mouse event is used for any input event related to the mouse. |
164 // | 168 // |
165 //////////////////////////////////////////////////////////////////////////////// | 169 //////////////////////////////////////////////////////////////////////////////// |
166 class MouseEvent : public LocatedEvent { | 170 class MouseEvent : public LocatedEvent { |
167 public: | 171 public: |
168 // Flags specific to mouse events | 172 // Flags specific to mouse events |
169 enum MouseEventFlags { EF_IS_DOUBLE_CLICK = 1 << 16 }; | 173 enum MouseEventFlags { |
| 174 EF_IS_DOUBLE_CLICK = 1 << 16, |
| 175 EF_IS_NON_CLIENT = 1 << 17 |
| 176 }; |
170 | 177 |
171 // Create a new mouse event | 178 // Create a new mouse event |
172 MouseEvent(EventType type, int x, int y, int flags) | 179 MouseEvent(EventType type, int x, int y, int flags) |
173 : LocatedEvent(type, gfx::Point(x, y), flags) { | 180 : LocatedEvent(type, gfx::Point(x, y), flags) { |
174 } | 181 } |
175 | 182 |
176 // Create a new mouse event from a type and a point. If from / to views | 183 // Create a new mouse event from a type and a point. If from / to views |
177 // are provided, the point will be converted from 'from' coordinate system to | 184 // are provided, the point will be converted from 'from' coordinate system to |
178 // 'to' coordinate system. | 185 // 'to' coordinate system. |
179 MouseEvent(EventType type, | 186 MouseEvent(EventType type, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 private: | 320 private: |
314 const OSExchangeData& data_; | 321 const OSExchangeData& data_; |
315 int source_operations_; | 322 int source_operations_; |
316 | 323 |
317 DISALLOW_EVIL_CONSTRUCTORS(DropTargetEvent); | 324 DISALLOW_EVIL_CONSTRUCTORS(DropTargetEvent); |
318 }; | 325 }; |
319 | 326 |
320 } // namespace views | 327 } // namespace views |
321 | 328 |
322 #endif // CHROME_VIEWS_EVENT_H_ | 329 #endif // CHROME_VIEWS_EVENT_H_ |
OLD | NEW |