Nicer structure

This commit is contained in:
2026-10-17 02:57:21 +02:00
parent 99146577d4
commit 335a4674d1
10 changed files with 767 additions and 317 deletions

24
src/mappings.h Normal file
View File

@@ -0,0 +1,24 @@
// gKeyMapper - reading and writing the mappings configuration file.
#ifndef GKEYMAPPER_MAPPINGS_H
#define GKEYMAPPER_MAPPINGS_H
#include <string>
#include <vector>
#include "keyrow.h"
namespace gkeymapper {
// Default config file: ~/.config/gKeyMapper/mappings.conf.
std::string default_config_path();
// Writes all rows as "G1=type:target" lines. Returns false on I/O error.
bool write_mappings(const std::string& path, const std::vector<KeyRow>& rows);
// Loads mappings from path into the rows' widgets. Missing/invalid lines are
// skipped; a missing file is reported and otherwise ignored.
void read_mappings(const std::string& path, const std::vector<KeyRow>& rows);
} // namespace gkeymapper
#endif // GKEYMAPPER_MAPPINGS_H