16 #include "DirtyRegion.h" 17 #include "VisibleEffect.h" 20 #include "utils/ColorUtils.h" 21 #include "windowing/GraphicContext.h" 39 enum ORIENTATION { HORIZONTAL = 0, VERTICAL };
55 unsigned int nCountTotal;
56 unsigned int nCountVisible;
60 nCountTotal = nCountVisible = 0;
69 EVENT_RESULT_HANDLED = 0x01,
70 EVENT_RESULT_PAN_HORIZONTAL = 0x02,
71 EVENT_RESULT_PAN_VERTICAL = 0x04,
72 EVENT_RESULT_PAN_VERTICAL_WITHOUT_INERTIA = 0x08,
73 EVENT_RESULT_PAN_HORIZONTAL_WITHOUT_INERTIA = 0x10,
74 EVENT_RESULT_ROTATE = 0x20,
75 EVENT_RESULT_ZOOM = 0x40,
76 EVENT_RESULT_SWIPE = 0x80
87 CGUIControl(
int parentID,
int controlID,
float posX,
float posY,
float width,
float height);
92 virtual void DoProcess(
unsigned int currentTime, CDirtyRegionList &dirtyregions);
93 virtual void Process(
unsigned int currentTime, CDirtyRegionList &dirtyregions);
94 virtual void DoRender();
95 virtual void Render() {}
98 virtual void RenderEx() {}
110 virtual bool OnAction(
const CAction &action);
114 virtual void OnDown();
115 virtual void OnLeft();
116 virtual void OnRight();
117 virtual bool OnBack();
118 virtual bool OnInfo();
119 virtual void OnNextControl();
120 virtual void OnPrevControl();
121 virtual void OnFocus() {}
122 virtual void OnUnFocus() {}
148 return EVENT_RESULT_UNHANDLED;
155 virtual void UnfocusFromPoint(
const CPoint &point);
162 virtual bool HitTest(
const CPoint &point)
const;
165 virtual int GetID(
void)
const;
166 virtual void SetID(
int id) { m_controlID = id; }
167 int GetParentID()
const;
168 virtual bool HasFocus()
const;
169 virtual void AllocResources();
170 virtual void FreeResources(
bool immediately =
false);
171 virtual void DynamicResourceAlloc(
bool bOnOff);
172 virtual bool IsDynamicallyAllocated() {
return false; }
173 virtual bool CanFocus()
const;
174 virtual bool IsVisible()
const;
175 bool IsVisibleFromSkin()
const {
return m_visibleFromSkinCondition; }
176 virtual bool IsDisabled()
const;
177 virtual void SetPosition(
float posX,
float posY);
178 virtual void SetHitRect(
const CRect& rect,
const UTILS::COLOR::Color& color);
179 virtual void SetCamera(
const CPoint &camera);
180 virtual void SetStereoFactor(
const float &factor);
182 CPoint GetRenderPosition()
const;
183 virtual float GetXPosition()
const;
184 virtual float GetYPosition()
const;
185 virtual float GetWidth()
const;
186 virtual float GetHeight()
const;
188 void MarkDirtyRegion(
const unsigned int dirtyState = DIRTY_STATE_CONTROL);
189 bool IsControlDirty()
const {
return m_controlDirtyState != 0; }
197 virtual CRect CalcRenderRegion()
const;
204 void SetActions(
const ActionMap &
actions);
213 void SetAction(
int actionID,
const CGUIAction &action,
bool replace =
true);
222 bool Navigate(
int direction)
const;
223 virtual void SetFocus(
bool focus);
224 virtual void SetWidth(
float width);
225 virtual void SetHeight(
float height);
226 virtual void SetVisible(
bool bVisible,
bool setVisState =
false);
227 void SetVisibleCondition(
const std::string &expression,
const std::string &allowHiddenFocus =
"");
228 bool HasVisibleCondition()
const {
return m_visibleCondition != NULL; }
229 void SetEnableCondition(
const std::string &expression);
230 virtual void UpdateVisibility(
const CGUIListItem *item);
231 virtual void SetInitialVisibility();
232 virtual void SetEnabled(
bool bEnable);
233 virtual void SetInvalid() { m_bInvalidated =
true; }
234 virtual void SetPulseOnSelect(
bool pulse) { m_pulseOnSelect = pulse; }
235 virtual std::string GetDescription()
const {
return ""; }
236 virtual std::string GetDescriptionByIndex(
int index)
const {
return ""; }
238 void SetAnimations(
const std::vector<CAnimation> &animations);
239 const std::vector<CAnimation>& GetAnimations()
const {
return m_animations; }
241 virtual void QueueAnimation(ANIMATION_TYPE anim);
242 virtual bool IsAnimating(ANIMATION_TYPE anim);
243 virtual bool HasAnimation(ANIMATION_TYPE anim);
244 CAnimation *GetAnimation(ANIMATION_TYPE type,
bool checkConditions =
true);
245 virtual void ResetAnimation(ANIMATION_TYPE type);
246 virtual void ResetAnimations();
249 virtual void UpdateInfo(
const CGUIListItem* item = NULL) {}
250 virtual void SetPushUpdates(
bool pushUpdates) { m_pushedUpdates = pushUpdates; }
252 virtual bool IsGroup()
const {
return false; }
253 virtual bool IsContainer()
const {
return false; }
254 virtual bool GetCondition(
int condition,
int data)
const {
return false; }
256 void SetParentControl(
CGUIControl* control) { m_parentControl = control; }
257 CGUIControl* GetParentControl(
void)
const {
return m_parentControl; }
258 virtual void SaveStates(std::vector<CControlState> &states);
259 virtual CGUIControl *GetControl(
int id, std::vector<CGUIControl*> *idCollector =
nullptr);
262 void SetControlStats(
GUICONTROLSTATS* controlStats) { m_controlStats = controlStats; }
263 virtual void UpdateControlStats();
270 GUICONTAINER_EPGGRID,
271 GUICONTAINER_FIXEDLIST,
274 GUICONTAINER_WRAPLIST,
275 GUICONTROL_BORDEREDIMAGE,
277 GUICONTROL_COLORBUTTON,
279 GUICONTROL_FADELABEL,
281 GUICONTROL_GAMECONTROLLER,
282 GUICONTROL_GAMECONTROLLERLIST,
284 GUICONTROL_GROUPLIST,
287 GUICONTROL_LISTGROUP,
288 GUICONTROL_LISTLABEL,
290 GUICONTROL_MULTI_IMAGE,
294 GUICONTROL_RENDERADDON,
297 GUICONTROL_SCROLLBAR,
298 GUICONTROL_SETTINGS_SLIDER,
303 GUICONTROL_TOGGLEBUTTON,
305 GUICONTROL_VISUALISATION,
307 GUICONTROLTYPES GetControlType()
const {
return ControlType; }
312 bool IsControlRenderable();
314 enum GUIVISIBLE { HIDDEN = 0, DELAYED, VISIBLE };
316 enum GUISCROLLVALUE { FOCUS = 0, NEVER, ALWAYS };
319 virtual void DumpTextureUse() {}
333 virtual bool OnMouseOver(
const CPoint &point);
340 virtual bool CanFocusFromPoint(
const CPoint &point)
const;
343 virtual bool Animate(
unsigned int currentTime);
344 virtual bool CheckAnimation(ANIMATION_TYPE animType);
345 void UpdateStates(ANIMATION_TYPE type, ANIMATION_PROCESS currentProcess, ANIMATION_STATE currentState);
346 bool SendWindowMessage(
CGUIMessage &message)
const;
356 UTILS::COLOR::Color m_hitColor = 0xffffffff;
363 bool m_pulseOnSelect;
364 GUICONTROLTYPES ControlType;
370 INFO::InfoPtr m_visibleCondition;
371 GUIVISIBLE m_visible;
372 bool m_visibleFromSkinCondition;
377 INFO::InfoPtr m_enableCondition;
380 bool m_pushedUpdates;
383 std::vector<CAnimation> m_animations;
389 bool m_isCulled{
true};
391 static const unsigned int DIRTY_STATE_CONTROL = 1;
392 static const unsigned int DIRTY_STATE_CHILD = 2;
394 unsigned int m_controlDirtyState;
395 CRect m_renderRegion;
Definition: GUIControl.h:53
Definition: GUIInfoBool.h:29
std::map< int, CGUIAction > ActionMap
Set actions to perform on navigation.
Definition: GUIControl.h:203
Definition: GUIListItem.h:29
virtual CPoint GetPosition() const
Return the coordinates of the top left of the control, in the control's parent coordinates.
Definition: GUIControl.h:326
bool HasProcessed() const
Returns whether or not we have processed.
Definition: GUIControl.h:101
Definition: VisibleEffect.h:151
const CRect & GetRenderRegion() const
return the render region in screen coordinates of this control
Definition: GUIControl.h:193
Base class for controls.
Definition: GUIControl.h:83
EVENT_RESULT
Results of OnMouseEvent() Any value not equal to EVENT_RESULT_UNHANDLED indicates that the event was ...
Definition: GUIControl.h:68
Class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:21
Definition: AudioDecoder.h:18
Definition: GUIMessage.h:365
virtual EVENT_RESULT OnMouseEvent(const CPoint &point, const KODI::MOUSE::CMouseEvent &event)
Perform a mouse action.
Definition: GUIControl.h:146
Definition: GUIControl.h:41
Definition: GUIInfoColor.h:30
Simple class for mouse events.
Definition: MouseEvent.h:20
Class containing vector of condition->(action/navigation route) and handling its execution.
Definition: GUIAction.h:21