Merge pull request #26386 from ksooo/guiinfo-fix-listitem-filenamenoextension
[xbmc.git] / xbmc / guilib / GUIResizeControl.h
blob457c6c3260c210f48c4ec53265c470376c23da3b
1 /*
2 * Copyright (C) 2005-2018 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.
7 */
9 #pragma once
11 /*!
12 \file GUIRESIZEControl.h
13 \brief
16 #include "GUIControl.h"
17 #include "GUITexture.h"
18 #include "utils/MovingSpeed.h"
20 /*!
21 \ingroup controls
22 \brief
24 class CGUIResizeControl : public CGUIControl
26 public:
27 CGUIResizeControl(int parentID,
28 int controlID,
29 float posX,
30 float posY,
31 float width,
32 float height,
33 const CTextureInfo& textureFocus,
34 const CTextureInfo& textureNoFocus,
35 KODI::UTILS::MOVING_SPEED::MapEventConfig& movingSpeedCfg);
37 ~CGUIResizeControl() override = default;
38 CGUIResizeControl* Clone() const override { return new CGUIResizeControl(*this); }
40 void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
41 void Render() override;
42 bool OnAction(const CAction &action) override;
43 void OnUp() override;
44 void OnDown() override;
45 void OnLeft() override;
46 void OnRight() override;
47 void AllocResources() override;
48 void FreeResources(bool immediately = false) override;
49 void DynamicResourceAlloc(bool bOnOff) override;
50 void SetInvalid() override;
51 void SetPosition(float posX, float posY) override;
52 void SetLimits(float x1, float y1, float x2, float y2);
53 bool CanFocus() const override { return true; }
55 protected:
56 EVENT_RESULT OnMouseEvent(const CPoint& point, const KODI::MOUSE::CMouseEvent& event) override;
57 bool UpdateColors(const CGUIListItem* item) override;
58 bool SetAlpha(unsigned char alpha);
59 void Resize(float x, float y);
60 std::unique_ptr<CGUITexture> m_imgFocus;
61 std::unique_ptr<CGUITexture> m_imgNoFocus;
62 unsigned int m_frameCounter;
63 KODI::UTILS::MOVING_SPEED::CMovingSpeed m_movingSpeed;
64 float m_fAnalogSpeed;
65 float m_x1, m_x2, m_y1, m_y2;
67 private:
68 CGUIResizeControl(const CGUIResizeControl& control);