[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / input / WindowTranslator.h
blob56437bb71ff3b2c04bf84062d4813e742e45a086
1 /*
2 * Copyright (C) 2017-2024 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <set>
12 #include <string>
13 #include <vector>
15 class CWindowTranslator
17 public:
18 /*!
19 * \brief Get a list of all known window names
21 static void GetWindows(std::vector<std::string>& windowList);
23 /*!
24 * \brief Translate between a window name and its ID
25 * \param window The name of the window
26 * \return ID of the window, or WINDOW_INVALID if not found
28 static int TranslateWindow(const std::string& window);
30 /*!
31 * \brief Translate between a window id and it's name
32 * \param window id of the window
33 * \return name of the window, or an empty string if not found
35 static std::string TranslateWindow(int windowId);
37 /*!
38 * \brief Get the window ID that should be used as fallback for keymap input
39 * \return The fallback window, or -1 for no fallback window
41 static int GetFallbackWindow(int windowId);
43 /*!
44 * \brief Get the special window ID if conditions met
45 * \return The special window ID or the given window ID
47 static int GetVirtualWindow(int windowId);
49 private:
50 struct WindowMapItem
52 const char* windowName;
53 int windowId;
56 struct WindowNameCompare
58 bool operator()(const WindowMapItem& lhs, const WindowMapItem& rhs) const;
61 struct WindowIDCompare
63 bool operator()(const WindowMapItem& lhs, const WindowMapItem& rhs) const;
66 using WindowMapByName = std::set<WindowMapItem, WindowNameCompare>;
67 using WindowMapByID = std::set<WindowMapItem, WindowIDCompare>;
69 static WindowMapByID CreateWindowMappingByID();
71 static const WindowMapByName WindowMappingByName;