diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Image.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2 kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Image.h')
| -rw-r--r-- | xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Image.h | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Image.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Image.h new file mode 100644 index 0000000..9dc493e --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Image.h | |||
| @@ -0,0 +1,112 @@ | |||
| 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 "../../c-api/gui/controls/image.h" | ||
| 12 | #include "../Window.h" | ||
| 13 | |||
| 14 | #ifdef __cplusplus | ||
| 15 | |||
| 16 | namespace kodi | ||
| 17 | { | ||
| 18 | namespace gui | ||
| 19 | { | ||
| 20 | namespace controls | ||
| 21 | { | ||
| 22 | |||
| 23 | //============================================================================ | ||
| 24 | /// @defgroup cpp_kodi_gui_windows_controls_CImage Control Image | ||
| 25 | /// @ingroup cpp_kodi_gui_windows_controls | ||
| 26 | /// @brief @cpp_class{ kodi::gui::controls::CImage } | ||
| 27 | /// **Window control used to show an image.**\n | ||
| 28 | /// The image control is used for displaying images in Kodi. You can choose | ||
| 29 | /// the position, size, transparency and contents of the image to be displayed. | ||
| 30 | /// | ||
| 31 | /// It has the header @ref Image.h "#include <kodi/gui/controls/Image.h>" | ||
| 32 | /// be included to enjoy it. | ||
| 33 | /// | ||
| 34 | /// Here you find the needed skin part for a @ref Image_Control "image control". | ||
| 35 | /// | ||
| 36 | /// @note The call of the control is only possible from the corresponding | ||
| 37 | /// window as its class and identification number is required. | ||
| 38 | /// | ||
| 39 | class ATTRIBUTE_HIDDEN CImage : public CAddonGUIControlBase | ||
| 40 | { | ||
| 41 | public: | ||
| 42 | //========================================================================== | ||
| 43 | /// @ingroup cpp_kodi_gui_windows_controls_CImage | ||
| 44 | /// @brief Construct a new control. | ||
| 45 | /// | ||
| 46 | /// @param[in] window Related window control class | ||
| 47 | /// @param[in] controlId Used skin xml control id | ||
| 48 | /// | ||
| 49 | CImage(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 50 | { | ||
| 51 | m_controlHandle = m_interface->kodi_gui->window->get_control_image( | ||
| 52 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 53 | if (!m_controlHandle) | ||
| 54 | kodi::Log(ADDON_LOG_FATAL, | ||
| 55 | "kodi::gui::controls::CImage can't create control class from Kodi !!!"); | ||
| 56 | } | ||
| 57 | //-------------------------------------------------------------------------- | ||
| 58 | |||
| 59 | //========================================================================== | ||
| 60 | /// @ingroup cpp_kodi_gui_windows_controls_CImage | ||
| 61 | /// @brief Destructor. | ||
| 62 | /// | ||
| 63 | ~CImage() override = default; | ||
| 64 | //-------------------------------------------------------------------------- | ||
| 65 | |||
| 66 | //========================================================================== | ||
| 67 | /// @ingroup cpp_kodi_gui_windows_controls_CImage | ||
| 68 | /// @brief Set the control on window to visible. | ||
| 69 | /// | ||
| 70 | /// @param[in] visible If true visible, otherwise hidden | ||
| 71 | /// | ||
| 72 | void SetVisible(bool visible) | ||
| 73 | { | ||
| 74 | m_interface->kodi_gui->control_image->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 75 | visible); | ||
| 76 | } | ||
| 77 | //-------------------------------------------------------------------------- | ||
| 78 | |||
| 79 | //========================================================================== | ||
| 80 | /// @ingroup cpp_kodi_gui_windows_controls_CImage | ||
| 81 | /// @brief To set the filename used on image control. | ||
| 82 | /// | ||
| 83 | /// @param[in] filename Image file to use | ||
| 84 | /// @param[in] useCache To define storage of image, default is in cache, if | ||
| 85 | /// false becomes it loaded always on changes again | ||
| 86 | /// | ||
| 87 | void SetFileName(const std::string& filename, bool useCache = true) | ||
| 88 | { | ||
| 89 | m_interface->kodi_gui->control_image->set_filename(m_interface->kodiBase, m_controlHandle, | ||
| 90 | filename.c_str(), useCache); | ||
| 91 | } | ||
| 92 | //-------------------------------------------------------------------------- | ||
| 93 | |||
| 94 | //========================================================================== | ||
| 95 | /// @ingroup cpp_kodi_gui_windows_controls_CImage | ||
| 96 | /// @brief To set set the diffuse color on image. | ||
| 97 | /// | ||
| 98 | /// @param[in] colorDiffuse Color to use for diffuse | ||
| 99 | /// | ||
| 100 | void SetColorDiffuse(uint32_t colorDiffuse) | ||
| 101 | { | ||
| 102 | m_interface->kodi_gui->control_image->set_color_diffuse(m_interface->kodiBase, m_controlHandle, | ||
| 103 | colorDiffuse); | ||
| 104 | } | ||
| 105 | //-------------------------------------------------------------------------- | ||
| 106 | }; | ||
| 107 | |||
| 108 | } /* namespace controls */ | ||
| 109 | } /* namespace gui */ | ||
| 110 | } /* namespace kodi */ | ||
| 111 | |||
| 112 | #endif /* __cplusplus */ | ||
