Kodi Documentation  20.0
Kodi is an open source media player and entertainment hub.
XBMCAddon::xbmcgui::Window Class Reference

#include <Window.h>

Inheritance diagram for XBMCAddon::xbmcgui::Window:
Collaboration diagram for XBMCAddon::xbmcgui::Window:

Public Member Functions

 Window (int existingWindowId=-1)
 
 ~Window () override
 
SWIGHIDDENVIRTUAL bool OnMessage (CGUIMessage &message)
 
SWIGHIDDENVIRTUAL bool OnAction (const CAction &action)
 
SWIGHIDDENVIRTUAL bool OnBack (int actionId)
 
SWIGHIDDENVIRTUAL void OnDeinitWindow (int nextWindowID)
 
SWIGHIDDENVIRTUAL bool IsDialogRunning () const
 
SWIGHIDDENVIRTUAL bool IsDialog () const
 
SWIGHIDDENVIRTUAL bool IsModalDialog () const
 
SWIGHIDDENVIRTUAL bool IsMediaWindow () const
 
SWIGHIDDENVIRTUAL void dispose ()
 
void interceptorClear ()
 
 onAction (...)
 

Function: onAction(self, Action action)


onAction method. More...
 
void onControl (...)
 

Function: onControl(self, Control)


onControl method. More...
 
 onClick (...)
 

Function: onClick(self, int controlId)


onClick method. More...
 
 onDoubleClick (...)
 

Function: onDoubleClick(self, int controlId)


onDoubleClick method. More...
 
 onFocus (...)
 

Function: onFocus(self, int controlId)


onFocus method. More...
 
 onInit (...)
 

Function: onInit(self)


onInit method. More...
 
 show ()
 

Function: show()


Show this window. More...
 
 setFocus (...)
 

Function: setFocus(Control)


Give the supplied control focus. More...
 
 setFocusId (...)
 

Function: setFocusId(ControlId)


Gives the control with the supplied focus. More...
 
 getFocus ()
 

Function: getFocus(Control)


Returns the control which is focused. More...
 
 getFocusId ()
 

Function: getFocusId(int)


Returns the id of the control which is focused. More...
 
 removeControl (...)
 

Function: removeControl(Control)


Removes the control from this window. More...
 
 removeControls (...)
 

Function: removeControls(List)


Removes a list of controls from this window. More...
 
 getHeight ()
 

Function: getHeight()


Returns the height of this Window instance. More...
 
 getWidth ()
 

Function: getWidth()


Returns the width of this Window instance. More...
 
 setProperty (...)
 

Function: setProperty(key, value)


Sets a window property, similar to an infolabel. More...
 
 getProperty (...)
 

Function: getProperty(key)


Returns a window property as a string, similar to an infolabel. More...
 
 clearProperty (...)
 

Function: clearProperty(key)


Clears the specific window property. More...
 
 clearProperties ()
 

Function: clearProperties()


Clears all window properties. More...
 
 close ()
 

Function: close()


Closes this window. More...
 
 doModal ()
 

Function: doModal()


Display this window until close() is called. More...
 
 addControl (...)
 

Function: addControl(Control)


Add a Control to this window. More...
 
 addControls (...)
 

Function: addControls(List)


Add a list of Controls to this window. More...
 
 getControl (...)
 

Function: getControl(controlId)


Gets the control from this window. More...
 
- Public Member Functions inherited from XBMCAddon::AddonCallback
 ~AddonCallback () override
 
void setHandler (CallbackHandler *_handler)
 
void invokeCallback (Callback *callback)
 
- Public Member Functions inherited from XBMCAddon::AddonClass
 AddonClass ()
 
virtual ~AddonClass ()
 
const char * GetClassname () const
 
LanguageHookGetLanguageHook ()
 
bool isDeallocating ()
 
void Release () const
 
void Acquire () const
 
- Public Member Functions inherited from XbmcThreads::CountingLockable< XbmcThreads::CRecursiveMutex >
 CountingLockable ()=default
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 
unsigned int exit (unsigned int leave=0)
 
void restore (unsigned int restoreCount)
 
XbmcThreads::CRecursiveMutex & get_underlying ()
 

Protected Member Functions

 Window (bool discrim)
 
void deallocating () override
 
void setWindow (InterceptorBase *_window)
 
void popActiveWindowId ()
 
ControlGetControlById (int iControlId, CCriticalSection *gc)
 
SWIGHIDDENVIRTUAL void PulseActionEvent ()
 
SWIGHIDDENVIRTUAL bool WaitForActionEvent (unsigned int milliseconds)
 
- Protected Member Functions inherited from XBMCAddon::AddonCallback
bool hasHandler ()
 
 AddonCallback ()
 

Static Protected Member Functions

static int getNextAvailableWindowId ()
 
- Static Protected Member Functions inherited from XBMCAddon::AddonClass
static short getNextClassIndex ()
 

Protected Attributes

InterceptorBasewindow
 
int iWindowId = -1
 
std::vector< AddonClass::Ref< Control > > vecControls
 
int iOldWindowId = 0
 
int iCurrentControlId = 3000
 
bool bModal = false
 
CEvent m_actionEvent
 
bool canPulse = false
 
bool existingWindow = true
 
bool destroyAfterDeInit = false
 
- Protected Attributes inherited from XBMCAddon::AddonCallback
AddonClass::Ref< CallbackHandlerhandler
 
- Protected Attributes inherited from XBMCAddon::AddonClass
LanguageHooklanguageHook
 
- Protected Attributes inherited from XbmcThreads::CountingLockable< XbmcThreads::CRecursiveMutex >
XbmcThreads::CRecursiveMutex mutex
 
unsigned int count
 

Friends

class WindowDialogMixin
 

Additional Inherited Members

- Static Public Member Functions inherited from XBMCAddon::AddonClass
static short getNumAddonClasses ()
 

Constructor & Destructor Documentation

◆ Window() [1/2]

XBMCAddon::xbmcgui::Window::Window ( bool  discrim)
explicitprotected

This only takes a boolean to allow subclasses to explicitly use it. A default constructor can be used as a concrete class and we need to tell the difference. subclasses should use this constructor and not the other.

◆ Window() [2/2]

XBMCAddon::xbmcgui::Window::Window ( int  existingWindowId = -1)
explicit

This just creates a default window.

◆ ~Window()

XBMCAddon::xbmcgui::Window::~Window ( )
override

Member Function Documentation

◆ deallocating()

void XBMCAddon::xbmcgui::Window::deallocating ( )
overrideprotectedvirtual

This method is meant to be called from the destructor of the lowest level class.

It's virtual because it's a convenient place to receive messages that we're about to go be deleted but prior to any real tear-down.

Any overloading classes need to remember to pass the call up the chain.

Reimplemented from XBMCAddon::AddonClass.

◆ dispose()

void XBMCAddon::xbmcgui::Window::dispose ( )
Todo:
rework locking
Bug:
This is an existing window, so no resources are free'd. Note that THIS WILL FAIL for any controls newly created by python - they will remain after the script ends. Ideally this would be remedied by a flag in Control that specifies that it was python created - any python created controls could then be removed + free'd from the window. how this works with controlgroups though could be a bit tricky.

◆ GetControlById()

Control * XBMCAddon::xbmcgui::Window::GetControlById ( int  iControlId,
CCriticalSection gc 
)
protected

This is a helper method since getting a control by it's id is a common function.

Todo:
Yuck! Should probably be done with a Factory pattern

◆ getNextAvailableWindowId()

int XBMCAddon::xbmcgui::Window::getNextAvailableWindowId ( )
staticprotected

This helper retrieves the next available id. It is assumed that the global lock is already being held.

◆ interceptorClear()

void XBMCAddon::xbmcgui::Window::interceptorClear ( )
inline

This is called from the InterceptorBase destructor to prevent further use of the interceptor from the window.

◆ IsDialog()

SWIGHIDDENVIRTUAL bool XBMCAddon::xbmcgui::Window::IsDialog ( ) const
inline

◆ IsDialogRunning()

SWIGHIDDENVIRTUAL bool XBMCAddon::xbmcgui::Window::IsDialogRunning ( ) const
inline

◆ IsMediaWindow()

SWIGHIDDENVIRTUAL bool XBMCAddon::xbmcgui::Window::IsMediaWindow ( ) const
inline

◆ IsModalDialog()

SWIGHIDDENVIRTUAL bool XBMCAddon::xbmcgui::Window::IsModalDialog ( ) const
inline

◆ OnAction()

bool XBMCAddon::xbmcgui::Window::OnAction ( const CAction action)

◆ OnBack()

bool XBMCAddon::xbmcgui::Window::OnBack ( int  actionId)

◆ OnDeinitWindow()

void XBMCAddon::xbmcgui::Window::OnDeinitWindow ( int  nextWindowID)

◆ OnMessage()

bool XBMCAddon::xbmcgui::Window::OnMessage ( CGUIMessage message)

◆ popActiveWindowId()

void XBMCAddon::xbmcgui::Window::popActiveWindowId ( )
protected

This is a helper method since popping the previous window id is a common function.

◆ PulseActionEvent()

void XBMCAddon::xbmcgui::Window::PulseActionEvent ( )
protected

◆ setWindow()

void XBMCAddon::xbmcgui::Window::setWindow ( InterceptorBase _window)
protected

Child classes MUST call this in their constructors. It should be an instance of Interceptor<P extends CGUIWindow>. Control of memory management for this class is then given to the Window.

◆ WaitForActionEvent()

bool XBMCAddon::xbmcgui::Window::WaitForActionEvent ( unsigned int  milliseconds)
protected

Friends And Related Function Documentation

◆ WindowDialogMixin

friend class WindowDialogMixin
friend

Member Data Documentation

◆ bModal

bool XBMCAddon::xbmcgui::Window::bModal = false
protected

◆ canPulse

bool XBMCAddon::xbmcgui::Window::canPulse = false
protected

◆ destroyAfterDeInit

bool XBMCAddon::xbmcgui::Window::destroyAfterDeInit = false
protected

◆ existingWindow

bool XBMCAddon::xbmcgui::Window::existingWindow = true
protected

◆ iCurrentControlId

int XBMCAddon::xbmcgui::Window::iCurrentControlId = 3000
protected

◆ iOldWindowId

int XBMCAddon::xbmcgui::Window::iOldWindowId = 0
protected

◆ iWindowId

int XBMCAddon::xbmcgui::Window::iWindowId = -1
protected

◆ m_actionEvent

CEvent XBMCAddon::xbmcgui::Window::m_actionEvent
protected

◆ vecControls

std::vector<AddonClass::Ref<Control> > XBMCAddon::xbmcgui::Window::vecControls
protected

◆ window

InterceptorBase* XBMCAddon::xbmcgui::Window::window
protected

The documentation for this class was generated from the following files: