Changeset 71303 in webkit


Ignore:
Timestamp:
Nov 3, 2010 8:55:33 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-11-03 Andre Pedralho <andre.pedralho@gmail.com>

Reviewed by Kenneth Rohde Christiansen.

Using the Platform Plugin to define the default values for the padding of HitTestResult.
https://bugs.webkit.org/show_bug.cgi?id=48450

  • Api/qwebkitplatformplugin.h: (QWebTouchModifier::~QWebTouchModifier):
  • WebCoreSupport/QtPlatformPlugin.cpp: (WebCore::QtPlatformPlugin::createTouchModifier):
  • WebCoreSupport/QtPlatformPlugin.h:
  • examples/platformplugin/WebPlugin.cpp: (WebPlugin::supportsExtension): (WebPlugin::createExtension):
  • examples/platformplugin/WebPlugin.h: (TouchModifier::hitTestPaddingForTouch):
  • examples/platformplugin/qwebkitplatformplugin.h: (QWebTouchModifier::~QWebTouchModifier):
Location:
trunk/WebKit/qt
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qwebkitplatformplugin.h

    r68204 r71303  
    103103};
    104104
     105class QWebTouchModifier : public QObject
     106{
     107    Q_OBJECT
     108public:
     109    virtual ~QWebTouchModifier() {}
     110
     111    enum PaddingDirection {
     112        Up, Right, Down, Left
     113    };
     114
     115    virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0;
     116};
     117
    105118class QWebKitPlatformPlugin
    106119{
     
    111124        MultipleSelections,
    112125        Notifications,
    113         Haptics
     126        Haptics,
     127        TouchInteraction
    114128    };
    115129
     
    118132};
    119133
    120 Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5");
     134Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.6");
    121135
    122136#endif // QWEBKITPLATFORMPLUGIN_H
  • trunk/WebKit/qt/ChangeLog

    r71241 r71303  
     12010-11-03  Andre Pedralho  <andre.pedralho@gmail.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Using the Platform Plugin to define the default values for the padding of HitTestResult.
     6        https://bugs.webkit.org/show_bug.cgi?id=48450
     7
     8        * Api/qwebkitplatformplugin.h:
     9        (QWebTouchModifier::~QWebTouchModifier):
     10        * WebCoreSupport/QtPlatformPlugin.cpp:
     11        (WebCore::QtPlatformPlugin::createTouchModifier):
     12        * WebCoreSupport/QtPlatformPlugin.h:
     13        * examples/platformplugin/WebPlugin.cpp:
     14        (WebPlugin::supportsExtension):
     15        (WebPlugin::createExtension):
     16        * examples/platformplugin/WebPlugin.h:
     17        (TouchModifier::hitTestPaddingForTouch):
     18        * examples/platformplugin/qwebkitplatformplugin.h:
     19        (QWebTouchModifier::~QWebTouchModifier):
     20
    1212010-11-03  Andreas Kling  <kling@webkit.org>
    222
  • trunk/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp

    r69003 r71303  
    108108}
    109109
     110QWebTouchModifier* QtPlatformPlugin::createTouchModifier()
     111{
     112    QWebKitPlatformPlugin* p = plugin();
     113    return p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0;
    110114}
     115
     116}
  • trunk/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h

    r68204 r71303  
    2929class QWebHapticFeedbackPlayer;
    3030class QWebSelectData;
     31class QWebTouchModifier;
    3132
    3233namespace WebCore {
     
    4041    QWebNotificationPresenter* createNotificationPresenter();
    4142    QWebHapticFeedbackPlayer* createHapticFeedbackPlayer();
     43    QWebTouchModifier* createTouchModifier();
    4244
    4345    QWebKitPlatformPlugin* plugin();
  • trunk/WebKit/qt/examples/platformplugin/WebPlugin.cpp

    r68128 r71303  
    218218        return true;
    219219#endif
     220    case TouchInteraction:
     221        return true;
    220222    default:
    221223        return false;
     
    232234        return new WebNotificationPresenter();
    233235#endif
     236    case TouchInteraction:
     237        return new TouchModifier();
    234238    default:
    235239        return 0;
  • trunk/WebKit/qt/examples/platformplugin/WebPlugin.h

    r68128 r71303  
    8383};
    8484
     85class TouchModifier : public QWebTouchModifier
     86{
     87    Q_OBJECT
     88public:
     89    unsigned hitTestPaddingForTouch(const PaddingDirection direction) const {
     90        // Use 10 as padding in each direction but Up.
     91        if (direction == QWebTouchModifier::Up)
     92            return 15;
     93        return 10;
     94    }
     95};
     96
    8597class WebPlugin : public QObject, public QWebKitPlatformPlugin
    8698{
  • trunk/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h

    r68128 r71303  
    9999};
    100100
     101class QWebTouchModifier : public QObject
     102{
     103    Q_OBJECT
     104public:
     105    virtual ~QWebTouchModifier() {}
     106
     107    enum PaddingDirection {
     108        Up, Right, Down, Left
     109    };
     110
     111    virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0;
     112};
     113
    101114class QWebKitPlatformPlugin
    102115{
     
    107120        MultipleSelections,
    108121        Notifications,
    109         Haptics
     122        Haptics,
     123        TouchInteraction
    110124    };
    111125
     
    114128};
    115129
    116 Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5");
     130Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.6");
    117131
    118132#endif // QWEBKITPLATFORMPLUGIN_H
Note: See TracChangeset for help on using the changeset viewer.