From 7d1cd5c66fe4c203873e8e99fab516a7bd48292a Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Mon, 4 May 2015 17:48:19 +0900 Subject: [PATCH] rotary: added rotary image XML schema for Qt UI
... rotary.png
And modified some logs. Change-Id: Ic332eff6b6cd58d5ac080c1c9b60b92207ba92aa Signed-off-by: GiWoong Kim --- tizen/src/display/xmllayoutparser.cpp | 32 ++++++++++++++-------- tizen/src/ui/layout/mainform.h | 1 + .../skins/wearableO-360x360-1btn/layout.xml | 4 +++ tizen/src/ui/skinpainter.cpp | 2 +- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/tizen/src/display/xmllayoutparser.cpp b/tizen/src/display/xmllayoutparser.cpp index fa627fe..dba4d35 100644 --- a/tizen/src/display/xmllayoutparser.cpp +++ b/tizen/src/display/xmllayoutparser.cpp @@ -42,6 +42,7 @@ #define NORMAL_IMG_KEYWORD "normalImage" #define PRESSED_IMG_KEYWORD "pressedImage" #define MASK_IMG_KEYWORD "maskImage" +#define ROTARY_IMG_KEYWORD "rotaryImage" #define KEYLIST_KEYWORD "keyList" #define HOVER_KEYWORD "hover" #define FORM_KEYWORD "form" @@ -158,7 +159,7 @@ DisplayType *XmlLayoutParser::parseDisplay(QXmlStreamReader &xml) } else if (xml.name() == MASK_IMG_KEYWORD) { /* display mask */ QString maskImageFileName = xml.readElementText(); - qDebug() << "- maskImage :" << maskImageFileName; + qDebug() << "-" << MASK_IMG_KEYWORD << ":" << maskImageFileName; if (maskImage.load( xmlPath + QDir::separator() + maskImageFileName) == false) { @@ -256,7 +257,7 @@ MainForm *XmlLayoutParser::parseMainForm(QXmlStreamReader &xml) } else if (xml.name() == NORMAL_IMG_KEYWORD) { /* normal image */ QString normalImageFileName = xml.readElementText(); - qDebug() << "- normalImage :" << normalImageFileName; + qDebug() << "-" << NORMAL_IMG_KEYWORD << ":" << normalImageFileName; if (form->skinImg[MainForm::normal].load( xmlPath + QDir::separator() + normalImageFileName) == false) { @@ -265,16 +266,25 @@ MainForm *XmlLayoutParser::parseMainForm(QXmlStreamReader &xml) } else if (xml.name() == PRESSED_IMG_KEYWORD) { /* key pressed image */ QString pressedImageFileName = xml.readElementText(); - qDebug() << "- pressedImage :" << pressedImageFileName; + qDebug() << "-" << PRESSED_IMG_KEYWORD << ":" << pressedImageFileName; if (form->skinImg[MainForm::pressed].load( xmlPath + QDir::separator() + pressedImageFileName) == false) { qWarning() << "failed to load pressed image"; } + } else if (xml.name() == ROTARY_IMG_KEYWORD) { + /* rotary image */ + QString rotaryImageFileName = xml.readElementText(); + qDebug() << "-" << ROTARY_IMG_KEYWORD << ":" << rotaryImageFileName; + + if (form->rotaryImg.load( + xmlPath + QDir::separator() + rotaryImageFileName) == false) { + qWarning() << "failed to load rotary image"; + } } else if (xml.name() == KEYLIST_KEYWORD) { /* HW keys */ int cnt = parseKeyList(xml, form->keyList); - qDebug("- keyList : %d", cnt); + qDebug() << "-" << KEYLIST_KEYWORD << ":" << cnt; } else { qWarning() << "undefined element :" << xml.name(); } @@ -303,7 +313,7 @@ int XmlLayoutParser::parseMainFormList( if (form != NULL) { /* image validation */ if (form->skinImg[MainForm::normal].size() == QSize(0, 0)) { - qDebug("general purpose skin form"); + qDebug("- general purpose skin form"); SkinPainter painter("main-skin", uiInfo->resolution, form->displayType->getAngle(), @@ -553,10 +563,10 @@ QString XmlLayoutParser::parseEmulatorUI(QXmlStreamReader &xml) continue; } else if (xml.name() == FORMLIST_KEYWORD) { int cnt = parseMainFormList(xml, uiInfo->mainFormList); - qDebug("formList : %d", cnt); + qDebug() << FORMLIST_KEYWORD << ":" << cnt; } else if (xml.name() == MENULIST_KEYWORD) { int cnt = parseMenuList(xml, uiInfo->menuList); - qDebug("menuList : %d", cnt); + qDebug() << MENULIST_KEYWORD << ":" << cnt; } } } @@ -583,7 +593,7 @@ ControllerForm *XmlLayoutParser::parseControllerForm(QXmlStreamReader &xml) if (xml.name() == NORMAL_IMG_KEYWORD) { /* normal image */ QString normalImageFileName = xml.readElementText(); - qDebug() << "- normalImage :" << normalImageFileName; + qDebug() << "-" << NORMAL_IMG_KEYWORD << ":" << normalImageFileName; if (form->conImg[ControllerForm::normal].load( xmlPath + QDir::separator() + normalImageFileName) == false) { @@ -592,7 +602,7 @@ ControllerForm *XmlLayoutParser::parseControllerForm(QXmlStreamReader &xml) } else if (xml.name() == PRESSED_IMG_KEYWORD) { /* key pressed image */ QString pressedImageFileName = xml.readElementText(); - qDebug() << "- pressedImage :" << pressedImageFileName; + qDebug() << "-" << PRESSED_IMG_KEYWORD << ":" << pressedImageFileName; if (form->conImg[ControllerForm::pressed].load( xmlPath + QDir::separator() + pressedImageFileName) == false) { @@ -601,7 +611,7 @@ ControllerForm *XmlLayoutParser::parseControllerForm(QXmlStreamReader &xml) } else if (xml.name() == KEYLIST_KEYWORD) { /* HW keys */ int cnt = parseKeyList(xml, form->keyList); - qDebug("- keyList : %d", cnt); + qDebug() << "-" << KEYLIST_KEYWORD << ":" << cnt; } else if (xml.name() == HOVER_KEYWORD) { /* hover */ form->setHoverType(parseHover(xml)); @@ -645,7 +655,7 @@ QString XmlLayoutParser::parseControllerUI(QXmlStreamReader &xml) if (form != NULL) { /* image validation */ if (form->conImg[ControllerForm::normal].size() == QSize(0, 0)) { - qDebug("general purpose con form"); + qDebug("- general purpose con form"); int keyCount = form->keyList.count(); diff --git a/tizen/src/ui/layout/mainform.h b/tizen/src/ui/layout/mainform.h index 9de052b..fd097f8 100644 --- a/tizen/src/ui/layout/mainform.h +++ b/tizen/src/ui/layout/mainform.h @@ -46,6 +46,7 @@ public: DisplayType *displayType; QImage skinImg[2]; + QImage rotaryImg; QList keyList; enum SkinImgType { diff --git a/tizen/src/ui/resource/skins/wearableO-360x360-1btn/layout.xml b/tizen/src/ui/resource/skins/wearableO-360x360-1btn/layout.xml index 944a101..736a0a6 100644 --- a/tizen/src/ui/resource/skins/wearableO-360x360-1btn/layout.xml +++ b/tizen/src/ui/resource/skins/wearableO-360x360-1btn/layout.xml @@ -10,6 +10,7 @@ default_0.png default_0_p.png + rotary_default_0.png @@ -27,6 +28,7 @@ default_L90.png default_L90_p.png + rotary_default_L90.png @@ -44,6 +46,7 @@ default_180.png default_180_p.png + rotary_default_180.png @@ -61,6 +64,7 @@ default_R90.png default_R90_p.png + rotary_default_R90.png diff --git a/tizen/src/ui/skinpainter.cpp b/tizen/src/ui/skinpainter.cpp index cdeeb30..3845514 100644 --- a/tizen/src/ui/skinpainter.cpp +++ b/tizen/src/ui/skinpainter.cpp @@ -45,7 +45,7 @@ SkinPainter::SkinPainter(QString patchPath, QSize centerPatch, int degree, void SkinPainter::drawSkin(QString patchPath, QSize center, int degree, QPoint tagLeftTop, QColor tagColor) { - qDebug() << "load skin patch from :" << patchPath; + qDebug() << "load skin patches from :" << patchPath; QImage LT(patchPath + "LT.png"); QImage LC(patchPath + "LC.png"); -- 2.7.4