Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/tastenbrett/section.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright 2019 Harald Sitter <sitter@kde.org> | ||||
3 | | ||||
4 | This program is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU General Public License as | ||||
6 | published by the Free Software Foundation; either version 2 of | ||||
7 | the License or (at your option) version 3 or any later version | ||||
8 | accepted by the membership of KDE e.V. (or its successor approved | ||||
9 | by the membership of KDE e.V.), which shall act as a proxy | ||||
10 | defined in Section 14 of version 3 of the license. | ||||
11 | | ||||
12 | This program is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU General Public License | ||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | #include "section.h" | ||||
22 | | ||||
23 | #include <QDebug> | ||||
24 | | ||||
25 | #include "doodad.h" | ||||
26 | #include "row.h" | ||||
27 | | ||||
28 | Section::Section(XkbSectionPtr section_, XkbDescPtr xkb_, QObject *parent) | ||||
29 | : XkbObject(xkb_, parent) | ||||
30 | , section(section_) | ||||
31 | { | ||||
32 | for (int i = 0; i < section->num_doodads; ++i) { | ||||
33 | Doodad *o = Doodad::factorize(section->doodads + i, xkb, this); | ||||
34 | if (!o) { | ||||
35 | continue; | ||||
36 | } | ||||
37 | doodads.push_back(o); | ||||
38 | } | ||||
39 | | ||||
40 | for (int i = 0; i < section->num_rows; ++i) { | ||||
41 | rows.push_back(new Row(section->rows + i, xkb, this)); | ||||
42 | } | ||||
43 | | ||||
44 | // Sections also contain overlays, that contain overlay rows, that contain | ||||
45 | // overlay keys, that are comprised of an "under" name (internal name | ||||
46 | // of our Key object) and an "over" name (the overlay to be used instead). | ||||
47 | // The intention I presume is to label keys this way. Alas, this seems | ||||
48 | // useless to us because that'd ignore key mapping. Our dynamic key cap | ||||
49 | // resolution should be yielding more useful cap data than these overlays. | ||||
50 | // Because of this we do not actually set our caps to the overlays and ignore | ||||
51 | // them entirely. | ||||
52 | } |