/* * Copyright (c) 2018-2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace PixelPaint { class Tool; class ToolboxWidget final : public GUI::Widget { C_OBJECT(ToolboxWidget); public: virtual ~ToolboxWidget() override; Function on_tool_selection; template void for_each_tool(Callback callback) { for (auto& tool : m_tools) callback(tool); } private: friend class ToolButton; void setup_tools(); explicit ToolboxWidget(); RefPtr m_toolbar; GUI::ActionGroup m_action_group; NonnullOwnPtrVector m_tools; }; }