-
Notifications
You must be signed in to change notification settings - Fork 2
/
backendplugin.cpp
50 lines (42 loc) · 1.7 KB
/
backendplugin.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "backendplugin.h"
#include <QMutex>
#include <QOffscreenSurface>
#include <QOpenGLFramebufferObject>
#include <QOpenGLContext>
// Nodes
#include "controloutput.h"
#include "gameconsole.h"
#include "globalgamepad.h"
#include "phoenixwindownode.h"
#include "videooutputnode.h"
// QML objects
#include "phoenixwindow.h"
#include "remappermodel.h"
#include "videooutput.h"
#include "libretrovariablemodel.h"
// Misc
#include "logging.h"
void BackendPlugin::registerTypes( const char *uri ) {
// QML-owned nodes
qmlRegisterType<ControlOutput>( uri, 1, 0, "ControlOutput" );
qmlRegisterType<GameConsole>( uri, 1, 0, "GameConsole" );
qmlRegisterType<GlobalGamepad>( uri, 1, 0, "GlobalGamepad" );
qmlRegisterType<PhoenixWindowNode>( uri, 1, 0, "PhoenixWindowNode" );
qmlRegisterType<VideoOutputNode>( uri, 1, 0, "VideoOutputNode" );
qmlRegisterType<LibretroVariableModel>( uri, 1, 0, "LibretroVariableModel" );
// Other QML-owned classes
qmlRegisterType<PhoenixWindow>( uri, 1, 0, "PhoenixWindow" );
qmlRegisterType<RemapperModel>( uri, 1, 0, "RemapperModel" );
qmlRegisterType<VideoOutput>( uri, 1, 0, "VideoOutput" );
qmlRegisterUncreatableType<Node>( uri, 1, 0, "Node", "Node cannot be directly instantiated from QML." );
// Node structs and enums
qRegisterMetaType<Node::Command>( "Command" );
qRegisterMetaType<Node::DataType>( "DataType" );
qRegisterMetaType<Node::State>( "State" );
// Misc
qRegisterMetaType<LibretroVideoFormat>();
qRegisterMetaType<QStringMap>();
qRegisterMetaType<size_t>( "size_t" );
qRegisterMetaType<Qt::MouseButtons>();
qRegisterMetaType<QOpenGLContext *>();
}