1
// SPDX-License-Identifier: LGPL-2.1-or-later
3
/***************************************************************************
4
* Copyright (c) 2023 Werner Mayer <wmayer[at]users.sourceforge.net> *
6
* This file is part of FreeCAD. *
8
* FreeCAD is free software: you can redistribute it and/or modify it *
9
* under the terms of the GNU Lesser General Public License as *
10
* published by the Free Software Foundation, either version 2.1 of the *
11
* License, or (at your option) any later version. *
13
* FreeCAD is distributed in the hope that it will be useful, but *
14
* WITHOUT ANY WARRANTY; without even the implied warranty of *
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16
* Lesser General Public License for more details. *
18
* You should have received a copy of the GNU Lesser General Public *
19
* License along with FreeCAD. If not, see *
20
* <https://www.gnu.org/licenses/>. *
22
**************************************************************************/
25
#include "PreCompiled.h"
26
#include "WorkbenchManipulator.h"
30
std::set<WorkbenchManipulator::Ptr> WorkbenchManipulator::manipulators; // NOLINT
32
void WorkbenchManipulator::installManipulator(const WorkbenchManipulator::Ptr& ptr)
34
manipulators.insert(ptr);
37
void WorkbenchManipulator::removeManipulator(const WorkbenchManipulator::Ptr& ptr)
39
auto it = manipulators.find(ptr);
40
if (it != manipulators.end()) {
41
manipulators.erase(it);
45
void WorkbenchManipulator::removeAll()
50
std::set<WorkbenchManipulator::Ptr> WorkbenchManipulator::getManipulators()
55
void WorkbenchManipulator::changeMenuBar(MenuItem* menuBar)
57
for (auto& it : manipulators) {
58
it->modifyMenuBar(menuBar);
62
void WorkbenchManipulator::changeContextMenu(const char* recipient, MenuItem* menuBar)
64
for (auto& it : manipulators) {
65
it->modifyContextMenu(recipient, menuBar);
69
void WorkbenchManipulator::changeToolBars(ToolBarItem* toolBar)
71
for (auto& it : manipulators) {
72
it->modifyToolBars(toolBar);
76
void WorkbenchManipulator::changeDockWindows(DockWindowItems* dockWindow)
78
for (auto& it : manipulators) {
79
it->modifyDockWindows(dockWindow);
83
void WorkbenchManipulator::modifyMenuBar([[maybe_unused]] MenuItem* menuBar)
87
void WorkbenchManipulator::modifyContextMenu([[maybe_unused]] const char* recipient,
88
[[maybe_unused]] MenuItem* menuBar)
92
void WorkbenchManipulator::modifyToolBars([[maybe_unused]] ToolBarItem* toolBar)
96
void WorkbenchManipulator::modifyDockWindows([[maybe_unused]] DockWindowItems* dockWindow)