4d53ab5d19be4f40e46484723ce45cd1c7fe27bd
[tpg/acess2.git] / Usermode / include / axwin2 / 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_VERSION,
54         MSG_SRSP_RETURN,        // {int RequestID, void[] Return Value} - Returns a value from a server request
55         
56         NUM_MSG
57 };
58
59 // --- Server Requests (Requests from the client of the server)
60 /**
61  * \brief Server Request - Ping (Get Server Version)
62  */
63 struct sAxWin_SReq_Ping
64 {
65 };
66
67 /**
68  * \brief Server Request - New Window
69  * \see eAxWin_Messages.MSG_SREQ_NEWWINDOW
70  */
71 struct sAxWin_SReq_NewWindow
72 {
73         uint16_t        X, Y, W, H;
74         uint32_t        Flags;
75 };
76
77
78 // --- Server Responses
79 /**
80  * \brief Server Response - Pong
81  * \see eAxWin_Messages.MSG_SRSP_PONG
82  */
83 struct sAxWin_SRsp_Version
84 {
85         uint8_t Major;
86         uint8_t Minor;
87         uint16_t        Build;
88 };
89
90 /**
91  * \brief Server Response - New Window
92  * \see eAxWin_Messages.MSG_SRSP_NEWWINDOW
93  */
94 struct sAxWin_SRsp_NewWindow
95 {
96         uint32_t        Handle;
97 };
98
99
100 // === Core Message Structure
101 /**
102  * \brief Overarching Message Structure
103  * \note sizeof(tAxWin_Message) is never valid
104  */
105 struct sAxWin_Message
106 {
107         uint16_t        ID;
108         uint16_t        Size;   //!< Size in DWORDS
109         char    Data[];
110 };
111
112 struct sAxWin_RetMsg
113 {
114         uint16_t        ReqID;
115         uint16_t        Rsvd;
116         union
117         {
118                  uint8_t        Bool;
119                 uint32_t        Handle;
120                  int    Integer;
121         };
122 };
123
124 #endif

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