61536f351c18ca58baa342ad12487527a8878d80
[tpg/acess2.git] / Usermode / Libraries / libaxwin2.so_src / include_exp / 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         // Client->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_ADDWIN,        // ELEMENT (char[] Name) - Adds a tab to the window
31         
32         MSG_SREQ_SETICON,       // void (TAB Tab, char[] IconURI)       - Set the icon of a tab (or application)
33
34         MSG_SREQ_NEWDIALOG,     // DIALOG (TAB Parent, char[] Name)     - Creates a dialog
35         MSG_SREQ_DELDIALOG,     // void (DIALOG Dialog) - Closes a dialog
36         
37         MSG_SREQ_SETNAME,       // void (ELEMENT Element, char[] Name)
38         MSG_SREQ_GETNAME,       // char[] (ELEMENT Element)
39         
40         // - Builtin Elements
41         MSG_SREQ_INSERT,        // ELEMENT (ELEMENT Parent, eAxWin_Controls Type, u32 Flags)
42         MSG_SREQ_DELETE,        // void (ELEMENT Element)
43         
44         // - Drawing
45         //  All drawing functions take an ELEMENT as their first parameter.
46         //  This must be either a Window or Canvas control
47         MSG_SREQ_SETCOL,
48         MSG_SREQ_PSET,
49         MSG_SREQ_LINE,  MSG_SREQ_CURVE,
50         MSG_SREQ_RECT,  MSG_SREQ_FILLRECT,
51         MSG_SREQ_RIMG,  MSG_SREQ_SIMG,  // Register/Set Image
52         MSG_SREQ_SETFONT,       MSG_SREQ_PUTTEXT,
53
54         // - Callback Registration
55
56         // - WM Control
57         MSG_SREQ_SET_MAXIMIZE_AREA,     // void (uint16_t X, Y, W, H)
58         
59         // Server->Client Responses
60         MSG_SRSP_VERSION,
61         MSG_SRSP_RETURN,        // {int RequestID, void[] Return Value} - Returns a value from a server request
62         
63         NUM_MSG
64 };
65
66 // --- Server Requests (Requests from the client of the server)
67 /**
68  * \brief Server Request - Ping (Get Server Version)
69  */
70 struct sAxWin_SReq_Ping
71 {
72 };
73
74 /**
75  * \brief Server Request - New Window
76  * \see eAxWin_Messages.MSG_SREQ_NEWWINDOW
77  */
78 struct sAxWin_SReq_NewWindow
79 {
80         uint16_t        X, Y, W, H;
81         uint32_t        Flags;
82 };
83
84 struct sAxWin_SReq_NewElement
85 {
86         uint16_t        Parent;
87         uint16_t        Type;
88         uint32_t        Flags;
89 };
90
91
92 // --- Server Responses
93 /**
94  * \brief Server Response - Pong
95  * \see eAxWin_Messages.MSG_SRSP_PONG
96  */
97 struct sAxWin_SRsp_Version
98 {
99         uint8_t Major;
100         uint8_t Minor;
101         uint16_t        Build;
102 };
103
104
105 // === Core Message Structure
106 /**
107  * \brief Overarching Message Structure
108  * \note sizeof(tAxWin_Message) is never valid
109  */
110 struct sAxWin_Message
111 {
112         uint32_t        Source;
113         uint16_t        ID;
114         uint16_t        Size;   // Size of data
115         char    Data[];
116 };
117
118 struct sAxWin_RetMsg
119 {
120         uint16_t        ReqID;
121         uint16_t        Rsvd;
122         uint32_t        Value;
123 };
124
125 #endif

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