From 63e054e0f8a68fc8ae0b31494a32264a93509277 Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Fri, 30 Jan 2015 17:00:17 +0900 Subject: [PATCH] skin: remove QML layout parsing Change-Id: Ie493ade52d6efa18413305b931e07c339b6dc3f0 Signed-off-by: GiWoong Kim --- tizen/src/display/qt5_supplement.cpp | 192 +---------------------------------- tizen/src/ui/Makefile.objs | 2 - tizen/src/ui/xml/Makefile.objs | 26 ----- tizen/src/ui/xml/emulatoruitype.cpp | 46 --------- tizen/src/ui/xml/emulatoruitype.h | 54 ---------- tizen/src/ui/xml/formlisttype.cpp | 46 --------- tizen/src/ui/xml/formlisttype.h | 55 ---------- tizen/src/ui/xml/formtype.cpp | 85 ---------------- tizen/src/ui/xml/formtype.h | 69 ------------- tizen/src/ui/xml/hardwarekeytype.cpp | 75 -------------- tizen/src/ui/xml/hardwarekeytype.h | 64 ------------ tizen/src/ui/xml/keylisttype.cpp | 47 --------- tizen/src/ui/xml/keylisttype.h | 55 ---------- tizen/src/ui/xml/regiontype.cpp | 81 --------------- tizen/src/ui/xml/regiontype.h | 66 ------------ 15 files changed, 3 insertions(+), 960 deletions(-) delete mode 100644 tizen/src/ui/xml/Makefile.objs delete mode 100644 tizen/src/ui/xml/emulatoruitype.cpp delete mode 100644 tizen/src/ui/xml/emulatoruitype.h delete mode 100644 tizen/src/ui/xml/formlisttype.cpp delete mode 100644 tizen/src/ui/xml/formlisttype.h delete mode 100644 tizen/src/ui/xml/formtype.cpp delete mode 100644 tizen/src/ui/xml/formtype.h delete mode 100644 tizen/src/ui/xml/hardwarekeytype.cpp delete mode 100644 tizen/src/ui/xml/hardwarekeytype.h delete mode 100644 tizen/src/ui/xml/keylisttype.cpp delete mode 100644 tizen/src/ui/xml/keylisttype.h delete mode 100644 tizen/src/ui/xml/regiontype.cpp delete mode 100644 tizen/src/ui/xml/regiontype.h diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp index 8be7e66..9ed9938 100644 --- a/tizen/src/display/qt5_supplement.cpp +++ b/tizen/src/display/qt5_supplement.cpp @@ -29,9 +29,6 @@ */ #include -#include -#include -#include #include "qt5_supplement.h" #include "mainwindow.h" @@ -39,7 +36,6 @@ #include "hardwarekey.h" #include "floatingcontroller.h" #include "xmllayoutparser.h" -#include "ui/xml/emulatoruitype.h" #include "uiutil.h" extern "C" { @@ -48,8 +44,6 @@ extern "C" { //using namespace std; void qMessageOutput(QtMsgType, const QMessageLogContext &, const QString &); -void loadMainFormFromQML(QFile *, UIInformation *); -void loadConFormFromQML(QFile *, UIInformation *); void loadMainFormFromXML(QFile *, UIInformation *); void loadConFormFromXML(QFile *, UIInformation *); @@ -130,20 +124,13 @@ void qt5_gui_init(void) } uiInfo->uiState.mainFormScale = scale; - /* XML */ - // TODO: convert QML to XML - - /* Register custom QML elements */ - qmlRegisterType("EmulatorComponent", 1, 0, "Region"); - qmlRegisterType("EmulatorComponent", 1, 0, "Key"); - qmlRegisterType("EmulatorComponent", 1, 0, "KeyList"); - - /* load main form */ + /* XML layout */ QFile mainXMLFile(uiInfo->skinPath + FORM_FILE_NAME); + /* load main form */ loadMainFormFromXML(&mainXMLFile, uiInfo); - /* load controller forms */ QDir skinDir(uiInfo->skinPath + CON_FORM_SUBPATH); + /* load controller forms */ QFileInfoList entries = skinDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); if (entries.isEmpty() == false) { @@ -375,126 +362,6 @@ void qMessageOutput(QtMsgType type, const QMessageLogContext &context, const QSt } } -void loadMainFormFromQML(QFile *file, UIInformation *uiInfo/* out */) -{ - if (file->exists() == false) { - qFatal("%s is not found", qPrintable(file->fileName())); - } - - qDebug("main form is loaded from %s", qPrintable(file->fileName())); - - qmlRegisterType("EmulatorComponent", 1, 0, "EmulatorUI"); - qmlRegisterType("EmulatorComponent", 1, 0, "FormList"); - qmlRegisterType("EmulatorComponent", 1, 0, "Form"); - - /* QML */ - QQmlEngine *engine = new QQmlEngine(); - QQmlComponent *component = new QQmlComponent(engine); - - component->loadUrl(QUrl::fromLocalFile(file->fileName())); - if (!component->isReady()) { - qWarning("%s", qPrintable(component->errorString())); - } - - QObject *object = component->create(); - if (object != NULL) { - QFileInfo fileInfo(*file); - qDebug() << "xml version :" << QQmlProperty::read(object, "version").toString(); - - EmulatorUIType *uiType = (EmulatorUIType *)object; - FormType *formType = NULL; - KeyListType *keyListType = NULL; - HardwareKeyType *hwKeyType = NULL; - - FormListType *formListType = uiType->formListType(); - for (int index = 0; index < formListType->getFormList()->count(); index++) { - MainForm *mainForm = new MainForm(); /* dst */ - - formType = (FormType *)formListType->getFormList()->at(index); /* src */ - - mainForm->displayRegion = formType->getDisplayRegion(); - mainForm->skinImg[MainForm::normal].load(fileInfo.absolutePath() - + QDir::separator() + formType->mainImageName()); - mainForm->skinImg[MainForm::pressed].load(fileInfo.absolutePath() - + QDir::separator() + formType->pressedImageName()); - - keyListType = formType->keyListType(); - if (keyListType != NULL) { - for (int i = 0; i < keyListType->getKeyList()->count(); i++) { - hwKeyType = keyListType->getKeyList()->at(i); - if (hwKeyType != NULL) { - mainForm->keyList.append(new HardwareKey(hwKeyType->objectName(), - hwKeyType->keycode(), hwKeyType->region(), hwKeyType->tooltip())); - } - } - } - - uiInfo->mainFormList.append(mainForm); - } - - delete object; - } - - delete component; - delete engine; -} - -void loadConFormFromQML(QFile *file, UIInformation *uiInfo/* out */) -{ - if (file->exists() == false) { - qWarning("%s is not found", qPrintable(file->fileName())); - return; - } - - qDebug("controller form is loaded from %s", qPrintable(file->fileName())); - - /* QML */ - QQmlEngine *engine = new QQmlEngine(); - QQmlComponent *component = new QQmlComponent(engine); - - component->loadUrl(QUrl::fromLocalFile(file->fileName())); - if (!component->isReady()) { - qWarning("%s", qPrintable(component->errorString())); - } - - QObject *object = component->create(); - if (object != NULL) { - QFileInfo fileInfo(*file); - qDebug() << "xml version :" << QQmlProperty::read(object, "version").toString(); - - FormType *formType = (FormType *)object; - KeyListType *keyListType = NULL; - HardwareKeyType *hwKeyType = NULL; - - QString conName = QQmlProperty::read(object, "name").toString(); - ControllerForm *conForm = new ControllerForm( - conName.isEmpty() ? fileInfo.dir().dirName() : conName); - - conForm->conImg[ControllerForm::normal].load(fileInfo.absolutePath() - + QDir::separator() + formType->mainImageName()); - conForm->conImg[ControllerForm::pressed].load(fileInfo.absolutePath() - + QDir::separator() + formType->pressedImageName()); - - keyListType = formType->keyListType(); - if (keyListType != NULL) { - for (int i = 0; i < keyListType->getKeyList()->count(); i++) { - hwKeyType = keyListType->getKeyList()->at(i); - if (hwKeyType != NULL) { - conForm->keyList.append(new HardwareKey(hwKeyType->objectName(), - hwKeyType->keycode(), hwKeyType->region(), hwKeyType->tooltip())); - } - } - } - - uiInfo->conFormList.append(conForm); - - delete object; - } - - delete component; - delete engine; -} - void loadMainFormFromXML(QFile *file, UIInformation *uiInfo/* out */) { if (file->exists() == false) { @@ -606,56 +473,3 @@ void loadConFormFromXML(QFile *file, UIInformation *uiInfo/* out */) return; } } - -#if 0 -#define CONTROL_PRIORITY_MAX 10 - -int getControlIndex() -{ - int controlIndex = 0; - int controlPriority = 0; - int priority = CONTROL_PRIORITY_MAX; - - if (!uiInfo) { - return controlIndex; - } - - /* find high priority*/ - QString line; - QDir skinDir(uiInfo->skinPath + CON_FORM_SUBPATH); - QFileInfoList entries = skinDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); - for (int i = 0; i < entries.size(); i++) { - QFile iniFile(entries.at(i).filePath() + QDir::separator() + "info.ini"); - if (iniFile.exists()) { - controlPriority = getPriority(&iniFile); - if (controlPriority < priority) { - controlIndex = i; - priority = controlPriority; - } - } - } - - return controlIndex; -} - -int getPriority(QFile *file) -{ - int priority = CONTROL_PRIORITY_MAX; - QRegExp rx("="); - - /* read priority in info.ini file */ - if (file->open(QFile::ReadOnly)) { - QTextStream in(file); - do { - QString line = in.readLine(); - QStringList list = line.split(rx, QString::SkipEmptyParts); - if (QString::compare(list.at(0), "priority", Qt::CaseInsensitive) == 0) { - priority = list.at(1).toInt(); - } - } while(!in.atEnd()); - file->close(); - } - - return priority; -} -#endif diff --git a/tizen/src/ui/Makefile.objs b/tizen/src/ui/Makefile.objs index 417087e..641bea8 100644 --- a/tizen/src/ui/Makefile.objs +++ b/tizen/src/ui/Makefile.objs @@ -25,8 +25,6 @@ obj-$(CONFIG_QT) += uistate.o obj-$(CONFIG_QT) += uiutil.o obj-$(CONFIG_QT) += qrc_resource.o -obj-$(CONFIG_QT) += xml/ - obj-$(CONFIG_QT) += menu/ $(obj)/moc_dockingcontroller.o: $(obj)/moc_dockingcontroller.cpp diff --git a/tizen/src/ui/xml/Makefile.objs b/tizen/src/ui/xml/Makefile.objs deleted file mode 100644 index 3b999b8..0000000 --- a/tizen/src/ui/xml/Makefile.objs +++ /dev/null @@ -1,26 +0,0 @@ -obj-$(CONFIG_QT) += emulatoruitype.o moc_emulatoruitype.o -obj-$(CONFIG_QT) += formlisttype.o moc_formlisttype.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_emulatoruitype.o: $(obj)/moc_emulatoruitype.cpp -$(obj)/moc_emulatoruitype.cpp: $(obj)/emulatoruitype.h - moc $< -o $@ -$(obj)/moc_formlisttype.o: $(obj)/moc_formlisttype.cpp -$(obj)/moc_formlisttype.cpp: $(obj)/formlisttype.h - moc $< -o $@ -$(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 - moc $< -o $@ -$(obj)/moc_regiontype.o: $(obj)/moc_regiontype.cpp -$(obj)/moc_regiontype.cpp: $(obj)/regiontype.h - moc $< -o $@ -$(obj)/moc_keylisttype.o: $(obj)/moc_keylisttype.cpp -$(obj)/moc_keylisttype.cpp: $(obj)/keylisttype.h - moc $< -o $@ - diff --git a/tizen/src/ui/xml/emulatoruitype.cpp b/tizen/src/ui/xml/emulatoruitype.cpp deleted file mode 100644 index cb81765..0000000 --- a/tizen/src/ui/xml/emulatoruitype.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#include "emulatoruitype.h" - -EmulatorUIType::EmulatorUIType(QObject *parent) : - QObject(parent) -{ - /* do nothing */ -} - -FormListType *EmulatorUIType::formListType() -{ - return formList; -} - -void EmulatorUIType::setFormListType(FormListType *formList) -{ - this->formList = formList; -} diff --git a/tizen/src/ui/xml/emulatoruitype.h b/tizen/src/ui/xml/emulatoruitype.h deleted file mode 100644 index e5e4dd0..0000000 --- a/tizen/src/ui/xml/emulatoruitype.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#ifndef EMULATORUITYPE_H -#define EMULATORUITYPE_H - -#include - -#include "formlisttype.h" - -class EmulatorUIType : public QObject -{ - Q_OBJECT - Q_PROPERTY(FormListType *formListType READ formListType WRITE setFormListType) - Q_CLASSINFO("DefaultProperty", "formListType") - -public: - explicit EmulatorUIType(QObject *parent = 0); - - FormListType *formListType(); - -private: - void setFormListType(FormListType *formList); - - FormListType *formList; -}; - -#endif // EMULATORUITYPE_H diff --git a/tizen/src/ui/xml/formlisttype.cpp b/tizen/src/ui/xml/formlisttype.cpp deleted file mode 100644 index f2b7d90..0000000 --- a/tizen/src/ui/xml/formlisttype.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#include "formlisttype.h" - -FormListType::FormListType(QObject *parent) : - QObject(parent) -{ - /* do nothing */ -} - -QQmlListProperty FormListType::formList() -{ - return QQmlListProperty(this, list); -} - -QList *FormListType::getFormList() -{ - return &list; -} diff --git a/tizen/src/ui/xml/formlisttype.h b/tizen/src/ui/xml/formlisttype.h deleted file mode 100644 index d94a47e..0000000 --- a/tizen/src/ui/xml/formlisttype.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#ifndef FORMLISTTYPE_H -#define FORMLISTTYPE_H - -#include -#include - -#include "formtype.h" - -class FormListType : public QObject -{ - Q_OBJECT - Q_PROPERTY(QQmlListProperty formList READ formList) - Q_CLASSINFO("DefaultProperty", "formList") - -public: - explicit FormListType(QObject *parent = 0); - - QList *getFormList(); - -private: - QQmlListProperty formList(); - - QList list; -}; - -#endif // FORMLISTTYPE_H diff --git a/tizen/src/ui/xml/formtype.cpp b/tizen/src/ui/xml/formtype.cpp deleted file mode 100644 index 0f73981..0000000 --- a/tizen/src/ui/xml/formtype.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#include "formtype.h" - -FormType::FormType(QObject *parent) : - QObject(parent), keyList(NULL) -{ - /* do nothing */ -} - -RegionType *FormType::displayRegionType() -{ - return displayRegion; -} - -void FormType::setDisplayRegionType(RegionType *displayRegion) -{ - this->displayRegion = displayRegion; -} - -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::getDisplayRegion() -{ - if (displayRegion == NULL) { - return QRect(0, 0, 0, 0); - } - - return displayRegion->region(); -} diff --git a/tizen/src/ui/xml/formtype.h b/tizen/src/ui/xml/formtype.h deleted file mode 100644 index c9eec66..0000000 --- a/tizen/src/ui/xml/formtype.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#ifndef FORMTYPE_H -#define FORMTYPE_H - -#include - -#include "keylisttype.h" -#include "regiontype.h" - -class FormType : public QObject -{ - Q_OBJECT - Q_PROPERTY(RegionType *display READ displayRegionType WRITE setDisplayRegionType) - Q_PROPERTY(QString mainImage READ mainImageName WRITE setMainImageName) - Q_PROPERTY(QString pressedImage READ pressedImageName WRITE setPressedImageName) - Q_PROPERTY(KeyListType *keyListType READ keyListType WRITE setKeyListType) - Q_CLASSINFO("DefaultProperty", "keyListType") - -public: - explicit FormType(QObject *parent = 0); - - QString mainImageName() const; - QString pressedImageName() const; - KeyListType *keyListType(); - - QRect getDisplayRegion(); - -private: - RegionType *displayRegionType(); - void setDisplayRegionType(RegionType *displayRegion); - void setMainImageName(QString imgFileName); - void setPressedImageName(QString imgFileName); - void setKeyListType(KeyListType *keyList); - - RegionType *displayRegion; - QString mainImgName; - QString pressedImgName; - KeyListType *keyList; -}; - -#endif // FORMTYPE_H diff --git a/tizen/src/ui/xml/hardwarekeytype.cpp b/tizen/src/ui/xml/hardwarekeytype.cpp deleted file mode 100644 index 4def9c8..0000000 --- a/tizen/src/ui/xml/hardwarekeytype.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#include "hardwarekeytype.h" - -HardwareKeyType::HardwareKeyType(QObject *parent) : - QObject(parent) -{ - /* do nothing */ -} - -int HardwareKeyType::keycode() const -{ - return code; -} - -void HardwareKeyType::setKeycode(int keycode) -{ - code = keycode; -} - -QString HardwareKeyType::tooltip() const -{ - return tip; -} - -void HardwareKeyType::setTooltip(const QString &tooltip) -{ - tip = tooltip; -} - -RegionType *HardwareKeyType::keyRegionType() -{ - return keyRegion; -} - -void HardwareKeyType::setKeyRegionType(RegionType *keyRegion) -{ - this->keyRegion = keyRegion; -} - -QRect HardwareKeyType::region() -{ - if (keyRegion == NULL) { - return QRect(0, 0, 0, 0); - } - - return keyRegion->region(); -} diff --git a/tizen/src/ui/xml/hardwarekeytype.h b/tizen/src/ui/xml/hardwarekeytype.h deleted file mode 100644 index f4ef8da..0000000 --- a/tizen/src/ui/xml/hardwarekeytype.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#ifndef HARDWAREKEYTYPE_H -#define HARDWAREKEYTYPE_H - -#include - -#include "regiontype.h" - -class HardwareKeyType : public QObject -{ - Q_OBJECT - Q_PROPERTY(int keycode READ keycode WRITE setKeycode) - Q_PROPERTY(QString tooltip READ tooltip WRITE setTooltip) - Q_PROPERTY(RegionType *keyRegionType READ keyRegionType WRITE setKeyRegionType) - Q_CLASSINFO("DefaultProperty", "keyRegionType") - -public: - explicit HardwareKeyType(QObject *parent = 0); - - int keycode() const; - QString tooltip() const; - - QRect region(); - -private: - void setKeycode(int keycode); - void setTooltip(const QString &tooltip); - RegionType *keyRegionType(); - void setKeyRegionType(RegionType *regionType); - - int code; - QString tip; - RegionType *keyRegion; -}; - -#endif // HARDWAREKEYTYPE_H diff --git a/tizen/src/ui/xml/keylisttype.cpp b/tizen/src/ui/xml/keylisttype.cpp deleted file mode 100644 index 6280cd1..0000000 --- a/tizen/src/ui/xml/keylisttype.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#include "keylisttype.h" - -KeyListType::KeyListType(QObject *parent) : - QObject(parent) -{ - /* do nothing */ -} - -QQmlListProperty KeyListType::keyListType() -{ - return QQmlListProperty(this, list); -} - -QList *KeyListType::getKeyList() -{ - return &list; -} - diff --git a/tizen/src/ui/xml/keylisttype.h b/tizen/src/ui/xml/keylisttype.h deleted file mode 100644 index 5427f50..0000000 --- a/tizen/src/ui/xml/keylisttype.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#ifndef KEYLISTTYPE_H -#define KEYLISTTYPE_H - -#include -#include - -#include "hardwarekeytype.h" - -class KeyListType : public QObject -{ - Q_OBJECT - Q_PROPERTY(QQmlListProperty keyListType READ keyListType) - Q_CLASSINFO("DefaultProperty", "keyListType") - -public: - explicit KeyListType(QObject *parent = 0); - - QList *getKeyList(); - -private: - QQmlListProperty keyListType(); - - QList list; -}; - -#endif // KEYLISTTYPE_H diff --git a/tizen/src/ui/xml/regiontype.cpp b/tizen/src/ui/xml/regiontype.cpp deleted file mode 100644 index ac370dc..0000000 --- a/tizen/src/ui/xml/regiontype.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#include "regiontype.h" - -RegionType::RegionType(QObject *parent) : - QObject(parent), x(0), y(0), w(0), h(0) -{ - /* do nothing */ -} - -int RegionType::left() -{ - return x; -} - -void RegionType::setLeft(int left) -{ - x = left; -} - -int RegionType::top() -{ - return y; -} - -void RegionType::setTop(int top) -{ - y = top; -} - -int RegionType::width() -{ - return w; -} - -void RegionType::setWidth(int width) -{ - w = width; -} - -int RegionType::height() -{ - return h; -} - -void RegionType::setHeight(int height) -{ - h = height; -} - -QRect RegionType::region() const -{ - return QRect(x, y, w, h); -} diff --git a/tizen/src/ui/xml/regiontype.h b/tizen/src/ui/xml/regiontype.h deleted file mode 100644 index e0885ab..0000000 --- a/tizen/src/ui/xml/regiontype.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Qt UI - * - * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * GiWoong Kim - * Sangho Park - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#ifndef REGIONTYPE_H -#define REGIONTYPE_H - -#include -#include - -class RegionType : public QObject -{ - Q_OBJECT - Q_PROPERTY(int left READ left WRITE setLeft) - Q_PROPERTY(int top READ top WRITE setTop) - Q_PROPERTY(int width READ width WRITE setWidth) - Q_PROPERTY(int height READ height WRITE setHeight) - -public: - explicit RegionType(QObject *parent = 0); - - int left(); - int top(); - int width(); - int height(); - - QRect region() const; - -private: - void setLeft(int left); - void setTop(int top); - void setWidth(int width); - void setHeight(int height); - - int x; - int y; - int w; - int h; -}; - -#endif // REGIONTYPE_H -- 2.7.4