home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1990-10-20 | 173.8 KB | 3,697 lines
M✓M✓M✓MG✓G✓G✓GR✓R✓R✓R -✓-✓-✓- C✓C✓C✓C L✓L✓L✓La✓a✓a✓an✓n✓n✓ng✓g✓g✓gu✓u✓u✓ua✓a✓a✓ag✓g✓g✓ge✓e✓e✓e A✓A✓A✓Ap✓p✓p✓pp✓p✓p✓pl✓l✓l✓li✓i✓i✓ic✓c✓c✓ca✓a✓a✓at✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rf✓f✓f✓fa✓a✓a✓ac✓c✓c✓ce✓e✓e✓e Stephen A. Uhler Bell Communications Research _✓A_✓B_✓S_✓T_✓R_✓A_✓C_✓T MGR (m✓m✓m✓manag✓g✓g✓ger✓r✓r✓r) is a window system for Unix that currently runs on Sun Workstations. MGR manages asynchronous updates of overlapping windows and provides application support for a heterogeneous network environment, i.e., many different types of computers connected by various communications media. The appli- cation interface enables applications (called client programs) to be written in a variety of programming languages, and run on dif- ferent operating systems. The client program can take full advantage of the windowing capabilities regardless of the type of connection to the workstation running MGR. This document describes the C interface library for MGR which provides a set of macros and functions that implement the stream protocol. This library provides client programs written in _✓C with a function call interface to MGR. The library provides the lowest level access to MGR functions and represents a one to one mapping to the underlying stream protocol. July 7, 1988 - _✓i - T✓T✓T✓Ta✓a✓a✓ab✓b✓b✓bl✓l✓l✓le✓e✓e✓e o✓o✓o✓of✓f✓f✓f C✓C✓C✓Co✓o✓o✓on✓n✓n✓nt✓t✓t✓te✓e✓e✓en✓n✓n✓nt✓t✓t✓ts✓s✓s✓s Introduction ............................................................ 1 Model of Interaction .................................................... 3 Coordinate Systems ...................................................... 3 Functional Overview ..................................................... 4 Underlying Protocol ..................................................... 7 Conventions and Notation ................................................ 9 Macros .................................................................. 11 Functions ............................................................... 36 Using the Library ....................................................... 40 Glossary ................................................................ 41 Sample Client Program ................................................... 44 Macros and Functions by Category ........................................ 46 Macro and Function Index ................................................ 53 July 7, 1988 MGR 4.0 c 1988 Bellcore M✓M✓M✓MG✓G✓G✓GR✓R✓R✓R -✓-✓-✓- C✓C✓C✓C L✓L✓L✓La✓a✓a✓an✓n✓n✓ng✓g✓g✓gu✓u✓u✓ua✓a✓a✓ag✓g✓g✓ge✓e✓e✓e A✓A✓A✓Ap✓p✓p✓pp✓p✓p✓pl✓l✓l✓li✓i✓i✓ic✓c✓c✓ca✓a✓a✓at✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rf✓f✓f✓fa✓a✓a✓ac✓c✓c✓ce✓e✓e✓e Stephen A. Uhler Bell Communications Research July 7, 1988 MGR 4.0 c 1988 Bellcore M✓M✓M✓MG✓G✓G✓GR✓R✓R✓R -✓-✓-✓- C✓C✓C✓C L✓L✓L✓La✓a✓a✓an✓n✓n✓ng✓g✓g✓gu✓u✓u✓ua✓a✓a✓ag✓g✓g✓ge✓e✓e✓e A✓A✓A✓Ap✓p✓p✓pp✓p✓p✓pl✓l✓l✓li✓i✓i✓ic✓c✓c✓ca✓a✓a✓at✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rf✓f✓f✓fa✓a✓a✓ac✓c✓c✓ce✓e✓e✓e Stephen A. Uhler Bell Communications Research => _✓I_✓n_✓t_✓r_✓o_✓d_✓u_✓c_✓t_✓i_✓o_✓n MGR (m✓m✓m✓manag✓g✓g✓ger✓r✓r✓r) is a window system for Unix that currently runs on Sun Worksta- tions. MGR manages asynchronous updates of overlapping windows and provides application support for a heterogeneous network environment, i.e., many dif- ferent types of computers connected by various communications media. The application interface enables applications (called client programs) to be written in a variety of programming languages, and run on different operating systems. The client program can take full advantage of the windowing capabil- ities regardless of the type of connection to the workstation running MGR. Client programs communicate with MGR via _✓p_✓s_✓e_✓u_✓d_✓o-_✓t_✓e_✓r_✓m_✓i_✓n_✓a_✓l_✓s over a reliable byte stream. Each client program can create and manipulate one or more windows on the display, with commands and data to the various windows multiplexed over the same connection. MGR provides ASCII terminal emulation and takes respon- sibility for maintaining the integrity of the window contents when parts of windows become obscured and subsequently uncovered. This permits naive appli- cations to work without modification by providing a default environment that appears to be an ordinary terminal. In addition to terminal emulation, MGR provides each client window with: graphics primitives such as line and circle drawing; facilities for manipulat- ing bitmaps, fonts, icons, and pop-up menus; commands to reshape and position windows; and a message passing facility enabling client programs to rendezvous and exchange messages. Client programs may ask to be informed when a change in the window system occurs, such as a reshaped window, a pushed mouse button, or a message sent from another client program. These changes are called events. MGR notifies a client program of an event by sending it an ASCII character string in a format specified by the client program. Existing appli- cations can be integrated into the windowing environment without modification _________________________ Copyright (c) 1988 Bellcore All Rights Reserved Permission is granted to copy or use this program, EXCEPT that it may not be sold for profit, the copyright notice must be reproduced on copies, and credit should be given to Bellcore where it is due. BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 2 - Introduction by having MGR imitate keystrokes in response to user defined menus or other events. The user interface provides a simple point-and-select model of interaction using the mouse with pop-up menus and quick access to system functions through meta-keys on the keyboard. MGR also provides a _✓c_✓u_✓t and _✓p_✓a_✓s_✓t_✓e function that permits a user to sweep out and copy text from any window and paste it into any other. This document describes the low level C interface library for MGR. The _✓C _✓I_✓n_✓t_✓e_✓r_✓f_✓a_✓c_✓e _✓l_✓i_✓b_✓r_✓a_✓r_✓y provides a set of macros and functions which implement the stream protocol and provide clients written in _✓C with a function call inter- face to MGR. This library provides the lowest level access to MGR functions and represents a direct mapping to the underlying protocol. It is expected that a higher level interface will evolve to support application development at a higher level. The library requires only the UNIX _✓S_✓t_✓a_✓n_✓d_✓a_✓r_✓d _✓I/_✓O _✓L_✓i_✓b_✓r_✓a_✓r_✓y for its operation and access to a byte sequential I/O interface from the underlying operating system. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 3 - Model of Interaction => _✓M_✓o_✓d_✓e_✓l _✓o_✓f _✓I_✓n_✓t_✓e_✓r_✓a_✓c_✓t_✓i_✓o_✓n The basic unit within MGR is the window. A window is a rectangular region on the display, surrounded by a border, with a single connection to other processes. All interactions among the client program, the user and MGR are defined entirely in terms of the state of a client's window or windows. MGR has no concept of window types; there are no separate _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓w_✓i_✓n_✓d_✓o_✓w_✓s, _✓t_✓e_✓x_✓t _✓w_✓i_✓n_✓d_✓o_✓w_✓s, or _✓e_✓d_✓i_✓t _✓w_✓i_✓n_✓d_✓o_✓w_✓s. Every window supports exactly the same set of capa- bilities as every other window. In addition, all windows act independently. Client programs need not know or care about the existence of other clients or windows that happen to coexist on the same display. The management of over- lapping windows is handled entirely by MGR. For example, when a window is partially or totally obscured by another window, then subsequently uncovered, MGR restores the integrity of the window's contents. There are no _✓s_✓u_✓b- _✓w_✓i_✓n_✓d_✓o_✓w_✓s, windows whose size or position are in some way restricted by a parent window. A client may create and manipulate many windows, each of which may be positioned and sized independently on the display. At any given time there is one special window on the display, the _✓a_✓c_✓t_✓i_✓v_✓e win- dow. This is the window that receives keystrokes and mouse data. It is dis- tinguishable to the user from the other windows on the display by its embol- dened border. The active window, in addition to receiving all mouse and key- board data, is also logically in front of the other windows on the display. The active window is, therefore, always completely exposed. Any window can become the active window, but there can only be one active window at a time. A client program may change its window at any time, write text into it, draw lines, anything, so long as the change is _✓l_✓o_✓c_✓a_✓l, that is the change affects just its window. Only the active window may effect _✓g_✓l_✓o_✓b_✓a_✓l changes to the display, such as changing its shape or position. The only global action a _✓n_✓o_✓n-_✓a_✓c_✓t_✓i_✓v_✓e window may perform is to become the active window. This window model provides both the user and application developer with a simple, con- sistent model of interaction. => _✓C_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e _✓S_✓y_✓s_✓t_✓e_✓m_✓s MGR uses four different coordinate systems, _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates , _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w coordinates, _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w coordinates, and _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinates. The entire display is represented by _✓d_✓i_✓s_✓p_✓l_✓a_✓y _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s whereas each window has its own _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w, _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w, and _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinate sys- tems. _✓D_✓i_✓s_✓p_✓l_✓a_✓y _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s are in units of pixels. The coordinate ( 0✓0✓0✓0,0✓0✓0✓0)is the top left pixel on the display. The _✓X coordinate increases to the right, the _✓Y coordinate increases down. The maximum _✓X and _✓Y coordinate depend upon the particular display in use, for the SUN-3 they are 1✓1✓1✓11✓1✓1✓15✓5✓5✓52✓2✓2✓2 by 9✓9✓9✓90✓0✓0✓00✓0✓0✓0. Commands that operate on the context of the entire display, such as reshaping a window are specified in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. Windows, when measured in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordi- nates include their borders. _✓A_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s, as with _✓d_✓i_✓s_✓p_✓l_✓a_✓y _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s, are measured in units of pixels. The X✓X✓X✓X and Y✓Y✓Y✓Y values increase to the right and down respec- tively. The origin, coordinate ( 0✓0✓0✓0,0✓0✓0✓0)is at the top left corner of the window, just inside the window border. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 4 - Coordinate Systems _✓R_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s are measured as a fraction of the window's size and shape. As with _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s, each window has its origin, ( 0✓0✓0✓0,0✓0✓0✓0), at the top left corner of the window just inside the border, however the lower right corner of the window is always at coordinate ( 9✓9✓9✓99✓9✓9✓99✓9✓9✓9,9✓9✓9✓99✓9✓9✓99✓9✓9✓9). Graphics commands to a window in _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s are automatically scaled to the size of the window. _✓C_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s are measured in rows and columns in the current font, just like an ordinary terminal. The coordinate ( 0✓0✓0✓0,0✓0✓0✓0)is the top left charac- ter position in the window. The maximum _✓r_✓o_✓w and _✓c_✓o_✓l_✓u_✓m_✓n in the window depends on both the window and font size. => _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓a_✓l _✓O_✓v_✓e_✓r_✓v_✓i_✓e_✓w The types of commands a client program may issue MGR are divided into 14 categories: _✓t_✓e_✓r_✓m_✓i_✓n_✓a_✓l _✓e_✓m_✓u_✓l_✓a_✓t_✓i_✓o_✓n, _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s, _✓b_✓i_✓t-_✓b_✓l_✓t_✓s, _✓w_✓i_✓n_✓d_✓o_✓w _✓p_✓o_✓s_✓i_✓t_✓i_✓o_✓n_✓i_✓n_✓g, _✓f_✓o_✓n_✓t _✓c_✓h_✓a_✓n_✓g_✓e_✓s, _✓s_✓t_✓a_✓t_✓e _✓i_✓n_✓q_✓u_✓i_✓r_✓y, _✓s_✓a_✓v_✓e_✓d _✓c_✓o_✓n_✓t_✓e_✓x_✓t_✓s, _✓m_✓e_✓n_✓u_✓s, _✓e_✓v_✓e_✓n_✓t_✓s, _✓s_✓w_✓e_✓e_✓p _✓f_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s, _✓m_✓u_✓l_✓t_✓i_✓- _✓p_✓l_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓m_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n, _✓c_✓u_✓t _✓a_✓n_✓d _✓p_✓a_✓s_✓t_✓e, _✓m_✓e_✓s_✓s_✓a_✓g_✓e_✓s, and _✓w_✓i_✓n_✓d_✓o_✓w _✓m_✓o_✓d_✓e_✓s. What fol- lows is a brief description of those command categories, and some examples of specific functions within the category. A detailed description of each com- mand is provided in the following section. _✓T_✓e_✓r_✓m_✓i_✓n_✓a_✓l _✓E_✓m_✓u_✓l_✓a_✓t_✓i_✓o_✓n At its basic level, every MGR window emulates a _✓C_✓R_✓T terminal. It provides functions for _✓i_✓n_✓s_✓e_✓r_✓t_✓i_✓n_✓g and _✓d_✓e_✓l_✓e_✓t_✓i_✓n_✓g lines and characters, highlighting text, clearing areas and windows, and arbitrary cursor motion capabilities. Sample MGR _✓T_✓E_✓R_✓M_✓C_✓A_✓P and _✓T_✓E_✓R_✓M_✓I_✓N_✓F_✓O descriptions are given in the tables below. No entries are provided for keyboard key values, as they depend upon the particu- l✓_a✓_r✓__k✓_e✓_y✓_b✓_o✓_a✓_r✓_d✓__i✓_n✓__u✓_s✓_e✓_.✓___________________________________________________________ | Sample MGR _✓T_✓E_✓R_✓M_✓C_✓A_✓P Entry |✓| Sample MGR _✓T_✓E_✓R_✓M_✓I_✓N_✓F_✓O Entry | |______________________________✓|✓|________________________________________________✓| | Px MGR MGR terminal:\ |✓| Px | MGR | MGR Terminal, | | :am:bs:im=:ta=^I:\ |✓| cols#80, lines#24, | | :AL=\E%da:al=\Ea:\ |✓| am, msgr, ht=^I, | | :cd=\EC:ce=\Ec:cl=^L:\ |✓| clear=^L, cr=^M, bel=^G, | | :cm=\E%r%d,%dM:\ |✓| cub1=^H, cud1=\Ef, cuf1=\Er, | | :co#80:li#24:\ |✓| cuu1=\Eu, ind=^J, | | :cs=\E%d,%dt:\ |✓| cup=\E%p2%d;%p1%dM, | | :DC=\E%dE:dc=\EE:\ |✓| csr=\E%p1%d;%p2%dt, | | :DL=\E%dd:dl=\Ed:\ |✓| wind=\E%p2%d;%p2%p4%+%d;%p1;%p1%p3%+%d;t, | | :do=\Ef:up=\Eu:nd=\Er:\ |✓| el=\Ec, ed=\EC, | | :IC=\E%dA:ic=\EA:\ |✓| il1=\Ea, dl1=\Ed, | | :se=\En:so=\Ei:\ |✓| il=\E%p1%da, dl=\E%p1%dd, | |___:✓_v✓_e✓_=✓_\✓_E✓_v✓_:✓_v✓_s✓_=✓_\✓_E✓_V✓_:✓_____________✓|✓| smso=\Ei, rmso=\En, | |___s✓_m✓_c✓_u✓_p✓_=✓_\✓_E✓_1✓_6✓_6✓_4✓_P✓_,✓__r✓_m✓_c✓_u✓_p✓_=✓_\✓_E✓_t✓_\✓_E✓_p✓_,✓__________________✓| MGR permits the client program to restrict the terminal emulator to an arbi- trary subrectangle within the window, called a _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n. For example, a text editor wishing to provide scroll bars or banner lines can still let MGR do the terminal emulation by specifying a text region that excludes the top and sides of the window. This text region may be redefined or moved around at will, permitting multiple terminal sub regions in the same window. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 5 - Functional Overview _✓G_✓r_✓a_✓p_✓h_✓i_✓c_✓s In addition to terminal emulation, MGR provides a suite of pen plotter style graphics primitives. A client program may draw lines, circles, ellipses, and elliptical arcs on a window. The graphics objects may either be completely positioned, or located relative to an internal _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t, maintained by MGR. The objects may also be drawn into undisplayed or _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d areas, then copied to the window as a single unit. The _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t may be aligned with the character cursor, for locating graphic objects relative to character text. Conversely, the character cursor may be aligned with the graphics cursor, per- mitting character text to be placed at arbitrary positions on the window. _✓B_✓i_✓t-_✓b_✓l_✓t_✓s MGR provides a complete set of functions for dealing with bitmaps, or rec- tangular arrays of pixels. Bitmaps may be combined with any of the 16 possi- ble _✓b_✓i_✓t-_✓b_✓l_✓t operations. Non-displayed bitmaps of arbitrary size may be created and destroyed, and _✓b_✓i_✓t-_✓b_✓l_✓t_✓s may be performed on the window, within a scratch-pad bitmap, between two scratch-pad bitmaps, or between a scratch-pad bitmap and the window. Bitmap images may be down-loaded from client programs to MGR, or up-loaded from MGR to the client program. In addition, bitmaps may be saved in files by MGR, or loaded into MGR from files. These last two capa- bilities permit client programs to manipulate large amounts of bitmap data without the need to send the bits over the communication channel. _✓W_✓i_✓n_✓d_✓o_✓w _✓P_✓o_✓s_✓i_✓t_✓i_✓o_✓n_✓i_✓n_✓g Either the user or client program may move the _✓a_✓c_✓t_✓i_✓v_✓e window around on the display. Windows may be moved with their size retained, reshaped but remain at the same location, or be both moved and shaped anywhere on the display. If the window is the _✓a_✓c_✓t_✓i_✓v_✓e window, it may be _✓b_✓u_✓r_✓i_✓e_✓d (shoved to the back on the display). If the window is not the _✓a_✓c_✓t_✓i_✓v_✓e window, it can become the active window and then moved about on the display. _✓F_✓o_✓n_✓t _✓C_✓h_✓a_✓n_✓g_✓e_✓s Client programs may change character fonts at any time, even on a character by character basis. MGR comes with scores of different fonts, ranging in size from microscopic to viewgraph size. Client programs are free to create and down-load their own fonts. The fonts supplied by MGR are constant width, that is _✓i's take up the same amount of room as _✓m's do. There are commands to aid client programs that wish to use proportional fonts. _✓S_✓t_✓a_✓t_✓e _✓I_✓n_✓q_✓u_✓i_✓r_✓y A client program may ask MGR about the state of its current window, such as its size and position on the display, the name and size of the current font, the position and extent of the text region, and the state of various mode set- tings. The client may also inquire about the state of the window system as a whole. That includes the position and state of the mouse, the number and sizes of the available fonts, and the organization of windows on the display. The display organization may include the position, size, name, ownership, and spatial ordering for all windows on the display. _✓S_✓a_✓v_✓e_✓d _✓C_✓o_✓n_✓t_✓e_✓x_✓t_✓s Certain parts of the current window environment may be pushed on a stack, then restored at some later time. Client programs rarely need to know the context in which they are called. They simply push those aspects of the environment they will change, then restore them before exiting. About a dozen different July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 6 - Functional Overview parts of the window environment, such as menus, character fonts, window posi- tion, etc. may be stacked independently, or in any combination. _✓M_✓e_✓n_✓u_✓s MGR has built in support for pop-up menus. Clients may arrange for menus to pop-up in response to mouse button hits. Up to 50 menus may be down-loaded at once for each window. The client _✓s_✓e_✓l_✓e_✓c_✓t_✓s which menu will pop-up when a mouse button is pushed. When an item of a pop-up menu is chosen, MGR returns the string previously put into the menu by the client program. The client program may arrange for different menus to pop up depending upon the current mouse position. Menus may also be linked together as a pop-up menu tree. Sliding off to the right of a menu (called a _✓p_✓a_✓r_✓e_✓n_✓t menu) while an item is selected can cause another menu (called a _✓c_✓h_✓i_✓l_✓d menu) to pop up. Any item of the _✓p_✓a_✓r_✓e_✓n_✓t menu may be specified as the entry item for a child menu. Upon select- ing an item of a _✓c_✓h_✓i_✓l_✓d menu, the client program may arrange for MGR to return ether the action string associated with just the _✓c_✓h_✓i_✓l_✓d menu item, or the action strings for the selected items of all the menus. Similar to _✓s_✓l_✓i_✓d_✓i_✓n_✓g menus, MGR supports _✓p_✓a_✓g_✓i_✓n_✓g menus as well. Long menus may be broken into several pages by the client program. MGR manages the paging automatically, popping up the next page as the user slides off the bottom of a paged menu. _✓E_✓v_✓e_✓n_✓t_✓s Client programs may arrange to be informed by MGR when some change, called an event, happens to the state of the window system. As with menus, the message informing the client program of a change is formated as specified by the client program. Examples of events include mouse buttons being depressed or released, windows changing shape or moving, and the window becoming the _✓a_✓c_✓t_✓i_✓v_✓e window or being covered by another window. Window state information, such as the current cursor position, may be returned as part of an event string. _✓S_✓w_✓e_✓e_✓p _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s It is often convenient for client programs to _✓s_✓w_✓e_✓e_✓p, or _✓r_✓u_✓b_✓b_✓e_✓r-_✓b_✓a_✓n_✓d simple objects, such as lines or boxes, in response to moving the mouse. MGR pro- vides client programs with a mouse activated sweep function. MGR tracks an edge of the line or box with the mouse and reports the coordinates to the client at the conclusion of the sweep operation, when the user releases the mouse. As usual, the client program specifies the format of the data returned by MGR. _✓M_✓u_✓l_✓t_✓i_✓p_✓l_✓e _✓W_✓i_✓n_✓d_✓o_✓w _✓M_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n A single client program may create and manipulate additional windows, called _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e windows. The data destined for, or to be received from, an _✓a_✓l_✓t_✓e_✓r_✓- _✓n_✓a_✓t_✓e window is multiplexed on the same channel as the main window. The client program selects a window to receive output, and all output goes to the selected window until a different window is selected. For input, the client program uses the _✓e_✓v_✓e_✓n_✓t mechanism to determine from which window input arrived. Alternate windows have the same capabilities as the main window. There is currently no limit to the number of alternate windows a client program may have. Up to 100 windows may exist on the display at one time before perfor- mance begins to degrade seriously. _✓C_✓u_✓t _✓a_✓n_✓d _✓P_✓a_✓s_✓t_✓e MGR provides a globally accessible _✓s_✓n_✓a_✓r_✓f buffer shared among all client pro- grams. Any client program may put data into or read data from this buffer. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 7 - Functional Overview MGR provides a user initiated _✓c_✓u_✓t and _✓p_✓a_✓s_✓t_✓e function from the command menu. MGR extracts character text from the window and places its ASCII representa- tion into the _✓s_✓n_✓a_✓r_✓f buffer. _✓P_✓a_✓s_✓t_✓e copies the contents of the _✓s_✓n_✓a_✓r_✓f buffer to the input stream of the active window. Client programs, by manipulating the data in the _✓s_✓n_✓a_✓r_✓f buffer, can interact with the system _✓c_✓u_✓t and _✓p_✓a_✓s_✓t_✓e func- tions. _✓M_✓e_✓s_✓s_✓a_✓g_✓e_✓s Although the _✓s_✓n_✓a_✓r_✓f buffer gives client programs a simple asynchronous inter- process communication mechanism, MGR has a more general synchronous interpro- cess message passing scheme. A client program may send a message to another client program, or broadcast the message to all client programs. As a message recipient, the client program may elect to receive messages as an _✓e_✓v_✓e_✓n_✓t and encapsulate the message and sender name in the format of its choice. MGR pro- vides the primitives needed to implement _✓s_✓e_✓r_✓v_✓e_✓r clients by permitting _✓s_✓e_✓r_✓v_✓e_✓r_✓s to register their names, services and protocols with MGR. Client programs may query MGR for a list of active _✓s_✓e_✓r_✓v_✓e_✓r_✓s. _✓S_✓e_✓r_✓v_✓e_✓r messages may be associated with windows by the _✓s_✓e_✓r_✓v_✓e_✓r client programs in such a way that the message is automatically received by a client program as part of a _✓m_✓o_✓u_✓s_✓e _✓b_✓u_✓t_✓t_✓o_✓n event whenever the mouse button is pressed on the _✓s_✓e_✓r_✓v_✓e_✓r's window. Using this mechanism, client programs can interact with _✓s_✓e_✓r_✓v_✓e_✓r clients without any advance knowledge of which _✓s_✓e_✓r_✓v_✓e_✓rs are available or what services they are providing. _✓W_✓i_✓n_✓d_✓o_✓w _✓M_✓o_✓d_✓e_✓s Client programs may select various combinations of window modes. These modes tailor the behavior of the macros described above. Examples of window modes include _✓a_✓u_✓t_✓o _✓l_✓i_✓n_✓e _✓w_✓r_✓a_✓p and _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓o_✓v_✓e_✓r_✓s_✓t_✓r_✓i_✓k_✓e that affect the terminal emu- lation, different coordinate system settings that affect _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s commands, or flags that set a window to _✓a_✓c_✓t_✓i_✓v_✓a_✓t_✓e automatically upon receiving input, ignore all keyboard input, or suspend output while a window is obscured. => _✓U_✓n_✓d_✓e_✓r_✓l_✓y_✓i_✓n_✓g _✓P_✓r_✓o_✓t_✓o_✓c_✓o_✓l The purpose of this library package is both to provide a function call inter- face to the stream protocol, and to document each command understood by MGR. There are two types_o✓_f✓__M✓_G✓_R✓__c✓_o✓_m✓_m✓_a✓_n✓_d✓_s✓_,✓__a✓_s✓__s✓_u✓_m✓_m✓_a✓_r✓_i✓_z✓_e✓_d✓__i✓_n✓__t✓_h✓_e✓__t✓_able below. | MGR command protocol | |________________________________________✓| | _✓E_✓S_✓C X1, X2,..., Xn _✓c_✓o_✓m_✓m_✓a_✓n_✓d | | _✓E_✓S_✓C X1, X2,..., Xn _✓l_✓e_✓n_✓g_✓t_✓h _✓c_✓o_✓m_✓m_✓a_✓n_✓d _✓d_✓a_✓t_✓a| |________________________________________✓| In both cases, _✓E_✓S_✓C is the ASCII escape character or '\033', whereas the word _✓c_✓o_✓m_✓m_✓a_✓n_✓d represents a single character command identifier. The _✓X's are optional integers, there can be as f✓_e✓_w✓__a✓_s✓_ zero, as in the command | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C_✓a| |______✓| which inserts a blank line in the window, or as many as eight, as would be used by the command __________________________ | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C0,0,50,100,10,20,3,2_✓b| |__________________________✓| which is an example of a command to copy images between bitmaps. No spaces may be included between the _✓E_✓S_✓C character and the command identifier charac- ter, but the argument separators may be either commas (,) or semicolons (;). July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 8 - Underlying Protocol The function of the command is determined both by the command identifier char- acter and _✓n, the number of numeric arguments preceding the command identifier character. All of the commands with the same command identifier character are closely related in function. For example, all the commands in the following table have the same command character, '_✓o', and all draw ellipses, but have different effects based upon the number of arguments. _____________________________ |_C✓_o✓_m✓_m✓_a✓_n✓_d✓_s✓__t✓_h✓_a✓_t✓__d✓_r✓_a✓_w✓___✓_✓e_✓_✓l_✓_✓l_✓_✓i_✓_✓p_✓_✓s_✓_✓e_✓_✓s_✓| | 1 | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C100,200o✓o✓o✓o | | 2 | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C100,200,300,400o✓o✓o✓o | | 3 | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C100,200,300,400,2o✓o✓o✓o| |_____✓|________________________✓| All of the ellipses have major and minor axis lengths of _✓1_✓0_✓0 and _✓2_✓0_✓0 units respectively. Command 1 draws the ellipse at the current graphics location. Command 2 draws the ellipse at the location specified by the third and forth arguments, at ( 3✓3✓3✓30✓0✓0✓00✓0✓0✓0,4✓4✓4✓40✓0✓0✓00✓0✓0✓0). Command 3 draws the ellipse into scratchpad bitmap number _✓2. The second form of MGR commands, which is a special case of the first form, is used for downloading data from the client program to MGR. The integer _✓l_✓e_✓n_✓g_✓t_✓h specifies the number of bytes of data to be downloaded, and _✓d_✓a_✓t_✓a are the _✓l_✓e_✓n_✓g_✓t_✓h number of data values downloaded. An example of the second type of MGR command is _________________ | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C11,7b✓b✓b✓b_✓I-_✓m_✓o_✓v_✓e_✓d| |_________________✓| which instructs MGR to send the client program the string _✓I-_✓m_✓o_✓v_✓e_✓d any time the client's window is moved to a different location on the display. The _✓1_✓1 refers to the number of the _✓m_✓o_✓v_✓e event and the _✓7 is the number of characters in the event string, which in this case is _✓I-_✓m_✓o_✓v_✓e_✓d. All of the command identifier characters are listed in _✓w_✓i_✓n_✓d_✓o_✓w._✓h. The command actions, determined by the command identifier and number of command arguments, are described by the macros in this document. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 9 - Conventions and Notation => _✓C_✓o_✓n_✓v_✓e_✓n_✓t_✓i_✓o_✓n_✓s _✓a_✓n_✓d _✓N_✓o_✓t_✓a_✓t_✓i_✓o_✓n All functions and macros and programming examples are shown in a typewriter font to distinguish them from ordinary text. Similarly, function and macro arguments are shown in a b✓b✓b✓bo✓o✓o✓ol✓l✓l✓ld✓d✓d✓d t✓t✓t✓ty✓y✓y✓yp✓p✓p✓pe✓e✓e✓ew✓w✓w✓wr✓r✓r✓ri✓i✓i✓it✓t✓t✓te✓e✓e✓er✓r✓r✓r f✓f✓f✓fo✓o✓o✓on✓n✓n✓nt✓t✓t✓t.✓.✓.✓. The names of often used arguments passed to macros indicate their function, and are defined below. c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w The integers c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n and r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w refer to a character position in _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinates even though characters may be placed at arbitrary pixel loca- tions within a window and need not fall on c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n or r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w boundaries. D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t The integers D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t represent a width and height in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e The positive integer m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e, represents the bit combination of window modes. M✓M✓M✓Mo✓o✓o✓od✓d✓d✓de✓e✓e✓e is usually an _✓o_✓red list of constants in _✓t_✓e_✓r_✓m._✓h. A typical use of m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e is the argument to m_push( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) as in m_push( P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LA✓A✓A✓AG✓G✓G✓GS✓S✓S✓S |✓|✓|✓| P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T |✓|✓|✓| P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U). n✓n✓n✓n The small non-negative integer n✓n✓n✓n represents a resource descriptor when describing objects such as windows, fonts, or menus. n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e N✓N✓N✓Na✓a✓a✓am✓m✓m✓me✓e✓e✓e is the file name of a bitmap image on the _✓M_✓G_✓R-_✓h_✓o_✓s_✓t machine. File names given with no directory prefix are referenced relative to the _✓i_✓c_✓o_✓n subdirectory of MGR's home directory. The home directory is installation dependent, and may be determined with the command _✓M_✓G_✓R -_✓V. p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t,c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d The small positive integers p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t and c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d represent menus. A _✓c_✓h_✓i_✓l_✓d menu is linked to a _✓p_✓a_✓r_✓e_✓n_✓t menu forming a tree of menus. r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s The positive integer r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s along with r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 signifies a radius when referring to circles or major and minor axis when referring to ellipses. They are only referenced in respect to _✓w_✓i_✓n_✓d_✓o_✓w coordinates. s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g An array of characters, s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is a null terminated ASCII character string. Except where noted, several ASCII control characters can be included in strings by escaping them with \_✓X, where _✓X is one of the characters shown in the following table. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 10 - Conventions and Notation _______________________________________ |__C✓_h✓_a✓_r✓_a✓_c✓_t✓_e✓_r✓__s✓_t✓_r✓_i✓_n✓_g✓__c✓_o✓_n✓_t✓_r✓_o✓_l✓__c✓_h✓_a✓_r✓_a✓_c✓_t✓_e✓_r✓_s✓___✓| | escape | octal| Meaning | | character| value| | |_✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓__✓__✓__✓__✓__✓__✓__✓__✓|✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓_ | \b| 010 | Back space | | \E| 033 | Escape | | \e| 033 | Escape | | \f| 014 | Form feed | | \g| 007 | Bell | | \M| * | Turn on | | | | 8'th (parity) bit| | \n| 012 | New line | | \r| 015 | Return | | \s| 040 | Space | | \\| 134 | Back-slash (\) | |✓|___________✓|________✓|____________________✓|✓| * (the next character has its 8'th bit turned on) t✓t✓t✓to✓o✓o✓o,f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m The small positive integers t✓t✓t✓to✓o✓o✓o and f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m identify the destination and source bitmaps for _✓b_✓i_✓t-_✓b_✓l_✓t operations. The value 0 (zero) represents the current window bitmap; positive integers name scratch-pad bitmap storage. w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t The integers w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t represent a width and height in _✓w_✓i_✓n_✓d_✓o_✓w coordinates. X✓X✓X✓X,Y✓Y✓Y✓Y The integer pair ( X✓X✓X✓X,Y✓Y✓Y✓Y) represents a point in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. The suffixes s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c and d✓d✓d✓ds✓s✓s✓st✓t✓t✓t as in ( X✓X✓X✓X_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,Y✓Y✓Y✓Y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c) or ( X✓X✓X✓X_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,Y✓Y✓Y✓Y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t) are used to indicate _✓s_✓o_✓u_✓r_✓c_✓e and _✓d_✓e_✓s_✓t_✓i_✓n_✓a_✓t_✓i_✓o_✓n coordinates respectively. Similarly, the suffixes 1✓1✓1✓1 and 2✓2✓2✓2 as in ( X✓X✓X✓X1✓1✓1✓1,Y✓Y✓Y✓Y1✓1✓1✓1) refer generically to the first or second coordinate. x✓x✓x✓x,y✓y✓y✓y The integers ( x✓x✓x✓x,y✓y✓y✓y) represent a point in _✓w_✓i_✓n_✓d_✓o_✓w coordinates. Whether that is _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e (i.e. 0-999) or _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e depends upon the current coor- dinate setting of the window. As with ( X✓X✓X✓X,Y✓Y✓Y✓Y) above, the modifiers s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,1✓1✓1✓1, and 2✓2✓2✓2 refer respectively to the _✓s_✓o_✓u_✓r_✓c_✓e, _✓d_✓e_✓s_✓t_✓i_✓n_✓a_✓t_✓i_✓o_✓n, _✓f_✓i_✓r_✓s_✓t, and _✓s_✓e_✓c_✓o_✓n_✓d coordinates. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 11 - Macros => _✓M_✓a_✓c_✓r_✓o_✓s All of the C library interface macros expand into _✓p_✓r_✓i_✓n_✓t_✓f expressions that con- vert their command specification into the MGR stream protocol. Compile time and run time options are available that globally alter the behavior of these macros to the specific needs of the client program. The options are detailed in the _✓U_✓s_✓i_✓n_✓g _✓t_✓h_✓e _✓L_✓i_✓b_✓r_✓a_✓r_✓y section of this document. The returned value of the macro expressions are not meaningful. The macros described here attempt to reflect the actual state of the system, and may include some inconsistencies that should be cleaned up in future releases of the software. Every MGR com- mand (a command identifier - argument count combination) that is accepted by MGR has a macro describing its function. m_addchar() Inserts a space character at the current character cursor position. The remaining characters on the line, if any, are shifted to the right. m_addchars( n✓n✓n✓n) Inserts n✓n✓n✓n space characters at the current character cursor position. The remaining characters on the line, if any, are shifted to the right. m_addline() Inserts a blank line at current row. The current row, and any below it, are shifted down one line. The bottom line of text is scrolled off the window. m_addlines( n✓n✓n✓n) Inserts n✓n✓n✓n blank lines at current row. The current row, and any below it are shifted down. The bottom n✓n✓n✓n lines of text are scrolled off the win- dow. It is much more efficient to call m_addlines( n✓n✓n✓n) once, than it is to call m_addline()n✓n✓n✓n times. m_aligntext() Moves the current character cursor coincident with the current graphics point. The current graphics point is set with m_go( x✓x✓x✓x,y✓y✓y✓y). This permits client programs to position characters at arbitrary pixel locations on the window. m_arc( x✓x✓x✓x,y✓y✓y✓y,x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1,x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2) An arc centered at ( x✓x✓x✓x,y✓y✓y✓y)is drawn counter clockwise from ( x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1)to ( x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2)using the current drawing function (see m_func()). m_bell() The window flashes and the bell, if there is one, rings. Even if the window is totally obscured, its flashing is made visible to the user. m_bcolor( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r) The background color for text operations is set to c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r, which is an index into the color lookup table. This command is ignored on a mono- chrome display. See also m_fcolor()and m_linecolor(). m_bitcopy( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c) Copy a rectangle from one place on the window to another with the copy July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 12 - Macros function set by m_func( n✓n✓n✓n). The rectangular area at x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c of size w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h is combined with the rectangle at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t according to the last function set by m_func(). The resultant rectangle is placed at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t. m_bitcopyto( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,t✓t✓t✓to✓o✓o✓o,f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m) Combine the rectangle at position x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c of size w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h of bitmap f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m with the rectangle of the same size at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t of bitmap t✓t✓t✓to✓o✓o✓o. The bit-blt function used to combine the two rectangles is set by m_func(). F✓F✓F✓Fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m and t✓t✓t✓to✓o✓o✓o are scratch-pad bitmap descriptors. Scratchpad bitmap 0 (zero) represents the current window contents and may be used for the source , destination or both. If the scratchpad bitmap t✓t✓t✓to✓o✓o✓o does not already exist, it is created with a size of w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e+x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h+y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c. m_bitcreate( n✓n✓n✓n,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h) Create the scratchpad bitmap n✓n✓n✓n of size w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h. The contents of the bitmap are undefined. The macro m_bitwriteto() can be used to initialize the scratchpad bitmap. If the bitmap already exists, the old one is first discarded. Scratchpad bitmaps may also be created implicitly by specifying a non-existent bitmap as the destination of m_bitwriteto(), m_bitcopyto(), m_bitld(), or m_stringto(). m_bitdestroy( n✓n✓n✓n) Destroys scratchpad bitmap n✓n✓n✓n and frees all the resources associated with it. If n✓n✓n✓n does not exist, this macro is ignored. m_bitfromfile( t✓t✓t✓to✓o✓o✓o,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e) Copy the file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e on the _✓M_✓G_✓R-_✓h_✓o_✓s_✓t machine into the scratchpad bitmap t✓t✓t✓to✓o✓o✓o. The scratchpad bitmap t✓t✓t✓to✓o✓o✓o is created if it does not already exist. _✓M_✓G_✓R returns a single line containing the _✓w_✓i_✓d_✓t_✓h and _✓h_✓e_✓i_✓g_✓h_✓t of the bitmap, or a _✓b_✓l_✓a_✓n_✓k if the file could not be found or loaded. If n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e does not start with / or ./, The file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e is prefixed with MGR's home directory and /_✓i_✓c_✓o_✓n/. N✓N✓N✓Na✓a✓a✓am✓m✓m✓me✓e✓e✓es starting with ./ are evaluated relative to the directory current when _✓M_✓G_✓R was invoked. The format of the bitmap file is described in _✓d_✓u_✓m_✓p._✓h. m_bitget( f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m,s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e,o✓o✓o✓of✓f✓f✓ff✓f✓f✓fs✓s✓s✓se✓e✓e✓et✓t✓t✓t) Upload part of a _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmap. S✓S✓S✓Si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e bytes of _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmap f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m, starting o✓o✓o✓of✓f✓f✓ff✓f✓f✓fs✓s✓s✓se✓e✓e✓et✓t✓t✓t bytes from the beginning of the bitmap are sent to the client program from _✓M_✓G_✓R. After this call, the client is expected to read s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e bytes from the input stream. The image data is sent in raster scan order, 8 pixels to a byte, padded at the right of every line to 16 bits. S✓S✓S✓Si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e should be kept small (about 80 bytes), to avoid potential flow control problems, with bitmaps uploaded in multiple passes. (See also m_bitsave()). The data sent by MGR for this macro requires an eight bit data channel, so its use is discouraged. The macro m_bitfromfile() should be used instead when possible. m_bitld( w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,x✓x✓x✓x,y✓y✓y✓y,s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e) Prepare MGR to download a bitmap to the window. This macro instructs MGR that the next s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e bytes received will be interpreted as a bitmap image to be displayed on the window starting at location ( x✓x✓x✓x,y✓y✓y✓y), and of size w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h. Downloading bitmaps requires an eight bit channel between MGR and the client program. Large bitmaps are best sent in several July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 13 - Macros pieces. The macro m_bitfromfile()should be used instead, where possible, as it only requires a seven bit data channel and avoids the movement of large amounts of data through the channel. If more bytes are specified than required by the size of the bitmap, they are discarded. If the number specified by s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e is insufficient to fill the entire bitmap, the remainder of the bits are set to undetermined values. m_bitldto( w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,t✓t✓t✓to✓o✓o✓o,s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e) Prepare to download a bitmap to the scratchpad bitmap t✓t✓t✓to✓o✓o✓o. If t✓t✓t✓to✓o✓o✓o does not already exist, (see m_bitcreate()), it is created automatically with size w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h. This function instructs MGR that the next s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e bytes received will be interpreted as a bitmap image to be copied to scratchpad bitmap t✓t✓t✓to✓o✓o✓o at location x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t. This function requires an eight bit channel between MGR and the client program. If more bytes are specified than required by the size of the bitmap, they are discarded. If the number specified by s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e is insufficient to fill the entire bitmap, the remainder of the bits are set to undetermined values. m_bitsave( f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e) Save a scratchpad bitmap f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m on the file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e on the _✓M_✓G_✓R-_✓h_✓o_✓s_✓t file sys- tem. If n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e does not start with / or ./, n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e is prefixed with MGR's home directory and /_✓i_✓c_✓o_✓n/. N✓N✓N✓Na✓a✓a✓am✓m✓m✓me✓e✓e✓es starting with ./ are evaluated relative to the directory current when _✓M_✓G_✓R was invoked. Specifying f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m to be 0✓0✓0✓0 (zero) saves the entire display contents to the file. The functions m_windowsave() and m_othersave() are used to save contents of entire win- dows. m_bitwrite( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h) The rectangular region of the window, starting at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t of extent w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h, is set, cleared or inverted as determined by the previous call to m_func(). m_bitwriteto( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,t✓t✓t✓to✓o✓o✓o) The rectangular region of _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmap t✓t✓t✓to✓o✓o✓o, starting at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t of extent w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h, is set, cleared or inverted as determined by the previous call to m_func(). If the destination t✓t✓t✓to✓o✓o✓o does not exist, it is created with the dimensions w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h. m_broadcast( s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) The message s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is broadcast to all windows that are _✓l_✓i_✓s_✓t_✓e_✓ning. _✓L_✓i_✓s_✓t_✓e_✓ning is turned on by setting the A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T event for a window. (See m_setevent()). Messages can only be sent to windows whose controlling terminals have general write permission disabled (i.e. mode 0400) as a security measure to prevent malicious foreign processes from sending _✓s_✓h_✓e_✓l_✓ls messages that get interpreted and executed as commands. m_circle( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s) A circle of radius r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s is drawn, centered at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t. The points at the edge of the circle are set, cleared or inverted depending upon the last call to m_func(). Circles are never scaled, they always appear as circles on the display, regardless of the window shape. The r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s is scaled based upon the average w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t of the window. Use m_ellipse()to obtain a scaled circle. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 14 - Macros m_clear() The current _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is cleared, and the character cursor is moved to position ( 0✓0✓0✓0,0✓0✓0✓0). If no _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is set, m_clear() clears the entire window. m_cleareol() All of the characters on the current line, starting with the current character to the end of the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n, are cleared. If no _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is set, m_cleareol() clears to the edge of the window. m_cleareos() All of the characters in the current _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n, from the current char- acter to the end of the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n, are cleared. If no _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is set, m_clear() clears to the end of the window. m_clearevent( n✓n✓n✓n) Event n✓n✓n✓n is cleared. The integer n✓n✓n✓n is one of: A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T, A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E, B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1, B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1U✓U✓U✓U, B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2, B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2U✓U✓U✓U, C✓C✓C✓CO✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RE✓E✓E✓ED✓D✓D✓D, D✓D✓D✓DE✓E✓E✓EA✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E, D✓D✓D✓DE✓E✓E✓ES✓S✓S✓ST✓T✓T✓TR✓R✓R✓RO✓O✓O✓OY✓Y✓Y✓Y, M✓M✓M✓MO✓O✓O✓OV✓V✓V✓VE✓E✓E✓E, N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y, P✓P✓P✓PA✓A✓A✓AS✓S✓S✓ST✓T✓T✓TE✓E✓E✓E, R✓R✓R✓RE✓E✓E✓ED✓D✓D✓DR✓R✓R✓RA✓A✓A✓AW✓W✓W✓W, R✓R✓R✓RE✓E✓E✓ES✓S✓S✓SH✓H✓H✓HA✓A✓A✓AP✓P✓P✓PE✓E✓E✓E, S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FE✓E✓E✓ED✓D✓D✓D,✓,✓,✓, S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AC✓C✓C✓CK✓K✓K✓K, or U✓U✓U✓UN✓N✓N✓NC✓C✓C✓CO✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RE✓E✓E✓ED✓D✓D✓D. See m_setevent() for a description of the events. m_clearmenu( n✓n✓n✓n) If menu n✓n✓n✓n exists, it is cleared. m_clearmode( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) Clear one of the following window modes. Except where noted, these are the default settings. The mode settings are more fully explained in m_setmode(). M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AB✓B✓B✓BS✓S✓S✓S _✓A_✓b_✓s_✓o_✓l_✓u_✓t_✓e window coordinate mode is turned off. The window is now in _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e window coordinates. All window coordinates range from ( 0✓0✓0✓0,0✓0✓0✓0) in the upper left corner to ( 9✓9✓9✓99✓9✓9✓99✓9✓9✓9,9✓9✓9✓99✓9✓9✓99✓9✓9✓9) at the lower right. M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E Bury the window. Unlike the other window modes, _✓b_✓u_✓r_✓y has no state associated with it, just a one time action. A window is buried by visually pushing it to the bottom of the display; any window inter- secting it will appear in front of it. M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TO✓O✓O✓OE✓E✓E✓EX✓X✓X✓XP✓P✓P✓PO✓O✓O✓OS✓S✓S✓SE✓E✓E✓E Do not automatically activate the window the next time it receives output. M✓M✓M✓M_✓_✓_✓_B✓B✓B✓BA✓A✓A✓AC✓C✓C✓CK✓K✓K✓KG✓G✓G✓GR✓R✓R✓RO✓O✓O✓OU✓U✓U✓UN✓N✓N✓ND✓D✓D✓D MGR does not permit the window to update if it is partially or totally obscured. Data destined for the window is held until the window is uncovered, or _✓M__✓B_✓A_✓C_✓K_✓G_✓R_✓O_✓U_✓N_✓D is turned on. M✓M✓M✓M_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OI✓I✓I✓IN✓N✓N✓NP✓P✓P✓PU✓U✓U✓UT✓T✓T✓T Accept keyboard input if the window is active. M✓M✓M✓M_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OW✓W✓W✓WR✓R✓R✓RA✓A✓A✓AP✓P✓P✓P Wrap the character cursor to the next line when it reaches the right July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 15 - Macros margin of the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n. M✓M✓M✓M_✓_✓_✓_O✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RS✓S✓S✓ST✓T✓T✓TR✓R✓R✓RI✓I✓I✓IK✓K✓K✓KE✓E✓E✓E Do not overstrike characters. Text is copied to the window as if m_func( B✓B✓B✓B_✓_✓_✓_S✓S✓S✓SR✓R✓R✓RC✓C✓C✓C) is set. M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FH✓H✓H✓HA✓A✓A✓AR✓R✓R✓RD✓D✓D✓D The system _✓c_✓u_✓t function fails if any errors are found. This is indi- cated by flashing the window. The contents of the _✓c_✓u_✓t buffer are left undisturbed. Normally this only happens if some process unknown to MGR scribbles into the region being cut. M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FL✓L✓L✓LI✓I✓I✓IN✓N✓N✓NE✓E✓E✓ES✓S✓S✓S Sets the system _✓c_✓u_✓t function to cut individual characters, instead of entire lines only. M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FT✓T✓T✓TA✓A✓A✓AB✓B✓B✓BS✓S✓S✓S The system _✓c_✓u_✓t function cuts text exactly as it appears on the win- dow. All interior white space is converted to _✓s_✓p_✓a_✓c_✓es, all trailing white space is treated as a _✓n_✓e_✓w _✓l_✓i_✓n_✓e. M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AC✓C✓C✓CK✓K✓K✓K Event stacking is turned off. Event strings are only returned for the current window context and not for any contexts stacked with m_push(). M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OU✓U✓U✓UT✓T✓T✓T Characters are drawn in black with a white background. M✓M✓M✓M_✓_✓_✓_W✓W✓W✓WO✓O✓O✓OB✓B✓B✓B The window foreground color is set to _✓b_✓l_✓a_✓c_✓k, and the window back- ground is set color to _✓w_✓h_✓i_✓t_✓e. M✓M✓M✓M_✓_✓_✓_D✓D✓D✓DU✓U✓U✓UP✓P✓P✓PK✓K✓K✓KE✓E✓E✓EY✓Y✓Y✓Y The keyboard escape character is turned off. This mode is turned on by calling m_dupkey(). There is no corresponding call to m_setmode(). m_deletechar() The character at the cursor position is deleted. Any characters on the line to the right of the cursor are shifted left one character position. The last character on the line is set to a _✓s_✓p_✓a_✓c_✓e. m_deletechars( n✓n✓n✓n) The next n✓n✓n✓n characters are deleted, starting at the character cursor posi- tion. Any characters on the line to the right of the cursor are shifted left n✓n✓n✓n character positions. The last n✓n✓n✓n characters on the line are set to _✓s_✓p_✓a_✓c_✓e. m_deleteline() The line at the cursor position is deleted. Any lines below the cursor are shifted up one line. The last line is cleared. m_deletelines( n✓n✓n✓n) July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 16 - Macros The next n✓n✓n✓n lines starting at the cursor position and toward the bottom of the window are deleted. Any lines below the deleted ones are shifted up n✓n✓n✓n lines. The last n✓n✓n✓n lines are cleared. It is more efficient to make one call to m_deletelines() than to call m_deleteline()n✓n✓n✓n times. m_destroywin( n✓n✓n✓n) Destroy alternate window n✓n✓n✓n, created by calling m_newwin(). If output is currently directed to this window, it is automatically re-directed to the _✓m_✓a_✓i_✓n window. See also m_selectwin(). m_down( n✓n✓n✓n) Move the character cursor down n✓n✓n✓n tenths of a character height. This may cause the window to scroll. See also m_left()m_right()and m_up(). m_draw( x✓x✓x✓x,y✓y✓y✓y) Draw a line from current _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t to ( x✓x✓x✓x,y✓y✓y✓y). The macro m_go() is used to move the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t. The _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t is left at ( x✓x✓x✓x,y✓y✓y✓y), the end point of the line. m_dupkey( c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r) Every time the character c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r is typed at the keyboard for this window, it is sent to the client program twice. This enables clients to reliably distinguish keyboard input from that generated by menu selections or events by starting every _✓e_✓v_✓e_✓n_✓t and _✓m_✓e_✓n_✓u string with a two character code whose first character is c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r and whose second character is anything but c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r. m_ellipse( x✓x✓x✓x,y✓y✓y✓y,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2) Draw an ellipse centered at ( x✓x✓x✓x,y✓y✓y✓y). The values for r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 are the major and minor axis radii. The ellipse is either set, cleared or inverted determined by the last call to m_func(). The values for r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 are scaled based upon the average width and height of the window. m_ellipseto( t✓t✓t✓to✓o✓o✓o,x✓x✓x✓x,y✓y✓y✓y,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2) Draw an ellipse on scratchpad bitmap t✓t✓t✓to✓o✓o✓o centered at ( x✓x✓x✓x,y✓y✓y✓y) where r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 are the major and minor axis radii. The ellipse is either set, cleared or inverted determined by the last call to m_func(). The values for r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 are scaled based upon the average w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t of the window. If the offscreen bitmap t✓t✓t✓to✓o✓o✓o does not exist, this call is ignored. m_fastdraw( x✓x✓x✓x,y✓y✓y✓y,c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t,d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a) The next c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t bytes of d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a are sent to MGR are to be interpreted as lines drawn in _✓f_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode, starting at ( x✓x✓x✓x,y✓y✓y✓y). _✓F_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode per- mits the rapid drawing of short vectors by encoding an _✓x,_✓y displacement location in a single byte. The _✓x coordinate is contained in the most significant 4 bits, the _✓y coordinate in the least significant 4 bits. Values for _✓x and _✓y represent displacements from the previous location, and range from +7 to -8. A 7 is coded as _✓0_✓x_✓f_✓f, a -8 as _✓0_✓x_✓0_✓0. If both _✓x and _✓y are zero (i.e. _✓0_✓x_✓8_✓0_✓8_✓0). The next coordinate is taken to be a _✓m_✓o_✓v_✓e instead of a _✓d_✓r_✓a_✓w. An eight bit channel between MGR and the client pro- gram is required for _✓f_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode. See also m_rfastdraw(). July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 17 - Macros m_fcolor( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r) The foreground color for text operations is set to c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r , which is an index into the color lookup table. This command is ignored on a mono- chrome display. See also m_bcolor()and m_linecolor(). m_flush() Flush the MGR output buffer. This is equivalent to the stdio function _✓f_✓f_✓l_✓u_✓s_✓h() and is needed only when the M✓M✓M✓M_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LU✓U✓U✓US✓S✓S✓SH✓H✓H✓H flag is _✓n_✓o_✓t specified in the call to m_setup(). m_font( n✓n✓n✓n) Change to font n✓n✓n✓n. The line positioning is adjusted to keep the baseline of the new and old fonts the same. Font numbers are small integers (currently no more than 15). Font 0 (zero) always refers to the built-in or _✓d_✓e_✓f_✓a_✓u_✓l_✓t font. The actual fonts associated with the font numbers may be set in the MGR _✓s_✓t_✓a_✓r_✓t_✓u_✓p file, or changed by clients on the fly (see m_loadfont()). m_func( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) Set the drawing mode. This specifies the drawing mode for all _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s and _✓b_✓i_✓t-_✓b_✓l_✓t operations. The integer m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e is one of 16 possible boolean combinations of the _✓s_✓o_✓u_✓r_✓c_✓e and _✓d_✓e_✓s_✓t_✓i_✓n_✓a_✓t_✓i_✓o_✓n bit patterns. Combinations of bit patterns for which there is no _✓s_✓o_✓u_✓r_✓c_✓e bitmap, such as m_bitwrite() or m_line() use the modes shown in the middle column of the following table. Several common m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓es are specified for the bit patterns in which the source bitmap is relevent. _______________________________________ |________N✓_a✓_m✓_e✓_s✓__f✓_o✓_r✓__b✓_✓b✓b✓bi✓_✓i✓i✓it✓_✓t✓t✓t-✓_✓-✓-✓-b✓_✓b✓b✓bl✓_✓l✓l✓lt✓_✓t✓t✓t_m✓_o✓_d✓_e✓_s✓_________✓| | source | no source| comments| |_✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓_ | B_OR | B_SET | default | | B_COPY | B_CLEAR | | | B_COPYINVERTED| B_INVERT | | | B_XOR | | | | B_AND | | | |✓|________________✓|____________✓|___________✓|✓| Alternately, m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e may be derived with a boolean combination of B✓B✓B✓B_✓_✓_✓_S✓S✓S✓SR✓R✓R✓RC✓C✓C✓C and B✓B✓B✓B_✓_✓_✓_D✓D✓D✓DS✓S✓S✓ST✓T✓T✓T,✓,✓,✓, thus B✓B✓B✓B_✓_✓_✓_O✓O✓O✓OR✓R✓R✓R is equivalent to (✓(✓(✓(B_SRC |✓|✓|✓| B_DST)✓)✓)✓).✓.✓.✓. m_getchar() The macro m_getchar()is equivalent to the _✓s_✓t_✓d_✓i_✓o routine _✓g_✓e_✓t_✓c_✓h_✓a_✓r(), except the character is retrieved from MGR via the file pointer _✓m__✓t_✓e_✓r_✓m_✓i_✓n instead of _✓s_✓t_✓d_✓i_✓n. m_gets( b✓b✓b✓bu✓u✓u✓uf✓f✓f✓ff✓f✓f✓f) A line of characters is read from MGR and placed into b✓b✓b✓bu✓u✓u✓uf✓f✓f✓ff✓f✓f✓f. The macro m_gets()returns _✓N_✓U_✓L_✓L if the connection to MGR is severed. The macro m_gets()is equivalent to the stdio _✓f_✓g_✓e_✓t_✓s() call except input is retrieved from MGR. m_getinfo( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) This function requests MGR to return information back to the client pro- gram. M✓M✓M✓Mo✓o✓o✓od✓d✓d✓de✓e✓e✓e specifies one of (currently) 16 different requests. Responses are always terminated with a _✓n_✓e_✓w _✓l_✓i_✓n_✓e for single line July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 18 - Macros responses, and with a pair of _✓n_✓e_✓w _✓l_✓i_✓n_✓e_✓s for multi-line responses. Conse- quently, clients can request and process information requests using nor- mal line mode processing. The following list of information requests is understood. G✓G✓G✓G_✓_✓_✓_A✓A✓A✓AL✓L✓L✓LL✓L✓L✓LM✓M✓M✓MI✓I✓I✓IN✓N✓N✓NE✓E✓E✓E Information about each window that may be written to by the client program is returned, one line of information per window, as a list of space separated items. The first two items give the location of the top left corner of the window in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. The second two items give the _✓h_✓e_✓i_✓g_✓h_✓t and _✓w_✓i_✓d_✓t_✓h of the window, also in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. The next field contains the last two charac- ters of the _✓p_✓s_✓e_✓u_✓d_✓otty associated with each window. Normally the _✓p_✓s_✓e_✓u_✓d_✓otty is the same for each window reported. The next field con- tains the _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d, which is 0 (zero) for the primary window, and the value returned by the call to m_makewindow()for the other win- dows (if any). The final field contains the visual status of the window, which is either _✓C__✓E_✓X_✓P_✓O_✓S_✓E_✓D ('e') if the window is completely visible, or _✓C__✓O_✓B_✓S_✓C_✓U_✓R_✓E_✓D ('o') if the window is partly or completely obscured. The window information is printed in order from _✓f_✓r_✓o_✓n_✓t to _✓b_✓a_✓c_✓k. A sample line might look something like: ______________________ |✓|_4✓_9✓_2✓__2✓__6✓_5✓_2✓__5✓_7✓_0✓__p✓_6✓__2✓__o✓__✓|✓| which indicates that the window at ( 4✓4✓4✓49✓9✓9✓92✓2✓2✓2,2✓2✓2✓2) is 6✓6✓6✓65✓5✓5✓52✓2✓2✓2 pixels _✓w_✓i_✓d_✓e and 5✓5✓5✓57✓7✓7✓70✓0✓0✓0 pixels _✓h_✓i_✓g_✓h, has a controlling _✓p_✓s_✓e_✓u_✓d_✓otty of /_✓d_✓e_✓v/_✓t_✓t_✓yp✓p✓p✓p6✓6✓6✓6, is alternate window number 2✓2✓2✓2,✓,✓,✓, and is at least partially obscured. G✓G✓G✓G_✓_✓_✓_A✓A✓A✓AL✓L✓L✓LL✓L✓L✓L Information about all windows is returned, one line of information per window, as a list of space separated items. The first two items give the location of the top left corner of the window in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. The second two items give the _✓h_✓e_✓i_✓g_✓h_✓t and _✓w_✓i_✓d_✓t_✓h of the window, also in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. The next field contains the last two characters of the _✓p_✓s_✓e_✓u_✓d_✓otty associated with each window. Normally the _✓p_✓s_✓e_✓u_✓d_✓otty is the same for each window controlled by the same client. The next field contains the _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d, which is 0 (zero) for a primary window, and the value returned by the call to m_makewindow()for alternate windows. The final field contains the visual status of the window, which is either _✓C__✓E_✓X_✓P_✓O_✓S_✓E_✓D ('e') if the window is completely visible, or _✓C__✓O_✓B_✓S_✓C_✓U_✓R_✓E_✓D ('o') if the window is partly or completely obscured. The window information for each win- dow is printed in order from _✓f_✓r_✓o_✓n_✓t to _✓b_✓a_✓c_✓k. Thus the first line returned is currently the _✓a_✓c_✓t_✓i_✓v_✓e window. A sample line might look something like: ______________________ |✓|_4✓_9✓_2✓__2✓__6✓_5✓_2✓__5✓_7✓_0✓__p✓_6✓__0✓__o✓__✓|✓| Which indicates that the window at ( 4✓4✓4✓49✓9✓9✓92✓2✓2✓2,2✓2✓2✓2) is 6✓6✓6✓65✓5✓5✓52✓2✓2✓2 pixels _✓w_✓i_✓d_✓e and 5✓5✓5✓57✓7✓7✓70✓0✓0✓0 pixels _✓h_✓i_✓g_✓h, has a controlling _✓p_✓s_✓e_✓u_✓d_✓otty of /_✓d_✓e_✓v/_✓t_✓t_✓yp✓p✓p✓p6✓6✓6✓6, is a main window, and is at least partially obscured. G✓G✓G✓G_✓_✓_✓_C✓C✓C✓CO✓O✓O✓OO✓O✓O✓OR✓R✓R✓RD✓D✓D✓DS✓S✓S✓S A single line is returned containing the location and size of the window in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. The first pair of numbers is the position of the top left corner of the window, the second pair of July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 19 - Macros numbers is the window's _✓w_✓i_✓d_✓t_✓h and _✓h_✓e_✓i_✓g_✓h_✓t in pixels. G✓G✓G✓G_✓_✓_✓_C✓C✓C✓CU✓U✓U✓UR✓R✓R✓RS✓S✓S✓SO✓O✓O✓OR✓R✓R✓R A single line is returned containing the position of the _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r and the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s cursor. The first pair of numbers is the current _✓c_✓o_✓l_✓u_✓m_✓n and _✓r_✓o_✓w in character coordinates and the second pair of numbers is the current _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓slocation in window coordinates. The graphics cursor location is reported in either _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e or _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e window coordinates, depending upon the window coordinate mode set- ting. G✓G✓G✓G_✓_✓_✓_F✓F✓F✓FO✓O✓O✓ON✓N✓N✓NT✓T✓T✓T A single line is returned which contains current font information. The first pair of numbers is the character _✓w_✓i_✓d_✓t_✓h and _✓h_✓e_✓i_✓g_✓h_✓t, in pix- els. The next number is the _✓f_✓o_✓n_✓t _✓n_✓u_✓m_✓b_✓e_✓r as would be used in a call to m✓m✓m✓m_✓_✓_✓_f✓f✓f✓fo✓o✓o✓on✓n✓n✓nt✓t✓t✓t, and the final field is the ascii name of the font. G✓G✓G✓G_✓_✓_✓_I✓I✓I✓ID✓D✓D✓D A single line is returned containing the window's alternate window id ( 0 for the main window), followed by the number of windows con- trolled by the client program. G✓G✓G✓G_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E The mouse position, in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates are returned, followed by the most recent button transition, which is one of 1✓1✓1✓1,-✓-✓-✓-1✓1✓1✓1,2✓2✓2✓2,-✓-✓-✓-2✓2✓2✓2. The numbers 1✓1✓1✓1 and 2✓2✓2✓2 represent buttons _✓o_✓n_✓e and _✓t_✓w_✓o on the mouse respec- tively. The third mouse button is reserved for system use and is not accessible to client programs. A negative value means the but- ton was released; a positive value indicates the button is still depressed. G✓G✓G✓G_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E2✓2✓2✓2 The mouse coordinates, in _✓w_✓i_✓n_✓d_✓o_✓w coordinates are returned, followed by the most recent button transition, which is one of 1✓1✓1✓1,-✓-✓-✓-1✓1✓1✓1,2✓2✓2✓2,-✓-✓-✓-2✓2✓2✓2. The numbers 1✓1✓1✓1 and 2✓2✓2✓2 represent buttons _✓o_✓n_✓e and _✓t_✓w_✓o respectively. A negative value means the button was last released; a positive value indicates the button is still depressed. If the mouse is above or to the left of the window, a negative coordinate value is returned. In addition if the window is in _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e coordinate mode, coordinate values between 0 and 999 will be reported only if the mouse is within the window. G✓G✓G✓G_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AT✓T✓T✓TU✓U✓U✓US✓S✓S✓S A line is returned containing a single character, either _✓C__✓E_✓X_✓P_✓O_✓S_✓E_✓D ('e'), _✓C__✓O_✓B_✓S_✓C_✓U_✓R_✓E_✓D ('o'), or _✓C__✓A_✓C_✓T_✓I_✓V_✓E ('a') depending upon whether the window is exposed but not the _✓a_✓c_✓t_✓i_✓v_✓e window, partially or totally obscured, or exposed and the _✓a_✓c_✓t_✓i_✓v_✓e window. G✓G✓G✓G_✓_✓_✓_S✓S✓S✓SY✓Y✓Y✓YS✓S✓S✓ST✓T✓T✓TE✓E✓E✓EM✓M✓M✓M A single line containing constant global information is returned. There are currently four fields: 1) The _✓h_✓o_✓s_✓t_✓n_✓a_✓m_✓e of the machine MGR is running on, as returned by _✓g_✓e_✓t_✓h_✓o_✓s_✓t_✓n_✓a_✓m_✓e(). July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 20 - Macros 2) The width of the display in pixels. 3) The height of the display in pixels. 4) The size of the window borders in pixels. G✓G✓G✓G_✓_✓_✓_T✓T✓T✓TE✓E✓E✓ER✓R✓R✓RM✓M✓M✓MC✓C✓C✓CA✓A✓A✓AP✓P✓P✓P A single line is returned which contains a _✓T_✓E_✓R_✓M_✓C_✓A_✓P entry for MGR. The _✓T_✓E_✓R_✓M_✓C_✓A_✓P entry is always the same, except for _✓l_✓i_✓n_✓e_✓s and _✓c_✓o_✓l_✓u_✓m_✓n_✓s entries (li# and co#), which vary to reflect the current window size. G✓G✓G✓G_✓_✓_✓_T✓T✓T✓TE✓E✓E✓EX✓X✓X✓XT✓T✓T✓T A single line containing four integers is returned with the current text region size. The first pair of numbers is the top left corner of the text region, in _✓w_✓i_✓n_✓d_✓o_✓w coordinates, the second pair of numbers is the _✓w_✓i_✓d_✓t_✓h and _✓h_✓e_✓i_✓g_✓h_✓t of the text region. If no text region is defined, implying the entire window is the text region, all four numbers are returned as 0 (zero). G✓G✓G✓G_✓_✓_✓_W✓W✓W✓WI✓I✓I✓IN✓N✓N✓NS✓S✓S✓SI✓I✓I✓IZ✓Z✓Z✓ZE✓E✓E✓E A single line is returned containing the current number of _✓c_✓o_✓l_✓u_✓m_✓n_✓s and _✓r_✓o_✓w_✓s in the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n. If no text region is defined, the number of _✓l_✓i_✓n_✓e_✓s and _✓c_✓o_✓l_✓u_✓m_✓n_✓s for the entire window is returned. G✓G✓G✓G_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LA✓A✓A✓AG✓G✓G✓GS✓S✓S✓S A single line is returned containing a hexadecimal number represent- ing the current window mode bits. Each mode is represented by a bit in the word. Many of the modes may be _✓s_✓e_✓t or _✓c_✓l_✓e_✓a_✓r_✓e_✓d with m_setmode() or m_clearmode(). See the discussion of m_setmode() for a detailed discussion of these flags. The meaningful mode bits are: 0x000001 The window is completely exposed. 0x000004 It is possible to use the system _✓c_✓u_✓t function in this win- dow. This mode is restored by clearing the window. See m_clear(). 0x000008 The window is _✓w_✓h_✓i_✓t_✓e text on a _✓b_✓l_✓a_✓c_✓k background. 0x000010 The window is in standout mode. Individual characters are printed in reverse. 0x000020 The window has died. If a client sees this flag, the win- dow is about to go away. 0x000040 Expose the window upon shell output. The window will be automatically activated when the next character arrives for output on the window. 0x000080 Permit a partially or totally obscured window to update. 0x000100 Do not kill the window when the original process started in it dies. This flag may only be set from the startup July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 21 - Macros file. 0x000200 _✓V_✓i mode is turned on. Pushing the right mouse button sends the characters: ________________ |✓|_r✓_✓r✓r✓ro✓_✓o✓o✓ow✓_✓w✓w✓w_H✓__c✓_✓c✓c✓co✓_✓o✓o✓ol✓_✓l✓l✓lu✓_✓u✓u✓um✓_✓m✓m✓mn✓_✓n✓n✓n_|✓__✓|✓| where r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w and c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n specifies the character location the mouse is sitting on. This has the effect of aligning _✓v_✓i's notion of the current character position with the mouse. 0x000800 Keyboard input is refused when the window is active. 0x001000 Auto wrap mode is turned on. The character cursor automatically wraps to the beginning of the next row when it reaches the right margin of the text region. 0x002000 Overstrike mode is turned on. Characters are written to the window using the the current drawing mode, as set by m_func(). 0x004000 The window is in _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e window coordinate mode. 0x010000 The system _✓c_✓u_✓t function snarfs complete lines only. 0x020000 The system _✓c_✓u_✓t function changes spaces to tabs whenever possible. Tabs are assumed to be every 8 spaces. 0x040000 The system _✓c_✓u_✓t function will attempt to snarf text even if errors occur. m_go( x✓x✓x✓x,y✓y✓y✓y) Move the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t to the window position ( x✓x✓x✓x,y✓y✓y✓y) in the current win- dow coordinates. m_gotext() The graphics point is moved to the bottom left corner of the current character cursor location. m_halfwin( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t) A window is created at X✓X✓X✓X,Y✓Y✓Y✓Y of size D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h by D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t with no process con- nected to it. MGR returns the name of the file, a _✓p_✓s_✓e_✓u_✓d_✓o-_✓t_✓t_✓y, that must be opened in order to talk to the new window. A process which opens that _✓p_✓s_✓e_✓u_✓d_✓o-_✓t_✓t_✓y becomes a client program, communicating with MGR and the new window in the usual fashion. For a single process managing multiple win- dows, use m_newwin(). m_highlight( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t) MGR flashes the rectagular portion of the display starting at X✓X✓X✓X,Y✓Y✓Y✓Y of size D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h by D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t. This is an experimental capability and may be removed in the future. m_incr( n✓n✓n✓n) The current character position is adjusted to the left or right n✓n✓n✓n units in _✓w_✓i_✓n_✓d_✓o_✓w coordinates. The argument n✓n✓n✓n may be signed to indicate movement July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 22 - Macros to the left (if negative) or to the right (if positive or unsigned). This is useful for client programs dealing with proportionally spaced text. m_left( n✓n✓n✓n) Move the character cursor left n✓n✓n✓n tenths of a character width. See also m_down()m_right()and m_up(). m_line( x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1,x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2) Draw a line in the current window from the coordinate ( x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1) to the coordinate ( x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2). The line is either set, cleared or inverted as determined by the last call to m_func(). m_linecolor( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e,c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r) The drawing mode and color is set for all graphics and bit-blt opera- tions. The integer m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e sets the drawing mode, in the manner of m_func(). The integer c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r is the index into the color lookup table for the drawing color. This command is equivalent to m_func()on a monochrome display. See also m_fcolor()and m_linecolor(). m_lineto( t✓t✓t✓to✓o✓o✓o,x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1,x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2) Draw a line on the scratchpad bitmap t✓t✓t✓to✓o✓o✓o from the coordinate ( x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1) to the coordinate ( x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2). The line is either set, cleared or inverted as determined by the last call to m_func(). m_linkmenu( p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t,i✓i✓i✓it✓t✓t✓te✓e✓e✓em✓m✓m✓m,c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d,m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) The menus p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t and c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d are linked together. When menu p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t is popped up and item number i✓i✓i✓it✓t✓t✓te✓e✓e✓em✓m✓m✓m (starting from zero) is highlighted, slid- ing off to the right of the p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t menu causes the c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d menu to pop up. When an item is chosen, MGR sends the concatenation of the action strings associated with each of the popped-up menus, from left to right (i.e. p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t to c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d). An arbitrary tree of menus may be created by linking successive menus together in this manner. It is up to the application to indicate on the parent menu item that sliding to the right will pop up a child menu. Typically "-✓-✓-✓->✓>✓>✓>" is used. The m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e argument, if not zero, changes the menu options for the p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t menu. The flag settings, which may be _✓o_✓r-ed together (except for M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_C✓C✓C✓CL✓L✓L✓LE✓E✓E✓EA✓A✓A✓AR✓R✓R✓R ) are: M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NI✓I✓I✓IP✓P✓P✓P By default, when an item in a _✓c_✓h_✓i_✓l_✓d menu is selected, the values associated with the highlighted items for all of the ancestor menus are concatenated to the _✓c_✓h_✓i_✓l_✓d's item value. When M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NI✓I✓I✓IP✓P✓P✓P is enabled, only the string associated with the child menu is returned. M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_P✓P✓P✓PA✓A✓A✓AG✓G✓G✓GE✓E✓E✓E Normally, whenever a menu is popped-up, the previously chosen item is initially highlighted. If M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_P✓P✓P✓PA✓A✓A✓AG✓G✓G✓GE✓E✓E✓E is enabled, this behavior is extended to paged menus. MGR automatically pages through a set of paged menus to highlight the currently selected item. M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TO✓O✓O✓O MGR will automatically slide to the right and pop up a child menu to July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 23 - Macros highlight the previously selected item. M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_C✓C✓C✓CL✓L✓L✓LE✓E✓E✓EA✓A✓A✓AR✓R✓R✓R Clears the mode M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NI✓I✓I✓IP✓P✓P✓P, M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_P✓P✓P✓PA✓A✓A✓AG✓G✓G✓GE✓E✓E✓E, and M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TO✓O✓O✓O. See also m_loadmenu(), m_selectmenu(), and m_unlinkmenu(). m_loadfont( n✓n✓n✓n,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e) The MGR font whose pathname is n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e is downloaded into MGR, replacing the font currently located at position n✓n✓n✓n. Any subsequent calls to m_font()will select the newly downloaded font. The font that used to be at position n✓n✓n✓n remains available to windows that are already using it, but is unavailable for future use. The format of MGR font files is described in _✓f_✓o_✓n_✓t._✓h. m_loadmenu( n✓n✓n✓n,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) The text s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is downloaded into menu position n✓n✓n✓n. The first character of s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is the _✓m_✓e_✓n_✓u _✓d_✓e_✓l_✓i_✓m_✓i_✓t_✓e_✓r character. All of the menu item strings are concatenated, followed by all of their action strings. The _✓m_✓e_✓n_✓u _✓d_✓e_✓l_✓- _✓i_✓m_✓i_✓t_✓e_✓r character separates all of the items and actions and terminates the list. Menus are downloaded at once, as a single entity. The macro m_selectmenu() is used to have the menu pop-up when a mouse button is pushed. m_move( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w) The character cursor is moved to character location c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w , where ( 0✓0✓0✓0,0✓0✓0✓0) is the top left character position on the window, or on the current text region if one is specified (see m_textregion()). m_movecursor( x✓x✓x✓x,y✓y✓y✓y) Move the character cursor to the position ( x✓x✓x✓x,y✓y✓y✓y) in window coordinates. This permits characters to be placed at arbitrary pixel locations, not just on character boundaries. Use m_move()to move to a r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w and c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n position. m_movemouse( X✓X✓X✓X,Y✓Y✓Y✓Y) Move the mouse to position ( X✓X✓X✓X,Y✓Y✓Y✓Y) in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. Excessive use of this macro is anti-social. m_moveprint( x✓x✓x✓x,y✓y✓y✓y,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) Print s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g at the window coordinate ( x✓x✓x✓x,y✓y✓y✓y). This macro is equivalent to calling m_movecursor() followed by m_printstr(). m_movewindow( X✓X✓X✓X,Y✓Y✓Y✓Y) Move the window to the display location ( X✓X✓X✓X,Y✓Y✓Y✓Y) in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates. If the new position is too close to the edge of the display for the win- dow to fit entirely at the requested location, the right edge or bottom of the window is truncated at the boundary of the display. An alternate window is created with the size and location indicated. The arguments X✓X✓X✓X and Y✓Y✓Y✓Y specify the upper left corner of the window, D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e and D✓D✓D✓Dh✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h the size. If the window is to be to fit at the requested location, its size is truncated appropriately. MGR will return a window number if the creation is successful, or a _✓n_✓e_✓w_✓l_✓i_✓n_✓e if the window could not be created. The newly created window is made the _✓a_✓c_✓t_✓i_✓v_✓e window. The macro m_selectwin()is used to enable writing on the newly created window. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 24 - Macros m_nomenu() Deselect all menus. No menu will pop-up when the middle mouse button is pressed. This call does not delete the menu, it simply disassociates it from the button. m_nomenu2() Deselect all menus. No menu will pop-up when the right mouse button is pressed. This call does not delete the menu, it simply disassociates it from the button. This macro should be combined with m_nomenu() but is separate for historical reasons. m_othersave( i✓i✓i✓id✓d✓d✓d,s✓s✓s✓su✓u✓u✓ub✓b✓b✓b,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e) The bitmap contents of the window identified as i✓i✓i✓id✓d✓d✓d.s✓s✓s✓su✓u✓u✓ub✓b✓b✓b is saved in the file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e in bitmap format (see _✓d_✓u_✓m_✓p._✓h for a description of the bitmap format). The _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d can be determined either by calling m_getinfo( G✓G✓G✓G_✓_✓_✓_A✓A✓A✓AL✓L✓L✓LL✓L✓L✓L) or from the event _✓M__✓A_✓C_✓C_✓E_✓P_✓T (see m_setevent()). See also m_windowsave() and m_bitsave(). m_pagemenu( p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t,c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d) Connect menu c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d to the bottom of menu p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t to permit a long menu to be paged. Mousing off the bottom of the p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t menu automatically pops- up the _✓c_✓h_✓i_✓l_✓d menu, which in turn may be the parent of another menu. See also m_unpagemenu(), m_linkmenu() and m_unlinkmenu(). m_pop() Pop the window context. The last window context saved by calling m_push() or m_pushsave() is restored. If no environments have been pushed, m_pop()is ignored. m_popall() Like m_pop()above, except all environments pushed since the first call to m_setup()are popped. The macro m_popall() is typically used as part of the clean up before client program termination. m_printstr( s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) Print s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g on the window at the current character cursor location. This is equivalent to the _✓s_✓t_✓d_✓i_✓o function _✓p_✓r_✓i_✓n_✓t_✓f with a %_✓s format speci- fied and the output directed toward the file pointer _✓m__✓t_✓e_✓r_✓m_✓o_✓u_✓t instead of _✓s_✓t_✓d_✓o_✓u_✓t. m_push( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) Certain parts (stack modes) of the current window environment may be moved to a stack, to be restored at a later time with m_pop()or m_popall(). Any combination of the following pieces of the window environment, called a window context, may be placed on the window stack. P✓P✓P✓P_✓_✓_✓_B✓B✓B✓BI✓I✓I✓IT✓T✓T✓TM✓M✓M✓MA✓A✓A✓AP✓P✓P✓P All currently defined _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmaps are moved to the stack and become undefined in the current window context. P✓P✓P✓P_✓_✓_✓_C✓C✓C✓CU✓U✓U✓UR✓R✓R✓RS✓S✓S✓SO✓O✓O✓OR✓R✓R✓R The current _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r cursor and _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t positions are saved on the stack. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 25 - Macros P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T All currently defined events are moved to the stack and become unde- fined in the current window context. P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LA✓A✓A✓AG✓G✓G✓GS✓S✓S✓S The window modes, as set with m_setmode()are moved to the stack. The modes revert to their default settings in the current window context. P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FO✓O✓O✓ON✓N✓N✓NT✓T✓T✓T The current font setting is copied to the stack. If this font is subsequently deleted, by writing over it with a different font, the original font setting is retained, even if it can no longer be accessed using m_font(). P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U All downloaded menus and menu links are moved to the the stack along with the currently selected menu number. The menus become undefined in the current context. P✓P✓P✓P_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E The mouse cursor location is saved on the stack. Its current loca- tion remains the same. P✓P✓P✓P_✓_✓_✓_P✓P✓P✓PO✓O✓O✓OS✓S✓S✓SI✓I✓I✓IT✓T✓T✓TI✓I✓I✓IO✓O✓O✓ON✓N✓N✓N The window size and location is saved on the stack. The current size and location are maintained. P✓P✓P✓P_✓_✓_✓_T✓T✓T✓TE✓E✓E✓EX✓X✓X✓XT✓T✓T✓T The text region location and size are saved on the stack. The text region in the current context is reset to the entire window. P✓P✓P✓P_✓_✓_✓_W✓W✓W✓WI✓I✓I✓IN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OW✓W✓W✓W The current image contents of the window is copied to the stack. This is done without altering the current contents of the window. Stack modes are combined by _✓o_✓r-ing them together to form a saved window context, such as: m_push( P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U|✓|✓|✓|P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T) which will save all events, and menus but leave everything else alone. All stack modes that require client download data revert to their default settings when they are _✓p_✓u_✓s_✓h_✓e_✓d. For example, after m_push( P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U|✓|✓|✓|P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T|✓|✓|✓|P✓P✓P✓P_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E) is called, no events or menus are currently defined, but the mouse remains where it is. The defined constant _✓P__✓A_✓L_✓L refers to all of the modes. m_pushsave( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) Certain parts (stack modes) of the current window environment may be copied to a stack, to be restored at a later time with m_pop()or m_popall(). The macro m_pushsave() differs from m_push()in that down- loaded data, such as _✓m_✓e_✓n_✓u_✓s _✓e_✓v_✓e_✓n_✓t_✓s or _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmaps are copied to the stack instead of moved, and thus remain in effect after the call to m_pushsave(). The current window context is thus unaffected. Any combi- nation of the following pieces of the window environment may be copied to the window stack. P✓P✓P✓P_✓_✓_✓_B✓B✓B✓BI✓I✓I✓IT✓T✓T✓TM✓M✓M✓MA✓A✓A✓AP✓P✓P✓P July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 26 - Macros All currently defined _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmaps are copied to the stack. P✓P✓P✓P_✓_✓_✓_C✓C✓C✓CU✓U✓U✓UR✓R✓R✓RS✓S✓S✓SO✓O✓O✓OR✓R✓R✓R The current _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r and _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s cursor positions are saved on the stack. P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T All currently defined events are copied to the stack. P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LA✓A✓A✓AG✓G✓G✓GS✓S✓S✓S The window modes, as set with m_setmode(), are copied to the stack. P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FO✓O✓O✓ON✓N✓N✓NT✓T✓T✓T The current font setting is copied to the stack. If this font is subsequently deleted, by writing over it with a different font, the original font setting is retained, even if it can no longer be accessed using m_font(). P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U All downloaded menus and menu links are copied to the the stack along with the currently selected menu number. P✓P✓P✓P_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E The mouse cursor location is saved on the stack. P✓P✓P✓P_✓_✓_✓_P✓P✓P✓PO✓O✓O✓OS✓S✓S✓SI✓I✓I✓IT✓T✓T✓TI✓I✓I✓IO✓O✓O✓ON✓N✓N✓N The window size and location are saved on the stack. P✓P✓P✓P_✓_✓_✓_T✓T✓T✓TE✓E✓E✓EX✓X✓X✓XT✓T✓T✓T The text region location and size are saved on the stack. P✓P✓P✓P_✓_✓_✓_W✓W✓W✓WI✓I✓I✓IN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OW✓W✓W✓W The current image contents of the window is copied to the stack. Stack modes are combined by _✓o_✓r-ing them together to form a saved window context, such as: m_push( P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U|✓|✓|✓|P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T) which will save all events, and menus but leave everything else alone. m_put( s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is put into the global _✓s_✓n_✓a_✓r_✓f buffer. There is one common buffer for all clients programs. The macro m_snarf() is used to retrieve the contents of the buffer. The MGR system _✓c_✓u_✓t function places text in this buffer, whereas the system _✓p_✓a_✓s_✓t_✓e function pastes text from this buffer. m_putchar( c✓c✓c✓c) The character c✓c✓c✓c is written in the window at the current character cursor location. This function is like the _✓s_✓t_✓d_✓i_✓o _✓p_✓u_✓t_✓c_✓h_✓a_✓r(_✓c), only directed toward the client's window. m_rcircle( r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s) A circle of radius r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s is drawn, centered at the current _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t. The points at the edge of the circle are set, cleared or inverted depending upon the last call to m_func(). Circles are always drawn as circles, both in _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e and in _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e window coordinates. The r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s is scaled based upon the average w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t of the window. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 27 - Macros m_rellipse( r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2) Draw an ellipse centered at the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t. The two radii, r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 specify the major and minor axis. The ellipse is either set, cleared, or inverted determined by the last call to m_func(). If the window is in _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e coordinate mode, r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 are scaled based upon the average w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t of the window. m_resetesc() The MGR _✓e_✓s_✓c_✓a_✓p_✓e character is reset to its to default value ('\033'). This turns off the debugging mode turned on by m_setesc(). m_rfastdraw( c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t,d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a) The next c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t bytes of d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a are sent to MGR are to be interpreted as lines drawn in _✓f_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode, starting at The current graphics point. _✓F_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode permits the rapid drawing of short vectors by encoding an _✓x,_✓y displacement location in a single byte. The _✓x coordinate is con- tained in the most significant 4 bits, the _✓y coordinate in the least sig- nificant 4 bits. Values for _✓x and _✓y represent displacements from the previous location, and range from +7 to -8. A 7 is coded as _✓0_✓x_✓f_✓f, a -8 as _✓0_✓x_✓0_✓0. If both _✓x and _✓y are zero (i.e. _✓0_✓x_✓8_✓0_✓8_✓0). The next coordinate is taken to be a _✓m_✓o_✓v_✓e instead of a _✓d_✓r_✓a_✓w. An eight bit channel between MGR and the client program is required for _✓f_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode. See also m_fastdraw(). m_right( n✓n✓n✓n) Move the character cursor right n✓n✓n✓n tenths of a character width. See also m_left()m_down()and m_up(). m_scrollregion( f✓f✓f✓fi✓i✓i✓ir✓r✓r✓rs✓s✓s✓st✓t✓t✓t_✓_✓_✓_r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w,l✓l✓l✓la✓a✓a✓as✓s✓s✓st✓t✓t✓t_✓_✓_✓_r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w) This sets up a _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n as a _✓V_✓T_✓1_✓0_✓0-_✓l_✓i_✓k_✓e scrolling region. The entire width of the window from lines f✓f✓f✓fi✓i✓i✓ir✓r✓r✓rs✓s✓s✓st✓t✓t✓t_✓_✓_✓_r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w to l✓l✓l✓la✓a✓a✓as✓s✓s✓st✓t✓t✓t_✓_✓_✓_r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w inclusive becomes the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n. See also m_textregion(). m_selectmenu( n✓n✓n✓n) This macro is used to indicate menu n✓n✓n✓n pops-up in response to pressing the _✓m_✓i_✓d_✓d_✓l_✓e mouse button. Menus are downloaded (with m_loadmenu()) first, then selected. Only one menu may be selected at a time on each button. If the button is already down when this call is made, and there is not currently a menu associated with the button, then the menu just selected pops-up immediately. This last feature may be used to pop up different menus in a context sensitive way. m_selectmenu2( n✓n✓n✓n) This macro is used to indicate menu n✓n✓n✓n pops-up in response to pressing the _✓r_✓i_✓g_✓h_✓t mouse button. Menus are downloaded (with m_loadmenu()) first, then selected. This macro functions the same as, and should be combined with m_selectmenu() above, but exists separately for historical reasons. m_selectwin( n✓n✓n✓n) Select alternate window n✓n✓n✓n for output. Alternate windows are first created by m_newwin(). All output goes to the selected window until either m_selectwin()is called to change windows, or the selected window is destroyed. If n✓n✓n✓n is 0 (zero) or the currently selected window is des- troyed, the main, or original window is selected. Input from all windows July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 28 - Macros is send to the client program on the same input channel. The macro m_setevent( A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E) may be used to help decide what window generated the input by associating a unique string with each window's _✓A_✓C_✓T_✓I_✓V_✓A_✓T_✓E event. The _✓s_✓e_✓l_✓e_✓c_✓t_✓e_✓d window and the _✓a_✓c_✓t_✓i_✓v_✓e window are specified indepen- dently. Selecting a window does not make it the _✓a_✓c_✓t_✓i_✓v_✓e window, and creating a new window, although it is created as the _✓a_✓c_✓t_✓i_✓v_✓e window, is not automatically selected. m_sendme( s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) The argument s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is sent back to the client process as if it was typed in at the keyboard. m_sendto( n✓n✓n✓n,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) The message s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is send to window n✓n✓n✓n. A unique window identifier, n✓n✓n✓n is determined with either m_setevent() using the %_✓w option, or with m_getinfo(). In general, the window id n✓n✓n✓n is the process id (_✓p_✓i_✓d) of the client program started by MGR when the window was created. If the target window has turned on _✓A_✓C_✓C_✓E_✓P_✓T with m_setevent(), s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is received by the client program associated with the target window as part of the _✓A_✓C_✓C_✓E_✓P_✓T event. General write permissions must be disabled on the target client's _✓p_✓s_✓e_✓u_✓d_✓otty in order for the message to be received, to prevent unsuspect- ing _✓s_✓h_✓e_✓l_✓ls from interpreting messages sent by unscrupulous processes as commands. See also m_broadcast(). m_setesc( c✓c✓c✓c) This macro call causes the character c✓c✓c✓c to be used as the MGR escape char- acter by the library package (instead of '\_✓0_✓3_✓3'). This permits viewing the output stream to MGR without causing the commands to be executed. m_setecho() Turn on character echoing, if possible. Character echoing is normally disabled by clients to inhibit information from MGR, as from calls to m_getinfo(), from echoing on the window. m_setevent( n✓n✓n✓n,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) An event string, s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is sent to the client program by MGR upon the occurrence of the specified event n✓n✓n✓n. The event string is typically read by the client program using m_gets(). Event strings are never sent in response to an event unless specifically requested by the client program. Events are one of the following types. A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E The window became the _✓a_✓c_✓t_✓i_✓v_✓e window. It is at the front of the display, and is currently receiving both mouse and keyboard input. B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1 The right mouse button was depressed. This event is sent only to the _✓a_✓c_✓t_✓i_✓v_✓e window. B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1U✓U✓U✓U The right mouse button was released. This event is sent only to the _✓a_✓c_✓t_✓i_✓v_✓e window. B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2 July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 29 - Macros The middle mouse button was depressed. This event is sent only to the _✓a_✓c_✓t_✓i_✓v_✓e window. B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2U✓U✓U✓U The middle mouse button was released. This event is sent only to the _✓a_✓c_✓t_✓i_✓v_✓e window. C✓C✓C✓CO✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RE✓E✓E✓ED✓D✓D✓D The window was partially or completely obscured by another window. D✓D✓D✓DE✓E✓E✓EA✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E The window was deactivated, it is no longer the _✓a_✓c_✓t_✓i_✓v_✓e window. R✓R✓R✓RE✓E✓E✓ED✓D✓D✓DR✓R✓R✓RA✓A✓A✓AW✓W✓W✓W The display was redrawn, either by selecting the _✓r_✓e_✓d_✓r_✓a_✓w option from the system menu, or by keying _✓L_✓E_✓F_✓T-_✓r from the keyboard. Only win- dows that are exposed receive the _✓R_✓E_✓D_✓R_✓A_✓W event. The images of obscured windows are restored automatically by MGR. The client pro- gram is expected to regenerate the contents of its window in response to the _✓R_✓E_✓D_✓R_✓A_✓W event. R✓R✓R✓RE✓E✓E✓ES✓S✓S✓SH✓H✓H✓HA✓A✓A✓AP✓P✓P✓PE✓E✓E✓E The window was reshaped. If the user selects the system _✓r_✓e_✓s_✓h_✓a_✓p_✓e option, the _✓R_✓E_✓S_✓H_✓A_✓P_✓E event is sent, even if the window stays the same shape. U✓U✓U✓UN✓N✓N✓NC✓C✓C✓CO✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RE✓E✓E✓ED✓D✓D✓D The window, previously obscured, was uncovered. If the window also became the _✓a_✓c_✓t_✓i_✓v_✓e window, the _✓U_✓N_✓C_✓O_✓V_✓E_✓R_✓E_✓D event is sent before the _✓A_✓C_✓T_✓I_✓V_✓A_✓T_✓E event. M✓M✓M✓MO✓O✓O✓OV✓V✓V✓VE✓E✓E✓E The window was moved. D✓D✓D✓DE✓E✓E✓ES✓S✓S✓ST✓T✓T✓TR✓R✓R✓RO✓O✓O✓OY✓Y✓Y✓Y The window was destroyed. Only _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e windows (as created by m_newwin()) cause _✓D_✓E_✓S_✓T_✓R_✓O_✓Y events to be sent. If the _✓m_✓a_✓i_✓n window is destroyed, the client program is sent a _✓h_✓a_✓n_✓g_✓u_✓p signal, and its con- nection to MGR is severed. A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T Messages are accepted from client programs running in other windows (see m_sendto()). The content of the message is obtained by speci- fying the %✓%✓%✓%m✓m✓m✓m parameter as part of the event string, as is fully described below. N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y Register a name with MGR, and make this name available to client programs. This name is available to other clients, either by a call to m_getinfo( G✓G✓G✓G_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y) or with the %✓%✓%✓%n✓n✓n✓n parameter described below. Unlike the other events, the _✓n_✓o_✓t_✓i_✓f_✓y string is never sent back to the client program by MGR, but is used to register a name for the win- dow. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 30 - Macros S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FE✓E✓E✓ED✓D✓D✓D Text was put into the snarf buffer either by a client program with m_put() or by use of the system _✓c_✓u_✓t function. P✓P✓P✓PA✓A✓A✓AS✓S✓S✓ST✓T✓T✓TE✓E✓E✓E Text is about to arrive as a result of the system _✓p_✓a_✓s_✓t_✓efunction. Some _✓e_✓v_✓e_✓n_✓t strings may contain substitutable parameters in the manner of _✓p_✓r_✓i_✓n_✓t_✓f format specifiers (i.e. %X). These parameters are applicable only to certain types of events. In any case, the % character may be forced by doubling it, as in %%. Where more than one data item replaces the format specifier, the items are separated by a _✓s_✓p_✓a_✓c_✓e character. For the event strings B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1 and B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2, several parameters cause MGR to sweep out some object in response to mouse movement, and report back the size of the swept object when the button is released. Any one of lines, boxes, text, or rectangles may be swept out with this mechanism. Initial parameters may be associated with a sweep event by listing them as comma separated integers following the % and preceding the sweep command char- acter. The parameters (if any) set the initial size of the object to be swept, in the same coordinate system in which the sweep extend is reported. %✓%✓%✓%r✓r✓r✓r Depressing the button causes MGR to sweep out a rectangle in response to moving the mouse, in a manner similar to the system _✓r_✓e_✓s_✓h_✓a_✓p_✓e function. The initial parameters set the initial width and height of the rectangle. When the button is released, the coordi- nates of the _✓s_✓t_✓a_✓r_✓t_✓i_✓n_✓g and _✓e_✓n_✓d_✓i_✓n_✓g points of the rectangle in response to moving the mouse, in _✓w_✓i_✓n_✓d_✓o_✓w coordinates, are substituted for the %_✓r. %✓%✓%✓%R✓R✓R✓R Depressing the button causes MGR to sweep out a rectangle, as in %_✓r above, only the the result is in _✓d_✓i_✓s_✓p_✓l_✓a_✓ycoordinates. %✓%✓%✓%b✓b✓b✓b Depressing the button causes MGR to move a rectangle in response to moving the mouse, in a manner similar to the system _✓m_✓o_✓v_✓e function. The initial parameters set the initial width and height of the rec- tangle to be moved. When the button is released, the current coor- dinates of the box's corner is returned in _✓w_✓i_✓n_✓d_✓o_✓w coordinates, sub- stituted for the %_✓b. %✓%✓%✓%B✓B✓B✓B Depressing the button causes MGR to move a rectangle in response to moving the mouse, in a manner similar to the system _✓m_✓o_✓v_✓e function. The initial parameters set the initial width and height of the rec- tangle to be moved. When the button is released, the current coor- dinates of the box's corner is returned in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates, sub- stituted for the %_✓b. %✓%✓%✓%l✓l✓l✓l Depressing the button causes MGR to sweep out a line. One end of the line remains fixed at the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t while the other end of the line tracks the mouse position. The initial end point of the line may be specified as a displacement from the graphics point as part of the initial parameters. When the button is released, the coordinates of the _✓s_✓t_✓a_✓r_✓t_✓i_✓n_✓g and _✓e_✓n_✓d_✓i_✓n_✓g points of the line, in _✓w_✓i_✓n_✓d_✓o_✓w coordinates, are substituted for the %_✓l. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 31 - Macros %✓%✓%✓%t✓t✓t✓t Depressing the button causes MGR to sweep out text, in a manner equivalent to the system _✓c_✓u_✓t function. Upon the release of the but- ton, the %_✓t is replaced by the starting character coordinate of the _✓c_✓u_✓t region, followed by character distance to the ending point in columns and lines respectively. For example, The event string _✓s_✓w_✓e_✓e_✓p[%✓%✓%✓%t✓t✓t✓t] might return _✓s_✓w_✓e_✓e_✓p[1✓1✓1✓17✓7✓7✓7 5✓5✓5✓5 6✓6✓6✓6 0✓0✓0✓0], indicating the user swept out a six character word on a single line, starting on c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n 17, r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w 5. An inital size may ber specified in number of rows and number of columns. The remaining format specifiers are replaced by the information described below No sweep action is performed. %✓%✓%✓%p✓p✓p✓p The %_✓p is replaced by the current mouse coordinates, in _✓w_✓i_✓n_✓d_✓o_✓w coor- dinates. %✓%✓%✓%P✓P✓P✓P The %_✓P is replaced by the current mouse coordinates, in _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinates. %✓%✓%✓%n✓n✓n✓n If the mouse cursor is over a window whose N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y event is set, the text of that message is substituted for the %_✓n. %✓%✓%✓%w✓w✓w✓w If the mouse cursor is over a window whose N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y event is set, the w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w_✓_✓_✓_i✓i✓i✓id✓d✓d✓d of the clicked on window is substituted for the %_✓w. This w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w_✓_✓_✓_i✓i✓i✓id✓d✓d✓d may be used by m_sendto()to send the clicked-on window a message. %✓%✓%✓%S✓S✓S✓S If the mouse cursor is over a window whose N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y event is set, the length of that message is substituted for the %_✓S. The A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T event is used to receive messages from other client programs. The following substituteable parameters may be used as part of the event string. %✓%✓%✓%f✓f✓f✓f The w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w_✓_✓_✓_i✓i✓i✓id✓d✓d✓d of message sender, as used in m_sendto(), replaces the %_✓f. %✓%✓%✓%m✓m✓m✓m The text of message sent by the other client program replaces the %_✓m %✓%✓%✓%s✓s✓s✓s The length of the message, in characters, replaces the %_✓s. For example, a call to __________________________________________________________ |✓|_m✓__✓_s✓_e✓_t✓_e✓_v✓_e✓_n✓_t✓_(✓_A✓_C✓_C✓_E✓_P✓_T✓_,✓_"✓_M✓_e✓_s✓_s✓_a✓_g✓_e✓__f✓_r✓_o✓_m✓__(✓_%✓_✓%✓%✓%f✓_✓f✓f✓f)✓_,✓__(✓_%✓_✓%✓%✓%s✓_✓s✓s✓s)✓__l✓_o✓_n✓_g✓__i✓_s✓_:✓__%✓_✓%✓%✓%m✓_✓m✓m✓m"✓_)✓__✓|✓| might cause MGR to return ______________________________________ |✓|_M✓_e✓_s✓_s✓_a✓_g✓_e✓__f✓_r✓_o✓_m✓__(✓_3✓_✓3✓3✓32✓_✓2✓2✓21✓_✓1✓1✓14✓_✓4✓4✓4)✓_,✓__(✓_2✓_✓2✓2✓2)✓__l✓_o✓_n✓_g✓__i✓_s✓_:✓__H✓_✓H✓H✓HI✓_✓I✓I✓I_✓|✓| after the client program whose _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d is _✓3_✓2_✓1_✓4 uses m_sendto()to send the message "_✓H_✓I". %✓%✓%✓%p✓p✓p✓p As with the B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N events above, %_✓p is replaced by the current mouse position in _✓w_✓i_✓n_✓d_✓o_✓w coordinates. %✓%✓%✓%P✓P✓P✓P As with the B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N events above, %_✓P is replaced by the current mouse position in _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinates. For the S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FE✓E✓E✓ED✓D✓D✓D event string, the following substitution parameters are July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 32 - Macros recognized. %✓%✓%✓%f✓f✓f✓f The _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d of the window filling the _✓s_✓n_✓a_✓r_✓f buffer replaces the %_✓f. %✓%✓%✓%c✓c✓c✓c The current length of the _✓s_✓n_✓a_✓r_✓f buffer, in characters, replaces the %_✓c. %✓%✓%✓%C✓C✓C✓C The contents of the _✓s_✓n_✓a_✓r_✓f buffer replaces the %_✓C. At present, only the first 250 characters of the _✓s_✓n_✓a_✓r_✓f buffer may be returned via the %_✓C parameter. Use m_snarf()to read the entire buffer. The P✓P✓P✓PA✓A✓A✓AS✓S✓S✓ST✓T✓T✓TE✓E✓E✓E event string, recognizes the %_✓c specifier as described under _✓S_✓N_✓A_✓R_✓F_✓E_✓D above. m_setmode( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) Various window modes may be _✓s_✓e_✓t or _✓c_✓l_✓e_✓a_✓r_✓e_✓d (see m_clearmode()) indepen- dently. These modes are: M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OU✓U✓U✓UT✓T✓T✓T The window is put in standout mode. All characters are written with their foreground and background colors reversed. M✓M✓M✓M_✓_✓_✓_W✓W✓W✓WO✓O✓O✓OB✓B✓B✓BThe sense of _✓w_✓h_✓i_✓t_✓e and _✓b_✓l_✓a_✓c_✓k is reversed for the entire window, not just for characters as is _✓M__✓S_✓T_✓A_✓N_✓D_✓O_✓U_✓T. M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TO✓O✓O✓OE✓E✓E✓EX✓X✓X✓XP✓P✓P✓PO✓O✓O✓OS✓S✓S✓SE✓E✓E✓E The next character to be typed on the window causes it to automati- cally become the _✓a_✓c_✓t_✓i_✓v_✓e window. M✓M✓M✓M_✓_✓_✓_B✓B✓B✓BA✓A✓A✓AC✓C✓C✓CK✓K✓K✓KG✓G✓G✓GR✓R✓R✓RO✓O✓O✓OU✓U✓U✓UN✓N✓N✓ND✓D✓D✓D Output goes to the window even if it is partially or totally obscured. The data in exposed portions of the window is seen immediately. Data in covered portions of the window is saved by MGR and restored when the covered portions are exposed. M✓M✓M✓M_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OI✓I✓I✓IN✓N✓N✓NP✓P✓P✓PU✓U✓U✓UT✓T✓T✓T Keyboard input is prohibited. All input from the keyboard is held buffered by MGR until either _✓M__✓N_✓O_✓I_✓N_✓P_✓U_✓T is cleared, or a different window is made the _✓a_✓c_✓t_✓i_✓v_✓e window. In the latter case the input goes to the newly activated window. This flag is automatically turned off when the user activates the window. This feature is for client programs that want one of their windows to come to the front just long enough to notify the user of some event, but do not want to accidently intercept keyboard input while the user is merrily typing to some other client. M✓M✓M✓M_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OW✓W✓W✓WR✓R✓R✓RA✓A✓A✓AP✓P✓P✓P The character cursor does not automatically jump to the left edge of the next line as it reaches the right edge of its text region. After the right margin is passed, the cursor and any subsequent text disappear past the right edge of the window. M✓M✓M✓M_✓_✓_✓_O✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RS✓S✓S✓ST✓T✓T✓TR✓R✓R✓RI✓I✓I✓IK✓K✓K✓KE✓E✓E✓E July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 33 - Macros Text is written to the window with the mode specified by m_func() instead of the normal copy mode. In copy mode, the characters com- pletely obliterate their destination instead of combining with it. M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AB✓B✓B✓BS✓S✓S✓S The window is set to _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e coordinate mode. The upper left edge of the window, just inside the border is at position ( 0✓0✓0✓0,0✓0✓0✓0). All other locations are measured relative to that corner in pixels. M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E The window is made the _✓a_✓c_✓t_✓i_✓v_✓e window, pops to the front of the display, and obtains all keyboard and mouse input. M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FL✓L✓L✓LI✓I✓I✓IN✓N✓N✓NE✓E✓E✓ES✓S✓S✓S The system _✓c_✓u_✓t function only cuts entire lines. If any text on a line is swept out, the entire line of text is included. M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FT✓T✓T✓TA✓A✓A✓AB✓B✓B✓BS✓S✓S✓S The system _✓c_✓u_✓t function attempts to turn white space into a minimal combination of spaces and tabs. Tab are set at every 8 columns. M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FH✓H✓H✓HA✓A✓A✓AR✓R✓R✓RD✓D✓D✓D The system _✓c_✓u_✓t function attempts to cut text even if the window con- tents have been corrupted. Unidentifyable characters are returned as _✓C__✓N_✓O_✓C_✓H_✓A_✓R ('?'). M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AC✓C✓C✓CK✓K✓K✓K Any events pushed on the window stack when this flag is set will be sent in addition to any currently active events. This setting is useful for filters which need to receive events, yet still permit clients running under them to receive events as well. m_setnoecho() Character echoing to the window is disabled if possible. Character echo- ing is normally disabled by clients to inhibit information from MGR, as from calls to m_getinfo() from echoing on the window. m_setnoraw() Normal terminal input processing is in effect. Input is buffered by lines, and all normal line editting and keyboard interrupt generation is in effect. m_setraw() Every character is available as entered, no input processing is done. This is typically called _✓r_✓a_✓w mode. Raw mode is not always available, in which case the macro call is ignored. m_shapewindow( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t) The window is reshaped to position ( X✓X✓X✓X,Y✓Y✓Y✓Y) and with size D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h by D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t. As only the _✓a_✓c_✓t_✓i_✓v_✓e window may be reshaped, m_shapewindow()activates the window if it is not already active. The new size of the window is not guaranteed; the _✓w_✓i_✓d_✓t_✓h or _✓h_✓e_✓i_✓g_✓h_✓t may be trun- cated to the right or bottom edges of the display. The macro m_getinfo()can be used to determine the actual window size. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 34 - Macros m_size( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s) The size of the window is changed so that it fits exactly c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s by r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s of characters in the current font. The window may be truncated at the right or bottom edge of the display if it is too large to fit on the display at its current position. m_sizeall( X✓X✓X✓X,Y✓Y✓Y✓Y,c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s) The window is reshaped to position ( X✓X✓X✓X,Y✓Y✓Y✓Y) on the display, and resized to fit c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s and r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s of text. As only the _✓a_✓c_✓t_✓i_✓v_✓e window may be reshaped, m_shapewindow() activates the window if it is not already active. The new size of the window is not guaranteed; the _✓w_✓i_✓d_✓t_✓h or _✓h_✓e_✓i_✓g_✓h_✓t may be truncated to the right or bottom edges of the display. The macro m_getinfo()can be used to determine the actual window size. m_snarf() The application is sent the contents of the global snarf buffer, if any, as specified by the last call by a client programs call to m_put() or by use of the system _✓c_✓u_✓t function. m_sleep() This call causes MGR to suspend the processing of characters to the win- dow. After a chunk of output for all other windows has been processed, output processing resumes. This does not normally take very long, making m_sleep() almost a _✓n_✓o-_✓o_✓p. m_standend() Inverse video mode as set by m_standout() is turned off. This is exactly equivalent to m_clearmode( M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OU✓U✓U✓UT✓T✓T✓T). m_standout() Inverse video mode is turned on. This is exactly equivalent to m_setmode( M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OU✓U✓U✓UT✓T✓T✓T). The color of the characters and their back- grounds are interchanged. m_stringto( t✓t✓t✓to✓o✓o✓o,x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g) The text s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is printed starting at the location ( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t) on _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmap t✓t✓t✓to✓o✓o✓o. The text is clipped to fit in the bitmap, and no special command processing is done on s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g.✓.✓.✓. If t✓t✓t✓to✓o✓o✓o is 0 (zero), The text is printed on the window, but _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n boundaries are ignored. This is the only way to get text into a window outside of the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n. m_textregion( x✓x✓x✓x,y✓y✓y✓y,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h) A subregion within the current window starting at ( x✓x✓x✓x,y✓y✓y✓y) and of size w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h is defined within which all text is restricted. All functions and information that deals in _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinates views the text region as if it was the entire window. As soon as the text region is defined, the character cursor is moved to row and column ( 0✓0✓0✓0,0✓0✓0✓0), which is now located at the point ( x✓x✓x✓x,y✓y✓y✓y). Graphics output is not affected by text regions. m_textreset() The _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n (defined by a call to m_textregion()) is reset to be the entire window. This is the default setting. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 35 - Macros m_unlinkmenu( p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t,i✓i✓i✓it✓t✓t✓te✓e✓e✓em✓m✓m✓m) The menu link associating a child menu with the menu p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t at i✓i✓i✓it✓t✓t✓te✓e✓e✓em✓m✓m✓m (counting from zero) is removed (see also m_linkmenu()). This function does not change the menus, only their connections. m_unpagemenu( p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t) The link associating the menu p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t with a _✓c_✓h_✓i_✓l_✓d menu is removed. See also m_pagemenu(). m_up( n✓n✓n✓n) Move the character cursor up n✓n✓n✓n tenths of a character height. This may cause the window to scroll down. See also m_left()m_right()and m_down(). m_whatsat( X✓X✓X✓X,Y✓Y✓Y✓Y) MGR returns to the client program a line indicating what is at the _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates ( X✓X✓X✓X,Y✓Y✓Y✓Y). If that location is occupied by a window, a line containing the window's controlling terminal, alternate window number, and _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d is returned in a space separated list. If the location ( X✓X✓X✓X,Y✓Y✓Y✓Y) is not in a window, MGR returns a newline. m_windowsave( n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e) The current image contents of the window is saved in the file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e on the MGR-host machine in MGR bitmap format. File names beginning with "./" are evaluated relative to the current directory when MGR was started. See also m_othersave() and m_bitsave(). July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 36 - Functions => _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s The functions listed below have packaged common sequences of _✓m_✓a_✓c_✓r_✓o calls together to provide a slightly higher level of interface than the macros alone. They are still low level, and have no pretense of completeness. Except where noted, all of the functions return a value greater than zero on success, and a value less than zero upon failure. The functions fail only if they read an unexpected value from MGR. Client programs may use the function m_lastline()in an attempt to determine what input caused the failure. Those functions which expect data from MGR automatically flush any pending output before reading, and unless the _✓M__✓M_✓O_✓D_✓E_✓O_✓K flag is set, attempt to turn off char- acter echoing to prevent data returned by MGR from echoing back on the window. int get_all( l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓t) struct window_data *list; The current position size and status of all windows on the display is returned in l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓t. The number of in windows on the display is returned. L✓L✓L✓Li✓i✓i✓is✓s✓s✓st✓t✓t✓t should be large enough to hold a status entry for each window. The _✓w_✓i_✓n_✓d_✓o_✓w__✓d_✓a_✓t_✓a structure is defined in _✓t_✓e_✓r_✓m._✓h. int get_client( l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓t) struct window_data *list; The current position size and status of the client programs _✓m_✓a_✓i_✓n and _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e windows is returned in l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓t. The number of windows owned by the client program is returned. L✓L✓L✓Li✓i✓i✓is✓s✓s✓st✓t✓t✓t should be large enough to hold a status entry for each window. The _✓w_✓i_✓n_✓d_✓o_✓w__✓d_✓a_✓t_✓a structure is defined in _✓t_✓e_✓r_✓m._✓h. int get_colrow( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s) int *columns, *rows; The number of _✓c_✓o_✓l_✓u_✓m_✓n_✓s and _✓r_✓o_✓w_✓s in the current _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is returned in c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s and r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s respectively. For any _✓N_✓U_✓L_✓L argument, no value is returned. int get_cursor( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w) int *column, *row; The current _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r cursor position is placed in c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n and r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w. For any _✓N_✓U_✓L_✓L argument, no value is returned. int get_eachclientwin( w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓ap✓p✓p✓p) struct window_data *windatap; Get the window parameters for each window in the current window set, one window at a time. This function returns 1 if window_data structure has been filled, 0 otherwise. It is important to call get_eachcleintwin() in a tight loop that doesn't exit until it returns 0, so that all the data is picked up. This function is preferred to get_client() because you July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 37 - Functions don't need to know the maximum number of windows you are likely to see. int get_eachwin( w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓ap✓p✓p✓p) struct window_data *windatap; Get the window parameters for all the windows, one window at a time. This function returns 1 if window_data structure has been filled, 0 oth- erwise. It is important to call get_eachwin() in a tight loop that doesn't exit until it returns 0, so that all the data is picked up. This function is preferred to get_all() because you don't need to know the maximum number of windows you are likely to see. int get_font( w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h) int *wide, *high; The character size of the current font, in pixels is placed in w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e and h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h. For any _✓N_✓U_✓L_✓L argument, no value is returned. The function returns the current font number, as would be used in a call to m_font(). int get_mouse( x✓x✓x✓x,y✓y✓y✓y) int *x, *y; The current mouse position, in _✓w_✓i_✓n_✓d_✓o_✓w coordinates, is placed in x✓x✓x✓x and y✓y✓y✓y. For any _✓N_✓U_✓L_✓L argument, no value is returned. The function returns the current mouse button state, which is in the range of -2 to +2 upon suc- cess, a value less than -2 upon failure. See m_getinfo( G✓G✓G✓G_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E) for a discussion of the return values. int get_param( h✓h✓h✓ho✓o✓o✓os✓s✓s✓st✓t✓t✓t,x✓x✓x✓xm✓m✓m✓ma✓a✓a✓ax✓x✓x✓x,y✓y✓y✓ym✓m✓m✓ma✓a✓a✓ax✓x✓x✓x,b✓b✓b✓bo✓o✓o✓or✓r✓r✓rd✓d✓d✓de✓e✓e✓er✓r✓r✓r) char *host; int *xmax, *ymax, *border; The _✓M_✓G_✓R-_✓h_✓o_✓s_✓t, display size (in pixels) and window border size (in pixels) is placed in the arguments h✓h✓h✓ho✓o✓o✓os✓s✓s✓st✓t✓t✓t,x✓x✓x✓xm✓m✓m✓ma✓a✓a✓ax✓x✓x✓x,y✓y✓y✓ym✓m✓m✓ma✓a✓a✓ax✓x✓x✓x, and b✓b✓b✓bo✓o✓o✓or✓r✓r✓rd✓d✓d✓de✓e✓e✓er✓r✓r✓r. For any _✓N_✓U_✓L_✓L argument, no value is returned. int get_size( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t) int *X, *Y, *Dwidth, *Dheight; The position of the window on the display, in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates is placed into X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t. For any _✓N_✓U_✓L_✓L argument, no value is returned. char * get_termcap() A string containing a _✓T_✓E_✓R_✓M_✓C_✓A_✓P entry, suitable for placing into the _✓T_✓E_✓R_✓M_✓C_✓A_✓P environment variable is returned. The function get_termcap() returns _✓N_✓U_✓L_✓L upon failure. int is_active() July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 38 - Functions The function is_active() returns _✓T_✓R_✓U_✓E if the window is the _✓a_✓c_✓t_✓i_✓v_✓e window . void menu_load( n✓n✓n✓n,c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t,t✓t✓t✓te✓e✓e✓ex✓x✓x✓xt✓t✓t✓t) int n; int count; struct menu_entry *text; A menu is downloaded to MGR at position n✓n✓n✓n. The integer c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t is the number of menu items to be down-loaded, and t✓t✓t✓te✓e✓e✓ex✓x✓x✓xt✓t✓t✓t is an array of menu item/value pairs. The structure _✓m_✓e_✓n_✓u__✓e_✓n_✓t_✓r_✓y is defined in _✓t_✓e_✓r_✓m._✓h. int m_bitfile( t✓t✓t✓to✓o✓o✓o,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓ep✓p✓p✓p,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓hp✓p✓p✓p) int to; char *name; int *widep, *highp; Given a bitmap id, t✓t✓t✓to✓o✓o✓o and an icon n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e, have MGR load that icon into that scratchpad bitmap, returning the icon width and height, in pixels, via the given integer pointers. Return a positive number if successful. If the icon is not loaded, set the width and height values to 0 and return 0. This function is identical to m_bitfromfile()plus the needed inter- ception of the line returned from MGR. void m_bitload( x✓x✓x✓x,y✓y✓y✓y,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a) int x,y; int wide,high; register char *data; The bitmap image pointed at by d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a is down-loaded to the window at posi- tion ( x✓x✓x✓x,y✓y✓y✓y) in _✓w_✓i_✓n_✓d_✓o_✓w coordinates. It is up to the client program to insure an 8 bit channel exists between the client and MGR. The integers w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e and h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h specify the size of the bitmap in pixels. char * m_lastline() The last input from MGR to a library function is returned. The data is kept in a static buffer which is overwritten at each request. int m_makewindow( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t) int X, Y, Dwidth, Dheight; An alternate window is created as the _✓a_✓c_✓t_✓i_✓v_✓e window, at display coordi- nates ( X✓X✓X✓X,Y✓Y✓Y✓Y) and of size D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h by D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t pixels. If the window is too big to fit on the display, its width and height are truncated. The alternate window's _✓w_✓i_✓n_✓d_✓o_✓w-_✓i_✓d is returned if the window was created suc- cessfully. The macro m_selectwin() is used to write on the newly created window. int m_setup( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e) int mode; July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 39 - Functions This function initializes the library. It must be called before any other function or macro. The argument m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e is one or more of the flags _✓M__✓F_✓L_✓U_✓S_✓H, _✓M__✓D_✓E_✓B_✓U_✓G, or _✓M__✓M_✓O_✓D_✓E_✓O_✓K _✓o_✓r-ed together. If _✓M__✓F_✓L_✓U_✓S_✓H is present, all macros and function flush output to MGR after each macro call. This is slightly less efficient than letting the client program flush the data (see m_flush() ) but prevent inadvertent buffering problems. The _✓M__✓D_✓E_✓B_✓U_✓G flag forces the macro package to read and write from _✓s_✓t_✓d_✓i_✓n and _✓s_✓t_✓d_✓o_✓u_✓t respectively. Normally /_✓d_✓e_✓v/_✓t_✓t_✓y is opened for reading and writing to permit standard input or output redirection while still maintaining a connection to MGR. If /_✓d_✓e_✓v/_✓t_✓t_✓y can not be opened, as would be the case for clients invoked through _✓r_✓s_✓h, the _✓M__✓D_✓E_✓B_✓U_✓G flag is turned on, and _✓s_✓t_✓d_✓i_✓n and _✓s_✓t_✓d_✓o_✓u_✓t are used instead. The _✓M__✓M_✓O_✓D_✓E_✓O_✓K flag instructs those functions which expect data from MGR to assume the terminal modes are set appropri- ately. Otherwise, the functions attempt to turn off character echoing and turn on line mode before fetching data from MGR. The functions m_ttyset() and m_ttyreset() can be used to set and reset the terminal modes. The function m_setup() returns its argument, with the _✓M__✓D_✓E_✓B_✓U_✓G flag _✓o_✓r-ed in if /_✓d_✓e_✓v/_✓t_✓t_✓y can not be opened. void m_ttyreset() The terminal modes are restored to their state just prior to the last call to m_ttyset(). Calls to m_ttyset() and m_ttyreset() may be stacked up to ten levels. int m_ttyset() The terminal is set in a state suitable for data exchange with MGR. Character echoing is turned off, and line processing mode is enabled. The function returns zero (0) if it successfully retrieves the terminal modes, -1 otherwise. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 40 - Using the Library => _✓U_✓s_✓i_✓n_✓g _✓t_✓h_✓e _✓L_✓i_✓b_✓r_✓a_✓r_✓y Clients using _✓T_✓h_✓e _✓C _✓I_✓n_✓t_✓e_✓r_✓f_✓a_✓c_✓e _✓L_✓i_✓b_✓r_✓a_✓r_✓y should specify: #include "term.h" which also includes <stdio.h> if it has not already been included. Programs are compiled either with cc -o foo foo.c term.o -I$(lib) where $(lib) is the MGR include directory or simply cc -o foo foo.c -lmgr if the library is installed in a standard location. The file _✓t_✓e_✓r_✓m._✓o contains the functions listed in the last section. Several compile time options are available to the client program using the library. Normally, the library setup routine, m_setup() attempts to open /_✓d_✓e_✓v/_✓t_✓t_✓y to communicate with MGR. Client programs may define the C preprocessor symbols _✓M__✓D_✓E_✓V_✓I_✓C_✓E_✓I_✓N or _✓M__✓D_✓E_✓V_✓I_✓C_✓E_✓O_✓U_✓T to override the selection of /_✓d_✓e_✓v/_✓t_✓t_✓y for input or output respec- tively. After each macro call, the flush flag _✓M__✓F_✓L_✓U_✓S_✓H is tested to see if output should be flushed to MGR. If the C preprocessor symbol _✓M__✓N_✓O_✓F_✓L_✓U_✓S_✓H is defined, before the client program includes _✓t_✓e_✓r_✓m._✓h, The flush flag is never tested, and it becomes the responsibility of the client program to insure out- put is flushed at the appropriate times. Several external variables maintained by the library are accessible to client programs. The _✓s_✓t_✓d_✓i_✓o _✓F_✓I_✓L_✓E pointers _✓m__✓t_✓e_✓r_✓m_✓i_✓n and _✓m__✓t_✓e_✓r_✓m_✓o_✓u_✓t are used for direct- ing output to, and receiving input from MGR. These file pointers are initial- ized in m_setup(), and may be changed by client programs after m_setup() is called. The integer _✓m__✓f_✓l_✓a_✓g_✓s contains the current library mode settings, as returned by m_setup(). The _✓M__✓M_✓O_✓D_✓E_✓O_✓K and _✓M__✓F_✓L_✓U_✓S_✓H bits of _✓m__✓f_✓l_✓a_✓g_✓s may also be changed at any time after m_setup() is called. The integer _✓m__✓e_✓n_✓v_✓c_✓o_✓u_✓n_✓t con- tains the current window context depth, and is used by m_popall()to pop the appropriate number of contexts. _✓M__✓e_✓n_✓v_✓c_✓o_✓u_✓n_✓t should not be changed by client programs. Finally, the character _✓m__✓m_✓e_✓n_✓u_✓c_✓h_✓a_✓r defines the menu separator char- acter used by menu_load(). This character, set to '\005' by the library pack- age, can be changed to any character that will not appear as part of a menu item or action. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 41 - Glossary => _✓G_✓l_✓o_✓s_✓s_✓a_✓r_✓y a✓a✓a✓ab✓b✓b✓bs✓s✓s✓so✓o✓o✓ol✓l✓l✓lu✓u✓u✓ut✓t✓t✓te✓e✓e✓e c✓c✓c✓co✓o✓o✓oo✓o✓o✓or✓r✓r✓rd✓d✓d✓di✓i✓i✓in✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓es✓s✓s✓s _✓A_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s is a coordinate system used in _✓w_✓i_✓n_✓d_✓o_✓w_✓s measured in units of pixels. a✓a✓a✓ac✓c✓c✓ct✓t✓t✓ti✓i✓i✓iv✓v✓v✓ve✓e✓e✓e w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w The _✓a_✓c_✓t_✓i_✓v_✓e window is the window logically in the front of the display, which is receiving keyboard and mouse input. a✓a✓a✓al✓l✓l✓lt✓t✓t✓te✓e✓e✓er✓r✓r✓rn✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓e w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w An _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w is an additional window created by a client program that shares the communication channel with the main window. b✓b✓b✓bi✓i✓i✓it✓t✓t✓tm✓m✓m✓ma✓a✓a✓ap✓p✓p✓p A _✓b_✓i_✓t_✓m_✓a_✓p is a rectangular array of bits, or pixels if the bitmap is currently on the display. c✓c✓c✓ch✓h✓h✓ha✓a✓a✓an✓n✓n✓nn✓n✓n✓ne✓e✓e✓el✓l✓l✓l The _✓c_✓h_✓a_✓n_✓n_✓e_✓l is the bidirectional byte stream connecting MGR with the client program. The _✓c_✓h_✓a_✓n_✓n_✓e_✓l is usually the program's standard input and output. c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓ra✓a✓a✓ac✓c✓c✓ct✓t✓t✓te✓e✓e✓er✓r✓r✓r c✓c✓c✓co✓o✓o✓oo✓o✓o✓or✓r✓r✓rd✓d✓d✓di✓i✓i✓in✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓es✓s✓s✓s _✓C_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s is the coordinate system used in windows for count- ing characters in _✓c_✓o_✓l_✓u_✓m_✓n_✓s and _✓r_✓o_✓w_✓s. c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓ra✓a✓a✓ac✓c✓c✓ct✓t✓t✓te✓e✓e✓er✓r✓r✓r c✓c✓c✓cu✓u✓u✓ur✓r✓r✓rs✓s✓s✓so✓o✓o✓or✓r✓r✓r The _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓c_✓u_✓r_✓s_✓o_✓r is the location in the window where the next charac- ter will be placed. The cursor location is always highlighted on the active window. c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d m✓m✓m✓me✓e✓e✓en✓n✓n✓nu✓u✓u✓u A _✓c_✓h_✓i_✓l_✓d _✓m_✓e_✓n_✓u is the menu that will pop up when the user slides off to the right of a popped up _✓p_✓a_✓r_✓e_✓n_✓t _✓m_✓e_✓n_✓u. c✓c✓c✓cl✓l✓l✓li✓i✓i✓ie✓e✓e✓en✓n✓n✓nt✓t✓t✓t p✓p✓p✓pr✓r✓r✓ro✓o✓o✓og✓g✓g✓gr✓r✓r✓ra✓a✓a✓am✓m✓m✓m A _✓c_✓l_✓i_✓e_✓n_✓t _✓p_✓r_✓o_✓g_✓r_✓a_✓m is any Unix command that is running in an MGR window. Client programs may be existing programs, as might be found in /_✓b_✓i_✓n or new applications written specifically to take advantage of the windowing environment. c✓c✓c✓cl✓l✓l✓li✓i✓i✓ie✓e✓e✓en✓n✓n✓nt✓t✓t✓t-✓-✓-✓-h✓h✓h✓ho✓o✓o✓os✓s✓s✓st✓t✓t✓t The _✓c_✓l_✓i_✓e_✓n_✓t-_✓h_✓o_✓s_✓t is the computer that the client program is running on. It is often the same as the _✓M_✓G_✓R-_✓h_✓o_✓s_✓t machine, but it does not need to be. d✓d✓d✓di✓i✓i✓is✓s✓s✓sp✓p✓p✓pl✓l✓l✓la✓a✓a✓ay✓y✓y✓y c✓c✓c✓co✓o✓o✓oo✓o✓o✓or✓r✓r✓rd✓d✓d✓di✓i✓i✓in✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓es✓s✓s✓s _✓D_✓i_✓s_✓p_✓l_✓a_✓y _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s is a coordinate system used to measure pixels on the display. The top left corner of the display is at (0,0), with _✓x increas- ing to the right, and _✓y increasing down. e✓e✓e✓ex✓x✓x✓xp✓p✓p✓po✓o✓o✓os✓s✓s✓se✓e✓e✓ed✓d✓d✓d A window is _✓e_✓x_✓p_✓o_✓s_✓e_✓d if it is entirely visible. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 42 - Glossary g✓g✓g✓gr✓r✓r✓ra✓a✓a✓ap✓p✓p✓ph✓h✓h✓hi✓i✓i✓ic✓c✓c✓cs✓s✓s✓s p✓p✓p✓po✓o✓o✓oi✓i✓i✓in✓n✓n✓nt✓t✓t✓t The _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t is a location on the window, measured in the prevail- ing window coordinate system, that may serve as a reference location or origin for many of the graphics operations. l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓te✓e✓e✓en✓n✓n✓ne✓e✓e✓er✓r✓r✓r A _✓l_✓i_✓s_✓t_✓e_✓n_✓e_✓r is a window that has turned on the A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T event and is willing to receive messages from other client programs. m✓m✓m✓ma✓a✓a✓ai✓i✓i✓in✓n✓n✓n w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w A client program's _✓m_✓a_✓i_✓n _✓w_✓i_✓n_✓d_✓o_✓w is the window the program was started in. The client program may create and destroy alternate windows, but not its _✓m_✓a_✓i_✓n _✓w_✓i_✓n_✓d_✓o_✓w. If the user destroys a client program's _✓m_✓a_✓i_✓n _✓w_✓i_✓n_✓d_✓o_✓w, the connection to MGR is severed, and the client program receives a _✓h_✓a_✓n_✓g_✓u_✓p signal. M✓M✓M✓MG✓G✓G✓GR✓R✓R✓R-✓-✓-✓-h✓h✓h✓ho✓o✓o✓os✓s✓s✓st✓t✓t✓t The MGR-host is the computer that MGR is running on. m✓m✓m✓mo✓o✓o✓ou✓u✓u✓us✓s✓s✓se✓e✓e✓e c✓c✓c✓cu✓u✓u✓ur✓r✓r✓rs✓s✓s✓so✓o✓o✓or✓r✓r✓r The _✓m_✓o_✓u_✓s_✓e _✓c_✓u_✓r_✓s_✓o_✓r is a small bitmap or _✓i_✓c_✓o_✓n that tracks the movement of the mouse on the display. Normally the _✓m_✓o_✓u_✓s_✓e _✓c_✓u_✓r_✓s_✓o_✓r is a small arrow pointing north west. o✓o✓o✓ob✓b✓b✓bs✓s✓s✓sc✓c✓c✓cu✓u✓u✓ur✓r✓r✓re✓e✓e✓ed✓d✓d✓d A window is _✓o_✓b_✓s_✓c_✓u_✓r_✓e_✓d when it is partially or totally covered by another window. p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t m✓m✓m✓me✓e✓e✓en✓n✓n✓nu✓u✓u✓u A menu is called a _✓p_✓a_✓r_✓e_✓n_✓t _✓m_✓e_✓n_✓u when sliding off to the right of a selected item causes another menu or _✓c_✓h_✓i_✓l_✓d _✓m_✓e_✓n_✓u to pop up. r✓r✓r✓re✓e✓e✓el✓l✓l✓la✓a✓a✓at✓t✓t✓ti✓i✓i✓iv✓v✓v✓ve✓e✓e✓e c✓c✓c✓co✓o✓o✓oo✓o✓o✓or✓r✓r✓rd✓d✓d✓di✓i✓i✓in✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓es✓s✓s✓s _✓R_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s is a coordinate system for windows where a single unit represents one thousandth of the way across (or down) the window. s✓s✓s✓sc✓c✓c✓cr✓r✓r✓ra✓a✓a✓at✓t✓t✓tc✓c✓c✓ch✓h✓h✓hp✓p✓p✓pa✓a✓a✓ad✓d✓d✓d b✓b✓b✓bi✓i✓i✓it✓t✓t✓tm✓m✓m✓ma✓a✓a✓ap✓p✓p✓p A _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d _✓b_✓i_✓t_✓m_✓a_✓p is a chunk of memory, allocated by MGR for use by a client program, that may hold a bitmap image that is not on the display. s✓s✓s✓sn✓n✓n✓na✓a✓a✓ar✓r✓r✓rf✓f✓f✓f b✓b✓b✓bu✓u✓u✓uf✓f✓f✓ff✓f✓f✓fe✓e✓e✓er✓r✓r✓r The _✓s_✓n_✓a_✓r_✓f _✓b_✓u_✓f_✓f_✓e_✓r is a buffer maintained by MGR of arbitrary size that is accessible by all client programs. t✓t✓t✓ta✓a✓a✓ar✓r✓r✓rg✓g✓g✓ge✓e✓e✓et✓t✓t✓t w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w A _✓t_✓a_✓r_✓g_✓e_✓t _✓w_✓i_✓n_✓d_✓o_✓w is a window that is to receive a message from another window. t✓t✓t✓te✓e✓e✓ex✓x✓x✓xt✓t✓t✓t r✓r✓r✓re✓e✓e✓eg✓g✓g✓gi✓i✓i✓io✓o✓o✓on✓n✓n✓n A _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is the part of the window in which character text and the functions that operate on characters work. The _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n may be the entire window (the default) or a rectangular subregion within the window. w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w b✓b✓b✓bo✓o✓o✓or✓r✓r✓rd✓d✓d✓de✓e✓e✓er✓r✓r✓r July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 43 - Glossary The _✓w_✓i_✓n_✓d_✓o_✓w _✓b_✓o_✓r_✓d_✓e_✓r is a thin black border around every window that separates the window from the rest of the display. w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w c✓c✓c✓co✓o✓o✓on✓n✓n✓nt✓t✓t✓te✓e✓e✓ex✓x✓x✓xt✓t✓t✓t A _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓n_✓t_✓e_✓x_✓t contains the values for one or more aspects of the window's state. _✓W_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓n_✓t_✓e_✓x_✓t a may be saved on a stack, and then restored at some later time. w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w i✓i✓i✓id✓d✓d✓d A _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d is a unique number assigned to every window that may be used as an identifier when sending a message to the window. _✓W_✓i_✓n_✓d_✓o_✓w _✓i_✓ds have two parts, the first part is the process number of the client program that was started when the window was created, the second part is the win- dows _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e window number, or zero for a main window. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 44 - Sample Client Program => _✓S_✓a_✓m_✓p_✓l_✓e _✓C_✓l_✓i_✓e_✓n_✓t _✓P_✓r_✓o_✓g_✓r_✓a_✓m This program, called _✓c_✓l_✓o_✓s_✓e, closes, or iconifies a window. Its not a terribly useful application in its own right, but it does exercise several of the library calls. When _✓c_✓l_✓o_✓s_✓e starts up, it makes the window smaller, moves it toward the top of the display, then writes the word "closed" in it. If the window is covered by another window, it changes the word "closed" to "hidden", then flashes its window every 15 seconds as long as the window is covered. If the window is then uncovered, the word "hidden" gets changed back to "closed". Activating the window causes _✓c_✓l_✓o_✓s_✓e to restore the window's original shape and contents, then exit. /* _✓i_✓c_✓o_✓n_✓i_✓f_✓y _✓a _✓M_✓G_✓R _✓w_✓i_✓n_✓d_✓o_✓w */ #include <signal.h> #include "term.h" #define TIME 15 /* _✓t_✓i_✓m_✓e _✓i_✓n_✓t_✓e_✓r_✓v_✓a_✓l _✓f_✓o_✓r _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r */ #define CONTEXT P_POSITION | P_WINDOW | P_FLAGS | P_EVENT | P_CURSOR static char line[80]; /* _✓e_✓v_✓e_✓n_✓t _✓i_✓n_✓p_✓u_✓t _✓b_✓u_✓f_✓f_✓e_✓r */ main() { int clean(), timer(); /* _✓i_✓n_✓t_✓e_✓r_✓r_✓u_✓p_✓t _✓r_✓o_✓u_✓t_✓i_✓n_✓e_✓s */ int x,y; /* _✓w_✓i_✓n_✓d_✓o_✓w _✓p_✓o_✓s_✓i_✓t_✓i_✓o_✓n _✓o_✓n _✓d_✓i_✓s_✓p_✓l_✓a_✓y */ char *msg = "closed"; /* _✓c_✓l_✓o_✓s_✓e_✓d _✓w_✓i_✓n_✓d_✓o_✓w "_✓i_✓c_✓o_✓n" */ /* _✓s_✓e_✓t_✓u_✓p _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓e_✓n_✓v_✓i_✓r_✓o_✓n_✓m_✓e_✓n_✓t */ m_setup(M_FLUSH); /* _✓s_✓e_✓t_✓u_✓p _✓i/_✓o, _✓t_✓u_✓r_✓n _✓o_✓n _✓f_✓l_✓u_✓s_✓h_✓i_✓n_✓g */ m_push(CONTEXT); /* _✓s_✓a_✓v_✓e _✓c_✓u_✓r_✓r_✓e_✓n_✓t _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓n_✓t_✓e_✓x_✓t */ m_setmode(M_NOWRAP); /* _✓d_✓o_✓n'_✓t _✓a_✓u_✓t_✓o-_✓w_✓r_✓a_✓p _✓a_✓t _✓r_✓i_✓g_✓h_✓t _✓m_✓a_✓r_✓g_✓i_✓n */ m_ttyset(); /* _✓s_✓e_✓t _✓u_✓p _✓t_✓t_✓y _✓m_✓o_✓d_✓e_✓s */ /* _✓c_✓a_✓t_✓c_✓h _✓t_✓h_✓e _✓a_✓p_✓p_✓r_✓o_✓p_✓r_✓i_✓a_✓t_✓e _✓s_✓i_✓g_✓n_✓a_✓l_✓s */ signal(SIGTERM,clean); /* _✓i_✓n _✓c_✓a_✓s_✓e _✓w_✓e _✓g_✓e_✓t _✓t_✓e_✓r_✓m_✓i_✓n_✓a_✓t_✓e_✓d */ signal(SIGALRM,timer); /* _✓f_✓o_✓r _✓t_✓h_✓e _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r _✓s_✓e_✓r_✓v_✓i_✓c_✓e */ /* _✓i_✓c_✓o_✓n_✓i_✓f_✓y _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w */ get_size(&x,&y,0,0); /* _✓f_✓e_✓t_✓c_✓h _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s */ m_sizeall(x,10,strlen(msg),1);/* _✓m_✓o_✓v_✓e _✓a_✓n_✓d _✓r_✓e_✓s_✓i_✓z_✓e _✓w_✓i_✓n_✓d_✓o_✓w */ m_clear(); /* _✓c_✓l_✓e_✓a_✓r _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w */ m_printstr(msg); /* _✓p_✓r_✓i_✓n_✓t _✓m_✓e_✓s_✓s_✓a_✓g_✓e _✓i_✓n _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w */ /* _✓c_✓a_✓t_✓c_✓h _✓e_✓v_✓e_✓n_✓t_✓s */ m_setevent(ACTIVATE, "A\r"); /* _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓s _✓n_✓o_✓w _✓t_✓h_✓e _✓a_✓c_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w */ m_setevent(COVERED, "C\r"); /* _✓c_✓o_✓v_✓e_✓r_✓e_✓d _✓b_✓y _✓a_✓n_✓o_✓t_✓h_✓e_✓r _✓w_✓i_✓n_✓d_✓o_✓w */ m_setevent(UNCOVERED,"U\r"); /* _✓c_✓o_✓m_✓p_✓l_✓e_✓t_✓e_✓l_✓y _✓v_✓i_✓s_✓i_✓b_✓l_✓e */ m_setevent(REDRAW, "R\r"); /* _✓r_✓e_✓d_✓r_✓a_✓w _✓r_✓e_✓q_✓u_✓e_✓s_✓t_✓e_✓d */ July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 45 - Sample Client Program m_clearmode(M_ACTIVATE); /* _✓b_✓u_✓r_✓y _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w */ /* _✓w_✓a_✓i_✓t _✓f_✓o_✓r _✓a_✓n _✓e_✓v_✓e_✓n_✓t */ while(m_gets(line) != NULL) /* _✓r_✓e_✓a_✓d _✓a _✓l_✓i_✓n_✓e _✓f_✓r_✓o_✓m _✓M_✓G_✓R */ switch (*line) { case 'A': /* _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓s _✓a_✓c_✓t_✓i_✓v_✓a_✓t_✓e_✓d */ clean(); /* _✓c_✓l_✓e_✓a_✓n _✓u_✓p _✓a_✓n_✓d _✓e_✓x_✓i_✓t */ break; case 'C': /* _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓s _✓c_✓o_✓v_✓e_✓r_✓e_✓d */ m_clear(); m_printstr("hidden"); alarm(TIME); /* _✓t_✓u_✓r_✓n _✓o_✓n _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r */ break; case 'R': /* _✓s_✓y_✓s_✓t_✓e_✓m '_✓r_✓e_✓d_✓r_✓a_✓w' */ case 'U': /* _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓s _✓u_✓n_✓c_✓o_✓v_✓e_✓r_✓e_✓d */ m_clear(); m_printstr(msg); alarm(0); /* _✓t_✓u_✓r_✓n _✓o_✓f_✓f _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r */ break; case 'T': /* _✓s_✓e_✓n_✓d _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r */ m_setmode(M_WOB); /* _✓h_✓i_✓g_✓h_✓l_✓i_✓g_✓h_✓t _✓w_✓i_✓n_✓d_✓o_✓w */ m_bell(); /* _✓r_✓i_✓n_✓g _✓t_✓h_✓e _✓b_✓e_✓l_✓l */ sleep(1); alarm(TIME); /* _✓r_✓e_✓s_✓e_✓t _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r _✓t_✓i_✓m_✓e_✓r */ m_clearmode(M_WOB); /* _✓r_✓e_✓s_✓e_✓t _✓w_✓i_✓n_✓d_✓o_✓w _✓h_✓i_✓g_✓h_✓l_✓i_✓g_✓h_✓t_✓i_✓n_✓g */ break; } } clean() /* _✓c_✓l_✓e_✓a_✓n _✓u_✓p _✓a_✓n_✓d _✓e_✓x_✓i_✓t */ { m_ttyreset(); /* _✓r_✓e_✓s_✓e_✓t _✓t_✓t_✓y _✓m_✓o_✓d_✓e_✓s */ m_popall(); /* _✓r_✓e_✓s_✓t_✓o_✓r_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓n_✓t_✓e_✓x_✓t */ exit(0); } timer() /* _✓c_✓a_✓l_✓l_✓e_✓d _✓a_✓t _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r _✓t_✓i_✓m_✓e_✓o_✓u_✓t */ { m_sendme("T\r"); /* _✓s_✓e_✓n_✓d _✓t_✓i_✓m_✓e_✓o_✓u_✓t _✓m_✓e_✓s_✓s_✓a_✓g_✓e */ } July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 46 - Macros and Functions by Category => _✓M_✓a_✓c_✓r_✓o_✓s _✓a_✓n_✓d _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s _✓b_✓y _✓C_✓a_✓t_✓e_✓g_✓o_✓r_✓y _✓L_✓i_✓b_✓r_✓a_✓r_✓y _✓P_✓a_✓c_✓k_✓a_✓g_✓e _✓C_✓o_✓n_✓t_✓r_✓o_✓l* m_bell 9✓9✓9✓9............Flash the window and ring the bell. m_flush 1✓1✓1✓13✓3✓3✓3..........Flush any outpout pending for the window. m_lastline|✓- 3✓3✓3✓31✓1✓1✓1......Retrieve the last line send from MGR for a library func- tion. m_resetesc 2✓2✓2✓21✓1✓1✓1.......Restore the MGR escape character to '033'. m_setecho 2✓2✓2✓22✓2✓2✓2........Turn on terminal character echo. m_setesc 2✓2✓2✓22✓2✓2✓2.........Change the MGR escape character (for debugging). m_setnoecho 2✓2✓2✓26✓6✓6✓6......Turn off character echo. m_setnoraw 2✓2✓2✓26✓6✓6✓6.......Enable normal character input processing (line mode). m_setraw 2✓2✓2✓26✓6✓6✓6.........Disable all character input processing (raw mode). m_setup|✓- 3✓3✓3✓31✓1✓1✓1.........Initialize the library package. m_ttyreset|✓- 3✓3✓3✓32✓2✓2✓2......Reset the tty modes. m_ttyset|✓- 3✓3✓3✓32✓2✓2✓2........Set the tty modes for proper MGR interaction. _✓S_✓t_✓a_✓n_✓d_✓a_✓r_✓d _✓I/_✓O _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s m_getchar 1✓1✓1✓14✓4✓4✓4........Read a character from MGR. m_gets 1✓1✓1✓14✓4✓4✓4...........Read a line from MGR. m_printstr 1✓1✓1✓19✓9✓9✓9.......Print a string on the window. m_putchar 2✓2✓2✓21✓1✓1✓1........Put a character on the window. _________________________ * The routines marked with a dagger (|✓-) are functions, the other routines are macros. The page number on which the macro or function is defined is printed in bold face after the name. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 47 - Macros and Functions by Category _✓T_✓e_✓r_✓m_✓i_✓n_✓a_✓l _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s m_addchar 9✓9✓9✓9.........Insert a space character. m_addchars 9✓9✓9✓9........Insert some space characters. m_addline 9✓9✓9✓9.........Insert a blank line. m_addlines 9✓9✓9✓9........Insert some blank lines. m_clear 1✓1✓1✓11✓1✓1✓1..........Clear the window. m_cleareol 1✓1✓1✓11✓1✓1✓1.......Clear to the end of the line. m_cleareos 1✓1✓1✓11✓1✓1✓1.......Clear to the end of the window. m_deletechar 1✓1✓1✓12✓2✓2✓2.....Delete a character. m_deletechars 1✓1✓1✓12✓2✓2✓2....Delete characters. m_deleteline 1✓1✓1✓12✓2✓2✓2.....Delete a line. m_deletelines 1✓1✓1✓12✓2✓2✓2....Delete lines. m_move 1✓1✓1✓18✓8✓8✓8...........Move the character cursor. m_scrollregion 2✓2✓2✓22✓2✓2✓2...Set up a VT00 like scrolling region. m_standend 2✓2✓2✓27✓7✓7✓7.......Turn off reverse video characters. m_standout 2✓2✓2✓27✓7✓7✓7.......Turn on reverse video characters. m_textreset 2✓2✓2✓27✓7✓7✓7......Reset the text region to the entire window. _✓G_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓P_✓r_✓i_✓m_✓i_✓t_✓i_✓v_✓e_✓s m_arc 9✓9✓9✓9.............Draw an arc. m_circle 1✓1✓1✓11✓1✓1✓1.........Draw a circle. m_draw 1✓1✓1✓13✓3✓3✓3...........Draw a line from the graphics point. m_ellipse 1✓1✓1✓13✓3✓3✓3........Draw an ellipse. m_ellipseto 1✓1✓1✓13✓3✓3✓3......Draw an ellipse on a scratchpad bitmap. m_fastdraw 1✓1✓1✓13✓3✓3✓3.......Draw a group of fast vectors. m_func 1✓1✓1✓13✓3✓3✓3...........Set the bit-blt and graphics drawing mode. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 48 - Macros and Functions by Category m_go 1✓1✓1✓17✓7✓7✓7.............Move the graphics point. m_gotext 1✓1✓1✓17✓7✓7✓7.........Align the graphics point with the character cursor. m_line 1✓1✓1✓17✓7✓7✓7...........Draw a line. m_lineto 1✓1✓1✓17✓7✓7✓7.........Draw a line on a scratchpad bitmap. m_rcircle 2✓2✓2✓21✓1✓1✓1........Draw a circle at the graphics point. m_rellipse 2✓2✓2✓21✓1✓1✓1.......Draw an ellipse at the graphics point. m_rfastdraw 2✓2✓2✓21✓1✓1✓1......Draw a group of fast vectors at the graphics point. m_stringto 2✓2✓2✓27✓7✓7✓7.......Print a string to an scratchpad bitmap. _✓B_✓i_✓t-_✓b_✓l_✓t_✓s _✓a_✓n_✓d _✓R_✓e_✓l_✓a_✓t_✓e_✓d _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s m_bitcopy 9✓9✓9✓9.........Bit-blt a rectangle within the window. m_bitcopyto 9✓9✓9✓9.......Bit-blt a rectangle between two bitmaps. m_bitcreate 9✓9✓9✓9.......Create a scratchpad bitmap. m_bitdestroy 1✓1✓1✓10✓0✓0✓0.....Destroy a scratchpad bitmap. m_bitfile|✓- 3✓3✓3✓31✓1✓1✓1.......Read a bitmap file into a scratchpad bitmap. m_bitfromfile 1✓1✓1✓10✓0✓0✓0....Read a bitmap file into a scratchpad bitmap. m_bitget 1✓1✓1✓10✓0✓0✓0.........Upload a bitmap to the client program. m_bitld 1✓1✓1✓10✓0✓0✓0..........Download an image to the window. m_bitldto 1✓1✓1✓10✓0✓0✓0........Down load an image to a scratchpad bitmap. m_bitload|✓- 3✓3✓3✓31✓1✓1✓1.......Download an image into the window. m_bitsave 1✓1✓1✓10✓0✓0✓0........Copy a scratchpad bitmap to a file. m_bitwrite 1✓1✓1✓10✓0✓0✓0.......Set, Clear or Invert a rectangular portion of the window. m_bitwriteto 1✓1✓1✓11✓1✓1✓1.....Set, Clear or Invert a rectangular portion of a scratchpad bitmap. m_func 1✓1✓1✓13✓3✓3✓3...........Set the bit-blt function. m_othersave 1✓1✓1✓19✓9✓9✓9......Save another client's window image in a file. m_windowsave 2✓2✓2✓28✓8✓8✓8.....Save the window image on a file. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 49 - Macros and Functions by Category _✓W_✓i_✓n_✓d_✓o_✓w _✓E_✓n_✓v_✓i_✓r_✓o_✓n_✓m_✓e_✓n_✓t _✓C_✓h_✓a_✓n_✓g_✓e_✓s m_clearmode 1✓1✓1✓11✓1✓1✓1......Reset a window mode. m_dupkey 1✓1✓1✓13✓3✓3✓3.........Turn on keyboard escape mechanism. m_font 1✓1✓1✓13✓3✓3✓3...........Change to a new font. m_loadfont 1✓1✓1✓18✓8✓8✓8.......Download a font. m_movemouse 1✓1✓1✓18✓8✓8✓8......Move the mouse position. m_movewindow 1✓1✓1✓19✓9✓9✓9.....Move a window. m_setmode 2✓2✓2✓25✓5✓5✓5........Set a window mode. m_shapewindow 2✓2✓2✓27✓7✓7✓7....Reposition a window. m_size 2✓2✓2✓27✓7✓7✓7...........Resize a window to a specified number of rows and columns. m_sizeall 2✓2✓2✓27✓7✓7✓7........Reposition a window with a given number of rows and columns. _✓W_✓i_✓n_✓d_✓o_✓w _✓S_✓t_✓a_✓t_✓e _✓I_✓n_✓q_✓u_✓i_✓r_✓y get_all|✓- 2✓2✓2✓29✓9✓9✓9.........Get all window status. get_client|✓- 2✓2✓2✓29✓9✓9✓9......Get alternate window status. get_colrow|✓- 2✓2✓2✓29✓9✓9✓9......Get window size, in columns and rows. get_cursor|✓- 2✓2✓2✓29✓9✓9✓9......Get cursor position. get_eachclientwin|✓- 2✓2✓2✓29✓9✓9✓9Get window parameters for each window. get_eachwin|✓- 2✓2✓2✓29✓9✓9✓9.....Get window parameters for each window. get_font|✓- 3✓3✓3✓30✓0✓0✓0........Get character font size. get_mouse|✓- 3✓3✓3✓30✓0✓0✓0.......Get mouse position. get_param|✓- 3✓3✓3✓30✓0✓0✓0.......Get MGR system parameters. get_size|✓- 3✓3✓3✓30✓0✓0✓0........Get the window size and position on the display. get_termcap|✓- 3✓3✓3✓30✓0✓0✓0.....Get a TERMCAP entry. is_active|✓- 3✓3✓3✓30✓0✓0✓0.......See if the window is the active window. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 50 - Macros and Functions by Category m_getinfo 1✓1✓1✓14✓4✓4✓4........Ask MGR for information. m_whatsat 2✓2✓2✓28✓8✓8✓8........Find out what is at a particular display location. _✓P_✓o_✓p-_✓u_✓p _✓M_✓e_✓n_✓u _✓M_✓a_✓n_✓a_✓g_✓e_✓m_✓e_✓n_✓t m_clearmenu 1✓1✓1✓11✓1✓1✓1......Clear a menu. m_linkmenu 1✓1✓1✓17✓7✓7✓7.......Link two menus together. m_loadmenu 1✓1✓1✓18✓8✓8✓8.......Down load a menu. m_nomenu 1✓1✓1✓19✓9✓9✓9.........Unselect a pop-up menu from the middle mouse button. m_nomenu2 1✓1✓1✓19✓9✓9✓9........Unselect a pop-up menu from the end mouse button. m_pagemenu 1✓1✓1✓19✓9✓9✓9.......Break a large menu into pages. m_selectmenu 2✓2✓2✓22✓2✓2✓2.....Select a pop-up menu for the middle mouse button. m_selectmenu2 2✓2✓2✓22✓2✓2✓2....Select a pop-up menu for the right mouse button. m_unlinkmenu 2✓2✓2✓27✓7✓7✓7.....Unlink a menu. m_unpagemenu 2✓2✓2✓28✓8✓8✓8.....Disconnect two pages of a paged menu. menu_load|✓- 3✓3✓3✓30✓0✓0✓0.......Down load a pop-up menu. _✓E_✓v_✓e_✓n_✓t _✓H_✓a_✓n_✓d_✓l_✓i_✓n_✓g m_clearevent 1✓1✓1✓11✓1✓1✓1.....Clear an event. m_setevent 2✓2✓2✓23✓3✓3✓3.......Set an event. _✓W_✓i_✓n_✓d_✓o_✓w _✓C_✓o_✓n_✓t_✓e_✓x_✓t _✓M_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n m_pop 1✓1✓1✓19✓9✓9✓9............Pop the window context. m_popall 1✓1✓1✓19✓9✓9✓9.........Pop all stacked window contexts. m_push 1✓1✓1✓19✓9✓9✓9...........Stack the window context. m_pushsave 2✓2✓2✓20✓0✓0✓0.......Stack and save the window context. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 51 - Macros and Functions by Category _✓M_✓u_✓l_✓t_✓i_✓p_✓l_✓e _✓W_✓i_✓n_✓d_✓o_✓w_✓s m_destroywin 1✓1✓1✓12✓2✓2✓2.....Destroy an alternate window. m_halfwin 1✓1✓1✓17✓7✓7✓7........Create a window with no process connected to it. m_makewindow|✓- 3✓3✓3✓31✓1✓1✓1....Make an alternate window. m_newwin 1✓1✓1✓19✓9✓9✓9.........Make a new window. m_selectwin 2✓2✓2✓22✓2✓2✓2......Select an alternate window for output. _✓M_✓e_✓s_✓s_✓a_✓g_✓e _✓P_✓a_✓s_✓s_✓i_✓n_✓g m_broadcast 1✓1✓1✓11✓1✓1✓1......Broadcast a message to all listeners. m_put 2✓2✓2✓21✓1✓1✓1............Save characters in the global snarf buffer. m_sendme 2✓2✓2✓22✓2✓2✓2.........Send string back to self. m_sendto 2✓2✓2✓22✓2✓2✓2.........Send a message to another window. m_snarf 2✓2✓2✓27✓7✓7✓7..........Retrieve the contents of the global snarf buffer. _✓M_✓i_✓s_✓c_✓e_✓l_✓l_✓a_✓n_✓e_✓o_✓u_✓s _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s m_aligntext 9✓9✓9✓9.......Align character cursor with the graphics point. m_down 1✓1✓1✓13✓3✓3✓3...........Move character cursor down by tenths of a character height. m_highlight 1✓1✓1✓17✓7✓7✓7......Highlight a portion of the display. m_incr 1✓1✓1✓17✓7✓7✓7...........Adjust the character cursor position. m_left 1✓1✓1✓17✓7✓7✓7...........Move character cursor left by tenths of a character width. m_movecursor 1✓1✓1✓18✓8✓8✓8.....Move the character cursor to an arbitrary coordinate loca- tion. m_moveprint 1✓1✓1✓19✓9✓9✓9......Print a string at a given location. m_right 2✓2✓2✓22✓2✓2✓2..........Move character cursor right by tenths of a character width. m_sleep 2✓2✓2✓27✓7✓7✓7..........Do nothing. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 52 - Macros and Functions by Category m_up 2✓2✓2✓28✓8✓8✓8.............Move character cursor up by tenths of a character height. _✓C_✓o_✓l_✓o_✓r _✓M_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n m_bcolor 9✓9✓9✓9..........Set the text background color. m_fcolor 1✓1✓1✓13✓3✓3✓3.........Set the text foreground color. m_linecolor 1✓1✓1✓17✓7✓7✓7......Set the graphics mode and color. July 7, 1988 MGR 4.0 c 1988 Bellcore MGR-C Language Application Interface- 53 - Macro and Function Index => _✓M_✓a_✓c_✓r_✓o _✓a_✓n_✓d _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n _✓I_✓n_✓d_✓e_✓x These are the pages where macros and functions are referenced. The _✓i_✓t_✓a_✓l_✓i_✓c page numbers are the defining references. get_all _✓2_✓9, 30 m_dupkey 12, _✓1_✓3 m_putchar _✓2_✓1 get_client _✓2_✓9 m_ellipse 11, _✓1_✓3 m_rcircle _✓2_✓1 get_colrow _✓2_✓9 m_ellipseto _✓1_✓3 m_rellipse _✓2_✓1 get_cursor _✓2_✓9 menu_load _✓3_✓0, 33 m_resetesc _✓2_✓1 get_eachclientwin _✓2_✓9 m_fastdraw _✓1_✓3, 22 m_rfastdraw 13, _✓2_✓1 get_eachwin _✓2_✓9 m_fcolor 9, _✓1_✓3, 17 m_right 13, 17, _✓2_✓2, get_font _✓3_✓0 m_flush _✓1_✓3, 31 28 get_mouse _✓3_✓0 m_font _✓1_✓3, 18, 20, m_scrollregion _✓2_✓2 get_param _✓3_✓0 21, 30 m_selectmenu 18, _✓2_✓2 get_size _✓3_✓0 m_func 9, 11, 12, _✓1_✓3, m_selectmenu2 _✓2_✓2 get_termcap _✓3_✓0 17, 21, 26 m_selectwin 13, 19, is_active _✓3_✓0 m_getchar _✓1_✓4 _✓2_✓2, 31 m_addchar _✓9 m_getinfo _✓1_✓4, 19, 22, m_sendme _✓2_✓2 m_addchars _✓9 23, 26, 27, 30 m_sendto _✓2_✓2, 23, 25 m_addline _✓9 m_gets _✓1_✓4, 23 m_setecho _✓2_✓2 m_addlines _✓9 m_go 9, 13, _✓1_✓7 m_setesc 21, _✓2_✓2 m_aligntext _✓9 m_gotext _✓1_✓7 m_setevent 11, 19, m_arc _✓9 m_halfwin _✓1_✓7 22, _✓2_✓3 m_bcolor _✓9, 13 m_highlight _✓1_✓7 m_setmode 11, 12, 16, m_bell _✓9 m_incr _✓1_✓7 20, 21, _✓2_✓5, 27 m_bitcopy _✓9 m_lastline 29, _✓3_✓1 m_setnoecho _✓2_✓6 m_bitcopyto _✓9, 10 m_left 13, _✓1_✓7, 22, 28 m_setnoraw _✓2_✓6 m_bitcreate _✓9, 10 m_line 14, _✓1_✓7 m_setraw _✓2_✓6 m_bitdestroy _✓1_✓0 m_linecolor 9, 13, _✓1_✓7 m_setup 13, 19, _✓3_✓1, m_bitfile _✓3_✓1 m_lineto _✓1_✓7 33 m_bitfromfile _✓1_✓0, 31 m_linkmenu _✓1_✓7, 19, 27 m_shapewindow _✓2_✓7 m_bitget _✓1_✓0 m_loadfont 13, _✓1_✓8 m_size _✓2_✓7 m_bitld _✓1_✓0 m_loadmenu _✓1_✓8, 22 m_sizeall _✓2_✓7 m_bitldto _✓1_✓0 m_makewindow 14, 15, m_sleep _✓2_✓7 m_bitload _✓3_✓1 _✓3_✓1 m_snarf 21, 25, _✓2_✓7 m_bitsave _✓1_✓0, 19, 28 m_move _✓1_✓8 m_standend _✓2_✓7 m_bitwrite _✓1_✓0, 14 m_movecursor _✓1_✓8, 19 m_standout _✓2_✓7 m_bitwriteto 10, _✓1_✓1 m_movemouse _✓1_✓8 m_stringto 10, _✓2_✓7 m_broadcast _✓1_✓1, 22 m_moveprint _✓1_✓9 m_textregion 18, 22, m_circle _✓1_✓1 m_movewindow _✓1_✓9 _✓2_✓7 m_clear _✓1_✓1, 16 m_newwin 12, 17, 22, m_textreset _✓2_✓7 m_cleareol _✓1_✓1 23 m_ttyreset 31, _✓3_✓2 m_cleareos _✓1_✓1 m_nomenu _✓1_✓9 m_ttyset 31, _✓3_✓2 m_clearevent _✓1_✓1 m_nomenu2 _✓1_✓9 m_unlinkmenu 18, 19, m_clearmenu _✓1_✓1 m_othersave 10, _✓1_✓9, _✓2_✓7 m_clearmode _✓1_✓1, 16, 28 m_unpagemenu 19, _✓2_✓8 25, 27 m_pagemenu _✓1_✓9, 28 m_up 13, 17, 22, _✓2_✓8 m_deletechar _✓1_✓2 m_pop _✓1_✓9, 20 m_whatsat _✓2_✓8 m_deletechars _✓1_✓2 m_popall _✓1_✓9, 20, 33 m_windowsave 10, 19, m_deleteline _✓1_✓2 m_printstr _✓1_✓9 _✓2_✓8 m_deletelines _✓1_✓2 m_push 7, 12, _✓1_✓9, 20, m_destroywin _✓1_✓2 21 m_down _✓1_✓3, 17, 22, 28 m_pushsave 19, _✓2_✓0 m_draw _✓1_✓3 m_put _✓2_✓1, 24, 27 July 7, 1988 MGR 4.0 c 1988 Bellcore