feat(display)!: Add libdisplaydevice dependency and output name mapping (#2894)

This commit is contained in:
Lukas Senionis
2024-12-11 21:17:44 +02:00
committed by GitHub
parent 0cc98f113e
commit 1543f584ab
20 changed files with 327 additions and 101 deletions

39
src/display_device.h Normal file
View File

@@ -0,0 +1,39 @@
/**
* @file src/display_device.h
* @brief Declarations for display device handling.
*/
#pragma once
// lib includes
#include <memory>
// forward declarations
namespace platf {
class deinit_t;
} // namespace platf
namespace display_device {
/**
* @brief Initialize the implementation and perform the initial state recovery (if needed).
* @returns A deinit_t instance that performs cleanup when destroyed.
*
* @examples
* const auto init_guard { display_device::init() };
* @examples_end
*/
std::unique_ptr<platf::deinit_t>
init();
/**
* @brief Map the output name to a specific display.
* @param output_name The user-configurable output name.
* @returns Mapped display name or empty string if the output name could not be mapped.
*
* @examples
* const auto mapped_name_config { map_output_name(config::video.output_name) };
* const auto mapped_name_custom { map_output_name("{some-device-id}") };
* @examples_end
*/
std::string
map_output_name(const std::string &output_name);
} // namespace display_device