[guilib] fix labelcontrols with auto width always being marked as dirty if they speci...
[vuplus_xbmc] / xbmc / guilib / GUIListItemLayout.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #include "GUIListGroup.h"
24 #include "GUITexture.h"
25 #include "GUIInfoTypes.h"
26
27 class CGUIListItem;
28 class CFileItem;
29 class CLabelInfo;
30
31 class CGUIListItemLayout
32 {
33 public:
34   CGUIListItemLayout();
35   CGUIListItemLayout(const CGUIListItemLayout &from);
36   virtual ~CGUIListItemLayout();
37   void LoadLayout(TiXmlElement *layout, int context, bool focused);
38   void Process(CGUIListItem *item, int parentID, unsigned int currentTime, CDirtyRegionList &dirtyregions);
39   void Render(CGUIListItem *item, int parentID);
40   float Size(ORIENTATION orientation) const;
41   unsigned int GetFocusedItem() const;
42   void SetFocusedItem(unsigned int focus);
43   bool IsAnimating(ANIMATION_TYPE animType);
44   void ResetAnimation(ANIMATION_TYPE animType);
45   void SetInvalid() { m_invalidated = true; };
46   void FreeResources(bool immediately = false);
47
48 //#ifdef PRE_SKIN_VERSION_9_10_COMPATIBILITY
49   void CreateListControlLayouts(float width, float height, bool focused, const CLabelInfo &labelInfo, const CLabelInfo &labelInfo2, const CTextureInfo &texture, const CTextureInfo &textureFocus, float texHeight, float iconWidth, float iconHeight, const CStdString &nofocusCondition, const CStdString &focusCondition);
50 //#endif
51
52   void SetWidth(float width);
53   void SetHeight(float height);
54   void SelectItemFromPoint(const CPoint &point);
55   bool MoveLeft();
56   bool MoveRight();
57
58 #ifdef _DEBUG
59   virtual void DumpTextureUse();
60 #endif
61   bool CheckCondition();
62 protected:
63   void LoadControl(TiXmlElement *child, CGUIControlGroup *group);
64   void Update(CFileItem *item);
65
66   CGUIListGroup m_group;
67
68   float m_width;
69   float m_height;
70   bool m_focused;
71   bool m_invalidated;
72
73   INFO::InfoPtr m_condition;
74   CGUIInfoBool m_isPlaying;
75 };
76