diff options
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/gui/General.h')
| -rw-r--r-- | xbmc/addons/kodi-dev-kit/include/kodi/gui/General.h | 176 |
1 files changed, 176 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/General.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/General.h new file mode 100644 index 0000000..85ba3f2 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/General.h | |||
| @@ -0,0 +1,176 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "../AddonBase.h" | ||
| 12 | #include "../c-api/gui/general.h" | ||
| 13 | |||
| 14 | #ifdef __cplusplus | ||
| 15 | |||
| 16 | namespace kodi | ||
| 17 | { | ||
| 18 | namespace gui | ||
| 19 | { | ||
| 20 | |||
| 21 | //============================================================================== | ||
| 22 | /// @addtogroup cpp_kodi_gui_general | ||
| 23 | /// Permits the use of the required functions of the add-on to Kodi. | ||
| 24 | /// | ||
| 25 | /// These are pure functions them no other initialization need. | ||
| 26 | /// | ||
| 27 | /// It has the header @ref kodi/gui/General.h "#include <kodi/gui/General.h>" be included | ||
| 28 | /// to enjoy it. | ||
| 29 | /// | ||
| 30 | |||
| 31 | //============================================================================== | ||
| 32 | /// @ingroup cpp_kodi_gui_general | ||
| 33 | /// @brief Performs a graphical lock of rendering engine. | ||
| 34 | /// | ||
| 35 | inline void ATTRIBUTE_HIDDEN Lock() | ||
| 36 | { | ||
| 37 | using namespace ::kodi::addon; | ||
| 38 | CAddonBase::m_interface->toKodi->kodi_gui->general->lock(); | ||
| 39 | } | ||
| 40 | //------------------------------------------------------------------------------ | ||
| 41 | |||
| 42 | //============================================================================== | ||
| 43 | /// @ingroup cpp_kodi_gui_general | ||
| 44 | /// @brief Performs a graphical unlock of previous locked rendering engine. | ||
| 45 | /// | ||
| 46 | inline void ATTRIBUTE_HIDDEN Unlock() | ||
| 47 | { | ||
| 48 | using namespace ::kodi::addon; | ||
| 49 | CAddonBase::m_interface->toKodi->kodi_gui->general->unlock(); | ||
| 50 | } | ||
| 51 | //------------------------------------------------------------------------------ | ||
| 52 | |||
| 53 | //============================================================================== | ||
| 54 | /// @ingroup cpp_kodi_gui_general | ||
| 55 | /// @brief Return the the current screen height with pixel. | ||
| 56 | /// | ||
| 57 | /// @return Screen height with pixel | ||
| 58 | /// | ||
| 59 | inline int ATTRIBUTE_HIDDEN GetScreenHeight() | ||
| 60 | { | ||
| 61 | using namespace ::kodi::addon; | ||
| 62 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_screen_height( | ||
| 63 | CAddonBase::m_interface->toKodi->kodiBase); | ||
| 64 | } | ||
| 65 | //------------------------------------------------------------------------------ | ||
| 66 | |||
| 67 | //============================================================================== | ||
| 68 | /// @ingroup cpp_kodi_gui_general | ||
| 69 | /// @brief Return the the current screen width with pixel. | ||
| 70 | /// | ||
| 71 | /// @return Screen width with pixel | ||
| 72 | /// | ||
| 73 | inline int ATTRIBUTE_HIDDEN GetScreenWidth() | ||
| 74 | { | ||
| 75 | using namespace ::kodi::addon; | ||
| 76 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_screen_width( | ||
| 77 | CAddonBase::m_interface->toKodi->kodiBase); | ||
| 78 | } | ||
| 79 | //------------------------------------------------------------------------------ | ||
| 80 | |||
| 81 | //============================================================================== | ||
| 82 | /// @ingroup cpp_kodi_gui_general | ||
| 83 | /// @brief Return the the current screen rendering resolution. | ||
| 84 | /// | ||
| 85 | /// @return Current screen rendering resolution | ||
| 86 | /// | ||
| 87 | inline int ATTRIBUTE_HIDDEN GetVideoResolution() | ||
| 88 | { | ||
| 89 | using namespace ::kodi::addon; | ||
| 90 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_video_resolution( | ||
| 91 | CAddonBase::m_interface->toKodi->kodiBase); | ||
| 92 | } | ||
| 93 | //------------------------------------------------------------------------------ | ||
| 94 | |||
| 95 | //============================================================================== | ||
| 96 | /// @ingroup cpp_kodi_gui_general | ||
| 97 | /// @brief Returns the id for the current 'active' dialog as an integer. | ||
| 98 | /// | ||
| 99 | /// @return The currently active dialog Id | ||
| 100 | /// | ||
| 101 | /// | ||
| 102 | ///------------------------------------------------------------------------- | ||
| 103 | /// | ||
| 104 | /// **Example:** | ||
| 105 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 106 | /// .. | ||
| 107 | /// int wid = kodi::gui::GetCurrentWindowDialogId(); | ||
| 108 | /// .. | ||
| 109 | /// ~~~~~~~~~~~~~ | ||
| 110 | /// | ||
| 111 | inline int ATTRIBUTE_HIDDEN GetCurrentWindowDialogId() | ||
| 112 | { | ||
| 113 | using namespace ::kodi::addon; | ||
| 114 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_current_window_dialog_id( | ||
| 115 | CAddonBase::m_interface->toKodi->kodiBase); | ||
| 116 | } | ||
| 117 | //------------------------------------------------------------------------------ | ||
| 118 | |||
| 119 | //============================================================================== | ||
| 120 | /// @ingroup cpp_kodi_gui_general | ||
| 121 | /// @brief Returns the id for the current 'active' window as an integer. | ||
| 122 | /// | ||
| 123 | /// @return The currently active window Id | ||
| 124 | /// | ||
| 125 | /// | ||
| 126 | ///------------------------------------------------------------------------- | ||
| 127 | /// | ||
| 128 | /// **Example:** | ||
| 129 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 130 | /// .. | ||
| 131 | /// int wid = kodi::gui::GetCurrentWindowId(); | ||
| 132 | /// .. | ||
| 133 | /// ~~~~~~~~~~~~~ | ||
| 134 | /// | ||
| 135 | inline int ATTRIBUTE_HIDDEN GetCurrentWindowId() | ||
| 136 | { | ||
| 137 | using namespace ::kodi::addon; | ||
| 138 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_current_window_id( | ||
| 139 | CAddonBase::m_interface->toKodi->kodiBase); | ||
| 140 | } | ||
| 141 | //------------------------------------------------------------------------------ | ||
| 142 | |||
| 143 | //============================================================================== | ||
| 144 | /// @ingroup cpp_kodi_gui_general | ||
| 145 | /// @brief To get hardware specific device context interface. | ||
| 146 | /// | ||
| 147 | /// @return A pointer to the used device with @ref cpp_kodi_Defs_HardwareContext "kodi::HardwareContext" | ||
| 148 | /// | ||
| 149 | /// @warning This function is only be supported under Windows, on all other | ||
| 150 | /// OS it return `nullptr`! | ||
| 151 | /// | ||
| 152 | /// @note Returned Windows class pointer is `ID3D11DeviceContext1`. | ||
| 153 | /// | ||
| 154 | /// | ||
| 155 | ///------------------------------------------------------------------------- | ||
| 156 | /// | ||
| 157 | /// **Example:** | ||
| 158 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 159 | /// #include <d3d11_1.h> | ||
| 160 | /// .. | ||
| 161 | /// ID3D11DeviceContext1* context = static_cast<ID3D11DeviceContext1*>(kodi::gui::GetHWContext()); | ||
| 162 | /// .. | ||
| 163 | /// ~~~~~~~~~~~~~ | ||
| 164 | /// | ||
| 165 | inline kodi::HardwareContext GetHWContext() | ||
| 166 | { | ||
| 167 | using namespace ::kodi::addon; | ||
| 168 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_hw_context( | ||
| 169 | CAddonBase::m_interface->toKodi->kodiBase); | ||
| 170 | } | ||
| 171 | //------------------------------------------------------------------------------ | ||
| 172 | |||
| 173 | } /* namespace gui */ | ||
| 174 | } /* namespace kodi */ | ||
| 175 | |||
| 176 | #endif /* __cplusplus */ | ||
