| 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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
| 10 #include "gfx/point.h" | 10 #include "gfx/point.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 class Event { | 34 class Event { |
| 35 public: | 35 public: |
| 36 // Event types. (prefixed because of a conflict with windows headers) | 36 // Event types. (prefixed because of a conflict with windows headers) |
| 37 enum EventType { ET_UNKNOWN = 0, | 37 enum EventType { ET_UNKNOWN = 0, |
| 38 ET_MOUSE_PRESSED, | 38 ET_MOUSE_PRESSED, |
| 39 ET_MOUSE_DRAGGED, | 39 ET_MOUSE_DRAGGED, |
| 40 ET_MOUSE_RELEASED, | 40 ET_MOUSE_RELEASED, |
| 41 ET_MOUSE_MOVED, | 41 ET_MOUSE_MOVED, |
| 42 ET_MOUSE_ENTERED, | 42 ET_MOUSE_ENTERED, |
| 43 ET_MOUSE_EXITED, | 43 ET_MOUSE_EXITED, |
| 44 ET_MOUSE_NEAR, |
| 45 ET_MOUSE_EXITED_NEAR, |
| 44 ET_KEY_PRESSED, | 46 ET_KEY_PRESSED, |
| 45 ET_KEY_RELEASED, | 47 ET_KEY_RELEASED, |
| 46 ET_MOUSEWHEEL, | 48 ET_MOUSEWHEEL, |
| 47 ET_DROP_TARGET_EVENT }; | 49 ET_DROP_TARGET_EVENT }; |
| 48 | 50 |
| 49 // Event flags currently supported. Although this is a "views" | 51 // Event flags currently supported. Although this is a "views" |
| 50 // file, this header is used on non-views platforms (e.g. OSX). For | 52 // file, this header is used on non-views platforms (e.g. OSX). For |
| 51 // example, these EventFlags are used by the automation provider for | 53 // example, these EventFlags are used by the automation provider for |
| 52 // all platforms. | 54 // all platforms. |
| 53 enum EventFlags { EF_SHIFT_DOWN = 1 << 0, | 55 enum EventFlags { EF_SHIFT_DOWN = 1 << 0, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return (flags_ & EF_ALT_DOWN) != 0; | 95 return (flags_ & EF_ALT_DOWN) != 0; |
| 94 } | 96 } |
| 95 | 97 |
| 96 bool IsMouseEvent() const { | 98 bool IsMouseEvent() const { |
| 97 return type_ == ET_MOUSE_PRESSED || | 99 return type_ == ET_MOUSE_PRESSED || |
| 98 type_ == ET_MOUSE_DRAGGED || | 100 type_ == ET_MOUSE_DRAGGED || |
| 99 type_ == ET_MOUSE_RELEASED || | 101 type_ == ET_MOUSE_RELEASED || |
| 100 type_ == ET_MOUSE_MOVED || | 102 type_ == ET_MOUSE_MOVED || |
| 101 type_ == ET_MOUSE_ENTERED || | 103 type_ == ET_MOUSE_ENTERED || |
| 102 type_ == ET_MOUSE_EXITED || | 104 type_ == ET_MOUSE_EXITED || |
| 103 type_ == ET_MOUSEWHEEL; | 105 type_ == ET_MOUSEWHEEL || |
| 106 type_ == ET_MOUSE_NEAR || |
| 107 type_ == ET_MOUSE_EXITED_NEAR; |
| 104 } | 108 } |
| 105 | 109 |
| 106 #if defined(OS_WIN) | 110 #if defined(OS_WIN) |
| 107 // Returns the EventFlags in terms of windows flags. | 111 // Returns the EventFlags in terms of windows flags. |
| 108 int GetWindowsFlags() const; | 112 int GetWindowsFlags() const; |
| 109 | 113 |
| 110 // Convert windows flags to views::Event flags | 114 // Convert windows flags to views::Event flags |
| 111 static int ConvertWindowsFlags(uint32 win_flags); | 115 static int ConvertWindowsFlags(uint32 win_flags); |
| 112 #elif defined(OS_LINUX) | 116 #elif defined(OS_LINUX) |
| 113 // Convert the state member on a GdkEvent to views::Event flags | 117 // Convert the state member on a GdkEvent to views::Event flags |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 private: | 343 private: |
| 340 const OSExchangeData& data_; | 344 const OSExchangeData& data_; |
| 341 int source_operations_; | 345 int source_operations_; |
| 342 | 346 |
| 343 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); | 347 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); |
| 344 }; | 348 }; |
| 345 | 349 |
| 346 } // namespace views | 350 } // namespace views |
| 347 | 351 |
| 348 #endif // VIEWS_EVENT_H_ | 352 #endif // VIEWS_EVENT_H_ |
| OLD | NEW |