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

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