Skip to content

Commit

Permalink
move lots of includes into implementation files
Browse files Browse the repository at this point in the history
  • Loading branch information
russelltg committed Nov 27, 2019
1 parent 41eb13b commit 7960d4c
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/centraltabview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <chi/GraphFunction.hpp>
#include <chi/GraphModule.hpp>
#include <chi/GraphStruct.hpp>
#include <chi/NodeInstance.hpp>
#include <chi/Support/Result.hpp>

#include "functionview.hpp"
Expand Down
6 changes: 6 additions & 0 deletions src/chigraphnodemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <chi/GraphFunction.hpp>
#include <chi/GraphModule.hpp>
#include <chi/NodeInstance.hpp>
#include <chi/NodeType.hpp>
#include <chi/Support/Result.hpp>
#include <nodes/NodeData>

Expand Down Expand Up @@ -258,6 +259,11 @@ bool ChigraphFlowSceneModel::getTypeConvertable(QtNodes::TypeConverterId const&
}
}

QtNodes::NodeIndex ChigraphFlowSceneModel::nodeIndex(const chi::NodeInstance& node) const {
return nodeIndex(
QUuid::fromRfc4122(QByteArray(reinterpret_cast<const char*>(node.id().data().data()), 16)));
}

QList<QUuid> ChigraphFlowSceneModel::nodeUUids() const {
QList<QUuid> ret;

Expand Down
8 changes: 2 additions & 6 deletions src/chigraphnodemodel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#include <QPushButton>
#include <QTextEdit>
#include <QValidator>
#include <chi/NodeInstance.hpp>
#include <chi/NodeType.hpp>
#include <chi/Fwd.hpp>
#include <chi/Support/Result.hpp>
#include <memory>
#include <nodes/FlowSceneModel>
Expand All @@ -34,10 +33,7 @@ class ChigraphFlowSceneModel : public QtNodes::FlowSceneModel {
// Retrieval functions
//////////////////////

QtNodes::NodeIndex nodeIndex(const chi::NodeInstance& node) const {
return nodeIndex(QUuid::fromRfc4122(
QByteArray(reinterpret_cast<const char*>(node.id().data().data()), 16)));
}
QtNodes::NodeIndex nodeIndex(const chi::NodeInstance& node) const;

QList<QUuid> nodeUUids() const override;
QtNodes::NodeIndex nodeIndex(const QUuid& ID) const override;
Expand Down
1 change: 1 addition & 0 deletions src/functiondetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QVBoxLayout>
#include <chi/GraphFunction.hpp>

#include "functioninouts.hpp"
#include "functionview.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/functioninouts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define CHIGGUI_FUNCTION_IN_OUTS_HPP

#include <QWidget>
#include <chi/GraphFunction.hpp>
#include <chi/Fwd.hpp>

#include "execparamlistwidget.hpp"
#include "paramlistwidget.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/functionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <chi/FunctionValidator.hpp>
#include <chi/GraphModule.hpp>
#include <chi/NodeInstance.hpp>
#include <chi/NodeType.hpp>
#include <chi/Support/Result.hpp>
#include <nodes/ConnectionStyle>
#include <nodes/NodeGraphicsObject>
Expand Down
2 changes: 2 additions & 0 deletions src/localvariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#include <QComboBox>
#include <QGridLayout>
#include <QPushButton>
#include <chi/Context.hpp>
#include <chi/DataType.hpp>
#include <chi/GraphFunction.hpp>
#include <chi/GraphModule.hpp>
#include <chi/LangModule.hpp>

#include "execparamlistwidget.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <chi/GraphFunction.hpp>
#include <chi/GraphModule.hpp>
#include <chi/LangModule.hpp>
#include <chi/NodeInstance.hpp>
#include <chi/Support/Result.hpp>
#include <chi/Support/json.hpp>
#include <fstream>
Expand Down
3 changes: 1 addition & 2 deletions src/mainwindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
#include <QProcess>
#include <QTabWidget>
#include <QUrl>
#include <chi/ChiModule.hpp>
#include <chi/Context.hpp>
#include <chi/GraphModule.hpp>
#include <chi/Fwd.hpp>
#include <nodes/FlowScene>
#include <nodes/FlowView>

Expand Down
3 changes: 3 additions & 0 deletions src/modulebrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
#include <QMenu>
#include <QTreeWidgetItem>
#include <chi/GraphFunction.hpp>
#include <chi/GraphModule.hpp>
#include <chi/GraphStruct.hpp>
#include <chi/NodeInstance.hpp>
#include <chi/NodeType.hpp>
#include <chi/Support/Result.hpp>
#include <filesystem>

Expand Down
19 changes: 19 additions & 0 deletions src/paramlistwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,30 @@
#include <chi/Context.hpp>
#include <chi/DataType.hpp>
#include <chi/GraphFunction.hpp>
#include <chi/GraphModule.hpp>

#include "execparamlistwidget.hpp"
#include "functionview.hpp"
#include "typeselector.hpp"

QStringList createTypeOptions(const chi::GraphModule& mod) {
QStringList ret;

// add the module
for (const auto& ty : mod.typeNames()) {
ret << QString::fromStdString(mod.fullName() + ":" + ty);
}

// and its dependencies
for (auto dep : mod.dependencies()) {
auto depMod = mod.context().moduleByFullName(dep);
for (const auto& type : depMod->typeNames()) {
ret << QString::fromStdString(depMod->fullName() + ":" + type);
}
}
return ret;
}

ParamListWidget::ParamListWidget(QWidget* parent) : QWidget(parent) {}

void ParamListWidget::setFunction(FunctionView* func, Type ty) {
Expand Down
22 changes: 3 additions & 19 deletions src/paramlistwidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,12 @@

#include <QListWidget>
#include <QTableView>
#include <chi/Context.hpp>
#include <chi/GraphModule.hpp>
#include <chi/Fwd.hpp>

class FunctionView;

inline QStringList createTypeOptions(const chi::GraphModule& mod) {
QStringList ret;

// add the module
for (const auto& ty : mod.typeNames()) {
ret << QString::fromStdString(mod.fullName() + ":" + ty);
}

// and its dependencies
for (auto dep : mod.dependencies()) {
auto depMod = mod.context().moduleByFullName(dep);
for (const auto& type : depMod->typeNames()) {
ret << QString::fromStdString(depMod->fullName() + ":" + type);
}
}
return ret;
}
QStringList createTypeOptions(const chi::GraphModule& mod);

class ParamListWidget : public QWidget {
Q_OBJECT

Expand Down
1 change: 1 addition & 0 deletions src/subprocessoutputview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <QPlainTextEdit>
#include <QVBoxLayout>
#include <chi/Context.hpp>
#include <chi/GraphModule.hpp>
#include <chi/Support/Result.hpp>
#include <chi/Support/TempFile.hpp>
#include <filesystem>
Expand Down
2 changes: 1 addition & 1 deletion src/subprocessoutputview.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <QPlainTextEdit>
#include <QProcess>
#include <chi/GraphModule.hpp>
#include <chi/Fwd.hpp>

class SubprocessOutputView : public QPlainTextEdit {
Q_OBJECT
Expand Down

0 comments on commit 7960d4c

Please sign in to comment.