diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-26 22:04:44 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-26 22:04:44 +0000 |
commit | a3e2de75e309b527cd694b16d23100bbec1710d9 (patch) | |
tree | 30f49027fbf74758595ee30b0b301206a4c2becf /ui/aura/event.h | |
parent | e30e4d816f7e32f2be39f32159e020d3b037de04 (diff) | |
download | chromium_src-a3e2de75e309b527cd694b16d23100bbec1710d9.zip chromium_src-a3e2de75e309b527cd694b16d23100bbec1710d9.tar.gz chromium_src-a3e2de75e309b527cd694b16d23100bbec1710d9.tar.bz2 |
Consolidate/cleanup event cracking code; single out GdkEvents; saves ~850 lines.
Move ui::NativeEvent typdefs and common functions to ui/base/events.h.
Remove NativeEvent2 typedef, single out GdkEvent* uses that should be removed.
Implement platform specific ui/base/[platform]/events_[platform].cc.
Revise views::NativeEvent definitions (to support Aura abstraction).
Consolidate Event[Type/Flags/Location]FromNative(), GetMouseWheelOffset(), etc.
Remove GetRepeatCount(), GetWindowsFlags(), IsExtendedKey(), etc.
Add IsMouseEvent(), KeyboardCodeFromNative(), EF_EXTENDED flag, etc.
Localize GetFlagsFromGdkEvent(), move some file locals to new helpers files.
Move views/touchui/touch_factory.h|cc to ui/base/touch.
Stop mixing Windows mouse events' MK_*BUTTON into their wParams.
BUG=93945
TEST=No build breaks (many configs...), no mouse/key behavior changes.
Review URL: http://codereview.chromium.org/7942004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/event.h')
-rw-r--r-- | ui/aura/event.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/ui/aura/event.h b/ui/aura/event.h index 3560805..f619c12 100644 --- a/ui/aura/event.h +++ b/ui/aura/event.h @@ -13,30 +13,20 @@ #include "ui/base/keycodes/keyboard_codes.h" #include "ui/gfx/point.h" -#if defined(USE_X11) -typedef union _XEvent XEvent; -#endif - namespace aura { -#if defined(OS_WIN) -typedef MSG NativeEvent; -#elif defined(USE_X11) -typedef XEvent* NativeEvent; -#endif - class Window; class AURA_EXPORT Event { public: - const NativeEvent& native_event() const { return native_event_; } + const ui::NativeEvent& native_event() const { return native_event_; } ui::EventType type() const { return type_; } const base::Time& time_stamp() const { return time_stamp_; } int flags() const { return flags_; } protected: Event(ui::EventType type, int flags); - Event(NativeEvent native_event, ui::EventType type, int flags); + Event(const ui::NativeEvent& native_event, ui::EventType type, int flags); Event(const Event& copy); void set_type(ui::EventType type) { type_ = type; } @@ -45,9 +35,9 @@ class AURA_EXPORT Event { // Safely initializes the native event members of this class. void Init(); - void InitWithNativeEvent(NativeEvent native_event); + void InitWithNativeEvent(const ui::NativeEvent& native_event); - NativeEvent native_event_; + ui::NativeEvent native_event_; ui::EventType type_; base::Time time_stamp_; int flags_; @@ -60,7 +50,7 @@ class AURA_EXPORT LocatedEvent : public Event { gfx::Point location() const { return location_; } protected: - explicit LocatedEvent(NativeEvent native_event); + explicit LocatedEvent(const ui::NativeEvent& native_event); // Create a new LocatedEvent which is identical to the provided model. // If source / target windows are provided, the model location will be @@ -78,7 +68,7 @@ class AURA_EXPORT LocatedEvent : public Event { class AURA_EXPORT MouseEvent : public LocatedEvent { public: - explicit MouseEvent(NativeEvent native_event); + explicit MouseEvent(const ui::NativeEvent& native_event); // Create a new MouseEvent which is identical to the provided model. // If source / target windows are provided, the model location will be @@ -98,7 +88,7 @@ class AURA_EXPORT MouseEvent : public LocatedEvent { class AURA_EXPORT KeyEvent : public Event { public: - explicit KeyEvent(NativeEvent native_event); + explicit KeyEvent(const ui::NativeEvent& native_event); // Used for synthetic events in testing. KeyEvent(ui::EventType type, |