Changeset 58038 in webkit


Ignore:
Timestamp:
Apr 21, 2010 6:56:27 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-21 Jesus Sanchez-Palencia <jesus@webkit.org>

Reviewed by Kenneth Rohde Christiansen.

Add PageClientQt files.

[Qt] PageClientQt specific implementation for QWidget
https://bugs.webkit.org/show_bug.cgi?id=37858

  • WebCore.pro:

2010-04-21 Jesus Sanchez-Palencia <jesus@webkit.org>

Reviewed by Kenneth Rohde Christiansen.

Add PageClientQWidget implementation based on the old
QWebPageWidgetClient to PageClientQt files. Also fix
QWebPage::setView() to use PageClientQWidget.

[Qt] PageClientQt specific implementation for QWidget
https://bugs.webkit.org/show_bug.cgi?id=37858

  • Api/qwebpage.cpp: (QWebPage::setView):
  • WebCoreSupport/PageClientQt.cpp: Added. (WebCore::PageClientQWidget::scroll): (WebCore::PageClientQWidget::update): (WebCore::PageClientQWidget::setInputMethodEnabled): (WebCore::PageClientQWidget::inputMethodEnabled): (WebCore::PageClientQWidget::setInputMethodHint): (WebCore::PageClientQWidget::cursor): (WebCore::PageClientQWidget::updateCursor): (WebCore::PageClientQWidget::palette): (WebCore::PageClientQWidget::screenNumber): (WebCore::PageClientQWidget::ownerWidget): (WebCore::PageClientQWidget::geometryRelativeToOwnerWidget): (WebCore::PageClientQWidget::pluginParent): (WebCore::PageClientQWidget::style):
  • WebCoreSupport/PageClientQt.h: Added. (WebCore::PageClientQWidget::PageClientQWidget): (WebCore::PageClientQWidget::isQWidgetClient):
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r58037 r58038  
     12010-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
    1122010-04-21  Diego Escalante Urrelo  <descalante@igalia.com>
    213
  • trunk/WebCore/WebCore.pro

    r58006 r58038  
    20322032    $$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
    20332033    $$PWD/../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
     2034    $$PWD/../WebKit/qt/WebCoreSupport/PageClientQt.h \
    20342035    $$PWD/platform/network/qt/DnsPrefetchHelper.h
    20352036
     
    21192120    ../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
    21202121    ../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
     2122    ../WebKit/qt/WebCoreSupport/PageClientQt.cpp \
    21212123    ../WebKit/qt/Api/qwebframe.cpp \
    21222124    ../WebKit/qt/Api/qgraphicswebview.cpp \
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r57793 r58038  
    8282#include "PageGroup.h"
    8383#include "NotificationPresenterClientQt.h"
    84 #include "QWebPageClient.h"
     84#include "PageClientQt.h"
    8585#include "WorkerThread.h"
    8686
     
    131131
    132132bool 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 >= 0x040600
    149     virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
    150 #endif
    151 
    152 #ifndef QT_NO_CURSOR
    153     virtual QCursor cursor() const;
    154     virtual void updateCursor(const QCursor& cursor);
    155 #endif
    156 
    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() const
    185 {
    186     return view->testAttribute(Qt::WA_InputMethodEnabled);
    187 }
    188 
    189 #if QT_VERSION >= 0x040600
    190 void QWebPageWidgetClient::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
    191 {
    192     if (enable)
    193         view->setInputMethodHints(view->inputMethodHints() | hint);
    194     else
    195         view->setInputMethodHints(view->inputMethodHints() & ~hint);
    196 }
    197 #endif
    198 #ifndef QT_NO_CURSOR
    199 QCursor QWebPageWidgetClient::cursor() const
    200 {
    201     return view->cursor();
    202 }
    203 
    204 void QWebPageWidgetClient::updateCursor(const QCursor& cursor)
    205 {
    206     view->setCursor(cursor);
    207 }
    208 #endif
    209 
    210 QPalette QWebPageWidgetClient::palette() const
    211 {
    212     return view->palette();
    213 }
    214 
    215 int QWebPageWidgetClient::screenNumber() const
    216 {
    217 #if defined(Q_WS_X11)
    218     return view->x11Info().screen();
    219 #endif
    220     return 0;
    221 }
    222 
    223 QWidget* QWebPageWidgetClient::ownerWidget() const
    224 {
    225     return view;
    226 }
    227 
    228 QRect QWebPageWidgetClient::geometryRelativeToOwnerWidget() const
    229 {
    230     return view->geometry();
    231 }
    232 
    233 QObject* QWebPageWidgetClient::pluginParent() const
    234 {
    235     return view;
    236 }
    237 
    238 QStyle* QWebPageWidgetClient::style() const
    239 {
    240     return view->style();
    241 }
    242133
    243134// Lookup table mapping QWebPage::WebActions to the associated Editor commands
     
    18551746    if (d->client) {
    18561747        if (d->client->isQWidgetClient())
    1857             static_cast<QWebPageWidgetClient*>(d->client)->view = view;
     1748            static_cast<PageClientQWidget*>(d->client)->view = view;
    18581749        return;
    18591750    }
    18601751
    18611752    if (view)
    1862         d->client = new QWebPageWidgetClient(view);
     1753        d->client = new PageClientQWidget(view);
    18631754}
    18641755
  • trunk/WebKit/qt/ChangeLog

    r57986 r58038  
     12010-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
    1322010-04-21  Jakub Wieczorek  <jwieczorek@webkit.org>
    233
Note: See TracChangeset for help on using the changeset viewer.