summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-10-08 06:14:43 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-10-08 06:14:43 (GMT)
commit3f0eb0416205600b97a0504006d7fbb09a10e035 (patch)
tree21fec3832a755c44d40c9ad1261b749747be7fe0 /src
parent11536f150887266b6a6f5cf00b22f9d1fcc1aaeb (diff)
parent1ebf63580152cba99c54e0241633145b6d7927e3 (diff)
downloadQt-3f0eb0416205600b97a0504006d7fbb09a10e035.zip
Qt-3f0eb0416205600b97a0504006d7fbb09a10e035.tar.gz
Qt-3f0eb0416205600b97a0504006d7fbb09a10e035.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp13
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h2
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp27
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject.cpp25
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject_p.h19
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp76
-rw-r--r--src/gui/image/qpixmap_x11_p.h1
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm5
-rw-r--r--src/gui/kernel/qt_s60_p.h9
-rw-r--r--src/gui/kernel/qwidget_s60.cpp28
-rw-r--r--src/gui/painting/qcups_p.h1
-rw-r--r--src/gui/s60framework/qs60mainapplication.cpp5
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp28
-rw-r--r--src/gui/s60framework/s60framework.pri18
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp2
-rw-r--r--src/plugins/graphicssystems/meego/qmeegoextensions.cpp32
-rw-r--r--src/plugins/graphicssystems/meego/qmeegoextensions.h15
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp203
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.h21
-rw-r--r--src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp30
-rw-r--r--src/plugins/graphicssystems/meego/qmeegopixmapdata.h1
-rw-r--r--src/s60installs/s60installs.pro17
-rw-r--r--src/s60main/s60main.rsg3
24 files changed, 490 insertions, 93 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index b06e2f7..c3bac2d 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -113,6 +113,7 @@ void QDeclarativeImageBase::setSourceSize(const QSize& size)
return;
d->sourcesize = size;
+ d->explicitSourceSize = true;
emit sourceSizeChanged();
if (isComponentComplete())
load();
@@ -121,7 +122,10 @@ void QDeclarativeImageBase::setSourceSize(const QSize& size)
QSize QDeclarativeImageBase::sourceSize() const
{
Q_D(const QDeclarativeImageBase);
- return d->sourcesize.isValid() ? d->sourcesize : QSize(implicitWidth(),implicitHeight());
+
+ int width = d->sourcesize.width();
+ int height = d->sourcesize.height();
+ return QSize(width != -1 ? width : implicitWidth(), height != -1 ? height : implicitHeight());
}
void QDeclarativeImageBase::load()
@@ -139,7 +143,7 @@ void QDeclarativeImageBase::load()
pixmapChange();
update();
} else {
- d->pix.load(qmlEngine(this), d->url, d->sourcesize, d->async);
+ d->pix.load(qmlEngine(this), d->url, d->explicitSourceSize ? sourceSize() : QSize(), d->async);
if (d->pix.isLoading()) {
d->progress = 0.0;
@@ -184,11 +188,8 @@ void QDeclarativeImageBase::requestFinished()
setImplicitWidth(d->pix.width());
setImplicitHeight(d->pix.height());
- if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height()) {
- d->sourcesize.setWidth(d->pix.width());
- d->sourcesize.setHeight(d->pix.height());
+ if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height())
emit sourceSizeChanged();
- }
if (d->status != oldStatus)
emit statusChanged(d->status);
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h
index aee8b28..3d23ba9 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h
@@ -69,6 +69,7 @@ public:
QDeclarativeImageBasePrivate()
: status(QDeclarativeImageBase::Null),
progress(0.0),
+ explicitSourceSize(false),
async(false)
{
QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents;
@@ -79,6 +80,7 @@ public:
QUrl url;
qreal progress;
QSize sourcesize;
+ bool explicitSourceSize : 1;
bool async : 1;
};
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 7a29f24..74bc5bd 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -2565,8 +2565,8 @@ bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder,
QStringList alias = astNodeToStringList(node);
- if (alias.count() != 1 && alias.count() != 2)
- COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. An alias reference must be specified as <id> or <id>.<property>"));
+ if (alias.count() < 1 || alias.count() > 3)
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property>"));
if (!compileState.ids.contains(alias.at(0)))
COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. Unable to find id \"%1\"").arg(alias.at(0)));
@@ -2578,11 +2578,14 @@ bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder,
int propIdx = -1;
int flags = 0;
bool writable = false;
- if (alias.count() == 2) {
+ if (alias.count() == 2 || alias.count() == 3) {
propIdx = idObject->metaObject()->indexOfProperty(alias.at(1).toUtf8().constData());
- if (-1 == propIdx)
+ if (-1 == propIdx) {
COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location"));
+ } else if (propIdx > 0xFFFF) {
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Alias property exceeds alias bounds"));
+ }
QMetaProperty aliasProperty = idObject->metaObject()->property(propIdx);
if (!aliasProperty.isScriptable())
@@ -2590,6 +2593,22 @@ bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder,
writable = aliasProperty.isWritable();
+ if (alias.count() == 3) {
+ QDeclarativeValueType *valueType = enginePrivate->valueTypes[aliasProperty.type()];
+ if (!valueType)
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location"));
+
+ propIdx |= ((unsigned int)aliasProperty.type()) << 24;
+
+ int valueTypeIndex = valueType->metaObject()->indexOfProperty(alias.at(2).toUtf8().constData());
+ if (valueTypeIndex == -1)
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location"));
+ Q_ASSERT(valueTypeIndex <= 0xFF);
+
+ aliasProperty = valueType->metaObject()->property(valueTypeIndex);
+ propIdx |= (valueTypeIndex << 16);
+ }
+
if (aliasProperty.isEnumType())
typeName = "int"; // Avoid introducing a dependency on the aliased metaobject
else
diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp
index 37f08fc..e28062b 100644
--- a/src/declarative/qml/qdeclarativevmemetaobject.cpp
+++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp
@@ -459,7 +459,7 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
id -= propOffset;
if (id < metaData->propertyCount) {
- int t = (metaData->propertyData() + id)->propertyType;
+ int t = (metaData->propertyData() + id)->propertyType;
bool needActivate = false;
if (t == -1) {
@@ -586,11 +586,26 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
connectAlias(id);
- if (d->propertyIdx == -1) {
+ if (d->isObjectAlias()) {
*reinterpret_cast<QObject **>(a[0]) = target;
return -1;
+ } else if (d->isValueTypeAlias()) {
+ // Value type property
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine);
+
+ QDeclarativeValueType *valueType = ep->valueTypes[d->valueType()];
+ Q_ASSERT(valueType);
+
+ valueType->read(target, d->propertyIndex());
+ int rv = QMetaObject::metacall(valueType, c, d->valueTypeIndex(), a);
+
+ if (c == QMetaObject::WriteProperty)
+ valueType->write(target, d->propertyIndex(), 0x00);
+
+ return rv;
+
} else {
- return QMetaObject::metacall(target, c, d->propertyIdx, a);
+ return QMetaObject::metacall(target, c, d->propertyIndex(), a);
}
}
@@ -823,8 +838,8 @@ void QDeclarativeVMEMetaObject::connectAlias(int aliasId)
int sigIdx = methodOffset + aliasId + metaData->propertyCount;
QMetaObject::connect(context, d->contextIdx + ctxtPriv->notifyIndex, object, sigIdx);
- if (d->propertyIdx != -1) {
- QMetaProperty prop = target->metaObject()->property(d->propertyIdx);
+ if (!d->isObjectAlias()) {
+ QMetaProperty prop = target->metaObject()->property(d->propertyIndex());
if (prop.hasNotifySignal())
QDeclarativePropertyPrivate::connect(target, prop.notifySignalIndex(), object, sigIdx);
}
diff --git a/src/declarative/qml/qdeclarativevmemetaobject_p.h b/src/declarative/qml/qdeclarativevmemetaobject_p.h
index 4ccaa73..5134763 100644
--- a/src/declarative/qml/qdeclarativevmemetaobject_p.h
+++ b/src/declarative/qml/qdeclarativevmemetaobject_p.h
@@ -84,6 +84,25 @@ struct QDeclarativeVMEMetaData
int contextIdx;
int propertyIdx;
int flags;
+
+ bool isObjectAlias() const {
+ return propertyIdx == -1;
+ }
+ bool isPropertyAlias() const {
+ return !isObjectAlias() && !(propertyIdx & 0xFF000000);
+ }
+ bool isValueTypeAlias() const {
+ return !isObjectAlias() && (propertyIdx & 0xFF000000);
+ }
+ int propertyIndex() const {
+ return propertyIdx & 0x0000FFFF;
+ }
+ int valueTypeIndex() const {
+ return (propertyIdx & 0x00FF0000) >> 16;
+ }
+ int valueType() const {
+ return ((unsigned int)propertyIdx) >> 24;
+ }
};
struct PropertyData {
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index fc44a44..60cd020 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2125,7 +2125,7 @@ void QGraphicsItem::setToolTip(const QString &toolTip)
\snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 2
- If no cursor has been set, the parent's cursor is used.
+ If no cursor has been set, the cursor of the item beneath is used.
\sa setCursor(), hasCursor(), unsetCursor(), QWidget::cursor,
QApplication::overrideCursor()
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index e58b93c..a0015dc 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4362,6 +4362,50 @@ static void _q_paintIntoCache(QPixmap *pix, QGraphicsItem *item, const QRegion &
}
}
+// Copied from qpaintengine_vg.cpp
+// Returns true for 90, 180, and 270 degree rotations.
+static inline bool transformIsSimple(const QTransform& transform)
+{
+ QTransform::TransformationType type = transform.type();
+ if (type == QTransform::TxNone || type == QTransform::TxTranslate) {
+ return true;
+ } else if (type == QTransform::TxScale) {
+ // Check for 0 and 180 degree rotations.
+ // (0 might happen after 4 rotations of 90 degrees).
+ qreal m11 = transform.m11();
+ qreal m12 = transform.m12();
+ qreal m21 = transform.m21();
+ qreal m22 = transform.m22();
+ if (m12 == 0.0f && m21 == 0.0f) {
+ if (m11 == 1.0f && m22 == 1.0f)
+ return true; // 0 degrees
+ else if (m11 == -1.0f && m22 == -1.0f)
+ return true; // 180 degrees.
+ if(m11 == 1.0f && m22 == -1.0f)
+ return true; // 0 degrees inverted y.
+ else if(m11 == -1.0f && m22 == 1.0f)
+ return true; // 180 degrees inverted y.
+ }
+ } else if (type == QTransform::TxRotate) {
+ // Check for 90, and 270 degree rotations.
+ qreal m11 = transform.m11();
+ qreal m12 = transform.m12();
+ qreal m21 = transform.m21();
+ qreal m22 = transform.m22();
+ if (m11 == 0.0f && m22 == 0.0f) {
+ if (m12 == 1.0f && m21 == -1.0f)
+ return true; // 90 degrees.
+ else if (m12 == -1.0f && m21 == 1.0f)
+ return true; // 270 degrees.
+ else if (m12 == -1.0f && m21 == -1.0f)
+ return true; // 90 degrees inverted y.
+ else if (m12 == 1.0f && m21 == 1.0f)
+ return true; // 270 degrees inverted y.
+ }
+ }
+ return false;
+}
+
/*!
\internal
@@ -4530,32 +4574,28 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
if (invertable)
diff *= painter->worldTransform();
deviceData->lastTransform = painter->worldTransform();
- if (!invertable
- || diff.type() > QTransform::TxTranslate
- || painter->worldTransform().type() > QTransform::TxScale) {
+ bool allowPartialCacheExposure = false;
+ bool simpleTransform = invertable && diff.type() <= QTransform::TxTranslate
+ && transformIsSimple(painter->worldTransform());
+ if (!simpleTransform) {
pixModified = true;
itemCache->allExposed = true;
itemCache->exposed.clear();
+ deviceData->cacheIndent = QPoint();
pix = QPixmap();
+ } else {
+ allowPartialCacheExposure = deviceData->cacheIndent != QPoint();
}
- // ### This is a pretty bad way to determine when to start partial
- // exposure for DeviceCoordinateCache but it's the least intrusive
- // approach for now.
-#if 0
- // Only if the device rect isn't fully contained.
- bool allowPartialCacheExposure = !viewRect.contains(deviceRect);
-#else
- // Only if deviceRect is 20% taller or wider than the desktop.
- bool allowPartialCacheExposure = false;
- if (widget) {
- QRect desktopRect = QApplication::desktop()->availableGeometry(widget);
- allowPartialCacheExposure = (desktopRect.width() * 1.2 < deviceRect.width()
- || desktopRect.height() * 1.2 < deviceRect.height());
+ // Allow partial cache exposure if the device rect isn't fully contained and
+ // deviceRect is 20% taller or wider than the viewRect.
+ if (!allowPartialCacheExposure && !viewRect.contains(deviceRect)) {
+ allowPartialCacheExposure = (viewRect.width() * 1.2 < deviceRect.width())
+ || (viewRect.height() * 1.2 < deviceRect.height());
}
-#endif
+
QRegion scrollExposure;
- if (deviceData->cacheIndent != QPoint() || allowPartialCacheExposure) {
+ if (allowPartialCacheExposure) {
// Part of pixmap is drawn. Either device contains viewrect (big
// item covers whole screen) or parts of device are outside the
// viewport. In either case the device rect must be the intersect
diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h
index 821fb69..f171281 100644
--- a/src/gui/image/qpixmap_x11_p.h
+++ b/src/gui/image/qpixmap_x11_p.h
@@ -115,6 +115,7 @@ private:
friend class QEglContext; // Needs gl_surface
friend class QGLContext; // Needs gl_surface
friend class QX11GLPixmapData; // Needs gl_surface
+ friend class QMeeGoGraphicsSystem; // Needs gl_surface and flags
friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs gl_surface
void release();
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index 7a9dc70..9b07d64 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -320,5 +320,10 @@ static void cleanupCocoaApplicationDelegate()
[NSApp terminate:self];
}
+- (void)qtDispatcherToQAction:(id)sender
+{
+ [[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender];
+}
+
@end
#endif
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 7fd2baa..93f64f6 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -142,6 +142,7 @@ public:
int avkonComponentsSupportTransparency : 1;
int menuBeingConstructed : 1;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
+ static CEikButtonGroupContainer *cba;
enum ScanCodeState {
Unpressed,
@@ -162,6 +163,7 @@ public:
static inline CAknTitlePane* titlePane();
static inline CAknContextPane* contextPane();
static inline CEikButtonGroupContainer* buttonGroupContainer();
+ static inline void setButtonGroupContainer(CEikButtonGroupContainer* newCba);
static void setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible);
#endif
static void controlVisibilityChanged(CCoeControl *control, bool visible);
@@ -383,7 +385,12 @@ inline CAknContextPane* QS60Data::contextPane()
inline CEikButtonGroupContainer* QS60Data::buttonGroupContainer()
{
- return CEikonEnv::Static()->AppUiFactory()->Cba();
+ return QS60Data::cba;
+}
+
+inline void QS60Data::setButtonGroupContainer(CEikButtonGroupContainer *newCba)
+{
+ QS60Data::cba = newCba;
}
#endif // Q_WS_S60
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 4109ed8..9a451ce 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -69,6 +69,7 @@ extern bool qt_nograb();
QWidget *QWidgetPrivate::mouseGrabber = 0;
QWidget *QWidgetPrivate::keyboardGrabber = 0;
+CEikButtonGroupContainer *QS60Data::cba = 0;
static bool isEqual(const QList<QAction*>& a, const QList<QAction*>& b)
{
@@ -494,9 +495,27 @@ void QWidgetPrivate::show_sys()
// Create the status pane and CBA here
CEikAppUi *ui = static_cast<CEikAppUi *>(S60->appUi());
MEikAppUiFactory *factory = CEikonEnv::Static()->AppUiFactory();
- TRAP_IGNORE(factory->ReadAppInfoResourceL(0, ui));
- if (S60->buttonGroupContainer())
- S60->buttonGroupContainer()->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
+
+ QT_TRAP_THROWING(
+ factory->CreateResourceIndependentFurnitureL(ui);
+
+ TRect boundingRect = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+
+ CEikButtonGroupContainer *cba = CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::ECba,
+ CEikButtonGroupContainer::EHorizontal,ui,R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
+
+ CEikButtonGroupContainer *oldCba = CEikonEnv::Static()->AppUiFactory()->SwapButtonGroup(cba);
+ Q_ASSERT(!oldCba);
+ S60->setButtonGroupContainer(cba);
+
+ CEikMenuBar *menuBar = new(ELeave) CEikMenuBar;
+ menuBar->ConstructL(ui, 0, R_AVKON_MENUPANE_EMPTY);
+ menuBar->SetMenuType(CEikMenuBar::EMenuOptions);
+ S60->appUi()->AddToStackL(menuBar,ECoeStackPriorityMenu,ECoeStackFlagRefusesFocus);
+
+ CEikMenuBar *oldMenu = CEikonEnv::Static()->AppUiFactory()->SwapMenuBar(menuBar);
+ Q_ASSERT(!oldMenu);
+ )
if (S60->statusPane()) {
// Use QDesktopWidget as the status pane observer to proxy for the AppUi.
@@ -1233,7 +1252,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
// At this point the backing store should already be destroyed
// so we flush the command buffer to ensure that the freeing of
// those resources and deleting the window can happen "atomically"
- S60->wsSession().Flush();
+ if (qApp)
+ S60->wsSession().Flush();
}
}
diff --git a/src/gui/painting/qcups_p.h b/src/gui/painting/qcups_p.h
index 9259679..239c244 100644
--- a/src/gui/painting/qcups_p.h
+++ b/src/gui/painting/qcups_p.h
@@ -59,6 +59,7 @@
#ifndef QT_NO_CUPS
#include <QtCore/qlibrary.h>
#include <cups/cups.h>
+#include <cups/ppd.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/s60framework/qs60mainapplication.cpp b/src/gui/s60framework/qs60mainapplication.cpp
index 5d4c54e..74432af 100644
--- a/src/gui/s60framework/qs60mainapplication.cpp
+++ b/src/gui/s60framework/qs60mainapplication.cpp
@@ -58,7 +58,6 @@ CApaApplication *newS60Application()
return new QS60MainApplication;
}
-_LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main" QT_LIBINFIX_UNICODE L".rsc");
/*!
\class QS60MainApplication
@@ -129,10 +128,6 @@ TUid QS60MainApplication::AppDllUid() const
*/
TFileName QS60MainApplication::ResourceFileName() const
{
- TFindFile finder(iCoeEnv->FsSession());
- TInt err = finder.FindByDir(KQtWrapperResourceFile, KNullDesC);
- if (err == KErrNone)
- return finder.File();
return KNullDesC();
}
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index ea9dbb3..92b3b55 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -50,16 +50,6 @@
#endif
#include <barsread.h>
#include <qconfig.h>
-#ifdef Q_WS_S60
-# if defined(QT_LIBINFIX_UNQUOTED)
-// Two level macro needed for proper expansion of libinfix
-# define QT_S60MAIN_RSG_2(x) <s60main##x##.rsg>
-# define QT_S60MAIN_RSG(x) QT_S60MAIN_RSG_2(x)
-# include QT_S60MAIN_RSG(QT_LIBINFIX_UNQUOTED)
-# else
-# include <s60main.rsg>
-# endif
-#endif
#include "qs60mainappui.h"
#include <QtGui/qapplication.h>
@@ -125,8 +115,8 @@ void QS60MainAppUi::ConstructL()
#ifdef Q_WS_S60
flags |= CAknAppUi::EAknEnableSkin;
// After 5th Edition S60, native side supports animated wallpapers.
- // However, there is no support for that feature on Qt side, so indicate to
- // native UI framework that this application will not support background animations.
+ // However, there is no support for that feature on Qt side, so indicate to
+ // native UI framework that this application will not support background animations.
if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)
flags |= KAknDisableAnimationBackground;
#endif
@@ -244,7 +234,7 @@ void QS60MainAppUi::DynInitMenuBarL(TInt /* resourceId */, CEikMenuBar * /* menu
void QS60MainAppUi::DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane)
{
#ifdef Q_WS_S60
- if (resourceId == R_QT_WRAPPERAPP_MENU) {
+ if (resourceId == R_AVKON_MENUPANE_EMPTY) {
if (menuPane->NumberOfItemsInPane() <= 1)
QT_TRYCATCH_LEAVING(qt_symbian_show_toplevel(menuPane));
@@ -274,7 +264,17 @@ void QS60MainAppUi::RestoreMenuL(CCoeControl *menuWindow, TInt resourceId, TMenu
DynInitMenuPaneL(resourceId, (CEikMenuPane*)menuWindow);
else
DynInitMenuBarL(resourceId, (CEikMenuBar*)menuWindow);
- } else
+ } else if(resourceId == R_AVKON_MENUPANE_EMPTY) {
+ CEikMenuBarTitle *title = new(ELeave) CEikMenuBarTitle;
+ CleanupStack::PushL(title);
+
+ title->iData.iMenuPaneResourceId = R_AVKON_MENUPANE_EMPTY;
+ title->iTitleFlags = 0;
+
+ S60->menuBar()->TitleArray()->AddTitleL(title);
+ CleanupStack::Pop( title );
+ }
+ else
#endif
{
QS60MainAppUiBase::RestoreMenuL(menuWindow, resourceId, menuType);
diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri
index edbacc0..19525b7 100644
--- a/src/gui/s60framework/s60framework.pri
+++ b/src/gui/s60framework/s60framework.pri
@@ -1,21 +1,3 @@
-contains(QT_CONFIG, s60) {
-# This block serves the minimalistic resource file for S60 3.1 platforms.
-# Note there is no way to ifdef S60 version in mmp file, that is why the resource
-# file is always compiled for WINSCW
-
- minimalAppResource31 = \
- "SOURCEPATH s60framework" \
- "START RESOURCE s60main.rss" \
- "TARGET s60main$${QT_LIBINFIX}" \
- "HEADER" \
- "TARGETPATH /resource/apps" \
- "END"
-
- MMP_RULES += minimalAppResource31
-
- SYMBIAN_RESOURCES += s60framework/s60main.rss
-}
-
SOURCES += s60framework/qs60mainapplication.cpp \
s60framework/qs60mainappui.cpp \
s60framework/qs60maindocument.cpp
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 9a5bac0..919c542 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -137,7 +137,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
if (ctx->d_ptr->workaround_brokenFBOReadBack) {
QImageTextureGlyphCache::resizeTextureData(width, height);
Q_ASSERT(image().depth() == 8);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, oldWidth, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, image().constBits());
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, image().constBits());
glDeleteTextures(1, &oldTexture);
return;
}
diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp
index e7f6439..611c962 100644
--- a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp
@@ -46,6 +46,7 @@
bool QMeeGoExtensions::initialized = false;
bool QMeeGoExtensions::hasImageShared = false;
bool QMeeGoExtensions::hasSurfaceScaling = false;
+bool QMeeGoExtensions::hasLockSurface = false;
/* Extension funcs */
@@ -53,11 +54,15 @@ typedef EGLBoolean (EGLAPIENTRY *eglQueryImageNOKFunc)(EGLDisplay, EGLImageKHR,
typedef EGLNativeSharedImageTypeNOK (EGLAPIENTRY *eglCreateSharedImageNOKFunc)(EGLDisplay, EGLImageKHR, EGLint*);
typedef EGLBoolean (EGLAPIENTRY *eglDestroySharedImageNOKFunc)(EGLDisplay, EGLNativeSharedImageTypeNOK);
typedef EGLBoolean (EGLAPIENTRY *eglSetSurfaceScalingNOKFunc)(EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint);
+typedef EGLBoolean (EGLAPIENTRY *eglLockSurfaceKHRFunc)(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRY *eglUnlockSurfaceKHRFunc)(EGLDisplay display, EGLSurface surface);
static eglQueryImageNOKFunc _eglQueryImageNOK = 0;
static eglCreateSharedImageNOKFunc _eglCreateSharedImageNOK = 0;
static eglDestroySharedImageNOKFunc _eglDestroySharedImageNOK = 0;
static eglSetSurfaceScalingNOKFunc _eglSetSurfaceScalingNOK = 0;
+static eglLockSurfaceKHRFunc _eglLockSurfaceKHR = 0;
+static eglUnlockSurfaceKHRFunc _eglUnlockSurfaceKHR = 0;
/* Public */
@@ -101,6 +106,22 @@ bool QMeeGoExtensions::eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surfac
return _eglSetSurfaceScalingNOK(dpy, surface, x, y, width, height);
}
+bool QMeeGoExtensions::eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list)
+{
+ if (! hasLockSurface)
+ qFatal("EGL_KHR_lock_surface2 not found but trying to use capability!");
+
+ return _eglLockSurfaceKHR(display, surface, attrib_list);
+}
+
+bool QMeeGoExtensions::eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface)
+{
+ if (! hasLockSurface)
+ qFatal("EGL_KHR_lock_surface2 not found but trying to use capability!");
+
+ return _eglUnlockSurfaceKHR(display, surface);
+}
+
/* Private */
void QMeeGoExtensions::initialize()
@@ -113,6 +134,8 @@ void QMeeGoExtensions::initialize()
_eglQueryImageNOK = (eglQueryImageNOKFunc) eglGetProcAddress("eglQueryImageNOK");
_eglCreateSharedImageNOK = (eglCreateSharedImageNOKFunc) eglGetProcAddress("eglCreateSharedImageNOK");
_eglDestroySharedImageNOK = (eglDestroySharedImageNOKFunc) eglGetProcAddress("eglDestroySharedImageNOK");
+ _eglLockSurfaceKHR = (eglLockSurfaceKHRFunc) eglGetProcAddress("eglLockSurfaceKHR");
+ _eglUnlockSurfaceKHR = (eglUnlockSurfaceKHRFunc) eglGetProcAddress("eglUnlockSurfaceKHR");
Q_ASSERT(_eglQueryImageNOK && _eglCreateSharedImageNOK && _eglDestroySharedImageNOK);
hasImageShared = true;
@@ -125,5 +148,14 @@ void QMeeGoExtensions::initialize()
Q_ASSERT(_eglSetSurfaceScalingNOK);
hasSurfaceScaling = true;
}
+
+ if (QEgl::hasExtension("EGL_KHR_lock_surface2")) {
+ qDebug("MeegoGraphics: found EGL_KHR_lock_surface2");
+ _eglLockSurfaceKHR = (eglLockSurfaceKHRFunc) eglGetProcAddress("eglLockSurfaceKHR");
+ _eglUnlockSurfaceKHR = (eglUnlockSurfaceKHRFunc) eglGetProcAddress("eglUnlockSurfaceKHR");
+
+ Q_ASSERT(_eglLockSurfaceKHR && _eglUnlockSurfaceKHR);
+ hasLockSurface = true;
+ }
}
diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.h b/src/plugins/graphicssystems/meego/qmeegoextensions.h
index ee20bd8..9e78caf 100644
--- a/src/plugins/graphicssystems/meego/qmeegoextensions.h
+++ b/src/plugins/graphicssystems/meego/qmeegoextensions.h
@@ -65,6 +65,18 @@ typedef void* EGLNativeSharedImageTypeNOK;
#define EGL_FIXED_HEIGHT_NOK 0x30DC
#endif
+#ifndef EGL_BITMAP_POINTER_KHR
+#define EGL_BITMAP_POINTER_KHR 0x30C6
+#define EGL_BITMAP_PITCH_KHR 0x30C7
+#endif
+
+#ifndef EGL_MAP_PRESERVE_PIXELS_KHR
+#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4
+#define EGL_LOCK_USAGE_HINT_KHR 0x30C5
+#define EGL_READ_SURFACE_BIT_KHR 0x0001
+#define EGL_WRITE_SURFACE_BIT_KHR 0x0002
+#endif
+
/* Class */
class QMeeGoExtensions
@@ -76,6 +88,8 @@ public:
static bool eglQueryImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLint prop, EGLint *v);
static bool eglDestroySharedImageNOK(EGLDisplay dpy, EGLNativeSharedImageTypeNOK img);
static bool eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surface, int x, int y, int width, int height);
+ static bool eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+ static bool eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface);
private:
static void initialize();
@@ -83,6 +97,7 @@ private:
static bool initialized;
static bool hasImageShared;
static bool hasSurfaceScaling;
+ static bool hasLockSurface;
};
#endif
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index 2a64d49..f8b228c 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -51,6 +51,7 @@
#include <private/qimage_p.h>
#include <private/qeglproperties_p.h>
#include <private/qeglcontext_p.h>
+#include <private/qpixmap_x11_p.h>
#include "qmeegopixmapdata.h"
#include "qmeegographicssystem.h"
@@ -58,6 +59,8 @@
bool QMeeGoGraphicsSystem::surfaceWasCreated = false;
+QHash <Qt::HANDLE, QPixmap*> QMeeGoGraphicsSystem::liveTexturePixmaps;
+
QMeeGoGraphicsSystem::QMeeGoGraphicsSystem()
{
qDebug("Using the meego graphics system");
@@ -170,6 +173,22 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handl
}
}
+QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLImage(Qt::HANDLE handle)
+{
+ if (QMeeGoGraphicsSystem::meeGoRunning()) {
+ QMeeGoPixmapData *pmd = new QMeeGoPixmapData;
+ pmd->fromEGLImage(handle);
+
+ // FIXME Ok. This is a bit BAD BAD BAD. We're abusing here the fact that we KNOW
+ // that this function is used for the live pixmap...
+ pmd->texture()->options &= ~QGLContext::InvertedYBindOption;
+ return QMeeGoGraphicsSystem::wrapPixmapData(pmd);
+ } else {
+ qFatal("Can't create from EGL image when not running meego graphics system!");
+ return NULL;
+ }
+}
+
void QMeeGoGraphicsSystem::updateEGLSharedImagePixmap(QPixmap *pixmap)
{
QMeeGoPixmapData *pmd = (QMeeGoPixmapData *) pixmap->pixmapData();
@@ -188,6 +207,109 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataWithGLTexture(int w, int h)
return QMeeGoGraphicsSystem::wrapPixmapData(pmd);
}
+Qt::HANDLE QMeeGoGraphicsSystem::createLiveTexture(int w, int h, QImage::Format format)
+{
+ // No need to wrap the QPixmapData here. This QPixmap(Data) is a
+ // internal implementation and we don't migrate it between
+ // graphics system switching.
+
+ // We use a bit ugly way of enforcing a color format on the X pixmap -- we create
+ // a local QImage and fromImage from there. This is quite redundant (extra overhead of creating
+ // the useless image only to delete it) but shouldn't be too bad for now... you're not expected
+ // to call createLiveTexture too often anyways. Would be great if QX11PixmapData had a way to
+ // force the X format upon creation or resize.
+
+ QImage image(w, h, format);
+ QX11PixmapData *pmd = new QX11PixmapData(QPixmapData::PixmapType);
+ pmd->fromImage(image, Qt::NoOpaqueDetection);
+ QPixmap *p = new QPixmap(pmd);
+
+ liveTexturePixmaps.insert(p->handle(), p);
+ return p->handle();
+}
+
+void QMeeGoGraphicsSystem::destroyLiveTexture(Qt::HANDLE h)
+{
+ if (liveTexturePixmaps.contains(h)) {
+ QPixmap *p = liveTexturePixmaps.value(h);
+ delete p;
+ liveTexturePixmaps.remove(h);
+ } else
+ qWarning("Trying to destroy live texture %ld which was not found!", h);
+}
+
+bool QMeeGoGraphicsSystem::lockLiveTexture(Qt::HANDLE h)
+{
+ if (! liveTexturePixmaps.contains(h)) {
+ qWarning("Trying to lock live texture %ld which was not found!", h);
+ return false;
+ }
+
+ EGLint attribs[] = {
+ EGL_MAP_PRESERVE_PIXELS_KHR, EGL_TRUE,
+ EGL_LOCK_USAGE_HINT_KHR, EGL_READ_SURFACE_BIT_KHR | EGL_WRITE_SURFACE_BIT_KHR,
+ EGL_NONE
+ };
+
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ EGLSurface surface = getSurfaceForLiveTexturePixmap(liveTexturePixmaps.value(h));
+ return QMeeGoExtensions::eglLockSurfaceKHR(QEgl::display(), surface, attribs);
+}
+
+bool QMeeGoGraphicsSystem::unlockLiveTexture(Qt::HANDLE h)
+{
+ if (! liveTexturePixmaps.contains(h)) {
+ qWarning("Trying to lock live texture %ld which was not found!", h);
+ return false;
+ }
+
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ QMeeGoExtensions::ensureInitialized();
+
+ EGLSurface surface = getSurfaceForLiveTexturePixmap(liveTexturePixmaps.value(h));
+ if (QMeeGoExtensions::eglUnlockSurfaceKHR(QEgl::display(), surface)) {
+ glFinish();
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void QMeeGoGraphicsSystem::queryLiveTexture(Qt::HANDLE h, void **data, int *pitch)
+{
+ // FIXME Only allow this on locked surfaces
+ if (! liveTexturePixmaps.contains(h)) {
+ qWarning("Trying to query live texture %ld which was not found!", h);
+ return;
+ }
+
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ QMeeGoExtensions::ensureInitialized();
+
+ EGLSurface surface = getSurfaceForLiveTexturePixmap(liveTexturePixmaps.value(h));
+ eglQuerySurface(QEgl::display(), surface, EGL_BITMAP_POINTER_KHR, (EGLint*) data);
+ eglQuerySurface(QEgl::display(), surface, EGL_BITMAP_PITCH_KHR, (EGLint*) pitch);
+}
+
+Qt::HANDLE QMeeGoGraphicsSystem::liveTextureToEGLImage(Qt::HANDLE h)
+{
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ QMeeGoExtensions::ensureInitialized();
+
+ EGLint attribs[] = {
+ EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
+ EGL_NONE
+ };
+
+ EGLImageKHR eglImage = QEgl::eglCreateImageKHR(QEgl::display(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR,
+ (EGLClientBuffer) h, attribs);
+
+ if (eglImage == EGL_NO_IMAGE_KHR)
+ qWarning("eglCreateImageKHR failed!");
+
+ return (Qt::HANDLE) eglImage;
+}
+
bool QMeeGoGraphicsSystem::meeGoRunning()
{
if (! QApplicationPrivate::instance()) {
@@ -204,6 +326,52 @@ bool QMeeGoGraphicsSystem::meeGoRunning()
return (name == "meego");
}
+void QMeeGoGraphicsSystem::destroySurfaceForLiveTexturePixmap(QPixmapData* pmd)
+{
+ Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
+ QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
+ if (pixmapData->gl_surface) {
+ eglDestroySurface(QEgl::display(), (EGLSurface)pixmapData->gl_surface);
+ pixmapData->gl_surface = 0;
+ }
+}
+
+EGLSurface QMeeGoGraphicsSystem::getSurfaceForLiveTexturePixmap(QPixmap *pixmap)
+{
+ // This code is a crative remix of the stuff that can be found in the
+ // Qt's TFP implementation in /src/opengl/qgl_x11egl.cpp ::bindiTextureFromNativePixmap
+ QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pixmap->data_ptr().data());
+ Q_ASSERT(pixmapData->classId() == QPixmapData::X11Class);
+ bool hasAlpha = pixmapData->hasAlphaChannel();
+
+ if (pixmapData->gl_surface &&
+ hasAlpha == (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
+ return pixmapData->gl_surface;
+
+ // Check to see if the surface is still valid
+ if (pixmapData->gl_surface &&
+ hasAlpha != ((pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha) > 0)) {
+ // Surface is invalid!
+ QMeeGoGraphicsSystem::destroySurfaceForLiveTexturePixmap(pixmapData);
+ }
+
+ if (pixmapData->gl_surface == 0) {
+ EGLConfig config = QEgl::defaultConfig(QInternal::Pixmap,
+ QEgl::OpenGL,
+ hasAlpha ? QEgl::Translucent : QEgl::NoOptions);
+
+ pixmapData->gl_surface = (void*)QEgl::createSurface(pixmap, config);
+
+ if (hasAlpha)
+ pixmapData->flags = pixmapData->flags | QX11PixmapData::GlSurfaceCreatedWithAlpha;
+
+ if (pixmapData->gl_surface == (void*)EGL_NO_SURFACE)
+ return NULL;
+ }
+
+ return pixmapData->gl_surface;
+}
+
/* C API */
int qt_meego_image_to_egl_shared_image(const QImage &image)
@@ -216,6 +384,11 @@ QPixmapData* qt_meego_pixmapdata_from_egl_shared_image(Qt::HANDLE handle, const
return QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(handle, softImage);
}
+QPixmapData* qt_meego_pixmapdata_from_egl_image(Qt::HANDLE handle)
+{
+ return QMeeGoGraphicsSystem::pixmapDataFromEGLImage(handle);
+}
+
QPixmapData* qt_meego_pixmapdata_with_gl_texture(int w, int h)
{
return QMeeGoGraphicsSystem::pixmapDataWithGLTexture(w, h);
@@ -245,3 +418,33 @@ void qt_meego_update_egl_shared_image_pixmap(QPixmap *pixmap)
{
QMeeGoGraphicsSystem::updateEGLSharedImagePixmap(pixmap);
}
+
+Qt::HANDLE qt_meego_live_texture_create(int w, int h, QImage::Format format)
+{
+ return QMeeGoGraphicsSystem::createLiveTexture(w, h, format);
+}
+
+void qt_meego_live_texture_destroy(Qt::HANDLE h)
+{
+ QMeeGoGraphicsSystem::destroyLiveTexture(h);
+}
+
+bool qt_meego_live_texture_lock(Qt::HANDLE h)
+{
+ return QMeeGoGraphicsSystem::lockLiveTexture(h);
+}
+
+bool qt_meego_live_texture_unlock(Qt::HANDLE h)
+{
+ return QMeeGoGraphicsSystem::unlockLiveTexture(h);
+}
+
+void qt_meego_live_texture_query(Qt::HANDLE h, void **data, int *pitch)
+{
+ return QMeeGoGraphicsSystem::queryLiveTexture(h, data, pitch);
+}
+
+Qt::HANDLE qt_meego_live_texture_to_egl_image(Qt::HANDLE h)
+{
+ return QMeeGoGraphicsSystem::liveTextureToEGLImage(h);
+}
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.h b/src/plugins/graphicssystems/meego/qmeegographicssystem.h
index 905f0c3..934d32d 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.h
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.h
@@ -43,6 +43,9 @@
#define MGRAPHICSSYSTEM_H
#include <private/qgraphicssystem_p.h>
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
class QMeeGoGraphicsSystem : public QGraphicsSystem
{
@@ -60,13 +63,24 @@ public:
static void setTranslucent(bool translucent);
static QPixmapData *pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage);
+ static QPixmapData *pixmapDataFromEGLImage(Qt::HANDLE handle);
static QPixmapData *pixmapDataWithGLTexture(int w, int h);
static void updateEGLSharedImagePixmap(QPixmap *pixmap);
+ static Qt::HANDLE createLiveTexture(int w, int h, QImage::Format format);
+ static void destroyLiveTexture(Qt::HANDLE h);
+ static bool lockLiveTexture(Qt::HANDLE h);
+ static bool unlockLiveTexture(Qt::HANDLE h);
+ static void queryLiveTexture(Qt::HANDLE h, void **data, int *pitch);
+ static Qt::HANDLE liveTextureToEGLImage(Qt::HANDLE h);
+
private:
static bool meeGoRunning();
+ static EGLSurface getSurfaceForLiveTexturePixmap(QPixmap *pixmap);
+ static void destroySurfaceForLiveTexturePixmap(QPixmapData* pmd);
static bool surfaceWasCreated;
+ static QHash <Qt::HANDLE, QPixmap*> liveTexturePixmaps;
};
/* C api */
@@ -74,12 +88,19 @@ private:
extern "C" {
Q_DECL_EXPORT int qt_meego_image_to_egl_shared_image(const QImage &image);
Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_from_egl_shared_image(Qt::HANDLE handle, const QImage &softImage);
+ Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_from_egl_image(Qt::HANDLE handle);
Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_with_gl_texture(int w, int h);
Q_DECL_EXPORT void qt_meego_update_egl_shared_image_pixmap(QPixmap *pixmap);
Q_DECL_EXPORT bool qt_meego_destroy_egl_shared_image(Qt::HANDLE handle);
Q_DECL_EXPORT void qt_meego_set_surface_fixed_size(int width, int height);
Q_DECL_EXPORT void qt_meego_set_surface_scaling(int x, int y, int width, int height);
Q_DECL_EXPORT void qt_meego_set_translucent(bool translucent);
+ Q_DECL_EXPORT Qt::HANDLE m_live_texture_create(int w, int h, QImage::Format format);
+ Q_DECL_EXPORT void m_live_texture_destroy(Qt::HANDLE h);
+ Q_DECL_EXPORT bool m_live_texture_lock(Qt::HANDLE h);
+ Q_DECL_EXPORT bool m_live_texture_unlock(Qt::HANDLE h);
+ Q_DECL_EXPORT void m_live_texture_query(Qt::HANDLE h, void **data, int *pitch);
+ Q_DECL_EXPORT Qt::HANDLE m_live_texture_to_egl_image(Qt::HANDLE h);
}
#endif
diff --git a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp
index 33611dc..84fc593 100644
--- a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp
@@ -87,6 +87,36 @@ void QMeeGoPixmapData::fromImage(const QImage &image,
}
}
+void QMeeGoPixmapData::fromEGLImage(Qt::HANDLE handle)
+{
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ QMeeGoExtensions::ensureInitialized();
+
+ bool textureIsBound = false;
+ GLuint newTextureId;
+ GLint newWidth, newHeight;
+
+ glGenTextures(1, &newTextureId);
+ glBindTexture(GL_TEXTURE_2D, newTextureId);
+
+ glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (EGLImageKHR) handle);
+ GLint err = glGetError();
+ if (err == GL_NO_ERROR)
+ textureIsBound = true;
+
+ QMeeGoExtensions::eglQueryImageNOK(QEgl::display(), (EGLImageKHR) handle, EGL_WIDTH, &newWidth);
+ QMeeGoExtensions::eglQueryImageNOK(QEgl::display(), (EGLImageKHR) handle, EGL_HEIGHT, &newHeight);
+
+ if (textureIsBound) {
+ // FIXME Remove this ugly hasAlphaChannel check when Qt lands the NoOpaqueCheck flag fix
+ // for QGLPixmapData.
+ fromTexture(newTextureId, newWidth, newHeight, true);
+ } else {
+ qWarning("Failed to create a texture from an egl image!");
+ glDeleteTextures(1, &newTextureId);
+ }
+}
+
void QMeeGoPixmapData::fromEGLSharedImage(Qt::HANDLE handle, const QImage &si)
{
if (si.isNull())
diff --git a/src/plugins/graphicssystems/meego/qmeegopixmapdata.h b/src/plugins/graphicssystems/meego/qmeegopixmapdata.h
index 8af33bd..8b1ae14 100644
--- a/src/plugins/graphicssystems/meego/qmeegopixmapdata.h
+++ b/src/plugins/graphicssystems/meego/qmeegopixmapdata.h
@@ -56,6 +56,7 @@ public:
QMeeGoPixmapData();
void fromTexture(GLuint textureId, int w, int h, bool alpha);
+ virtual void fromEGLImage(Qt::HANDLE handle);
virtual void fromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage);
virtual void fromImage (const QImage &image, Qt::ImageConversionFlags flags);
virtual QImage toImage() const;
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 1f622c0..c73ed06 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -11,10 +11,10 @@ symbian: {
isEmpty(QT_LIBINFIX) {
TARGET.UID3 = 0x2001E61C
-
+
# Sqlite3 is expected to be already found on phone if infixed configuration is built.
# It is also expected that devices newer than those based on S60 5.0 all have sqlite3.dll.
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
BLD_INF_RULES.prj_exports += \
"sqlite3.sis /epoc32/data/qt/sis/sqlite3.sis" \
"sqlite3_selfsigned.sis /epoc32/data/qt/sis/sqlite3_selfsigned.sis"
@@ -35,15 +35,6 @@ symbian: {
}
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
- symbian-abld|symbian-sbsv2 {
- qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main$${QT_LIBINFIX}.rsc
- } else {
- qtresources.sources = $$QMAKE_LIBDIR_QT/s60main$${QT_LIBINFIX}.rsc
- DESTDIR = $$QMAKE_LIBDIR_QT
- }
- qtresources.path = c:$$APP_RESOURCE_DIR
- DEPLOYMENT += qtresources
-
qtlibraries.sources = \
$$QMAKE_LIBDIR_QT/QtCore$${QT_LIBINFIX}.dll \
$$QMAKE_LIBDIR_QT/QtXml$${QT_LIBINFIX}.dll \
@@ -109,9 +100,9 @@ symbian: {
qtlibraries.pkg_prerules = vendorinfo
qtlibraries.pkg_prerules += "; Dependencies of Qt libraries"
-
+
# It is expected that Symbian^3 and newer phones will have sufficiently new OpenC already installed
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
qtlibraries.pkg_prerules += "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}"
contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
qtlibraries.pkg_prerules += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}"
diff --git a/src/s60main/s60main.rsg b/src/s60main/s60main.rsg
deleted file mode 100644
index 8cdf3ba..0000000
--- a/src/s60main/s60main.rsg
+++ /dev/null
@@ -1,3 +0,0 @@
-#define R_DEFAULT_DOCUMENT_NAME 0x55567002
-#define R_QT_WRAPPERAPP_MENUBAR 0x55567004
-#define R_QT_WRAPPERAPP_MENU 0x55567005