File indexing completed on 2024-12-01 05:04:17

0001 /*
0002     SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #include "section.h"
0008 
0009 #include <QDebug>
0010 
0011 #include "doodad.h"
0012 #include "row.h"
0013 
0014 Section::Section(XkbSectionPtr section_, XkbDescPtr xkb_, QObject *parent)
0015     : XkbObject(xkb_, parent)
0016     , section(section_)
0017 {
0018     for (int i = 0; i < section->num_doodads; ++i) {
0019         Doodad *o = Doodad::factorize(section->doodads + i, xkb, this);
0020         if (!o) {
0021             continue;
0022         }
0023         doodads.push_back(o);
0024     }
0025 
0026     for (int i = 0; i < section->num_rows; ++i) {
0027         rows.push_back(new Row(section->rows + i, xkb, this));
0028     }
0029 
0030     // Sections also contain overlays, that contain overlay rows, that contain
0031     // overlay keys, that are comprised of an "under" name (internal name
0032     // of our Key object) and an "over" name (the overlay to be used instead).
0033     // The intention I presume is to label keys this way. Alas, this seems
0034     // useless to us because that'd ignore key mapping. Our dynamic key cap
0035     // resolution should be yielding more useful cap data than these overlays.
0036     // Because of this we do not actually set our caps to the overlays and ignore
0037     // them entirely.
0038 }