FreeCAD

Форк
0
/
WorkbenchManipulator.cpp 
98 строк · 3.2 Кб
1
// SPDX-License-Identifier: LGPL-2.1-or-later
2

3
/***************************************************************************
4
 *   Copyright (c) 2023 Werner Mayer <wmayer[at]users.sourceforge.net>     *
5
 *                                                                         *
6
 *   This file is part of FreeCAD.                                         *
7
 *                                                                         *
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.                       *
12
 *                                                                         *
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.                       *
17
 *                                                                         *
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/>.                                      *
21
 *                                                                         *
22
 **************************************************************************/
23

24

25
#include "PreCompiled.h"
26
#include "WorkbenchManipulator.h"
27

28
using namespace Gui;
29

30
std::set<WorkbenchManipulator::Ptr> WorkbenchManipulator::manipulators; // NOLINT
31

32
void WorkbenchManipulator::installManipulator(const WorkbenchManipulator::Ptr& ptr)
33
{
34
    manipulators.insert(ptr);
35
}
36

37
void WorkbenchManipulator::removeManipulator(const WorkbenchManipulator::Ptr& ptr)
38
{
39
    auto it = manipulators.find(ptr);
40
    if (it != manipulators.end()) {
41
        manipulators.erase(it);
42
    }
43
}
44

45
void WorkbenchManipulator::removeAll()
46
{
47
    manipulators.clear();
48
}
49

50
std::set<WorkbenchManipulator::Ptr> WorkbenchManipulator::getManipulators()
51
{
52
    return manipulators;
53
}
54

55
void WorkbenchManipulator::changeMenuBar(MenuItem* menuBar)
56
{
57
    for (auto& it : manipulators) {
58
        it->modifyMenuBar(menuBar);
59
    }
60
}
61

62
void WorkbenchManipulator::changeContextMenu(const char* recipient, MenuItem* menuBar)
63
{
64
    for (auto& it : manipulators) {
65
        it->modifyContextMenu(recipient, menuBar);
66
    }
67
}
68

69
void WorkbenchManipulator::changeToolBars(ToolBarItem* toolBar)
70
{
71
    for (auto& it : manipulators) {
72
        it->modifyToolBars(toolBar);
73
    }
74
}
75

76
void WorkbenchManipulator::changeDockWindows(DockWindowItems* dockWindow)
77
{
78
    for (auto& it : manipulators) {
79
        it->modifyDockWindows(dockWindow);
80
    }
81
}
82

83
void WorkbenchManipulator::modifyMenuBar([[maybe_unused]] MenuItem* menuBar)
84
{
85
}
86

87
void WorkbenchManipulator::modifyContextMenu([[maybe_unused]] const char* recipient,
88
                                             [[maybe_unused]] MenuItem* menuBar)
89
{
90
}
91

92
void WorkbenchManipulator::modifyToolBars([[maybe_unused]] ToolBarItem* toolBar)
93
{
94
}
95

96
void WorkbenchManipulator::modifyDockWindows([[maybe_unused]] DockWindowItems* dockWindow)
97
{
98
}
99

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.