Clean up fontsmanager
This commit is contained in:
parent
076e32b1d6
commit
64f0b3e77a
26 changed files with 111 additions and 89 deletions
|
@ -1,16 +1,8 @@
|
|||
#include "TestCase.h"
|
||||
#include "TestCaseRunner.h"
|
||||
|
||||
#include "TestUiApplication.h"
|
||||
|
||||
#include "TestFramework.h"
|
||||
|
||||
#include "DesktopManager.h"
|
||||
#include "MeshPrimitives.h"
|
||||
#include "MeshNode.h"
|
||||
#include "RectangleNode.h"
|
||||
#include "TextNode.h"
|
||||
#include "Scene.h"
|
||||
#include "Widget.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
@ -18,5 +10,15 @@
|
|||
|
||||
TEST_CASE(TestD2dRendering, "graphics")
|
||||
{
|
||||
auto gui_app = TestCaseRunner::getInstance().getTestApplication();
|
||||
auto scene = gui_app->getMainWindowScene();
|
||||
|
||||
auto rect = std::make_unique<RectangleNode>(Point(10, 10), 200.0, 200.0);
|
||||
scene->addNode(rect.get());
|
||||
|
||||
auto text_node = std::make_unique<TextNode>("Test2", Point(100, 100));
|
||||
scene->addNode(text_node.get());
|
||||
|
||||
scene->update();
|
||||
gui_app->run();
|
||||
};
|
|
@ -1,6 +1,7 @@
|
|||
#include "TestUiApplication.h"
|
||||
|
||||
#include "MainApplication.h"
|
||||
#include "DesktopManager.h"
|
||||
|
||||
TestUiApplication::TestUiApplication(std::unique_ptr<CommandLineArgs> args, std::unique_ptr<MainApplication> mainApp)
|
||||
: GuiApplication(std::move(args), std::move(mainApp))
|
||||
|
@ -11,4 +12,9 @@ TestUiApplication::TestUiApplication(std::unique_ptr<CommandLineArgs> args, std:
|
|||
DesktopManager* TestUiApplication::getDesktopManager() const
|
||||
{
|
||||
return mDesktopManager.get();
|
||||
}
|
||||
|
||||
Scene* TestUiApplication::getMainWindowScene() const
|
||||
{
|
||||
return mDesktopManager->getWindowManager()->getMainWindow()->getScene();
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "GuiApplication.h"
|
||||
#include "Scene.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
@ -10,4 +11,6 @@ public:
|
|||
TestUiApplication(std::unique_ptr<CommandLineArgs> args = nullptr, std::unique_ptr<MainApplication> mainApp = nullptr);
|
||||
|
||||
DesktopManager* getDesktopManager() const;
|
||||
|
||||
Scene* getMainWindowScene() const;
|
||||
};
|
|
@ -23,6 +23,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
|
|||
auto args = CommandLineArgs::Create();
|
||||
CommandLineArgs::initialize(args.get());
|
||||
|
||||
const auto user_args = args->getUserArgs();
|
||||
|
||||
auto main_app = MainApplication::Create();
|
||||
|
||||
auto applicationContext = std::make_unique<Win32ApplicationContext>();
|
||||
|
@ -41,7 +43,7 @@ int main(int argc, char *argv[])
|
|||
#endif
|
||||
|
||||
TestCaseRunner::getInstance().setTestApplication(gui_app.get());
|
||||
auto result = TestCaseRunner::getInstance().run({});
|
||||
auto result = TestCaseRunner::getInstance().run(user_args);
|
||||
|
||||
#ifdef _WIN32
|
||||
CoUninitialize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue