}
//using namespace std;
-void qMessageOutput(QtMsgType, const QMessageLogContext &, const QString &);
-void loadMainFormFromXML(QString, UiInformation *);
-void loadConFormFromXML(QFile *, UiInformation *);
-
bool qt5IsOnscreen;
QApplication *qt5App = NULL;
+ QOpenGLContext *qt5GLContext;
+ bool isForceLegacy;
static int argc = 0;
static char *argv[0];
mainwindow->processCaptured(captured, pixels, width, height);
}
}
-
-void qMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
-{
- QByteArray localMsg = msg.toLocal8Bit();
- QByteArray dateMsg = QDateTime::currentDateTime().toString("hh:mm:ss.zzz").toLocal8Bit();
-
- QString path = context.file;
- QByteArray fname = NULL;
- int posFname = path.lastIndexOf('/') + 1;
- int posDot = path.lastIndexOf('.');
-
- if (( posFname != 0 ) && ( posDot != -1)) {
- int fnameLen = path.length() - posFname;
- path = path.right(fnameLen);
- fnameLen = posDot - posFname;
- path.truncate(fnameLen);
- }
- fname = path.toLocal8Bit();
-
- switch (type) {
- case QtDebugMsg:
- fprintf(stdout, "%s|%5d|I|%10.10s|%4u|%s\n", dateMsg.constData(),
- qemu_get_thread_id(), fname.trimmed().constData(), context.line,
- localMsg.trimmed().constData());
- break;
- case QtWarningMsg:
- fprintf(stdout, "%s|%5d|W|%10.10s|%4u|%s\n", dateMsg.constData(),
- qemu_get_thread_id(), fname.trimmed().constData(), context.line,
- localMsg.trimmed().constData());
- break;
- case QtCriticalMsg:
- fprintf(stderr, "%s|%5d|S|%10.10s|%4u|%s\n", dateMsg.constData(),
- qemu_get_thread_id(), fname.trimmed().constData(), context.line,
- localMsg.trimmed().constData());
- break;
- case QtFatalMsg:
- fprintf(stderr, "%s|%5d|S|%10.10s|%4u|%s\n", dateMsg.constData(),
- qemu_get_thread_id(), fname.trimmed().constData(), context.line,
- localMsg.trimmed().constData());
- {
- QString err;
- QMessageBox::critical(0, EMULATOR_TITLE,
- QString(MSG_INTERNAL_ERR) +
- err.sprintf("%s", (localMsg.trimmed()).constData()) +
- MSG_EMULATOR_EXIT);
- }
-
- abort();
- default:
- qFatal("invalid message type");
- break;
- }
-}
-
-void loadMainFormFromXML(QString xmlPath, UiInformation *uiInfo/* out */)
-{
- QFile file(xmlPath);
-
- if (file.exists() == false ||
- file.open(QIODevice::ReadOnly | QIODevice::Text) == false) {
- qFatal("Failed to load the emulator skin. %s%s", MSG_CHECK_PATH,
- qPrintable(xmlPath));
- return;
- }
-
- qDebug("main form is loaded from %s", qPrintable(file.fileName()));
-
- /* read xml */
- QXmlStreamReader xml(&file);
-
- /* parse xml */
- QFileInfo fileInfo(xmlPath);
- XmlLayoutParser parser(fileInfo.absolutePath(), uiInfo);
- QString version = parser.parseEmulatorUI(xml);
- qDebug() << "* main layout version:" << version;
-
- const bool hasError = xml.hasError();
- xml.clear();
- file.close();
-
- if (hasError == true) {
- qFatal("%s %s%s", MSG_INVALID_XML_FORMAT, MSG_CHECK_PATH,
- qPrintable(xmlPath));
- return;
- }
-}
-
-void loadConFormFromXML(QFile *file, UiInformation *uiInfo/* out */)
-{
- if (file->exists() == false ||
- file->open(QIODevice::ReadOnly | QIODevice::Text) == false) {
- qWarning() << "Failed to load the controller skin:" <<
- file->fileName();
- return;
- }
-
- qDebug("controller form is loaded from %s", qPrintable(file->fileName()));
-
- /* read xml */
- QXmlStreamReader xml(file);
-
- /* parse xml */
- QFileInfo fileInfo(*file);
- XmlLayoutParser parser(fileInfo.absolutePath(), uiInfo);
- QString version = parser.parseControllerUI(xml);
- qDebug() << "* con layout version:" << version;
-
- const bool hasError = xml.hasError();
- xml.clear();
- file->close();
-
- if (hasError == true) {
- qFatal("%s %s%s", MSG_INVALID_XML_FORMAT, MSG_CHECK_PATH,
- qPrintable(fileInfo.absoluteFilePath()));
- return;
- }
-}
+
+ void qt5_update_texture(unsigned int tex_id)
+ {
+ if (mainwindow) {
+ mainwindow->updateTexture(tex_id);
+ }
+ }