src: replaced gui wording with view wording

Changed gui wording in lib and app to view wording, since MVC views do not necessarily deal with GUIs. And moved files
so structure is similar in lib and app.
This commit is contained in:
Eberhard Graether
2014-07-21 14:48:02 +02:00
parent bf563f92f3
commit 0074db86e8
33 changed files with 199 additions and 205 deletions
+6 -6
View File
@@ -7,14 +7,14 @@
#include "component/view/CodeView.h"
#include "component/view/GraphView.h"
#include "component/view/SearchView.h"
#include "component/view/ViewFactory.h"
#include "component/view/ViewLayout.h"
#include "gui/GuiFactory.h"
std::shared_ptr<ComponentFactory> ComponentFactory::create(
GuiFactory* guiFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
ViewFactory* viewFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
){
std::shared_ptr<ComponentFactory> ptr(new ComponentFactory());
ptr->m_guiFactory = guiFactory;
ptr->m_viewFactory = viewFactory;
ptr->m_viewLayout = viewLayout;
ptr->m_graphAccess = graphAccess;
ptr->m_locationAccess = locationAccess;
@@ -27,7 +27,7 @@ ComponentFactory::~ComponentFactory()
std::shared_ptr<Component> ComponentFactory::createCodeComponent()
{
std::shared_ptr<CodeView> view = m_guiFactory->createCodeView(m_viewLayout);
std::shared_ptr<CodeView> view = m_viewFactory->createCodeView(m_viewLayout);
std::shared_ptr<CodeController> controller = std::make_shared<CodeController>(m_locationAccess);
std::shared_ptr<Component> component = std::make_shared<Component>(view, controller);
@@ -36,7 +36,7 @@ std::shared_ptr<Component> ComponentFactory::createCodeComponent()
std::shared_ptr<Component> ComponentFactory::createGraphComponent()
{
std::shared_ptr<View> view = m_guiFactory->createGraphView(m_viewLayout);
std::shared_ptr<View> view = m_viewFactory->createGraphView(m_viewLayout);
std::shared_ptr<GraphController> controller = std::make_shared<GraphController>(m_graphAccess);
std::shared_ptr<Component> component = std::make_shared<Component>(view, controller);
@@ -45,7 +45,7 @@ std::shared_ptr<Component> ComponentFactory::createGraphComponent()
std::shared_ptr<Component> ComponentFactory::createSearchComponent()
{
std::shared_ptr<SearchView> view = m_guiFactory->createSearchView(m_viewLayout);
std::shared_ptr<SearchView> view = m_viewFactory->createSearchView(m_viewLayout);
std::shared_ptr<SearchController> controller = std::make_shared<SearchController>(m_graphAccess);
std::shared_ptr<Component> component = std::make_shared<Component>(view, controller);
+3 -3
View File
@@ -7,14 +7,14 @@
#include "data/access/GraphAccess.h"
class Component;
class GuiFactory;
class ViewFactory;
class ViewLayout;
class ComponentFactory
{
public:
static std::shared_ptr<ComponentFactory> create(
GuiFactory* guiFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
ViewFactory* viewFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
);
~ComponentFactory();
@@ -27,7 +27,7 @@ private:
ComponentFactory();
ComponentFactory(const ComponentFactory&);
GuiFactory* m_guiFactory;
ViewFactory* m_viewFactory;
ViewLayout* m_viewLayout;
GraphAccess* m_graphAccess;
+2 -5
View File
@@ -2,15 +2,12 @@
#include "component/view/CodeView.h"
#include "component/view/GraphView.h"
#include "component/view/ViewLayout.h"
#include "data/location/TokenLocationFile.h"
std::shared_ptr<ComponentManager> ComponentManager::create(
GuiFactory* guiFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
ViewFactory* viewFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
){
std::shared_ptr<ComponentManager> ptr(new ComponentManager());
ptr->m_componentFactory = ComponentFactory::create(guiFactory, viewLayout, graphAccess, locationAccess);
ptr->m_componentFactory = ComponentFactory::create(viewFactory, viewLayout, graphAccess, locationAccess);
return ptr;
}
+2 -2
View File
@@ -9,14 +9,14 @@
#include "data/access/LocationAccess.h"
#include "data/access/GraphAccess.h"
class GuiFactory;
class ViewFactory;
class ViewLayout;
class ComponentManager
{
public:
static std::shared_ptr<ComponentManager> create(
GuiFactory* guiFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
ViewFactory* viewFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
);
~ComponentManager();
+3 -3
View File
@@ -1,6 +1,6 @@
#include "component/view/View.h"
#include "gui/GuiWidgetWrapper.h"
#include "component/view/ViewWidgetWrapper.h"
View::View(ViewLayout* viewLayout, const Vec2i& minSize)
: m_viewLayout(viewLayout)
@@ -14,12 +14,12 @@ View::~View()
m_viewLayout->removeView(this);
}
void View::setWidgetWrapper(std::shared_ptr<GuiWidgetWrapper> widgetWrapper)
void View::setWidgetWrapper(std::shared_ptr<ViewWidgetWrapper> widgetWrapper)
{
m_widgetWrapper = widgetWrapper;
}
GuiWidgetWrapper* View::getWidgetWrapper()
ViewWidgetWrapper* View::getWidgetWrapper()
{
return m_widgetWrapper.get();
}
+7 -8
View File
@@ -8,7 +8,7 @@
#include "component/view/ViewLayout.h"
#include "utility/math/Vector2.h"
class GuiWidgetWrapper;
class ViewWidgetWrapper;
class View
{
@@ -20,15 +20,14 @@ public:
virtual ~View();
virtual std::string getName() const = 0;
virtual void createWidgetWrapper() = 0;
void setWidgetWrapper(std::shared_ptr<GuiWidgetWrapper> widgetWrapper);
GuiWidgetWrapper* getWidgetWrapper();
virtual void initGui() = 0;
virtual void initView() = 0;
void setComponent(Component* component);
void setWidgetWrapper(std::shared_ptr<ViewWidgetWrapper> widgetWrapper);
ViewWidgetWrapper* getWidgetWrapper();
int getMinWidth() const;
int getMinHeight() const;
Vec2i getMinSize() const;
@@ -42,7 +41,7 @@ protected:
private:
Component* m_component;
ViewLayout* const m_viewLayout;
std::shared_ptr<GuiWidgetWrapper> m_widgetWrapper;
std::shared_ptr<ViewWidgetWrapper> m_widgetWrapper;
Vec2i m_minSize;
};
@@ -52,7 +51,7 @@ std::shared_ptr<T> View::create(ViewLayout* viewLayout)
std::shared_ptr<T> ptr = std::make_shared<T>(viewLayout);
ptr->createWidgetWrapper();
ptr->initGui();
ptr->initView();
viewLayout->addView(ptr.get());
+9
View File
@@ -0,0 +1,9 @@
#include "component/view/ViewFactory.h"
ViewFactory::ViewFactory()
{
}
ViewFactory::~ViewFactory()
{
}
+24
View File
@@ -0,0 +1,24 @@
#ifndef VIEW_FACTORY_H
#define VIEW_FACTORY_H
#include <memory>
class CodeView;
class GraphView;
class MainView;
class SearchView;
class ViewLayout;
class ViewFactory
{
public:
ViewFactory();
virtual ~ViewFactory();
virtual std::shared_ptr<MainView> createMainView() const = 0;
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const = 0;
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
};
#endif // VIEW_FACTORY_H
@@ -0,0 +1,9 @@
#include "component/view/ViewWidgetWrapper.h"
ViewWidgetWrapper::ViewWidgetWrapper()
{
}
ViewWidgetWrapper::~ViewWidgetWrapper()
{
}
@@ -0,0 +1,11 @@
#ifndef VIEW_WIDGET_WRAPPER_H
#define VIEW_WIDGET_WRAPPER_H
class ViewWidgetWrapper
{
public:
ViewWidgetWrapper();
virtual ~ViewWidgetWrapper();
};
#endif // VIEW_WIDGET_WRAPPER_H