X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Finclude%2Fwm_renderer.h;h=5882549172ee8bdb27315a307c06c1b06dffe60d;hb=bfacdd3b71576cf6ceaa83352d3a7d162adb75e1;hp=f870290ed3f0ded55b30f68c5d6ef5a6d1876475;hpb=21d938f9041683280a2d5ed44ef0bca278210829;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/include/wm_renderer.h b/Usermode/Applications/axwin3_src/WM/include/wm_renderer.h index f870290e..58825491 100644 --- a/Usermode/Applications/axwin3_src/WM/include/wm_renderer.h +++ b/Usermode/Applications/axwin3_src/WM/include/wm_renderer.h @@ -1,18 +1,60 @@ /* -* Acess2 Window Manager v3 (axwin3) -* - By John Hodge (thePowersGang) -* -* include/wm_renderer.h -* - Window renderer API -*/ + * Acess2 Window Manager v3 (axwin3) + * - By John Hodge (thePowersGang) + * + * include/wm_renderer.h + * - Window renderer API + */ #ifndef _WM_RENDERER_H_ #define _WM_RENDERER_H_ -typedef struct +#include +#include + +struct sWMRenderer { - tWindow (*InitWindow)(int W, int H, int Flags); + /** + * \brief Internal pointer to next loaded renderer + */ + struct sWMRenderer *Next; + + /** + * \brief Renderer name / identifier + */ + const char *Name; + + /** + * \brief Initialise a window structure for the renderer + * \param Flags Flags for the window + * \return malloc()'d window structure, or NULL on error + * \note \a Flags is provided for convinience, the caller will + * set the copy in the window structure. + */ + tWindow *(*CreateWindow)(int Arg); + + /** + * \brief Redraw a window on the screen + * \param Window Window to render + * + * Called when a window needs to be re-rendered, e.g. when it is uncovered or + * repositioned. + * + * \todo List all conditions for Redraw + */ void (*Redraw)(tWindow *Window); - int (*SendMessage)(tWindow *Window, int MessageID, int Length, void *Data); -} tWMRenderer; + + /** + * \brief Handle a message sent to the window using WM_SendMessage + * \param Window Target window + * \param MessageID Implementation defined message ID (usually the command) + * \param Length Length of the buffer \a Data + * \param Data Implementation defined data buffer + * \return Boolean failure (0: Handled, 1: Unhandled) + */ + int (*HandleMessage)(tWindow *Window, int MessageID, int Length, const void *Data); +}; + +extern void WM_RegisterRenderer(tWMRenderer *Renderer); +extern tWindow *WM_CreateWindowStruct(size_t ExtraBytes); #endif