commit
9c6f1c2c91
|
@ -222,7 +222,7 @@ endif
|
||||||
ifeq ($(HAVE_QT), 1)
|
ifeq ($(HAVE_QT), 1)
|
||||||
OBJ += ui/drivers/ui_qt.o
|
OBJ += ui/drivers/ui_qt.o
|
||||||
# TODO/FIXME - figure out which libraries we need to link against
|
# TODO/FIXME - figure out which libraries we need to link against
|
||||||
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lglu32 -lopengl32 -L./ui/drivers/qt/release -lwrapper
|
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lglu32 -lopengl32 -L./ui/drivers/qt/wrapper/build/release -lwrapper
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# LibretroDB
|
# LibretroDB
|
||||||
|
|
|
@ -404,6 +404,6 @@ add_define_make OS "$OS"
|
||||||
|
|
||||||
# Creates config.mk and config.h.
|
# Creates config.mk and config.h.
|
||||||
add_define_make GLOBAL_CONFIG_DIR "$GLOBAL_CONFIG_DIR"
|
add_define_make GLOBAL_CONFIG_DIR "$GLOBAL_CONFIG_DIR"
|
||||||
VARS="RGUI LAKKA GLUI XMB ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO CORETEXT PULSE SDL SDL2 D3D9 DINPUT LIBUSB XINPUT DSOUND XAUDIO OPENGL EXYNOS DISPMANX SUNXI OMAP GLES GLES3 VG EGL KMS GBM DRM DYLIB GETOPT_LONG THREADS CG LIBXML2 ZLIB DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE FREETYPE STB_FONT XKBCOMMON XVIDEO X11 XEXT XF86VM XINERAMA WAYLAND MALI_FBDEV VIVANTE_FBDEV NETWORKING NETPLAY NETWORK_CMD STDIN_CMD COMMAND SOCKET_LEGACY FBO STRL STRCASESTR MMAP PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 SWRESAMPLE FFMPEG_AVCODEC_ENCODE_VIDEO2 BSV_MOVIE VIDEOCORE NEON FLOATHARD FLOATSOFTFP UDEV V4L2 AV_CHANNEL_LAYOUT 7ZIP PARPORT IMAGEVIEWER COCOA AVFOUNDATION CORELOCATION IOHIDMANAGER LIBRETRODB"
|
VARS="RGUI LAKKA GLUI XMB ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO CORETEXT PULSE SDL SDL2 D3D9 DINPUT LIBUSB XINPUT DSOUND XAUDIO OPENGL EXYNOS DISPMANX SUNXI OMAP GLES GLES3 VG EGL KMS GBM DRM DYLIB GETOPT_LONG THREADS CG LIBXML2 ZLIB DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE FREETYPE STB_FONT XKBCOMMON XVIDEO X11 XEXT XF86VM XINERAMA WAYLAND MALI_FBDEV VIVANTE_FBDEV NETWORKING NETPLAY NETWORK_CMD STDIN_CMD COMMAND SOCKET_LEGACY FBO STRL STRCASESTR MMAP PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 SWRESAMPLE FFMPEG_AVCODEC_ENCODE_VIDEO2 BSV_MOVIE VIDEOCORE NEON FLOATHARD FLOATSOFTFP UDEV V4L2 AV_CHANNEL_LAYOUT 7ZIP PARPORT IMAGEVIEWER COCOA AVFOUNDATION CORELOCATION IOHIDMANAGER LIBRETRODB QT"
|
||||||
create_config_make config.mk $VARS
|
create_config_make config.mk $VARS
|
||||||
create_config_header config.h $VARS
|
create_config_header config.h $VARS
|
||||||
|
|
|
@ -57,3 +57,4 @@ HAVE_PRESERVE_DYLIB=no # Disable dlclose() for Valgrind support
|
||||||
HAVE_PARPORT=auto # Parallel port joypad support
|
HAVE_PARPORT=auto # Parallel port joypad support
|
||||||
HAVE_IMAGEVIEWER=yes # Built-in image viewer support.
|
HAVE_IMAGEVIEWER=yes # Built-in image viewer support.
|
||||||
HAVE_MMAP=auto # MMAP support
|
HAVE_MMAP=auto # MMAP support
|
||||||
|
HAVE_QT=no # QT companion support
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
#include <QDebug>
|
||||||
|
#include "../wrapper/wrapper.h"
|
||||||
|
#include "../wimp/wimp.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
struct Wimp* t;
|
||||||
|
|
||||||
|
|
||||||
|
int i=0;
|
||||||
|
|
||||||
|
void *initGui(void *arg)
|
||||||
|
{
|
||||||
|
char **arguments = (char**)arg;
|
||||||
|
t = ctrWimp(i,arguments);
|
||||||
|
CreateMainWindow(t); //-->uncomment this to open the QT gui
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
i = argc;
|
||||||
|
|
||||||
|
pthread_t gui;
|
||||||
|
int rc;
|
||||||
|
rc=pthread_create(&gui, NULL, initGui, (void *)argv);
|
||||||
|
if(rc!=0)
|
||||||
|
{
|
||||||
|
printf("failed");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int j=0;j<100;j++)
|
||||||
|
{
|
||||||
|
Sleep(1000);
|
||||||
|
printf("test = %d\n",i);
|
||||||
|
i++;
|
||||||
|
if(j < 2)
|
||||||
|
t->SetTitle("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
pthread_join(gui,NULL);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
TARGET = wimp-test
|
||||||
|
CONFIG += console
|
||||||
|
|
||||||
|
|
||||||
|
SOURCES += main.cpp
|
||||||
|
|
||||||
|
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../wimp/build/release/ -lwimp.dll
|
||||||
|
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../wimp/build/debug/ -lwimp.dll
|
||||||
|
else:unix: LIBS += -L$$PWD/../wimp/build/ -lwimp.dll
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../wimp/build/release
|
||||||
|
DEPENDPATH += $$PWD/../wimp/build/release
|
||||||
|
|
||||||
|
|
||||||
|
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../wrapper/build/release/ -lwrapper.dll
|
||||||
|
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../wrapper/build/debug/ -lwrapper.dll
|
||||||
|
else:unix: LIBS += -L$$PWD/../wrapper/build/ -lwrapper.dll
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../wrapper/build/release
|
||||||
|
DEPENDPATH += $$PWD/../wrapper/build/release
|
|
@ -21,20 +21,30 @@
|
||||||
#include <QQuickWindow>
|
#include <QQuickWindow>
|
||||||
|
|
||||||
QObject *topLevel;
|
QObject *topLevel;
|
||||||
QQuickWindow *window;
|
|
||||||
|
|
||||||
int Wimp::CreateMainWindow()
|
static settings_t *settings;
|
||||||
|
|
||||||
|
int Wimp::CreateMainWindow(char* windowTitle)
|
||||||
{
|
{
|
||||||
QQmlApplicationEngine engine;
|
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);
|
||||||
|
|
||||||
SetTitle("Hello QT");
|
|
||||||
return this->exec();
|
return this->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Wimp::SetTitle(char* title)
|
void Wimp::SetTitle(char* title)
|
||||||
{
|
{
|
||||||
window->setTitle(title);
|
window->setTitle(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Wimp::ConfigGetPtr(settings_t *g_config)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,15 +20,19 @@
|
||||||
#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 "configuration.h"
|
||||||
|
|
||||||
class WIMPSHARED_EXPORT Wimp : public QGuiApplication
|
class WIMPSHARED_EXPORT Wimp : public QGuiApplication
|
||||||
{
|
{
|
||||||
|
QQuickWindow *window;
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Wimp(int argc, char *argv[]): QGuiApplication(argc, argv) {}
|
Wimp(int argc, char *argv[]): QGuiApplication(argc, argv) {}
|
||||||
int CreateMainWindow();
|
int CreateMainWindow(char* windowTitle);
|
||||||
void SetTitle(char* title);
|
void SetTitle(char* title);
|
||||||
|
void ConfigGetPtr(settings_t *g_config);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,3 +20,7 @@ HEADERS +=\
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
qml.qrc
|
qml.qrc
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../../../../
|
||||||
|
INCLUDEPATH += $$PWD/../../../../libretro-common/include/
|
||||||
|
|
|
@ -29,14 +29,14 @@ Wimp* ctrWimp(int argc, char *argv[]){
|
||||||
return new Wimp(argc,argv);
|
return new Wimp(argc,argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CreateMainWindow(Wimp* p)
|
int CreateMainWindow(Wimp* p, char* windowTitle)
|
||||||
{
|
{
|
||||||
return p->CreateMainWindow();
|
return p->CreateMainWindow(windowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetTitle(Wimp*p, char* title)
|
void ConfigGetPtr(Wimp*p, settings_t *g_config)
|
||||||
{
|
{
|
||||||
return p->SetTitle(title);
|
return p->ConfigGetPtr(g_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
#ifndef WRAPPER_H
|
#ifndef WRAPPER_H
|
||||||
#define WRAPPER_H
|
#define WRAPPER_H
|
||||||
|
@ -25,8 +26,8 @@ typedef struct Wimp Wimp;
|
||||||
|
|
||||||
Wimp* ctrWimp(int argc, char *argv[]);
|
Wimp* ctrWimp(int argc, char *argv[]);
|
||||||
|
|
||||||
int CreateMainWindow(Wimp* p);
|
int CreateMainWindow(Wimp* p, char* windowTitle);
|
||||||
void SetTitle(Wimp* p, char* title);
|
void ConfigGetPtr(Wimp*p, settings_t *g_config);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,12 @@ HEADERS += \
|
||||||
wrapper.h
|
wrapper.h
|
||||||
|
|
||||||
|
|
||||||
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../release -lwimp
|
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../wimp/build/release/ -lwimp.dll
|
||||||
|
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../wimp/build/debug/ -lwimp.dll
|
||||||
|
else:unix: LIBS += -L$$PWD/../wimp/build/ -lwimp.dll
|
||||||
|
|
||||||
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../release/libwimp.dll.a
|
INCLUDEPATH += $$PWD/../wimp/build/release
|
||||||
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../release/wimp.lib
|
DEPENDPATH += $$PWD/../wimp/build/release
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../../../../
|
||||||
|
INCLUDEPATH += $$PWD/../../../../libretro-common/include/
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "general.h"
|
||||||
|
#include "system.h"
|
||||||
|
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include <rthreads/rthreads.h>
|
#include <rthreads/rthreads.h>
|
||||||
|
@ -38,11 +40,18 @@ typedef struct ui_companion_qt
|
||||||
|
|
||||||
static void qt_thread(void *data)
|
static void qt_thread(void *data)
|
||||||
{
|
{
|
||||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)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;
|
||||||
wimp = ctrWimp(0, NULL);
|
wimp = ctrWimp(0, NULL);
|
||||||
if(wimp)
|
if(wimp)
|
||||||
CreateMainWindow(wimp);
|
{
|
||||||
|
ConfigGetPtr(wimp, settings);
|
||||||
|
CreateMainWindow(wimp, "RetroArch QT");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -63,16 +72,11 @@ static void ui_companion_qt_deinit(void *data)
|
||||||
static void *ui_companion_qt_init(void)
|
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));
|
||||||
|
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
|
|
||||||
if (!handle)
|
if (!handle)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
slock_free(handle->lock);
|
slock_free(handle->lock);
|
||||||
|
@ -87,8 +91,6 @@ static int ui_companion_qt_iterate(void *data, unsigned action)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)action;
|
(void)action;
|
||||||
printf("Test");
|
|
||||||
fflush(stdout);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue