Changes between Version 4 and Version 5 of QtWebKitPlugins
- Timestamp:
- Oct 18, 2009, 2:35:12 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QtWebKitPlugins
v4 v5 1 This page documents the current status, code overview of (netscape) plugins on Qt/WebKit. Feel free to substitute 'plugins' with 'flash' when reading this document (since it's the main plugin we test with).1 This page documents the current status, code overview of plugins on Qt/WebKit. 2 2 3 3 = Overview = 4 Qt/WebKit supports loading of netscape plugins. To enable loading of plugins, you must enable QWebSettings::PluginsEnabled. 4 Qt/WebKit supports loading of two kinds of plugins. 5 * Qt based plugins - These can be QWidget or QGraphicsWidget based. 6 * Netscape plugins (npapi) 7 8 To enable loading of plugins, you must enable QWebSettings::PluginsEnabled. 9 10 == Qt Based plugins == 11 <object> are encapsulated in HTMLPlugInElement. FrameLoaderClient has a method createPlugin that returns the Widget that should be used as the plugin. FrameLoaderClientQt.cpp inspects the mimetype. With a mime type of application/x-qt-plugin or application/x-qt-styled-widget, the frameloader creates a QWidget using the QWebPluginFactory (QWebPluginFactory::create()). This QWidget is encapsulate in a QtPluginWidget (which is basically a WebCore Widget). The QWidget is created as a child of the QWebPageClient::pluginParent() (more information on this below). 12 13 = Netscape plugins = 14 The rest of this document focuses on Netscape plugins. Feel free to substitute 'plugins' with 'flash' when reading this document (since it's the main plugin we test with). 5 15 6 16 = Hacking = … … 23 33 * PluginDatabase.cpp - Takes care of locating the plugin library file. Provides PluginPackage(s). 24 34 25 QWebPageClient - We require access to the QWidget (QGraphicsView/QWebView) or the parent (QGraphicsWebView/QWebView). To provide this and keep the plugin code working in both cases, the chrome (hostwindow) provides a platformPageClient() that helps us get information about the client of the QWebPage. Both QWebView and QGraphicsWebView provide objects that implement the virtuals in QWebPageClient. 35 QWebPageClient - We require access to the QWidget (QGraphicsView/QWebView) or the parent (QGraphicsWebView/QWebView). To provide this and keep the plugin code working in both cases, the chrome (hostwindow) provides a platformPageClient() that helps us get information about the client of the QWebPage. Both QWebView and QGraphicsWebView provide objects that implement the virtuals in QWebPageClient. QWebPageClient::ownerWidget() return the QWidget in which the page is displayed (i.e QWebView or the QGraphicsView). QWebPageClient::pluginParent() returns the parent QObject (i.e QWebView or QGraphicsWebView). The ownerWidget() is necessary for the popup code. The pluginParent is necessary to position the plugins. 26 36 27 37 = Platform Specific =