bool NetscapePluginX11::handleMouseEvent(const WebMouseEvent& event) { ASSERT(m_plugin.isWindowed()); XEvent xEvent; initializeXEvent(xEvent); switch (event.type()) { case WebEvent::MouseDown: case WebEvent::MouseUp: setXButtonEventFields(xEvent, event, m_plugin.convertToRootView(IntPoint())); break; case WebEvent::MouseMove: setXMotionEventFields(xEvent, event, m_plugin.convertToRootView(IntPoint())); break; case WebEvent::MouseForceChanged: case WebEvent::MouseForceDown: case WebEvent::MouseForceUp: case WebEvent::NoType: case WebEvent::Wheel: case WebEvent::KeyDown: case WebEvent::KeyUp: case WebEvent::RawKeyDown: case WebEvent::Char: #if ENABLE(TOUCH_EVENTS) case WebEvent::TouchStart: case WebEvent::TouchMove: case WebEvent::TouchEnd: case WebEvent::TouchCancel: #endif return false; } return !m_plugin.NPP_HandleEvent(&xEvent); }
bool NetscapePluginX11::handleMouseLeaveEvent(const WebMouseEvent& event) { ASSERT(m_plugin.isWindowed()); XEvent xEvent; initializeXEvent(xEvent); setXCrossingEventFields(xEvent, event, m_plugin.convertToRootView(IntPoint()), LeaveNotify); return !m_plugin.NPP_HandleEvent(&xEvent); }
bool NetscapePluginX11::handleWheelEvent(const WebWheelEvent& event) { ASSERT(m_plugin.isWindowed()); XEvent xEvent; initializeXEvent(xEvent); setXButtonEventFieldsByWebWheelEvent(xEvent, event, m_plugin.convertToRootView(IntPoint())); return !m_plugin.NPP_HandleEvent(&xEvent); }
bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& event) { // We don't generate other types of keyboard events via WebEventFactory. ASSERT(event.type() == WebEvent::KeyDown || event.type() == WebEvent::KeyUp); XEvent xEvent; initializeXEvent(xEvent); setXKeyEventFields(xEvent, event); return !NPP_HandleEvent(&xEvent); }
bool NetscapePlugin::platformHandleMouseLeaveEvent(const WebMouseEvent& event) { if (m_isWindowed) return false; XEvent xEvent; initializeXEvent(xEvent); setXCrossingEventFields(xEvent, event, convertToRootView(IntPoint()), LeaveNotify); return !NPP_HandleEvent(&xEvent); }
bool NetscapePlugin::platformHandleWheelEvent(const WebWheelEvent& event) { if (m_isWindowed) return false; XEvent xEvent; initializeXEvent(xEvent); setXButtonEventFieldsByWebWheelEvent(xEvent, event, convertToRootView(IntPoint())); return !NPP_HandleEvent(&xEvent); }
bool NetscapePluginX11::handleKeyboardEvent(const WebKeyboardEvent& event) { ASSERT(m_plugin.isWindowed()); // We don't generate other types of keyboard events via WebEventFactory. ASSERT(event.type() == WebEvent::KeyDown || event.type() == WebEvent::KeyUp); XEvent xEvent; initializeXEvent(xEvent); setXKeyEventFields(xEvent, event); return !m_plugin.NPP_HandleEvent(&xEvent); }
void NetscapePluginX11::setFocus(bool focusIn) { ASSERT(m_plugin.isWindowed()); XEvent xEvent; initializeXEvent(xEvent); XFocusChangeEvent& focusEvent = xEvent.xfocus; focusEvent.type = focusIn ? kFocusInType : kFocusOutType; focusEvent.mode = NotifyNormal; focusEvent.detail = NotifyDetailNone; m_plugin.NPP_HandleEvent(&xEvent); }
void NetscapePlugin::platformSetFocus(bool focusIn) { if (m_isWindowed) return; XEvent xEvent; initializeXEvent(xEvent); XFocusChangeEvent& focusEvent = xEvent.xfocus; focusEvent.type = focusIn ? kFocusInType : kFocusOutType; focusEvent.mode = NotifyNormal; focusEvent.detail = NotifyDetailNone; NPP_HandleEvent(&xEvent); }
bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& event) { if (m_isWindowed) return false; if ((event.type() == WebEvent::MouseDown || event.type() == WebEvent::MouseUp) && event.button() == WebMouseEvent::RightButton && quirks().contains(PluginQuirks::IgnoreRightClickInWindowlessMode)) return false; XEvent xEvent; initializeXEvent(xEvent); switch (event.type()) { case WebEvent::MouseDown: case WebEvent::MouseUp: setXButtonEventFields(xEvent, event, convertToRootView(IntPoint())); break; case WebEvent::MouseMove: setXMotionEventFields(xEvent, event, convertToRootView(IntPoint())); break; case WebEvent::NoType: case WebEvent::Wheel: case WebEvent::KeyDown: case WebEvent::KeyUp: case WebEvent::RawKeyDown: case WebEvent::Char: #if ENABLE(GESTURE_EVENTS) case WebEvent::GestureScrollBegin: case WebEvent::GestureScrollEnd: #endif #if ENABLE(TOUCH_EVENTS) case WebEvent::TouchStart: case WebEvent::TouchMove: case WebEvent::TouchEnd: case WebEvent::TouchCancel: #endif return false; } return !NPP_HandleEvent(&xEvent); }