OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 11 matching lines...) Expand all Loading... |
22 */ | 22 */ |
23 | 23 |
24 #ifndef UIEvent_h | 24 #ifndef UIEvent_h |
25 #define UIEvent_h | 25 #define UIEvent_h |
26 | 26 |
27 #include "core/CoreExport.h" | 27 #include "core/CoreExport.h" |
28 #include "core/events/Event.h" | 28 #include "core/events/Event.h" |
29 #include "core/events/EventDispatchMediator.h" | 29 #include "core/events/EventDispatchMediator.h" |
30 #include "core/events/UIEventInit.h" | 30 #include "core/events/UIEventInit.h" |
31 #include "core/frame/DOMWindow.h" | 31 #include "core/frame/DOMWindow.h" |
| 32 #include "core/input/InputDevice.h" |
32 | 33 |
33 namespace blink { | 34 namespace blink { |
34 | 35 |
35 // FIXME: Get rid of this typedef. | 36 // FIXME: Get rid of this typedef. |
36 typedef DOMWindow AbstractView; | 37 typedef DOMWindow AbstractView; |
37 | 38 |
38 class CORE_EXPORT UIEvent : public Event { | 39 class CORE_EXPORT UIEvent : public Event { |
39 DEFINE_WRAPPERTYPEINFO(); | 40 DEFINE_WRAPPERTYPEINFO(); |
40 public: | 41 public: |
41 static PassRefPtrWillBeRawPtr<UIEvent> create() | 42 static PassRefPtrWillBeRawPtr<UIEvent> create() |
42 { | 43 { |
43 return adoptRefWillBeNoop(new UIEvent); | 44 return adoptRefWillBeNoop(new UIEvent); |
44 } | 45 } |
45 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, bool
canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int deta
il) | 46 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, bool
canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int deta
il) |
46 { | 47 { |
47 return adoptRefWillBeNoop(new UIEvent(type, canBubble, cancelable, view,
detail)); | 48 return adoptRefWillBeNoop(new UIEvent(type, canBubble, cancelable, view,
detail)); |
48 } | 49 } |
49 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, cons
t UIEventInit& initializer) | 50 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, cons
t UIEventInit& initializer) |
50 { | 51 { |
51 return adoptRefWillBeNoop(new UIEvent(type, initializer)); | 52 return adoptRefWillBeNoop(new UIEvent(type, initializer)); |
52 } | 53 } |
53 virtual ~UIEvent(); | 54 virtual ~UIEvent(); |
54 | 55 |
55 void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable,
PassRefPtrWillBeRawPtr<AbstractView>, int detail); | 56 void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable,
PassRefPtrWillBeRawPtr<AbstractView>, int detail); |
56 | 57 |
57 AbstractView* view() const { return m_view.get(); } | 58 AbstractView* view() const { return m_view.get(); } |
58 int detail() const { return m_detail; } | 59 int detail() const { return m_detail; } |
| 60 InputDevice* sourceDevice() const { return m_sourceDevice.get(); } |
59 | 61 |
60 virtual const AtomicString& interfaceName() const override; | 62 virtual const AtomicString& interfaceName() const override; |
61 virtual bool isUIEvent() const override final; | 63 virtual bool isUIEvent() const override final; |
62 | 64 |
63 virtual int keyCode() const; | 65 virtual int keyCode() const; |
64 virtual int charCode() const; | 66 virtual int charCode() const; |
65 | 67 |
66 virtual int layerX(); | 68 virtual int layerX(); |
67 virtual int layerY(); | 69 virtual int layerY(); |
68 | 70 |
69 virtual int pageX() const; | 71 virtual int pageX() const; |
70 virtual int pageY() const; | 72 virtual int pageY() const; |
71 | 73 |
72 virtual int which() const; | 74 virtual int which() const; |
73 | 75 |
74 DECLARE_VIRTUAL_TRACE(); | 76 DECLARE_VIRTUAL_TRACE(); |
75 | 77 |
76 protected: | 78 protected: |
77 UIEvent(); | 79 UIEvent(); |
78 UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPt
rWillBeRawPtr<AbstractView>, int detail); | 80 UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPt
rWillBeRawPtr<AbstractView>, int detail); |
79 UIEvent(const AtomicString&, const UIEventInit&); | 81 UIEvent(const AtomicString&, const UIEventInit&); |
80 | 82 |
81 private: | 83 private: |
82 RefPtrWillBeMember<AbstractView> m_view; | 84 RefPtrWillBeMember<AbstractView> m_view; |
83 int m_detail; | 85 int m_detail; |
| 86 PersistentWillBeMember<InputDevice> m_sourceDevice; |
84 }; | 87 }; |
85 | 88 |
86 } // namespace blink | 89 } // namespace blink |
87 | 90 |
88 #endif // UIEvent_h | 91 #endif // UIEvent_h |
OLD | NEW |