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.
15 class CWindowTranslator
19 * \brief Get a list of all known window names
21 static void GetWindows(std::vector
<std::string
>& windowList
);
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
);
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
);
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
);
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
);
52 const char* windowName
;
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
;