Communications between cadiz and a window take place using an ASCII language. Where mathematical symbols need to be communicated, the ISO Standard E-mail mark-up is used.
Instances of windows are created by cadiz calling the scripts mip/bin/*proof. The scripts are given an option -b hostname,port allowing a socket to be established over which the communications take place.
The first implementation of a window that communicates with cadiz using this language is the auxiliary tool proof. An alternative implementation could be configured by alterations to the mip/bin/*proof scripts.
For communications initiated by cadiz, there is a library of operations declared in src/include/window.h that abstract away from the particular messages.
For communications initiated by a window, there are only two possible messages. They are received within cadiz by serviceproof(), and are as follows.
where the string is the name of the displayed file and the numbers identify the currently selected formulae, the first number being the most recent selection. This message is sent when the user wishes to inspect a formula. The window can expect to receive a response from cadiz.
This message is sent when the user wishes to quit.
(It follows that all other operations initiated by the user are handled by the window without assistance from cadiz. In particular, selection of formulae prior to inspection is supported by information embedded in the formatted text.)
The messages from cadiz that a window should recognise are as follows.
Engage the user in a dialogue, using the first string as a prompt and the second string as the default response. The response expected by cadiz is "D%s\n" where the string is the response, or "d\n" if the user cancelled the dialogue.
The given filename is that of a file which is part of the current specification. No response is expected by cadiz. This filename may be used to assist the user's navigation of the spec.
If the given filename is not that of the currently displayed file, display the corresponding file's first page. No response is expected by cadiz.
Offer the user a menu whose items are the given strings in order. The given number indicates which item should be highlighted on initial display of the menu, counting from 0. Within each item, if the character \034 appears, that marks the end of the item and the start of an explanation of it. The explanations are for display as the user moves the selection over corresponding items. The response expected by cadiz is "M%d\n" where the number is that of the chosen item counting from 0, or "M-1\n" if the user cancelled the menu.
Set status indicator to ready (e.g. change the cursor to an arrow), and henceforth respond to user interactions until another message instructs otherwise. No response is expected by cadiz.
Display the given message. Newlines may be encoded within the message using "\r" (return). No response is expected by cadiz. The user will typically be provided with some means of acknowledging the message, after which it will be removed from the display.
Exit. No response is expected by cadiz.
Report back the name of the current file and the number of the latest current selection. The response expected by cadiz is of the form "F%s\nS%d\n" where the number is -1 if there is no current selection.
Synchronize with the start of the next document on the formatting stream (so that messages containing selection numbers will be interpreted against the appropriate file). No response is expected by cadiz.
Select the formulae in the current file that are identified by the given numbers. The first number is that of the principle selection. No response is expected by cadiz.
Display the given message as an aside. No response is expected by cadiz.
Set status indicator to busy (e.g. change the cursor to a clock), and henceforth ignore user interactions until another message is received from cadiz. No response is expected by cadiz. This message is sent by cadiz before embarking on a computation (typically requested by the user) that may take some time.
Set status indicator to busy (e.g. change the cursor to an hourglass), and henceforth ignore user interactions until another message is received from cadiz. No response is expected by cadiz. This message is sent by cadiz before embarking on a garbage collection.