ui: modify the class name to avoid confusing 92/25492/2
authorGiWoong Kim <giwoong.kim@samsung.com>
Wed, 6 Aug 2014 05:36:26 +0000 (14:36 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 7 Aug 2014 05:56:52 +0000 (22:56 -0700)
layout -> form

Change-Id: I1d1c57e716df7fedcadbd3baf1cbdd4490c2b273
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
29 files changed:
tizen/src/display/qt5_supplement.cpp
tizen/src/ui/Makefile.objs
tizen/src/ui/controllerform.cpp [new file with mode: 0644]
tizen/src/ui/controllerform.h [new file with mode: 0644]
tizen/src/ui/controllerlayout.cpp [deleted file]
tizen/src/ui/controllerlayout.h [deleted file]
tizen/src/ui/controllerwidget.cpp
tizen/src/ui/controllerwidget.h
tizen/src/ui/displaywidget.cpp
tizen/src/ui/mainwindow.cpp
tizen/src/ui/menu/contextmenu.cpp
tizen/src/ui/resource/mobile-720x1280-3btn/layout.qml
tizen/src/ui/resource/wearable-320x320-1btn/layout.qml
tizen/src/ui/skincontrollerview.cpp
tizen/src/ui/skincontrollerview.h
tizen/src/ui/skinform.cpp [new file with mode: 0644]
tizen/src/ui/skinform.h [new file with mode: 0644]
tizen/src/ui/skinlayout.cpp [deleted file]
tizen/src/ui/skinlayout.h [deleted file]
tizen/src/ui/skinview.cpp
tizen/src/ui/uiinformation.cpp
tizen/src/ui/uiinformation.h
tizen/src/ui/uistate.cpp
tizen/src/ui/uistate.h
tizen/src/ui/xml/Makefile.objs
tizen/src/ui/xml/formtype.cpp [new file with mode: 0644]
tizen/src/ui/xml/formtype.h [new file with mode: 0644]
tizen/src/ui/xml/layouttype.cpp [deleted file]
tizen/src/ui/xml/layouttype.h [deleted file]

index c3be0733a23b81bcd7bb29844f494544f602fd6f..7f4b2337fb7b898bf3c2436ddc87383aec3484ab 100644 (file)
@@ -40,7 +40,7 @@
 #include "controllerwidget.h"
 #include "ui/xml/hardwarekeytype.h"
 #include "ui/xml/keylisttype.h"
-#include "ui/xml/layouttype.h"
+#include "ui/xml/formtype.h"
 
 extern "C" {
 #include "emul_state.h"
@@ -48,8 +48,8 @@ extern "C" {
 
 //using namespace std;
 void qMessageOutput(QtMsgType, const QMessageLogContext &, const QString &);
-void loadSkinLayoutFromXML(QFile *, UIInformation *);
-void loadControllerLayoutFromXML(QFile *, UIInformation *);
+void loadSkinFormFromXML(QFile *, UIInformation *);
+void loadControllerFormFromXML(QFile *, UIInformation *);
 
 static QApplication *app;
 
@@ -60,7 +60,7 @@ static MainWindow *mainwindow;
 static UIInformation *uiInfo;
 
 #define FORM_FILE_NAME "layout.qml"
-#define CON_FORM_SUBPATH "controller-layout"
+#define CON_FORM_SUBPATH "controller"
 
 void qt5_skin_init(void)
 {
@@ -88,7 +88,7 @@ void qt5_skin_init(void)
     }
     uiInfo->skinName = skinName;
 
-    uiInfo->uiState.layoutScale = 50;
+    uiInfo->uiState.formScale = 50;
 
     /* XML */
     // TODO: convert QML to XML
@@ -100,14 +100,14 @@ void qt5_skin_init(void)
 
     /* load skin form */
     QFile skinXMLFile(uiInfo->skinPath + FORM_FILE_NAME);
-    loadSkinLayoutFromXML(&skinXMLFile, uiInfo);
+    loadSkinFormFromXML(&skinXMLFile, uiInfo);
 
     /* load controller forms */
     QDir skinDir(uiInfo->skinPath + CON_FORM_SUBPATH);
     QFileInfoList entries = skinDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
     for (int i = 0; i < entries.size(); i++) {
         QFile conXMLFile(entries.at(i).filePath() + '/' + FORM_FILE_NAME);
-        loadControllerLayoutFromXML(&conXMLFile, uiInfo);
+        loadControllerFormFromXML(&conXMLFile, uiInfo);
     }
 
     /* GUI */
@@ -190,7 +190,7 @@ void qMessageOutput(QtMsgType type, const QMessageLogContext &context, const QSt
     }
 }
 
-void loadSkinLayoutFromXML(QFile *file, UIInformation *uiInfo/* out */)
+void loadSkinFormFromXML(QFile *file, UIInformation *uiInfo/* out */)
 {
     if (file->exists() == false) {
         qFatal("%s is not found", qPrintable(file->fileName()));
@@ -198,7 +198,7 @@ void loadSkinLayoutFromXML(QFile *file, UIInformation *uiInfo/* out */)
 
     qDebug("skin form is loaded from %s", qPrintable(file->fileName()));
 
-    qmlRegisterType<LayoutType>("EmulatorComponent", 1, 0, "Layout");
+    qmlRegisterType<FormType>("EmulatorComponent", 1, 0, "Form");
 
     /* QML */
     QQmlEngine *engine = new QQmlEngine();
@@ -214,35 +214,35 @@ void loadSkinLayoutFromXML(QFile *file, UIInformation *uiInfo/* out */)
         QFileInfo fileInfo(*file);
         qDebug() << "xml version :" << QQmlProperty::read(object, "version").toString();
 
-        LayoutType *layoutType = NULL;
+        FormType *formType = NULL;
         KeyListType *keyListType = NULL;
         HardwareKeyType *hwKeyType = NULL;
 
-        QObjectList layoutTypeList = object->children();
-        for (int index = 0; index < layoutTypeList.count(); index++) {
-            SkinLayout *layout = new SkinLayout(); /* dst */
+        QObjectList formTypeList = object->children();
+        for (int index = 0; index < formTypeList.count(); index++) {
+            SkinForm *form = new SkinForm(); /* dst */
 
-            layoutType = (LayoutType *)layoutTypeList.at(index); /* src */
+            formType = (FormType *)formTypeList.at(index); /* src */
 
-            layout->displayRegion = layoutType->displayRegion();
-            layout->skinImg[SkinLayout::normal].load(
-                        fileInfo.absolutePath() + "/" + layoutType->mainImageName());
-            layout->skinImg[SkinLayout::pressed].load(
-                        fileInfo.absolutePath() + "/" + layoutType->pressedImageName());
+            form->displayRegion = formType->displayRegion();
+            form->skinImg[SkinForm::normal].load(
+                        fileInfo.absolutePath() + "/" + formType->mainImageName());
+            form->skinImg[SkinForm::pressed].load(
+                        fileInfo.absolutePath() + "/" + formType->pressedImageName());
 
-            keyListType = layoutType->keyListType();
+            keyListType = formType->keyListType();
             if (keyListType != NULL) {
                 for (int i = 0; i < keyListType->list.count(); i++) {
                     hwKeyType = keyListType->list.at(i);
                     if (hwKeyType != NULL) {
-                        layout->keyList.append(
+                        form->keyList.append(
                                     new HardwareKey(hwKeyType->objectName(), hwKeyType->keycode(),
                                                     hwKeyType->region(), hwKeyType->tooltip()));
                     }
                 }
             }
 
-            uiInfo->layoutList.append(layout);
+            uiInfo->formList.append(form);
         }
 
         delete object;
@@ -252,7 +252,7 @@ void loadSkinLayoutFromXML(QFile *file, UIInformation *uiInfo/* out */)
     delete engine;
 }
 
-void loadControllerLayoutFromXML(QFile *file, UIInformation *uiInfo/* out */)
+void loadControllerFormFromXML(QFile *file, UIInformation *uiInfo/* out */)
 {
     if (file->exists() == false) {
         qWarning("%s is not found", qPrintable(file->fileName()));
@@ -275,29 +275,29 @@ void loadControllerLayoutFromXML(QFile *file, UIInformation *uiInfo/* out */)
         QFileInfo fileInfo(*file);
         qDebug() << "xml version :" << QQmlProperty::read(object, "version").toString();
 
-        LayoutType *layoutType = (LayoutType *)object;
+        FormType *formType = (FormType *)object;
         KeyListType *keyListType = NULL;
         HardwareKeyType *hwKeyType = NULL;
 
-        ControllerLayout *layout = new ControllerLayout(fileInfo.dir().dirName());
-        layout->conImg[ControllerLayout::normal].load(
-            fileInfo.absolutePath() + "/" + layoutType->mainImageName());
-        layout->conImg[ControllerLayout::pressed].load(
-            fileInfo.absolutePath() + "/" + layoutType->pressedImageName());
+        ControllerForm *form = new ControllerForm(fileInfo.dir().dirName());
+        form->conImg[ControllerForm::normal].load(
+            fileInfo.absolutePath() + "/" + formType->mainImageName());
+        form->conImg[ControllerForm::pressed].load(
+            fileInfo.absolutePath() + "/" + formType->pressedImageName());
 
-        keyListType = layoutType->keyListType();
+        keyListType = formType->keyListType();
         if (keyListType != NULL) {
             for (int i = 0; i < keyListType->list.count(); i++) {
                 hwKeyType = keyListType->list.at(i);
                 if (hwKeyType != NULL) {
-                    layout->keyList.append(
+                    form->keyList.append(
                                 new HardwareKey(hwKeyType->objectName(), hwKeyType->keycode(),
                                                 hwKeyType->region(), hwKeyType->tooltip()));
                 }
             }
         }
 
-        uiInfo->controllerList.append(layout);
+        uiInfo->controllerList.append(form);
 
         delete object;
     }
index 8034a6516dd9cb7edd2c4e8c6985c6ded17e1e6f..a33417671d340b3969f306d69eb49de5e51fe718 100644 (file)
@@ -5,7 +5,7 @@ $(obj)/qrc_resource.o: $(obj)/qrc_resource.cpp
 $(obj)/qrc_resource.cpp: $(TIZEN_UI)/resource/resource.qrc
        rcc -name resource $< -o $@
 
-obj-$(CONFIG_QT) += controllerlayout.o
+obj-$(CONFIG_QT) += controllerform.o
 obj-$(CONFIG_QT) += controllerwidget.o moc_controllerwidget.o
 obj-$(CONFIG_QT) += displaywidget.o moc_displaywidget.o
 obj-$(CONFIG_QT) += hardwarekey.o
@@ -13,7 +13,7 @@ obj-$(CONFIG_QT) += mainwindow.o moc_mainwindow.o
 obj-$(CONFIG_QT) += skinbezelitem.o
 obj-$(CONFIG_QT) += skincontrollerview.o
 obj-$(CONFIG_QT) += skinkeyitem.o
-obj-$(CONFIG_QT) += skinlayout.o
+obj-$(CONFIG_QT) += skinform.o
 obj-$(CONFIG_QT) += skinview.o
 obj-$(CONFIG_QT) += uiinformation.o
 obj-$(CONFIG_QT) += uistate.o
diff --git a/tizen/src/ui/controllerform.cpp b/tizen/src/ui/controllerform.cpp
new file mode 100644 (file)
index 0000000..63bcd66
--- /dev/null
@@ -0,0 +1,11 @@
+#include "controllerform.h"
+
+ControllerForm::ControllerForm(QString name)
+{
+    this->name = name;
+}
+
+ControllerForm::~ControllerForm()
+{
+    qDebug("destroy con layout");
+}
diff --git a/tizen/src/ui/controllerform.h b/tizen/src/ui/controllerform.h
new file mode 100644 (file)
index 0000000..79f9e03
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef CONTROLLERFORM_H
+#define CONTROLLERFORM_H
+
+#include <QWidget>
+
+#include "hardwarekey.h"
+
+class ControllerForm
+{
+    Q_ENUMS(ConImgType)
+
+public:
+    ControllerForm(QString name);
+    ~ControllerForm();
+
+    QString name;
+    QImage conImg[2];
+    QList<HardwareKey *> keyList;
+
+    enum ConImgType {
+        normal = 0,
+        pressed = 1
+    };
+};
+
+#endif // CONTROLLERFORM_H
diff --git a/tizen/src/ui/controllerlayout.cpp b/tizen/src/ui/controllerlayout.cpp
deleted file mode 100644 (file)
index 0b2269a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "controllerlayout.h"
-
-ControllerLayout::ControllerLayout(QString name)
-{
-    this->name = name;
-}
-
-ControllerLayout::~ControllerLayout()
-{
-    qDebug("destroy con layout");
-}
diff --git a/tizen/src/ui/controllerlayout.h b/tizen/src/ui/controllerlayout.h
deleted file mode 100644 (file)
index b993aff..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef CONTROLLERLAYOUT_H
-#define CONTROLLERLAYOUT_H
-
-#include <QWidget>
-
-#include "hardwarekey.h"
-
-class ControllerLayout
-{
-    Q_ENUMS(ConImgType)
-
-public:
-    ControllerLayout(QString name);
-    ~ControllerLayout();
-
-    QString name;
-    QImage conImg[2];
-    QList<HardwareKey *> keyList;
-
-    enum ConImgType {
-        normal = 0,
-        pressed = 1
-    };
-};
-
-#endif // CONTROLLERLAYOUT_H
index f379e37641581d9fc732289300bc977dc661ba3b..4f150ccd70359e83937d2a7d87eaba726bd19fc0 100644 (file)
@@ -2,16 +2,16 @@
 
 #include "controllerwidget.h"
 
-ControllerWidget::ControllerWidget(ControllerLayout *conLayout, QWidget *parent) :
+ControllerWidget::ControllerWidget(ControllerForm *conForm, QWidget *parent) :
     QLabel(parent)
 {
-    this->conLayout = conLayout;
+    this->conForm = conForm;
 
     setStyleSheet("border-style: none");
     setWindowFlags(Qt::FramelessWindowHint);
     setAttribute(Qt::WA_DeleteOnClose);
 
-    setWindowTitle(conLayout->name);
+    setWindowTitle(conForm->name);
 
     QHBoxLayout *layout = new QHBoxLayout(this);
     layout->setMargin(0);
@@ -19,14 +19,14 @@ ControllerWidget::ControllerWidget(ControllerLayout *conLayout, QWidget *parent)
 
     QGraphicsScene *conScene = new QGraphicsScene(this);
 
-    conView = new SkinControllerView(conLayout, conScene, this);
+    conView = new SkinControllerView(conForm, conScene, this);
     conView->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
     layout->addWidget(conView);
 }
 
 void ControllerWidget::showEvent(QShowEvent *event)
 {
-    setRegion(conLayout->conImg[ControllerLayout::normal]);
+    setRegion(conForm->conImg[ControllerForm::normal]);
 }
 
 void ControllerWidget::setRegion(QImage baseImage)
index 60ef55f55008030d7e30ca802fb52086a816b916..be18a3297a03f26d3cf4be975b64f2497195bc48 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <QLabel>
 
-#include "controllerlayout.h"
+#include "controllerform.h"
 #include "skincontrollerview.h"
 
 class ControllerWidget : public QLabel
@@ -11,7 +11,7 @@ class ControllerWidget : public QLabel
     Q_OBJECT
 
 public:
-    explicit ControllerWidget(ControllerLayout *conLayout, QWidget *parent = 0);
+    explicit ControllerWidget(ControllerForm *conForm, QWidget *parent = 0);
     ~ControllerWidget();
 
 protected:
@@ -21,7 +21,7 @@ protected:
 
 private:
     SkinControllerView *conView;
-    ControllerLayout *conLayout;
+    ControllerForm *conForm;
 };
 
 #endif // CONTROLLERWIDGET_H
index e620c548aad74a65024c2b2ca7a423ffc1f74e97..a0ef1fc4d64ef0ae07d79884db3ba5346ced772f 100644 (file)
@@ -15,7 +15,7 @@ DisplayWidget::DisplayWidget(QSize resolution, QGLContext *context, QWidget *par
     this->resolution = resolution;
 
     MainWindow *win = ((MainWindow *)this->parent()->parent());
-    rotateAngle = win->getUIState()->layoutAngle;
+    rotateAngle = win->getUIState()->formAngle;
     scaleFactor = win->getUIState()->getScaleFactor();
 
     //setAutoFillBackground(false);
@@ -65,18 +65,18 @@ void DisplayWidget::resizeEvent(QResizeEvent *event)
     //QGLWidget::resizeEvent(event); /* initializeGL */
 
     MainWindow *win = ((MainWindow *)this->parent()->parent());
-    SkinLayout *layout = win->uiInfo->getLayout();
-    if (layout == NULL) {
-        layout = win->uiInfo->layoutList.at(0);
+    SkinForm *form = win->uiInfo->getForm();
+    if (form == NULL) {
+        form = win->uiInfo->formList.at(0);
     }
 
     const qreal sx = scaleFactor;
     const qreal sy = scaleFactor;
 
-    setGeometry(layout->displayRegion.x() * sx,
-                layout->displayRegion.y() * sy,
-                layout->displayRegion.width() * sx,
-                layout->displayRegion.height() * sy);
+    setGeometry(form->displayRegion.x() * sx,
+                form->displayRegion.y() * sy,
+                form->displayRegion.width() * sx,
+                form->displayRegion.height() * sy);
 
     qt5_window_width = width();
     qt5_window_height = height();
index 574d68b9c8aac873c6ffd91597c42cda8bc068a7..558fa6e176ec736f7adbad3e2b39c57eef02a1f5 100644 (file)
@@ -1,7 +1,7 @@
 #include <QtWidgets>
 
 #include "mainwindow.h"
-#include "skinlayout.h"
+#include "skinform.h"
 
 QOpenGLContext *qt5GLContext = NULL;
 QSurfaceFormat qt5GLFormat;
@@ -178,8 +178,8 @@ void MainWindow::openController(int index)
         return;
     }
 
-    ControllerLayout *conLayout = uiInfo->controllerList.at(index);
-    con = new ControllerWidget(conLayout);
+    ControllerForm *conForm = uiInfo->controllerList.at(index);
+    con = new ControllerWidget(conForm);
 
     QPoint globalPos = mapToGlobal(QPoint(0, 0));
     con->move(globalPos.x() + size().width(), globalPos.y());
@@ -200,12 +200,12 @@ void MainWindow::resizeEvent(QResizeEvent *event)
 {
     qDebug("resize main window");
 
-    resize(uiInfo->getLayoutSize().width(),
-        uiInfo->getLayoutSize().height());
+    resize(uiInfo->getFormSize().width(),
+        uiInfo->getFormSize().height());
 
-    SkinLayout *layout = uiInfo->getLayout();
-    if (layout != NULL) {
-        setRegion(layout->skinImg[SkinLayout::normal]);
+    SkinForm *form = uiInfo->getForm();
+    if (form != NULL) {
+        setRegion(form->skinImg[SkinForm::normal]);
     }
 }
 
@@ -213,10 +213,10 @@ void MainWindow::rotate(int angle)
 {
     qDebug("window rotate : %d", angle);
 
-    getUIState()->layoutAngle = angle;
+    getUIState()->formAngle = angle;
 
     skinView->rotate();
-    display->rotate(getUIState()->layoutAngle);
+    display->rotate(getUIState()->formAngle);
 
     adjustSize();
 }
@@ -225,10 +225,10 @@ void MainWindow::scale(int scale)
 {
     qDebug("window scale : %d", scale);
 
-    getUIState()->layoutScale = scale;
+    getUIState()->formScale = scale;
 
     skinView->adjustSize();
-    display->scale(getUIState()->layoutScale);
+    display->scale(getUIState()->formScale);
 
     adjustSize();
 }
index 7f1071c170b3e12be95b61c6ffd234ea7ee32a98..312b32cd3fa6e240e5948dcfcbf7558e29d58ab4 100644 (file)
@@ -52,7 +52,7 @@ ContextMenu::ContextMenu(QWidget *parent) :
     rotateMapper->setMapping(action, 90);
     connect(action, SIGNAL(triggered()), rotateMapper, SLOT(map()));
 
-    action = (QAction *)rotateMapper->mapping(win->getUIState()->layoutAngle);
+    action = (QAction *)rotateMapper->mapping(win->getUIState()->formAngle);
     action->setChecked(true);
     /* =============== */
 
@@ -89,7 +89,7 @@ ContextMenu::ContextMenu(QWidget *parent) :
 
     // TODO: interpolation
 
-    action = (QAction *)scaleMapper->mapping(win->getUIState()->layoutScale);
+    action = (QAction *)scaleMapper->mapping(win->getUIState()->formScale);
     action->setChecked(true);
     /* ============== */
 
index 7acd6b7ebcf8cdb3728373af85b4bfff178545fd..ab67ef49a1d4a7175e312b2ce705f3069579143e 100644 (file)
@@ -4,7 +4,7 @@ import EmulatorComponent 1.0
 Item {
     property string version: "1.0"
 
-    Layout {
+    Form {
         objectName: "portrait"
         display: Region { left: 67; top: 116; width: 720; height: 1280 }
 
@@ -39,7 +39,7 @@ Item {
         }
     }
 
-    Layout {
+    Form {
         objectName: "landscape"
         display: Region { left: 116; top: 78; width: 1280; height: 720 }
 
@@ -74,7 +74,7 @@ Item {
         }
     }
 
-    Layout {
+    Form {
         objectName: "reverse portrait"
         display: Region { left: 78; top: 117; width: 720; height: 1280 }
 
@@ -109,7 +109,7 @@ Item {
         }
     }
 
-    Layout {
+    Form {
         objectName: "reverse landscape"
         display: Region { left: 117; top: 67; width: 1280; height: 720 }
 
index 4f6945b602bded98f49988ee2291bdfaa350a99d..f7a0a1c853c936a0aac0163bfba7e540fd654e1f 100644 (file)
@@ -4,7 +4,7 @@ import EmulatorComponent 1.0
 Item {
     property string version: "1.0"
 
-    Layout {
+    Form {
         objectName: "portrait"
         display: Region { left: 26; top: 60; width: 320; height: 320 }
 
@@ -19,7 +19,7 @@ Item {
         }
     }
 
-    Layout {
+    Form {
         objectName: "landscape"
         display: Region { left: 60; top: 38; width: 320; height: 320 }
 
@@ -34,7 +34,7 @@ Item {
         }
     }
 
-    Layout {
+    Form {
         objectName: "reverse portrait"
         display: Region { left: 38; top: 60; width: 320; height: 320 }
 
@@ -49,7 +49,7 @@ Item {
         }
     }
 
-    Layout {
+    Form {
         objectName: "reverse landscape"
         display: Region { left: 60; top: 26; width: 320; height: 320 }
 
index 1e4cbf3c04f5dd3ad71f4f0352e55aad1a75ddb3..9c8bdcb9bfccbce3556b091d40c0d880910ea12c 100644 (file)
@@ -2,7 +2,7 @@
 #include "mainwindow.h"
 #include "skinkeyitem.h"
 
-SkinControllerView::SkinControllerView(ControllerLayout *conLayout, QGraphicsScene *scene, QWidget *parent) :
+SkinControllerView::SkinControllerView(ControllerForm *conForm, QGraphicsScene *scene, QWidget *parent) :
     QGraphicsView(scene, parent)
 {
     setStyleSheet("background: transparent");
@@ -16,23 +16,23 @@ SkinControllerView::SkinControllerView(ControllerLayout *conLayout, QGraphicsSce
     grabWinPos = QPoint(-1, -1);
     grabPos = QPoint(-1, -1);
 
-    createItems(conLayout);
+    createItems(conForm);
 }
 
-void SkinControllerView::createItems(ControllerLayout *conLayout)
+void SkinControllerView::createItems(ControllerForm *conForm)
 {
     /* bezel */
-    SkinBezelItem *bezelItem = new SkinBezelItem(conLayout->conImg[ControllerLayout::normal]);
+    SkinBezelItem *bezelItem = new SkinBezelItem(conForm->conImg[ControllerForm::normal]);
     scene()->addItem(bezelItem);
 
     /* HW keys */
-    QList<HardwareKey *> keyList = conLayout->keyList;
+    QList<HardwareKey *> keyList = conForm->keyList;
 
     HardwareKey *hwKey = NULL;
     for (int i = 0; i < keyList.count(); i++) {
         hwKey = keyList.at(i);
         if (hwKey != NULL) {
-            new SkinKeyItem(conLayout->conImg[ControllerLayout::pressed].copy(hwKey->region),
+            new SkinKeyItem(conForm->conImg[ControllerForm::pressed].copy(hwKey->region),
                     hwKey, bezelItem);
         }
     }
index c9e3c402915dba188825821be4f68386ebe8d8e1..f3e78829dc5309d66d3cf24f195267868d4529f6 100644 (file)
@@ -2,12 +2,12 @@
 #define SKINCONTROLLERVIEW_H
 
 #include "skinview.h"
-#include "controllerlayout.h"
+#include "controllerform.h"
 
 class SkinControllerView : public QGraphicsView
 {
 public:
-    SkinControllerView(ControllerLayout *conLayout, QGraphicsScene *scene, QWidget *parent = 0);
+    SkinControllerView(ControllerForm *conForm, QGraphicsScene *scene, QWidget *parent = 0);
     ~SkinControllerView();
 
 protected:
@@ -21,7 +21,7 @@ protected:
     QPoint grabPos;
 
 private:
-    void createItems(ControllerLayout *conLayout);
+    void createItems(ControllerForm *conForm);
 };
 
 #endif // SKINCONTROLLERVIEW_H
diff --git a/tizen/src/ui/skinform.cpp b/tizen/src/ui/skinform.cpp
new file mode 100644 (file)
index 0000000..fc407ca
--- /dev/null
@@ -0,0 +1,16 @@
+#include "skinform.h"
+
+SkinForm::SkinForm() :
+    displayRegion(0, 0, 0, 0)
+{
+}
+
+SkinForm::~SkinForm()
+{
+    qDebug("destroy skin form");
+
+    for (int i = 0; i < keyList.count(); i++) {
+        delete keyList.at(i);
+    }
+    keyList.clear();
+}
diff --git a/tizen/src/ui/skinform.h b/tizen/src/ui/skinform.h
new file mode 100644 (file)
index 0000000..49c6072
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef SKINFORM_H
+#define SKINFORM_H
+
+#include <QtWidgets>
+
+#include "hardwarekey.h"
+
+class SkinForm
+{
+    Q_ENUMS(SkinImgType)
+
+public:
+    SkinForm();
+    ~SkinForm();
+
+    QImage skinImg[2];
+    QRect displayRegion;
+    QList<HardwareKey *> keyList;
+
+    enum SkinImgType {
+        normal = 0,
+        pressed = 1
+    };
+};
+
+#endif // SKINFORM_H
diff --git a/tizen/src/ui/skinlayout.cpp b/tizen/src/ui/skinlayout.cpp
deleted file mode 100644 (file)
index 0ee389b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "skinlayout.h"
-
-SkinLayout::SkinLayout() :
-    displayRegion(0, 0, 0, 0)
-{
-}
-
-SkinLayout::~SkinLayout()
-{
-    qDebug("destroy skin layout");
-
-    for (int i = 0; i < keyList.count(); i++) {
-        delete keyList.at(i);
-    }
-    keyList.clear();
-}
diff --git a/tizen/src/ui/skinlayout.h b/tizen/src/ui/skinlayout.h
deleted file mode 100644 (file)
index 2aee722..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef SKINLAYOUT_H
-#define SKINLAYOUT_H
-
-#include <QtWidgets>
-
-#include "hardwarekey.h"
-
-class SkinLayout
-{
-    Q_ENUMS(SkinImgType)
-
-public:
-    SkinLayout();
-    ~SkinLayout();
-
-    QImage skinImg[2];
-    QRect displayRegion;
-    QList<HardwareKey *> keyList;
-
-    enum SkinImgType {
-        normal = 0,
-        pressed = 1
-    };
-};
-
-#endif // SKINLAYOUT_H
index 3943e25e00db1e175caf5cb3e3ced0dcdb7fd2a3..5952791151224e267cee4186112f8605afee96b3 100644 (file)
@@ -22,23 +22,23 @@ SkinView::SkinView(QGraphicsScene *scene, QWidget *parent) :
 void SkinView::createItems()
 {
     MainWindow *win = ((MainWindow *)this->parent());
-    SkinLayout *layout = win->uiInfo->getLayout();
-    if (layout == NULL) {
-        layout = win->uiInfo->layoutList.at(0);
+    SkinForm *form = win->uiInfo->getForm();
+    if (form == NULL) {
+        form = win->uiInfo->formList.at(0);
     }
 
     /* bezel */
-    SkinBezelItem *bezelItem = new SkinBezelItem(layout->skinImg[SkinLayout::normal]);
+    SkinBezelItem *bezelItem = new SkinBezelItem(form->skinImg[SkinForm::normal]);
     scene()->addItem(bezelItem);
 
     /* HW keys */
-    QList<HardwareKey *> keyList = layout->keyList;
+    QList<HardwareKey *> keyList = form->keyList;
 
     HardwareKey *hwKey = NULL;
     for (int i = 0; i < keyList.count(); i++) {
         hwKey = keyList.at(i);
         if (hwKey != NULL) {
-            new SkinKeyItem(layout->skinImg[SkinLayout::pressed].copy(hwKey->region),
+            new SkinKeyItem(form->skinImg[SkinForm::pressed].copy(hwKey->region),
                     hwKey, bezelItem);
         }
     }
@@ -61,8 +61,8 @@ void SkinView::resizeEvent(QResizeEvent *event)
     MainWindow *win = ((MainWindow *)this->parent());
 
     /* geometry */
-    const int width = win->uiInfo->getLayoutSize().width();
-    const int height = win->uiInfo->getLayoutSize().height();
+    const int width = win->uiInfo->getFormSize().width();
+    const int height = win->uiInfo->getFormSize().height();
     setGeometry(0, 0, width, height);
 
     /* scaling */
index f5c07dbb45d10937cb98581321b900d46f722b46..40f0dbfc74edf1c2c1d368e418612cc690edc274 100644 (file)
@@ -6,35 +6,35 @@ UIInformation::UIInformation() :
     skinPath = "./";
 }
 
-SkinLayout *UIInformation::getLayout()
+SkinForm *UIInformation::getForm()
 {
-    if (uiState.getLayoutIndex() > (layoutList.count() - 1)
-            || uiState.getLayoutIndex() < 0) {
-        qWarning("layout is null");
+    if (uiState.getFormIndex() > (formList.count() - 1)
+            || uiState.getFormIndex() < 0) {
+        qWarning("form is null");
         return NULL;
     }
 
-    return layoutList.at(uiState.getLayoutIndex());
+    return formList.at(uiState.getFormIndex());
 }
 
-QSize UIInformation::getLayoutSize()
+QSize UIInformation::getFormSize()
 {
-    SkinLayout *layout = getLayout();
-    if (layout == NULL) {
+    SkinForm *form = getForm();
+    if (form == NULL) {
         return QSize(0, 0);
     }
 
-    return getLayout()->skinImg[SkinLayout::normal].size() * uiState.getScaleFactor();
+    return getForm()->skinImg[SkinForm::normal].size() * uiState.getScaleFactor();
 }
 
 UIInformation::~UIInformation()
 {
     qDebug("destroy UI info");
 
-    for (int i = 0; i < layoutList.count(); i++) {
-        delete layoutList.at(i);
+    for (int i = 0; i < formList.count(); i++) {
+        delete formList.at(i);
     }
-    layoutList.clear();
+    formList.clear();
 
     for (int i = 0; i < controllerList.count(); i++) {
         delete controllerList.at(i);
index ba26f77256c4d47c03af74b59d27daf1423fc6f6..de10e1b3cc9ba753be2bf49facdb914578ed41c3 100644 (file)
@@ -3,9 +3,9 @@
 
 #include <QtWidgets>
 
-#include "skinlayout.h"
+#include "skinform.h"
 #include "uistate.h"
-#include "controllerlayout.h"
+#include "controllerform.h"
 
 class UIInformation
 {
@@ -19,14 +19,14 @@ public:
 
     QString skinPath;
     QString skinName;
-    QList<SkinLayout *> layoutList;
-    QList<ControllerLayout *> controllerList;
+    QList<SkinForm *> formList;
+    QList<ControllerForm *> controllerList;
     QColor hoverColor;
 
     UIState uiState; /* runtime information */
 
-    SkinLayout *getLayout(); /* current */
-    QSize getLayoutSize(); /* current */
+    SkinForm *getForm(); /* current */
+    QSize getFormSize(); /* current */
 };
 
 #endif // UIINFORMATION_H
index c7f1acbb99add4d1f3872a223fa36bb8ee8d973f..0928bae8ab5ccaf109a45c15b2450c008c3db63e 100644 (file)
@@ -1,11 +1,11 @@
 #include "uistate.h"
 
 UIState::UIState() :
-    layoutAngle(0), layoutScale(100)
+    formAngle(0), formScale(100)
 {
 }
 
-int UIState::getLayoutIndex(int angle)
+int UIState::getFormIndex(int angle)
 {
     // TODO: map
 
@@ -30,9 +30,9 @@ int UIState::getLayoutIndex(int angle)
     return index;
 }
 
-int UIState::getLayoutIndex()
+int UIState::getFormIndex()
 {
-    return getLayoutIndex(layoutAngle);
+    return getFormIndex(formAngle);
 }
 
 qreal UIState::getScaleFactor(int scale)
@@ -42,5 +42,5 @@ qreal UIState::getScaleFactor(int scale)
 
 qreal UIState::getScaleFactor()
 {
-    return getScaleFactor(this->layoutScale);
+    return getScaleFactor(this->formScale);
 }
index 84bfd366e7ab12c20f4edc542de07fee576928b8..f556df5eb0c95483891ffe498be5e077c9878de4 100644 (file)
@@ -8,13 +8,13 @@ class UIState
 public:
     UIState();
 
-    int getLayoutIndex(int angle);
-    int getLayoutIndex(); /* current */
+    int getFormIndex(int angle);
+    int getFormIndex(); /* current */
     qreal getScaleFactor(int scale);
     qreal getScaleFactor(); /* current */
 
-    int layoutAngle;
-    int layoutScale;
+    int formAngle;
+    int formScale;
 };
 
 #endif // UISTATE_H
index 9a9378ad854fefdecebb37b45bbcf26ae8d4f326..6cb887c6c77ec2df4d9f7446c8549a5c15e54a8a 100644 (file)
@@ -1,10 +1,10 @@
-obj-$(CONFIG_QT) += layouttype.o moc_layouttype.o
+obj-$(CONFIG_QT) += formtype.o moc_formtype.o
 obj-$(CONFIG_QT) += hardwarekeytype.o moc_hardwarekeytype.o
 obj-$(CONFIG_QT) += regiontype.o moc_regiontype.o
 obj-$(CONFIG_QT) += keylisttype.o moc_keylisttype.o
 
-$(obj)/moc_layouttype.o: $(obj)/moc_layouttype.cpp
-$(obj)/moc_layouttype.cpp: $(obj)/layouttype.h
+$(obj)/moc_formtype.o: $(obj)/moc_formtype.cpp
+$(obj)/moc_formtype.cpp: $(obj)/formtype.h
        moc $< -o $@
 $(obj)/moc_hardwarekeytype.o: $(obj)/moc_hardwarekeytype.cpp
 $(obj)/moc_hardwarekeytype.cpp: $(obj)/hardwarekeytype.h
diff --git a/tizen/src/ui/xml/formtype.cpp b/tizen/src/ui/xml/formtype.cpp
new file mode 100644 (file)
index 0000000..6f6e50c
--- /dev/null
@@ -0,0 +1,50 @@
+#include "formtype.h"
+
+FormType::FormType(QObject *parent) :
+    QObject(parent), keyList(NULL)
+{
+}
+
+void FormType::setRegionType(RegionType *regionType)
+{
+    this->regionType = regionType;
+}
+
+QString FormType::mainImageName() const
+{
+    return mainImgName;
+}
+
+void FormType::setMainImageName(QString imgFileName)
+{
+    mainImgName = imgFileName;
+}
+
+QString FormType::pressedImageName() const
+{
+    return pressedImgName;
+}
+
+void FormType::setPressedImageName(QString imgFileName)
+{
+    pressedImgName = imgFileName;
+}
+
+KeyListType *FormType::keyListType()
+{
+    return keyList;
+}
+
+void FormType::setKeyListType(KeyListType *keyList)
+{
+    this->keyList = keyList;
+}
+
+QRect FormType::displayRegion()
+{
+    if (regionType == NULL) {
+        return QRect(0, 0, 0, 0);
+    }
+
+    return regionType->region();
+}
diff --git a/tizen/src/ui/xml/formtype.h b/tizen/src/ui/xml/formtype.h
new file mode 100644 (file)
index 0000000..662c0a7
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef FORMTYPE_H
+#define FORMTYPE_H
+
+#include <QObject>
+
+#include "keylisttype.h"
+#include "regiontype.h"
+
+class FormType : public QObject
+{
+    Q_OBJECT
+    Q_PROPERTY(RegionType *display WRITE setRegionType)
+    Q_PROPERTY(QString mainImage READ mainImageName WRITE setMainImageName)
+    Q_PROPERTY(QString pressedImage READ pressedImageName WRITE setPressedImageName)
+    Q_PROPERTY(KeyListType *hwKeyList READ keyListType WRITE setKeyListType)
+    Q_CLASSINFO("DefaultProperty", "hwKeyList")
+
+public:
+    explicit FormType(QObject *parent = 0);
+
+    void setRegionType(RegionType *regionType);
+    QString mainImageName() const;
+    void setMainImageName(QString imgFileName);
+    QString pressedImageName() const;
+    void setPressedImageName(QString imgFileName);
+    KeyListType *keyListType();
+    void setKeyListType(KeyListType *keyList);
+
+    QRect displayRegion();
+
+private:
+    RegionType *regionType;
+    QString mainImgName;
+    QString pressedImgName;
+    KeyListType *keyList;
+};
+
+#endif // FORMTYPE_H
diff --git a/tizen/src/ui/xml/layouttype.cpp b/tizen/src/ui/xml/layouttype.cpp
deleted file mode 100644 (file)
index 2352385..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "layouttype.h"
-
-LayoutType::LayoutType(QObject *parent) :
-    QObject(parent), keyList(NULL)
-{
-}
-
-void LayoutType::setRegionType(RegionType *regionType)
-{
-    this->regionType = regionType;
-}
-
-QString LayoutType::mainImageName() const
-{
-    return mainImgName;
-}
-
-void LayoutType::setMainImageName(QString imgFileName)
-{
-    mainImgName = imgFileName;
-}
-
-QString LayoutType::pressedImageName() const
-{
-    return pressedImgName;
-}
-
-void LayoutType::setPressedImageName(QString imgFileName)
-{
-    pressedImgName = imgFileName;
-}
-
-KeyListType *LayoutType::keyListType()
-{
-    return keyList;
-}
-
-void LayoutType::setKeyListType(KeyListType *keyList)
-{
-    this->keyList = keyList;
-}
-
-QRect LayoutType::displayRegion()
-{
-    if (regionType == NULL) {
-        return QRect(0, 0, 0, 0);
-    }
-
-    return regionType->region();
-}
diff --git a/tizen/src/ui/xml/layouttype.h b/tizen/src/ui/xml/layouttype.h
deleted file mode 100644 (file)
index b0af6d8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef LAYOUTTYPE_H
-#define LAYOUTTYPE_H
-
-#include <QObject>
-
-#include "keylisttype.h"
-#include "regiontype.h"
-
-class LayoutType : public QObject
-{
-    Q_OBJECT
-    Q_PROPERTY(RegionType *display WRITE setRegionType)
-    Q_PROPERTY(QString mainImage READ mainImageName WRITE setMainImageName)
-    Q_PROPERTY(QString pressedImage READ pressedImageName WRITE setPressedImageName)
-    Q_PROPERTY(KeyListType *hwKeyList READ keyListType WRITE setKeyListType)
-    Q_CLASSINFO("DefaultProperty", "hwKeyList")
-
-public:
-    explicit LayoutType(QObject *parent = 0);
-
-    void setRegionType(RegionType *regionType);
-    QString mainImageName() const;
-    void setMainImageName(QString imgFileName);
-    QString pressedImageName() const;
-    void setPressedImageName(QString imgFileName);
-    KeyListType *keyListType();
-    void setKeyListType(KeyListType *keyList);
-
-    QRect displayRegion();
-
-private:
-    RegionType *regionType;
-    QString mainImgName;
-    QString pressedImgName;
-    KeyListType *keyList;
-};
-
-#endif // LAYOUTTYPE_H