if (form->skinImg[MainForm::normal].size() == QSize(0, 0)) {
qDebug("general purpose skin form");
- SkinPainter skinPainter("main-skin",
+ SkinPainter painter("main-skin",
form->displayType->region.width(), form->displayType->region.height());
- form->skinImg[MainForm::normal] = skinPainter.getSkinImage();
- form->displayType->region.translate(skinPainter.getDisplayRect().topLeft());
+ form->skinImg[MainForm::normal] = painter.getSkinImage();
+ form->displayType->region.translate(painter.getCenterRect().topLeft());
+ form->setGeneralPurpose(true);
}
list.append(form);
} else if (xml.name() == FORM_KEYWORD) {
form = parseControllerForm(xml);
if (form != NULL) {
+ if (form->conImg[ControllerForm::normal].size() == QSize(0, 0)) {
+ qDebug("general purpose con form");
+
+ // TODO:
+ }
+
uiInfo->conFormList.append(form);
}
}
obj-$(CONFIG_QT) += skinbezelitem.o
obj-$(CONFIG_QT) += skinkeyitem.o moc_skinkeyitem.o
obj-$(CONFIG_QT) += displaytype.o
+obj-$(CONFIG_QT) += layoutform.o
obj-$(CONFIG_QT) += mainform.o
obj-$(CONFIG_QT) += keyboardhelper.o
obj-$(CONFIG_QT) += keyboardshortcut.o moc_keyboardshortcut.o
#include "controllerform.h"
-ControllerForm::ControllerForm(const QString &name)
+ControllerForm::ControllerForm(const QString &name) : LayoutForm(name)
{
- this->name = name;
-}
-
-QString ControllerForm::getName()
-{
- return name;
+ /* do nothing */
}
ControllerForm::~ControllerForm()
#include <QWidget>
+#include "layoutform.h"
#include "hardwarekey.h"
-class ControllerForm
+class ControllerForm : public LayoutForm
{
Q_ENUMS(ConImgType)
ControllerForm(const QString &name);
~ControllerForm();
- QString getName();
-
QImage conImg[2];
QList<HardwareKey *> keyList;
normal = 0,
pressed = 1
};
-
-private:
- QString name;
};
#endif // CONTROLLERFORM_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 "layoutform.h"
+
+LayoutForm::LayoutForm(const QString &name)
+{
+ this->name = name;
+ this->generalPurpose = false;
+}
+
+QString LayoutForm::getName()
+{
+ return name;
+}
+
+void LayoutForm::setGeneralPurpose(bool general)
+{
+ generalPurpose = general;
+}
+
+bool LayoutForm::isGeneralPurpose()
+{
+ return generalPurpose;
+}
--- /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 LAYOUTFORM_H
+#define LAYOUTFORM_H
+
+#include <QWidget>
+
+class LayoutForm
+{
+public:
+ LayoutForm(const QString &name);
+
+ QString getName();
+ void setGeneralPurpose(bool general);
+ bool isGeneralPurpose();
+
+private:
+ QString name;
+ bool generalPurpose;
+};
+
+#endif // LAYOUTFORM_H
#include "mainform.h"
-MainForm::MainForm(const QString &name)
+MainForm::MainForm(const QString &name) : LayoutForm(name)
{
- this->name = name;
this->displayType = NULL;
}
-QString MainForm::getName()
-{
- return name;
-}
-
MainForm::~MainForm()
{
qDebug("destroy main form");
#ifndef MAINFORM_H
#define MAINFORM_H
-#include <QtWidgets>
+#include <QWidget>
+#include "layoutform.h"
#include "displaytype.h"
#include "hardwarekey.h"
-class MainForm
+class MainForm : public LayoutForm
{
Q_ENUMS(SkinImgType)
MainForm(const QString &name);
~MainForm();
- QString getName();
-
DisplayType *displayType;
QImage skinImg[2];
QList<HardwareKey *> keyList;
normal = 0,
pressed = 1
};
-
-private:
- QString name;
};
#endif // MAINFORM_H
<file>images/main-skin/RC.png</file>
<file>images/main-skin/RB.png</file>
+ <file>images/controller-skin/LT.png</file>
+ <file>images/controller-skin/LC.png</file>
+ <file>images/controller-skin/LB.png</file>
+ <file>images/controller-skin/TC.png</file>
+ <file>images/controller-skin/BC.png</file>
+ <file>images/controller-skin/RT.png</file>
+ <file>images/controller-skin/RC.png</file>
+ <file>images/controller-skin/RB.png</file>
+
<file>icons/emulator_icon.ico</file>
<file>icons/shell.png</file>
<file>icons/about.png</file>
QImage RC(patchPath + "RC.png");
QImage RB(patchPath + "RB.png");
- displayRect.setRect(LT.width(), LT.height(), displayWidth, displayHeight);
+ centerRect.setRect(LT.width(), LT.height(), displayWidth, displayHeight);
skin = new QPixmap(displayWidth + (LT.width() * 2), displayHeight + (LT.height() * 2));
skin->fill(Qt::transparent);
/* middle side */
painter.drawImage(QRect(0, LT.height(), LT.width(), displayHeight), LC);
- painter.fillRect(displayRect, Qt::SolidPattern);
+ painter.fillRect(centerRect, Qt::SolidPattern);
painter.drawImage(QRect(displayWidth + LT.width(), LT.height(), RT.width(), displayHeight), RC);
/* bottom side */
return skin->toImage();
}
-QRect SkinPainter::getDisplayRect()
+QRect SkinPainter::getCenterRect()
{
- return displayRect;
+ return centerRect;
}
unsigned int displayWidth, unsigned int displayHeight);
QImage getSkinImage();
- QRect getDisplayRect();
+ QRect getCenterRect();
private:
void drawSkinPatch(QString patchPath,
unsigned int displayWidth, unsigned int displayHeight);
QPixmap *skin;
- QRect displayRect;
+ QRect centerRect;
};
#endif // SKINPAINTER_H