OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return; | 77 return; |
78 | 78 |
79 if (!gNodesDispatchingSimulatedClicks) | 79 if (!gNodesDispatchingSimulatedClicks) |
80 gNodesDispatchingSimulatedClicks = new HashSet<Node*>; | 80 gNodesDispatchingSimulatedClicks = new HashSet<Node*>; |
81 else if (gNodesDispatchingSimulatedClicks->contains(node)) | 81 else if (gNodesDispatchingSimulatedClicks->contains(node)) |
82 return; | 82 return; |
83 | 83 |
84 gNodesDispatchingSimulatedClicks->add(node); | 84 gNodesDispatchingSimulatedClicks->add(node); |
85 | 85 |
86 if (mouseEventOptions == SendMouseOverUpDownEvents) | 86 if (mouseEventOptions == SendMouseOverUpDownEvents) |
87 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseo
ver, node->document().defaultView(), underlyingEvent)).dispatch(); | 87 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseo
ver, node->document().domWindow(), underlyingEvent)).dispatch(); |
88 | 88 |
89 if (mouseEventOptions != SendNoEvents) | 89 if (mouseEventOptions != SendNoEvents) |
90 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::moused
own, node->document().defaultView(), underlyingEvent)).dispatch(); | 90 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::moused
own, node->document().domWindow(), underlyingEvent)).dispatch(); |
91 node->setActive(true, visualOptions == ShowPressedLook); | 91 node->setActive(true, visualOptions == ShowPressedLook); |
92 if (mouseEventOptions != SendNoEvents) | 92 if (mouseEventOptions != SendNoEvents) |
93 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseu
p, node->document().defaultView(), underlyingEvent)).dispatch(); | 93 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseu
p, node->document().domWindow(), underlyingEvent)).dispatch(); |
94 node->setActive(false); | 94 node->setActive(false); |
95 | 95 |
96 // always send click | 96 // always send click |
97 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod
e->document().defaultView(), underlyingEvent)).dispatch(); | 97 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod
e->document().domWindow(), underlyingEvent)).dispatch(); |
98 | 98 |
99 gNodesDispatchingSimulatedClicks->remove(node); | 99 gNodesDispatchingSimulatedClicks->remove(node); |
100 } | 100 } |
101 | 101 |
102 bool EventDispatcher::dispatch() | 102 bool EventDispatcher::dispatch() |
103 { | 103 { |
104 #ifndef NDEBUG | 104 #ifndef NDEBUG |
105 ASSERT(!m_eventDispatched); | 105 ASSERT(!m_eventDispatched); |
106 m_eventDispatched = true; | 106 m_eventDispatched = true; |
107 #endif | 107 #endif |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 } | 218 } |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 const EventContext* EventDispatcher::topEventContext() | 222 const EventContext* EventDispatcher::topEventContext() |
223 { | 223 { |
224 return m_event->eventPath().isEmpty() ? 0 : m_event->eventPath().last().get(
); | 224 return m_event->eventPath().isEmpty() ? 0 : m_event->eventPath().last().get(
); |
225 } | 225 } |
226 | 226 |
227 } | 227 } |
OLD | NEW |