summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qt_s60_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qt_s60_p.h')
-rw-r--r--src/gui/kernel/qt_s60_p.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index ada52a0..96b8141 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -77,6 +77,7 @@
#include <akncontext.h> // CAknContextPane
#include <eikspane.h> // CEikStatusPane
#include <AknPopupFader.h> // MAknFadedComponent and TAknPopupFader
+#include <bitstd.h> // EGraphicsOrientation constants
#ifdef QT_SYMBIAN_HAVE_AKNTRANSEFFECT_H
#include <gfxtranseffect/gfxtranseffect.h> // BeginFullScreen
#include <akntranseffect.h> // BeginFullScreen
@@ -97,6 +98,10 @@ static const int qt_symbian_max_screens = 4;
//this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2
#define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13)
+class QSymbianTypeFaceExtras;
+typedef QHash<QString, const QSymbianTypeFaceExtras *> QSymbianTypeFaceExtrasHash;
+typedef void (*QThreadLocalReleaseFunc)();
+
class Q_AUTOTEST_EXPORT QS60ThreadLocalData
{
public:
@@ -105,6 +110,8 @@ public:
bool usingCONEinstances;
RWsSession wsSession;
CWsScreenDevice *screenDevice;
+ QSymbianTypeFaceExtrasHash fontData;
+ QVector<QThreadLocalReleaseFunc> releaseFuncs;
};
class QS60Data
@@ -178,6 +185,8 @@ public:
inline CWsScreenDevice* screenDevice(const QWidget *widget);
inline CWsScreenDevice* screenDevice(int screenNumber);
static inline int screenNumberForWidget(const QWidget *widget);
+ inline QSymbianTypeFaceExtrasHash& fontData();
+ inline void addThreadLocalReleaseFunc(QThreadLocalReleaseFunc func);
static inline CCoeAppUi* appUi();
static inline CEikMenuBar* menuBar();
#ifdef Q_WS_S60
@@ -205,6 +214,14 @@ public:
int nativeScreenWidthInPixels;
int nativeScreenHeightInPixels;
+ enum ScreenRotation {
+ ScreenRotation0, // portrait (or the native orientation)
+ ScreenRotation90, // typically DisplayLeftUp landscape
+ ScreenRotation180, // not used
+ ScreenRotation270 // DisplayRightUp landscape when 3-way orientation is supported
+ };
+ ScreenRotation screenRotation;
+
int beginFullScreenCalled : 1;
int endFullScreenCalled : 1;
};
@@ -376,6 +393,24 @@ inline void QS60Data::updateScreenSize()
inches = S60->screenWidthInTwips / (TReal)KTwipsPerInch;
S60->defaultDpiX = S60->screenWidthInPixels / inches;
+ switch (params.iRotation) {
+ case CFbsBitGc::EGraphicsOrientationNormal:
+ S60->screenRotation = ScreenRotation0;
+ break;
+ case CFbsBitGc::EGraphicsOrientationRotated90:
+ S60->screenRotation = ScreenRotation90;
+ break;
+ case CFbsBitGc::EGraphicsOrientationRotated180:
+ S60->screenRotation = ScreenRotation180;
+ break;
+ case CFbsBitGc::EGraphicsOrientationRotated270:
+ S60->screenRotation = ScreenRotation270;
+ break;
+ default:
+ S60->screenRotation = ScreenRotation0;
+ break;
+ }
+
int screens = S60->screenCount();
for (int i = 0; i < screens; ++i) {
CWsScreenDevice *dev = S60->screenDevice(i);
@@ -478,6 +513,24 @@ inline int QS60Data::screenNumberForWidget(const QWidget *widget)
return qt_widget_private(const_cast<QWidget *>(w))->symbianScreenNumber;
}
+inline QSymbianTypeFaceExtrasHash& QS60Data::fontData()
+{
+ if (!tls.hasLocalData()) {
+ tls.setLocalData(new QS60ThreadLocalData);
+ }
+ return tls.localData()->fontData;
+}
+
+inline void QS60Data::addThreadLocalReleaseFunc(QThreadLocalReleaseFunc func)
+{
+ if (!tls.hasLocalData()) {
+ tls.setLocalData(new QS60ThreadLocalData);
+ }
+ QS60ThreadLocalData *data = tls.localData();
+ if (!data->releaseFuncs.contains(func))
+ data->releaseFuncs.append(func);
+}
+
inline CCoeAppUi* QS60Data::appUi()
{
return CCoeEnv::Static()-> AppUi();