obj-$(CONFIG_QT) += displaybase.o
obj-$(CONFIG_QT) += displayglwidget.o moc_displayglwidget.o
obj-$(CONFIG_QT) += displayswwidget.o moc_displayswwidget.o
+obj-$(CONFIG_QT) += displayswapper.o moc_displayswapper.o
obj-$(CONFIG_QT) += mainwindow.o moc_mainwindow.o
obj-$(CONFIG_QT) += skinbezelitem.o
obj-$(CONFIG_QT) += skinkeyitem.o moc_skinkeyitem.o
$(obj)/moc_displayswwidget.o: $(obj)/moc_displayswwidget.cpp
$(obj)/moc_displayswwidget.cpp: $(obj)/displayswwidget.h
moc $< -o $@
+$(obj)/moc_displayswapper.o: $(obj)/moc_displayswapper.cpp
+$(obj)/moc_displayswapper.cpp: $(obj)/displayswapper.h
+ moc $< -o $@
$(obj)/moc_mainwindow.o: $(obj)/moc_mainwindow.cpp
$(obj)/moc_mainwindow.cpp: $(obj)/mainwindow.h
moc $< -o $@
--- /dev/null
+/*
+ * Qt UI
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * Sangho Park <sangho1206.park@samsung.com>
+ * Stanislav Vorobiov
+ *
+ * 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 "displayswapper.h"
+
+extern "C" {
+void qt5_graphic_hw_update(void);
+int qt5_graphic_hw_display(void);
+}
+
+DisplaySwapper::DisplaySwapper(QGLContext* context, QObject* parent) :
+ QObject(parent), context(context), terminating(false)
+{
+ /* do nothing */
+}
+
+void DisplaySwapper::display()
+{
+ if (context) {
+ while (!terminating) {
+ context->makeCurrent();
+ if (qt5_graphic_hw_display()) {
+ context->swapBuffers();
+ }
+ context->doneCurrent();
+ }
+ } else {
+ while (!terminating) {
+ qt5_graphic_hw_display();
+ }
+ }
+
+ qDebug("DisplaySwapper::display() terminated");
+
+ emit displayFinished();
+}
--- /dev/null
+/*
+ * Qt UI
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * Sangho Park <sangho1206.park@samsung.com>
+ * Stanislav Vorobiov
+ *
+ * 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 DISPLAYSWAPPER_H
+#define DISPLAYSWAPPER_H
+
+#include <QWidget>
+#include <QGLContext>
+
+class DisplaySwapper : public QObject
+{
+ Q_OBJECT
+
+public:
+ DisplaySwapper(QGLContext* context, QObject* parent = 0);
+
+ inline void setTerminating() { terminating = true; }
+
+public slots:
+ void display();
+
+signals:
+ void displayFinished();
+
+private:
+ QGLContext *context;
+ bool terminating;
+};
+
+#endif // DISPLAYSWAPPER_H
extern "C" {
void qt5_graphic_hw_update(void);
-int qt5_graphic_hw_display(void);
}
QOpenGLContext *qt5GLContext = NULL;
QSurfaceFormat qt5GLFormat;
-DisplaySwapper::DisplaySwapper(QGLContext* context, QObject* parent) :
- QObject(parent), context(context), terminating(false)
-{
- /* do nothing */
-}
-
-void DisplaySwapper::display()
-{
- /*
- * TODO: Currently qt5 skin doesn't terminate properly,
- * check this once proper termination is implemented.
- */
-
- if (context) {
- while (!terminating) {
- context->makeCurrent();
- if (qt5_graphic_hw_display()) {
- context->swapBuffers();
- }
- context->doneCurrent();
- }
- } else {
- while (!terminating) {
- qt5_graphic_hw_display();
- }
- }
-
- qDebug("DisplaySwapper::display() terminated");
-}
-
MainWindow::MainWindow(UIInformation *uiInfo, QWidget *parent) :
QWidget(parent)
{
swapper = new DisplaySwapper(context);
swapper->moveToThread(swapperThread);
- connect(swapperThread, &QThread::finished, swapper, &QObject::deleteLater);
+
+ connect(swapper, SIGNAL(displayFinished()),
+ swapperThread, SLOT(quit()), Qt::DirectConnection);
+ connect(swapperThread, SIGNAL(finished()), swapper, SLOT(deleteLater()));
+ connect(swapperThread, SIGNAL(finished()), swapperThread, SLOT(deleteLater()));
swapperThread->start();
} else { /* off-screen rendering */
#include "menu/contextmenu.h"
#include "skinview.h"
#include "displaybase.h"
+#include "displayswapper.h"
#include "rotaryview.h"
#include "uiinformation.h"
#include "controller/dockingcontroller.h"
#include "skin/maruskin_operation.h"
}
-class DisplaySwapper : public QObject
-{
- Q_OBJECT
-
-public:
- DisplaySwapper(QGLContext* context, QObject* parent = 0);
-
- inline void setTerminating() { terminating = true; }
-
-public slots:
- void display();
-
-private:
- QGLContext *context;
- bool terminating;
-};
-
class MainWindow : public QWidget
{
Q_OBJECT