e4ed1fe2f478fcedff7fa6c7e8c7a95fe24c1e78
[tpg/acess2.git] / Usermode / include / axwin / messages.h
1 /**
2  * \file messages.h
3  * \author John Hodge (thePowersGang)
4  * \brief AxWin Control Messages and structures
5  */
6 #ifndef _AXWIN_MESSAGES_H
7 #define _AXWIN_MESSAGES_H
8
9 #include <stdint.h>
10
11 typedef struct sAxWin_Message   tAxWin_Message;
12
13 /**
14  * \brief Message IDs
15  */
16 enum eAxWin_Messages
17 {
18         // Server Requests
19         MSG_SREQ_PING,
20         // - Windows
21         MSG_SREQ_NEWWINDOW,     // (short x, y, w, h, uint32_t flags)
22         MSG_SREQ_GETFLAGS,      MSG_SREQ_SETFLAGS,
23         MSG_SREQ_GETRECT,       MSG_SREQ_SETRECT,
24         // - Drawing
25         MSG_SREQ_SETCOL,
26         MSG_SREQ_PSET,
27         MSG_SREQ_LINE,  MSG_SREQ_CURVE,
28         MSG_SREQ_RECT,  MSG_SREQ_FILLRECT,
29         MSG_SREQ_RIMG,  MSG_SREQ_SIMG,  // Register/Set Image
30         MSG_SREQ_SETFONT,       MSG_SREQ_PUTTEXT,
31         
32         // Server Responses
33         MSG_SRSP_PONG,
34         MSG_SRSP_WINDOW,        // Returns the new window ID
35         MSG_SRSP_IMG,   // Returns the image ID
36         
37         NUM_MSG
38 };
39
40 // --- Server Requests (Requests from the client of the server)
41 /**
42  * \brief Server Request - Ping (Get Server Version)
43  */
44 struct sAxWin_SReq_Ping
45 {
46 };
47
48 /**
49  * \brief Server Request - New Window
50  * \see eAxWin_Messages.MSG_SREQ_NEWWINDOW
51  */
52 struct sAxWin_SReq_NewWindow
53 {
54         uint16_t        X, Y, W, H;
55         uint32_t        Flags;
56 };
57
58
59 // --- Server Responses
60 /**
61  * \brief Server Response - Pong
62  * \see eAxWin_Messages.MSG_SRSP_PONG
63  */
64 struct sAxWin_SRsp_Pong
65 {
66         uint8_t Major;
67         uint8_t Minor;
68         uint16_t        Build;
69 };
70
71 /**
72  * \brief Server Response - New Window
73  * \see eAxWin_Messages.MSG_SRSP_NEWWINDOW
74  */
75 struct sAxWin_SRsp_NewWindow
76 {
77         uint32_t        Handle;
78 };
79
80
81 // === Core Message Structure
82 /**
83  * \brief Overarching Message Structure
84  * \note sizeof(tAxWin_Message) is never valid
85  */
86 struct sAxWin_Message
87 {
88         uint16_t        ID;
89         uint16_t        Size;   //!< Size in DWORDS
90         union
91         {
92                 struct sAxWin_SReq_Ping SReq_Pong;
93                 struct sAxWin_SReq_NewWindow    SReq_NewWindow;
94                 
95                 // Server Responses
96                 struct sAxWin_SRsp_Pong SRsp_Pong;
97                 struct sAxWin_SRsp_NewWindow    SRsp_Window;
98         };
99 };
100
101 #endif

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