Title: [99903] trunk/Source/WebKit/qt
Revision
99903
Author
[email protected]
Date
2011-11-10 15:01:27 -0800 (Thu, 10 Nov 2011)

Log Message

[Qt] Adding methods setGeometry and setFont to QWebSelectMethod class.
https://bugs.webkit.org/show_bug.cgi?id=71530

Reviewed by Simon Hausmann.

Adding methods setGeometry and setFont so that users of platform plugin may show the
popup menus in proper position and using proper font.

* Api/qwebkitplatformplugin.h:
* WebCoreSupport/PopupMenuQt.cpp:
(WebCore::PopupMenuQt::show):
* examples/platformplugin/WebPlugin.h:
(WebPopup::setGeometry):
(WebPopup::setFont):
* examples/platformplugin/qwebkitplatformplugin.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/Api/qwebkitplatformplugin.h (99902 => 99903)


--- trunk/Source/WebKit/qt/Api/qwebkitplatformplugin.h	2011-11-10 22:59:46 UTC (rev 99902)
+++ trunk/Source/WebKit/qt/Api/qwebkitplatformplugin.h	2011-11-10 23:01:27 UTC (rev 99903)
@@ -30,8 +30,10 @@
 #include <QMediaPlayer>
 #endif
 #include <QtCore/QObject>
+#include <QtCore/QRect>
 #include <QtCore/QUrl>
 #include <QtGui/QColor>
+#include <QtGui/QFont>
 
 class QWebSelectData {
 public:
@@ -59,6 +61,8 @@
 
     virtual void show(const QWebSelectData&) = 0;
     virtual void hide() = 0;
+    virtual void setGeometry(const QRect&) = 0;
+    virtual void setFont(const QFont&) = 0;
 
 Q_SIGNALS:
     void selectItem(int index, bool allowMultiplySelections, bool shift);
@@ -176,7 +180,7 @@
 };
 
 QT_BEGIN_NAMESPACE
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.7");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.8");
 QT_END_NAMESPACE
 
 #endif // QWEBKITPLATFORMPLUGIN_H

Modified: trunk/Source/WebKit/qt/ChangeLog (99902 => 99903)


--- trunk/Source/WebKit/qt/ChangeLog	2011-11-10 22:59:46 UTC (rev 99902)
+++ trunk/Source/WebKit/qt/ChangeLog	2011-11-10 23:01:27 UTC (rev 99903)
@@ -1,3 +1,21 @@
+2011-11-03  Luiz Agostini  <[email protected]>
+
+        [Qt] Adding methods setGeometry and setFont to QWebSelectMethod class.
+        https://bugs.webkit.org/show_bug.cgi?id=71530
+
+        Reviewed by Simon Hausmann.
+
+        Adding methods setGeometry and setFont so that users of platform plugin may show the
+        popup menus in proper position and using proper font.
+
+        * Api/qwebkitplatformplugin.h:
+        * WebCoreSupport/PopupMenuQt.cpp:
+        (WebCore::PopupMenuQt::show):
+        * examples/platformplugin/WebPlugin.h:
+        (WebPopup::setGeometry):
+        (WebPopup::setFont):
+        * examples/platformplugin/qwebkitplatformplugin.h:
+
 2011-11-10  Alexis Menard  <[email protected]>
 
         [Qt] Merge QTouchWebView and QDesktopWebView into one class

Modified: trunk/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp (99902 => 99903)


--- trunk/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp	2011-11-10 22:59:46 UTC (rev 99902)
+++ trunk/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp	2011-11-10 23:01:27 UTC (rev 99903)
@@ -107,12 +107,10 @@
         connect(m_popup.get(), SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool)));
     }
 
-    if (QtFallbackWebPopup* fallback = qobject_cast<QtFallbackWebPopup*>(m_popup.get())) {
-        QRect geometry(rect);
-        geometry.moveTopLeft(view->contentsToWindow(rect.location()));
-        fallback->setGeometry(geometry);
-        fallback->setFont(m_popupClient->menuStyle().font().font());
-    }
+    QRect geometry(rect);
+    geometry.moveTopLeft(view->contentsToWindow(rect.location()));
+    m_popup->setGeometry(geometry);
+    m_popup->setFont(m_popupClient->menuStyle().font().font());
 
     m_selectData = adoptPtr(new SelectData(m_popupClient));
     m_popup->show(*m_selectData.get());

Modified: trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.h (99902 => 99903)


--- trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.h	2011-11-10 22:59:46 UTC (rev 99902)
+++ trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.h	2011-11-10 23:01:27 UTC (rev 99903)
@@ -72,6 +72,8 @@
 
     virtual void show(const QWebSelectData& data);
     virtual void hide();
+    virtual void setGeometry(const QRect&) { }
+    virtual void setFont(const QFont&) { }
 
 private slots:
     void popupClosed();

Modified: trunk/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h (99902 => 99903)


--- trunk/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h	2011-11-10 22:59:46 UTC (rev 99902)
+++ trunk/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h	2011-11-10 23:01:27 UTC (rev 99903)
@@ -30,8 +30,10 @@
 #include <QMediaPlayer>
 #endif
 #include <QtCore/QObject>
+#include <QtCore/QRect>
 #include <QtCore/QUrl>
 #include <QtGui/QColor>
+#include <QtGui/QFont>
 
 class QWebSelectData {
 public:
@@ -59,6 +61,8 @@
 
     virtual void show(const QWebSelectData&) = 0;
     virtual void hide() = 0;
+    virtual void setGeometry(const QRect&) = 0;
+    virtual void setFont(const QFont&) = 0;
 
 Q_SIGNALS:
     void selectItem(int index, bool allowMultiplySelections, bool shift);
@@ -176,7 +180,7 @@
 };
 
 QT_BEGIN_NAMESPACE
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.7");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.8");
 QT_END_NAMESPACE
 
 #endif // QWEBKITPLATFORMPLUGIN_H
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to