aboutsummaryrefslogtreecommitdiffstats
path: root/doc/protocols
blob: c013dd10a0564fbf21a220166eff788fcf912ba1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
---------------------------------------------------------------------

Command: assign-id
  Assign new ID to client, or fetch current ID

Purpose: assigning ID to clients so server can respond to that client

Compulsivity: manditory (core infrastructure)

More documentation: doc/messages

Reference implementation: mds-server

---------------------------------------------------------------------

Command: intercept
  Sign up for reception of message

Optional header: Stop
  Stop reception of messages if `yes`

Optional header: Priority
  Signed 64-bit integer of reception priority (reversed of order)

Optional header: Modifying
  Send message asynchronously and await modification if `yes`

Optional header: Length
  Length of the message

Message: list of headers and header–value-pairs that qualifies
         a message for reception, all messages qualifies if this
	 list is empty

Purpose: filter received message for clients and servers
Purpose: assigned interception order for modification of messages

Compulsivity: manditory (core infrastructure)

More documentation: doc/messages

Reference implementation: mds-server

---------------------------------------------------------------------

Command: echo
  Echo back a message

Required header: Client ID
  Your ID, provided by `ID assignment`
  in response to `Command: assign-id`
  
Optional header: Length
  Length of the message

Message: message to echo

Purpose: debugging and testing
Purpose: network heartbeat

Compulsivity: recommended for network enabled servers

Reference implementation: mds-echo

---------------------------------------------------------------------

Command: register
  Register availability of a command for which you implement a service

Required header: Client ID
  Your ID, provided by `ID assignment`
  in response to `Command: assign-id`

Conditionally required header: Length
  Required if: `Action: list`
  Length of the message

Optional header: Action
  Remove availability for registry if `remove`.
  Wait until listed commands are available if `wait`,
    however if a protocol becomes unavailable during this
    wait period it will still be counted as available for
    this wait action.
  Send a list of availability commands if `list`.

Conditionally optional header: Time to live
  Available and optional if: `Action: wait`
  The maximum number of seconds to wait.

Message: List of values for the header `Command` that you implement

Purpose: Identify supported display server operations
Purpose: Initialisation process synchronisation

Compulsivity: highly recommended (infrastructure), programs may
	      stall a bit from time to time without it, or at
	      initialisation depending on the program's implementation

Reference implementation: mds-registry

---------------------------------------------------------------------

Command: reregister
  Request that all servers resends `Command: register` with either
  `Action: add` or without the `Action` header (does the same thing)

Purpose: Rebuild registry created with `Command: register` if the
	 registry server crashes

Compulsivity: highly recommended (infrastructure), programs may
	      think a protocol is not supported of the registry
	      server crashes if you do not implement this in your
	      server

---------------------------------------------------------------------

Command: clipboard
  Read or manipulate a clipboard

Required header: Level
  The clipboard level, an [1, 3] integer:
    1 "primary".    Text copied/pasted using
      		    the keyboard or a menu item
    2 "secondary".  Text copied/pasted using the rat
    3 "tertiary".   Non-text, it is customary for this
      		    data to begin with a line describing
		    the data type.

Required header: Action
  What to do with the clipboard:
    add)  Write the message to the clipboard
    read)  Read the clipboard
    clear)  Clear all entries on the selected level on the clipboard
    set-size)  Shrink/grow the clipstack
    get-size)  Read the size of the clipstack
      In the reply, the server will send:
	Size: <configured maximum size of the clipstack>
	Used: <number of elements currently in the clipstack>

Conditionally required header: Length
  Required if: `Action: add`
  Length of the message

Conditionally required header: Size
  Required if: `Action: set-size`
  The maximum number of elements in the clipstack

Conditionally required header: Client ID
  Your ID, provided by `ID assignment`
  in response to `Command: assign-id`.
  Required if: `Action: add` and a header starting with
  	       `Time to live: until-death`
  Required if: `Action: read`
  Required if: `Action: get-size`

Conditionally optional header: Index
  Available and optional if: `Action: read`
  The index of the item in the clipstack, starting at 0

Conditionally optional header: Time to live
  Available and optional if: `Action: add`
  The number of seconds the entry should be available
  before it is removed by the server, or:
    until-death: remove entry when the client closes
    until-death #: remove entry when the client closes,
    		   or # seconds have elapsed
    forever: never remove it (default)
  The server will always remove the entry when:
    1) it is at the bottom of the clipstack and a new
       entry is added to the clipstack
    2) `Action: clear` is issued for the clipstack
  The entry will also be removed, unless
  `Time to live: forever`, if the server crashes or is
  reexecuted.
  It is up to the implementation to choose when
  the removal actually takes place. For example,
  the reference implementation will pop entries
  that have timed out when a new entry is added,
  the reading on the clipstack is requested or the
  server is reexecuted, but another implement may
  choose to pop entires asynchronously using another
  thread or an alarm an pop when when SIGARLM is
  received.

Message: The content to add to the clipboard

Purpose: Enable the user to duplicate content from one process
	 into another process without requiring those processes
	 to be aware of eathother to any extent

Compulsivity: optional

Reference implementation: mds-clipboard

---------------------------------------------------------------------

Command: clipboard-info
  The clipboard server sends out some information about
  what it is doing, such as automatically removing entires

Included header: Event
  pop)  An item in the clipstack has been removed
    Included headers:
      Level:   The clipboard level that has been affected
      Popped:  The index of the item in the clipstack
      	       that has been removed
      Size:    Configured maximum size of the clipstack
      Used:    Number of elements currently in the clipstack
  crash)  The clipboard has been reset because of a software crash

Purpose: Enable clients to get notification about changes
	 to the clipboard, that cannot trivially derived
	 from `Command: clipboard`

Compulsivity: optional, optional add-on to the
	      clipboard's functionallity

Reference implementation: mds-clipboard

---------------------------------------------------------------------

Command: add-tray-icon
  Add a status icons to the status icon tray
  The client should keep in mind that there can be any number of
  trays available on the system: zero, one, two or three, ...,
  and that it will get a response once from every tray

Required header: Client ID
  Your ID, provided by `ID assignment`
  in response to `Command: assign-id`

Required header: Package
  The name of the package to which the program announced the icon
  belongs

Required header: Icon ID
  An ID of the icon that can be used identify the icon, icon ID:s
  are not unique, but the combination of a package and a icon ID
  should be unque and can be used to ignore already added icons
  and hide icons that the user has been configured to be hidden

Required header: Title
  A title describing the icon for the user, used to configured
  when icons should be hidden and shown among other configuration

Required header: Icon
  The name or pathname of an icon to use together with the title

Response:
  To: <Client ID>
  In response to: <Message ID>
  Message ID: <the status tray's message ID>
  Socket: <Where to embed the icon>
  Will send update: <`yes` if this message will be followed by
       	    	     `Command: tray-update`, otherwise `no`>

Purpose: Enable clients to add a small icon that displays the status
	 of programs, particularly minimised programs and services

Compulsivity: optional

---------------------------------------------------------------------

Command: update-tray-icon
  Change the status of a status icon

Purpose: Enable status trays to automatically hide inactive icons
Purpose: Hide icons without actually removing them

Compulsivity: optional

---------------------------------------------------------------------

Command: tray-update
  Send updates about the status tray to the status icon

Purpose: Enable clients to be aware of the appearance of the tray,
	 such as colours, transparency and background image

Compulsivity: optional

---------------------------------------------------------------------

Command: new-tray
  Announce the existence of a new status icon trays

Purpose: Allow clients to add their status icons to status icon
	 trays that have been added to the display after those
	 programs have started and attempted to add their icons

Compulsivity: required if supporting `Command: add-tray-icon`

---------------------------------------------------------------------