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 VIEWS_EVENT_H_ | 5 #ifndef VIEWS_EVENT_H_ |
6 #define VIEWS_EVENT_H_ | 6 #define VIEWS_EVENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "app/keyboard_codes.h" | 9 #include "app/keyboard_codes.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "gfx/point.h" | 11 #include "gfx/point.h" |
12 | 12 |
13 #if defined(OS_LINUX) | 13 #if defined(OS_LINUX) |
14 typedef struct _GdkEventKey GdkEventKey; | 14 typedef struct _GdkEventKey GdkEventKey; |
15 #endif | 15 #endif |
| 16 |
16 #if defined(TOUCH_UI) | 17 #if defined(TOUCH_UI) |
17 typedef union _XEvent XEvent; | 18 typedef union _XEvent XEvent; |
18 #endif | 19 #endif |
19 | 20 |
20 class OSExchangeData; | 21 class OSExchangeData; |
21 | 22 |
22 namespace views { | 23 namespace views { |
23 | 24 |
24 class View; | 25 class View; |
25 | 26 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 //////////////////////////////////////////////////////////////////////////////// | 326 //////////////////////////////////////////////////////////////////////////////// |
326 class KeyEvent : public Event { | 327 class KeyEvent : public Event { |
327 public: | 328 public: |
328 // Create a new key event | 329 // Create a new key event |
329 KeyEvent(EventType type, | 330 KeyEvent(EventType type, |
330 app::KeyboardCode key_code, | 331 app::KeyboardCode key_code, |
331 int event_flags, | 332 int event_flags, |
332 int repeat_count, | 333 int repeat_count, |
333 int message_flags); | 334 int message_flags); |
334 #if defined(OS_LINUX) | 335 #if defined(OS_LINUX) |
335 explicit KeyEvent(GdkEventKey* event); | 336 explicit KeyEvent(const GdkEventKey* event); |
| 337 |
| 338 const GdkEventKey* native_event() const { return native_event_; } |
336 #endif | 339 #endif |
337 | 340 |
338 #if defined(TOUCH_UI) | 341 #if defined(TOUCH_UI) |
339 // Create a key event from an X key event. | 342 // Create a key event from an X key event. |
340 explicit KeyEvent(XEvent* xevent); | 343 explicit KeyEvent(XEvent* xevent); |
341 #endif | 344 #endif |
342 | 345 |
343 // This returns a VKEY_ value as defined in app/keyboard_codes.h which is | 346 // This returns a VKEY_ value as defined in app/keyboard_codes.h which is |
344 // the Windows value. | 347 // the Windows value. |
345 // On GTK, you can use the methods in keyboard_code_conversion_gtk.cc to | 348 // On GTK, you can use the methods in keyboard_code_conversion_gtk.cc to |
(...skipping 13 matching lines...) Expand all Loading... |
359 #if defined(OS_WIN) | 362 #if defined(OS_WIN) |
360 // Returns the current state of the KeyState. | 363 // Returns the current state of the KeyState. |
361 static int GetKeyStateFlags(); | 364 static int GetKeyStateFlags(); |
362 #endif | 365 #endif |
363 | 366 |
364 private: | 367 private: |
365 | 368 |
366 app::KeyboardCode key_code_; | 369 app::KeyboardCode key_code_; |
367 int repeat_count_; | 370 int repeat_count_; |
368 int message_flags_; | 371 int message_flags_; |
369 | 372 #if defined(OS_LINUX) |
| 373 const GdkEventKey* native_event_; |
| 374 #endif |
370 DISALLOW_COPY_AND_ASSIGN(KeyEvent); | 375 DISALLOW_COPY_AND_ASSIGN(KeyEvent); |
371 }; | 376 }; |
372 | 377 |
373 //////////////////////////////////////////////////////////////////////////////// | 378 //////////////////////////////////////////////////////////////////////////////// |
374 // | 379 // |
375 // MouseWheelEvent class | 380 // MouseWheelEvent class |
376 // | 381 // |
377 // A MouseWheelEvent is used to propagate mouse wheel user events | 382 // A MouseWheelEvent is used to propagate mouse wheel user events |
378 // | 383 // |
379 //////////////////////////////////////////////////////////////////////////////// | 384 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 private: | 432 private: |
428 const OSExchangeData& data_; | 433 const OSExchangeData& data_; |
429 int source_operations_; | 434 int source_operations_; |
430 | 435 |
431 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); | 436 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); |
432 }; | 437 }; |
433 | 438 |
434 } // namespace views | 439 } // namespace views |
435 | 440 |
436 #endif // VIEWS_EVENT_H_ | 441 #endif // VIEWS_EVENT_H_ |
OLD | NEW |