Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-Studio-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2023 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 : #include "passlayoutindependentitems.h"
23 :
24 : #include "dom/score.h"
25 :
26 : #include "tlayout.h"
27 :
28 : using namespace mu::engraving;
29 : using namespace mu::engraving::rendering::score;
30 :
31 0 : void PassLayoutIndependentItems::doRun(Score* score, LayoutContext& ctx)
32 : {
33 0 : for (EngravingObject* child : score->children()) {
34 0 : if (child->isEngravingItem()) {
35 0 : scan(toEngravingItem(child), ctx);
36 : }
37 : }
38 0 : }
39 :
40 0 : void PassLayoutIndependentItems::scan(EngravingItem* item, LayoutContext& ctx)
41 : {
42 : //! NOTE These items are independent
43 0 : switch (item->type()) {
44 0 : case ElementType::ACCIDENTAL:
45 : case ElementType::ACTION_ICON:
46 : case ElementType::AMBITUS:
47 : case ElementType::BREATH:
48 : case ElementType::CLEF:
49 : case ElementType::DEAD_SLAPPED:
50 : case ElementType::HARMONY:
51 : case ElementType::HOOK:
52 : case ElementType::INSTRUMENT_NAME:
53 : case ElementType::KEYSIG:
54 : case ElementType::LAYOUT_BREAK:
55 : case ElementType::NOTE:
56 : case ElementType::NOTEDOT:
57 : case ElementType::STAFF_STATE:
58 : case ElementType::STAFFTYPE_CHANGE:
59 : case ElementType::STEM:
60 : case ElementType::SYMBOL:
61 : case ElementType::FSYMBOL:
62 : case ElementType::SYSTEM_DIVIDER:
63 : case ElementType::TIMESIG:
64 : case ElementType::TREMOLOBAR:
65 0 : TLayout::layoutItem(item, ctx);
66 0 : default:
67 0 : break;
68 : }
69 :
70 0 : for (EngravingItem* ch : item->childrenItems()) {
71 0 : scan(ch, ctx);
72 0 : }
73 0 : }
|