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:
@@ -2,13 +2,13 @@
|
||||
|
||||
#include "ApplicationSettings.h"
|
||||
#include "component/view/MainView.h"
|
||||
#include "component/view/ViewFactory.h"
|
||||
#include "data/access/GraphAccessProxy.h"
|
||||
#include "data/access/LocationAccessProxy.h"
|
||||
#include "gui/GuiFactory.h"
|
||||
#include "utility/messaging/MessageQueue.h"
|
||||
#include "utility/messaging/type/MessageActivateToken.h"
|
||||
|
||||
std::shared_ptr<Application> Application::create(GuiFactory* guiFactory)
|
||||
std::shared_ptr<Application> Application::create(ViewFactory* viewFactory)
|
||||
{
|
||||
ApplicationSettings::getInstance()->load("data/ApplicationSettings.xml");
|
||||
|
||||
@@ -17,9 +17,9 @@ std::shared_ptr<Application> Application::create(GuiFactory* guiFactory)
|
||||
ptr->m_graphAccessProxy = std::make_shared<GraphAccessProxy>();
|
||||
ptr->m_locationAccessProxy = std::make_shared<LocationAccessProxy>();
|
||||
|
||||
ptr->m_mainView = guiFactory->createMainView();
|
||||
ptr->m_mainView = viewFactory->createMainView();
|
||||
ptr->m_componentManager = ComponentManager::create(
|
||||
guiFactory, ptr->m_mainView.get(), ptr->m_graphAccessProxy.get(), ptr->m_locationAccessProxy.get());
|
||||
viewFactory, ptr->m_mainView.get(), ptr->m_graphAccessProxy.get(), ptr->m_locationAccessProxy.get());
|
||||
|
||||
ptr->m_componentManager->setup();
|
||||
ptr->m_mainView->loadLayout();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "utility/messaging/type/MessageLoadProject.h"
|
||||
#include "utility/messaging/type/MessageLoadSource.h"
|
||||
|
||||
class GuiFactory;
|
||||
class ViewFactory;
|
||||
class MainView;
|
||||
class GraphAccessProxy;
|
||||
class LocationAccessProxy;
|
||||
@@ -19,7 +19,7 @@ class Application
|
||||
, public MessageListener<MessageLoadSource>
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<Application> create(GuiFactory* guiFactory);
|
||||
static std::shared_ptr<Application> create(ViewFactory* viewFactory);
|
||||
|
||||
~Application();
|
||||
|
||||
|
||||
@@ -48,8 +48,12 @@ add_files(
|
||||
component/view/SearchView.h
|
||||
component/view/View.cpp
|
||||
component/view/View.h
|
||||
component/view/ViewFactory.cpp
|
||||
component/view/ViewFactory.h
|
||||
component/view/ViewLayout.cpp
|
||||
component/view/ViewLayout.h
|
||||
component/view/ViewWidgetWrapper.cpp
|
||||
component/view/ViewWidgetWrapper.h
|
||||
|
||||
component/Component.cpp
|
||||
component/Component.h
|
||||
@@ -124,11 +128,6 @@ add_files(
|
||||
data/Storage.cpp
|
||||
data/Storage.h
|
||||
|
||||
gui/GuiFactory.cpp
|
||||
gui/GuiFactory.h
|
||||
gui/GuiWidgetWrapper.cpp
|
||||
gui/GuiWidgetWrapper.h
|
||||
|
||||
utility/logging/ConsoleLogger.cpp
|
||||
utility/logging/ConsoleLogger.h
|
||||
utility/logging/FileLogger.cpp
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "component/view/ViewFactory.h"
|
||||
|
||||
ViewFactory::ViewFactory()
|
||||
{
|
||||
}
|
||||
|
||||
ViewFactory::~ViewFactory()
|
||||
{
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef GUI_FACTORY_H
|
||||
#define GUI_FACTORY_H
|
||||
#ifndef VIEW_FACTORY_H
|
||||
#define VIEW_FACTORY_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -9,11 +9,11 @@ class MainView;
|
||||
class SearchView;
|
||||
class ViewLayout;
|
||||
|
||||
class GuiFactory
|
||||
class ViewFactory
|
||||
{
|
||||
public:
|
||||
GuiFactory();
|
||||
virtual ~GuiFactory();
|
||||
ViewFactory();
|
||||
virtual ~ViewFactory();
|
||||
|
||||
virtual std::shared_ptr<MainView> createMainView() const = 0;
|
||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
|
||||
@@ -21,4 +21,4 @@ public:
|
||||
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
|
||||
};
|
||||
|
||||
#endif // GUI_FACTORY_H
|
||||
#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
|
||||
@@ -1,9 +0,0 @@
|
||||
#include "gui/GuiFactory.h"
|
||||
|
||||
GuiFactory::GuiFactory()
|
||||
{
|
||||
}
|
||||
|
||||
GuiFactory::~GuiFactory()
|
||||
{
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
#include "gui/GuiWidgetWrapper.h"
|
||||
|
||||
GuiWidgetWrapper::GuiWidgetWrapper()
|
||||
{
|
||||
}
|
||||
|
||||
GuiWidgetWrapper::~GuiWidgetWrapper()
|
||||
{
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef GUI_WIDGET_WRAPPER_H
|
||||
#define GUI_WIDGET_WRAPPER_H
|
||||
|
||||
class GuiWidgetWrapper
|
||||
{
|
||||
public:
|
||||
GuiWidgetWrapper();
|
||||
virtual ~GuiWidgetWrapper();
|
||||
};
|
||||
|
||||
#endif // GUI_WIDGET_WRAPPER_H
|
||||
Reference in New Issue
Block a user