mirror of
https://github.com/libretro/RetroArch
synced 2025-04-25 18:02:57 +00:00
Merge pull request #2090 from fr500/master
[QT] populate core list and collection list
This commit is contained in:
commit
d16ec2fc3b
@ -1,301 +1,211 @@
|
|||||||
import QtQuick 2.4
|
import QtQuick 2.2
|
||||||
import QtQuick.Window 2.2
|
import Material 0.1
|
||||||
import QtQuick.Controls 1.2
|
import Material.ListItems 0.1 as ListItem
|
||||||
import QtQuick.Layouts 1.1
|
|
||||||
|
|
||||||
|
ApplicationWindow {
|
||||||
Window {
|
|
||||||
id: mainWindow
|
id: mainWindow
|
||||||
title: "RetroArch"
|
title: "RetroArch"
|
||||||
width: 1280
|
width: 1280
|
||||||
height: 720
|
height: 720
|
||||||
color: "#211822"
|
color: "#211822"
|
||||||
visible: true
|
visible: true
|
||||||
|
theme {
|
||||||
|
primaryColor: Palette.colors["blue"]["500"]
|
||||||
|
primaryDarkColor: Palette.colors["blue"]["700"]
|
||||||
|
accentColor: Palette.colors["red"]["A200"]
|
||||||
|
tabHighlightColor: "white"
|
||||||
|
}
|
||||||
|
|
||||||
SplitView {
|
/* temporary top level folder list */
|
||||||
|
property var folders: [
|
||||||
|
"C:\\", "D:\\"
|
||||||
|
]
|
||||||
|
|
||||||
|
property var sections: [ collections, cores, folders ]
|
||||||
|
property var sectionTitles: [ "Collections", "Cores", "File Browser" ]
|
||||||
|
|
||||||
|
property string selectedItem: collections[0]
|
||||||
|
|
||||||
|
|
||||||
|
initialPage: Page {
|
||||||
|
id: page
|
||||||
|
|
||||||
|
title: "RetroArch"
|
||||||
|
|
||||||
|
tabs: navDrawer.enabled ? [] : sectionTitles
|
||||||
|
|
||||||
|
actionBar.maxActionCount: navDrawer.enabled ? 3 : 4
|
||||||
|
|
||||||
|
actions: [
|
||||||
|
Action {
|
||||||
|
iconName: "action/search"
|
||||||
|
name: "Search"
|
||||||
|
enabled: true
|
||||||
|
},
|
||||||
|
|
||||||
|
Action {
|
||||||
|
iconName: "image/color_lens"
|
||||||
|
name: "Colors"
|
||||||
|
onTriggered: colorPicker.show()
|
||||||
|
},
|
||||||
|
|
||||||
|
Action {
|
||||||
|
iconName: "action/settings"
|
||||||
|
name: "Settings"
|
||||||
|
hoverAnimation: true
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
Action {
|
||||||
|
iconName: "action/language"
|
||||||
|
name: "Language"
|
||||||
|
enabled: true
|
||||||
|
},
|
||||||
|
|
||||||
|
Action {
|
||||||
|
iconName: "action/account_circle"
|
||||||
|
name: "Accounts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
backAction: navDrawer.action
|
||||||
|
|
||||||
|
NavigationDrawer {
|
||||||
|
id: navDrawer
|
||||||
|
enabled: page.width < Units.dp(500)
|
||||||
|
|
||||||
|
|
||||||
|
Flickable {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
orientation: Qt.Horizontal
|
|
||||||
|
|
||||||
Rectangle {
|
contentHeight: Math.max(content.implicitHeight, height)
|
||||||
id: consoleBar;
|
|
||||||
color: "#2b2b2b";
|
|
||||||
height: 500;
|
|
||||||
width: 250;
|
|
||||||
Layout.maximumWidth: 400
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: rightBord;
|
|
||||||
anchors {
|
|
||||||
top: parent.top;
|
|
||||||
bottom: parent.bottom;
|
|
||||||
right: parent.right;
|
|
||||||
}
|
|
||||||
width: 1;
|
|
||||||
color: "#1a1a1a";
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: leftBord;
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
top: parent.top;
|
|
||||||
bottom: parent.bottom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: consoleHeader;
|
|
||||||
height: 36;
|
|
||||||
color: parent.color;
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: parent.top;
|
|
||||||
//topMargin: 12;
|
|
||||||
left: parent.left;
|
|
||||||
right: parent.right;
|
|
||||||
rightMargin: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouse;
|
|
||||||
anchors.fill: parent;
|
|
||||||
onClicked: {
|
|
||||||
if (listView.retractList)
|
|
||||||
listView.retractList = false;
|
|
||||||
else
|
|
||||||
listView.retractList = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
top: parent.top;
|
|
||||||
topMargin: 12;
|
|
||||||
leftMargin: 12;
|
|
||||||
horizontalCenter: parent.horizontalCenter;
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
renderType: Text.QtRendering;
|
|
||||||
text: "Platforms";
|
|
||||||
color: "#f1f1f1";
|
|
||||||
font {
|
|
||||||
bold: true;
|
|
||||||
family: "Sans";
|
|
||||||
pixelSize: 12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListModel {
|
|
||||||
id: platformsModel
|
|
||||||
ListElement { name: "Megadrive" }
|
|
||||||
ListElement { name: "Nintendo" }
|
|
||||||
ListElement { name: "Playstation" }
|
|
||||||
}
|
|
||||||
ListView {
|
|
||||||
id: listView;
|
|
||||||
visible: (height !== 0);
|
|
||||||
anchors {
|
|
||||||
top: consoleHeader.bottom;
|
|
||||||
//bottom: parent.bottom;
|
|
||||||
right: parent.right;
|
|
||||||
left: parent.left;
|
|
||||||
topMargin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
height: retractList ? 0 : 500;
|
|
||||||
|
|
||||||
Behavior on height {
|
|
||||||
PropertyAnimation {}
|
|
||||||
}
|
|
||||||
|
|
||||||
snapMode: ListView.SnapToItem;
|
|
||||||
orientation: ListView.Vertical;
|
|
||||||
interactive: true;
|
|
||||||
highlightFollowsCurrentItem: false;
|
|
||||||
|
|
||||||
property bool retractList: false;
|
|
||||||
|
|
||||||
highlight: Item {
|
|
||||||
id: highlightItem;
|
|
||||||
visible: !listView.retractList;
|
|
||||||
height: listView.currentItem.height;
|
|
||||||
width: listView.width;
|
|
||||||
anchors.verticalCenter: listView.currentItem.verticalCenter;
|
|
||||||
y: listView.currentItem.y;
|
|
||||||
Item {
|
|
||||||
id: innerItem;
|
|
||||||
height: parent.height;
|
|
||||||
width: parent.width;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: mainColor;
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
right: parent.right;
|
|
||||||
top: parent.top;
|
|
||||||
bottom: parent.bottom;
|
|
||||||
}
|
|
||||||
color: listView.currentItem ? "#171717" : "#000000FF";
|
|
||||||
Rectangle {
|
|
||||||
id: topBorder;
|
|
||||||
color: "#f27b77";
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
leftMargin: leftBord.width;
|
|
||||||
top: parent.top;
|
|
||||||
}
|
|
||||||
height: 2;
|
|
||||||
width: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
// leftAccent;
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
leftMargin: leftBord.width;
|
|
||||||
bottom: bottomB.top;
|
|
||||||
top: topBorder.bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors {
|
|
||||||
top: parent.top;
|
|
||||||
bottom: parent.bottom;
|
|
||||||
}
|
|
||||||
width: 1;
|
|
||||||
color: "#db5753";
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors {
|
|
||||||
top: parent.top;
|
|
||||||
bottom: parent.bottom;
|
|
||||||
}
|
|
||||||
width: 3;
|
|
||||||
color: "#e8433f";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: bottomB;
|
id: content
|
||||||
anchors {
|
anchors.fill: parent
|
||||||
right: parent.right;
|
|
||||||
rightMargin: rightBord.width;
|
|
||||||
left: parent.left;
|
|
||||||
leftMargin: leftBord.width;
|
|
||||||
bottom: parent.bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Repeater {
|
||||||
color: "#a22f2c";
|
model: sections
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
delegate: ListItem.Standard {
|
||||||
|
width: parent.width
|
||||||
|
ListItem.Subheader {
|
||||||
|
text: sectionTitles[index]
|
||||||
}
|
}
|
||||||
width: 4;
|
|
||||||
height: 2;
|
|
||||||
}
|
}
|
||||||
Rectangle {
|
|
||||||
color: "#474747";
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
right: parent.right;
|
|
||||||
}
|
}
|
||||||
height: 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TabView {
|
||||||
|
id: tabView
|
||||||
|
anchors.fill: parent
|
||||||
|
currentIndex: page.selectedTab
|
||||||
|
model: sections
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
right: parent.right;
|
|
||||||
left: parent.left;
|
|
||||||
top: consoleLabel.bottom;
|
|
||||||
topMargin: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
model: platformsModel;
|
|
||||||
|
|
||||||
ExclusiveGroup {
|
|
||||||
id: consoleGroup
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
//visible: !listView.retractList;
|
width: tabView.width
|
||||||
height: 22;
|
height: tabView.height
|
||||||
width: consoleBar.width;
|
clip: true
|
||||||
Row {
|
|
||||||
id: row;
|
Sidebar {
|
||||||
|
id: sidebar
|
||||||
|
|
||||||
|
expanded: !navDrawer.enabled
|
||||||
|
|
||||||
|
Column {
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: modelData
|
||||||
|
delegate: ListItem.Standard {
|
||||||
|
text: modelData
|
||||||
|
selected: modelData == selectedItem
|
||||||
|
onClicked: selectedItem = modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Flickable {
|
||||||
|
id: flickable
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent;
|
left: sidebar.right
|
||||||
leftMargin: 25;
|
right: parent.right
|
||||||
|
top: parent.top
|
||||||
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
spacing: 7;
|
clip: true
|
||||||
|
Column {
|
||||||
Image {
|
width: parent.width
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
|
||||||
fillMode: Image.PreserveAspectFit;
|
|
||||||
sourceSize {
|
|
||||||
height: 24;
|
|
||||||
width: 24;
|
|
||||||
}
|
|
||||||
height: 20;
|
|
||||||
width: 20;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
|
||||||
id: consoleItem;
|
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
|
||||||
width: 140;
|
|
||||||
text: modelData;
|
|
||||||
color: "#f1f1f1";
|
|
||||||
renderType: Text.QtRendering;
|
|
||||||
elide: Text.ElideRight;
|
|
||||||
font {
|
|
||||||
family: "Sans";
|
|
||||||
pixelSize: 11;
|
|
||||||
}
|
}
|
||||||
}
|
Scrollbar {
|
||||||
}
|
flickableItem: flickable
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent;
|
|
||||||
onClicked: {
|
|
||||||
listView.currentIndex = index;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dialog {
|
||||||
|
id: colorPicker
|
||||||
|
title: "Pick color"
|
||||||
|
|
||||||
|
positiveButtonText: "Done"
|
||||||
|
|
||||||
|
MenuField {
|
||||||
|
id: selection
|
||||||
|
model: ["Primary color", "Accent color", "Background color"]
|
||||||
|
width: Units.dp(160)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Grid {
|
||||||
|
columns: 7
|
||||||
|
spacing: Units.dp(8)
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: [
|
||||||
|
"red", "pink", "purple", "deepPurple", "indigo",
|
||||||
|
"blue", "lightBlue", "cyan", "teal", "green",
|
||||||
|
"lightGreen", "lime", "yellow", "amber", "orange",
|
||||||
|
"deepOrange", "grey", "blueGrey", "brown", "black",
|
||||||
|
"white"
|
||||||
|
]
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: centerItem
|
width: Units.dp(30)
|
||||||
Layout.minimumWidth: 50
|
height: Units.dp(30)
|
||||||
Layout.fillWidth: true
|
radius: Units.dp(2)
|
||||||
color: "lightgray"
|
color: Palette.colors[modelData]["500"]
|
||||||
Text {
|
border.width: modelData === "white" ? Units.dp(2) : 0
|
||||||
text: "Content View"
|
border.color: Theme.alpha("#000", 0.26)
|
||||||
anchors.centerIn: parent
|
|
||||||
|
Ink {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
switch(selection.selectedIndex) {
|
||||||
|
case 0:
|
||||||
|
theme.primaryColor = parent.color
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
theme.accentColor = parent.color
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
theme.backgroundColor = parent.color
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onRejected: {
|
||||||
|
// TODO set default colors again but we currently don't know what that is
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,34 +17,75 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
#include <QListView>
|
|
||||||
#include <QQuickWindow>
|
#include <QQuickWindow>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QQmlContext>
|
||||||
|
|
||||||
QObject *topLevel;
|
QObject *topLevel;
|
||||||
|
|
||||||
static settings_t *settings;
|
int Wimp::CreateMainWindow()
|
||||||
|
|
||||||
int Wimp::CreateMainWindow(char* windowTitle)
|
|
||||||
{
|
{
|
||||||
QQmlApplicationEngine engine;
|
|
||||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||||
topLevel = engine.rootObjects().value(0);
|
topLevel = engine.rootObjects().value(0);
|
||||||
window = qobject_cast<QQuickWindow *>(topLevel);
|
window = qobject_cast<QQuickWindow *>(topLevel);
|
||||||
SetTitle(windowTitle);
|
|
||||||
|
if(settings->playlist_directory[0] != '\0')
|
||||||
|
GetCollections(settings->playlist_directory);
|
||||||
|
else
|
||||||
|
collections.append("Collection dir not defined");
|
||||||
|
|
||||||
|
engine.rootContext()->setContextProperty("collections", QVariant::fromValue(collections));
|
||||||
|
|
||||||
|
if(settings->libretro_directory[0] != '\0')
|
||||||
|
GetCores(settings->libretro_directory);
|
||||||
|
else
|
||||||
|
cores.append("Core dir not defined");
|
||||||
|
|
||||||
|
engine.rootContext()->setContextProperty("cores", QVariant::fromValue(cores));
|
||||||
|
|
||||||
return this->exec();
|
return this->exec();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Wimp::GetSettings(settings_t *s)
|
||||||
void Wimp::SetTitle(char* title)
|
|
||||||
{
|
{
|
||||||
window->setTitle(title);
|
settings = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Wimp::ConfigGetPtr(settings_t *g_config)
|
void Wimp::GetCollections(char* path)
|
||||||
{
|
{
|
||||||
settings = g_config;
|
QDir dir(path);
|
||||||
/* test print the value of max users to compare with the value in RA */
|
dir.setNameFilters(QStringList("*.lpl"));
|
||||||
printf("Max Users: %d\n",g_config->input.max_users);
|
QStringList fileList = dir.entryList();
|
||||||
fflush(stdout);
|
|
||||||
|
if(fileList.count() == 0)
|
||||||
|
collections.append("Empty");
|
||||||
|
|
||||||
|
for (int i=0; i < fileList.count(); i++)
|
||||||
|
{
|
||||||
|
QString collection = fileList[i].section('.',0,0);
|
||||||
|
collections.append(collection);
|
||||||
|
qDebug() << "Found file: " << collection;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Wimp::GetCores(char* path)
|
||||||
|
{
|
||||||
|
QDir dir(path);
|
||||||
|
dir.setNameFilters(QStringList("*.dll"));
|
||||||
|
QStringList fileList = dir.entryList();
|
||||||
|
|
||||||
|
if(fileList.count() == 0)
|
||||||
|
cores.append("Empty");
|
||||||
|
|
||||||
|
for (int i=0; i < fileList.count(); i++)
|
||||||
|
{
|
||||||
|
QString core = fileList[i].section('.',0,0);
|
||||||
|
cores.append(core);
|
||||||
|
qDebug() << "Found file: " << core;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,12 +16,22 @@
|
|||||||
#ifndef WIMP_H
|
#ifndef WIMP_H
|
||||||
#define WIMP_H
|
#define WIMP_H
|
||||||
|
|
||||||
|
/* this is the only define missing from config.h remove these once
|
||||||
|
* we can build everything with a single makefile
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef HAVE_MENU
|
||||||
|
#define HAVE_MENU
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
#include "wimp_global.h"
|
#include "wimp_global.h"
|
||||||
#include <QtWidgets/qwidget.h>
|
#include <QtWidgets/qwidget.h>
|
||||||
#include <QtWidgets/qapplication.h>
|
#include <QtWidgets/qapplication.h>
|
||||||
#include <QtQml/qqmlapplicationengine.h>
|
#include <QtQml/qqmlapplicationengine.h>
|
||||||
#include <QtQuick/qquickwindow.h>
|
#include <QtQuick/qquickwindow.h>
|
||||||
#include "configuration.h"
|
|
||||||
|
|
||||||
class WIMPSHARED_EXPORT Wimp : public QGuiApplication
|
class WIMPSHARED_EXPORT Wimp : public QGuiApplication
|
||||||
{
|
{
|
||||||
@ -30,10 +40,24 @@ class WIMPSHARED_EXPORT Wimp : public QGuiApplication
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Wimp(int argc, char *argv[]): QGuiApplication(argc, argv) {}
|
Wimp(int argc, char *argv[]): QGuiApplication(argc, argv) {}
|
||||||
int CreateMainWindow(char* windowTitle);
|
|
||||||
void SetTitle(char* title);
|
/* create the main QT window */
|
||||||
void ConfigGetPtr(settings_t *g_config);
|
int CreateMainWindow();
|
||||||
|
|
||||||
|
/* get a pointer to RetroArch settings */
|
||||||
|
void GetSettings(settings_t *s);
|
||||||
|
|
||||||
|
void GetCollections(char* path);
|
||||||
|
void GetCores(char* path);
|
||||||
|
|
||||||
|
private:
|
||||||
|
/* pointer to RetroArch settings */
|
||||||
|
settings_t *settings;
|
||||||
|
QStringList collections;
|
||||||
|
QStringList cores;
|
||||||
|
QQmlApplicationEngine engine;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WIMP_H
|
#endif // WIMP_H
|
||||||
|
|
||||||
|
@ -29,14 +29,14 @@ Wimp* ctrWimp(int argc, char *argv[]){
|
|||||||
return new Wimp(argc,argv);
|
return new Wimp(argc,argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CreateMainWindow(Wimp* p, char* windowTitle)
|
int CreateMainWindow(Wimp* p)
|
||||||
{
|
{
|
||||||
return p->CreateMainWindow(windowTitle);
|
return p->CreateMainWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigGetPtr(Wimp*p, settings_t *g_config)
|
void GetSettings(Wimp* p, settings_t *s)
|
||||||
{
|
{
|
||||||
return p->ConfigGetPtr(g_config);
|
return p->GetSettings(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -13,6 +13,11 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef HAVE_MENU
|
||||||
|
#define HAVE_MENU
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#ifndef WRAPPER_H
|
#ifndef WRAPPER_H
|
||||||
@ -23,11 +28,12 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct Wimp Wimp;
|
typedef struct Wimp Wimp;
|
||||||
|
typedef settings_t (*config_get_ptr_cb);
|
||||||
|
|
||||||
Wimp* ctrWimp(int argc, char *argv[]);
|
Wimp* ctrWimp(int argc, char *argv[]);
|
||||||
|
|
||||||
int CreateMainWindow(Wimp* p, char* windowTitle);
|
int CreateMainWindow(Wimp* p);
|
||||||
void ConfigGetPtr(Wimp*p, settings_t *g_config);
|
void GetSettings(Wimp* p, settings_t *s);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
struct Wimp* wimp;
|
struct Wimp* wimp;
|
||||||
char* args[] = {""};
|
char* args[] = {""};
|
||||||
|
settings_t *settings;
|
||||||
|
|
||||||
typedef struct ui_companion_qt
|
typedef struct ui_companion_qt
|
||||||
{
|
{
|
||||||
@ -41,16 +41,12 @@ typedef struct ui_companion_qt
|
|||||||
static void qt_thread(void *data)
|
static void qt_thread(void *data)
|
||||||
{
|
{
|
||||||
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
/* test print the value of max users to compare with the value in QT */
|
|
||||||
RARCH_LOG("Max Users: %d\n", settings->input.max_users);
|
|
||||||
|
|
||||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||||
wimp = ctrWimp(0, NULL);
|
wimp = ctrWimp(0, NULL);
|
||||||
if(wimp)
|
if(wimp)
|
||||||
{
|
{
|
||||||
ConfigGetPtr(wimp, settings);
|
GetSettings(wimp, settings);
|
||||||
CreateMainWindow(wimp, "RetroArch QT");
|
CreateMainWindow(wimp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -74,7 +70,7 @@ static void *ui_companion_qt_init(void)
|
|||||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle));
|
ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle));
|
||||||
if (!handle)
|
if (!handle)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
settings = config_get_ptr();
|
||||||
handle->lock = slock_new();
|
handle->lock = slock_new();
|
||||||
handle->thread = sthread_create(qt_thread, handle);
|
handle->thread = sthread_create(qt_thread, handle);
|
||||||
if (!handle->thread)
|
if (!handle->thread)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user