@Part[mult-changes, root "thesis.mss"] @appendix[Multics Video System Modifications for MWP] @include[doc.form.mss] The Multics Video System supports basic windowing on standard CRT type devices. It does not support anything but the most primitive form of desk management. There are two major parts are of the video system, each of which is implemented as a Multics "I/O module". An I/O module is simple a piece of code which conforms to the standard Multics I/O calling conventions (i.e. can be dispatched to by the iox_ subroutine). The two video system I/O modules are window_io_, which is responsible for operations on windows, and terminal control (tc_io_) which is responsible for mapping window operations into operations on a given terminal. @section(Modifications to window_io_) The application interface to those window_io_ functions not covered by the standard iox_ I/O functions, is the window_ subroutine. The window_$create entrypoint will be enhanced and several new entrypoints will be added. Window_call, the command language interface to window_ will be upgraded as well. One window_io_ control order will be enhanced. @subsection(window_) Window_$create: The window_position_info parameter will be enhanced to include the MWP window attributes. It may point to the following structure, which will be defined in the include file window_control_info.incl.pl1. (Note, the old will structure will still be accepted for compatibility): @begin[programexample] dcl 1 window_attributes_info aligned based (window_attributes_info_ptr), 2 version char(8), 2 name char(256) varying, 2 position_info aligned like window_position_info, 2 flags, 3 vertical_scrolling unaligned bit(1), 3 horizontal_scrolling unaligned bit(1), 3 mbz unaligned bit(34); dcl window_attributes_info_ptr ptr; dcl window_attributes_info_version_1 char(8) init static options (constant) init ("wati0001"); where: @begin[enumerate, indent 0, above 1] version (Input)@\ is the version of the structure. The current version is window_attributes_info_version_1. name (Input)@\ is the name of the window. position_info (Input)@\ is a window_position_info structure (defined in window_control_info.incl.pl1) which describes the location and size of the window. vertical_scrolling (Input)@\ is true if the application creating the window is prepared to deal with vertical scrolling events. horizontal_scrolling (Input)@\ is true if the application creating the window is prepared to deal with horizontal scrolling events. @end[enumerate] @end[programexample] @group< @begin[transparent, indent 0] The following entrypoints will be added to window_: @end[transparent] @entry[name="window_$start_mwp", dcl="dcl window_$start_mwp (fixed bin(35));", call="call window_$start_mwp (code)", description="This initializes MWP."] @begin[enumerate, indent 0, above 1] code (Output)@\ is a standard system error code. @end[enumerate] @end[programexample]> @entry[name="window_$select", description="This is used to select a window as defined in MWP.", dcl="dcl window_$select (ptr, fixed bin(35));", call="call window_$select (window_iocb_ptr, code);"] @begin[enumerate, indent 0, above 1] window_iocb_ptr (Input)@\ is a pointer to an IOCB attached via window_io_. code (Output)@\ is a standard system error code. @end[enumerate] @end[programexample] @entry[name="window_$surface", description="This is used to bring the specified window to the top of the desktop.", dcl="dcl window_$surface (ptr, fixed bin(35));", call="call window_$surface (window_iocb_ptr, code);"] @begin[enumerate, indent 0, above 1] window_iocb_ptr (Input)@\ is a pointer to an IOCB attached via window_io_. code (Output)@\ is a standard system error code. @end[enumerate] @end[programexample] @entry[name=window_$bury, description="This is used to bury the specified window beneath existing windows on the desktop.", dcl="dcl window_$bury (ptr, fixed bin(35));", call="call window_$bury (window_iocb_ptr, code);"] @begin[enumerate, indent 0, above 1] window_iocb_ptr (Input)@\ is a pointer to an IOCB attach via window_io_. code (Output)@\ is a standard system error code. @end[enumerate] @end[programexample] @entry[name="window_$move", description=" This is used to move the window to a new location on the screen.", dcl="dcl window_$move (ptr, ptr, fixed bin(35);", call="call window_$move (window_iocb_ptr, window_position_info_ptr, code);"] @begin[enumerate, indent 0, above 1] window_iocb_ptr (Input)@\ is a pointer to an IOCB attached via window_io_. window_position_info_ptr (Input)@\ is a pointer to a window_position_info structure. The new location is given by window_position_info.origin. If column and line are both zero, they are not specified and the workstation will query the user (Multics window coordinates are one-based). The value of window_position_info.extent is not used. code (Output)@\ is a standard system error code. @end[enumerate] @end[programexample] @entry[name="window_$resize", description="This entry is used to resize a window.", dcl="dcl window_$resize entry (ptr, ptr, fixed bin(35);", call="call window_$resize (window_iocb_ptr, window_position_info_ptr, code);"] @begin[enumerate, indent 0, above 1] window_iocb_ptr (Input)@\ is a pointer to an IOCB attached via window_io_. window_position_info_ptr (Input)@\ is a pointer to a window_position_info structure (defined in window_control_info.incl.pl1). The new window size is taken from window_position_info.extent. If width and height are both zero, they are not specified and the workstation will query the user. The value of window_position_info.origin is not used. code (Output)@\ is a standard system error code. @end[enumerate] @end[programexample] @group< The following entries will be added to window_ to support the scrolling protocol: @entry[name="window_$disable_scrolling", description="This entry is used to disable scrolling for the specified window.", dcl="dcl window_$disable_scrolling entry (ptr, bit(1) aligned, bit(1) aligned, fixed bin(35))", call= "call window_$disable_scrolling (window_iocb_ptr, horizontal, vertical, code);"] @begin[enumerate, indent 0, above 1] window_iocb_ptr (Input)@\ is a pointer to an IOCB attached via window_io_. horizontal (Input)@\ if true horizontal scrolling is to be disabled. vertical (Input)@\ if true vertical scrolling is to be disabled. code (Output)@\ is a standard system error code. @end[enumerate] @end[programexample]> @entry[name="window_$enable_scrolling", description="This entry is used to enable scrolling for the specified window.", dcl="dcl window_$enable_scrolling entry (ptr, bit(1) aligned, bit(1) aligned, entry (ptr, fixed bin(35)), fixed bin(35))", call= "call window_$enable_scrolling (window_iocb_ptr, horizontal, vertical, scroll_event_handler, code);"] @begin[enumerate, indent 0, above 1] window_iocb_ptr (Input)@\ is a pointer to an IOCB attached via window_io_. horizontal (Input)@\ if true horizontal scrolling is enabled. vertical (Input)@\ if true vertical scrolling is enabled. scroll_event_handler (Input)@\ is an entry which should be called when a SCROLL command is sent by the workstation. It should take two arguments, a pointer to a scroll_event_info structure (described below and defined in window_control_info.incl.pl1) and a code variable. code (Output)@\ is a standard system error code. If the specified window does not have the proper scrolling attribute or the workstation does not implement the proper scrolling option the error code video_et_$capability_lacking will be returned. @end[enumerate] @end[programexample] @group< The scroll_event_info structure: @begin[programexample] dcl 1 scroll_event_info aligned based (scroll_event_info_ptr), 2 version char(8), 2 direction fixed bin, 2 flags, 3 absolute unaligned bit(1), 3 mbz unaligned bit(35), 2 distance fixed bin (21); where: @begin[enumerate, indent 0, above 1] version@\ the version of the scroll_event_info being passed to the event handler, currently scroll_event_info_version_1. direction@\ is one of the following constants defined in window_control_info.incl.pl1: SCROLL_VERTICAL or SCROLL_HORIZONTAL. absolute@\ is true if position is to be interpreted as an absolute position, otherwise position will be a relative position. position@\ is the number of line (or column depending on the value of direction) which the workstation wants to be displayed in the top line (or leftmost column) of the window. @end[enumerate] @end[programexample]> @entry[name="window_$set_scroll_position", dcl="dcl window_$set_scroll_position entry (ptr, fixed bin(21), fixed bin(21), fixed bin(21), fixed bin(21), fixed bin(35));", call="call window_$set_scroll_position (window_iocb_ptr, top_line, total_lines, left_column, total_columns, code)", description="Informs tc_io_ (and hence the workstation) of the current position of the window. The workstation will probably display this information to the user."] @begin[enumerate, indent 0, above 1] window_iocb_ptr (Input)@\ is a pointer to an IOCB attached via window_io_. top_line (Input)@\ is the top line currently displayed in the window. total_lines (Input)@\ is the last line number which may be displayed in the window. leftmost_column (Input)@\ is the left most column which is displayed in the window. total_columns (Input)@\ is the last column which can be displayed in the window. code (Output)@\ is a standard system error code. If the specified window does not have either the vertical or horizontal scrolling attribute the error code video_et_$capability_lacking will be returned. @end[enumerate] @end[programexample] @subsection(window_call) Window_Call keywords and new control arguments will be added to support the window_ entries. @subsection(window_io_ control orders) The @i[set_window_info] control order and its companion @i[get_window_info] will also be modified to handle window_attributes_info structures, as well as the current window_position_info structures. @section(Modifications to tc_io_) Window_io_ will inform terminal control of the MWP requests via the following additions to tc_operations_.incl.pl1. These will supplement existing mechanisms (i.e. the "check_(in out)_window" control orders), rather than replacing them. The new tc operations will be the only method to generate the MWP sequences sent to the workstation. @begin[programexample] dcl OP_CREATE_WINDOW fixed bin initial (17) internal static options (constant); dcl 1 request_create aligned based (request_ptr), 2 header aligned like request_header, 2 window_attributes_info_ptr ptr; @end[programexample] @begin[programexample] dcl OP_DELETE_WINDOW fixed bin initial (18) internal static options (constant); dcl 1 request_delete aligned based (request_ptr), 2 header aligned like request_header; @end[programexample] @begin[programexample] dcl OP_SELECT_WINDOW fixed bin initial(19) internal static options (constant); dcl OP_SURFACE_WINDOW fixed bin initial(20) internal static options (constant); dcl OP_BURY_WINDOW fixed bin initial(21) internal static options (constant); dcl OP_MOVE_WINDOW fixed bin initial(22) internal static options (constant); dcl OP_RESIZE_WINDOW fixed bin initial(23) internal static options (constant); dcl OP_SET_WINDOW_INFO fixed bin initial (24) internal static options (constant); dcl 1 request_set_window_info aligned like request_create based (request_ptr); dcl OP_DISABLE_SCROLLING fixed bin initial (25) internal static options (constant); dcl OP_ENABLE_SCROLLING fixed bin initial (26) internal static options (constant); dcl OP_SET_SCROLL_POSITION fixed bin initial (27) internal static options (constant); @end[programexample] Terminal control (tc_input.pl1) will look for APC strings when reading and take the correct action. It will respond directly to the workstation as much as possible, for example when the workstation requests the current scroll position. When window creation is requested, terminal control will create the iocb, and start a control point (i.e. a task) with standard iocbs mapped to the newly created iocb. Terminal control will isolate the user from having to perform selection commands by wrapping the correct selection commands around an I/O request done to an inactive window. How will terminal control map MWP Operations into the correct DCS strings? One possibility is to extend the TTF @cite(TTF) to include entries for each new operation. This is deficient because it would require major changes to add new types of arguments to TTF sequences, and since MWP only needs to describe one set of sequences, the generic terminal type definition interface and its supporting programs need not be modified. Instead, include file definitions of the sequences will be used and much knowledge of the individual requests will reside in the code itself. In the long run a more flexible replacement for the TTF should be developed. Initial dialog will be started via a new control order @i[start_mwp], which will cause terminal control will do any necessary initialization, negotiate for the implemented options, and inform the workstation of existing windows on Multics. @section(Future Modifications) The next obvious candidate for modification is menu_. This would allow existing menu based applications to take advantage of the workstations choice facilities. However, there is a problem. The existing Multics menu facility assumes that the is forced to make a choice, but many workstation allow the user to abort any menu at any time. This will have to be resolved. It would also be nice to enhance menu_ to take advantage of the new features found in the MWP menu protocol, such as the active menu list. After this more processing could be moved out of window_io_iox_.pl1 and into the workstation by implementing the option described in section @ref(moreprocessing). Further MWP extensions, as described in chapter @ref(extensions), would also fit in well with existing Multics software. Extensions such as translation tables or local echo negotiation would require few changes on Multics, but could represent a large increase in performance and functionality.