summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorWater-Team <water@pad.test.qt.nokia.com>2011-11-25 00:00:13 (GMT)
committerWater-Team <water@pad.test.qt.nokia.com>2011-11-25 00:00:13 (GMT)
commit6a63e71096c577144d646b637451ea812287ceb1 (patch)
tree98ae4bf3eabb81c7bbb8384cde97d4152223d8c3 /src/gui
parent366a6b941eecb9d5381d9513d591bdfcf5847425 (diff)
parent0e7c7f75b404c26b420cb174f062eda02846641f (diff)
downloadQt-6a63e71096c577144d646b637451ea812287ceb1.zip
Qt-6a63e71096c577144d646b637451ea812287ceb1.tar.gz
Qt-6a63e71096c577144d646b637451ea812287ceb1.tar.bz2
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp193
-rw-r--r--src/gui/kernel/qapplication_s60.cpp96
-rw-r--r--src/gui/kernel/qclipboard_s60.cpp3
-rw-r--r--src/gui/painting/painting.pri6
-rw-r--r--src/gui/painting/qgraphicssystemex_symbian.cpp2
-rw-r--r--src/gui/painting/qgraphicssystemhelper_symbian.cpp141
-rw-r--r--src/gui/painting/qgraphicssystemhelper_symbian.h82
8 files changed, 394 insertions, 131 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 90d47f9..b17d9c7 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -162,6 +162,8 @@ private:
void enableSymbianCcpuSupport();
void changeCBA(bool showCopyAndOrPaste);
void copyOrCutTextToClipboard(const char *operation);
+ void getScreenCoordinatesForFepX(TPoint& aLeftSideOfBaseLine, TInt& aHeight, TInt& aAscent,
+ TInt aDocumentPosition) const;
//From MEikCcpuEditor interface
public:
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index ed7411f..44e0df0 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -1465,40 +1465,49 @@ void QCoeFepInputContext::CancelFepInlineEdit()
m_pendingTransactionCancel = true;
- QList<QInputMethodEvent::Attribute> attributes;
- QInputMethodEvent event(QLatin1String(""), attributes);
- event.setCommitString(QLatin1String(""), 0, 0);
- m_preeditString.clear();
- m_inlinePosition = 0;
- sendEvent(event);
-
- // Sync with native side editor state. Native side can then do various operations
- // based on editor state, such as removing 'exact word bubble'.
- if (!m_pendingInputCapabilitiesChanged)
- ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState);
+ QT_TRY {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event(QLatin1String(""), attributes);
+ event.setCommitString(QLatin1String(""), 0, 0);
+ m_preeditString.clear();
+ m_inlinePosition = 0;
+ sendEvent(event);
+
+ // Sync with native side editor state. Native side can then do various operations
+ // based on editor state, such as removing 'exact word bubble'.
+ if (!m_pendingInputCapabilitiesChanged)
+ ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState);
+ } QT_CATCH(const std::exception&) {
+ m_preeditString.clear();
+ m_inlinePosition = 0;
+ }
m_pendingTransactionCancel = false;
}
TInt QCoeFepInputContext::DocumentLengthForFep() const
{
- QWidget *w = focusWidget();
- if (!w)
- return 0;
+ QT_TRY {
+ QWidget *w = focusWidget();
+ if (!w)
+ return 0;
- QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText);
+ QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText);
- int size = variant.value<QString>().size() + m_preeditString.size();
+ int size = variant.value<QString>().size() + m_preeditString.size();
- // To fix an issue with backspaces not being generated if document size is zero,
- // fake document length to be at least one always, except when dealing with
- // hidden text widgets, where this faking would generate extra asterisk. Since the
- // primary use of hidden text widgets is password fields, they are unlikely to
- // support multiple lines anyway.
- if (size == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText))
- size = 1;
+ // To fix an issue with backspaces not being generated if document size is zero,
+ // fake document length to be at least one always, except when dealing with
+ // hidden text widgets, where this faking would generate extra asterisk. Since the
+ // primary use of hidden text widgets is password fields, they are unlikely to
+ // support multiple lines anyway.
+ if (size == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText))
+ size = 1;
- return size;
+ return size;
+ } QT_CATCH(const std::exception&) {
+ return 0;
+ }
}
TInt QCoeFepInputContext::DocumentMaximumLengthForFep() const
@@ -1540,42 +1549,46 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur
void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const
{
- QWidget *w = focusWidget();
- if (!w) {
- aCursorSelection.SetSelection(0,0);
- return;
- }
+ QT_TRY {
+ QWidget *w = focusWidget();
+ if (!w) {
+ aCursorSelection.SetSelection(0,0);
+ return;
+ }
- int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size();
- int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size();
+ int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size();
+ int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size();
- // If the position is stored, use that value, so that word replacement from proposed word
- // lists are added to the correct position.
- if (m_cachedCursorAndAnchorPosition != -1) {
- cursor = m_cachedCursorAndAnchorPosition;
- anchor = m_cachedCursorAndAnchorPosition;
- }
- QString text = w->inputMethodQuery(Qt::ImSurroundingText).value<QString>();
- int combinedSize = text.size() + m_preeditString.size();
- if (combinedSize < anchor || combinedSize < cursor) {
- // ### TODO! FIXME! QTBUG-5050
- // This is a hack to prevent crashing in 4.6 with QLineEdits that use input masks.
- // The root problem is that cursor position is relative to displayed text instead of the
- // actual text we get.
- //
- // To properly fix this we would need to know the displayText of QLineEdits instead
- // of just the text, which on itself should be a trivial change. The difficulties start
- // when we need to commit the changes back to the QLineEdit, which would have to be somehow
- // able to handle displayText, too.
- //
- // Until properly fixed, the cursor and anchor positions will not reflect correct positions
- // for masked QLineEdits, unless all the masked positions are filled in order so that
- // cursor position relative to the displayed text matches position relative to actual text.
- aCursorSelection.iAnchorPos = combinedSize;
- aCursorSelection.iCursorPos = combinedSize;
- } else {
- aCursorSelection.iAnchorPos = anchor;
- aCursorSelection.iCursorPos = cursor;
+ // If the position is stored, use that value, so that word replacement from proposed word
+ // lists are added to the correct position.
+ if (m_cachedCursorAndAnchorPosition != -1) {
+ cursor = m_cachedCursorAndAnchorPosition;
+ anchor = m_cachedCursorAndAnchorPosition;
+ }
+ QString text = w->inputMethodQuery(Qt::ImSurroundingText).value<QString>();
+ int combinedSize = text.size() + m_preeditString.size();
+ if (combinedSize < anchor || combinedSize < cursor) {
+ // ### TODO! FIXME! QTBUG-5050
+ // This is a hack to prevent crashing in 4.6 with QLineEdits that use input masks.
+ // The root problem is that cursor position is relative to displayed text instead of the
+ // actual text we get.
+ //
+ // To properly fix this we would need to know the displayText of QLineEdits instead
+ // of just the text, which on itself should be a trivial change. The difficulties start
+ // when we need to commit the changes back to the QLineEdit, which would have to be somehow
+ // able to handle displayText, too.
+ //
+ // Until properly fixed, the cursor and anchor positions will not reflect correct positions
+ // for masked QLineEdits, unless all the masked positions are filled in order so that
+ // cursor position relative to the displayed text matches position relative to actual text.
+ aCursorSelection.iAnchorPos = combinedSize;
+ aCursorSelection.iCursorPos = combinedSize;
+ } else {
+ aCursorSelection.iAnchorPos = anchor;
+ aCursorSelection.iCursorPos = cursor;
+ }
+ } QT_CATCH(const std::exception&) {
+ aCursorSelection.SetSelection(0,0);
}
}
@@ -1618,6 +1631,12 @@ void QCoeFepInputContext::GetFormatForFep(TCharFormat& aFormat, TInt /* aDocumen
}
void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight,
+ TInt& aAscent, TInt aDocumentPosition) const
+{
+ QT_TRYCATCH_LEAVING(getScreenCoordinatesForFepX(aLeftSideOfBaseLine, aHeight, aAscent, aDocumentPosition));
+}
+
+void QCoeFepInputContext::getScreenCoordinatesForFepX(TPoint& aLeftSideOfBaseLine, TInt& aHeight,
TInt& aAscent, TInt /* aDocumentPosition */) const
{
QWidget *w = focusWidget();
@@ -1774,36 +1793,40 @@ TBool QCoeFepInputContext::CcpuIsFocused() const
TBool QCoeFepInputContext::CcpuCanCut() const
{
- bool retval = false;
- if (m_inDestruction)
- return retval;
- QWidget *w = focusWidget();
- QObject *focusObject = 0;
- if (!w) {
- w = m_lastFocusedEditor;
- focusObject = m_lastFocusedObject;
- } else {
- w = getQWidgetFromQGraphicsView(w, &focusObject);
- }
- if (w) {
- QRect microFocus = w->inputMethodQuery(Qt::ImMicroFocus).toRect();
- if (microFocus.isNull()) {
- // For some reason, the editor does not have microfocus. Most probably,
- // it is due to using native fullscreen editing mode with QML apps.
- // Try accessing "selectedText" directly.
- QObject *invokeTarget = w;
- if (focusObject)
- invokeTarget = focusObject;
-
- QString selectedText = invokeTarget->property("selectedText").toString();
- retval = !selectedText.isNull();
+ QT_TRY {
+ bool retval = false;
+ if (m_inDestruction)
+ return retval;
+ QWidget *w = focusWidget();
+ QObject *focusObject = 0;
+ if (!w) {
+ w = m_lastFocusedEditor;
+ focusObject = m_lastFocusedObject;
} else {
- int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
- int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt();
- retval = cursor != anchor;
+ w = getQWidgetFromQGraphicsView(w, &focusObject);
}
+ if (w) {
+ QRect microFocus = w->inputMethodQuery(Qt::ImMicroFocus).toRect();
+ if (microFocus.isNull()) {
+ // For some reason, the editor does not have microfocus. Most probably,
+ // it is due to using native fullscreen editing mode with QML apps.
+ // Try accessing "selectedText" directly.
+ QObject *invokeTarget = w;
+ if (focusObject)
+ invokeTarget = focusObject;
+
+ QString selectedText = invokeTarget->property("selectedText").toString();
+ retval = !selectedText.isNull();
+ } else {
+ int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
+ int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt();
+ retval = cursor != anchor;
+ }
+ }
+ return retval;
+ } QT_CATCH(const std::exception&) {
+ return EFalse;
}
- return retval;
}
void QCoeFepInputContext::CcpuCutL()
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index fe239f5..bb84491 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1534,53 +1534,57 @@ bool QSymbianControl::hasFocusedAndVisibleChild(QWidget *parentWidget)
void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
{
- if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
- return;
+ QT_TRY {
+ if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
+ return;
#ifdef Q_WS_S60
- if (S60->splitViewLastWidget)
- return;
+ if (S60->splitViewLastWidget)
+ return;
#endif
- // Popups never get focused, but still receive the FocusChanged when they are hidden.
- if (QApplicationPrivate::popupWidgets != 0
- || (qwidget->windowType() & Qt::Popup) == Qt::Popup)
- return;
-
- if (IsFocused() && IsVisible()) {
- if (m_symbianPopupIsOpen) {
- QWidget *fw = QApplication::focusWidget();
- if (fw) {
- QFocusEvent event(QEvent::FocusIn, Qt::PopupFocusReason);
- QCoreApplication::sendEvent(fw, &event);
- }
- m_symbianPopupIsOpen = false;
- }
+ // Popups never get focused, but still receive the FocusChanged when they are hidden.
+ if (QApplicationPrivate::popupWidgets != 0
+ || (qwidget->windowType() & Qt::Popup) == Qt::Popup)
+ return;
- QApplication::setActiveWindow(qwidget->window());
- qwidget->d_func()->setWindowIcon_sys(true);
- qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle());
-#ifdef Q_WS_S60
- if (qwidget->isWindow())
- S60->setRecursiveDecorationsVisibility(qwidget, qwidget->windowState());
-#endif
- } else {
- QWidget *parentWindow = qwidget->window();
- if (QApplication::activeWindow() == parentWindow && !hasFocusedAndVisibleChild(parentWindow)) {
- if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) {
+ if (IsFocused() && IsVisible()) {
+ if (m_symbianPopupIsOpen) {
QWidget *fw = QApplication::focusWidget();
if (fw) {
- QFocusEvent event(QEvent::FocusOut, Qt::PopupFocusReason);
+ QFocusEvent event(QEvent::FocusIn, Qt::PopupFocusReason);
QCoreApplication::sendEvent(fw, &event);
}
- m_symbianPopupIsOpen = true;
- return;
+ m_symbianPopupIsOpen = false;
}
- QApplication::setActiveWindow(0);
+ QApplication::setActiveWindow(qwidget->window());
+ qwidget->d_func()->setWindowIcon_sys(true);
+ qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle());
+#ifdef Q_WS_S60
+ if (qwidget->isWindow())
+ S60->setRecursiveDecorationsVisibility(qwidget, qwidget->windowState());
+#endif
+ } else {
+ QWidget *parentWindow = qwidget->window();
+ if (QApplication::activeWindow() == parentWindow && !hasFocusedAndVisibleChild(parentWindow)) {
+ if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) {
+ QWidget *fw = QApplication::focusWidget();
+ if (fw) {
+ QFocusEvent event(QEvent::FocusOut, Qt::PopupFocusReason);
+ QCoreApplication::sendEvent(fw, &event);
+ }
+ m_symbianPopupIsOpen = true;
+ return;
+ }
+
+ QApplication::setActiveWindow(0);
+ }
}
+ // else { We don't touch the active window unless we were explicitly activated or deactivated }
+ } QT_CATCH(const std::exception&) {
+ // ignore errors
}
- // else { We don't touch the active window unless we were explicitly activated or deactivated }
}
void QSymbianControl::handleClientAreaChange()
@@ -2377,19 +2381,25 @@ int QApplication::symbianProcessEvent(const QSymbianEvent *event)
QScopedLoopLevelCounter counter(d->threadData);
- if (d->eventDispatcher->filterEvent(const_cast<QSymbianEvent *>(event)))
- return 1;
+ QT_TRY {
+ if (d->eventDispatcher->filterEvent(const_cast<QSymbianEvent *>(event)))
+ return 1;
+
+ QWidget *w = qApp ? qApp->focusWidget() : 0;
+ if (w) {
+ QInputContext *ic = w->inputContext();
+ if (ic && ic->symbianFilterEvent(w, event))
+ return 1;
+ }
- QWidget *w = qApp ? qApp->focusWidget() : 0;
- if (w) {
- QInputContext *ic = w->inputContext();
- if (ic && ic->symbianFilterEvent(w, event))
+ if (symbianEventFilter(event))
return 1;
+ } QT_CATCH(const std::exception& ex) {
+ // don't allow an exception to stop exit command handling
+ if (event->type() != QSymbianEvent::CommandEvent || event->command() != EEikCmdExit)
+ QT_RETHROW;
}
- if (symbianEventFilter(event))
- return 1;
-
switch (event->type()) {
case QSymbianEvent::WindowServerEvent:
return d->symbianProcessWsEvent(event);
diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp
index f5314bd..dc812fb 100644
--- a/src/gui/kernel/qclipboard_s60.cpp
+++ b/src/gui/kernel/qclipboard_s60.cpp
@@ -187,6 +187,7 @@ void readSymbianStoreLX(QMimeData* aData, CClipboard* clipboard)
QString string = qt_TDesC2QString(buf);
CleanupStack::PopAndDestroy(text);
+ aData->clear();
aData->setText(string);
}
@@ -196,6 +197,8 @@ void readFromStreamLX(QMimeData* aData,RReadStream& aStream)
// dependencies between cleanup styles, and no cleanup stack dependencies on stacked objects.
TCardinality mimeTypeCount;
aStream >> mimeTypeCount;
+ if (mimeTypeCount > 0)
+ aData->clear();
for (int i = 0; i< mimeTypeCount;i++)
{
// mime type
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 27b1bf2..d4f904b 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -200,10 +200,12 @@ symbian {
SOURCES += \
painting/qpaintengine_raster_symbian.cpp \
painting/qregion_s60.cpp \
- painting/qcolormap_s60.cpp
+ painting/qcolormap_s60.cpp \
+ painting/qgraphicssystemhelper_symbian.cpp
HEADERS += \
- painting/qpaintengine_raster_symbian_p.h
+ painting/qpaintengine_raster_symbian_p.h \
+ painting/qgraphicssystemhelper_symbian.h
}
x11|embedded|qpa {
diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp
index 5a182ff..5bfd5a8 100644
--- a/src/gui/painting/qgraphicssystemex_symbian.cpp
+++ b/src/gui/painting/qgraphicssystemex_symbian.cpp
@@ -74,7 +74,7 @@ bool QSymbianGraphicsSystemEx::hasBCM2727()
#if 1
// Hacky but fast ~0ms.
const char* vendor = eglQueryString(display, EGL_VENDOR);
- if (strstr(vendor, "Broadcom")) {
+ if (vendor && strstr(vendor, "Broadcom")) {
const TUid KIvePropertyCat = {0x2726beef};
enum TIvePropertyChipType {
EVCBCM2727B1 = 0x00000000,
diff --git a/src/gui/painting/qgraphicssystemhelper_symbian.cpp b/src/gui/painting/qgraphicssystemhelper_symbian.cpp
new file mode 100644
index 0000000..eb70247
--- /dev/null
+++ b/src/gui/painting/qgraphicssystemhelper_symbian.cpp
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgraphicssystemhelper_symbian.h"
+#include "qt_s60_p.h"
+#include "qwidget_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \enum QSymbianGraphicsSystemHelper::NativePaintMode
+
+ This enum controls the way in which QWidget paints content from the Qt
+ backing store into the corresponding native window surface.
+
+ \value NativePaintModeDefault Default painting behaviour.
+ \value NativePaintModeZeroFill Ignore contents of backing store, and
+ fill the window surface region with zeroes.
+ \value NativePaintModeWriteAlpha By default, alpha values are only copied
+ from the backing store into the window surface if the top-level widget
+ has the Qt::WA_TranslucentBackground attribute. If this mode is set,
+ alpha values are copied regardless of the value of that attribute.
+ \value NativePaintModeDisable Do not paint anything into the native window
+ surface.
+ */
+
+/*!
+ \class QSymbianGraphicsSystemHelper
+ \ingroup painting
+
+ \brief QSymbianGraphicsSystemHelper defines functions required by
+ QtMultimediaKit in order to enable video rendering.
+
+ This class is not intended for use by applications.
+*/
+
+/*!
+ Specify whether native focus change events should be ignored by the widget.
+*/
+
+void QSymbianGraphicsSystemHelper::setIgnoreFocusChanged(QWidget *widget, bool value)
+{
+ static_cast<QSymbianControl *>(widget->winId())->setIgnoreFocusChanged(value);
+}
+
+/*!
+ Set the native paint mode to the specified \a mode.
+*/
+
+void QSymbianGraphicsSystemHelper::setNativePaintMode(QWidget *widget, NativePaintMode mode)
+{
+ QWidgetPrivate *widgetPrivate = qt_widget_private(widget->window());
+ widgetPrivate->createExtra();
+ QWExtra::NativePaintMode widgetMode = QWExtra::Default;
+ switch (mode) {
+ case NativePaintModeDefault:
+ break;
+ case NativePaintModeZeroFill:
+ widgetMode = QWExtra::ZeroFill;
+ break;
+ case NativePaintModeWriteAlpha:
+ widgetMode = QWExtra::BlitWriteAlpha;
+ break;
+ case NativePaintModeDisable:
+ widgetMode = QWExtra::Disable;
+ break;
+ }
+ widgetPrivate->extraData()->nativePaintMode = widgetMode;
+}
+
+/*!
+ Set the native paint mode to the specified \a mode.
+*/
+
+void QSymbianGraphicsSystemHelper::setNativePaintMode(WId wid, NativePaintMode mode)
+{
+ QWidget *window = static_cast<QSymbianControl *>(wid)->widget()->window();
+ setNativePaintMode(window, mode);
+}
+
+/*!
+ Specify whether the widget should receive receive native paint events.
+
+ If enabled, the QWidget::beginNativePaintEvent slot is called before
+ content from the backing store is written into the native window
+ surface, and QWidget::endNativePaintEvent is called once writing to
+ the native window surface is complete.
+
+ This function is intended for use by QWidget clients such as video
+ widgets, which wish to use Direct Screen Access to write into the
+ native window surface. Such clients should stop their DSA session on
+ receipt of QWidget::beginNativePaintEvent, and re-start it on receipt of
+ QWidget::endNativePaintEvent.
+*/
+
+void QSymbianGraphicsSystemHelper::setReceiveNativePaintEvents(QWidget *widget, bool value)
+{
+ QWidgetPrivate *widgetPrivate = qt_widget_private(widget);
+ widgetPrivate->createExtra();
+ widgetPrivate->extraData()->receiveNativePaintEvents = value;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystemhelper_symbian.h b/src/gui/painting/qgraphicssystemhelper_symbian.h
new file mode 100644
index 0000000..b74144e
--- /dev/null
+++ b/src/gui/painting/qgraphicssystemhelper_symbian.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSYMBIANGRAPHICSSYSTEMHELPER_H
+#define QSYMBIANGRAPHICSSYSTEMHELPER_H
+
+#include <QtCore/qglobal.h>
+
+#ifndef Q_OS_SYMBIAN
+#error "This header file can only be included when building for Symbian"
+#endif
+
+#include <QtGui/qwindowdefs.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QWidget;
+
+class Q_GUI_EXPORT QSymbianGraphicsSystemHelper
+{
+public:
+ enum NativePaintMode {
+ NativePaintModeDefault,
+ NativePaintModeZeroFill,
+ NativePaintModeWriteAlpha,
+ NativePaintModeDisable
+ };
+
+ static void setIgnoreFocusChanged(QWidget *widget, bool value);
+ static void setNativePaintMode(QWidget *widget, NativePaintMode mode);
+ static void setNativePaintMode(WId wid, NativePaintMode mode);
+ static void setReceiveNativePaintEvents(QWidget *widget, bool value);
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QSYMBIANGRAPHICSSYSTEMHELPER_H
+