xbmc
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
XBMCAddon::xbmcgui::Window Class Reference
Inheritance diagram for XBMCAddon::xbmcgui::Window:
Inheritance graph
[legend]
Collaboration diagram for XBMCAddon::xbmcgui::Window:
Collaboration graph
[legend]

Public Member Functions

 Window (int existingWindowId=-1)
 This just creates a default window.
 
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 ()
 This is called from the InterceptorBase destructor to prevent further use of the interceptor from the window.
 
virtual void onAction (Action *action)
 
virtual void onControl (Control *control)
 
virtual void onClick (int controlId)
 
virtual void onDoubleClick (int controlId)
 
virtual void onFocus (int controlId)
 
virtual void onInit ()
 
SWIGHIDDENVIRTUAL void show ()
 
SWIGHIDDENVIRTUAL void setFocus (Control *pControl)
 
SWIGHIDDENVIRTUAL void setFocusId (int iControlId)
 
SWIGHIDDENVIRTUAL ControlgetFocus ()
 
SWIGHIDDENVIRTUAL long getFocusId ()
 
SWIGHIDDENVIRTUAL void removeControl (Control *pControl)
 
SWIGHIDDENVIRTUAL void removeControls (std::vector< Control *> pControls)
 
SWIGHIDDENVIRTUAL long getHeight ()
 
SWIGHIDDENVIRTUAL long getWidth ()
 
SWIGHIDDENVIRTUAL void setProperty (const char *key, const String &value)
 
SWIGHIDDENVIRTUAL String getProperty (const char *key)
 
SWIGHIDDENVIRTUAL void clearProperty (const char *key)
 
SWIGHIDDENVIRTUAL void clearProperties ()
 
SWIGHIDDENVIRTUAL void close ()
 
SWIGHIDDENVIRTUAL void doModal ()
 
SWIGHIDDENVIRTUAL void addControl (Control *pControl)
 
SWIGHIDDENVIRTUAL void addControls (std::vector< Control *> pControls)
 
SWIGHIDDENVIRTUAL ControlgetControl (int iControlId)
 
- Public Member Functions inherited from XBMCAddon::AddonCallback
void setHandler (CallbackHandler *_handler)
 
void invokeCallback (Callback *callback)
 
- Public Member Functions inherited from XBMCAddon::AddonClass
const char * GetClassname () const
 
LanguageHookGetLanguageHook ()
 
bool isDeallocating ()
 This method should be called while holding a Synchronize on the object. More...
 
void Release () const
 
void Acquire () const
 

Protected Member Functions

 Window (bool discrim)
 This only takes a boolean to allow subclasses to explicitly use it. More...
 
void deallocating () override
 This method is meant to be called from the destructor of the lowest level class. More...
 
void setWindow (InterceptorBase *_window)
 Child classes MUST call this in their constructors. More...
 
void popActiveWindowId ()
 This is a helper method since popping the previous window id is a common function.
 
ControlGetControlById (int iControlId, CCriticalSection *gc)
 This is a helper method since getting a control by it's id is a common function. More...
 
SWIGHIDDENVIRTUAL void PulseActionEvent ()
 
SWIGHIDDENVIRTUAL bool WaitForActionEvent (unsigned int milliseconds)
 
- Protected Member Functions inherited from XBMCAddon::AddonCallback
bool hasHandler ()
 

Static Protected Member Functions

static int getNextAvailableWindowId ()
 This helper retrieves the next available id. More...
 
- Static Protected Member Functions inherited from XBMCAddon::AddonClass
static short getNextClassIndex ()
 This is meant to be called during static initialization and so isn't synchronized.
 

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
 

Friends

class WindowDialogMixin
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ Window()

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.

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.

◆ doModal()

void XBMCAddon::xbmcgui::Window::doModal ( )
Todo:
garbear added this code to the python window.cpp class and commented in XBPyThread.cpp. I'm not sure how to handle this in this native implementation.

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

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


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