void IPCThread::run(void) { if(!m_firstInstance) { m_semaphore_w->acquire(); size_t *pidPtr = reinterpret_cast<size_t*>(m_sharedMem->data()); *pidPtr = x264_process_id(); m_semaphore_r->release(); return; } forever { if(!m_semaphore_r->acquire()) { qWarning("IPCThread: System error !!!"); qWarning("IPCThread: %s\n", m_semaphore_r->errorString().toLatin1().constData()); break; } if(m_abort) { break; } const size_t procId = *reinterpret_cast<const size_t*>(m_sharedMem->constData()); m_semaphore_w->release(); emit instanceCreated(procId); } }
MainConfigurationWindow * MainConfigurationWindow::instance() { if (!Instance) { InstanceDataManager = new ConfigFileDataManager(); Instance = new MainConfigurationWindow(); instanceCreated(); } return Instance; }
KServiceFactory::KServiceFactory() : KSycocaFactory( KST_KServiceFactory ), m_nameDict(0), m_relNameDict(0), m_menuIdDict(0) { kServiceFactoryInstance->instanceCreated(this); m_offerListOffset = 0; m_nameDictOffset = 0; m_relNameDictOffset = 0; m_menuIdDictOffset = 0; if (!KSycoca::self()->isBuilding()) { QDataStream* str = stream(); Q_ASSERT(str); if (!str) return; // Read Header qint32 i; (*str) >> i; m_nameDictOffset = i; (*str) >> i; m_relNameDictOffset = i; (*str) >> i; m_offerListOffset = i; (*str) >> i; m_menuIdDictOffset = i; const int saveOffset = str->device()->pos(); // Init index tables m_nameDict = new KSycocaDict(str, m_nameDictOffset); // Init index tables m_relNameDict = new KSycocaDict(str, m_relNameDictOffset); // Init index tables m_menuIdDict = new KSycocaDict(str, m_menuIdDictOffset); str->device()->seek(saveOffset); }
QtPrototypeWindow::QtPrototypeWindow(const std::string& filePath, QtGLWorker* worker, QWidget* parent) : QtEditorWindowBase(filePath, worker, parent) , ui(new Ui::QtPrototypeWindow) { ui->setupUi(this); m_componentListModel = new QStandardItemModel(this); m_componentsWidget = new QtComponentsWidget(); m_componentsWidget->setAllowCreateAndDestroy(true); QDockWidget* componentsDockWidget = new QDockWidget("Components", this); componentsDockWidget->setWidget(m_componentsWidget); componentsDockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); addDockWidget(Qt::LeftDockWidgetArea, componentsDockWidget); tabifyDockWidget(ui->constraintsDockWidget, componentsDockWidget); m_constraintListModel = new QStandardItemModel(this); ui->addConstraintComboBox->setModel(QtEditorInterface::getGlobalDataModel("global:constraintType")); ui->typeComboBox->setModel(QtEditorInterface::getGlobalDataModel("global:constraintType")); ui->constraintListView->setModel(m_constraintListModel); ui->componentAComboBox->setModel(m_componentListModel); ui->componentBComboBox->setModel(m_componentListModel); connect(ui->componentAComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onComponentAChanged(int))); connect(ui->componentBComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onComponentBChanged(int))); connect(ui->typeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onConstraintTypeChanged(int))); connect(ui->nameLineEdit, SIGNAL(editingFinished()), this, SLOT(onNameEditFinished())); connect(ui->colorPushButton, SIGNAL(clicked()), this, SLOT(onPickColorButtonClicked())); connect(ui->xSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onLocationChanged(double))); connect(ui->ySpinBox, SIGNAL(valueChanged(double)), this, SLOT(onLocationChanged(double))); connect(ui->zSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onLocationChanged(double))); connect(ui->xRotSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onRotationChanged(double))); connect(ui->yRotSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onRotationChanged(double))); connect(ui->zRotSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onRotationChanged(double))); connect(ui->sizeSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onSizeChanged(double))); m_actorDefaultsWidget = new QtActorDefaultsWidget(); QDockWidget* actorDefaultsDockWidget = new QDockWidget("Actor defaults", this); actorDefaultsDockWidget->setWidget(m_actorDefaultsWidget); actorDefaultsDockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); addDockWidget(Qt::RightDockWidgetArea, actorDefaultsDockWidget); m_nodeSettingsWidget = new QtNodeSettingsWidget(); m_nodeSettingsWidget->m_propertyView->setLocalDataModel("local:componentList", m_componentListModel); QDockWidget* nodeSettingsDockWidget = new QDockWidget("Node settings", this); nodeSettingsDockWidget->setWidget(m_nodeSettingsWidget); nodeSettingsDockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); addDockWidget(Qt::RightDockWidgetArea, nodeSettingsDockWidget); m_prototypeWidget = new QtPrototypeWidget(); QDockWidget* prototypeDockWidget = new QDockWidget("Script entities", this); prototypeDockWidget->setWidget(m_prototypeWidget); prototypeDockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); addDockWidget(Qt::RightDockWidgetArea, prototypeDockWidget); m_prototypeEditor = new QtPrototypeEditor(m_worker); m_prototypeEditor->setEditorEventDispatcher(m_editorEventDispatcher); m_editorWidget = m_prototypeEditor; connect(m_prototypeEditor, SIGNAL(instanceCreated()), this, SLOT(onEditorInstanceCreated())); ui->centralTabWidget->addTab(m_prototypeEditor, "Actor"); m_vsgWidget = new QtVSGWidget(); ui->centralTabWidget->addTab(m_vsgWidget, "Graph"); connect(m_prototypeWidget, SIGNAL(entityChanged(RJNode)), m_vsgWidget, SLOT(onEntityChanged(RJNode))); connect(m_actorDefaultsWidget, SIGNAL(executeRequest(ObjectRequest&)), this, SLOT(executeRequest(ObjectRequest&))); connect(m_vsgWidget, SIGNAL(selectionChanged()), this, SLOT(nodeSelectionChanged())); connect(m_nodeSettingsWidget->m_propertyView, SIGNAL(valueChanged(std::list<int>&, RJNode&, bool&)), m_vsgWidget, SLOT(applyModelDataChange(std::list<int>&, RJNode&, bool&))); connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(onActionSaveTriggered())); connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(onActionExitTriggered())); connect(m_componentsWidget, SIGNAL(executeRequest(ObjectRequest&)), this, SLOT(executeRequest(ObjectRequest&))); connect(m_componentsWidget, SIGNAL(selectionChanged(std::string)), this, SLOT(componentSelectionChanged(std::string))); setWindowTitle(QString("R2 Prototype editor : ") + m_assetFilePath.c_str()); }