Cleanup Commit
[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_REGISTER,      // bool (char[] Name) - Registers this PID with the Window Manager
22         
23         MSG_SREQ_ADDTAB,        // ELEMENT (char[] Name) - Adds a tab to the window
24         MSG_SREQ_DELTAB,        // void (TAB Tab)       - Closes a tab
25         
26         MSG_SREQ_NEWDIALOG,     // ELEMENT (ELEMENT Parent, char[] Name)        - Creates a dialog
27         MSG_SREQ_DELDIALOG,     // void (ELEMENT Dialog)        - Closes a dialog
28         
29         MSG_SREQ_SETNAME,       // void (ELEMENT Element, char[] Name)
30         MSG_SREQ_GETNAME,       // char[] (ELEMENT Element)
31         
32         // - Builtin Elements
33         MSG_SREQ_INSERT,        // void (ELEMENT Parent, eAxWin_Controls Type, u32 Flags)
34         
35         // - Drawing
36         //  All drawing functions take an ELEMENT as their first parameter.
37         //  This must be either a Tab, Dialog or Canvas control
38         MSG_SREQ_SETCOL,
39         MSG_SREQ_PSET,
40         MSG_SREQ_LINE,  MSG_SREQ_CURVE,
41         MSG_SREQ_RECT,  MSG_SREQ_FILLRECT,
42         MSG_SREQ_RIMG,  MSG_SREQ_SIMG,  // Register/Set Image
43         MSG_SREQ_SETFONT,       MSG_SREQ_PUTTEXT,
44         
45         // Server Responses
46         MSG_SRSP_RETURN,        // {int RequestID, void[] Return Value} - Returns a value from a server request
47         
48         NUM_MSG
49 };
50
51 // --- Server Requests (Requests from the client of the server)
52 /**
53  * \brief Server Request - Ping (Get Server Version)
54  */
55 struct sAxWin_SReq_Ping
56 {
57 };
58
59 /**
60  * \brief Server Request - New Window
61  * \see eAxWin_Messages.MSG_SREQ_NEWWINDOW
62  */
63 struct sAxWin_SReq_NewWindow
64 {
65         uint16_t        X, Y, W, H;
66         uint32_t        Flags;
67 };
68
69
70 // --- Server Responses
71 /**
72  * \brief Server Response - Pong
73  * \see eAxWin_Messages.MSG_SRSP_PONG
74  */
75 struct sAxWin_SRsp_Pong
76 {
77         uint8_t Major;
78         uint8_t Minor;
79         uint16_t        Build;
80 };
81
82 /**
83  * \brief Server Response - New Window
84  * \see eAxWin_Messages.MSG_SRSP_NEWWINDOW
85  */
86 struct sAxWin_SRsp_NewWindow
87 {
88         uint32_t        Handle;
89 };
90
91
92 // === Core Message Structure
93 /**
94  * \brief Overarching Message Structure
95  * \note sizeof(tAxWin_Message) is never valid
96  */
97 struct sAxWin_Message
98 {
99         uint16_t        ID;
100         uint16_t        Size;   //!< Size in DWORDS
101         union
102         {
103                 struct sAxWin_SReq_Ping SReq_Pong;
104                 struct sAxWin_SReq_NewWindow    SReq_NewWindow;
105                 
106                 // Server Responses
107                 struct sAxWin_SRsp_Pong SRsp_Pong;
108                 struct sAxWin_SRsp_NewWindow    SRsp_Window;
109         };
110 };
111
112 #endif

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