{
noScript = false;
}
+ else if (type == CELLTYPE_PLUGIN_IN)
+ {
+ noScript = false;
+ }
+ else if (type == CELLTYPE_PLUGIN_OUT)
+ {
+ noScript = false;
+ }
else
{
Q_ASSERT(0);
TKCell* DCContainer::addCell(std::string theLocation, std::string theName, std::string type, std::string customScript)
{
- QMutexLocker(d_scene->getSceneLock());
+ QMutexLocker lock(d_scene->getSceneLock());
DCCell *cell = dynamic_cast<DCCell*>(TKContainer::addCell(theLocation, theName, type, customScript));
TKCell* DCContainer::addCell(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string customScript)
{
- QMutexLocker(d_scene->getSceneLock());
+ QMutexLocker lock(d_scene->getSceneLock());
DCCell *cell = dynamic_cast<DCCell*>(TKContainer::addCell(theLocation, theName, cellCode, customScript));
TKCellCode* DCContainer::addCellCode(std::string theName, std::string theAPIType, std::string code)
{
- QMutexLocker(d_scene->getSceneLock());
+ QMutexLocker lock(d_scene->getSceneLock());
DCCellCode *cellCode = dynamic_cast<DCCellCode*>(TKContainer::addCellCode(theName, theAPIType, code));
return cell;
}
+TKCell* DCContainer::pluginCellFactory(std::string location, std::string fullName, std::string type, std::string pluginName, std::string pluginValue, bool canInterfaceIn, bool canInterfaceOut)
+{
+ return cellFactory(location, fullName, type, canInterfaceIn, canInterfaceOut );
+}
+
+
TKAxon* DCContainer::axonFactory(TKCell *theOwner)
{
return DCComponentUtil::createAxon((DCCell*)theOwner);
QDir workdir(d_workDirCellCodeRoot + path);
return workdir.absoluteFilePath(name + ".js");
}
+
+bool DCContainer::getIsPluginType(const QString &type) const
+{
+ std::string t = type.toStdString();
+
+ if (t == TKContainer::CELLTYPE_PLUGIN_IN)
+ {
+ return true;
+ }
+ else if (t == TKContainer::CELLTYPE_PLUGIN_OUT)
+ {
+ return true;
+ }
+
+ return false;
+}
+
+QList<QString> DCContainer::getAvailablePluginLibraries() const
+{
+ QList<QString> list;
+ return list;
+}
+
+QList<QString> DCContainer::getPreDefinedPluginVariablesForPlugin(const QString& libraryName) const
+{
+ QList<QString> list;
+ return list;
+}
+
+QString DCContainer::createPluginCellName(const QString &name, const QString& type, const QString &libraryName)
+{
+ QString cellName = name;
+
+ if (type == QString::fromStdString(TKContainer::CELLTYPE_PLUGIN_IN))
+ {
+ cellName += "@@";
+ cellName += libraryName;
+ }
+ else if (type == QString::fromStdString(TKContainer::CELLTYPE_PLUGIN_OUT))
+ {
+ cellName += "@";
+ cellName += libraryName;
+ }
+ return cellName;
+}
virtual TKCellCode* addCellCode(std::string theName, std::string theAPIType, std::string code);
virtual TKCell* cellFactory(std::string location, std::string name, std::string type, bool canInterfaceIn, bool canInterfaceOut);
+ virtual TKCell* pluginCellFactory(std::string location, std::string fullName, std::string type, std::string pluginName, std::string pluginValue, bool canInterfaceIn, bool canInterfaceOut);
virtual TKAxon* axonFactory(TKCell *theOwner);
virtual TKReceptor* receptorFactory(TKCell *theOwner);
virtual TKAxonTerminal* axonTerminalFactory(TKAxon *theOwner);
*/
bool getIsReceptorAvailable(const QString& type) const;
+ /***************************************************************************
+ * plugin rules
+ **************************************************************************/
+
+ bool getIsPluginType(const QString& type) const;
+ QList<QString> getAvailablePluginLibraries() const;
+ QList<QString> getPreDefinedPluginVariablesForPlugin(const QString& libraryName) const;
+ QString createPluginCellName(const QString& name, const QString& type, const QString& libraryName);
};
#endif // DCCONTAINER_H
codeeditor/dceditscriptfolder.h \
codeeditor/dccodeeditorscriptmanager.h \
dialog/dccodeeditorexternaleditorsettingdialog.h \
- cellcodescripttreeview/dccellcodescripttreeviewwidget.h
+ cellcodescripttreeview/dccellcodescripttreeviewwidget.h \
+ engine/layer1/dnplugininfo.h
SOURCES = main.cpp \
mainwindow.cpp \
codeeditor/dceditscriptfolder.cpp \
codeeditor/dccodeeditorscriptmanager.cpp \
dialog/dccodeeditorexternaleditorsettingdialog.cpp \
- cellcodescripttreeview/dccellcodescripttreeviewwidget.cpp
+ cellcodescripttreeview/dccellcodescripttreeviewwidget.cpp \
+ engine/layer1/dnplugininfo.cpp
RESOURCES = denncoCreator.qrc
d_comboBox = new QComboBox;
d_comboBox->addItems(QStringList(d_container->getAvailableCellTypes()));
+ d_pluginLibraryNameComboBox = new QComboBox;
+ d_pluginLibraryNameComboBox->setEditable(true);
DCScene *scene = container->getScene();
const QMap<QString,DCVCPage*> *pages = scene->getPages();
d_cancelButton->setAutoDefault(true);
d_cancelButton->setDefault(true);
+ d_pluginInputBox = new QGroupBox();
+ QHBoxLayout *pluginInfoLayout = new QHBoxLayout;
+ pluginInfoLayout->addWidget(new QLabel(tr("Plugin")));
+ pluginInfoLayout->addWidget(d_pluginLibraryNameComboBox);
+ d_pluginInputBox->setLayout(pluginInfoLayout);
+ d_pluginInputBox->setVisible(false);
+
QGridLayout *glayout = new QGridLayout;
glayout->addWidget(new QLabel(tr("name")),0,0);
glayout->addWidget(d_textField,0,1);
glayout->addWidget(new QLabel(tr("type")),1,0);
- glayout->addWidget(d_comboBox);
+ glayout->addWidget(d_comboBox, 1, 1);
+ glayout->addWidget(d_pluginInputBox, 2,0,1,2);
((QVBoxLayout*)layout())->addLayout(glayout);
layout()->addWidget(d_table);
d_statusText = new QLabel;
connect(d_cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClicked()));
connect(d_table,SIGNAL(selectionChangedSignal(QItemSelection,QItemSelection)), this, SLOT(listSelectionChanged(QItemSelection,QItemSelection)));
connect(d_creator, SIGNAL(commandExecuted(const QUndoCommand*)), this, SLOT(commandExecuted(const QUndoCommand*)));
+ connect(d_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectedTypeChanged(int)));
+ connect(d_pluginLibraryNameComboBox, SIGNAL(editTextChanged(QString)), this, SLOT(pluginNameChanged(QString)));
if (selection >= 0)
{
bool DCAddCellDialog::checkInput()
{
+ bool valid = true;
+
d_message->setText("");
d_statusText->setText("");
if (d_selectedPagePath.length() == 0)
{
d_message->setText(tr("Select a page to place the cell"));
+ valid = false;
}
else if (d_textField->text().length() > 0)
{
- std::string path = getFQNString(d_selectedPagePath.toLocal8Bit().data(), d_textField->text().toLocal8Bit().data());
- TKCell *cell = d_container->getCell(path);
- if (cell)
+ QString name;
+ if (d_container->getIsPluginType(d_comboBox->currentText()))
{
- d_message->setText(tr("The cell name exists"));
+ if (d_pluginLibraryNameComboBox->currentText().length() == 0)
+ {
+ d_message->setText(tr("Input plugin name"));
+ valid = false;
+ }
+ else
+ {
+ name = d_container->createPluginCellName(d_textField->text(), d_comboBox->currentText(),d_pluginLibraryNameComboBox->currentText());
+ }
}
else
{
- d_statusText->setText(QString::fromStdString(path));
- d_okButton->setEnabled(true);
- d_okButton->setDefault(true);
- return true;
+ name = d_textField->text();
+ }
+
+ if (valid)
+ {
+ std::string path = getFQNString(d_selectedPagePath.toLocal8Bit().data(), name.toLocal8Bit().data());
+ TKCell *cell = d_container->getCell(path);
+ if (cell)
+ {
+ d_message->setText(tr("The cell name exists"));
+ valid = false;
+ }
+ else
+ {
+ d_statusText->setText(QString::fromStdString(path));
+ }
}
}
else
{
d_message->setText(tr("Input cell name"));
+ valid = false;
}
- d_okButton->setEnabled(false);
- d_cancelButton->setDefault(true);
- return false;
+
+ if (valid)
+ {
+ d_okButton->setEnabled(true);
+ d_okButton->setDefault(true);
+ }
+ else
+ {
+ d_okButton->setEnabled(false);
+ d_cancelButton->setDefault(true);
+ }
+ return valid;
}
void DCAddCellDialog::textInputChanged(const QString &text)
{
if (checkInput())
{
- d_creator->doCommandAddCell(this, d_container, d_selectedPagePath, d_textField->text(), d_comboBox->currentText(), d_pageX, d_pageY);
- }
+ QString name;
+ if (d_container->getIsPluginType(d_comboBox->currentText()))
+ {
+ Q_ASSERT(d_pluginLibraryNameComboBox->currentText().length() > 0);
+ name = d_container->createPluginCellName(d_textField->text(), d_comboBox->currentText(),d_pluginLibraryNameComboBox->currentText());
+ }
+ else
+ {
+ name = d_textField->text();
+ }
+ d_creator->doCommandAddCell(this, d_container, d_selectedPagePath, name, d_comboBox->currentText(), d_pageX, d_pageY);
+ }
}
void DCAddCellDialog::cancelButtonClicked()
checkInput();
}
+void DCAddCellDialog::selectedTypeChanged(int index)
+{
+ (void)index;
+
+ if (d_container->getIsPluginType(d_comboBox->currentText()))
+ {
+ d_pluginInputBox->setVisible(true);
+ d_pluginLibraryNameComboBox->clear();
+ d_pluginLibraryNameComboBox->addItems(d_container->getAvailablePluginLibraries());
+ }
+ else
+ {
+ d_pluginInputBox->setVisible(false);
+ }
+ checkInput();
+}
+
+void DCAddCellDialog::pluginNameChanged(const QString &text)
+{
+ (void)text;
+ checkInput();
+}
+
void DCAddCellDialog::commandExecuted(const QUndoCommand *executedCommand)
{
const DCCommand *command = dynamic_cast<const DCCommand*>(executedCommand);
done(true);
}
}
+
#include <QTableView>
#include <QComboBox>
#include <QLabel>
+#include <QGroupBox>
#include <QUndoCommand>
class DCContainer;
QLineEdit *d_textField;
QLabel *d_statusText;
QLabel *d_message;
+ QGroupBox *d_pluginInputBox;
+ QComboBox *d_pluginLibraryNameComboBox;
float d_pageX;
float d_pageY;
void okButtonClicked();
void cancelButtonClicked();
void listSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
+ void selectedTypeChanged(int index);
+ void pluginNameChanged(const QString& text);
void commandExecuted(const QUndoCommand* executedCommand);
};
#include "TKCellCode.h"
#include "DNStorage.h"
#include "DNUtils.h"
+#include "dnplugininfo.h"
#include <string>
}
else if (type == CELLTYPE_PLUGIN_IN)
{
- cell = cellFactory(theLocation, theName, type, true, false);
+ DNPluginInfo info = DNPluginInfo::create(theName);
+ if (info.isValid)
+ {
+ cell = pluginCellFactory(theLocation, theName, type, info.pluginName, info.pluginValueName, true, false);
+ }
+ else
+ {
+ std::string message = std::string("Failed to initialize cell '").append(theLocation).append("#").append(theName);
+ message.append("'\nThis is a plugin input cell. The name of the cell should be described by following form:\n'pluginValueName'@'pluginName'");
+ dnNotifyError("Initialization failed", message);
+ }
noScript = true;
}
else if (type == CELLTYPE_PLUGIN_OUT)
{
- cell = cellFactory(theLocation, theName, type, false, true);
+ DNPluginInfo info = DNPluginInfo::create(theName);
+ if (info.isValid)
+ {
+ cell = pluginCellFactory(theLocation, theName, type, info.pluginName, info.pluginValueName, false, true);
+ }
+ else
+ {
+ std::string message = std::string("Failed to initialize cell '").append(theLocation).append("#").append(theName);
+ message.append("'\nThis is a plugin output cell. The name of the cell should be described by following form:\n'pluginValueName'@'pluginName'");
+ dnNotifyError("Initialization failed", message);
+ }
noScript = true;
}
else
inline virtual float getValue(std::string key) const = 0;
virtual TKCell* cellFactory(std::string location, std::string name, std::string type, bool canInterfaceIn, bool canInterfaceOut) = 0;
+ virtual TKCell* pluginCellFactory(std::string location, std::string fullName, std::string type, std::string pluginName, std::string pluginValue, bool canInterfaceIn, bool canInterfaceOut) = 0;
virtual TKAxon* axonFactory(TKCell *theOwner) = 0;
virtual TKReceptor* receptorFactory(TKCell *theOwner) = 0;
virtual TKAxonTerminal* axonTerminalFactory(TKAxon *theOwner) = 0;
--- /dev/null
+// Copyright (c) 2013 Dennco Project
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+//
+// Created by tkawata on 1/29/2013.
+//
+
+#include "dnplugininfo.h"
+#include "DNUtils.h"
+
+DNPluginInfo::DNPluginInfo()
+{
+ isValid = false;
+}
+
+DNPluginInfo::DNPluginInfo(const DNPluginInfo &other)
+{
+ isValid = other.isValid;
+ pluginName = other.pluginName;
+ pluginValueName = other.pluginValueName;
+}
+
+//static
+DNPluginInfo DNPluginInfo::create(const std::string &name)
+{
+ DNPluginInfo result;
+ unsigned int idx = name.find("@");
+ if (idx != std::string::npos && idx > 0 && idx + 1 < name.length())
+ {
+ result.isValid = true;
+ result.pluginValueName = name.substr(0,idx);
+ result.pluginName = name.substr(name.find_last_of("@")+1);
+ }
+
+ return result;
+}
--- /dev/null
+// Copyright (c) 2013 Dennco Project
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+//
+// Created by tkawata on 1/29/2013.
+//
+
+#ifndef DNPLUGININFO_H
+#define DNPLUGININFO_H
+
+#include <string>
+
+struct DNPluginInfo
+{
+ DNPluginInfo();
+ DNPluginInfo(const DNPluginInfo &other);
+
+ std::string pluginName;
+ std::string pluginValueName;
+ bool isValid;
+
+ static DNPluginInfo create(const std::string& name);
+};
+
+#endif // DNPLUGININFO_H
#include "dcreceptor.h"
#include "dccontainer.h"
#include "dcscene.h"
+#include "dnplugininfo.h"
#include "dccuberenderer.h"
#include "dcselectionrenderer.h"
}
QString label2 = QString::fromStdString(d_owner->getName());
- d_shape->setTextLabel(label1, label2);
+ QString label3 = "";
+ DCContainer *container = dynamic_cast<DCContainer*> (d_owner->getContainer());
+ if (container)
+ {
+ if (container->getIsPluginType(d_owner->getType()))
+ {
+ DNPluginInfo info = DNPluginInfo::create(d_owner->getName());
+ if (info.isValid)
+ {
+ label2 = QString::fromStdString(info.pluginValueName);
+ label3 = " (" + QString::fromStdString(info.pluginName) +") ";
+ }
+ }
+ }
+ d_shape->setTextLabel(label1, label2, label3);
d_shouldUpdateShape = false;
}
m_shapeUpdated = true;
}
-void DCCubeRenderer::setTextLabel(const QString &text1, const QString &text2)
+void DCCubeRenderer::setTextLabel(const QString &text1, const QString &text2, const QString &text3)
{
QString newText1 = " " + text1 + " ";
QString newText2 = " " + text2 + " ";
- if (newText1 != m_text1 || newText2 != m_text2)
+ if (newText1 != m_text1 || newText2 != m_text2 || text3 != m_text3)
{
m_text1 = newText1;
m_text2 = newText2;
+ m_text3 = text3;
m_shapeUpdated = true;
}
}
painter.setBrush(QBrush(QColor(m_faceColor[0]*255, m_faceColor[1]*255, m_faceColor[2]*255)));
painter.drawRoundedRect(0,0, texSize, texSize, r,r);
+ float text1Rate = m_text3.length() > 0 ? 0.3 : 0.4;
+ float text2Rate = m_text3.length() > 0 ? 0.4 : 0.6;
+
QFont font;
font.setPointSize(22);
font.setItalic(true);
painter.setPen(Qt::black);
painter.setFont(font);
- QRectF rect = painter.boundingRect(0,0,image.width(), image.height()*0.4, Qt::AlignCenter | Qt::TextDontClip, m_text1);
+ QRectF rect = painter.boundingRect(0,0,image.width(), image.height()*text1Rate, Qt::AlignCenter | Qt::TextDontClip, m_text1);
if (rect.width() > image.rect().width())
{
font.setPointSizeF(22*(image.rect().width()/rect.width()));
painter.setFont(font);
}
- painter.drawText(0,0,image.width(),image.height()*0.4, Qt::AlignCenter | Qt::TextDontClip, m_text1);
+ painter.drawText(0,0,image.width(),image.height()*text1Rate, Qt::AlignCenter | Qt::TextDontClip, m_text1);
+
font.setPointSize(48);
font.setItalic(false);
painter.setPen(Qt::black);
painter.setFont(font);
- rect = painter.boundingRect(0,0,image.width(), image.height()*0.6, Qt::AlignCenter | Qt::TextDontClip, m_text2);
+ rect = painter.boundingRect(0,0,image.width(), image.height()*text2Rate, Qt::AlignCenter | Qt::TextDontClip, m_text2);
if (rect.width() > image.rect().width())
{
font.setPointSizeF(48*(image.rect().width()/rect.width()));
painter.setFont(font);
}
- painter.drawText(0, image.height()*0.4, image.width(), image.height()*0.6, Qt::AlignCenter | Qt::TextDontClip, m_text2);
+ painter.drawText(0, image.height()*text1Rate, image.width(), image.height()*text2Rate, Qt::AlignCenter | Qt::TextDontClip, m_text2);
+
+ if (m_text3.length() > 0)
+ {
+ font.setPointSize(22);
+ font.setItalic(false);
+ painter.setPen(Qt::black);
+ painter.setFont(font);
+ rect = painter.boundingRect(0,0,image.width(), image.height()*0.2, Qt::AlignCenter | Qt::TextDontClip, m_text3);
+ if (rect.width() > image.rect().width())
+ {
+ font.setPointSizeF(22*(image.rect().width()/rect.width()));
+ painter.setFont(font);
+ }
+ painter.drawText(0, image.height()*0.7, image.width(), image.height()*0.2, Qt::AlignCenter | Qt::TextDontClip, m_text3);
+ }
GLuint texture = m_widget->bindTexture(image, GL_TEXTURE_2D,GL_RGBA,QGLContext::LinearFilteringBindOption|QGLContext::InvertedYBindOption);
painter.setBrush(QBrush(QColor(m_faceColor[0]*255, m_faceColor[1]*255, m_faceColor[2]*255)));
painter.drawRoundedRect(0,0, texSize_w, texSize_h, r_w, r_h);
+ float text1Rate = m_text3.length() > 0 ? 0.3 : 0.4;
+ float text2Rate = m_text3.length() > 0 ? 0.4 : 0.6;
+
QFont font;
font.setPointSize(22);
font.setItalic(true);
painter.setPen(Qt::black);
painter.setFont(font);
- QRectF rect = painter.boundingRect(0,0,image.width(), image.height()*0.4, Qt::AlignCenter | Qt::TextDontClip, m_text1);
+ QRectF rect = painter.boundingRect(0,0,image.width(), image.height()*text1Rate, Qt::AlignCenter | Qt::TextDontClip, m_text1);
if (rect.width() > image.rect().width())
{
font.setPointSizeF(22*(image.rect().width()/rect.width()));
painter.setFont(font);
}
- painter.drawText(0,0,image.width(), image.height()*0.4, Qt::AlignCenter | Qt::TextDontClip, m_text1);
+ painter.drawText(0,0,image.width(),image.height()*text1Rate, Qt::AlignCenter | Qt::TextDontClip, m_text1);
+
font.setPointSize(48);
font.setItalic(false);
painter.setPen(Qt::black);
painter.setFont(font);
- rect = painter.boundingRect(0,0,image.width(), image.height()*0.6, Qt::AlignCenter | Qt::TextDontClip, m_text2);
+ rect = painter.boundingRect(0,0,image.width(), image.height()*text2Rate, Qt::AlignCenter | Qt::TextDontClip, m_text2);
if (rect.width() > image.rect().width())
{
font.setPointSizeF(48*(image.rect().width()/rect.width()));
painter.setFont(font);
}
- painter.drawText(0,image.height()*0.4,image.width(), image.height()*0.6, Qt::AlignCenter | Qt::TextDontClip, m_text2);
+ painter.drawText(0, image.height()*text1Rate, image.width(), image.height()*text2Rate, Qt::AlignCenter | Qt::TextDontClip, m_text2);
- painter.end();
+ if (m_text3.length() > 0)
+ {
+ font.setPointSize(22);
+ font.setItalic(false);
+ painter.setPen(Qt::black);
+ painter.setFont(font);
+ rect = painter.boundingRect(0,0,image.width(), image.height()*0.2, Qt::AlignCenter | Qt::TextDontClip, m_text3);
+ if (rect.width() > image.rect().width())
+ {
+ font.setPointSizeF(22*(image.rect().width()/rect.width()));
+ painter.setFont(font);
+ }
+ painter.drawText(0, image.height()*0.7, image.width(), image.height()*0.2, Qt::AlignCenter | Qt::TextDontClip, m_text3);
+ }
GLuint texture = m_widget->bindTexture(image, GL_TEXTURE_2D,GL_RGBA,QGLContext::LinearFilteringBindOption|QGLContext::InvertedYBindOption);
void draw();
void setEdgeColor(GLfloat r, GLfloat g, GLfloat b);
void setFaceColor(GLfloat r, GLfloat g, GLfloat b);
- void setTextLabel(const QString &text1, const QString &text2);
+ void setTextLabel(const QString &text1, const QString &text2, const QString &text3 = "");
void setSize(float size);
void setHeight(float height);
QString m_text1;
QString m_text2;
+ QString m_text3;
};
DCVCPage* DCScene::getPage(const std::string &location) const
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
QMap<QString, DCVCPage*>::const_iterator i = d_pages.find(QString::fromStdString(location));
if (i != d_pages.end())
bool DCScene::getIsPageExist(const QString &location) const
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
QMap<QString, DCVCPage*>::const_iterator i = d_pages.find(location);
return i != d_pages.end();
DCVCPage* DCScene::addPage(const std::string &location)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
QString qlocation = QString::fromStdString(location);
QMap<QString, DCVCPage*>::const_iterator i = d_pages.find(qlocation);
if (i != d_pages.end())
bool DCScene::removePage(DCVCPage *page)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
bool removed = false;
QMap<QString,DCVCPage*>::Iterator it = d_pages.begin();
while(it != d_pages.end())
bool DCScene::selectPage(const void *requester, const DCVCPage *page, bool multipleSelection)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
bool pageFound = false;
QMapIterator<QString, DCVCPage*> i(d_pages);
bool DCScene::unselectPage(const void *requester, const DCVCPage *page)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
bool pageFound = false;
QMapIterator<QString, DCVCPage*> i(d_pages);
bool DCScene::selectPage(const void *requester, const QString &locationPath, bool multipleSelection)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
bool pageFound = false;
QMapIterator<QString, DCVCPage*> i(d_pages);
bool DCScene::unselectPage(const void *requester, const QString &locationPath)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
bool pageFound = false;
QMapIterator<QString, DCVCPage*> i(d_pages);
bool DCScene::unselectPageAll(const void *requester)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
QMapIterator<QString, DCVCPage*> i(d_pages);
while (i.hasNext())
void DCScene::selectCellObject(const void *requester, DCVComponent *object, bool multipleSelection)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
bool objectSelected = false;
bool otherObjectSelected = false;
void DCScene::unselectCellObject(const void *requester, DCVComponent *object)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
if (!object->getIsSelected())
{
void DCScene::unselectCellObjectAll(const void *requester)
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
QList<DCVComponent*> list = d_owner->getSelectedCellObjects();
if (list.size() == 0)
int DCScene::getNumberOfSelectedPages() const
{
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
int cnt = 0;
QMapIterator<QString, DCVCPage*> i(d_pages);
while (i.hasNext())
{
QList<DCVCPage*> list;
- DNLocker(getSceneLock());
+ QMutexLocker locker(getSceneLock());
QMapIterator<QString, DCVCPage*> i(d_pages);
while (i.hasNext())
{
QList<DCVComponent*> DCScene::getSelectedCellObjects() const
{
- DNLocker(getSceneLock());
+ QMutexLocker lockr(getSceneLock());
return d_owner->getSelectedCellObjects();
}