DFFWidget::DFFWidget(DisplayedFile* dfile, QWidget* parent) : QWidget(parent), dfile(dfile), mesh(NULL), frameModel(NULL), geomModel(NULL), texSource(NULL), currentGeom(NULL), currentGeomPart(NULL), currentMaterial(NULL), currentTexture(NULL) { ui.setupUi(this); File file = dfile->getFile(); renderContainerWidget = new GLContainerWidget(ui.renderContainerWidget); renderContainerWidget->setWindowTitle(tr("%1 - DFF Rendering") .arg(file.getPath().getFileName().get())); ui.renderContainerWidget->layout()->addWidget(renderContainerWidget); renderWidget = new DFFRenderWidget(renderContainerWidget); renderContainerWidget->setGLWidget(renderWidget); updateLayoutType(); reloadHighLevelFile(); System* sys = System::getInstance(); DFFGUIModule* guiModule = DFFGUIModule::getInstance(); sys->installGUIModule(guiModule); connect(ui.editTexSrcButton, SIGNAL(pressed()), this, SLOT(texSrcEditRequested())); connect(ui.texSourceBox, SIGNAL(currentIndexChanged(int)), this, SLOT(texSrcChanged(int))); connect(ui.materialList, SIGNAL(currentRowChanged(int)), this, SLOT(materialSelected(int))); connect(ui.textureList, SIGNAL(currentRowChanged(int)), this, SLOT(textureSelected(int))); connect(ui.geometryFrameLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(geometryFrameLinkActivated(const QString&))); connect(ui.geometryPartMaterialLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(geometryPartMaterialLinkActivated(const QString&))); connect(ui.textureOpenButton, SIGNAL(pressed()), this, SLOT(textureOpenRequested())); connect(guiModule, SIGNAL(dumpRequested()), this, SLOT(xmlDumpRequested())); connect(System::getInstance(), SIGNAL(configurationChanged()), this, SLOT(updateLayoutType())); connect(dfile, SIGNAL(saved()), this, SLOT(reloadHighLevelFile())); }
COLWidget::COLWidget(const File& file, QWidget *parent) : QWidget(parent), currentlyCompact(false), entityModel(NULL) { ui.setupUi(this); ui.collisionMeshMainSplitter->setSizes(QList<int>() << width() / 3 << (width() / 3) * 2); renderContainer = new GLContainerWidget(ui.renderWidgetContainer); ui.renderWidgetContainer->layout()->addWidget(renderContainer); renderWidget = new COLRenderWidget(renderContainer); renderContainer->setGLWidget(renderWidget); COLLoader col; istream* stream = file.openInputStream(istream::binary); COLModel* model; while ((model = col.loadModel(stream))) { models << model; ui.modelList->addItem(model->getName().get()); } System* sys = System::getInstance(); sys->installGUIModule(COLGUIModule::getInstance()); connect(ui.collisionMeshMainSplitter, SIGNAL(splitterMoved(int, int)), this, SLOT(collisionMeshMainSplitterValueChanged(int, int))); connect(ui.modelList, SIGNAL(currentRowChanged(int)), this, SLOT(currentModelChanged(int))); //connect(ui.meshList, SIGNAL(currentRowChanged(int)), this, SLOT(currentMeshChanged(int))); /*connect(meshRenderer, SIGNAL(faceSelectionChanged(int, int)), this, SLOT(vertexMeshFaceSelectionChanged(int, int)));*/ connect(sys, SIGNAL(configurationChanged()), this, SLOT(updateLayoutType())); updateLayoutType(); loadConfigUiSettings(); }
void TestInvocation::invoke() { sizeWebViewForCurrentTest(m_pathOrURL.c_str()); updateLayoutType(m_pathOrURL.c_str()); updateTiledDrawingForCurrentTest(m_pathOrURL.c_str()); WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("BeginTest")); WKRetainPtr<WKMutableDictionaryRef> beginTestMessageBody = adoptWK(WKMutableDictionaryCreate()); WKRetainPtr<WKStringRef> dumpFrameLoadDelegatesKey = adoptWK(WKStringCreateWithUTF8CString("DumpFrameLoadDelegates")); WKRetainPtr<WKBooleanRef> dumpFrameLoadDelegatesValue = adoptWK(WKBooleanCreate(shouldLogFrameLoadDelegates(m_pathOrURL.c_str()))); WKDictionaryAddItem(beginTestMessageBody.get(), dumpFrameLoadDelegatesKey.get(), dumpFrameLoadDelegatesValue.get()); WKRetainPtr<WKStringRef> dumpPixelsKey = adoptWK(WKStringCreateWithUTF8CString("DumpPixels")); WKRetainPtr<WKBooleanRef> dumpPixelsValue = adoptWK(WKBooleanCreate(m_dumpPixels)); WKDictionaryAddItem(beginTestMessageBody.get(), dumpPixelsKey.get(), dumpPixelsValue.get()); WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey = adoptWK(WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer")); WKRetainPtr<WKBooleanRef> useWaitToDumpWatchdogTimerValue = adoptWK(WKBooleanCreate(TestController::shared().useWaitToDumpWatchdogTimer())); WKDictionaryAddItem(beginTestMessageBody.get(), useWaitToDumpWatchdogTimerKey.get(), useWaitToDumpWatchdogTimerValue.get()); WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), beginTestMessageBody.get()); TestController::shared().runUntil(m_gotInitialResponse, TestController::ShortTimeout); if (!m_gotInitialResponse) { m_errorMessage = "Timed out waiting for initial response from web process\n"; m_webProcessIsUnresponsive = true; goto end; } if (m_error) goto end; #if ENABLE(INSPECTOR) if (shouldOpenWebInspector(m_pathOrURL.c_str())) WKInspectorShow(WKPageGetInspector(TestController::shared().mainWebView()->page())); #endif // ENABLE(INSPECTOR) WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get()); TestController::shared().runUntil(m_gotFinalMessage, TestController::shared().useWaitToDumpWatchdogTimer() ? TestController::LongTimeout : TestController::NoTimeout); if (!m_gotFinalMessage) { m_errorMessage = "Timed out waiting for final message from web process\n"; m_webProcessIsUnresponsive = true; goto end; } if (m_error) goto end; dumpResults(); end: #if ENABLE(INSPECTOR) if (m_gotInitialResponse) WKInspectorClose(WKPageGetInspector(TestController::shared().mainWebView()->page())); #endif // ENABLE(INSPECTOR) if (m_webProcessIsUnresponsive) dumpWebProcessUnresponsiveness(); else if (!TestController::shared().resetStateToConsistentValues()) { m_errorMessage = "Timed out loading about:blank before the next test"; dumpWebProcessUnresponsiveness(); } }