[meego-commits] 15136: Changes to Trunk/libmeegotouch
Peter Zhu
no_reply at build.meego.com
Thu Mar 24 01:52:29 UTC 2011
Hi,
I have made the following changes to libmeegotouch in project Trunk. Please review and accept ASAP.
Thank You,
Peter Zhu
[This message was auto-generated]
---
Request #15136:
submit: Trunk:Testing/libmeegotouch(r3) -> Trunk/libmeegotouch
Message:
Move to Trunk
State: new 2011-03-23T18:52:23 peter
Comment: None
changes files:
--------------
--- libmeegotouch.changes
+++ libmeegotouch.changes
@@ -0,0 +1,18 @@
+* Mon Mar 21 2011 Shane Bryan <shane.bryan at linux.intel.com> - 0.20.89
+- BMC#13246 - Assumes all displays start in Landscape orientation
+ added patches backported from fixes merged upstream (as of 0.20.95-1):
+ - BMC13246_0001-New-MDeviceProfile-orientationFromAngle.patch
+ - BMC13246_0002-Changes-Code-cosmetics.-Removing-trailing-whitespace.patch
+ - BMC13246_0003-Changes-MWindow-Remove-assumption-that-Angle0-is-Lan.patch
+ - BMC13246_0004-Changed-MTheme-remove-assumption-that-default-orient.patch
+ - BMC13246_0005-Changed-MStyleSheetAttribute-consider-device-s-nativ.patch
+ - BMC13246_0006-Changed-MSceneManager-remove-assumption-that-native-.patch
+ - BMC13246_0007-Changed-MOrientationTrackerPrivate-remove-assumption.patch
+ - BMC13246_0008-New-Adding-a-default-portrait-device-configuration.patch
+ - BMC13246_0009-Revert-Changes-Do-not-rotate-the-dim-layer-effect-wi.patch
+ added new DefaultPortrait.conf to .spec file
+
+* Mon Mar 21 2011 Fathi Boudra <fathi.boudra at nokia.com> - 0.20.89
+- removed BMC14407_MTextEdit_prompt_only_visible_when_text_edit_not_focused.patch
+ as it has been rejected upstream. The current behavior is intentional
+
old:
----
BMC14407_MTextEdit_prompt_only_visible_when_text_edit_not_focused.patch
new:
----
BMC13246_0001-New-MDeviceProfile-orientationFromAngle.patch
BMC13246_0002-Changes-Code-cosmetics.-Removing-trailing-whitespace.patch
BMC13246_0003-Changes-MWindow-Remove-assumption-that-Angle0-is-Lan.patch
BMC13246_0004-Changed-MTheme-remove-assumption-that-default-orient.patch
BMC13246_0005-Changed-MStyleSheetAttribute-consider-device-s-nativ.patch
BMC13246_0006-Changed-MSceneManager-remove-assumption-that-native-.patch
BMC13246_0007-Changed-MOrientationTrackerPrivate-remove-assumption.patch
BMC13246_0008-New-Adding-a-default-portrait-device-configuration.patch
BMC13246_0009-Revert-Changes-Do-not-rotate-the-dim-layer-effect-wi.patch
spec files:
-----------
--- libmeegotouch.spec
+++ libmeegotouch.spec
@@ -21,7 +21,15 @@
Patch2: BMC_12753_temp_solve_statusbar_height.patch
Patch3: BMC_8268_show_statusbar_on_n900.patch
Patch4: BMC_12929_meegographicssystem.patch
-Patch5: BMC14407_MTextEdit_prompt_only_visible_when_text_edit_not_focused.patch
+Patch5: BMC13246_0001-New-MDeviceProfile-orientationFromAngle.patch
+Patch6: BMC13246_0002-Changes-Code-cosmetics.-Removing-trailing-whitespace.patch
+Patch7: BMC13246_0003-Changes-MWindow-Remove-assumption-that-Angle0-is-Lan.patch
+Patch8: BMC13246_0004-Changed-MTheme-remove-assumption-that-default-orient.patch
+Patch9: BMC13246_0005-Changed-MStyleSheetAttribute-consider-device-s-nativ.patch
+Patch10: BMC13246_0006-Changed-MSceneManager-remove-assumption-that-native-.patch
+Patch11: BMC13246_0007-Changed-MOrientationTrackerPrivate-remove-assumption.patch
+Patch12: BMC13246_0008-New-Adding-a-default-portrait-device-configuration.patch
+Patch13: BMC13246_0009-Revert-Changes-Do-not-rotate-the-dim-layer-effect-wi.patch
Requires: meegotouch-theme >= 0.20.79
Requires: libmeegotouch-l10n-en
Requires(post): /sbin/ldconfig
@@ -186,8 +194,24 @@
%patch3 -p1
# BMC_12929_meegographicssystem.patch
%patch4 -p1
-# BMC14407_MTextEdit_prompt_only_visible_when_text_edit_not_focused.patch
+# BMC13246_0001-New-MDeviceProfile-orientationFromAngle.patch
%patch5 -p1
+# BMC13246_0002-Changes-Code-cosmetics.-Removing-trailing-whitespace.patch
+%patch6 -p1
+# BMC13246_0003-Changes-MWindow-Remove-assumption-that-Angle0-is-Lan.patch
+%patch7 -p1
+# BMC13246_0004-Changed-MTheme-remove-assumption-that-default-orient.patch
+%patch8 -p1
+# BMC13246_0005-Changed-MStyleSheetAttribute-consider-device-s-nativ.patch
+%patch9 -p1
+# BMC13246_0006-Changed-MSceneManager-remove-assumption-that-native-.patch
+%patch10 -p1
+# BMC13246_0007-Changed-MOrientationTrackerPrivate-remove-assumption.patch
+%patch11 -p1
+# BMC13246_0008-New-Adding-a-default-portrait-device-configuration.patch
+%patch12 -p1
+# BMC13246_0009-Revert-Changes-Do-not-rotate-the-dim-layer-effect-wi.patch
+%patch13 -p1
# >> setup
# << setup
@@ -305,6 +329,7 @@
%{_datadir}/meegotouch/shaders/yuv1.frag
%{_datadir}/meegotouch/shaders/yuv3.frag
%{_datadir}/meegotouch/targets/Default.conf
+%{_datadir}/meegotouch/targets/DefaultPortrait.conf
%{_datadir}/meegotouch/targets/iCDK.conf
%{_datadir}/meegotouch/targets/N900.conf
%{_datadir}/meegotouch/targets/N95.conf
other changes:
--------------
++++++ BMC13246_0001-New-MDeviceProfile-orientationFromAngle.patch (new)
--- BMC13246_0001-New-MDeviceProfile-orientationFromAngle.patch
+++ BMC13246_0001-New-MDeviceProfile-orientationFromAngle.patch
+From c764ec102e26d4dc331a18d723512659149409f1 Mon Sep 17 00:00:00 2001
+From: Daniel d'Andrada <daniel.dandrada at nokia.com>
+Date: Fri, 18 Mar 2011 10:19:06 +0200
+Subject: [PATCH 1/9] New: MDeviceProfile::orientationFromAngle()
+
+RevBy: TrustMe
+Details:
+Part of fix for BMC#13264. Inspired by patches from Shane Bryan.
+---
+ src/corelib/workspace/mdeviceprofile.cpp | 24 ++++++++++++++++++++++++
+ src/corelib/workspace/mdeviceprofile.h | 18 ++++++++++++++++++
+ 2 files changed, 42 insertions(+), 0 deletions(-)
+
+diff --git a/src/corelib/workspace/mdeviceprofile.cpp b/src/corelib/workspace/mdeviceprofile.cpp
+index 3db9459..8617c13 100644
+--- a/src/corelib/workspace/mdeviceprofile.cpp
++++ b/src/corelib/workspace/mdeviceprofile.cpp
+@@ -225,6 +225,30 @@ bool MDeviceProfile::showStatusbar() const
+ return d->showStatusBar;
+ }
+
++M::Orientation MDeviceProfile::orientationFromAngle(M::OrientationAngle angle) const
++{
++ Q_D(const MDeviceProfile);
++ M::Orientation orientation;
++
++ if (d->resolution.width() >= d->resolution.height()) {
++ // native display orientation is landscape
++ if (angle == M::Angle0 || angle == M::Angle180) {
++ orientation = M::Landscape;
++ } else {
++ orientation = M::Portrait;
++ }
++ } else {
++ // native display orientation is portrait
++ if (angle == M::Angle0 || angle == M::Angle180) {
++ orientation = M::Portrait;
++ } else {
++ orientation = M::Landscape;
++ }
++ }
++
++ return orientation;
++}
++
+ bool MDeviceProfile::orientationAngleIsSupported(M::OrientationAngle angle, bool isKeyboardOpen) const
+ {
+ Q_D(const MDeviceProfile);
+diff --git a/src/corelib/workspace/mdeviceprofile.h b/src/corelib/workspace/mdeviceprofile.h
+index 8a13802..5a2dd7d 100644
+--- a/src/corelib/workspace/mdeviceprofile.h
++++ b/src/corelib/workspace/mdeviceprofile.h
+@@ -54,6 +54,24 @@ public:
+ //! Return whether the status bar should be shown on target device
+ bool showStatusbar() const;
+
++ /*!
++ \brief Returns the resulting orientation of a device for a given rotation angle.
++
++ The rotation is relative to the position where the device's display has its
++ top edge on top.
++
++ For devices whose display native resolution is landscape:
++ \li Angle0 and Angle180 are landscape angles.
++ \li Angle90 and Angle270 are portrait angles.
++
++ For devices whose display native resolution is portrait:
++ \li Angle0 and Angle180 are portrait angles.
++ \li Angle90 and Angle270 are landscape angles.
++
++ orientationFromAngle(M::Angle0) returns the display's native orientation.
++ */
++ M::Orientation orientationFromAngle(M::OrientationAngle angle) const;
++
+ //! Returns true if orientation angle is supported for given keyboard state.
+ bool orientationAngleIsSupported(M::OrientationAngle angle, bool isKeyboardOpen) const;
+
+--
+1.7.2.2
+
++++++ BMC13246_0002-Changes-Code-cosmetics.-Removing-trailing-whitespace.patch (new)
--- BMC13246_0002-Changes-Code-cosmetics.-Removing-trailing-whitespace.patch
+++ BMC13246_0002-Changes-Code-cosmetics.-Removing-trailing-whitespace.patch
+From d72e79c200c9001c3ad5164892084ff72342ca9a Mon Sep 17 00:00:00 2001
+From: Daniel d'Andrada <daniel.dandrada at nokia.com>
+Date: Fri, 18 Mar 2011 10:24:47 +0200
+Subject: [PATCH 2/9] Changes: Code cosmetics. Removing trailing whitespaces
+
+RevBy: TrustMe
+---
+ src/corelib/workspace/mdeviceprofile.cpp | 4 ++--
+ src/corelib/workspace/mdeviceprofile.h | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/corelib/workspace/mdeviceprofile.cpp b/src/corelib/workspace/mdeviceprofile.cpp
+index 8617c13..c0cc3b7 100644
+--- a/src/corelib/workspace/mdeviceprofile.cpp
++++ b/src/corelib/workspace/mdeviceprofile.cpp
+@@ -132,7 +132,7 @@ bool MDeviceProfilePrivate::load(const QString& filename)
+ pixelsPerMmF = pixelsPerInch.width() / mmPerInch;
+ pixelsPerPt = pixelsPerInch.height() / pointsPerInch;
+ pixelsPerPtF = pixelsPerInch.height() / pointsPerInch;
+-
++
+ if (settings.value("/other/showStatusBar").toString() == "autodetect")
+ showStatusBar = hasStatusbarProvider();
+ else
+@@ -301,7 +301,7 @@ int MDeviceProfile::ptToPixels(qreal pt)
+ return pt * d->pixelsPerPt;
+ }
+
+-qreal MDeviceProfile::ptToPixelsF(qreal pt)
++qreal MDeviceProfile::ptToPixelsF(qreal pt)
+ {
+ Q_D(const MDeviceProfile);
+ return pt * d->pixelsPerPtF;
+diff --git a/src/corelib/workspace/mdeviceprofile.h b/src/corelib/workspace/mdeviceprofile.h
+index 5a2dd7d..f7624dc 100644
+--- a/src/corelib/workspace/mdeviceprofile.h
++++ b/src/corelib/workspace/mdeviceprofile.h
+@@ -89,7 +89,7 @@ public:
+
+ //! Returns the result of pixels to points conversion
+ int pixelsToPt(int pixels);
+-
++
+ //! Returns the result of pixels to points conversion
+ qreal pixelsToPtF(qreal pixels);
+
+--
+1.7.2.2
+
++++++ BMC13246_0003-Changes-MWindow-Remove-assumption-that-Angle0-is-Lan.patch (new)
--- BMC13246_0003-Changes-MWindow-Remove-assumption-that-Angle0-is-Lan.patch
+++ BMC13246_0003-Changes-MWindow-Remove-assumption-that-Angle0-is-Lan.patch
+From 9d00b21319d6af0cf721bba22f1cac1254002874 Mon Sep 17 00:00:00 2001
+From: Daniel d'Andrada <daniel.dandrada at nokia.com>
+Date: Fri, 18 Mar 2011 10:59:10 +0200
+Subject: [PATCH 3/9] Changes: MWindow - Remove assumption that Angle0 is Landscape
+
+RevBy: TrustMe
+Details:
+Based on original commit by Shane Bryan.
+Display's native resolution can be either landscape or portrait.
+Part of fix for BMC#13264.
+---
+ src/corelib/widgets/mwindow.cpp | 65 ++++++++++++++++++++++++--------------
+ src/corelib/widgets/mwindow_p.h | 1 -
+ 2 files changed, 41 insertions(+), 25 deletions(-)
+
+diff --git a/src/corelib/widgets/mwindow.cpp b/src/corelib/widgets/mwindow.cpp
+index 3b68181..5bda89d 100644
+--- a/src/corelib/widgets/mwindow.cpp
++++ b/src/corelib/widgets/mwindow.cpp
+@@ -69,14 +69,6 @@ namespace {
+ #endif
+ const char* AnimatedOrientationChangePropertyName =
+ "animatedOrientationChange";
+-
+- M::Orientation orientationFromOrientationAngle(M::OrientationAngle angle) {
+- if (angle == M::Angle0 || angle == M::Angle180) {
+- return M::Landscape;
+- } else {
+- return M::Portrait;
+- }
+- }
+ }
+
+ /// Actual class
+@@ -163,9 +155,9 @@ void MWindowPrivate::init()
+
+ #endif // Q_WS_X11
+
+- // resize always to the size in landscape mode,
++ // resize always to the display's native orientation
+ // since it's not the window but the scene content that is rotated
+- q->resize(q->visibleSceneSize(M::Landscape));
++ q->resize(q->visibleSceneSize(MDeviceProfile::instance()->orientationFromAngle(M::Angle0)));
+ q->setFrameStyle(0);
+ q->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ q->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+@@ -347,7 +339,7 @@ void MWindowPrivate::rotateWindowsFromKeyEvent(QKeyEvent *event) {
+ int newAngle = (window->orientationAngle()
+ + ((event->modifiers() & Qt::AltModifier) ? 270 : 90)) % 360;
+ M::OrientationAngle newOrientationAngle = static_cast<M::OrientationAngle>(newAngle);
+- M::Orientation newOrientation = orientationFromOrientationAngle(newOrientationAngle);
++ M::Orientation newOrientation = MDeviceProfile::instance()->orientationFromAngle(newOrientationAngle);
+
+ if (!window->isOrientationAngleLocked()) {
+ if (!window->isOrientationLocked() || (window->orientation() == newOrientation)) {
+@@ -493,11 +485,6 @@ bool MWindow::isInSwitcher() const
+ return d->isInSwitcher;
+ }
+
+-M::Orientation MWindowPrivate::orientation(M::OrientationAngle angle) const
+-{
+- return (angle == M::Angle0 || angle == M::Angle180) ? M::Landscape : M::Portrait;
+-}
+-
+ // return true if modifiers match what is required for debug keyboard shortcuts
+ bool MWindowPrivate::debugShortcutModifiersPresent(Qt::KeyboardModifiers modifiers) const
+ {
+@@ -1118,7 +1105,8 @@ void MWindow::setSceneManager(MSceneManager *sceneManager)
+ SIGNAL(orientationChangeFinished(M::Orientation)));
+ sceneManager->setParent(this);
+ setScene(sceneManager->scene());
+- setSceneRect(QRectF(QPointF(), visibleSceneSize(M::Landscape)));
++ // make scene rect match the display's native orientation
++ setSceneRect(QRectF(QPointF(), visibleSceneSize(MDeviceProfile::instance()->orientationFromAngle(M::Angle0))));
+ centerOn(sceneRect().center());
+ }
+ }
+@@ -1150,7 +1138,7 @@ M::Orientation MWindow::orientation() const
+ if (d->sceneManager) {
+ return d->sceneManager->orientation();
+ } else {
+- return d->orientation(d->angle);
++ return MDeviceProfile::instance()->orientationFromAngle(d->angle);
+ }
+ }
+
+@@ -1204,25 +1192,54 @@ void MWindow::setOrientationAngle(M::OrientationAngle angle)
+
+ void MWindow::setLandscapeOrientation()
+ {
+- if (orientation() != M::Landscape)
++ if (orientation() == M::Landscape) {
++ return;
++ }
++
++ if (MDeviceProfile::instance()->orientationFromAngle(M::Angle0) == M::Landscape) {
++ // native display orientation is landscape
+ setOrientationAngle(M::Angle0);
++ } else {
++ // native display orientation is portrait
++ setOrientationAngle(M::Angle270);
++ }
+ }
+
+ void MWindow::setPortraitOrientation()
+ {
+- if (orientation() != M::Portrait)
++ if (orientation() == M::Portrait) {
++ return;
++ }
++
++ if (MDeviceProfile::instance()->orientationFromAngle(M::Angle0) == M::Portrait) {
++ // native display orientation is portrait
++ setOrientationAngle(M::Angle0);
++ } else {
++ // native display orientation is landscape
+ setOrientationAngle(M::Angle270);
++ }
+ }
+
+ QSize MWindow::visibleSceneSize(M::Orientation orientation) const
+ {
+ QSize s;
+
+- if (orientation == M::Landscape) {
+- s = MDeviceProfile::instance()->resolution();
++ if (MDeviceProfile::instance()->orientationFromAngle(M::Angle0) == M::Landscape) {
++ // native display orientation is landscape
++ if (orientation == M::Landscape)
++ s = QSize(MDeviceProfile::instance()->resolution().width(),
++ MDeviceProfile::instance()->resolution().height());
++ else
++ s = QSize(MDeviceProfile::instance()->resolution().height(),
++ MDeviceProfile::instance()->resolution().width());
+ } else {
+- s = QSize(MDeviceProfile::instance()->resolution().height(),
+- MDeviceProfile::instance()->resolution().width());
++ // native display orientation is portrait
++ if (orientation == M::Landscape)
++ s = QSize(MDeviceProfile::instance()->resolution().height(),
++ MDeviceProfile::instance()->resolution().width());
++ else
++ s = QSize(MDeviceProfile::instance()->resolution().width(),
++ MDeviceProfile::instance()->resolution().height());
+ }
+
+ return s;
+diff --git a/src/corelib/widgets/mwindow_p.h b/src/corelib/widgets/mwindow_p.h
+index 145aaa8..49e490b 100644
+--- a/src/corelib/widgets/mwindow_p.h
++++ b/src/corelib/widgets/mwindow_p.h
+@@ -45,7 +45,6 @@ public:
+ void handleLanguageChangeEvent(QGraphicsItem *item);
+ void handleWindowStateChangeEvent(QWindowStateChangeEvent *event);
+ void handleCloseEvent(QCloseEvent *event);
+- M::Orientation orientation(M::OrientationAngle angle) const;
+ bool debugShortcutModifiersPresent(Qt::KeyboardModifiers modifiers) const;
+ void setVisible(bool visible);
+ void _q_enablePaintUpdates();
+--
+1.7.2.2
+
++++++ BMC13246_0004-Changed-MTheme-remove-assumption-that-default-orient.patch (new)
--- BMC13246_0004-Changed-MTheme-remove-assumption-that-default-orient.patch
+++ BMC13246_0004-Changed-MTheme-remove-assumption-that-default-orient.patch
+From ecd8622f16f0d1fb054c22017bdfc008c3e88e09 Mon Sep 17 00:00:00 2001
+From: Shane Bryan <shane.bryan at linux.intel.com>
+Date: Tue, 8 Mar 2011 14:07:32 -0800
+Subject: [PATCH 4/9] Changed: MTheme - remove assumption that default orientation is landscape
+
+RevBy: Daniel d'Andrada
+ModifiedBy: Daniel d'Andrada - made it use a different method from MDeviceProfile
+Details: Rather than assuming that default theme orientation is
+M::Landscape, return sane result based on device native orientation.
+
+Part of fix for BMC#13264.
+---
+ src/corelib/theme/mtheme.cpp | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/src/corelib/theme/mtheme.cpp b/src/corelib/theme/mtheme.cpp
+index 6481ddd..0f6508c 100644
+--- a/src/corelib/theme/mtheme.cpp
++++ b/src/corelib/theme/mtheme.cpp
+@@ -59,6 +59,7 @@ M_LIBRARY
+ #include "mapplicationwindow.h"
+ #include "mcomponentdata.h"
+ #include "mcomponentdata_p.h"
++#include "mdeviceprofile.h"
+
+ #include "mgraphicssystemhelper.h"
+
+@@ -498,7 +499,9 @@ bool MThemePrivate::appendLibraryStyleSheet(QList<const MStyleSheet *> &sheets,
+ const MStyle *MTheme::style(const char *styleClassName,
+ const QString &objectName)
+ {
+- return MTheme::style(styleClassName, objectName, 0, 0, M::Landscape, NULL);
++ M::Orientation nativeOrientation = MDeviceProfile::instance()->orientationFromAngle(M::Angle0);
++
++ return MTheme::style(styleClassName, objectName, 0, 0, nativeOrientation, NULL);
+ }
+
+ const MStyle *MTheme::style(const char *styleClassName,
+--
+1.7.2.2
+
++++++ BMC13246_0005-Changed-MStyleSheetAttribute-consider-device-s-nativ.patch (new)
--- BMC13246_0005-Changed-MStyleSheetAttribute-consider-device-s-nativ.patch
+++ BMC13246_0005-Changed-MStyleSheetAttribute-consider-device-s-nativ.patch
+From 23445365cf982a77df64037be21ace39d31ca2ef Mon Sep 17 00:00:00 2001
+From: Shane Bryan <shane.bryan at linux.intel.com>
+Date: Mon, 14 Mar 2011 16:35:20 -0700
+Subject: [PATCH 5/9] Changed: MStyleSheetAttribute - consider device's native orientation
+
+Details: When converting attributes from percentages to int or
+float values, base result on device's native orientation, not just
+the specified orientation that the attribute applies to.
+
+Part of fix for BMC#13264.
+---
+ src/corelib/style/mstylesheetattribute.cpp | 72 +++++++++++++++++-----------
+ src/corelib/style/mstylesheetattribute.h | 1 +
+ 2 files changed, 45 insertions(+), 28 deletions(-)
+
+diff --git a/src/corelib/style/mstylesheetattribute.cpp b/src/corelib/style/mstylesheetattribute.cpp
+index 22045d6..9376ccf 100644
+--- a/src/corelib/style/mstylesheetattribute.cpp
++++ b/src/corelib/style/mstylesheetattribute.cpp
+@@ -302,6 +302,46 @@ qint64 MStyleSheetAttribute::getPosition() const
+ return position;
+ }
+
++int MStyleSheetAttribute::maxValueForDevice(SizeAttributeType type, M::Orientation orientation)
++{
++ // Percentages must be based on the devices native orientation, so
++ // here we are returning the correct sizes based on the device AND the
++ // requested orientation.
++ //
++ // Another way of putting is, for portrait native devices:
++ // M::landscape == MDeviceProfile::instance()->resolution().height()
++ // While, for landscape native devices:
++ // M::landscape == MDeviceProfile::instance()->resolution().width()
++
++ if (MDeviceProfile::instance()->orientationFromAngle(M::Angle0) == M::Landscape) {
++ // native display orientation is landscape
++ if (orientation == M::Landscape) {
++ if (type == WidthAttribute)
++ return MDeviceProfile::instance()->resolution().width();
++ else
++ return MDeviceProfile::instance()->resolution().height();
++ } else {
++ if (type == WidthAttribute)
++ return MDeviceProfile::instance()->resolution().height();
++ else
++ return MDeviceProfile::instance()->resolution().width();
++ }
++ } else {
++ // native display orientation is portrait
++ if (orientation == M::Landscape) {
++ if (type == WidthAttribute)
++ return MDeviceProfile::instance()->resolution().height();
++ else
++ return MDeviceProfile::instance()->resolution().width();
++ } else {
++ if (type == WidthAttribute)
++ return MDeviceProfile::instance()->resolution().width();
++ else
++ return MDeviceProfile::instance()->resolution().height();
++ }
++ }
++}
++
+ int MStyleSheetAttribute::attributeToInt(const QByteArray &attribute, bool *conversionOk)
+ {
+ QByteArray value = attribute.trimmed();
+@@ -334,21 +374,9 @@ int MStyleSheetAttribute::attributeToInt(const QByteArray &attribute, bool *conv
+ QByteArray value = attribute.trimmed();
+
+ if (attribute.endsWith(units[PERCENT_UNIT])) {
+- int maximumValue = 0;
++ int maximumValue = maxValueForDevice(type, orientation);
+
+- if (orientation == M::Landscape) {
+- *cacheOrientation = LandscapeFlag;
+- if (type == WidthAttribute)
+- maximumValue = MDeviceProfile::instance()->resolution().width();
+- else
+- maximumValue = MDeviceProfile::instance()->resolution().height();
+- } else {
+- *cacheOrientation = PortraitFlag;
+- if (type == WidthAttribute)
+- maximumValue = MDeviceProfile::instance()->resolution().height();
+- else
+- maximumValue = MDeviceProfile::instance()->resolution().width();
+- }
++ *cacheOrientation = (orientation==M::Landscape) ? LandscapeFlag : PortraitFlag;
+
+ value.truncate(value.length() - 1);
+
+@@ -392,21 +419,9 @@ qreal MStyleSheetAttribute::attributeToFloat(const QByteArray &attribute, bool *
+ QByteArray value = attribute.trimmed();
+
+ if (attribute.endsWith(units[PERCENT_UNIT])) {
+- int maximumValue = 0;
++ int maximumValue = maxValueForDevice(type, orientation);
+
+- if (orientation == M::Landscape) {
+- *cacheOrientation = LandscapeFlag;
+- if (type == WidthAttribute)
+- maximumValue = MDeviceProfile::instance()->resolution().width();
+- else
+- maximumValue = MDeviceProfile::instance()->resolution().height();
+- } else {
+- *cacheOrientation = PortraitFlag;
+- if (type == WidthAttribute)
+- maximumValue = MDeviceProfile::instance()->resolution().height();
+- else
+- maximumValue = MDeviceProfile::instance()->resolution().width();
+- }
++ *cacheOrientation = (orientation==M::Landscape) ? LandscapeFlag : PortraitFlag;
+
+ value.truncate(value.length() - 1);
+
+diff --git a/src/corelib/style/mstylesheetattribute.h b/src/corelib/style/mstylesheetattribute.h
+index e1147bb..c6e0720 100644
+--- a/src/corelib/style/mstylesheetattribute.h
++++ b/src/corelib/style/mstylesheetattribute.h
+@@ -54,6 +54,7 @@ public:
+ MUniqueStringCache::Index getValueID() const;
+ qint64 getPosition() const;
+
++ static int maxValueForDevice(SizeAttributeType type, M::Orientation orientation);
+ static int attributeToInt(const QByteArray &attribute, bool *conversionOk);
+ static int attributeToInt(const QByteArray &attribute, bool *conversionOk, SizeAttributeType type, M::Orientation orientation, CacheOrientationFlags *cacheOrientation);
+ static qreal attributeToFloat(const QByteArray &attribute, bool *conversionOk);
+--
+1.7.2.2
+
++++++ BMC13246_0006-Changed-MSceneManager-remove-assumption-that-native-.patch (new)
--- BMC13246_0006-Changed-MSceneManager-remove-assumption-that-native-.patch
+++ BMC13246_0006-Changed-MSceneManager-remove-assumption-that-native-.patch
+From 468b551c869d64367bbb852393e06fdfd161230e Mon Sep 17 00:00:00 2001
+From: Shane Bryan <shane.bryan at linux.intel.com>
+Date: Tue, 8 Mar 2011 13:59:32 -0800
+Subject: [PATCH] Changed: MSceneManager - remove assumption that native orientation is landscape
+
+RevBy: Daniel d'Andrada
+ModifiedBy: Daniel d'Andrada
+ - using MDeviceProfile::orientationFromAngle() instead of
+ MDeviceProfile::deviceIsLandscape()
+ - removed MSceneManagerPrivave::orientation(), using
+ MDeviceProfile::orientationFromAngle() instead
+ - fixed changed made for setOrientationAngleWithoutAnimation()
+ - fixed eventEater size
+ - fixed orientation animation size
+Details: visibleSceneSize() and orientation() now return results based on
+both the current orientation and the devices native orientation.
+Changed several internal calls to visibleSceneSize() to not pass in
+M::Landscape explicitly, as this is no longer a valid assumption.
+Added "FIXME" comment where additional device native orientation may need
+consideration in calculateSceneWindowGeometry().
+
+Part of fix for BMC#13264.
+---
+ src/corelib/scene/mscenemanager.cpp | 64 +++++++++++++++++++---------------
+ src/corelib/scene/mscenemanager_p.h | 2 -
+ 2 files changed, 36 insertions(+), 30 deletions(-)
+
+diff --git a/src/corelib/scene/mscenemanager.cpp b/src/corelib/scene/mscenemanager.cpp
+index df3c0b4..0a4522a 100644
+--- a/src/corelib/scene/mscenemanager.cpp
++++ b/src/corelib/scene/mscenemanager.cpp
+@@ -142,7 +142,8 @@ void MSceneManagerPrivate::init(MScene *scene)
+
+ eventEater = new MSceneEventEater();
+ scene->addItem(eventEater);
+- eventEater->setGeometry(QRectF(QPointF(0.0, 0.0), q->visibleSceneSize(M::Landscape)));
++ QSize eventEaterSize = q->visibleSceneSize(MDeviceProfile::instance()->orientationFromAngle(M::Angle0));
++ eventEater->setGeometry(QRectF(QPointF(0.0, 0.0), eventEaterSize));
+ createOrientationAnimation();
+
+ initRelocator();
+@@ -183,7 +184,8 @@ void MSceneManagerPrivate::createOrientationAnimation()
+ {
+ Q_Q(MSceneManager);
+
+- QRectF visibleSceneRect = QRectF(QPointF(0.0, 0.0), q->visibleSceneSize(M::Landscape));
++ QRectF visibleSceneRect = QRectF(QPointF(0.0, 0.0),
++ q->visibleSceneSize(MDeviceProfile::instance()->orientationFromAngle(M::Angle0)));
+
+ //TODO: get this from theme
+ orientationAnimation = new MCrossFadedOrientationAnimation(visibleSceneRect);
+@@ -205,7 +207,8 @@ void MSceneManagerPrivate::initRelocator()
+ Q_Q(MSceneManager);
+
+ inputWidgetRelocator = QPointer<MInputWidgetRelocator>(
+- new MInputWidgetRelocator(scene, rootElement, orientation(newAngle)));
++ new MInputWidgetRelocator(scene, rootElement,
++ MDeviceProfile::instance()->orientationFromAngle(newAngle)));
+
+ // Register scene window scroller.
+ QSharedPointer<MSceneWindowScroller> sceneWindowScroller(new MSceneWindowScroller);
+@@ -312,13 +315,13 @@ void MSceneManagerPrivate::_q_changeGlobalOrientationAngle()
+ Q_Q(MSceneManager);
+
+ M::OrientationAngle oldAngle = angle;
+- M::Orientation oldOrientation = orientation(angle);
++ M::Orientation oldOrientation = MDeviceProfile::instance()->orientationFromAngle(angle);
+ angle = newAngle;
+
+ // Needs to be called on every angle change and before scene window geometries are changed.
+ inputWidgetRelocator->handleRotationBegin();
+
+- if (oldOrientation != orientation(angle)) {
++ if (oldOrientation != MDeviceProfile::instance()->orientationFromAngle(angle)) {
+ emit q->orientationAboutToChange(q->orientation());
+
+ notifyWidgetsAboutOrientationChange();
+@@ -585,11 +588,6 @@ void MSceneManager::ensureCursorVisible()
+ d->inputWidgetRelocator->update();
+ }
+
+-M::Orientation MSceneManagerPrivate::orientation(M::OrientationAngle angle) const
+-{
+- return (angle == M::Angle0 || angle == M::Angle180) ? M::Landscape : M::Portrait;
+-}
+-
+ void MSceneManagerPrivate::addUnmanagedSceneWindow(MSceneWindow *sceneWindow)
+ {
+ Q_Q(MSceneManager);
+@@ -625,7 +623,7 @@ void MSceneManagerPrivate::addSceneWindow(MSceneWindow *sceneWindow)
+ // Just add it
+ addUnmanagedSceneWindow(sceneWindow);
+ // This window was not receiving any events. Might not know about orientation change yet.
+- MOrientationChangeEvent event(orientation(angle));
++ MOrientationChangeEvent event(MDeviceProfile::instance()->orientationFromAngle(angle));
+ scene->sendEvent(sceneWindow, &event);
+ } else {
+ if (sceneWindow->d_func()->sceneManager != q) {
+@@ -926,7 +924,7 @@ void MSceneManagerPrivate::updateStatusBarGeometryProperty()
+
+ void MSceneManagerPrivate::notifyWidgetsAboutOrientationChange()
+ {
+- MOrientationChangeEvent event(orientation(angle));
++ MOrientationChangeEvent event(MDeviceProfile::instance()->orientationFromAngle(angle));
+
+ QList<QGraphicsItem *> sceneItems = scene->items();
+ for(int i = sceneItems.count() - 1; i >= 0; i--) {
+@@ -941,7 +939,7 @@ void MSceneManagerPrivate::notifyWidgetsAboutOrientationChange()
+ QRectF MSceneManagerPrivate::calculateAvailableSceneRect(MSceneWindow *sceneWindow) const
+ {
+ Q_Q(const MSceneManager);
+- QSizeF sceneSize = q->visibleSceneSize(orientation(angle));
++ QSizeF sceneSize = q->visibleSceneSize(MDeviceProfile::instance()->orientationFromAngle(angle));
+ QRectF availableSceneRect(QPointF(0,0), sceneSize);
+
+ if (sceneWindow->windowType() == MSceneWindow::Sheet
+@@ -1007,23 +1005,22 @@ void MSceneManagerPrivate::rotateToAngle(M::OrientationAngle newAngle)
+
+ void MSceneManagerPrivate::setOrientationAngleWithoutAnimation(M::OrientationAngle newAngle)
+ {
+- Q_Q(MSceneManager);
+-
+ this->newAngle = newAngle;
+ _q_changeGlobalOrientationAngle();
+
+- QSize landscapeScreenSize = q->visibleSceneSize(M::Landscape);
++ QSize nativeScreenSize = MDeviceProfile::instance()->resolution();
++ M::Orientation nativeOrientation = MDeviceProfile::instance()->orientationFromAngle(M::Angle0);
+
+ rootElement->setRotation(newAngle);
+- if (orientation(angle) == M::Landscape) {
++ if (MDeviceProfile::instance()->orientationFromAngle(newAngle) == nativeOrientation) {
+ rootElement->setPos(0, 0);
+- rootElement->setTransformOriginPoint(landscapeScreenSize.width() / 2,
+- landscapeScreenSize.height() / 2);
++ rootElement->setTransformOriginPoint(nativeScreenSize.width() / 2,
++ nativeScreenSize.height() / 2);
+ } else {
+- rootElement->setPos((landscapeScreenSize.width() - landscapeScreenSize.height()) / 2,
+- (landscapeScreenSize.height() - landscapeScreenSize.width()) / 2);
+- rootElement->setTransformOriginPoint(landscapeScreenSize.height() / 2,
+- landscapeScreenSize.width() / 2);
++ rootElement->setPos((nativeScreenSize.width() - nativeScreenSize.height()) / 2,
++ (nativeScreenSize.height() - nativeScreenSize.width()) / 2);
++ rootElement->setTransformOriginPoint(nativeScreenSize.height() / 2,
++ nativeScreenSize.width() / 2);
+ }
+
+ _q_emitOrientationChangeFinished();
+@@ -2327,7 +2324,7 @@ M::Orientation MSceneManager::orientation() const
+ {
+ Q_D(const MSceneManager);
+
+- return d->orientation(d->angle);
++ return MDeviceProfile::instance()->orientationFromAngle(d->angle);
+ }
+
+ M::OrientationAngle MSceneManager::orientationAngle() const
+@@ -2341,11 +2338,22 @@ QSize MSceneManager::visibleSceneSize(M::Orientation orientation) const
+ {
+ QSize s;
+
+- if (orientation == M::Landscape) {
+- s = MDeviceProfile::instance()->resolution();
++ if (MDeviceProfile::instance()->orientationFromAngle(M::Angle0) == M::Landscape) {
++ // native display orientation is landscape
++ if (orientation == M::Landscape)
++ s = QSize(MDeviceProfile::instance()->resolution().width(),
++ MDeviceProfile::instance()->resolution().height());
++ else
++ s = QSize(MDeviceProfile::instance()->resolution().height(),
++ MDeviceProfile::instance()->resolution().width());
+ } else {
+- s = QSize(MDeviceProfile::instance()->resolution().height(),
+- MDeviceProfile::instance()->resolution().width());
++ // native display orientation is portrait
++ if (orientation == M::Landscape)
++ s = QSize(MDeviceProfile::instance()->resolution().height(),
++ MDeviceProfile::instance()->resolution().width());
++ else
++ s = QSize(MDeviceProfile::instance()->resolution().width(),
++ MDeviceProfile::instance()->resolution().height());
+ }
+
+ return s;
+diff --git a/src/corelib/scene/mscenemanager_p.h b/src/corelib/scene/mscenemanager_p.h
+index 562c869..ff54141 100644
+--- a/src/corelib/scene/mscenemanager_p.h
++++ b/src/corelib/scene/mscenemanager_p.h
+@@ -108,8 +108,6 @@ public:
+ void destroyLayerEffectForSceneWindow(MSceneWindow *sceneWindow);
+ bool windowIntersectsRect(const QRectF &rect, MSceneWindow *window);
+
+- M::Orientation orientation(M::OrientationAngle angle) const;
+-
+ QRectF calculateAvailableSceneRect(MSceneWindow *sceneWindow) const;
+ QRectF calculateSceneWindowGeometry(MSceneWindow *window) const;
+ void setSceneWindowGeometry(MSceneWindow *window);
++++++ BMC13246_0007-Changed-MOrientationTrackerPrivate-remove-assumption.patch (new)
--- BMC13246_0007-Changed-MOrientationTrackerPrivate-remove-assumption.patch
+++ BMC13246_0007-Changed-MOrientationTrackerPrivate-remove-assumption.patch
+From 3749f269eef9ce3fc9893a223953b7a435c5893e Mon Sep 17 00:00:00 2001
+From: Shane Bryan <shane.bryan at linux.intel.com>
+Date: Tue, 8 Mar 2011 13:44:37 -0800
+Subject: [PATCH 7/9] Changed: MOrientationTrackerPrivate - remove assumption that native orientation is landscape
+
+RevBy: Daniel d'Andrada
+ModifiedBy: Daniel d'Andrada
+ - Made it use MDeviceProfile::orientationFromAngle() instead of own implementation.
+Details: Use device native orientation when calculating correct angles
+and orientations in rotateToAngleIfAllowed() and doUpdateOrientationAngle().
+Part of fix for BMC#13264.
+---
+ src/corelib/events/morientationtracker.cpp | 19 +++++++++----------
+ 1 files changed, 9 insertions(+), 10 deletions(-)
+
+diff --git a/src/corelib/events/morientationtracker.cpp b/src/corelib/events/morientationtracker.cpp
+index d1dc2a1..2727ac6 100644
+--- a/src/corelib/events/morientationtracker.cpp
++++ b/src/corelib/events/morientationtracker.cpp
+@@ -62,11 +62,8 @@ MOrientationTrackerPrivate::MOrientationTrackerPrivate(MOrientationTracker *cont
+ #endif //Q_WS_X11
+ {
+ if (MComponentData::isOrientationForced()) {
+- M::Orientation orientation = M::Landscape;
+-
+ currentAngle = MComponentData::forcedOrientationAngle();
+- if (currentAngle == M::Angle90 || currentAngle == M::Angle270)
+- orientation = M::Portrait;
++ M::Orientation orientation = MDeviceProfile::instance()->orientationFromAngle(currentAngle);
+
+ foreach(MWindow * window, MApplication::windows()) {
+ if (window->orientation() == orientation)
+@@ -205,9 +202,13 @@ void MOrientationTrackerPrivate::doUpdateOrientationAngle(M::OrientationAngle an
+ }
+ currentIsKeyboardOpen = isKeyboardOpen;
+
+- if (tvIsConnected) // TV forces landscape for now, no transformations
+- angle = M::Angle0;
+- else if (!MDeviceProfile::instance()->orientationAngleIsSupported(angle, isKeyboardOpen)) {
++ if (tvIsConnected) { // TV forces landscape for now, no transformations
++ if (MDeviceProfile::instance()->orientationFromAngle(M::Angle0) == M::Landscape) {
++ angle = M::Angle0;
++ } else {
++ angle = M::Angle270;
++ }
++ } else if (!MDeviceProfile::instance()->orientationAngleIsSupported(angle, isKeyboardOpen)) {
+ //it seems that orientation does not match allowed for current kybrd state.
+ //check if the previous one was ok:
+ if (MDeviceProfile::instance()->orientationAngleIsSupported(currentAngle, isKeyboardOpen)) {
+@@ -250,9 +251,7 @@ void MOrientationTrackerPrivate::doUpdateOrientationAngle(M::OrientationAngle an
+
+ void MOrientationTrackerPrivate::rotateToAngleIfAllowed(M::OrientationAngle angle, MWindow* window)
+ {
+- M::Orientation orientation = M::Landscape;
+- if (angle == M::Angle90 || angle == M::Angle270)
+- orientation = M::Portrait;
++ M::Orientation orientation = MDeviceProfile::instance()->orientationFromAngle(angle);
+ if (!window->isOrientationAngleLocked() &&
+ (!window->isOrientationLocked() || window->orientation() == orientation)) {
+ window->setOrientationAngle(angle);
+--
+1.7.2.2
+
++++++ BMC13246_0008-New-Adding-a-default-portrait-device-configuration.patch (new)
--- BMC13246_0008-New-Adding-a-default-portrait-device-configuration.patch
+++ BMC13246_0008-New-Adding-a-default-portrait-device-configuration.patch
+From acb33913e4f79d4b1667ed1bfd34cb07ba2a4d98 Mon Sep 17 00:00:00 2001
+From: Daniel d'Andrada <daniel.dandrada at nokia.com>
+Date: Mon, 21 Mar 2011 08:57:22 +0200
+Subject: [PATCH 8/9] New: Adding a default portrait device configuration
+
+RevBy: TrustMe
+Details: Same as Default.conf, but the X and Y resolution are swapped.
+I.e., the display native aspect ratio is portrait, whereas Default.conf
+it's landscape.
+---
+ src/data/targets/DefaultPortrait.conf | 11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+ create mode 100644 src/data/targets/DefaultPortrait.conf
+
+diff --git a/src/data/targets/DefaultPortrait.conf b/src/data/targets/DefaultPortrait.conf
+new file mode 100644
+index 0000000..a9a9015
+--- /dev/null
++++ b/src/data/targets/DefaultPortrait.conf
+@@ -0,0 +1,11 @@
++[resolution]
++X=480
++Y=854
++[ppi]
++X=254
++Y=254
++[allowedOrientations]
++keyboardOpen = 90
++keyboardClosed = 0,90
++[other]
++showStatusBar=true
+--
+1.7.2.2
+
++++++ BMC13246_0009-Revert-Changes-Do-not-rotate-the-dim-layer-effect-wi.patch (new)
--- BMC13246_0009-Revert-Changes-Do-not-rotate-the-dim-layer-effect-wi.patch
+++ BMC13246_0009-Revert-Changes-Do-not-rotate-the-dim-layer-effect-wi.patch
+From 8c21a597835ea1caec4e142209a9582f13e46e66 Mon Sep 17 00:00:00 2001
+From: Daniel d'Andrada <daniel.dandrada at nokia.com>
+Date: Mon, 21 Mar 2011 09:12:39 +0200
+Subject: [PATCH 9/9] Revert "Changes: Do not rotate the dim layer effect with the scene."
+
+This reverts commit 7b81e475017d1a3bbcee319b692bb84145c429a6.
+Details: It assumes that the native aspect ratio is landscape
+---
+ src/views/mscenelayereffectdimview.cpp | 15 ---------------
+ 1 files changed, 0 insertions(+), 15 deletions(-)
+
+diff --git a/src/views/mscenelayereffectdimview.cpp b/src/views/mscenelayereffectdimview.cpp
+index 94f2e2c..2505204 100644
+--- a/src/views/mscenelayereffectdimview.cpp
++++ b/src/views/mscenelayereffectdimview.cpp
+@@ -24,8 +24,6 @@
+ #include "mscenelayereffect.h"
+ #include "mscenelayereffectmodel.h"
+
+-#include "mscenemanager.h"
+-
+ //! \internal
+ class MSceneLayerEffectDimViewPrivate : public MSceneWindowViewPrivate
+ {
+@@ -39,7 +37,6 @@ MSceneLayerEffectDimView::MSceneLayerEffectDimView(MSceneLayerEffect *controller
+ {
+ Q_D(MSceneLayerEffectDimView);
+ d->controller = controller;
+-
+ d->controller->setFlag(QGraphicsItem::ItemDoesntPropagateOpacityToChildren, true);
+ }
+
+@@ -49,26 +46,14 @@ MSceneLayerEffectDimView::~MSceneLayerEffectDimView()
+
+ void MSceneLayerEffectDimView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+ {
+- Q_D(MSceneLayerEffectDimView);
+ Q_UNUSED(widget);
+ Q_UNUSED(option);
+
+ qreal oldOpacity = painter->opacity();
+ qreal opacity = d_ptr->controller->effectiveOpacity() * style()->opacity();
+-
+- QTransform oldTransform = painter->transform();
+- QTransform transform;
+- if (d->controller->sceneManager() && d->controller->sceneManager()->orientation() == M::Portrait) {
+- transform.translate(0, boundingRect().width());
+- transform.rotate(-90);
+- }
+-
+- painter->setTransform(transform);
+ painter->setOpacity(opacity);
+ painter->fillRect(boundingRect(), QColor(0, 0, 0));
+ painter->setOpacity(oldOpacity);
+-
+- painter->setTransform(oldTransform);
+ }
+
+ QRectF MSceneLayerEffectDimView::boundingRect() const
+--
+1.7.2.2
+
++++++ libmeegotouch.yaml
--- libmeegotouch.yaml
+++ libmeegotouch.yaml
@@ -13,7 +13,15 @@
- BMC_12753_temp_solve_statusbar_height.patch
- BMC_8268_show_statusbar_on_n900.patch
- BMC_12929_meegographicssystem.patch
- - BMC14407_MTextEdit_prompt_only_visible_when_text_edit_not_focused.patch
+ - BMC13246_0001-New-MDeviceProfile-orientationFromAngle.patch
+ - BMC13246_0002-Changes-Code-cosmetics.-Removing-trailing-whitespace.patch
+ - BMC13246_0003-Changes-MWindow-Remove-assumption-that-Angle0-is-Lan.patch
+ - BMC13246_0004-Changed-MTheme-remove-assumption-that-default-orient.patch
+ - BMC13246_0005-Changed-MStyleSheetAttribute-consider-device-s-nativ.patch
+ - BMC13246_0006-Changed-MSceneManager-remove-assumption-that-native-.patch
+ - BMC13246_0007-Changed-MOrientationTrackerPrivate-remove-assumption.patch
+ - BMC13246_0008-New-Adding-a-default-portrait-device-configuration.patch
+ - BMC13246_0009-Revert-Changes-Do-not-rotate-the-dim-layer-effect-wi.patch
Description: |
Qt based MeeGo Touch Framework for developing touch based user interfaces.
Requires:
++++++ deleted files:
--- BMC14407_MTextEdit_prompt_only_visible_when_text_edit_not_focused.patch
More information about the MeeGo-commits
mailing list