Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I45b8d2d8a6c512a38a6775bb0fe95358623cef99
This commit is contained in:
commit
f3552aebda
@ -9,7 +9,24 @@
|
||||
"libraries": {
|
||||
"wayland-client": {
|
||||
"label": "Wayland client library",
|
||||
"test": "wayland",
|
||||
"headers": "wayland-version.h",
|
||||
"test": {
|
||||
"main": [
|
||||
"#if WAYLAND_VERSION_MAJOR < 1",
|
||||
"# error Wayland 1.8.0 or higher required",
|
||||
"#endif",
|
||||
"#if WAYLAND_VERSION_MAJOR == 1",
|
||||
"# if WAYLAND_VERSION_MINOR < 8",
|
||||
"# error Wayland 1.8.0 or higher required",
|
||||
"# endif",
|
||||
"# if WAYLAND_VERSION_MINOR == 8",
|
||||
"# if WAYLAND_VERSION_MICRO < 0",
|
||||
"# error Wayland 1.8.0 or higher required",
|
||||
"# endif",
|
||||
"# endif",
|
||||
"#endif"
|
||||
]
|
||||
},
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "wayland-client" },
|
||||
"-lwayland-client"
|
||||
@ -17,7 +34,10 @@
|
||||
},
|
||||
"wayland-cursor": {
|
||||
"label": "Wayland cursor library",
|
||||
"test": "wayland_cursor",
|
||||
"headers": "wayland-cursor.h",
|
||||
"test": {
|
||||
"main": "struct wl_cursor_image *image = 0;"
|
||||
},
|
||||
"use": "wayland-client",
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "wayland-cursor" },
|
||||
@ -26,7 +46,10 @@
|
||||
},
|
||||
"wayland-egl": {
|
||||
"label": "Wayland EGL library",
|
||||
"test": "wayland_egl",
|
||||
"headers": "wayland-egl.h",
|
||||
"test": {
|
||||
"main": "struct wl_egl_window *window = wl_egl_window_create(0, 100, 100);"
|
||||
},
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "wayland-egl" },
|
||||
"-lwayland-egl",
|
||||
@ -35,7 +58,11 @@
|
||||
},
|
||||
"xcomposite": {
|
||||
"label": "XComposite",
|
||||
"test": "xcomposite",
|
||||
"headers": "X11/extensions/Xcomposite.h",
|
||||
"test": {
|
||||
"main": "XCompositeRedirectWindow((Display *)0,(Window) 0, CompositeRedirectManual);"
|
||||
|
||||
},
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "xcomposite" },
|
||||
"-lxcomposite"
|
||||
@ -43,7 +70,14 @@
|
||||
},
|
||||
"glx": {
|
||||
"label": "GLX",
|
||||
"test": "glx",
|
||||
"headers": "GL/glx.h",
|
||||
"test": {
|
||||
"main": [
|
||||
"Display *dpy = XOpenDisplay(0);",
|
||||
"int items = 0;",
|
||||
"GLXFBConfig *fbc = glXChooseFBConfig(dpy, DefaultScreen(dpy), 0 , &items);"
|
||||
]
|
||||
},
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "x11 gl" },
|
||||
"-lX11 -lGl"
|
||||
|
@ -92,7 +92,7 @@ private:
|
||||
};
|
||||
|
||||
bool isServerSide();
|
||||
bool parseOption(const char *str);
|
||||
bool parseOption(const QByteArray &str);
|
||||
|
||||
QByteArray byteArrayValue(const QXmlStreamReader &xml, const char *name);
|
||||
int intValue(const QXmlStreamReader &xml, const char *name, int defaultValue = 0);
|
||||
@ -123,29 +123,55 @@ private:
|
||||
QByteArray m_scannerName;
|
||||
QByteArray m_headerPath;
|
||||
QByteArray m_prefix;
|
||||
QVector <QByteArray> m_includes;
|
||||
QXmlStreamReader *m_xml = nullptr;
|
||||
};
|
||||
|
||||
bool Scanner::parseArguments(int argc, char **argv)
|
||||
{
|
||||
m_scannerName = argv[0];
|
||||
QVector<QByteArray> args;
|
||||
args.reserve(argc);
|
||||
for (int i = 0; i < argc; ++i)
|
||||
args << QByteArray(argv[i]);
|
||||
|
||||
if (argc <= 2 || !parseOption(argv[1]))
|
||||
m_scannerName = args[0];
|
||||
|
||||
if (argc <= 2 || !parseOption(args[1]))
|
||||
return false;
|
||||
|
||||
m_protocolFilePath = QByteArray(argv[2]);
|
||||
m_protocolFilePath = args[2];
|
||||
|
||||
if (argc >= 4)
|
||||
m_headerPath = QByteArray(argv[3]);
|
||||
if (argc == 5)
|
||||
m_prefix = QByteArray(argv[4]);
|
||||
if (argc > 3 && !args[3].startsWith('-')) {
|
||||
// legacy positional arguments
|
||||
m_headerPath = args[3];
|
||||
if (argc == 5)
|
||||
m_prefix = args[4];
|
||||
} else {
|
||||
// --header-path=<path> (14 characters)
|
||||
// --prefix=<prefix> (9 characters)
|
||||
// --add-include=<include> (14 characters)
|
||||
for (int pos = 3; pos < argc; pos++) {
|
||||
const QByteArray &option = args[pos];
|
||||
if (option.startsWith("--header-path=")) {
|
||||
m_headerPath = option.mid(14);
|
||||
} else if (option.startsWith("--prefix=")) {
|
||||
m_prefix = option.mid(10);
|
||||
} else if (option.startsWith("--add-include=")) {
|
||||
auto include = option.mid(14);
|
||||
if (!include.isEmpty())
|
||||
m_includes << include;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Scanner::printUsage()
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [client-header|server-header|client-code|server-code] specfile [header-path] [prefix]\n", m_scannerName.constData());
|
||||
fprintf(stderr, "Usage: %s [client-header|server-header|client-code|server-code] specfile [--header-path=<path>] [--prefix=<prefix>] [--add-include=<include>]\n", m_scannerName.constData());
|
||||
}
|
||||
|
||||
bool Scanner::isServerSide()
|
||||
@ -153,15 +179,15 @@ bool Scanner::isServerSide()
|
||||
return m_option == ServerHeader || m_option == ServerCode;
|
||||
}
|
||||
|
||||
bool Scanner::parseOption(const char *str)
|
||||
bool Scanner::parseOption(const QByteArray &str)
|
||||
{
|
||||
if (str == QLatin1String("client-header"))
|
||||
if (str == "client-header")
|
||||
m_option = ClientHeader;
|
||||
else if (str == QLatin1String("server-header"))
|
||||
else if (str == "server-header")
|
||||
m_option = ServerHeader;
|
||||
else if (str == QLatin1String("client-code"))
|
||||
else if (str == "client-code")
|
||||
m_option = ClientCode;
|
||||
else if (str == QLatin1String("server-code"))
|
||||
else if (str == "server-code")
|
||||
m_option = ServerCode;
|
||||
else
|
||||
return false;
|
||||
@ -441,6 +467,9 @@ bool Scanner::process()
|
||||
if (m_xml->hasError())
|
||||
return false;
|
||||
|
||||
for (auto b : qAsConst(m_includes))
|
||||
printf("#include %s\n", b.constData());
|
||||
|
||||
if (m_option == ServerHeader) {
|
||||
QByteArray inclusionGuard = QByteArray("QT_WAYLAND_SERVER_") + preProcessorProtocolName.constData();
|
||||
printf("#ifndef %s\n", inclusionGuard.constData());
|
||||
|
@ -58,8 +58,6 @@ private:
|
||||
QByteArray mComposeModule = QByteArray("QComposeInputContext"); // default input context
|
||||
QByteArray mIbusModule = QByteArray("QIBusPlatformInputContext");
|
||||
QByteArray mWaylandModule = QByteArray("QtWaylandClient::QWaylandInputContext");
|
||||
|
||||
TextInputManager *mTextInputManager = nullptr;
|
||||
};
|
||||
|
||||
void tst_inputcontext::initTestCase()
|
||||
|
Loading…
x
Reference in New Issue
Block a user