2015-04-13 00:29:46 -04:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2015 - Andres Suarez
|
|
|
|
*
|
|
|
|
* RetroArch 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 Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch 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 RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2015-04-12 15:20:57 -04:00
|
|
|
#include "wimp.h"
|
|
|
|
#include "stdio.h"
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QListView>
|
2015-04-13 00:29:46 -04:00
|
|
|
#include <QQuickWindow>
|
|
|
|
|
|
|
|
QObject *topLevel;
|
2015-04-12 15:20:57 -04:00
|
|
|
|
2015-08-31 22:23:40 -05:00
|
|
|
static settings_t *settings;
|
|
|
|
|
|
|
|
int Wimp::CreateMainWindow(char* windowTitle)
|
2015-04-12 15:20:57 -04:00
|
|
|
{
|
|
|
|
QQmlApplicationEngine engine;
|
|
|
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
2015-04-13 00:29:46 -04:00
|
|
|
topLevel = engine.rootObjects().value(0);
|
|
|
|
window = qobject_cast<QQuickWindow *>(topLevel);
|
2015-08-31 22:23:40 -05:00
|
|
|
SetTitle(windowTitle);
|
2015-04-12 15:20:57 -04:00
|
|
|
|
|
|
|
return this->exec();
|
|
|
|
}
|
|
|
|
|
2015-08-31 19:28:14 -05:00
|
|
|
|
2015-04-13 00:29:46 -04:00
|
|
|
void Wimp::SetTitle(char* title)
|
|
|
|
{
|
2015-08-31 21:00:46 -05:00
|
|
|
window->setTitle(title);
|
2015-04-13 00:29:46 -04:00
|
|
|
}
|
2015-08-31 19:28:14 -05:00
|
|
|
|
2015-08-31 22:23:40 -05:00
|
|
|
void Wimp::ConfigGetPtr(settings_t *g_config)
|
2015-08-31 19:28:14 -05:00
|
|
|
{
|
2015-08-31 22:23:40 -05:00
|
|
|
settings = g_config;
|
|
|
|
/* test print the value of max users to compare with the value in RA */
|
|
|
|
printf("Max Users: %d\n",g_config->input.max_users);
|
2015-08-31 21:00:46 -05:00
|
|
|
fflush(stdout);
|
2015-08-31 19:28:14 -05:00
|
|
|
}
|