Changeset 58038 in webkit
- Timestamp:
- Apr 21, 2010 6:56:27 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r58037 r58038 1 2010-04-21 Jesus Sanchez-Palencia <jesus@webkit.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 Add PageClientQt files. 6 7 [Qt] PageClientQt specific implementation for QWidget 8 https://bugs.webkit.org/show_bug.cgi?id=37858 9 10 * WebCore.pro: 11 1 12 2010-04-21 Diego Escalante Urrelo <descalante@igalia.com> 2 13 -
trunk/WebCore/WebCore.pro
r58006 r58038 2032 2032 $$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \ 2033 2033 $$PWD/../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \ 2034 $$PWD/../WebKit/qt/WebCoreSupport/PageClientQt.h \ 2034 2035 $$PWD/platform/network/qt/DnsPrefetchHelper.h 2035 2036 … … 2119 2120 ../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \ 2120 2121 ../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \ 2122 ../WebKit/qt/WebCoreSupport/PageClientQt.cpp \ 2121 2123 ../WebKit/qt/Api/qwebframe.cpp \ 2122 2124 ../WebKit/qt/Api/qgraphicswebview.cpp \ -
trunk/WebKit/qt/Api/qwebpage.cpp
r57793 r58038 82 82 #include "PageGroup.h" 83 83 #include "NotificationPresenterClientQt.h" 84 #include " QWebPageClient.h"84 #include "PageClientQt.h" 85 85 #include "WorkerThread.h" 86 86 … … 131 131 132 132 bool QWebPagePrivate::drtRun = false; 133 134 class QWebPageWidgetClient : public QWebPageClient {135 public:136 QWebPageWidgetClient(QWidget* view)137 : view(view)138 {139 Q_ASSERT(view);140 }141 142 virtual bool isQWidgetClient() const { return true; }143 144 virtual void scroll(int dx, int dy, const QRect&);145 virtual void update(const QRect& dirtyRect);146 virtual void setInputMethodEnabled(bool enable);147 virtual bool inputMethodEnabled() const;148 #if QT_VERSION >= 0x040600149 virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);150 #endif151 152 #ifndef QT_NO_CURSOR153 virtual QCursor cursor() const;154 virtual void updateCursor(const QCursor& cursor);155 #endif156 157 virtual QPalette palette() const;158 virtual int screenNumber() const;159 virtual QWidget* ownerWidget() const;160 virtual QRect geometryRelativeToOwnerWidget() const;161 162 virtual QObject* pluginParent() const;163 164 virtual QStyle* style() const;165 166 QWidget* view;167 };168 169 void QWebPageWidgetClient::scroll(int dx, int dy, const QRect& rectToScroll)170 {171 view->scroll(qreal(dx), qreal(dy), rectToScroll);172 }173 174 void QWebPageWidgetClient::update(const QRect & dirtyRect)175 {176 view->update(dirtyRect);177 }178 179 void QWebPageWidgetClient::setInputMethodEnabled(bool enable)180 {181 view->setAttribute(Qt::WA_InputMethodEnabled, enable);182 }183 184 bool QWebPageWidgetClient::inputMethodEnabled() const185 {186 return view->testAttribute(Qt::WA_InputMethodEnabled);187 }188 189 #if QT_VERSION >= 0x040600190 void QWebPageWidgetClient::setInputMethodHint(Qt::InputMethodHint hint, bool enable)191 {192 if (enable)193 view->setInputMethodHints(view->inputMethodHints() | hint);194 else195 view->setInputMethodHints(view->inputMethodHints() & ~hint);196 }197 #endif198 #ifndef QT_NO_CURSOR199 QCursor QWebPageWidgetClient::cursor() const200 {201 return view->cursor();202 }203 204 void QWebPageWidgetClient::updateCursor(const QCursor& cursor)205 {206 view->setCursor(cursor);207 }208 #endif209 210 QPalette QWebPageWidgetClient::palette() const211 {212 return view->palette();213 }214 215 int QWebPageWidgetClient::screenNumber() const216 {217 #if defined(Q_WS_X11)218 return view->x11Info().screen();219 #endif220 return 0;221 }222 223 QWidget* QWebPageWidgetClient::ownerWidget() const224 {225 return view;226 }227 228 QRect QWebPageWidgetClient::geometryRelativeToOwnerWidget() const229 {230 return view->geometry();231 }232 233 QObject* QWebPageWidgetClient::pluginParent() const234 {235 return view;236 }237 238 QStyle* QWebPageWidgetClient::style() const239 {240 return view->style();241 }242 133 243 134 // Lookup table mapping QWebPage::WebActions to the associated Editor commands … … 1855 1746 if (d->client) { 1856 1747 if (d->client->isQWidgetClient()) 1857 static_cast< QWebPageWidgetClient*>(d->client)->view = view;1748 static_cast<PageClientQWidget*>(d->client)->view = view; 1858 1749 return; 1859 1750 } 1860 1751 1861 1752 if (view) 1862 d->client = new QWebPageWidgetClient(view);1753 d->client = new PageClientQWidget(view); 1863 1754 } 1864 1755 -
trunk/WebKit/qt/ChangeLog
r57986 r58038 1 2010-04-21 Jesus Sanchez-Palencia <jesus@webkit.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 Add PageClientQWidget implementation based on the old 6 QWebPageWidgetClient to PageClientQt files. Also fix 7 QWebPage::setView() to use PageClientQWidget. 8 9 [Qt] PageClientQt specific implementation for QWidget 10 https://bugs.webkit.org/show_bug.cgi?id=37858 11 12 * Api/qwebpage.cpp: 13 (QWebPage::setView): 14 * WebCoreSupport/PageClientQt.cpp: Added. 15 (WebCore::PageClientQWidget::scroll): 16 (WebCore::PageClientQWidget::update): 17 (WebCore::PageClientQWidget::setInputMethodEnabled): 18 (WebCore::PageClientQWidget::inputMethodEnabled): 19 (WebCore::PageClientQWidget::setInputMethodHint): 20 (WebCore::PageClientQWidget::cursor): 21 (WebCore::PageClientQWidget::updateCursor): 22 (WebCore::PageClientQWidget::palette): 23 (WebCore::PageClientQWidget::screenNumber): 24 (WebCore::PageClientQWidget::ownerWidget): 25 (WebCore::PageClientQWidget::geometryRelativeToOwnerWidget): 26 (WebCore::PageClientQWidget::pluginParent): 27 (WebCore::PageClientQWidget::style): 28 * WebCoreSupport/PageClientQt.h: Added. 29 (WebCore::PageClientQWidget::PageClientQWidget): 30 (WebCore::PageClientQWidget::isQWidgetClient): 31 1 32 2010-04-21 Jakub Wieczorek <jwieczorek@webkit.org> 2 33
Note: See TracChangeset
for help on using the changeset viewer.