Changeset 63740 in webkit


Ignore:
Timestamp:
Jul 20, 2010 5:11:56 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-20 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>

[Qt] Add API to define device-width and height for use with the viewport meta tag
https://bugs.webkit.org/show_bug.cgi?id=42597

Reviewed by Antonio Gomes.

Add a new API for setting the deviceSize for use in conjunction with
out viewport meta tag API.

  • Api/qgraphicswebview.cpp: (QGraphicsWebView::setDeviceSize): (QGraphicsWebView::deviceSize):
  • Api/qgraphicswebview.h:
  • WebCoreSupport/PageClientQt.cpp: (WebCore::PageClientQGraphicsWidget::windowRect):
  • WebCoreSupport/PageClientQt.h: (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget):
Location:
trunk/WebKit/qt
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qgraphicswebview.cpp

    r61984 r63740  
    7474    QWebPage* page;
    7575    bool resizesToContents;
     76    QSize deviceSize;
    7677
    7778    // Just a convenience to avoid using page->client->overlay always
     
    550551
    551552/*!
     553    \property QGraphicsWebView::deviceSize
     554    \brief the size of the device using the web view
     555
     556    The device size is used by the DOM window object methods
     557    otherHeight(), otherWidth() as well as a page for the viewport
     558    meta tag attributes device-width and device-height.
     559*/
     560void QGraphicsWebView::setDeviceSize(const QSize& size)
     561{
     562    d->deviceSize = size;
     563}
     564
     565QSize QGraphicsWebView::deviceSize() const
     566{
     567    return d->deviceSize;
     568}
     569
     570/*!
    552571    \property QGraphicsWebView::zoomFactor
    553572    \brief the zoom factor for the view
  • trunk/WebKit/qt/Api/qgraphicswebview.h

    r56581 r63740  
    4242    Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
    4343    Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
     44    Q_PROPERTY(QSize deviceSize READ deviceSize WRITE setDeviceSize)
    4445
    4546    Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
     
    6566    void setZoomFactor(qreal);
    6667
     68    QSize deviceSize() const;
     69    void setDeviceSize(const QSize&);
     70
    6771    bool isModified() const;
    6872
    69     void load(const QUrl &url);
     73    void load(const QUrl& url);
    7074    void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray());
    7175
  • trunk/WebKit/qt/ChangeLog

    r63738 r63740  
     12010-07-20  Kenneth Rohde Christiansen  <kenneth.christiansen@openbossa.org>
     2
     3        [Qt] Add API to define device-width and height for use with the viewport meta tag
     4        https://bugs.webkit.org/show_bug.cgi?id=42597
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Add a new API for setting the deviceSize for use in conjunction with
     9        out viewport meta tag API.
     10
     11        * Api/qgraphicswebview.cpp:
     12        (QGraphicsWebView::setDeviceSize):
     13        (QGraphicsWebView::deviceSize):
     14        * Api/qgraphicswebview.h:
     15        * WebCoreSupport/PageClientQt.cpp:
     16        (WebCore::PageClientQGraphicsWidget::windowRect):
     17        * WebCoreSupport/PageClientQt.h:
     18        (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget):
     19
    1202010-07-20  Andreas Kling  <andreas.kling@nokia.com>
    221
  • trunk/WebKit/qt/WebCoreSupport/PageClientQt.cpp

    r61342 r63740  
    325325QRectF PageClientQGraphicsWidget::windowRect() const
    326326{
     327    if (!view->deviceSize().isEmpty())
     328        return QRectF(QRect(QPoint(0, 0), view->deviceSize()));
     329
    327330    if (!view->scene())
    328331        return QRectF();
  • trunk/WebKit/qt/WebCoreSupport/PageClientQt.h

    r61342 r63740  
    2727#include "QWebPageClient.h"
    2828#include "TiledBackingStore.h"
     29#include "qgraphicswebview.h"
    2930#include "qwebframe.h"
    3031#include "qwebframe_p.h"
    3132#include "qwebpage.h"
    3233#include "qwebpage_p.h"
    33 
    3434#include <QtCore/qmetaobject.h>
    3535#include <QtCore/qsharedpointer.h>
     
    4343#include <Settings.h>
    4444
    45 
    4645namespace WebCore {
    4746
     
    123122class PageClientQGraphicsWidget : public QWebPageClient {
    124123public:
    125     PageClientQGraphicsWidget(QGraphicsWidget* v, QWebPage* p)
     124    PageClientQGraphicsWidget(QGraphicsWebView* v, QWebPage* p)
    126125        : view(v)
    127126        , page(p)
     
    187186    virtual QRectF windowRect() const;
    188187
    189     QGraphicsWidget* view;
     188    QGraphicsWebView* view;
    190189    QWebPage* page;
    191190    bool viewResizesToContents;
Note: See TracChangeset for help on using the changeset viewer.