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 /addons | |
parent | 42cb8cfcab1fc734e9224f02986fff2d07d3bba1 (diff) | |
parent | 140a43324b48db19765a0c930e57635057b5eacc (diff) |
Merge remote-tracking branch 'fernetmenta/addongui' into pvrapi_1_7_0. Github issue #1816
Diffstat (limited to 'addons')
-rw-r--r-- | addons/library.xbmc.gui/libXBMC_gui.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/addons/library.xbmc.gui/libXBMC_gui.h b/addons/library.xbmc.gui/libXBMC_gui.h index 3fccaf0453..4050fdf2d6 100644 --- a/addons/library.xbmc.gui/libXBMC_gui.h +++ b/addons/library.xbmc.gui/libXBMC_gui.h @@ -35,6 +35,12 @@ typedef void* GUIHANDLE; #define GUI_HELPER_DLL "/library.xbmc.gui/" GUI_HELPER_DLL_NAME #endif +/* current ADDONGUI API version */ +#define XBMC_GUI_API_VERSION "1.0.0" + +/* min. ADDONGUI API version */ +#define XBMC_GUI_MIN_API_VERSION "1.0.0" + #define ADDON_ACTION_PREVIOUS_MENU 10 #define ADDON_ACTION_CLOSE_DIALOG 51 @@ -43,6 +49,7 @@ class CAddonGUISpinControl; class CAddonGUIRadioButton; class CAddonGUIProgressControl; class CAddonListItem; +class CAddonGUIRenderingControl; class CHelper_libXBMC_gui { @@ -154,6 +161,14 @@ public: dlsym(m_libXBMC_gui, "GUI_ListItem_destroy"); if (GUI_ListItem_destroy == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + GUI_control_get_rendering = (CAddonGUIRenderingControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) + dlsym(m_libXBMC_gui, "GUI_control_get_rendering"); + if (GUI_control_get_rendering == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_control_release_rendering = (void (*)(CAddonGUIRenderingControl* p)) + dlsym(m_libXBMC_gui, "GUI_control_release_rendering"); + if (GUI_control_release_rendering == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + m_Callbacks = GUI_register_me(m_Handle); return m_Callbacks != NULL; @@ -234,6 +249,16 @@ public: return GUI_ListItem_destroy(p); } + CAddonGUIRenderingControl* Control_getRendering(CAddonGUIWindow *window, int controlId) + { + return GUI_control_get_rendering(m_Handle, m_Callbacks, window, controlId); + } + + void Control_releaseRendering(CAddonGUIRenderingControl* p) + { + return GUI_control_release_rendering(p); + } + protected: void* (*GUI_register_me)(void *HANDLE); void (*GUI_unregister_me)(void *HANDLE, void* CB); @@ -252,6 +277,8 @@ protected: void (*GUI_control_release_progress)(CAddonGUIProgressControl* p); CAddonListItem* (*GUI_ListItem_create)(void *HANDLE, void* CB, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path); void (*GUI_ListItem_destroy)(CAddonListItem* p); + CAddonGUIRenderingControl* (*GUI_control_get_rendering)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); + void (*GUI_control_release_rendering)(CAddonGUIRenderingControl* p); private: void *m_libXBMC_gui; @@ -355,6 +382,7 @@ class CAddonGUIWindow friend class CAddonGUISpinControl; friend class CAddonGUIRadioButton; friend class CAddonGUIProgressControl; +friend class CAddonGUIRenderingControl; public: CAddonGUIWindow(void *hdl, void *cb, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog); @@ -385,6 +413,7 @@ public: virtual void SetCurrentListPosition(int listPos); virtual int GetCurrentListPosition(); virtual void SetControlLabel(int controlId, const char *label); + virtual void MarkDirtyRegion(); virtual bool OnClick(int controlId); virtual bool OnFocus(int controlId); @@ -402,3 +431,29 @@ protected: void *m_Handle; void *m_cb; }; + +class CAddonGUIRenderingControl +{ +public: + CAddonGUIRenderingControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); + virtual ~CAddonGUIRenderingControl(); + virtual void Init(); + + virtual bool Create(int x, int y, int w, int h, void *device); + virtual void Render(); + virtual void Stop(); + virtual bool Dirty(); + + GUIHANDLE m_cbhdl; + bool (*CBCreate)(GUIHANDLE cbhdl, int x, int y, int w, int h, void *device); + void (*CBRender)(GUIHANDLE cbhdl); + void (*CBStop)(GUIHANDLE cbhdl); + bool (*CBDirty)(GUIHANDLE cbhdl); + +private: + CAddonGUIWindow *m_Window; + int m_ControlId; + GUIHANDLE m_RenderingHandle; + void *m_Handle; + void *m_cb; +}; |