1 |
TODO |
2 |
---- |
3 |
|
4 |
* Command for executing new programs. |
5 |
|
6 |
* Commands for changing z order and focus. |
7 |
|
8 |
* Command for transferring icon. |
9 |
|
10 |
* Think about protocol version management |
11 |
|
12 |
* Try to assure that messages aren't repeated or are sent for hidden windows. |
13 |
|
14 |
Overview |
15 |
======== |
16 |
|
17 |
The protocol is a line based protocol following this simple syntax: |
18 |
|
19 |
OPERATION[,ARG1[,ARG2,[...]]] |
20 |
|
21 |
The goal is to have a generic protocol that can be used for other display |
22 |
systems (e.g. VNC) as well. |
23 |
|
24 |
One line may not exceed 1024 bytes, including newline. |
25 |
|
26 |
The protocol has no concept of hidden or unmapped windows. A window does not |
27 |
exist unless it is visible. Note that a minimised window is an exception to |
28 |
this rule. |
29 |
|
30 |
Data types |
31 |
========== |
32 |
Window ID are written in hex, like 0x4321. |
33 |
|
34 |
Window positions can be negative. This happens when a window is moved |
35 |
outside the desktop. |
36 |
|
37 |
All integers fit inside 32 bits. |
38 |
|
39 |
Server to Client Operations |
40 |
=========================== |
41 |
|
42 |
CREATE |
43 |
------ |
44 |
|
45 |
Allocate structures for a new window. |
46 |
|
47 |
Syntax: |
48 |
CREATE,<ID>,<FLAGS> |
49 |
|
50 |
Note that very little information is included in this message. Things like |
51 |
title and state will come in subsequent messages. This message should only |
52 |
be used to allocate data structures for the new window. |
53 |
|
54 |
DESTROY |
55 |
------- |
56 |
|
57 |
Remove a window. |
58 |
|
59 |
Syntax: |
60 |
DESTROY,<ID>,<FLAGS> |
61 |
|
62 |
Remove the window and deallocate all associated structures. |
63 |
|
64 |
POSITION |
65 |
-------- |
66 |
|
67 |
Move and/or resize a window. |
68 |
|
69 |
Syntax: |
70 |
POSITION,<ID>,<X>,<Y>,<WIDTH>,<HEIGHT>,<FLAGS> |
71 |
|
72 |
If the window isn't visible yet (because a |
73 |
STATE hasn't been set or because it's minimised), you must store the position |
74 |
and size. A new POSITION is not guaranteed to be sent when the window changes |
75 |
state. |
76 |
|
77 |
TITLE |
78 |
----- |
79 |
|
80 |
Sets a window title. |
81 |
|
82 |
Syntax: |
83 |
TITLE,<ID>,<TITLE>,<FLAGS> |
84 |
|
85 |
The text is guaranteed to be stripped of control characters (< 0x20). |
86 |
|
87 |
Note that this has the same requirement as POSITION, that the title needs to |
88 |
be stored for newly created windows until a STATE is sent. |
89 |
|
90 |
|
91 |
ZCHANGE |
92 |
------- |
93 |
|
94 |
The window moved in z order. |
95 |
|
96 |
Syntax: |
97 |
ZCHANGE,<ID>,<BEHIND>,<FLAGS> |
98 |
|
99 |
The window with the id ID is behind the window with the id BEHIND. If |
100 |
BEHIND is 0, then this window should be brought to the front. |
101 |
|
102 |
STATE |
103 |
----- |
104 |
|
105 |
Changes the window's state and/or title. |
106 |
|
107 |
Syntax: |
108 |
STATE,<ID>,<STATE>,<FLAGS> |
109 |
|
110 |
State can have one of three values: |
111 |
0 : "Normal" window. |
112 |
1 : Minimised. |
113 |
2 : Maximised. |
114 |
|
115 |
|
116 |
DEBUG |
117 |
----- |
118 |
|
119 |
Debug output from the server component. |
120 |
|
121 |
Syntax: |
122 |
DEBUG,<STRING> |
123 |
|
124 |
Used for debugging. |
125 |
|
126 |
SYNCBEGIN |
127 |
--------- |
128 |
|
129 |
Indicates that a synchronisation has begun. |
130 |
|
131 |
Syntax: |
132 |
SYNCBEGIN,<FLAGS> |
133 |
|
134 |
Sent when the server starts a synchronisation. The client should flush all |
135 |
information at this point. |
136 |
|
137 |
SYNCEND |
138 |
------- |
139 |
|
140 |
Indicates that a synchronisation is complete. |
141 |
|
142 |
Syntac: |
143 |
SYNCEND,<FLAGS> |
144 |
|
145 |
Sent when the last message that is part of the synchronisation has been sent. |
146 |
This may be followed by duplicate messages and/or messages referring invalid |
147 |
windows that were queued up during the synchronisation. |
148 |
|
149 |
Client to Server Operations |
150 |
=========================== |
151 |
|
152 |
SYNC |
153 |
---- |
154 |
|
155 |
Request a synchronisation of window information. |
156 |
|
157 |
Syntax: |
158 |
SYNC,<FLAGS> |
159 |
|
160 |
For each window, the server will send CREATE, POSITION and SETSTATE just as |
161 |
if the window was created. |
162 |
|
163 |
POSITION |
164 |
-------- |
165 |
|
166 |
Identical to the command sent from server to client. |
167 |
|
168 |
TITLE |
169 |
----- |
170 |
|
171 |
Identical to the command sent from server to client. |
172 |
|
173 |
ZCHANGE |
174 |
------- |
175 |
|
176 |
Identical to the command sent from server to client. |
177 |
|
178 |
STATE |
179 |
----- |
180 |
|
181 |
Identical to the command sent from server to client. |
182 |
|
183 |
FOCUS |
184 |
----- |
185 |
|
186 |
Sets which window has input focus. |
187 |
|
188 |
Syntax: |
189 |
FOCUS,<ID>,<FLAGS> |
190 |
|
191 |
Changes which window that will recieve the keyboard events. Note that this |
192 |
might cause the window to change z order. |