diff options
| author | Ben Murdoch <benm@google.com> | 2010-05-11 18:35:50 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2010-05-14 10:23:05 +0100 |
| commit | 21939df44de1705786c545cd1bf519d47250322d (patch) | |
| tree | ef56c310f5c0cdc379c2abb2e212308a3281ce20 /WebKit/qt/WebCoreSupport/PageClientQt.cpp | |
| parent | 4ff1d8891d520763f17675827154340c7c740f90 (diff) | |
| download | external_webkit-21939df44de1705786c545cd1bf519d47250322d.zip external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.gz external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.bz2 | |
Merge Webkit at r58956: Initial merge by Git.
Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228
Diffstat (limited to 'WebKit/qt/WebCoreSupport/PageClientQt.cpp')
| -rw-r--r-- | WebKit/qt/WebCoreSupport/PageClientQt.cpp | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp new file mode 100644 index 0000000..611bab7 --- /dev/null +++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "config.h" + +#include "PageClientQt.h" + +#if defined(Q_WS_X11) +#include <QX11Info> +#endif + +namespace WebCore { + +void PageClientQWidget::scroll(int dx, int dy, const QRect& rectToScroll) +{ + view->scroll(qreal(dx), qreal(dy), rectToScroll); +} + +void PageClientQWidget::update(const QRect & dirtyRect) +{ + view->update(dirtyRect); +} + +void PageClientQWidget::setInputMethodEnabled(bool enable) +{ + view->setAttribute(Qt::WA_InputMethodEnabled, enable); +} + +bool PageClientQWidget::inputMethodEnabled() const +{ + return view->testAttribute(Qt::WA_InputMethodEnabled); +} + +#if QT_VERSION >= 0x040600 +void PageClientQWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable) +{ + if (enable) + view->setInputMethodHints(view->inputMethodHints() | hint); + else + view->setInputMethodHints(view->inputMethodHints() & ~hint); +} +#endif + +#ifndef QT_NO_CURSOR +QCursor PageClientQWidget::cursor() const +{ + return view->cursor(); +} + +void PageClientQWidget::updateCursor(const QCursor& cursor) +{ + view->setCursor(cursor); +} +#endif + +QPalette PageClientQWidget::palette() const +{ + return view->palette(); +} + +int PageClientQWidget::screenNumber() const +{ +#if defined(Q_WS_X11) + return view->x11Info().screen(); +#endif + return 0; +} + +QWidget* PageClientQWidget::ownerWidget() const +{ + return view; +} + +QRect PageClientQWidget::geometryRelativeToOwnerWidget() const +{ + return view->geometry(); +} + +QObject* PageClientQWidget::pluginParent() const +{ + return view; +} + +QStyle* PageClientQWidget::style() const +{ + return view->style(); +} + +} |
