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