summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qt_s60_p.h
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-06-04 16:31:49 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-06-04 16:31:49 (GMT)
commit7b9b55e3a0deb69a6ff04ee9b76840a5f8d11545 (patch)
tree67cdc97b929e03f318539eeba18c6a66580034bc /src/gui/kernel/qt_s60_p.h
parentda7b5677262254aada234ac2c71d54d8fee3c711 (diff)
downloadQt-7b9b55e3a0deb69a6ff04ee9b76840a5f8d11545.zip
Qt-7b9b55e3a0deb69a6ff04ee9b76840a5f8d11545.tar.gz
Qt-7b9b55e3a0deb69a6ff04ee9b76840a5f8d11545.tar.bz2
Fix up the display mode conversion function.
Few things here: - Add support for EGray2 and EGray256 - Change the define to disable EColor16MAP for old SDKs - Make the default case return Invalid instead of a fatal error - Fix indentation, tabs -> spaces
Diffstat (limited to 'src/gui/kernel/qt_s60_p.h')
-rw-r--r--src/gui/kernel/qt_s60_p.h65
1 files changed, 34 insertions, 31 deletions
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index aed8241..d2fa5da 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -242,37 +242,40 @@ static inline QFont qt_TFontSpec2QFontL(const TFontSpec &fontSpec)
static inline QImage::Format qt_TDisplayMode2Format(TDisplayMode mode)
{
- QImage::Format format;
- switch(mode) {
- case EColor256:
- // TODO: is the correct?
- format = QImage::Format_Indexed8;
- break;
- case EColor4K:
- format = QImage::Format_RGB444;
- break;
- case EColor64K:
- format = QImage::Format_RGB16;
- break;
- case EColor16M:
- format = QImage::Format_RGB666;
- break;
- case EColor16MU:
- format = QImage::Format_RGB32;
- break;
- case EColor16MA:
- format = QImage::Format_ARGB32;
- break;
-#ifdef __S60_50__
- case EColor16MAP:
- format = QImage::Format_ARGB32_Premultiplied;
- break;
-#endif
- default:
- qFatal("Screen format not supported");
- break;
- }
- return format;
+ QImage::Format format;
+ switch(mode) {
+ case EGray2:
+ format = QImage::Format_MonoLSB;
+ break;
+ case EColor256:
+ case EGray256:
+ format = QImage::Format_Indexed8;
+ break;
+ case EColor4K:
+ format = QImage::Format_RGB444;
+ break;
+ case EColor64K:
+ format = QImage::Format_RGB16;
+ break;
+ case EColor16M:
+ format = QImage::Format_RGB666;
+ break;
+ case EColor16MU:
+ format = QImage::Format_RGB32;
+ break;
+ case EColor16MA:
+ format = QImage::Format_ARGB32;
+ break;
+#if !defined(__SERIES60_31__) && !defined(__S60_32__)
+ case EColor16MAP:
+ format = QImage::Format_ARGB32_Premultiplied;
+ break;
+#endif
+ default:
+ format = QImage::Format_Invalid;
+ break;
+ }
+ return format;
}