16 #include "GUIAction.h" 19 #include "threads/CriticalSection.h" 28 RENDER_ORDER_WINDOW = 0,
29 RENDER_ORDER_DIALOG = 1,
30 RENDER_ORDER_WINDOW_SCREENSAVER = INT_MAX,
31 RENDER_ORDER_WINDOW_POINTER = INT_MAX - 1,
32 RENDER_ORDER_WINDOW_DEBUG = INT_MAX - 2,
33 RENDER_ORDER_DIALOG_TELETEXT = INT_MAX - 3
51 INFO::InfoPtr condition;
61 enum LOAD_TYPE { LOAD_EVERY_TIME, LOAD_ON_GUI_INIT, KEEP_IN_MEMORY };
63 CGUIWindow(
int id,
const std::string &xmlFile);
67 bool Load(
const std::string& strFileName,
bool bContainsPath =
false);
71 void DoProcess(
unsigned int currentTime, CDirtyRegionList &dirtyregions)
override;
79 void DoRender()
override;
92 void Close(
bool forceClose =
false,
int nextWindowID = 0,
bool enableSound =
true,
bool bWait =
true);
99 bool OnAction(
const CAction &action)
override;
101 using CGUIControlGroup::OnBack;
102 virtual bool OnBack(
int actionID);
103 using CGUIControlGroup::OnInfo;
104 virtual bool OnInfo(
int actionID) {
return false; }
108 virtual void ClearBackground();
110 bool OnMove(
int fromControl,
int moveAction);
113 bool ControlGroupHasFocus(
int groupID,
int controlID);
114 void SetID(
int id)
override;
115 virtual bool HasID(
int controlID)
const;
116 const std::vector<int>& GetIDRange()
const {
return m_idRange; }
117 int GetPreviousWindow() {
return m_previousWindow; }
118 CRect GetScaledBounds()
const;
119 void ClearAll()
override;
120 using CGUIControlGroup::AllocResources;
121 virtual void AllocResources(
bool forceLoad =
false);
122 void FreeResources(
bool forceUnLoad =
false)
override;
123 void DynamicResourceAlloc(
bool bOnOff)
override;
124 virtual bool IsDialog()
const {
return false; }
125 virtual bool IsDialogRunning()
const {
return false; }
126 virtual bool IsModalDialog()
const {
return false; }
127 virtual bool IsMediaWindow()
const {
return false; }
128 virtual bool HasListItems()
const {
return false; }
129 virtual bool IsSoundEnabled()
const {
return true; }
130 virtual CFileItemPtr GetCurrentListItem(
int offset = 0) {
return CFileItemPtr(); }
131 virtual int GetViewContainerID()
const {
return 0; }
132 virtual int GetViewCount()
const {
return 0; }
133 virtual bool CanBeActivated()
const {
return true; }
134 virtual bool IsActive()
const;
137 void SetLoadType(LOAD_TYPE loadType) { m_loadType = loadType; }
138 LOAD_TYPE GetLoadType() {
return m_loadType; }
139 int GetRenderOrder() {
return m_renderOrder; }
140 void SetInitialVisibility()
override;
141 bool IsVisible()
const override {
return true; };
144 virtual bool HasVisibleControls() {
return true; };
146 bool IsAnimating(ANIMATION_TYPE animType)
override;
160 void DisableAnimations();
162 virtual void ResetControlStates();
163 void UpdateControlStats()
override {};
165 void SetRunActionsManually();
166 void RunLoadActions()
const;
167 void RunUnloadActions()
const;
175 void SetProperty(
const std::string &key,
const CVariant &value);
181 CVariant GetProperty(
const std::string &key)
const;
186 void ClearProperties();
189 void DumpTextureUse()
override;
191 bool HasSaveLastControl()
const {
return !m_defaultAlways; }
193 virtual void OnDeinitWindow(
int nextWindowID);
202 virtual bool LoadXML(
const std::string& strPath,
const std::string &strLowerPath);
209 virtual bool Load(TiXmlElement *pRootElement);
216 virtual std::unique_ptr<TiXmlElement> Prepare(
const std::unique_ptr<TiXmlElement>& rootElement);
221 bool NeedLoad()
const;
223 virtual void SetDefaults();
224 virtual void OnWindowUnload() {}
225 virtual void OnWindowLoaded();
226 virtual void OnInitWindow();
227 void Close_Internal(
bool forceClose =
false,
int nextWindowID = 0,
bool enableSound =
true);
229 bool Animate(
unsigned int currentTime)
override;
230 bool CheckAnimation(ANIMATION_TYPE animType)
override;
233 virtual void SaveControlStates();
234 virtual void RestoreControlStates();
237 void OnEditChanged(
int id, std::string &text);
238 bool SendMessage(
int message,
int id,
int param1 = 0,
int param2 = 0);
242 std::vector<int> m_idRange;
246 LOAD_TYPE m_loadType;
247 bool m_dynamicResourceAlloc;
259 CPoint GetPosition()
const override;
260 std::vector<COrigin> m_origins;
264 std::vector<CControlState> m_controlStates;
265 int m_previousWindow;
267 bool m_animationsEnabled;
270 bool operator()(
const std::string &s1,
const std::string &s2)
const;
281 bool m_manualRunActions;
286 int m_menuLastFocusedControlID;
290 std::map<std::string, CVariant, icompare> m_mapProperties;
291 std::map<INFO::InfoPtr, bool> m_xmlIncludeConditions;
void SetCustom(bool custom)
Mark this window as custom window.
Definition: GUIWindow.h:158
std::shared_ptr< CFileItem > CFileItemPtr
A shared pointer to CFileItem.
Definition: FileItem.h:680
int m_exclusiveMouseControl
id of child control that wishes to receive all mouse events
Definition: GUIWindow.h:283
Definition: XBMCTinyXML.h:33
std::unique_ptr< TiXmlElement > m_windowXMLRootElement
window root xml definition after resolving any skin includes. Stored to avoid parsing the XML every t...
Definition: GUIWindow.h:279
virtual void FrameMove()
Main update function, called every frame prior to rendering Any window that requires updating on a fr...
Definition: GUIWindow.h:90
EVENT_RESULT
Results of OnMouseEvent() Any value not equal to EVENT_RESULT_UNHANDLED indicates that the event was ...
Definition: GUIControl.h:60
bool IsCustom() const
Return if the window is a custom window.
Definition: GUIWindow.h:152
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
Provide info of a resolution.
Definition: Resolution.h:66
Definition: GUIMessage.h:365
Definition: GUIWindow.h:58
Definition: GUIWindow.h:42
group of controls, useful for remembering last control + animating/hiding together ...
Definition: GUIControlGroup.h:24
Definition: GUIInfoColor.h:30
Definition: GUIWindow.h:268
Represents a file on a share.
Definition: FileItem.h:102
Simple class for mouse events.
Definition: Key.h:114
Class containing vector of condition->(action/navigation route) and handling its execution.
Definition: GUIAction.h:21