next up previous contents index
Next: Exit Up: Main Functions 1 Previous: Symbol Tables   Contents   Index

Display

(int) Window(x, y, width, win)
The window view is changed so that it is centered at x, y and has width set by the third argument. If the width argument is less than or equal to zero, a centered, full view of the current cell is obtained. In this case, the x, y arguments are ignored. The win is an integer 0-4 which specifies the window:

0 Main drawing window
1-4 Sub-window (number as shown in title bar)

The function returns 1 on success, 0 if the indicated window does not exist.

(int) GetWindow()
This function returns the window number of the drawing window that contains the pointer. The window number is an integer 0-4:

0 Main drawing window
1-4 Sub-window (number as shown in title bar)

If the pointer is not in a drawing window, 0 is returned.

(int) GetWindowView(win, array)
This function returns the view area (visible cell coordinates) of the given window win, which is an integer 0-4 where 0 is the main window and 1-4 represent sub-windows. The view coordinates, in microns, are returned in the array, in order L, B, R, T. On success, 1 is returned, otherwise 0 is returned and the array is untouched.

(int) GetWindowMode(win)
This function returns the display mode of the given window win, which is 0 for physical mode, 1 for electrical, or -1 if the window does not exist. The argument is an integer 0-4, where 0 represents the main window and 1-4 indicate sub-windows. This function is identical to CurMode.

(int) Expand(win, string)
This sets the expansion mode for the display in the window specified in win. The win argument is an integer 0-4, where 0 refers to the main window, and 1-4 correspond to the sub-windows brought up with the Viewport command. The string contains characters which modify the display mode, as would be given to the Expand command in the View Menu.

integer set expand level
n set level to 0
a expand all
+ increment expand level
- decrement expand level

(int) Display(display_string, win_id, l, b, r, t)
This function will render the current cell in a foreign X window. The X window id is passed as an integer in the second argument. The first argument is the X display string corresponding to the server in which the window is cached. The remaining arguments set the area to be displayed, in microns. The function returns 1 upon success, 0 otherwise. This function is useful for rendering a layout if interactive graphics is not enabled, such as in server mode. This function will not work under Microsoft Windows.

This is a primitive to allow Xic to export graphics rendering capability. The intention is that this might be used in a Tk script (for example) that is otherwise using Xic in server mode as a back-end. The machine containing the window to be drawn into must allow X access to the machine running the Xic server (see the xhost Unix command).

One can demonstrate the capability as follows. The ``xwininfo -children'' Unix command can be used to find the window id of a suitable child window in a running application. The top-level window given from xwininfo without the ``-children'' argument is generally obscured by child windows, so this won't work. For example, an xterm window has a single child, which is the id to use. In server mode, a cell must be loaded for editing with the Edit function. Then, a Display command can be given, something like

Display(":0", 0x1800015, -100, -100, 100, 100)

The ":0" is the display name for the local machine, assuming that the Xic server is also running on this machine. In general, this is the same as the DISPLAY environment variable, in the form hostname:0. The second argument is the window id returned from xwininfo. The remaining arguments set the area to display. After giving the command, the window should be overwritten with a display similar to a drawing window in Xic. However, if the window is redrawn, it will revert to its previous contents. The user must set up expose event handling in a real application. The suggested way to do this is to pass the id of a pixmap to Xic, and then copy the pixmap to the destination window. This is usually faster than a direct write, and the pixmap can be used for backing store for expose events.

(int) FreezeDisplay(freeze)
When this function is called with a nonzero argument, the graphical display in the drawing windows will be frozen until a subsequent call of this function with a zero argument, or the script terminates. This is useful for speeding execution, and eliminating distracting screen drawing while a script is running. When the function is called with a zero argument, all drawing windows are refreshed.

(int) Redraw(win)
This function will redraw the window indicated by the argument, which is 0 for the main window or 1-4 for the sub-windows. The function returns 0 if the argument does not correspond to an existing window, 1 otherwise.


next up previous contents index
Next: Exit Up: Main Functions 1 Previous: Symbol Tables   Contents   Index
Stephen R. Whiteley 2017-03-22