Changeset 68128 in webkit


Ignore:
Timestamp:
Sep 23, 2010 3:53:58 AM (14 years ago)
Author:
vestbo@webkit.org
Message:

2010-09-23 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>

Reviewed by Simon Hausmann.

[Qt] Refactor QtWebKitPlatformPlugin interface

Make it easier to keep source-compability for the
QtWebKitPlatformPlugin interface, and run qmake
on the example (but not build) for convenience.

https://bugs.webkit.org/show_bug.cgi?id=46345

  • Api/qwebkitplatformplugin.h:
  • WebCoreSupport/QtPlatformPlugin.cpp:
  • examples/platformplugin/README:
  • examples/platformplugin/WebPlugin.cpp:
  • examples/platformplugin/WebPlugin.h:
  • examples/platformplugin/qwebkitplatformplugin.h:

2010-09-23 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>

Reviewed by Simon Hausmann.

[Qt] Refactor QtWebKitPlatformPlugin interface

Make it easier to keep source-compability for the
QtWebKitPlatformPlugin interface, and run qmake
on the example (but not build) for convenience.

https://bugs.webkit.org/show_bug.cgi?id=46345

  • Scripts/webkitdirs.pm:
Location:
trunk
Files:
9 edited

Legend:

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

    r67272 r68128  
    111111
    112112    virtual bool supportsExtension(Extension extension) const = 0;
    113     virtual QWebSelectMethod* createSelectInputMethod() const = 0;
    114     virtual QWebNotificationPresenter* createNotificationPresenter() const = 0;
    115     virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0;
    116 
     113    virtual QObject* createExtension(Extension extension) const = 0;
    117114};
    118115
    119 Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
     116Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5");
    120117
    121118#endif // QWEBKITPLATFORMPLUGIN_H
  • trunk/WebKit/qt/ChangeLog

    r68099 r68128  
     12010-09-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] Refactor QtWebKitPlatformPlugin interface
     6
     7        Make it easier to keep source-compability for the
     8        QtWebKitPlatformPlugin interface, and run qmake
     9        on the example (but not build) for convenience.
     10
     11        https://bugs.webkit.org/show_bug.cgi?id=46345
     12
     13        * Api/qwebkitplatformplugin.h:
     14        * WebCoreSupport/QtPlatformPlugin.cpp:
     15        * examples/platformplugin/README:
     16        * examples/platformplugin/WebPlugin.cpp:
     17        * examples/platformplugin/WebPlugin.h:
     18        * examples/platformplugin/qwebkitplatformplugin.h:
     19
    1202010-09-22  Andras Becsi  <abecsi@webkit.org>
    221
  • trunk/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp

    r64829 r68128  
    9292{
    9393    QWebKitPlatformPlugin* p = plugin();
    94     return p ? p->createSelectInputMethod() : 0;
     94    return p ? qobject_cast<QWebSelectMethod*>(p->createExtension(QWebKitPlatformPlugin::MultipleSelections)) : 0;
    9595}
    9696
     
    9999{
    100100    QWebKitPlatformPlugin* p = plugin();
    101     if (!p)
    102         return 0;
    103     return p->createNotificationPresenter();
     101    return p ? qobject_cast<QWebNotificationPresenter*>(p->createExtension(QWebKitPlatformPlugin::Notifications)) : 0;
    104102}
    105103
  • trunk/WebKit/qt/examples/platformplugin/README

    r60285 r68128  
    77put the plugin into use. To stop using the plugin just remove the directory $$[QT_INSTALL_PLUGINS]/webkit.
    88
     9A copy of qwebkitplatformplugin.h is provided with the example, as platform plugins should not depend
     10on the precense of QtWebKit to build.
     11
    912This plugin can provide popups for <select multiple> elements but to use this feature QtWebKit must be
    1013compiled with NO_LISTBOX_RENDERING enabled.
  • trunk/WebKit/qt/examples/platformplugin/WebPlugin.cpp

    r61487 r68128  
    211211bool WebPlugin::supportsExtension(Extension extension) const
    212212{
    213     if (extension == MultipleSelections)
     213    switch (extension) {
     214    case MultipleSelections:
    214215        return true;
    215     if (extension == Notifications)
    216216#if ENABLE_NOTIFICATIONS
     217    case Notifications:
    217218        return true;
    218 #else
     219#endif
     220    default:
    219221        return false;
     222    }
     223}
     224
     225QObject* WebPlugin::createExtension(Extension extension) const
     226{
     227    switch (extension) {
     228    case MultipleSelections:
     229        return new WebPopup();
     230#if ENABLE_NOTIFICATIONS
     231    case Notifications:
     232        return new WebNotificationPresenter();
    220233#endif
    221     return false;
     234    default:
     235        return 0;
     236    }
    222237}
    223238
  • trunk/WebKit/qt/examples/platformplugin/WebPlugin.h

    r64557 r68128  
    8888    Q_INTERFACES(QWebKitPlatformPlugin)
    8989public:
    90     virtual QWebSelectMethod* createSelectInputMethod() const { return new WebPopup(); }
    9190    virtual bool supportsExtension(Extension extension) const;
    92     virtual QWebNotificationPresenter* createNotificationPresenter() const {
    93         return new WebNotificationPresenter();
    94     }
    95     virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const {
    96         return 0;
    97     }
     91    virtual QObject* createExtension(Extension extension) const;
    9892};
    9993
  • trunk/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h

    r67272 r68128  
    111111
    112112    virtual bool supportsExtension(Extension extension) const = 0;
    113     virtual QWebSelectMethod* createSelectInputMethod() const = 0;
    114     virtual QWebNotificationPresenter* createNotificationPresenter() const = 0;
    115     virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0;
    116 
     113    virtual QObject* createExtension(Extension extension) const = 0;
    117114};
    118115
    119 Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
     116Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5");
    120117
    121118#endif // QWEBKITPLATFORMPLUGIN_H
  • trunk/WebKitTools/ChangeLog

    r68125 r68128  
     12010-09-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] Refactor QtWebKitPlatformPlugin interface
     6
     7        Make it easier to keep source-compability for the
     8        QtWebKitPlatformPlugin interface, and run qmake
     9        on the example (but not build) for convenience.
     10
     11        https://bugs.webkit.org/show_bug.cgi?id=46345
     12
     13        * Scripts/webkitdirs.pm:
     14
    1152010-09-23  Adam Barth  <abarth@webkit.org>
    216
  • trunk/WebKitTools/Scripts/webkitdirs.pm

    r67911 r68128  
    15471547    }
    15481548
    1549     push @buildArgs, sourceDir() . "/WebKit.pro";
    15501549    if ($config =~ m/debug/i) {
    15511550        push @buildArgs, "CONFIG-=release";
     
    15621561    }
    15631562
     1563    push @buildArgs, sourceDir() . "/WebKit.pro";
     1564
    15641565    print "Calling '$qmakebin @buildArgs' in " . $dir . "\n\n";
    15651566    print "Installation headers directory: $installHeaders\n" if(defined($installHeaders));
     
    15701571       die "Failed to setup build environment using $qmakebin!\n";
    15711572    }
     1573
     1574    # Manually create makefiles for the examples so we don't build by default
     1575    my $examplesDir = $dir . "/WebKit/qt/examples";
     1576    File::Path::mkpath($examplesDir);
     1577    $buildArgs[-1] = sourceDir() . "/WebKit/qt/examples/examples.pro";
     1578    chdir $examplesDir or die;
     1579    print "Calling '$qmakebin @buildArgs' in " . $examplesDir . "\n\n";
     1580    $result = system "$qmakebin @buildArgs";
     1581    die "Failed to create makefiles for the examples!\n" if $result ne 0;
     1582    chdir $dir or die;
    15721583
    15731584    if ($clean) {
Note: See TracChangeset for help on using the changeset viewer.