diff options
author | Lars Op den Kamp <lars@opdenkamp.eu> | 2013-03-07 00:39:27 +0100 |
---|---|---|
committer | Lars Op den Kamp <lars@opdenkamp.eu> | 2013-03-07 00:39:44 +0100 |
commit | e80c694d862a75f341a27e8fa3894e6a343afbe2 (patch) | |
tree | 8b91f4d531802f3ea2de7b90be6a61a862016f1b /lib | |
parent | 42cb8cfcab1fc734e9224f02986fff2d07d3bba1 (diff) | |
parent | 140a43324b48db19765a0c930e57635057b5eacc (diff) |
Merge remote-tracking branch 'fernetmenta/addongui' into pvrapi_1_7_0. Github issue #1816
Diffstat (limited to 'lib')
-rw-r--r-- | lib/addons/library.xbmc.gui/libXBMC_gui.cpp | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/lib/addons/library.xbmc.gui/libXBMC_gui.cpp b/lib/addons/library.xbmc.gui/libXBMC_gui.cpp index c9765a3a04..7da98dbdef 100644 --- a/lib/addons/library.xbmc.gui/libXBMC_gui.cpp +++ b/lib/addons/library.xbmc.gui/libXBMC_gui.cpp @@ -300,6 +300,11 @@ void CAddonGUIWindow::SetControlLabel(int controlId, const char *label) ((CB_GUILib*)m_cb)->Window_SetControlLabel(((AddonCB*)m_Handle)->addonData, m_WindowHandle, controlId, label); } +void CAddonGUIWindow::MarkDirtyRegion() +{ + ((CB_GUILib*)m_cb)->Window_MarkDirtyRegion(((AddonCB*)m_Handle)->addonData, m_WindowHandle); +} + ///------------------------------------- /// cGUISpinControl @@ -555,5 +560,91 @@ void CAddonListItem::SetPath(const char *Path) ((CB_GUILib*)m_cb)->ListItem_SetPath(((AddonCB*)m_Handle)->addonData, m_ListItemHandle, Path); } +///------------------------------------- +/// cGUIRenderingControl + +DLLEXPORT CAddonGUIRenderingControl* GUI_control_get_rendering(void *hdl, void *cb, CAddonGUIWindow *window, int controlId) +{ + return new CAddonGUIRenderingControl(hdl, cb, window, controlId); +} + +DLLEXPORT void GUI_control_release_rendering(CAddonGUIRenderingControl* p) +{ + delete p; +} + +DLLEXPORT bool GUI_control_rendering_create(GUIHANDLE handle, int x, int y, int w, int h, void *device) +{ + CAddonGUIRenderingControl *pControl = (CAddonGUIRenderingControl*) handle; + return pControl->Create(x,y,w,h,device); +} + +DLLEXPORT void GUI_control_rendering_render(GUIHANDLE handle) +{ + CAddonGUIRenderingControl *pControl = (CAddonGUIRenderingControl*) handle; + pControl->Render(); +} + +DLLEXPORT void GUI_control_rendering_stop(GUIHANDLE handle) +{ + CAddonGUIRenderingControl *pControl = (CAddonGUIRenderingControl*) handle; + pControl->Stop(); +} + +DLLEXPORT bool GUI_control_rendering_dirty(GUIHANDLE handle) +{ + CAddonGUIRenderingControl *pControl = (CAddonGUIRenderingControl*) handle; + return pControl->Dirty(); +} + +CAddonGUIRenderingControl::CAddonGUIRenderingControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId) + : m_Window(window) + , m_ControlId(controlId) + , m_Handle(hdl) + , m_cb(cb) +{ + m_RenderingHandle = ((CB_GUILib*)m_cb)->Window_GetControl_RenderAddon(((AddonCB*)m_Handle)->addonData, m_Window->m_WindowHandle, controlId); +} + +CAddonGUIRenderingControl::~CAddonGUIRenderingControl() +{ + ((CB_GUILib*)m_cb)->RenderAddon_Delete(((AddonCB*)m_Handle)->addonData, m_RenderingHandle); +} + +void CAddonGUIRenderingControl::Init() +{ + ((CB_GUILib*)m_cb)->RenderAddon_SetCallbacks(((AddonCB*)m_Handle)->addonData, m_RenderingHandle, this, GUI_control_rendering_create, GUI_control_rendering_render, GUI_control_rendering_stop, GUI_control_rendering_dirty); +} + +bool CAddonGUIRenderingControl::Create(int x, int y, int w, int h, void *device) +{ + if (!CBCreate) + return false; + + return CBCreate(m_cbhdl, x, y, w, h, device); +} + +void CAddonGUIRenderingControl::Render() +{ + if (!CBRender) + return; + CBRender(m_cbhdl); +} + +void CAddonGUIRenderingControl::Stop() +{ + if (!CBStop) + return; + + CBStop(m_cbhdl); +} + +bool CAddonGUIRenderingControl::Dirty() +{ + if (!CBDirty) + return true; + + return CBDirty(m_cbhdl); +} }; |