home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume17 / mgr / part44 < prev    next >
Encoding:
Internet Message Format  |  1989-01-19  |  48.7 KB

  1. Subject:  v17i045:  MGR, Bellcore window manager, Part44/61
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4.  
  5. Submitted-by: Stephen A. Uhler <sau@bellcore.com>
  6. Posting-number: Volume 17, Issue 45
  7. Archive-name: mgr/part44
  8.  
  9.  
  10.  
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 44 (of 61)."
  19. # Contents:  doc/usrman/doc.1 doc/usrman/doc.3
  20. # Wrapped by rsalz@papaya.bbn.com on Thu Nov 17 21:05:53 1988
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'doc/usrman/doc.1' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'doc/usrman/doc.1'\"
  24. else
  25. echo shar: Extracting \"'doc/usrman/doc.1'\" \(26023 characters\)
  26. sed "s/^X//" >'doc/usrman/doc.1' <<'END_OF_FILE'
  27. X'\"                        Copyright (c) 1988 Bellcore
  28. X'\"                            All Rights Reserved
  29. X'\"       Permission is granted to copy or use this program, EXCEPT that it
  30. X'\"       may not be sold for profit, the copyright notice must be reproduced
  31. X'\"       on copies, and credit should be given to Bellcore where it is due.
  32. X'\"       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  33. X'\"
  34. X'\"    $Header: doc.1,v 4.2 88/06/30 12:44:53 bianchi Exp $
  35. X'\"    $Source: /tmp/mgrsrc/doc/usrman/RCS/doc.1,v $
  36. X.TL
  37. X\*M - C Language Application Interface
  38. X.AU
  39. XStephen A. Uhler
  40. X.AI
  41. XBell Communications Research
  42. X.Sh nopage Introduction
  43. X.FS
  44. X.ce 2
  45. XCopyright (c) 1988 Bellcore
  46. XAll Rights Reserved
  47. X.br
  48. XPermission is granted to copy or use this program, EXCEPT that it
  49. Xmay not be sold for profit, the copyright notice must be reproduced
  50. Xon copies, and credit should be given to Bellcore where it is due.
  51. XBELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  52. X.FE
  53. X\*M 
  54. X(\fBm\fPana\fBg\fPe\fBr\fP)
  55. Xis a window system for Unix that currently runs on Sun Workstations.
  56. X\*M manages asynchronous updates of overlapping windows
  57. Xand provides application support for a heterogeneous network
  58. Xenvironment, i.e.,
  59. Xmany different types of computers connected by various 
  60. Xcommunications media.
  61. XThe application interface enables applications (called client programs) to be
  62. Xwritten in a variety of programming languages, and run on different
  63. Xoperating systems.
  64. XThe client program can take full 
  65. Xadvantage of the windowing capabilities 
  66. Xregardless of the
  67. Xtype of connection to the workstation running \*M.
  68. X.LP
  69. XClient programs communicate with \*M via
  70. X.I pseudo-terminals 
  71. Xover a reliable byte stream.
  72. XEach client program can create and manipulate one or more windows
  73. Xon the display, with commands and data to the various windows multiplexed over 
  74. Xthe same connection.
  75. X\*M provides
  76. X.SM
  77. XASCII
  78. X.LG
  79. Xterminal emulation and takes responsibility for
  80. Xmaintaining the integrity of the window contents when parts of windows become 
  81. Xobscured and subsequently uncovered.
  82. XThis permits naive applications to work without modification
  83. Xby providing a default environment that appears to be an ordinary terminal.
  84. X.LP
  85. XIn addition to terminal emulation, \*M provides each client window with:
  86. Xgraphics primitives such as line and circle drawing; facilities for 
  87. Xmanipulating bitmaps, fonts, icons, and pop-up menus;
  88. Xcommands to reshape
  89. Xand position windows; and a message passing
  90. Xfacility enabling client programs
  91. Xto rendezvous and exchange messages.
  92. XClient programs may ask to be informed when a change in the window system
  93. Xoccurs, such as a reshaped window, a pushed mouse button,
  94. Xor a message sent from another client program.
  95. XThese changes are called events.
  96. X\*M notifies a client program of an event by sending
  97. Xit an
  98. X.SM
  99. XASCII
  100. X.LG
  101. Xcharacter string in a format specified by the client program.
  102. XExisting applications can be integrated into the
  103. Xwindowing environment without modification by having \*M
  104. Ximitate keystrokes in response to user defined menus or
  105. Xother events.
  106. X.LP
  107. XThe user interface provides a simple point-and-select model of 
  108. Xinteraction using the mouse with pop-up menus and
  109. Xquick access to system functions through meta-keys on the keyboard.
  110. X\*M also provides a 
  111. X.I cut
  112. Xand
  113. X.I  paste
  114. X.R
  115. Xfunction that permits a user to sweep out and copy text from any window
  116. Xand paste it into any other.
  117. X.LP
  118. XThis document describes the low level 
  119. XC interface library for \*M.
  120. XThe 
  121. X.I
  122. XC Interface library
  123. X.R
  124. Xprovides a set of macros and functions which implement the stream protocol
  125. Xand provide clients written in
  126. X.B C
  127. Xwith a function call interface to \*M.
  128. XThis library provides the lowest level access to \*M functions
  129. Xand represents a direct mapping to the underlying protocol.
  130. XIt is expected that a higher level interface will evolve to support
  131. Xapplication development at a higher level.
  132. XThe library requires only the
  133. X.SM
  134. XUNIX
  135. X.LG
  136. X.I "Standard I/O Library"
  137. Xfor its operation and access to a byte sequential I/O
  138. Xinterface from the underlying operating system.
  139. X.Sh page Model of Interaction
  140. XThe basic unit within \*M is the window.
  141. XA window is a rectangular region on the display, surrounded by a
  142. Xborder, with a single connection to other processes.
  143. XAll interactions among the client program, the user and \*M are
  144. Xdefined entirely in terms of the state
  145. Xof a client's window or windows.
  146. X\*M has no concept of window types; there are no separate
  147. X.I "graphics windows" ,
  148. X.I "text windows" ,
  149. Xor
  150. X.I "edit windows" .
  151. XEvery window supports exactly the same set of capabilities as
  152. Xevery other window.
  153. XIn addition, all windows act independently.
  154. XClient programs need not know or care about the existence of other
  155. Xclients or windows that happen to coexist on the same display.
  156. XThe management of overlapping windows is handled entirely by \*M.
  157. XFor example,
  158. Xwhen a window is partially or totally obscured by another window,
  159. Xthen subsequently uncovered, \*M restores the integrity of the
  160. Xwindow's contents.
  161. XThere are no
  162. X.I sub-windows ,
  163. Xwindows whose size or position are in some
  164. Xway restricted by a parent window.
  165. XA client may create and manipulate many windows, each of which
  166. Xmay be positioned and sized independently on the display.
  167. X.LP
  168. XAt any given time there is one special window on the display,
  169. Xthe
  170. X.I active
  171. Xwindow.
  172. XThis is the window that receives keystrokes and mouse data.
  173. XIt is distinguishable to the user from the other windows on the
  174. Xdisplay by its emboldened border.
  175. XThe active window, in addition to receiving all mouse and keyboard
  176. Xdata, is also logically in front of the other windows
  177. Xon the display.
  178. XThe active window is, therefore, always completely exposed.
  179. XAny window can become the active window, but there can only be one 
  180. Xactive window at a time.
  181. X.LP
  182. XA client program may change its window at any time, write text into it,
  183. Xdraw lines, anything, so long as the change is
  184. X.I local ,
  185. Xthat is the change affects just its window.
  186. XOnly the active window may effect 
  187. X.I global
  188. Xchanges
  189. Xto the display,
  190. Xsuch as changing its shape or position.
  191. XThe only global action a
  192. X.I non-active
  193. Xwindow may perform is to become the active window.
  194. XThis window model provides both the user and
  195. Xapplication developer with a simple,
  196. Xconsistent model of interaction.
  197. X.Sh nopage Coordinate Systems
  198. X\*M uses four different coordinate systems,
  199. X.I display
  200. Xcoordinates ,
  201. X.I "absolute window"
  202. Xcoordinates,
  203. X.I "relative window"
  204. Xcoordinates,
  205. Xand
  206. X.I character
  207. Xcoordinates.
  208. XThe entire display is represented by
  209. X.I "display coordinates"
  210. Xwhereas each window has its own
  211. X.I "absolute window" ,
  212. X.I "relative window" ,
  213. Xand
  214. X.I character
  215. Xcoordinate systems.
  216. X.LP  
  217. X.I "Display coordinates"
  218. Xare in units of pixels.
  219. XThe coordinate
  220. X.Fr "" 0 0
  221. Xis the top left
  222. Xpixel on the display.  The
  223. X.B X
  224. Xcoordinate increases to the right, the
  225. X.B Y
  226. Xcoordinate
  227. Xincreases down.
  228. XThe maximum
  229. X.B X
  230. Xand
  231. X.B Y
  232. Xcoordinate depend upon the particular display in use,
  233. Xfor the SUN-3 they are
  234. X.Fi 1152
  235. Xby
  236. X.Fi 900 .
  237. XCommands that operate on the context of the entire display, such as
  238. Xreshaping a window are specified in 
  239. X.I display
  240. Xcoordinates.
  241. XWindows, when measured
  242. Xin
  243. X.I display
  244. Xcoordinates include their borders.
  245. X.LP
  246. X.I "Absolute window coordinates" ,
  247. Xas with
  248. X.I "display coordinates" ,
  249. Xare measured in units of pixels.
  250. XThe
  251. X.Fi X
  252. Xand
  253. X.Fi Y
  254. Xvalues increase to the right and down respectively.
  255. XThe origin, coordinate
  256. X.Fr "" 0 0
  257. Xis at the top left corner of the window, just inside the window border.
  258. X.LP
  259. X.I "Relative window coordinates"
  260. Xare measured as a fraction of the window's size and shape.
  261. XAs with
  262. X.I "absolute window coordinates" ,
  263. Xeach window has its origin, 
  264. X.Fr "" 0 0
  265. X, at the top left corner of the window just inside the border,
  266. Xhowever the lower right corner of the window is always at 
  267. Xcoordinate
  268. X.Fr "" 999 999
  269. X\&.
  270. XGraphics commands to a window in 
  271. X.I "relative window coordinates"
  272. Xare automatically scaled to the size of the window.
  273. X.LP
  274. X.I "Character coordinates"
  275. Xare measured in rows and columns in the current
  276. Xfont, just like an ordinary terminal.
  277. XThe coordinate
  278. X.Fr "" 0 0 
  279. Xis the top left character
  280. Xposition in the window.
  281. XThe maximum
  282. X.I row
  283. Xand
  284. X.I column
  285. Xin the window
  286. Xdepends on both the window and font size.
  287. X.Sh nopage Functional Overview
  288. XThe types of commands a client program may issue \*M
  289. Xare divided into 14
  290. Xcategories:
  291. X.I "terminal emulation" ,
  292. X.I graphics ,
  293. X.I bit-blts ,
  294. X.I "window positioning" ,
  295. X.I "font changes" ,
  296. X.I "state inquiry" ,
  297. X.I "saved contexts" ,
  298. X.I menus ,
  299. X.I events ,
  300. X.I "sweep functions" ,
  301. X.I "multiple window manipulation" ,
  302. X.I "cut and paste" ,
  303. X.I messages ,
  304. Xand
  305. X.I "window modes" .
  306. XWhat follows is a brief description of those command categories,
  307. Xand some examples of specific functions within the category.
  308. XA detailed description of each command is provided in the following
  309. Xsection.
  310. X.LP
  311. X.B
  312. XTerminal Emulation
  313. X.R
  314. X.br
  315. XAt its basic level, every \*M window emulates a
  316. X.I \s-2CRT\s+2
  317. Xterminal.
  318. XIt provides functions for
  319. X.I inserting
  320. Xand
  321. X.I deleting
  322. Xlines and characters, highlighting text, clearing areas and windows, and
  323. Xarbitrary cursor motion capabilities.
  324. XSample \*M 
  325. X.I \s-2TERMCAP\s+2
  326. Xand
  327. X.I \s-2TERMINFO\s+2
  328. Xdescriptions are given in the tables below.
  329. XNo entries are provided for keyboard key values,
  330. Xas they depend upon the particular keyboard in use.
  331. X.Mk    \" mark vertical baseline or later return
  332. X.TS
  333. Xbox;
  334. Xc s
  335. Xl s
  336. Xl lflrp-2.
  337. XSample \*M \fIT\s-2ERMCAP\fP\s+2 Entry
  338. X_
  339. XPx \(vr \*M \(vr \*M terminal:\e
  340. X  :am:bs:im=:ta=^I:\e
  341. X  :AL=\eE%da:al=\eEa:\e
  342. X  :cd=\eEC:ce=\eEc:cl=^L:\e
  343. X  :cm=\eE%r%d,%dM:\e
  344. X  :co#80:li#24:\e
  345. X  :cs=\eE%d,%dt:\e
  346. X  :DC=\eE%dE:dc=\eEE:\e
  347. X  :DL=\eE%dd:dl=\eEd:\e
  348. X  :do=\eEf:up=\eEu:nd=\eEr:\e
  349. X  :IC=\eE%dA:ic=\eEA:\e
  350. X  :se=\eEn:so=\eEi:\e
  351. X  :ve=\eEv:vs=\eEV:
  352. X.TE
  353. X.Go 3.1i    \" return to baseline shifted right
  354. X.TS
  355. Xbox;
  356. Xc s
  357. Xl s
  358. Xl lflrp-2.
  359. XSample \*M \fIT\s-2ERMINFO\s+2\fP Entry
  360. X_
  361. XPx \(br \*M \(br \*M Terminal,
  362. X  cols#80, lines#24,
  363. X  am, msgr, ht=^I,
  364. X  clear=^L, cr=^M, bel=^G, 
  365. X  cub1=^H, cud1=\eEf, cuf1=\eEr,
  366. X  cuu1=\eEu, ind=^J,
  367. X  cup=\eE%p2%d;%p1%dM,
  368. X  csr=\eE%p1%d;%p2%dt,
  369. X  wind=\eE%p2%d;%p2%p4%+%d;%p1;%p1%p3%+%d;t,
  370. X  el=\eEc, ed=\eEC,
  371. X  il1=\eEa, dl1=\eEd,
  372. X  il=\eE%p1%da, dl=\eE%p1%dd,
  373. X  smso=\eEi, rmso=\eEn,
  374. X  smcup=\eE1664P, rmcup=\eEt\eEp,
  375. X.TE
  376. X.Rs    \" restore baseline stuff
  377. X.LP
  378. X\*M permits the client program to restrict the terminal emulator
  379. Xto an arbitrary subrectangle within the window,
  380. Xcalled a
  381. X.I "text region" .
  382. XFor example, a text editor wishing to provide scroll bars or banner lines
  383. Xcan still let \*M do the terminal emulation by specifying a text
  384. Xregion that excludes the top and sides of the window.
  385. XThis text region may be redefined or moved around at will, permitting
  386. Xmultiple terminal sub regions in the same window.
  387. X.LP
  388. X.B Graphics
  389. X.br
  390. XIn addition to terminal emulation, \*M provides a suite of pen plotter style
  391. Xgraphics primitives.
  392. XA client program may draw lines, circles, ellipses, and elliptical arcs
  393. Xon a window.
  394. XThe graphics objects may either be completely positioned, or located 
  395. Xrelative to an internal
  396. X.I "graphics point" ,
  397. Xmaintained by \*M.
  398. XThe objects may also be drawn into undisplayed or
  399. X.I scratchpad
  400. Xareas, then copied to the window as a single unit.
  401. XThe
  402. X.I "graphics point"
  403. Xmay be aligned with the character cursor,
  404. Xfor locating graphic objects relative to character text.
  405. XConversely, the character cursor may be aligned with the graphics cursor, 
  406. Xpermitting character text to be placed at arbitrary positions on the window.
  407. X.LP
  408. X.B Bit-blts
  409. X.br
  410. X\*M provides a complete set of functions for dealing with bitmaps, or
  411. Xrectangular arrays of pixels.
  412. XBitmaps may be combined with any of the 16 possible
  413. X.I bit-blt
  414. Xoperations.
  415. XNon-displayed
  416. Xbitmaps of arbitrary size may be created and destroyed, and
  417. X.I bit-blts
  418. Xmay be performed on the window, within a scratch-pad bitmap,
  419. Xbetween two scratch-pad  bitmaps,
  420. Xor between a scratch-pad bitmap and the window.
  421. XBitmap images may be down-loaded from client programs to \*M, 
  422. Xor up-loaded from \*M to the client program.
  423. XIn addition, bitmaps may be saved in files by \*M, or loaded 
  424. Xinto \*M from files.
  425. XThese last two capabilities permit client programs to manipulate large
  426. Xamounts of bitmap data without the need to send the bits
  427. Xover the communication channel.
  428. X.LP
  429. X.B "Window Positioning"
  430. X.br
  431. XEither the user or client program may move the 
  432. X.I active
  433. Xwindow
  434. Xaround on the display.
  435. XWindows may be moved with their size retained, reshaped but remain at the
  436. Xsame location, or be both moved and shaped anywhere on the display.
  437. XIf the window is the 
  438. X.I active
  439. Xwindow,
  440. Xit may be
  441. X.I buried
  442. X(shoved to the back on the display).
  443. XIf the window is not the
  444. X.I active
  445. Xwindow,
  446. Xit can become the active window and then moved about on the display.
  447. X.LP
  448. X.B "Font Changes"
  449. X.br
  450. XClient programs may change character fonts at any time, even on a
  451. Xcharacter by character basis.
  452. X\*M comes with scores of different fonts, 
  453. Xranging in size from microscopic to viewgraph size.
  454. XClient programs are
  455. Xfree to create and down-load their own fonts.
  456. XThe fonts supplied by \*M are constant width, that is
  457. X.I i 's
  458. Xtake up the same amount of room as
  459. X.I m 's
  460. Xdo.  There are commands to aid client programs that wish to use 
  461. Xproportional fonts.
  462. X.LP
  463. X.B "State Inquiry"
  464. X.br
  465. XA client program may ask \*M about the state of its current window,
  466. Xsuch as its size and position on the display,
  467. Xthe name and size of the current font,
  468. Xthe position and extent of the text region, and the state of
  469. Xvarious mode settings.
  470. XThe client may also inquire about the state of the window system as a whole.
  471. XThat includes the position and state of the mouse, the number and sizes
  472. Xof the available fonts, and
  473. Xthe organization of windows on the display.
  474. XThe display organization may include the position, size, name,
  475. Xownership, and spatial ordering for all windows on the display.
  476. X.LP
  477. X.B "Saved Contexts"
  478. X.br
  479. XCertain parts of the current window environment may be pushed on a stack,
  480. Xthen restored at some later time.
  481. XClient programs rarely need to know the context in which they are called.
  482. XThey simply push those aspects of the environment they will change, then
  483. Xrestore them before exiting.
  484. XAbout a dozen different parts of the window environment, such as menus,
  485. Xcharacter fonts, window position, etc. may be stacked independently, or in
  486. Xany combination.
  487. X.LP
  488. X.B Menus
  489. X.br
  490. X\*M has built in support for pop-up menus.
  491. XClients may arrange for menus to pop-up in response to mouse button
  492. Xhits.
  493. XUp to 50 menus may be down-loaded at once for each window.
  494. XThe client
  495. X.I selects
  496. Xwhich menu will pop-up when a mouse button is pushed.
  497. XWhen an item of a pop-up menu is chosen, \*M returns the string
  498. Xpreviously put into the menu by the client program.
  499. XThe client program may arrange
  500. Xfor different menus to pop up depending upon the
  501. Xcurrent mouse position.
  502. XMenus may also be linked together as a pop-up menu tree.
  503. XSliding off to the right of a menu (called a
  504. X.I parent
  505. Xmenu) while an item is selected
  506. Xcan cause another menu (called a
  507. X.I child
  508. Xmenu)
  509. Xto pop up.
  510. XAny item of the
  511. X.I parent
  512. Xmenu may be specified as the entry item for a child menu.
  513. XUpon selecting an item of a
  514. X.I child
  515. Xmenu,
  516. Xthe client program may arrange for \*M to return
  517. Xether the action string associated with just the
  518. X.I child
  519. Xmenu item,
  520. Xor the action strings for the selected items of all the menus.
  521. XSimilar to 
  522. X.I sliding
  523. Xmenus,
  524. X\*M supports 
  525. X.I paging
  526. Xmenus as well.
  527. XLong menus may be broken into several pages by the client program.
  528. X\*M manages the paging automatically, popping up the next page as
  529. Xthe user slides off the bottom of a paged menu.
  530. X.LP
  531. X.B Events
  532. X.br
  533. XClient programs may arrange to be informed by \*M when some change,
  534. Xcalled an event,
  535. Xhappens to the state of the window system.
  536. XAs with menus, the message informing the client program of a change
  537. Xis formated as specified by the client program.
  538. XExamples of events include mouse buttons being depressed or released,
  539. Xwindows changing shape or moving, and the window becoming the
  540. X.I active
  541. Xwindow or being covered by another window.
  542. XWindow state information, such as the current cursor position,
  543. Xmay be returned as part of an event string.
  544. X.LP
  545. X.B "Sweep Functions"
  546. X.br
  547. XIt is often convenient for client programs to
  548. X.I sweep ,
  549. Xor
  550. X.I rubber-band
  551. Xsimple objects, such as lines or boxes, in response to moving the mouse.
  552. X\*M provides client programs with a mouse activated sweep function.
  553. X\*M tracks an edge of the line or box with the mouse and reports 
  554. Xthe coordinates to the client at the conclusion of the sweep
  555. Xoperation, when the user releases the mouse.
  556. XAs usual, the client program specifies the format of the data returned by
  557. X\*M.
  558. X.LP
  559. X.B "Multiple Window Manipulation"
  560. X.br
  561. XA single client program may create and manipulate additional windows, called
  562. X.I alternate
  563. Xwindows.
  564. XThe data destined for, or to be received from, an
  565. X.I alternate 
  566. Xwindow is multiplexed on the same channel as the main window.
  567. XThe client program selects a window to receive output, and all output
  568. Xgoes to the selected window until a different window is selected.
  569. XFor input, the client program uses the
  570. X.I event
  571. Xmechanism to determine from which window input arrived.
  572. XAlternate windows have the same capabilities as the main window.
  573. XThere is currently no limit to the number of alternate windows a
  574. Xclient program may have.
  575. XUp to 100 windows may exist on the display at one time
  576. Xbefore performance begins to degrade seriously.
  577. X.LP
  578. X.B "Cut and Paste"
  579. X.br
  580. X\*M provides a globally accessible 
  581. X.I snarf
  582. Xbuffer shared among all client programs.
  583. XAny client program
  584. Xmay put data into or read data from this buffer.
  585. X\*M provides a user initiated 
  586. X.I cut
  587. Xand
  588. X.I paste
  589. Xfunction from the command menu.
  590. X\*M extracts character text from the window and places its
  591. X\s-2ASCII\s+2
  592. Xrepresentation into the 
  593. X.I snarf 
  594. Xbuffer.
  595. X.I Paste
  596. Xcopies the contents of the
  597. X.I snarf 
  598. Xbuffer to the input stream of the active
  599. Xwindow.
  600. XClient programs, by manipulating the data in the 
  601. X.I snarf
  602. Xbuffer,
  603. Xcan interact with the system
  604. X.I cut
  605. Xand
  606. X.I paste
  607. Xfunctions.
  608. X.LP
  609. X.B Messages
  610. X.br
  611. XAlthough the 
  612. X.I snarf
  613. Xbuffer gives client programs a simple asynchronous interprocess
  614. Xcommunication mechanism, \*M has a more general synchronous interprocess
  615. Xmessage passing scheme.
  616. XA client program may send a message
  617. Xto another client program, or broadcast the message to all client programs.
  618. XAs a message recipient, the client program may elect to receive messages
  619. Xas an
  620. X.I event
  621. Xand encapsulate the message and sender name in the format of its choice.
  622. X\*M provides the primitives needed to implement 
  623. X.I server
  624. Xclients
  625. Xby permitting 
  626. X.I servers
  627. Xto register their names, services and protocols with \*M.
  628. XClient
  629. Xprograms may query \*M for a list of active
  630. X.I servers .
  631. X.I Server
  632. Xmessages may be associated with windows by the
  633. X.I server
  634. Xclient programs in such a way that the message is automatically
  635. Xreceived by a client
  636. Xprogram as part of a 
  637. X.I "mouse button"
  638. Xevent whenever the mouse button is 
  639. Xpressed on the
  640. X.I server 's
  641. Xwindow.
  642. XUsing this mechanism, client programs can interact with
  643. X.I server
  644. Xclients without any advance knowledge of which 
  645. X.I server s
  646. Xare available or what services they are providing.
  647. X.br
  648. X.LP
  649. X.B "Window Modes"
  650. X.br
  651. XClient programs may select various combinations of window modes.
  652. XThese modes tailor the behavior of the macros described above.
  653. XExamples of window modes include
  654. X.I "auto line wrap"
  655. Xand
  656. X.I "character overstrike"
  657. Xthat affect the terminal emulation,
  658. Xdifferent coordinate system settings that affect
  659. X.I graphics
  660. Xcommands, or
  661. Xflags that set a window to
  662. X.I activate 
  663. Xautomatically upon receiving input, 
  664. Xignore all keyboard input, 
  665. Xor suspend output while a window is obscured.
  666. X.Sh nopage Underlying Protocol
  667. XThe purpose of this library package is both to provide a function call
  668. Xinterface to the stream protocol, and to document each command understood
  669. Xby \*M.
  670. XThere are two types of \*M commands, as summarized in the table below.
  671. X.TS
  672. Xcenter box;
  673. Xc
  674. Xl.
  675. X\*M command protocol
  676. X_
  677. XT{
  678. X.B ESC
  679. X.Sb X 1 ,
  680. X.Sb X 2 , ... ,
  681. X.Sb X n
  682. X.B command
  683. XT}
  684. XT{
  685. X.B ESC
  686. X.Sb X 1 ,
  687. X.Sb X 2 , ... ,
  688. X.Sb X n
  689. X.I length
  690. X.B command
  691. X.I data
  692. XT}
  693. X.sp 0.5v
  694. X.TE
  695. XIn both cases, 
  696. X.SM
  697. X.B ESC
  698. X.LG
  699. Xis the
  700. X.SM
  701. XASCII
  702. X.LG
  703. Xescape character or '\e033',
  704. Xwhereas the word
  705. X.B command
  706. Xrepresents a single character command identifier.
  707. XThe 
  708. X.I X 's
  709. Xare optional integers,  there can be as few as zero, as in the command
  710. X.TS
  711. Xcenter box;
  712. Xc.
  713. X\fBESC\fP\fIa\fP
  714. X.TE
  715. Xwhich inserts a blank line in the window, or
  716. Xas many as eight, as would be used by the command
  717. X.TS
  718. Xcenter box;
  719. Xc.
  720. X\fBESC\fP0,0,50,100,10,20,3,2\fIb\fP
  721. X.TE
  722. Xwhich is an example of a command to copy images between bitmaps.
  723. XNo spaces may be included between the
  724. X.B ESC
  725. Xcharacter and the command identifier character, but the argument
  726. Xseparators may be either commas (,) or semicolons (;).
  727. X.LP
  728. XThe function of the command is determined both
  729. Xby the command identifier character
  730. Xand
  731. X.I n ,
  732. Xthe number of numeric arguments preceding the command identifier character.
  733. XAll of the commands with the same command identifier character are closely
  734. Xrelated in function.
  735. XFor example, all the commands
  736. Xin the following table have the same command character,
  737. X.B 'o' ,
  738. Xand all draw ellipses, but have different effects based upon the
  739. Xnumber of arguments.
  740. X.TS
  741. Xcenter box;
  742. Xc s
  743. Xl|l.
  744. XCommands that draw \fIellipses\fP
  745. X_
  746. X1    \fBESC\fP100,200\fBo\fP
  747. X2    \fBESC\fP100,200,300,400\fBo\fP
  748. X3    \fBESC\fP100,200,300,400,2\fBo\fP
  749. X.TE
  750. XAll of the ellipses have major and minor axis lengths of 
  751. X.I 100
  752. Xand
  753. X.I 200 
  754. Xunits respectively.
  755. XCommand 1 draws the ellipse at the current graphics location.
  756. XCommand 2 draws the ellipse at the location specified by the
  757. Xthird and forth arguments, at
  758. X.Fr "" 300 400
  759. X\&.
  760. XCommand 3 draws the ellipse into scratchpad bitmap number
  761. X.I 2 .
  762. X.LP
  763. XThe second form of \*M commands,
  764. Xwhich is a special case of the first form,
  765. Xis used for downloading data from the
  766. Xclient program to \*M.
  767. XThe integer
  768. X.I length
  769. Xspecifies the number of bytes of data to be downloaded, and
  770. X.I data
  771. Xare the
  772. X.I length
  773. Xnumber of data values downloaded.
  774. XAn example of the second type of \*M command is
  775. X.TS
  776. Xcenter box;
  777. Xc.
  778. X\fBESC\fP11,7\fBb\fP\fII-moved\fP
  779. X.TE
  780. Xwhich instructs \*M to send the client program the string
  781. X.I "I-moved"
  782. Xany time the client's window is moved to a different location
  783. Xon the display.
  784. XThe
  785. X.I 11
  786. Xrefers to the number of the
  787. X.I move
  788. Xevent and the
  789. X.I 7
  790. Xis the number of characters in the event string, which in this case is
  791. X.I "I-moved" .
  792. X.LP
  793. XAll of the command identifier characters are listed in
  794. X.I "window.h" .
  795. XThe command actions, determined by the command identifier and number
  796. Xof command arguments, are described by the macros in this document.
  797. X.Sh page Conventions and Notation
  798. XAll functions and macros and programming examples are shown
  799. X.ft \*(Ff
  800. Xin a typewriter font
  801. X.ft
  802. Xto distinguish them from ordinary text.
  803. XSimilarly, function and macro arguments are shown in a 
  804. X.ft \*(Fn
  805. Xbold typewriter font.
  806. X.ft
  807. X.LP
  808. XThe names of often used
  809. Xarguments passed to macros indicate their function,
  810. Xand are defined below.
  811. X.Ad column , row
  812. XThe integers
  813. X.Fa column
  814. Xand
  815. X.Fa row
  816. Xrefer to a character position in
  817. X.I character
  818. Xcoordinates even though characters may be placed at arbitrary pixel
  819. Xlocations within a window
  820. Xand need not fall on
  821. X.Fa column
  822. Xor
  823. X.Fa row
  824. Xboundaries.
  825. X.Ad Dwidth , Dheight
  826. XThe integers
  827. X.Fa Dwidth
  828. Xand
  829. X.Fa Dheight
  830. Xrepresent a width and height in
  831. X.B display
  832. Xcoordinates.
  833. X.Ad mode
  834. XThe positive integer
  835. X.Fa mode ,
  836. Xrepresents the bit combination 
  837. Xof window modes.
  838. X.Fa Mode
  839. Xis usually an
  840. X.I or ed
  841. Xlist of constants in
  842. X.I term.h .
  843. XA typical use of
  844. X.Fa mode
  845. Xis the argument to 
  846. X.Fr m_push mode
  847. X as in
  848. X.Fr m_push "P_FLAGS \(br P_EVENT \(br P_MENU"
  849. X\&.
  850. X.Ad n
  851. XThe small non-negative integer
  852. X.Fi n
  853. Xrepresents a resource descriptor
  854. Xwhen describing objects such as windows, fonts, or menus.
  855. X.Ad name
  856. X.Fa Name
  857. Xis the file name of a bitmap image on the 
  858. X.I \*M-host
  859. Xmachine.
  860. XFile names given with no directory prefix are referenced relative to
  861. Xthe
  862. X.I icon
  863. Xsubdirectory of
  864. X\*M's 
  865. Xhome directory.
  866. XThe home directory is installation dependent, and may be determined with
  867. Xthe command
  868. X.I "\*M -V" .
  869. X.Ad parent , child
  870. XThe small positive integers
  871. X.Fa parent
  872. Xand
  873. X.Fa child
  874. Xrepresent menus.
  875. XA
  876. X.I child
  877. Xmenu is linked
  878. Xto a
  879. X.I parent 
  880. Xmenu forming a tree of menus.
  881. X.Ad radius
  882. XThe positive integer
  883. X.Fa radius
  884. Xalong with
  885. X.Fa radius1
  886. Xand 
  887. X.Fa radius2
  888. Xsignifies a radius when referring to circles or 
  889. Xmajor and minor axis when referring to ellipses.
  890. XThey are only referenced in respect to
  891. X.I window
  892. Xcoordinates.
  893. X.Ad string
  894. XAn array of characters,
  895. X.Fi string
  896. Xis a null terminated
  897. X.SM
  898. XASCII
  899. X.LG
  900. Xcharacter string.
  901. XExcept where noted, several
  902. X.SM
  903. XASCII
  904. X.LG
  905. Xcontrol characters can be included in
  906. Xstrings by escaping them with \e\fIX\fP, where
  907. X.I X
  908. Xis one of the  characters shown in the following table.
  909. X.TS
  910. Xcenter box;
  911. Xc s s
  912. Xc | c | c
  913. Xc | c | c
  914. Xr | l | l.
  915. XCharacter string control characters
  916. X_
  917. Xescape    octal    Meaning
  918. Xcharacter    value    
  919. X=
  920. X\eb    010    Back space
  921. X\eE    033    Escape
  922. X\ee    033    Escape
  923. X\ef    014    Form feed
  924. X\eg    007    Bell
  925. X\eM    *    Turn on 
  926. X        8'th (parity) bit
  927. X\en    012    New line
  928. X\er    015    Return
  929. X\es    040    Space
  930. X\e\e    134    Back-slash (\e)
  931. X
  932. X.TE
  933. X.ce
  934. X* \s-2(the next character has its 8'th bit turned on)\s+2
  935. X.Ad to , from
  936. XThe small positive integers
  937. X.Fa to
  938. Xand
  939. X.Fa from
  940. Xidentify the destination and source bitmaps for
  941. X.I bit-blt
  942. Xoperations.
  943. XThe value 0 (zero) represents the current window bitmap;
  944. Xpositive integers name scratch-pad bitmap storage.
  945. X.Ad width , height
  946. XThe integers
  947. X.Fa width
  948. Xand
  949. X.Fa height
  950. Xrepresent a width and height in
  951. X.B window
  952. Xcoordinates.
  953. X.Ad X , Y
  954. XThe integer pair
  955. X.Fr "" X Y
  956. X represents a point in 
  957. X.I display
  958. Xcoordinates.
  959. XThe suffixes
  960. X.Fi src
  961. Xand
  962. X.Fi dst
  963. Xas in
  964. X.Fr "" X_src Y_src
  965. X or
  966. X.Fr "" X_dst Y_dst
  967. X are used to indicate 
  968. X.I source
  969. Xand 
  970. X.I destination
  971. Xcoordinates respectively.
  972. XSimilarly, the suffixes
  973. X.Fi 1
  974. Xand
  975. X.Fi 2
  976. Xas in
  977. X.Fr "" X1 Y1
  978. X refer generically to the first or second coordinate.
  979. X.Ad  x , y
  980. XThe integers
  981. X.Fr "" x y
  982. X represent a point in
  983. X.I window
  984. Xcoordinates.  Whether that is
  985. X.I relative
  986. X(i.e. 0-999) or
  987. X.I absolute
  988. Xdepends upon the current coordinate setting of the window.
  989. XAs with
  990. X.Fr "" X Y
  991. X above, the modifiers
  992. X.Fi src , dst , 1 ,
  993. Xand
  994. X.Fi 2
  995. Xrefer respectively to the
  996. X.I source ,
  997. X.I destination ,
  998. X.I first ,
  999. Xand
  1000. X.I second
  1001. Xcoordinates.
  1002. END_OF_FILE
  1003. # end of 'doc/usrman/doc.1'
  1004. fi
  1005. if test -f 'doc/usrman/doc.3' -a "${1}" != "-c" ; then 
  1006.   echo shar: Will not clobber existing file \"'doc/usrman/doc.3'\"
  1007. else
  1008. echo shar: Extracting \"'doc/usrman/doc.3'\" \(19981 characters\)
  1009. sed "s/^X//" >'doc/usrman/doc.3' <<'END_OF_FILE'
  1010. X'\"                        Copyright (c) 1988 Bellcore
  1011. X'\"                            All Rights Reserved
  1012. X'\"       Permission is granted to copy or use this program, EXCEPT that it
  1013. X'\"       may not be sold for profit, the copyright notice must be reproduced
  1014. X'\"       on copies, and credit should be given to Bellcore where it is due.
  1015. X'\"       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  1016. X'\"
  1017. X'\"    $Header: doc.3,v 4.2 88/06/30 12:44:57 bianchi Exp $
  1018. X'\"    $Source: /tmp/mgrsrc/doc/usrman/RCS/doc.3,v $
  1019. X.Fh m_font n 
  1020. X.Fs m_font 6 "Change to a new font"
  1021. XChange to font
  1022. X.Fi n .
  1023. XThe line positioning is adjusted to keep
  1024. Xthe baseline of the new and old fonts the same.
  1025. XFont numbers are small integers
  1026. X(currently no more than 15).
  1027. XFont 0 (zero) always refers to the built-in or
  1028. X.I default
  1029. Xfont.
  1030. XThe actual fonts associated with the font numbers may be set in the \*M
  1031. X.I startup
  1032. Xfile, or changed by clients on the fly
  1033. X(see
  1034. X.Fr m_loadfont
  1035. X).
  1036. X.Fe
  1037. X.Fh m_func mode 
  1038. X.Fs m_func 4 "Set the bit-blt and graphics drawing mode"
  1039. X.Fs m_func 5 "Set the bit-blt function"
  1040. XSet the drawing mode.
  1041. XThis specifies the drawing mode for all
  1042. X.I graphics
  1043. Xand
  1044. X.I bit-blt
  1045. Xoperations.
  1046. XThe integer
  1047. X.Fi mode
  1048. Xis one of 16 possible boolean combinations of
  1049. Xthe
  1050. X.I source
  1051. Xand
  1052. X.I destination
  1053. Xbit patterns.
  1054. XCombinations of bit patterns for which
  1055. Xthere is no
  1056. X.I source
  1057. Xbitmap, such as
  1058. X.Fr m_bitwrite
  1059. X or
  1060. X.Fr m_line
  1061. X use the modes shown in the middle column of the following table.
  1062. XSeveral common
  1063. X.Fi mode s
  1064. Xare specified for the bit patterns in which the source
  1065. Xbitmap is relevent.
  1066. X.TS
  1067. Xcenter box;
  1068. Xc s s
  1069. Xc | c | c
  1070. Xl | l | l.
  1071. XNames for \fBbit-blt\fP modes
  1072. X_
  1073. Xsource    no source    comments
  1074. X=
  1075. XB_OR    B_SET    default
  1076. XB_COPY    B_CLEAR
  1077. XB_COPYINVERTED    B_INVERT
  1078. XB_XOR
  1079. XB_AND
  1080. X
  1081. X.TE
  1082. XAlternately,
  1083. X.Fi mode
  1084. Xmay be derived with a boolean combination of
  1085. X.Fi B_SRC
  1086. Xand
  1087. X.Fi  B_DST,
  1088. Xthus
  1089. X.Fi B_OR
  1090. Xis equivalent to
  1091. X.Fi ( B_SRC " \(br "  B_DST ).
  1092. X.Fe
  1093. X.Fh m_getchar
  1094. X.Fs m_getchar 2 "Read a character from \*M"
  1095. XThe macro
  1096. X.Fr m_getchar
  1097. Xis equivalent to the
  1098. X.I stdio
  1099. Xroutine
  1100. X.I getchar() ,
  1101. Xexcept the character is retrieved from \*M via the file pointer
  1102. X.I m_termin
  1103. Xinstead of
  1104. X.I stdin.
  1105. X.Fe
  1106. X.Fh m_gets buff 
  1107. X.Fs m_gets 2 "Read a line from \*M"
  1108. XA line of characters is read from \*M and placed into
  1109. X.Fi buff .
  1110. XThe macro 
  1111. X.Fr m_gets
  1112. Xreturns
  1113. X.SM
  1114. X.I NULL
  1115. X.LG
  1116. Xif the connection to \*M is severed.
  1117. XThe macro 
  1118. X.Fr m_gets
  1119. Xis equivalent to the stdio
  1120. X.I fgets()
  1121. Xcall
  1122. Xexcept input is retrieved from \*M.
  1123. X.Fe
  1124. X.Fh m_getinfo mode 
  1125. X.Fs m_getinfo 7 "Ask \*M for information"
  1126. XThis function requests \*M to return information back to the client program.
  1127. X.Fi Mode
  1128. Xspecifies one of (currently) 16 different requests.
  1129. XResponses are always terminated with a 
  1130. X.I "new line"
  1131. Xfor single line responses, and with a pair of
  1132. X.I "new lines"
  1133. Xfor multi-line
  1134. Xresponses.
  1135. XConsequently, clients can request and process information requests
  1136. Xusing normal line mode processing.
  1137. XThe following list of information requests is understood.
  1138. X.RS
  1139. X'\"    .IP \fBG_ALLFONT\fP 0.5i    Size information for all fonts.
  1140. X'\"    .br
  1141. X'\"    The
  1142. X'\"    .I width
  1143. X'\"    and
  1144. X'\"    .I height
  1145. X'\"    in pixels for a character in each font is listed in a space
  1146. X'\"    separated list.
  1147. X'\"    The first pair of numbers is the character size of font
  1148. X'\"    .B 0 ,
  1149. X'\"    the next pair for font
  1150. X'\"    .B 1 ,
  1151. X'\"    and so on.
  1152. X'\"    The first request for
  1153. X'\"    .Fi G_ALLFONT
  1154. X'\"    can be expensive, as it requires reading each font
  1155. X'\"    from the disk that has not yet been used.
  1156. X.IP \fBG_ALLMINE\fP 0.5i    Window status for alternate windows.
  1157. X.br
  1158. XInformation about each window that may be written to by the client program
  1159. Xis returned, one line of information per window, as a 
  1160. Xlist of space separated items.
  1161. XThe first two items give the location of the top left
  1162. Xcorner of the window in
  1163. X.I display
  1164. Xcoordinates.
  1165. XThe second two items give the 
  1166. X.I height
  1167. Xand
  1168. X.I width
  1169. Xof the window, 
  1170. Xalso in
  1171. X.I display
  1172. Xcoordinates.
  1173. XThe next field contains the last two characters of the
  1174. X.I pseudo tty
  1175. Xassociated with each window.
  1176. XNormally the 
  1177. X.I pseudo tty
  1178. Xis the same for each window reported.
  1179. XThe next field contains the 
  1180. X.I "window id" ,
  1181. Xwhich is 0 (zero)
  1182. Xfor the primary window, 
  1183. Xand the value returned by the call to 
  1184. X.Fr m_makewindow
  1185. Xfor the other windows (if any).
  1186. XThe final field contains the visual status of the window,
  1187. Xwhich is either 
  1188. X.SM
  1189. X.I C_EXPOSED
  1190. X.LG
  1191. X('e')
  1192. Xif the window is completely visible,
  1193. Xor
  1194. X.SM
  1195. X.I C_OBSCURED
  1196. X.LG
  1197. X('o')
  1198. Xif the window is partly or completely obscured.
  1199. XThe window information is printed in order from
  1200. X.I front
  1201. Xto 
  1202. X.I back .
  1203. XA sample line might look something like:
  1204. X.TS
  1205. Xcenter box;
  1206. Xc.
  1207. X492 2 652 570 p6 2 o
  1208. X.TE
  1209. Xwhich indicates that the window at
  1210. X.Fr "" 492 2
  1211. X is 
  1212. X.Fi 652
  1213. Xpixels
  1214. X.I wide
  1215. Xand
  1216. X.Fi 570
  1217. Xpixels
  1218. X.I high ,
  1219. Xhas a controlling
  1220. X.I pseudo tty
  1221. Xof
  1222. X.I /dev/tty\fBp6\fP,
  1223. Xis alternate window number
  1224. X.Fi 2,
  1225. Xand is at least partially obscured.
  1226. X.IP \fBG_ALL\fP 0.5i         Status of all windows.
  1227. X.br
  1228. XInformation about all windows
  1229. Xis returned, one line of information per window, as a
  1230. Xlist of space separated items.
  1231. XThe first two items give the location of the top left
  1232. Xcorner of the window in
  1233. X.I display
  1234. Xcoordinates.
  1235. XThe second two items give the 
  1236. X.I height
  1237. Xand
  1238. X.I width
  1239. Xof the window, 
  1240. Xalso in
  1241. X.I display
  1242. Xcoordinates.
  1243. XThe next field contains the last two characters of the
  1244. X.I pseudo tty
  1245. Xassociated with each window.
  1246. XNormally the 
  1247. X.I pseudo tty
  1248. Xis the same for each window controlled by the same client.
  1249. XThe next field contains the 
  1250. X.I "window id" ,
  1251. Xwhich is 0 (zero)
  1252. Xfor a primary window, 
  1253. Xand the value returned by the call to 
  1254. X.Fr m_makewindow
  1255. Xfor alternate windows.
  1256. XThe final field contains the visual status of the window,
  1257. Xwhich is either 
  1258. X.SM
  1259. X.I C_EXPOSED
  1260. X.LG
  1261. X('e')
  1262. Xif the window is completely visible,
  1263. Xor
  1264. X.SM
  1265. X.I C_OBSCURED
  1266. X.LG
  1267. X('o')
  1268. Xif the window is partly or completely obscured.
  1269. XThe window information for each window is printed in order from
  1270. X.I front
  1271. Xto 
  1272. X.I back.
  1273. XThus the first line returned is currently the
  1274. X.I active
  1275. Xwindow.
  1276. XA sample line might look something like:
  1277. X.TS
  1278. Xcenter box;
  1279. Xc.
  1280. X492 2 652 570 p6 0 o
  1281. X.TE
  1282. XWhich indicates that the window at
  1283. X.Fr "" 492 2
  1284. X is 
  1285. X.Fi 652
  1286. Xpixels
  1287. X.I wide
  1288. Xand
  1289. X.Fi 570
  1290. Xpixels
  1291. X.I high,
  1292. Xhas a controlling
  1293. X.I pseudo tty
  1294. Xof
  1295. X.I /dev/tty\fBp6\fP,
  1296. Xis a main window,
  1297. Xand is at least partially obscured.
  1298. X.IP \fBG_COORDS\fP 0.5i    Window coordinates.
  1299. X.br
  1300. XA single line is returned containing the location and size of the
  1301. Xwindow in 
  1302. X.I display
  1303. Xcoordinates.
  1304. XThe first pair of numbers is the position of the top left
  1305. Xcorner of the window,
  1306. Xthe second pair of numbers is the window's
  1307. X.I width
  1308. Xand
  1309. X.I height
  1310. Xin pixels.
  1311. X.IP \fBG_CURSOR\fP 0.5i
  1312. X.br
  1313. XA single line is returned containing the position of the
  1314. X.I character
  1315. Xand the
  1316. X.I graphics
  1317. Xcursor.
  1318. XThe first pair of numbers is the current
  1319. X.I column
  1320. Xand
  1321. X.I row
  1322. Xin character coordinates
  1323. Xand the second pair of numbers is the
  1324. Xcurrent
  1325. X.I graphics location
  1326. Xin window coordinates.
  1327. XThe graphics cursor location is reported in either
  1328. X.I absolute
  1329. Xor
  1330. X.I relative
  1331. Xwindow coordinates,
  1332. Xdepending upon the window coordinate mode setting.
  1333. X.IP \fBG_FONT\fP 0.5i    Current font information.
  1334. X.br
  1335. XA single line is returned which contains current font information.
  1336. XThe first pair of numbers is the character
  1337. X.I width
  1338. Xand
  1339. X.I height,
  1340. Xin pixels.
  1341. XThe next number is the
  1342. X.I "font number"
  1343. Xas would be used in a call to
  1344. X.Fi m_font ,
  1345. Xand the final field is the ascii name of the font.
  1346. X.IP \fBG_ID\fP 0.5i    Alternate window number.
  1347. X.br
  1348. XA single line is returned containing the window's alternate window
  1349. Xid ( 0 for the main window), 
  1350. Xfollowed by the number of windows controlled by the client 
  1351. Xprogram.
  1352. X.IP \fBG_MOUSE\fP 0.5i    Mouse coordinates.
  1353. X.br
  1354. XThe mouse position, in 
  1355. X.I display 
  1356. Xcoordinates are returned, followed by the most recent button transition,
  1357. Xwhich is one of
  1358. X.Fi 1 , -1 , 2 , -2 .
  1359. XThe numbers
  1360. X.Fi 1
  1361. Xand
  1362. X.Fi 2
  1363. Xrepresent buttons
  1364. X.I one
  1365. Xand
  1366. X.I two
  1367. Xon the mouse respectively.
  1368. XThe third mouse button is reserved for system use and is not accessible to
  1369. Xclient programs.
  1370. XA negative value means the button was released;
  1371. Xa positive value indicates the button is still depressed.
  1372. X.IP \fBG_MOUSE2\fP 0.5i    Scaled mouse coordinates .
  1373. X.br
  1374. XThe mouse coordinates, in 
  1375. X.I window 
  1376. Xcoordinates are returned, followed by the most recent button transition,
  1377. Xwhich is one of
  1378. X.Fi 1 , -1 , 2 , -2 .
  1379. XThe numbers
  1380. X.Fi 1
  1381. Xand
  1382. X.Fi 2
  1383. Xrepresent buttons
  1384. X.I one
  1385. Xand
  1386. X.I two
  1387. Xrespectively.
  1388. XA negative value means the button was last released;
  1389. Xa positive value indicates the button is still depressed.
  1390. XIf the 
  1391. Xmouse is above
  1392. Xor to the left of the window,
  1393. Xa negative coordinate value is returned.
  1394. XIn addition if the window is in
  1395. X.I relative
  1396. Xcoordinate mode, coordinate values between
  1397. X0 and 999 will be reported only if the mouse is within the window.
  1398. X.IP \fBG_STATUS\fP 0.5i    Window status.
  1399. X.br
  1400. XA line is returned containing a single character,
  1401. Xeither
  1402. X.SM
  1403. X.I C_EXPOSED
  1404. X.LG
  1405. X('e'),
  1406. X.SM
  1407. X.I C_OBSCURED
  1408. X.LG
  1409. X('o'),
  1410. Xor
  1411. X.SM
  1412. X.I C_ACTIVE
  1413. X('a')
  1414. X.LG
  1415. Xdepending upon whether the window is
  1416. Xexposed but not the
  1417. X.I active
  1418. Xwindow,
  1419. Xpartially or totally obscured,
  1420. Xor exposed and the
  1421. X.I active
  1422. Xwindow.
  1423. X.IP \fBG_SYSTEM\fP 0.5i    System global information.
  1424. X.br
  1425. XA single line containing constant global information is returned.
  1426. XThere are currently four fields:
  1427. X.RS
  1428. X.IP 1) 3
  1429. XThe 
  1430. X.I hostname
  1431. Xof the machine \*M is running on,
  1432. Xas returned by 
  1433. X.I gethostname() .
  1434. X.IP 2) 3
  1435. XThe width of the display in pixels.
  1436. X.IP 3) 3
  1437. XThe height of the display
  1438. Xin pixels.
  1439. X.IP 4) 3
  1440. XThe size of the window borders in pixels.
  1441. X.RE
  1442. X.IP \fBG_TERMCAP\fP 0.5i
  1443. X.br
  1444. XA single line is returned which contains a 
  1445. X.I \s-2TERMCAP\s+2
  1446. Xentry for \*M.
  1447. XThe 
  1448. X.I \s-2TERMCAP\s+2
  1449. Xentry is always the same, except for
  1450. X.I lines
  1451. Xand
  1452. X.I columns 
  1453. Xentries (li# and co#),
  1454. Xwhich vary to reflect the current window size.
  1455. X.IP \fBG_TEXT\fP 0.5i
  1456. X.br
  1457. XA single line containing four integers is returned
  1458. Xwith the current text region size.
  1459. XThe first pair of numbers is the top left corner of the text region,
  1460. Xin
  1461. X.I window
  1462. Xcoordinates, the second pair of numbers is the
  1463. X.I width
  1464. Xand
  1465. X.I height
  1466. Xof the text region.
  1467. XIf no text region is defined, implying the entire window is the text
  1468. Xregion, all four numbers are returned as 0 (zero).
  1469. X.IP \fBG_WINSIZE\fP 0.5i
  1470. X.br
  1471. XA single line is returned containing the current number of 
  1472. X.I columns
  1473. Xand
  1474. X.I rows
  1475. Xin the 
  1476. X.I "text region" .
  1477. XIf no text region is defined, 
  1478. Xthe number of 
  1479. X.I lines
  1480. Xand
  1481. X.I columns
  1482. Xfor the entire window is returned.
  1483. X.IP \fBG_FLAGS\fP 0.5i    Window flags.
  1484. X.br
  1485. XA single line is returned containing a hexadecimal number representing
  1486. Xthe current window mode bits.
  1487. XEach mode is represented by a bit in the word.
  1488. XMany of the modes may be
  1489. X.I set
  1490. Xor
  1491. X.I cleared
  1492. Xwith
  1493. X.Fr m_setmode
  1494. X or
  1495. X.Fr m_clearmode
  1496. X\&.
  1497. XSee the discussion of
  1498. X.Fr m_setmode
  1499. X for a detailed discussion of these flags.
  1500. XThe meaningful mode bits are:
  1501. X.RS
  1502. X.IP 0x000001 10
  1503. XThe window is completely exposed.
  1504. X.IP 0x000004 10
  1505. XIt is possible to use the system
  1506. X.I cut
  1507. Xfunction in this window.
  1508. XThis mode is restored by clearing the window.
  1509. XSee
  1510. X.Fr m_clear
  1511. X\&.
  1512. X.IP 0x000008 10
  1513. XThe window is
  1514. X.I white
  1515. Xtext on a
  1516. X.I black
  1517. Xbackground.
  1518. X.IP 0x000010 10
  1519. XThe window is in standout mode.
  1520. XIndividual characters are printed in reverse.
  1521. X.IP 0x000020 10
  1522. XThe window has died.
  1523. XIf a client sees this flag, the window is about to go away.
  1524. X.IP 0x000040 10
  1525. XExpose the window upon shell output.
  1526. XThe window will be automatically activated 
  1527. Xwhen the next character arrives for output on the window.
  1528. X.IP 0x000080 10
  1529. XPermit a partially or totally obscured window to update.
  1530. X.IP 0x000100 10
  1531. XDo not kill the window when the original process started in it dies.
  1532. XThis flag may only be set from the startup file.
  1533. X.IP 0x000200 10
  1534. X.I Vi
  1535. Xmode is turned on.
  1536. XPushing the right mouse button sends the characters:
  1537. X.TS
  1538. Xcenter box;
  1539. Xc.
  1540. X\fBrow\fP H \fBcolumn\fP \(br
  1541. X.TE
  1542. Xwhere
  1543. X.Fi row
  1544. Xand
  1545. X.Fi column
  1546. Xspecifies the character location the mouse is sitting on.
  1547. XThis has the effect of aligning 
  1548. X.I vi 's
  1549. Xnotion of the current character position with the mouse.
  1550. X.IP 0x000800 10
  1551. XKeyboard input is refused when the window is active.
  1552. X.IP 0x001000 10
  1553. XAuto wrap mode is turned on.
  1554. XThe character cursor automatically wraps to the
  1555. Xbeginning of the next row when it reaches the right margin of the text region.
  1556. X.IP 0x002000 10
  1557. XOverstrike mode is turned on.
  1558. XCharacters are written to the window using the the current drawing mode,
  1559. Xas set by
  1560. X.Fr m_func
  1561. X\&.
  1562. X.IP 0x004000 10
  1563. XThe window is in
  1564. X.I absolute
  1565. Xwindow coordinate mode.
  1566. X.IP 0x010000 10
  1567. XThe system
  1568. X.I cut
  1569. Xfunction snarfs complete lines only.
  1570. X.IP 0x020000 10
  1571. XThe system
  1572. X.I cut
  1573. Xfunction changes spaces to tabs whenever possible.
  1574. XTabs are assumed to be every 8 spaces.
  1575. X.IP 0x040000 10
  1576. XThe system
  1577. X.I cut
  1578. Xfunction will attempt to snarf text even if errors occur.
  1579. X.RE
  1580. X.RE
  1581. X.Fe
  1582. X.Fh m_go x y
  1583. X.Fs m_go 4 "Move the graphics point"
  1584. XMove the
  1585. X.I "graphics point"
  1586. Xto the window position
  1587. X.Fr "" x y
  1588. X in the current window coordinates.
  1589. X.Fe
  1590. X.Fh m_gotext
  1591. X.Fs m_gotext 4 "Align the graphics point with the character cursor"
  1592. XThe graphics point is moved to the bottom left corner of the
  1593. Xcurrent character cursor location.
  1594. X.Fe
  1595. X.Fh m_halfwin X Y Dwidth Dheight
  1596. X.Fs m_halfwin 11 "Create a window with no process connected to it"
  1597. XA window is created at 
  1598. X.Fi X , Y
  1599. Xof size
  1600. X.Fi Dwidth
  1601. Xby
  1602. X.Fi Dheight 
  1603. Xwith no process connected to it.
  1604. X\*M returns the name of the file, a
  1605. X.I pseudo-tty ,
  1606. Xthat must be opened in order to
  1607. Xtalk to the new window.
  1608. XA process which opens that 
  1609. X.I pseudo-tty
  1610. Xbecomes a client program, communicating with \*M and the new
  1611. Xwindow in the usual fashion.
  1612. XFor a single process managing multiple windows, use
  1613. X.Fr m_newwin
  1614. X\&.
  1615. X.Fe
  1616. X.Fh m_highlight X Y Dwidth Dheight
  1617. X.Fs m_highlight 13 "Highlight a portion of the display"
  1618. X\*M flashes the rectagular portion of the display starting at
  1619. X.Fi X , Y
  1620. Xof size
  1621. X.Fi Dwidth
  1622. Xby
  1623. X.Fi Dheight .
  1624. XThis is an experimental capability and may be removed in the future.
  1625. X.Fe
  1626. X.Fh m_incr n
  1627. X.Fs m_incr 13 "Adjust the character cursor position"
  1628. XThe current character position is adjusted to the left or 
  1629. Xright
  1630. X.Fi n
  1631. Xunits
  1632. Xin 
  1633. X.I window
  1634. Xcoordinates.
  1635. XThe argument
  1636. X.Fi n
  1637. Xmay be signed to indicate movement to the left (if negative) or to the
  1638. Xright (if positive or unsigned).
  1639. XThis is useful for client programs dealing with proportionally
  1640. Xspaced text.
  1641. X.Fe
  1642. X.Fh m_left n 
  1643. X.Fs m_left 13 "Move character cursor left by tenths of a character width"
  1644. XMove the character cursor left 
  1645. X.Fi n
  1646. Xtenths of a character width.
  1647. XSee also
  1648. X.Fr m_down
  1649. X.Fr m_right
  1650. Xand
  1651. X.Fr m_up
  1652. X\&.
  1653. X.Fe
  1654. X.Fh m_line x1 y1 x2 y2
  1655. X.Fs m_line 4 "Draw a line"
  1656. XDraw a line in the current window from the coordinate
  1657. X.Fr ""  x1 y1
  1658. X to the coordinate
  1659. X.Fr "" x2 y2
  1660. X\&.
  1661. XThe line is either set,
  1662. Xcleared or inverted as determined by the last call to
  1663. X.Fr m_func
  1664. X\&.
  1665. X.Fe
  1666. X.Fh m_linecolor mode color
  1667. X.Fs m_linecolor 14 "Set the graphics mode and color"
  1668. XThe drawing mode and color is set for all graphics and bit-blt operations.
  1669. XThe integer
  1670. X.Fi mode
  1671. Xsets the drawing mode, in the manner of 
  1672. X.Fr m_func
  1673. X\&.
  1674. XThe integer
  1675. X.Fi color
  1676. Xis the index into the color lookup table for the drawing color.
  1677. XThis command is equivalent to
  1678. X.Fr m_func
  1679. Xon a monochrome display.
  1680. XSee also 
  1681. X.Fr m_fcolor
  1682. Xand
  1683. X.Fr m_linecolor
  1684. X\&.
  1685. X.Fe
  1686. X.Fh m_lineto to x1 y1 x2 y2
  1687. X.Fs m_lineto 4 "Draw a line on a scratchpad bitmap"
  1688. XDraw a line 
  1689. Xon the scratchpad bitmap
  1690. X.Fi to
  1691. Xfrom the coordinate
  1692. X.Fr ""  x1 y1
  1693. X to the coordinate
  1694. X.Fr "" x2 y2
  1695. X\&.
  1696. XThe line is either set,
  1697. Xcleared or inverted as determined by the last call to
  1698. X.Fr m_func
  1699. X\&.
  1700. X.Fe
  1701. X.Fh m_linkmenu parent item child mode
  1702. X.Fs m_linkmenu 8 "Link two menus together"
  1703. XThe menus
  1704. X.Fi parent
  1705. Xand
  1706. X.Fi child 
  1707. Xare linked together.
  1708. XWhen menu
  1709. X.Fi parent
  1710. Xis popped up and item number
  1711. X.Fi item
  1712. X(starting from zero)
  1713. Xis highlighted, sliding off to the right of the
  1714. X.Fi parent
  1715. Xmenu causes the
  1716. X.Fi child
  1717. Xmenu to pop up.
  1718. XWhen an item is chosen, \*M sends the
  1719. Xconcatenation of the action strings associated with each of the
  1720. Xpopped-up menus,
  1721. Xfrom left to right (i.e.
  1722. X.Fi parent
  1723. Xto 
  1724. X.Fi child  ).
  1725. XAn arbitrary tree of menus
  1726. Xmay be created by linking successive menus together in this
  1727. Xmanner.
  1728. XIt is up to the application to indicate on the parent
  1729. Xmenu item that sliding to the right will pop up a child menu.
  1730. XTypically "\fB\(->\fP" is used.
  1731. X.sp
  1732. XThe
  1733. X.Fi mode
  1734. Xargument,
  1735. Xif not zero,
  1736. Xchanges the menu options
  1737. Xfor the
  1738. X.Fi parent
  1739. Xmenu.
  1740. XThe flag settings,
  1741. Xwhich may be
  1742. X.I or -ed
  1743. Xtogether (except for
  1744. X.SM
  1745. X.Fi MF_CLEAR
  1746. X.LG
  1747. X) are:
  1748. X.RS
  1749. X.IP \fBMF_SNIP\fP 0.5i
  1750. X.br
  1751. XBy default, when an item in a
  1752. X.I child
  1753. Xmenu is selected,
  1754. Xthe values associated with the highlighted items for all of the ancestor menus
  1755. Xare concatenated to the
  1756. X.I child 's
  1757. Xitem value.
  1758. XWhen
  1759. X.SM
  1760. X.Fi MF_SNIP
  1761. X.LG
  1762. Xis enabled, only the string associated with the child menu is returned.
  1763. X.IP \fBMF_PAGE\fP 0.5i
  1764. X.br
  1765. XNormally, whenever a menu is popped-up, the previously
  1766. Xchosen item is initially highlighted.
  1767. XIf
  1768. X.SM
  1769. X.Fi MF_PAGE
  1770. X.LG
  1771. Xis enabled, this behavior is extended to paged menus.
  1772. X\*M automatically pages through a set of paged
  1773. Xmenus to highlight the currently selected item.
  1774. X.IP \fBMF_AUTO\fP 0.5i
  1775. X.br
  1776. X\*M will automatically slide to the right and pop up
  1777. Xa child menu
  1778. Xto highlight the previously selected item.
  1779. X.IP \fBMF_CLEAR\fP 0.5i
  1780. X.br
  1781. XClears the mode
  1782. X.SM
  1783. X.Fi MF_SNIP ,
  1784. X.Fi MF_PAGE ,
  1785. X.LG
  1786. Xand
  1787. X.SM
  1788. X.Fi MF_AUTO .
  1789. X.LG
  1790. X.RE
  1791. XSee also
  1792. X.Fr m_loadmenu
  1793. X,
  1794. X.Fr m_selectmenu
  1795. X, and
  1796. X.Fr m_unlinkmenu
  1797. X\&.
  1798. X.Fe
  1799. X.Fh m_loadfont n name
  1800. X.Fs m_loadfont 6 "Download a font"
  1801. XThe \*M font whose pathname is
  1802. X.Fi name
  1803. Xis downloaded into
  1804. X\*M, replacing the font currently located at position
  1805. X.Fi n .
  1806. XAny subsequent calls to
  1807. X.Fr m_font
  1808. Xwill select the newly downloaded font.
  1809. XThe font that used to be at position
  1810. X.Fi n
  1811. Xremains available to windows that are already using it, 
  1812. Xbut is unavailable for future use.
  1813. XThe format of \*M font files is described in
  1814. X.I font.h .
  1815. X.Fe
  1816. X.Fh m_loadmenu n string
  1817. X.Fs m_loadmenu 8 "Down load a menu"
  1818. XThe text
  1819. X.Fi string
  1820. Xis downloaded into menu position
  1821. X.Fi n .
  1822. XThe first character of
  1823. X.Fi string
  1824. Xis the 
  1825. X.I "menu delimiter"
  1826. Xcharacter.
  1827. XAll of the menu item strings are concatenated,
  1828. Xfollowed by all of their action strings.
  1829. XThe 
  1830. X.I "menu delimiter"
  1831. Xcharacter separates all of the items and actions
  1832. Xand terminates the list.
  1833. XMenus are downloaded at once, as a single entity.
  1834. XThe macro
  1835. X.Fr m_selectmenu
  1836. X is used to have the menu pop-up when a mouse button is pushed.
  1837. X.Fe
  1838. X.Fh m_move column row
  1839. X.Fs m_move 3 "Move the character cursor"
  1840. XThe character cursor is moved to character location
  1841. X.Fi column , row
  1842. X, where
  1843. X.Fr "" 0 0
  1844. X is the top left character position on the window, or on
  1845. Xthe current text region if one is specified
  1846. X(see
  1847. X.Fr m_textregion
  1848. X).
  1849. X.Fe
  1850. X.Fh m_movecursor x y
  1851. X.Fs m_movecursor 13 "Move the character cursor to an arbitrary coordinate location"
  1852. XMove the character cursor to the position
  1853. X.Fr "" x y
  1854. X in window coordinates.
  1855. XThis permits characters to be placed at arbitrary pixel locations,
  1856. Xnot just on character boundaries.
  1857. XUse
  1858. X.Fr m_move
  1859. Xto move to a
  1860. X.Fi row
  1861. Xand
  1862. X.Fi column
  1863. Xposition.
  1864. X.Fe
  1865. X.Fh m_movemouse X Y
  1866. X.Fs m_movemouse 6 "Move the mouse position"
  1867. XMove the mouse to position
  1868. X.Fr "" X Y
  1869. X in
  1870. X.I display
  1871. Xcoordinates.
  1872. XExcessive use of this macro is anti-social.
  1873. X.Fe
  1874. X.Fh m_moveprint x y string
  1875. X.Fs m_moveprint 13 "Print a string at a given location"
  1876. XPrint
  1877. X.Fi string
  1878. Xat the window coordinate
  1879. X.Fr "" x y
  1880. X\&.
  1881. XThis macro is equivalent to calling
  1882. X.Fr m_movecursor
  1883. X followed by
  1884. X.Fr m_printstr
  1885. X\&.
  1886. X.Fe
  1887. X.Fh m_movewindow X Y
  1888. X.Fs m_movewindow 6 "Move a window"
  1889. XMove the window to the display location
  1890. X.Fr "" X Y 
  1891. X in 
  1892. X.I display
  1893. Xcoordinates.
  1894. XIf the new position is too close to the edge of the display for the window
  1895. Xto fit entirely at the requested location,
  1896. Xthe right edge or bottom of the window is truncated at the boundary of the
  1897. Xdisplay.
  1898. X.Fe
  1899. X.Fs m_newwin 11 "Make a new window"
  1900. XAn alternate window is created with the size and location indicated.
  1901. XThe arguments
  1902. X.Fi X
  1903. Xand
  1904. X.Fi Y
  1905. Xspecify the upper left corner of the window,
  1906. X.Fi Dwide
  1907. Xand
  1908. X.Fi Dhigh
  1909. Xthe size.
  1910. XIf the window is to be to fit at the requested location,
  1911. Xits size is truncated appropriately.
  1912. X\*M will return a window number if the creation is successful, or
  1913. Xa 
  1914. X.I newline
  1915. Xif the window could not be created.
  1916. XThe newly created window is made the
  1917. X.I active 
  1918. Xwindow.
  1919. XThe macro
  1920. X.Fr m_selectwin
  1921. Xis used to enable writing on the newly created window.
  1922. X.Fe
  1923. END_OF_FILE
  1924. # end of 'doc/usrman/doc.3'
  1925. fi
  1926. echo shar: End of archive 44 \(of 61\).
  1927. cp /dev/null ark44isdone
  1928. MISSING=""
  1929. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
  1930.     21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 \
  1931.     38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 \
  1932.     55 56 57 58 59 60 61 ; do
  1933.     if test ! -f ark${I}isdone ; then
  1934.     MISSING="${MISSING} ${I}"
  1935.     fi
  1936. done
  1937. if test "${MISSING}" = "" ; then
  1938.     echo You have unpacked all 61 archives.
  1939.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1940. else
  1941.     echo You still need to unpack the following archives:
  1942.     echo "        " ${MISSING}
  1943. fi
  1944. ##  End of shell archive.
  1945. exit 0
  1946.