infinipaint/src/DrawingProgram/DrawingProgramToolBase.cpp

54 lines
2.1 KiB
C++
Raw Normal View History

2025-08-02 20:10:33 +03:00
#include "DrawingProgramToolBase.hpp"
#include "BrushTool.hpp"
#include "EraserTool.hpp"
2025-09-28 15:00:19 +03:00
#include "PanCanvasTool.hpp"
2025-08-02 20:10:33 +03:00
#include "RectSelectTool.hpp"
#include "LassoSelectTool.hpp"
#include "RectDrawTool.hpp"
#include "EllipseDrawTool.hpp"
#include "TextBoxTool.hpp"
2025-08-05 12:11:50 +03:00
#include "EyeDropperTool.hpp"
2025-08-02 20:10:33 +03:00
#include "ScreenshotTool.hpp"
#include "EditTool.hpp"
#include "GridModifyTool.hpp"
2025-09-28 11:59:08 +03:00
#include "ZoomCanvasTool.hpp"
2025-08-02 20:10:33 +03:00
DrawingProgramToolBase::DrawingProgramToolBase(DrawingProgram& initDrawP):
drawP(initDrawP)
{}
DrawingProgramToolBase::~DrawingProgramToolBase() {}
std::unique_ptr<DrawingProgramToolBase> DrawingProgramToolBase::allocate_tool_type(DrawingProgram& drawP, DrawingProgramToolType t) {
switch(t) {
case DrawingProgramToolType::BRUSH:
return std::make_unique<BrushTool>(drawP);
case DrawingProgramToolType::ERASER:
return std::make_unique<EraserTool>(drawP);
case DrawingProgramToolType::LASSOSELECT:
return std::make_unique<LassoSelectTool>(drawP);
case DrawingProgramToolType::RECTSELECT:
return std::make_unique<RectSelectTool>(drawP);
case DrawingProgramToolType::RECTANGLE:
return std::make_unique<RectDrawTool>(drawP);
case DrawingProgramToolType::ELLIPSE:
return std::make_unique<EllipseDrawTool>(drawP);
case DrawingProgramToolType::TEXTBOX:
return std::make_unique<TextBoxTool>(drawP);
2025-08-05 12:11:50 +03:00
case DrawingProgramToolType::EYEDROPPER:
return std::make_unique<EyeDropperTool>(drawP);
2025-08-02 20:10:33 +03:00
case DrawingProgramToolType::SCREENSHOT:
return std::make_unique<ScreenshotTool>(drawP);
case DrawingProgramToolType::GRIDMODIFY:
return std::make_unique<GridModifyTool>(drawP);
2025-08-02 20:10:33 +03:00
case DrawingProgramToolType::EDIT:
return std::make_unique<EditTool>(drawP);
2025-09-28 11:59:08 +03:00
case DrawingProgramToolType::ZOOM:
return std::make_unique<ZoomCanvasTool>(drawP);
2025-09-28 15:00:19 +03:00
case DrawingProgramToolType::PAN:
return std::make_unique<PanCanvasTool>(drawP);
2025-08-02 20:10:33 +03:00
}
return nullptr;
}