Usermode/AxWin3 - Cleaning up and separating code
[tpg/acess2.git] / Usermode / Applications / axwin3_src / WM / include / wm_renderer.h
1 /*
2  * Acess2 Window Manager v3 (axwin3)
3  * - By John Hodge (thePowersGang)
4  *
5  * include/wm_renderer.h
6  * - Window renderer API
7  */
8 #ifndef _WM_RENDERER_H_
9 #define _WM_RENDERER_H_
10
11 #include <wm.h>
12 #include <wm_internals.h>
13
14 struct sWMRenderer
15 {
16         /**
17          * \brief Internal pointer to next loaded renderer
18          */
19         struct sWMRenderer      *Next;
20
21         /**
22          * \brief Renderer name / identifier
23          */
24         const char      *Name;
25
26         /**
27          * \brief Initialise a window structure for the renderer
28          * \param Flags Flags for the window
29          * \return malloc()'d window structure, or NULL on error
30          * \note \a Flags is provided for convinience, the caller will
31          *       set the copy in the window structure.
32          */
33         tWindow *(*CreateWindow)(int Arg);
34         
35         /**
36          * \brief Clean up any stored info
37          * \param Window        Window being destroyed
38          */
39         void    (*DestroyWindow)(tWindow *Window);
40
41         /**
42          * \brief Redraw a window on the screen
43          * \param Window        Window to render
44          * 
45          * Called when a window needs to be re-rendered, e.g. when it is uncovered or
46          * repositioned.
47          *
48          * \todo List all conditions for Redraw
49          */
50         void    (*Redraw)(tWindow *Window);
51         
52         /**
53          * \brief Handle a message sent to the window using WM_SendMessage
54          * \param Window        Target window
55          * \param MessageID     Implementation defined message ID (usually the command)
56          * \param Length        Length of the buffer \a Data
57          * \param Data          Implementation defined data buffer
58          * \return Boolean failure (0: Handled, 1: Unhandled)
59          */
60          int    (*HandleMessage)(tWindow *Window, int MessageID, int Length, const void *Data);
61         
62          int    nIPCHandlers;
63         
64         /**
65          * \brief IPC Message handler
66          */
67          int    (*IPCHandlers[])(tWindow *Window, size_t Length, const void *Data);
68 };
69
70 extern void     WM_RegisterRenderer(tWMRenderer *Renderer);
71 extern tWindow  *WM_CreateWindowStruct(size_t ExtraBytes);
72 extern int      WM_SendIPCReply(tWindow *Window, int Message, size_t Length, const void *Data);
73
74 #endif

UCC git Repository :: git.ucc.asn.au