*/
#include <QApplication>
-#include <QQmlComponent>
-#include <QQmlEngine>
-#include <QQmlProperty>
#include "qt5_supplement.h"
#include "mainwindow.h"
#include "hardwarekey.h"
#include "floatingcontroller.h"
#include "xmllayoutparser.h"
-#include "ui/xml/emulatoruitype.h"
#include "uiutil.h"
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 *);
}
uiInfo->uiState.mainFormScale = scale;
- /* XML */
- // TODO: convert QML to XML
-
- /* Register custom QML elements */
- qmlRegisterType<RegionType>("EmulatorComponent", 1, 0, "Region");
- qmlRegisterType<HardwareKeyType>("EmulatorComponent", 1, 0, "Key");
- qmlRegisterType<KeyListType>("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) {
}
}
-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<EmulatorUIType>("EmulatorComponent", 1, 0, "EmulatorUI");
- qmlRegisterType<FormListType>("EmulatorComponent", 1, 0, "FormList");
- qmlRegisterType<FormType>("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) {
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
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
+++ /dev/null
-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 $@
-
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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;
-}
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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 <QObject>
-
-#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
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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<FormType> FormListType::formList()
-{
- return QQmlListProperty<FormType>(this, list);
-}
-
-QList<FormType *> *FormListType::getFormList()
-{
- return &list;
-}
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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 <QObject>
-#include <QQmlListProperty>
-
-#include "formtype.h"
-
-class FormListType : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QQmlListProperty<FormType> formList READ formList)
- Q_CLASSINFO("DefaultProperty", "formList")
-
-public:
- explicit FormListType(QObject *parent = 0);
-
- QList<FormType *> *getFormList();
-
-private:
- QQmlListProperty<FormType> formList();
-
- QList<FormType *> list;
-};
-
-#endif // FORMLISTTYPE_H
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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();
-}
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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 <QObject>
-
-#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
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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();
-}
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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 <QObject>
-
-#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
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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<HardwareKeyType> KeyListType::keyListType()
-{
- return QQmlListProperty<HardwareKeyType>(this, list);
-}
-
-QList<HardwareKeyType *> *KeyListType::getKeyList()
-{
- return &list;
-}
-
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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 <QObject>
-#include <QQmlListProperty>
-
-#include "hardwarekeytype.h"
-
-class KeyListType : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QQmlListProperty<HardwareKeyType> keyListType READ keyListType)
- Q_CLASSINFO("DefaultProperty", "keyListType")
-
-public:
- explicit KeyListType(QObject *parent = 0);
-
- QList<HardwareKeyType *> *getKeyList();
-
-private:
- QQmlListProperty<HardwareKeyType> keyListType();
-
- QList<HardwareKeyType *> list;
-};
-
-#endif // KEYLISTTYPE_H
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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);
-}
+++ /dev/null
-/*
- * Qt UI
- *
- * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
- *
- * 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 <QObject>
-#include <QRect>
-
-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