tests/data/i3_messages.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* \author Hantz Vius | ||
| 2 | * | ||
| 3 | * \copyright Copyright (C) 2019-2025 Hantz Vius | ||
| 4 | * | ||
| 5 | * \license{ | ||
| 6 | * This file is part of qi3pc. | ||
| 7 | * | ||
| 8 | * qi3pc is free software: you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU Affero General Public License as published by | ||
| 10 | * the Free Software Foundation, either version 3 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU Affero General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU Affero General Public License | ||
| 19 | * along with this program. If not, see <https://www.gnu.org/licenses/>.} | ||
| 20 | */ | ||
| 21 | |||
| 22 | #pragma once | ||
| 23 | |||
| 24 | #include <QJsonObject> | ||
| 25 | |||
| 26 | #include "workspaces.h" | ||
| 27 | #include "outputs.h" | ||
| 28 | #include "bindingModes.h" | ||
| 29 | #include "marks.h" | ||
| 30 | #include "tree.h" | ||
| 31 | #include "version.h" | ||
| 32 | #include "bindingState.h" | ||
| 33 | #include "barConfigs.h" | ||
| 34 | #include "config.h" | ||
| 35 | #include "command.h" | ||
| 36 | |||
| 37 | namespace test_qi3pc{ | ||
| 38 | namespace data { | ||
| 39 | struct i3messages { | ||
| 40 | inline static auto workspaces = test_qi3pc::raw::data::workspaces; | ||
| 41 | inline static auto outputs = test_qi3pc::raw::data::outputs; | ||
| 42 | inline static auto bindingModes = test_qi3pc::raw::data::bindingModes; | ||
| 43 | inline static auto marks = test_qi3pc::raw::data::marks; | ||
| 44 | inline static auto tree = test_qi3pc::raw::data::tree; | ||
| 45 | inline static auto version = test_qi3pc::raw::data::version; | ||
| 46 | inline static auto bindingState = test_qi3pc::raw::data::bindingState; | ||
| 47 | inline static auto parsedBindingState = test_qi3pc::raw::data::parsedBindingState; | ||
| 48 | inline static auto barConfigs = test_qi3pc::raw::data::barConfigs; | ||
| 49 | inline static auto config = test_qi3pc::raw::data::config; | ||
| 50 | |||
| 51 | using Command = test_qi3pc::raw::data::Command; | ||
| 52 | inline static auto commands = test_qi3pc::raw::data::commands; | ||
| 53 | |||
| 54 | 10 | inline static QByteArray barIds() { | |
| 55 | 10 | auto begin = barConfigs.constBegin(); | |
| 56 | 10 | auto end = barConfigs.constEnd(); | |
| 57 | 10 | QJsonArray array; | |
| 58 | 20 | for (auto it = begin; it != end; ++it) { | |
| 59 | 10 | array.append(it.key()); | |
| 60 | } | ||
| 61 | |||
| 62 | 20 | return QJsonDocument(array).toJson(QJsonDocument::Compact); | |
| 63 | 10 | } | |
| 64 | |||
| 65 | 5 | inline static QJsonObject barConfig(const QString& id) { | |
| 66 | 5 | return QJsonDocument::fromJson(barConfigs[id]).object(); | |
| 67 | } | ||
| 68 | }; | ||
| 69 | } // namespace data | ||
| 70 | } // namespace test_qi3pc | ||
| 71 |