11 #include "guilib/DirtyRegion.h" 13 #include "guilib/GUIListItemLayout.h" 14 #include "guilib/GUITexture.h" 15 #include "guilib/IGUIContainer.h" 16 #include "threads/CriticalSection.h" 17 #include "utils/Geometry.h" 33 class CPVRChannelGroupMember;
34 class CPVRChannelNumber;
36 class CGUIEPGGridContainerModel;
41 CGUIEPGGridContainer(
int parentID,
int controlID,
float posX,
float posY,
float width,
float height,
42 ORIENTATION orientation,
int scrollTime,
int preloadItems,
int minutesPerPage,
43 int rulerUnit,
const CTextureInfo& progressIndicatorTexture);
54 void AllocResources()
override;
55 void FreeResources(
bool immediately)
override;
57 bool OnAction(
const CAction& action)
override;
58 void OnDown()
override;
60 void OnLeft()
override;
61 void OnRight()
override;
64 void SetFocus(
bool focus)
override;
65 std::string GetDescription()
const override;
68 void Process(
unsigned int currentTime, CDirtyRegionList& dirtyregions)
override;
69 void Render()
override;
71 CGUIListItemPtr GetListItem(
int offset,
unsigned int flag = 0)
const override;
72 std::string GetLabel(
int info)
const override;
74 std::shared_ptr<CFileItem> GetSelectedGridItem(
int offset = 0)
const;
75 std::shared_ptr<CPVRChannelGroupMember> GetSelectedChannelGroupMember()
const;
78 void LoadLayout(TiXmlElement* layout);
79 void SetPageControl(
int id);
96 void GoToFirstChannel();
97 void GoToLastChannel();
102 void GoToMostRight();
104 void SetTimelineItems(
const std::unique_ptr<CFileItemList>& items,
108 std::unique_ptr<CFileItemList> GetCurrentTimeLineItems()
const;
115 bool SetChannel(
const std::shared_ptr<CPVRChannel>& channel);
132 bool OnClick(
int actionID);
133 bool SelectItemFromPoint(
const CPoint& point,
bool justGrid =
true);
137 void SetBlock(
int block,
bool bUpdateBlockTravelAxis =
true);
138 void UpdateBlock(
bool bUpdateBlockTravelAxis =
true);
140 void ChannelScroll(
int amount);
141 void ProgrammesScroll(
int amount);
142 void ValidateOffset();
145 void SetItem(
const std::pair<std::shared_ptr<CFileItem>,
int>& itemInfo);
146 bool SetItem(
const std::shared_ptr<CFileItem>& item,
int channelIndex,
int blockIndex);
147 std::shared_ptr<CFileItem> GetItem()
const;
148 std::pair<std::shared_ptr<CFileItem>,
int> GetNextItem()
const;
149 std::pair<std::shared_ptr<CFileItem>,
int> GetPrevItem()
const;
152 void MoveToRow(
int row);
156 void ScrollToBlockOffset(
int offset);
157 void ScrollToChannelOffset(
int offset);
158 void GoToBlock(
int blockIndex);
159 void GoToChannel(
int channelIndex);
160 void UpdateScrollOffset(
unsigned int currentTime);
161 void ProcessItem(
float posX,
float posY,
const std::shared_ptr<CFileItem>& item, std::shared_ptr<CFileItem>& lastitem,
bool focused,
CGUIListItemLayout* normallayout,
CGUIListItemLayout* focusedlayout,
unsigned int currentTime, CDirtyRegionList& dirtyregions,
float resize = -1.0f);
162 void RenderItem(
float posX,
float posY,
CGUIListItem* item,
bool focused);
163 void GetCurrentLayouts();
165 void ProcessChannels(
unsigned int currentTime, CDirtyRegionList& dirtyregions);
166 void ProcessRuler(
unsigned int currentTime, CDirtyRegionList& dirtyregions);
167 void ProcessRulerDate(
unsigned int currentTime, CDirtyRegionList& dirtyregions);
168 void ProcessProgrammeGrid(
unsigned int currentTime, CDirtyRegionList& dirtyregions);
169 void ProcessProgressIndicator(
unsigned int currentTime, CDirtyRegionList& dirtyregions);
170 void RenderChannels();
171 void RenderRulerDate();
173 void RenderProgrammeGrid();
174 void RenderProgressIndicator();
178 ORIENTATION m_orientation;
180 std::vector<CGUIListItemLayout> m_channelLayouts;
181 std::vector<CGUIListItemLayout> m_focusedChannelLayouts;
182 std::vector<CGUIListItemLayout> m_focusedProgrammeLayouts;
183 std::vector<CGUIListItemLayout> m_programmeLayouts;
184 std::vector<CGUIListItemLayout> m_rulerLayouts;
185 std::vector<CGUIListItemLayout> m_rulerDateLayouts;
196 void GetChannelCacheOffsets(
int& cacheBefore,
int& cacheAfter);
197 void GetProgrammeCacheOffsets(
int& cacheBefore,
int& cacheAfter);
200 bool OnMouseClick(
int dwButton,
const CPoint& point);
201 bool OnMouseDoubleClick(
int dwButton,
const CPoint& point);
202 bool OnMouseWheel(
char wheel,
const CPoint& point);
204 void HandleChannels(
bool bRender,
unsigned int currentTime, CDirtyRegionList& dirtyregions);
205 void HandleRuler(
bool bRender,
unsigned int currentTime, CDirtyRegionList& dirtyregions);
206 void HandleRulerDate(
bool bRender,
unsigned int currentTime, CDirtyRegionList& dirtyregions);
207 void HandleProgrammeGrid(
bool bRender,
unsigned int currentTime, CDirtyRegionList& dirtyregions);
209 float GetCurrentTimePositionOnPage()
const;
210 float GetProgressIndicatorWidth()
const;
211 float GetProgressIndicatorHeight()
const;
215 float GetChannelScrollOffsetPos()
const;
216 float GetProgrammeScrollOffsetPos()
const;
218 int GetProgrammeScrollOffset()
const;
221 int m_channelsPerPage;
222 int m_programmesPerPage;
228 int m_blockTravelAxis;
229 int m_cacheChannelItems;
230 int m_cacheProgrammeItems;
231 int m_cacheRulerItems;
233 float m_rulerDateHeight;
234 float m_rulerDateWidth;
241 float m_channelHeight;
242 float m_channelWidth;
248 float m_analogScrollCount;
250 std::unique_ptr<CGUITexture> m_guiProgressIndicatorTexture;
252 std::shared_ptr<CFileItem> m_lastItem;
253 std::shared_ptr<CFileItem> m_lastChannel;
255 bool m_bEnableProgrammeScrolling =
true;
256 bool m_bEnableChannelScrolling =
true;
260 int m_programmeScrollLastTime;
261 float m_programmeScrollSpeed;
262 float m_programmeScrollOffset;
264 int m_channelScrollLastTime;
265 float m_channelScrollSpeed;
266 float m_channelScrollOffset;
268 mutable CCriticalSection m_critSection;
269 std::unique_ptr<CGUIEPGGridContainerModel> m_gridModel;
270 std::unique_ptr<CGUIEPGGridContainerModel> m_updatedGridModel;
272 int m_itemStartBlock = 0;
bool HasData() const
Check whether the control currently holds data.
Definition: GUIEPGGridContainer.cpp:169
Definition: GUIListItem.h:30
Definition: ContextMenuManager.h:24
bool SetChannel(const std::shared_ptr< CPVRChannel > &channel)
Set the control's selection to the given channel and set the control's view port to show the channel...
Definition: GUIEPGGridContainer.cpp:1123
void SetRenderOffset(const CPoint &offset)
Set the offset of the first item in the container from the container's position Useful for lists/pane...
Definition: GUIEPGGridContainer.cpp:2084
Represents a list of files.
Definition: FileItem.h:713
Definition: GUIListItemLayout.h:20
Definition: IGUIContainer.h:22
EVENT_RESULT
Results of OnMouseEvent() Any value not equal to EVENT_RESULT_UNHANDLED indicates that the event was ...
Definition: GUIControl.h:60
Definition: GUIEPGGridContainer.h:38
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
bool OnMouseOver(const CPoint &point) override
Called when the mouse is over the control. Default implementation selects the control.
Definition: GUIEPGGridContainer.cpp:1315
Definition: GUITexture.h:51
DateTime class, which uses FileTime as it's base.
Definition: XBDateTime.h:63
Definition: GUIMessage.h:365
Definition: PVRChannelNumber.h:15
EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event) override
Perform a mouse action.
Definition: GUIEPGGridContainer.cpp:1254
Represents a file on a share.
Definition: FileItem.h:102
Simple class for mouse events.
Definition: Key.h:114