diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h new file mode 100644 index 0000000..f1df60d --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h | |||
| @@ -0,0 +1,156 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2017 Team KODI | ||
| 4 | * http://kodi.tv | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with KODI; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "../AddonBase.h" | ||
| 23 | #include "definitions.h" | ||
| 24 | |||
| 25 | namespace kodi | ||
| 26 | { | ||
| 27 | namespace gui | ||
| 28 | { | ||
| 29 | |||
| 30 | //============================================================================ | ||
| 31 | /// | ||
| 32 | // \defgroup cpp_kodi_gui ::general | ||
| 33 | /// \addtogroup cpp_kodi_gui | ||
| 34 | /// @{ | ||
| 35 | /// @brief **Allow use of binary classes and function to use on add-on's** | ||
| 36 | /// | ||
| 37 | /// Permits the use of the required functions of the add-on to Kodi. This class | ||
| 38 | /// also contains some functions to the control. | ||
| 39 | /// | ||
| 40 | /// These are pure functions them no other initialization need. | ||
| 41 | /// | ||
| 42 | /// It has the header \ref kodi/gui/General.h "#include <kodi/gui/General.h>" be included | ||
| 43 | /// to enjoy it. | ||
| 44 | /// | ||
| 45 | |||
| 46 | //========================================================================== | ||
| 47 | /// | ||
| 48 | /// \ingroup cpp_kodi_gui | ||
| 49 | /// @brief Performs a graphical lock of rendering engine | ||
| 50 | /// | ||
| 51 | inline void Lock() | ||
| 52 | { | ||
| 53 | using namespace ::kodi::addon; | ||
| 54 | CAddonBase::m_interface->toKodi->kodi_gui->general->lock(); | ||
| 55 | } | ||
| 56 | |||
| 57 | //-------------------------------------------------------------------------- | ||
| 58 | |||
| 59 | //========================================================================== | ||
| 60 | /// | ||
| 61 | /// \ingroup cpp_kodi_gui | ||
| 62 | /// @brief Performs a graphical unlock of previous locked rendering engine | ||
| 63 | /// | ||
| 64 | inline void Unlock() | ||
| 65 | { | ||
| 66 | using namespace ::kodi::addon; | ||
| 67 | CAddonBase::m_interface->toKodi->kodi_gui->general->unlock(); | ||
| 68 | } | ||
| 69 | //-------------------------------------------------------------------------- | ||
| 70 | |||
| 71 | //========================================================================== | ||
| 72 | /// | ||
| 73 | /// \ingroup cpp_kodi_gui | ||
| 74 | /// @brief Return the the current screen height with pixel | ||
| 75 | /// | ||
| 76 | inline int GetScreenHeight() | ||
| 77 | { | ||
| 78 | using namespace ::kodi::addon; | ||
| 79 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_screen_height(CAddonBase::m_interface->toKodi->kodiBase); | ||
| 80 | } | ||
| 81 | //-------------------------------------------------------------------------- | ||
| 82 | |||
| 83 | //========================================================================== | ||
| 84 | /// | ||
| 85 | /// \ingroup cpp_kodi_gui | ||
| 86 | /// @brief Return the the current screen width with pixel | ||
| 87 | /// | ||
| 88 | inline int GetScreenWidth() | ||
| 89 | { | ||
| 90 | using namespace ::kodi::addon; | ||
| 91 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_screen_width(CAddonBase::m_interface->toKodi->kodiBase); | ||
| 92 | } | ||
| 93 | //-------------------------------------------------------------------------- | ||
| 94 | |||
| 95 | //========================================================================== | ||
| 96 | /// | ||
| 97 | /// \ingroup cpp_kodi_gui | ||
| 98 | /// @brief Return the the current screen rendering resolution | ||
| 99 | /// | ||
| 100 | inline int GetVideoResolution() | ||
| 101 | { | ||
| 102 | using namespace ::kodi::addon; | ||
| 103 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_video_resolution(CAddonBase::m_interface->toKodi->kodiBase); | ||
| 104 | } | ||
| 105 | //-------------------------------------------------------------------------- | ||
| 106 | |||
| 107 | //========================================================================== | ||
| 108 | /// | ||
| 109 | /// \ingroup cpp_kodi_gui | ||
| 110 | /// @brief Returns the id for the current 'active' dialog as an integer. | ||
| 111 | /// | ||
| 112 | /// @return The currently active dialog Id | ||
| 113 | /// | ||
| 114 | /// | ||
| 115 | ///------------------------------------------------------------------------- | ||
| 116 | /// | ||
| 117 | /// **Example:** | ||
| 118 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 119 | /// .. | ||
| 120 | /// int wid = kodi::gui::GetCurrentWindowDialogId() | ||
| 121 | /// .. | ||
| 122 | /// ~~~~~~~~~~~~~ | ||
| 123 | /// | ||
| 124 | inline int GetCurrentWindowDialogId() | ||
| 125 | { | ||
| 126 | using namespace ::kodi::addon; | ||
| 127 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_current_window_dialog_id(CAddonBase::m_interface->toKodi->kodiBase); | ||
| 128 | } | ||
| 129 | //-------------------------------------------------------------------------- | ||
| 130 | |||
| 131 | //========================================================================== | ||
| 132 | /// | ||
| 133 | /// \ingroup cpp_kodi_gui | ||
| 134 | /// @brief Returns the id for the current 'active' window as an integer. | ||
| 135 | /// | ||
| 136 | /// @return The currently active window Id | ||
| 137 | /// | ||
| 138 | /// | ||
| 139 | ///------------------------------------------------------------------------- | ||
| 140 | /// | ||
| 141 | /// **Example:** | ||
| 142 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 143 | /// .. | ||
| 144 | /// int wid = kodi::gui::GetCurrentWindowId() | ||
| 145 | /// .. | ||
| 146 | /// ~~~~~~~~~~~~~ | ||
| 147 | /// | ||
| 148 | inline int GetCurrentWindowId() | ||
| 149 | { | ||
| 150 | using namespace ::kodi::addon; | ||
| 151 | return CAddonBase::m_interface->toKodi->kodi_gui->general->get_current_window_id(CAddonBase::m_interface->toKodi->kodiBase); | ||
| 152 | } | ||
| 153 | //-------------------------------------------------------------------------- | ||
| 154 | |||
| 155 | } /* namespace gui */ | ||
| 156 | } /* namespace kodi */ | ||
