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 #include "base/gfx/point.h" |
9 | 10 |
10 #if defined(OS_LINUX) | 11 #if defined(OS_LINUX) |
11 #include <gdk/gdk.h> | 12 typedef struct _GdkEventKey GdkEventKey; |
12 #endif | 13 #endif |
13 | |
14 #include "base/gfx/point.h" | |
15 | |
16 class OSExchangeData; | 14 class OSExchangeData; |
17 | 15 |
18 namespace views { | 16 namespace views { |
19 | 17 |
20 class View; | 18 class View; |
21 | 19 |
22 //////////////////////////////////////////////////////////////////////////////// | 20 //////////////////////////////////////////////////////////////////////////////// |
23 // | 21 // |
24 // Event class | 22 // Event class |
25 // | 23 // |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 bool IsOnlyRightMouseButton() const { | 209 bool IsOnlyRightMouseButton() const { |
212 return (GetFlags() & EF_RIGHT_BUTTON_DOWN) && | 210 return (GetFlags() & EF_RIGHT_BUTTON_DOWN) && |
213 !(GetFlags() & (EF_LEFT_BUTTON_DOWN | EF_MIDDLE_BUTTON_DOWN)); | 211 !(GetFlags() & (EF_LEFT_BUTTON_DOWN | EF_MIDDLE_BUTTON_DOWN)); |
214 } | 212 } |
215 | 213 |
216 bool IsRightMouseButton() const { | 214 bool IsRightMouseButton() const { |
217 return (GetFlags() & EF_RIGHT_BUTTON_DOWN) != 0; | 215 return (GetFlags() & EF_RIGHT_BUTTON_DOWN) != 0; |
218 } | 216 } |
219 | 217 |
220 private: | 218 private: |
221 DISALLOW_EVIL_CONSTRUCTORS(MouseEvent); | 219 DISALLOW_COPY_AND_ASSIGN(MouseEvent); |
222 }; | 220 }; |
223 | 221 |
224 //////////////////////////////////////////////////////////////////////////////// | 222 //////////////////////////////////////////////////////////////////////////////// |
225 // | 223 // |
226 // KeyEvent class | 224 // KeyEvent class |
227 // | 225 // |
228 // A key event is used for any input event related to the keyboard. | 226 // A key event is used for any input event related to the keyboard. |
229 // Note: this event is about key pressed, not typed characters. | 227 // Note: this event is about key pressed, not typed characters. |
230 // | 228 // |
231 //////////////////////////////////////////////////////////////////////////////// | 229 //////////////////////////////////////////////////////////////////////////////// |
232 class KeyEvent : public Event { | 230 class KeyEvent : public Event { |
233 public: | 231 public: |
234 #if defined(OS_WIN) | 232 #if defined(OS_WIN) |
235 // Create a new key event | 233 // Create a new key event |
236 KeyEvent(EventType type, int ch, int repeat_count, int message_flags); | 234 KeyEvent(EventType type, int ch, int repeat_count, int message_flags); |
237 #elif defined(OS_LINUX) | 235 #elif defined(OS_LINUX) |
238 KeyEvent(GdkEventKey* event); | 236 explicit KeyEvent(GdkEventKey* event); |
239 #endif | 237 #endif |
240 | 238 |
241 int GetCharacter() const { | 239 int GetCharacter() const { |
242 return character_; | 240 return character_; |
243 } | 241 } |
244 | 242 |
245 #if defined(OS_WIN) | 243 #if defined(OS_WIN) |
246 bool IsExtendedKey() const; | 244 bool IsExtendedKey() const; |
247 #endif | 245 #endif |
248 | 246 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 private: | 313 private: |
316 const OSExchangeData& data_; | 314 const OSExchangeData& data_; |
317 int source_operations_; | 315 int source_operations_; |
318 | 316 |
319 DISALLOW_EVIL_CONSTRUCTORS(DropTargetEvent); | 317 DISALLOW_EVIL_CONSTRUCTORS(DropTargetEvent); |
320 }; | 318 }; |
321 | 319 |
322 } // namespace views | 320 } // namespace views |
323 | 321 |
324 #endif // CHROME_VIEWS_EVENT_H_ | 322 #endif // CHROME_VIEWS_EVENT_H_ |
OLD | NEW |