1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 09:48:42 +00:00

Hide Qt wrapper code behind an ifdef - HAVE_QT_WRAPPER, set this to

1 in Makefile.common in order to use it
This commit is contained in:
twinaphex 2016-06-09 19:51:50 +02:00
parent c011090ebb
commit b4085b6118
3 changed files with 25 additions and 9 deletions

View File

@ -247,9 +247,14 @@ endif
# Qt
ifeq ($(HAVE_QT), 1)
HAVE_QT_WRAPPER=0
OBJ += ui/drivers/ui_qt.o
# TODO/FIXME - figure out which libraries we need to link against
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lglu32 -lopengl32 -L./ui/drivers/qt/wrapper/build/release -lwrapper
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -L./ui/drivers/qt/wrapper/build/release
ifeq ($(HAVE_QT_WRAPPER), 1)
LIBS += -lwrapper
endif
endif
ifeq ($(HAVE_SSA),1)

View File

@ -101,7 +101,7 @@ void get_ios_version(int *major, int *minor);
@end
@interface RetroArch_OSX : NSObject
@interface RetroArch_OSX : NSObject <NSApplicationDelegate>
{
NSWindow* _window;
}

View File

@ -28,30 +28,34 @@
#include "../../tasks/tasks_internal.h"
#include "qt/wrapper/wrapper.h"
#ifdef HAVE_QT_WRAPPER
struct Wimp* wimp;
#endif
char* args[] = {""};
settings_t *settings;
typedef struct ui_companion_qt
{
void *empty;
#ifdef HAVE_QT_WRAPPER
volatile bool quit;
slock_t *lock;
sthread_t *thread;
#endif
} ui_companion_qt_t;
#ifdef HAVE_QT_WRAPPER
static void qt_thread(void *data)
{
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
wimp = ctrWimp(0, NULL);
if(wimp)
{
settings_t *settings = config_get_ptr();
GetSettings(wimp, settings);
CreateMainWindow(wimp);
}
return;
}
#endif
static void ui_companion_qt_deinit(void *data)
{
@ -60,8 +64,10 @@ static void ui_companion_qt_deinit(void *data)
if (!handle)
return;
#ifdef HAVE_QT_WRAPPER
slock_free(handle->lock);
sthread_join(handle->thread);
#endif
free(handle);
}
@ -71,15 +77,18 @@ static void *ui_companion_qt_init(void)
ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle));
if (!handle)
return NULL;
settings = config_get_ptr();
handle->lock = slock_new();
handle->thread = sthread_create(qt_thread, handle);
#ifdef HAVE_QT_WRAPPER
settings_t *settings = config_get_ptr();
handle->lock = slock_new();
handle->thread = sthread_create(qt_thread, handle);
if (!handle->thread)
{
slock_free(handle->lock);
free(handle);
return NULL;
}
#endif
return handle;
}
@ -108,9 +117,11 @@ static void ui_companion_qt_event_command(void *data, enum event_command cmd)
if (!handle)
return;
#ifdef HAVE_QT_WRAPPER
slock_lock(handle->lock);
command_event(cmd, NULL);
slock_unlock(handle->lock);
#endif
}
static void ui_companion_qt_notify_list_pushed(void *data, file_list_t *list,