22 #include <QStringList>
73 #define CONTENT_CHECK_TIME 2000
150 if (nAppTime != 0 && (nNextTime == 0 || nAppTime < nNextTime))
152 nNextTime = nAppTime;
159 if (nNextTime == 0 || nNextTime > CONTENT_CHECK_TIME)
161 nNextTime = CONTENT_CHECK_TIME;
168 MHLOG(
MHLogLinks, QString(
"Asynchronous event dequeued - %1 from %2")
191 if (text.size() == 0)
200 unsigned char ch = text[0];
217 pTree = parser->
Parse();
228 pTree->
Failure(
"Expected Application or Scene");
250 if (csPath.isEmpty() || csPath.startsWith(
"DSM:") || csPath.startsWith(
"~"))
252 if (csPath.startsWith(
"hybrid:"))
254 if (csPath.startsWith(
"http:") || csPath.startsWith(
"https:"))
256 if (csPath.startsWith(
"CI:"))
259 int firstColon = csPath.indexOf(
':'), firstSlash = csPath.indexOf(
'/');
260 if (firstColon > 0 && firstSlash > 0 && firstColon < firstSlash)
271 MHLOG(
MHLogWarning,
"WARN Launch during transition - ignoring");
334 pProgram->
m_Path = csPath;
335 int nPos = pProgram->
m_Path.lastIndexOf(
'/');
372 MHLOG(
MHLogWarning,
"WARN Quit during transition - ignoring");
416 MHLOG(
MHLogWarning,
"WARN TransitionTo during transition - ignoring");
439 MHERROR(
"Empty scene");
444 MHERROR(
"Expected a scene");
480 QQueue<MHAsynchEvent *>::iterator it =
m_EventQueue.begin();
532 QString csPath = QString::fromUtf8((
const char *)str.
Bytes(), str.
Size());
545 if (csPath.startsWith(
"DSM:"))
546 csPath = csPath.mid(4);
547 else if (csPath.startsWith(
"~"))
548 csPath = csPath.mid(1);
549 if (!csPath.startsWith(
"//"))
561 while ((nPos = csPath.indexOf(
"/../")) >= 0)
565 while (nPos >= 1 && csPath[nPos-1] !=
'/')
570 csPath = csPath.left(nPos) + csPath.mid(nEnd);
609 throw "FindObject failed";
644 MHLOG(
MHLogLinks, QString(
"Event - %1 from %2")
712 m_LinkTable.at(i)->MatchEvent(sourceRef, ev, un,
this);
731 for (
int i = actions.
Size(); i > 0; i--)
858 if (toDraw.isEmpty())
863 while (nStackPos >= 0)
870 if (! drawArea.isEmpty())
964 MHLOG(
MHLogWarning, QString(
"WARN EngineEvent %1 but no app").arg(nCode));
987 if (csPath.isEmpty())
989 MHLOG(
MHLogWarning,
"RequestExternalContent empty path");
1003 reinterpret_cast< const unsigned char * >(text.constData()),
1006 catch (
char const *)
1011 MHLOG(
MHLogWarning, QString(
"WARN No file content %1 <= %2")
1026 pContent->
m_time.start();
1073 .arg(text.size()) );
1078 reinterpret_cast< const unsigned char * >(text.constData()),
1081 catch (
char const *)
1086 MHLOG(
MHLogWarning, QString(
"WARN No file content %1 <= %2")
1096 else if (pContent->
m_time.elapsed() > 60000)
1101 MHLOG(
MHLogWarning, QString(
"WARN File timed out %1 <= %2")
1156 for (i = 0; i < variables.
Size(); i++)
1171 for (i = 0; i < variables.
Size(); i++)
1185 QString csFeat = QString::fromUtf8((
const char *)feature.
Bytes(), feature.
Size());
1186 QStringList strings = csFeat.split(QRegExp(
"[\\(\\,\\)]"));
1190 if (strings[0] ==
"ApplicationStacking" || strings[0] ==
"ASt")
1196 if (strings[0] ==
"Cloning" || strings[0] ==
"Clo")
1201 if (strings[0] ==
"SceneCoordinateSystem" || strings[0] ==
"SCS")
1203 if (strings.count() >= 3 && strings[1] ==
"720" && strings[2] ==
"576")
1215 if (strings[0] ==
"MultipleAudioStreams" || strings[0] ==
"MAS")
1217 if (strings.count() >= 2 && (strings[1] ==
"0" || strings[1] ==
"1"))
1227 if (strings[0] ==
"MultipleVideoStreams" || strings[0] ==
"MVS")
1229 if (strings.count() >= 2 && (strings[1] ==
"0" || strings[1] ==
"1"))
1240 if (strings[0] ==
"OverlappingVisibles" || strings[0] ==
"OvV")
1245 if (strings[0] ==
"SceneAspectRatio" || strings[0] ==
"SAR")
1247 if (strings.count() < 3)
1251 else if ((strings[1] ==
"4" && strings[2] ==
"3") || (strings[1] ==
"16" && strings[2] ==
"9"))
1262 if (strings[0] ==
"VideoScaling" || strings[0] ==
"VSc")
1264 if (strings.count() < 4 || strings[1] !=
"10")
1268 else if ((strings[2] ==
"720" && strings[3] ==
"576") || (strings[2] ==
"360" && strings[3] ==
"288"))
1278 if (strings[0] ==
"BitmapScaling" || strings[0] ==
"BSc")
1280 if (strings.count() < 4 || strings[1] !=
"2")
1284 else if ((strings[2] ==
"720" && strings[3] ==
"576") || (strings[2] ==
"360" && strings[3] ==
"288"))
1295 if (strings[0] ==
"VideoDecodeOffset" || strings[0] ==
"VDO")
1297 if (strings.count() >= 3 && strings[1] ==
"10" && strings[1] ==
"0")
1308 if (strings[0] ==
"BitmapDecodeOffset" || strings[0] ==
"BDO")
1310 if (strings.count() >= 3 && strings[1] ==
"2" && (strings[2] ==
"0" || strings[2] ==
"1"))
1314 else if (strings.count() >= 2 && (strings[1] ==
"4" || strings[1] ==
"6"))
1324 if (strings[0] ==
"UKEngineProfile" || strings[0] ==
"UniversalEngineProfile" || strings[0] ==
"UEP")
1326 if (strings.count() < 2)
1348 if (strings[1] ==
"2")
1359 if (strings[0] ==
"ICProfile" || strings[0] ==
"ICP") {
1360 if (strings.count() != 2)
return false;
1361 if (strings[1] ==
"0")
1363 if (strings[1] ==
"1")
1509 str.
Copy(
"plain.24.24.0");
1524 QByteArray
tmp = logtext.toLatin1();