Changeset 88702 in webkit


Ignore:
Timestamp:
Jun 13, 2011 2:58:20 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-13 Sangyong Park <sy302.park@gmail.com>

Reviewed by Eric Seidel.

implement to handle wheel event of plugin on x11
https://bugs.webkit.org/show_bug.cgi?id=62522

Implement platformHandleWheelEvent() in NetscapePluginX11.cpp
for to handle wheel event on plugins

  • WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::setCommonMouseEventFields): add template argument to support WebWheelEvent (WebKit::setXButtonEventFieldsByWebWheelEvent): initialize XButtonEvent by WebWheelEvent (WebKit::NetscapePlugin::platformHandleWheelEvent): handle wheel event on plugin
Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r88701 r88702  
     12011-06-13  Sangyong Park  <sy302.park@gmail.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        implement to handle wheel event of plugin on x11
     6        https://bugs.webkit.org/show_bug.cgi?id=62522
     7
     8        Implement platformHandleWheelEvent() in NetscapePluginX11.cpp
     9        for to handle wheel event on plugins
     10
     11        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
     12        (WebKit::setCommonMouseEventFields): add template argument to support WebWheelEvent
     13        (WebKit::setXButtonEventFieldsByWebWheelEvent): initialize XButtonEvent by WebWheelEvent
     14        (WebKit::NetscapePlugin::platformHandleWheelEvent): handle wheel event on plugin
     15
    1162011-06-13  Eunmi Lee  <eunmi15.lee@samsung.com>
    217
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp

    r88244 r88702  
    327327}
    328328
    329 template <typename XEventType>
    330 static inline void setCommonMouseEventFields(XEventType& xEvent, const WebMouseEvent& webEvent, const WebCore::IntPoint& pluginLocation)
     329template <typename XEventType, typename WebEventType>
     330static inline void setCommonMouseEventFields(XEventType& xEvent, const WebEventType& webEvent, const WebCore::IntPoint& pluginLocation)
    331331{
    332332    xEvent.root = rootWindowID();
     
    367367}
    368368
     369static inline void setXButtonEventFieldsByWebWheelEvent(XEvent& xEvent, const WebWheelEvent& webEvent, const WebCore::IntPoint& pluginLocation)
     370{
     371    XButtonEvent& xButton = xEvent.xbutton;
     372    setCommonMouseEventFields(xButton, webEvent, pluginLocation);
     373
     374    xButton.type = ButtonPress;
     375    FloatSize ticks = webEvent.wheelTicks();
     376    if (ticks.height()) {
     377        if (ticks.height() > 0)
     378            xButton.button = 4; // up
     379        else
     380            xButton.button = 5; // down
     381    } else {
     382        if (ticks.width() > 0)
     383            xButton.button = 6; // left
     384        else
     385            xButton.button = 7; // right
     386    }
     387}
     388
    369389static inline void setXCrossingEventFields(XEvent& xEvent, const WebMouseEvent& webEvent, const WebCore::IntPoint& pluginLocation, int type)
    370390{
     
    406426const int kFocusOutType = 10;
    407427
    408 bool NetscapePlugin::platformHandleWheelEvent(const WebWheelEvent&)
    409 {
    410     notImplemented();
    411     return false;
     428bool NetscapePlugin::platformHandleWheelEvent(const WebWheelEvent& event)
     429{
     430    if (m_isWindowed)
     431        return false;
     432
     433    XEvent xEvent;
     434    initializeXEvent(xEvent);
     435    setXButtonEventFieldsByWebWheelEvent(xEvent, event, m_frameRect.location());
     436
     437    return NPP_HandleEvent(&xEvent);
    412438}
    413439
Note: See TracChangeset for help on using the changeset viewer.