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
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

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
- Protected Attributes inherited from XbmcThreads::CountingLockable< XbmcThreads::CRecursiveMutex >
XbmcThreads::CRecursiveMutex mutex
unsigned int count


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)

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)

This just creates a default window.

◆ ~Window()

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

Member Function Documentation

◆ deallocating()

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

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 ( )
rework locking
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 

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

Yuck! Should probably be done with a Factory pattern

◆ getNextAvailableWindowId()

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

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

◆ interceptorClear()

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

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

◆ IsDialogRunning()

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

◆ IsMediaWindow()

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

◆ IsModalDialog()

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

◆ 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 ( )

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

◆ PulseActionEvent()

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

◆ setWindow()

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

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)

Friends And Related Function Documentation

◆ WindowDialogMixin

friend class WindowDialogMixin

Member Data Documentation

◆ bModal

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

◆ canPulse

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

◆ destroyAfterDeInit

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

◆ existingWindow

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

◆ iCurrentControlId

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

◆ iOldWindowId

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

◆ iWindowId

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

◆ m_actionEvent

CEvent XBMCAddon::xbmcgui::Window::m_actionEvent

◆ vecControls

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

◆ window

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

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