logic: code controller communication

- Replaced CodeAccess with LocationAccess.
- Implemented basic functionality for CodeController.
- Added messaging to the project.
- Added QtThreadedFunctor to enable our Messaging thread to invoke calls on the QtThread.
- Added GraphController.

fortune cookie message = Good news from someone dear is coming soon.
This commit is contained in:
malte_langkabel
2014-07-02 16:42:33 +02:00
parent a8e32af5dd
commit 400e2629d2
37 changed files with 441 additions and 78 deletions
+5 -4
View File
@@ -7,11 +7,12 @@
std::shared_ptr<ComponentManager> ComponentManager::create(
GuiFactory* guiFactory,
ViewLayout* viewLayout,
std::shared_ptr<CodeAccess> codeAccess,
std::shared_ptr<LocationAccess> locationAccess,
std::shared_ptr<GraphAccess> graphAccess)
{
std::shared_ptr<ComponentManager> ptr(new ComponentManager());
ptr->m_componentFactory = ComponentFactory::create(guiFactory, viewLayout, codeAccess, graphAccess);
ptr->m_componentFactory = ComponentFactory::create(guiFactory, viewLayout, locationAccess, graphAccess);
return ptr;
}
@@ -22,7 +23,7 @@ ComponentManager::~ComponentManager()
void ComponentManager::setup()
{
std::shared_ptr<Component> graphComponent = m_componentFactory->createGraphComponent();
GraphView* graphView = dynamic_cast<GraphView*>(graphComponent->getView());
GraphView* graphView = graphComponent->getView<GraphView>();
graphView->addNode(Vec2i(-100, -100), "foo");
graphView->addNode(Vec2i(50, 50), "bar");
@@ -31,7 +32,7 @@ void ComponentManager::setup()
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
m_components.push_back(codeComponent);
CodeView* codeView = dynamic_cast<CodeView*>(codeComponent->getView());
CodeView* codeView = codeComponent->getView<CodeView>();
codeView->addCodeSnippet("class HelloWorld;");
codeView->addCodeSnippet("static int n = 42; // the answer.");
// codeView->clearCodeSnippets();