#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"
//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;
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)
{
}
uiInfo->skinName = skinName;
- uiInfo->uiState.layoutScale = 50;
+ uiInfo->uiState.formScale = 50;
/* XML */
// TODO: convert QML to XML
/* 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 */
}
}
-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()));
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();
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;
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()));
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;
}
$(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
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
--- /dev/null
+#include "controllerform.h"
+
+ControllerForm::ControllerForm(QString name)
+{
+ this->name = name;
+}
+
+ControllerForm::~ControllerForm()
+{
+ qDebug("destroy con layout");
+}
--- /dev/null
+#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
+++ /dev/null
-#include "controllerlayout.h"
-
-ControllerLayout::ControllerLayout(QString name)
-{
- this->name = name;
-}
-
-ControllerLayout::~ControllerLayout()
-{
- qDebug("destroy con layout");
-}
+++ /dev/null
-#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
#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);
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)
#include <QLabel>
-#include "controllerlayout.h"
+#include "controllerform.h"
#include "skincontrollerview.h"
class ControllerWidget : public QLabel
Q_OBJECT
public:
- explicit ControllerWidget(ControllerLayout *conLayout, QWidget *parent = 0);
+ explicit ControllerWidget(ControllerForm *conForm, QWidget *parent = 0);
~ControllerWidget();
protected:
private:
SkinControllerView *conView;
- ControllerLayout *conLayout;
+ ControllerForm *conForm;
};
#endif // CONTROLLERWIDGET_H
this->resolution = resolution;
MainWindow *win = ((MainWindow *)this->parent()->parent());
- rotateAngle = win->getUIState()->layoutAngle;
+ rotateAngle = win->getUIState()->formAngle;
scaleFactor = win->getUIState()->getScaleFactor();
//setAutoFillBackground(false);
//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();
#include <QtWidgets>
#include "mainwindow.h"
-#include "skinlayout.h"
+#include "skinform.h"
QOpenGLContext *qt5GLContext = NULL;
QSurfaceFormat qt5GLFormat;
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());
{
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]);
}
}
{
qDebug("window rotate : %d", angle);
- getUIState()->layoutAngle = angle;
+ getUIState()->formAngle = angle;
skinView->rotate();
- display->rotate(getUIState()->layoutAngle);
+ display->rotate(getUIState()->formAngle);
adjustSize();
}
{
qDebug("window scale : %d", scale);
- getUIState()->layoutScale = scale;
+ getUIState()->formScale = scale;
skinView->adjustSize();
- display->scale(getUIState()->layoutScale);
+ display->scale(getUIState()->formScale);
adjustSize();
}
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);
/* =============== */
// TODO: interpolation
- action = (QAction *)scaleMapper->mapping(win->getUIState()->layoutScale);
+ action = (QAction *)scaleMapper->mapping(win->getUIState()->formScale);
action->setChecked(true);
/* ============== */
Item {
property string version: "1.0"
- Layout {
+ Form {
objectName: "portrait"
display: Region { left: 67; top: 116; width: 720; height: 1280 }
}
}
- Layout {
+ Form {
objectName: "landscape"
display: Region { left: 116; top: 78; width: 1280; height: 720 }
}
}
- Layout {
+ Form {
objectName: "reverse portrait"
display: Region { left: 78; top: 117; width: 720; height: 1280 }
}
}
- Layout {
+ Form {
objectName: "reverse landscape"
display: Region { left: 117; top: 67; width: 1280; height: 720 }
Item {
property string version: "1.0"
- Layout {
+ Form {
objectName: "portrait"
display: Region { left: 26; top: 60; width: 320; height: 320 }
}
}
- Layout {
+ Form {
objectName: "landscape"
display: Region { left: 60; top: 38; width: 320; height: 320 }
}
}
- Layout {
+ Form {
objectName: "reverse portrait"
display: Region { left: 38; top: 60; width: 320; height: 320 }
}
}
- Layout {
+ Form {
objectName: "reverse landscape"
display: Region { left: 60; top: 26; width: 320; height: 320 }
#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");
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);
}
}
#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:
QPoint grabPos;
private:
- void createItems(ControllerLayout *conLayout);
+ void createItems(ControllerForm *conForm);
};
#endif // SKINCONTROLLERVIEW_H
--- /dev/null
+#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();
+}
--- /dev/null
+#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
+++ /dev/null
-#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();
-}
+++ /dev/null
-#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
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);
}
}
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 */
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);
#include <QtWidgets>
-#include "skinlayout.h"
+#include "skinform.h"
#include "uistate.h"
-#include "controllerlayout.h"
+#include "controllerform.h"
class UIInformation
{
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
#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
return index;
}
-int UIState::getLayoutIndex()
+int UIState::getFormIndex()
{
- return getLayoutIndex(layoutAngle);
+ return getFormIndex(formAngle);
}
qreal UIState::getScaleFactor(int scale)
qreal UIState::getScaleFactor()
{
- return getScaleFactor(this->layoutScale);
+ return getScaleFactor(this->formScale);
}
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
-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
--- /dev/null
+#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();
+}
--- /dev/null
+#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
+++ /dev/null
-#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();
-}
+++ /dev/null
-#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