home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / CSCAP321.ZIP / GRAPHICS.TXT < prev    next >
Encoding:
Text File  |  1990-12-28  |  107.1 KB  |  3,681 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                            C-scape and Graphics
  9.  
  10.         Copyright (c) 1990, Oakland Group, Inc.  All rights reserved.
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. SECTION1:  About this document
  20.  
  21. Part of C-scape's power is that it allows you to use graphics in your
  22. applications.  This document takes a look at the various tools available for
  23. using graphics.  It is organized as follows:
  24.  
  25.         Section 2    C-scape and graphics
  26.  
  27.                      This section offers a practical approach to the methods
  28.                      that you can use to put graphics into your application.
  29.                      Each part of this section is based on and explicates a
  30.                      particular C-scape demo program (see below).
  31.  
  32.         Section 3    C-scape graphics theory
  33.  
  34.                      This section provides a theoretical explanation of C-scape
  35.                      and its graphics components.  It is not required reading,
  36.                      though you may find it useful, edifying, or even fun.
  37.  
  38.         Section 4    Function reference
  39.  
  40.                      This section is a reference for the functions mentioned in
  41.                      this document and in the programs to which it refers.
  42.  
  43. For more basic information on C-scape, consult the C-scape User's Manual, the
  44. C-scape Function Reference, and the file READ.ME (also on your distribution
  45. media).
  46.  
  47. SECTION 2:  C-scape and graphics
  48.  
  49. C-scape sits on top of the Oakland Windowing Library (OWL), which itself has
  50. two parts: the Window Manager and the Device Interface Group (DIG).  The Window
  51. Manager creates, paints, manipulates, and destroys windows.  The DIG handles
  52. all communications with the display hardware and operating system.
  53.  
  54. The Window Manager maintains all windows on the display and knows which parts
  55. of each window are visible.  It uses a message passing scheme to handle
  56. requests to paint, resize, and move windows.  For instance, when you want to
  57. paint a window, you tell the Window Manager (by calling sed_Repaint).  The
  58. Window Manager then sends a paint message to the window; this message tells the
  59. window which of its parts are visible (and require painting).  The window
  60. receives the message and paints the appropriate areas.  This message passing
  61. approach allows the Window Manager to govern different types of windows with
  62. the same message, since each type knows how to respond to the message.  Note
  63. that every window has associated data that determines what it is currently
  64. displaying because the Window Manager may send it a paint message at any time.
  65. The data associated with a sed (the window type used by C-scape) is held in its
  66. menu object.  The menu object consists of the text buffer, an array of fields,
  67. and various state information.
  68.  
  69. When a window receives a paint message, it responds by drawing something, such
  70. as a text string, to the display.  It does this with one of the standard DIG
  71. commands.  The DIG is a collection of routines that perform specific interface
  72. functions.  For example, one DIG routine plots a string to the display and
  73. another scrolls a region on the display.  There exists one DIG for each display
  74. mode.  disp_Init calls either the DIG you have specified or, if you so choose,
  75. the best one available for your platform.
  76.  
  77. When you run a text mode C-scape program, disp_Init sets up the DIG to use
  78. functions that communicate to the display in text mode.  In graphics mode, the
  79. DIG is set up to emulate text mode with graphics commands, so that C-scape
  80. still lays out text forms using character coordinates.  Note that C-scape
  81. windows (seds) can only use fixed-width fonts and can only use one font at a
  82. time.
  83.  
  84. The graphics mode DIG makes it possible to read and write bitmap images (or
  85. pixmaps) to and from the display.  C-scape graphics programs use this ability
  86. when they create windows containing bitmap images.
  87.  
  88. Note that the following applications use either grwins (GRaphics WINdows) or
  89. pmwins (Pixel Map WINdows).  Both window classes can hold pixmaps.  A grwin is
  90. designed for use in a dynamically changing situation; it automatically
  91. allocates its own pixmap (ensuring that the window and its pixmap are the same
  92. size) and can handle SAVE messages.  A pmwin is designed for more static
  93. situations; it allocates its pixmap in a separate operation (pmap_Open) and
  94. uses a "GRAB" message to read from the display and update its pixmap.
  95.  
  96. 2.1  Drawing on top of the display and restoring
  97.  
  98. The easiest and simplest way of creating a graphical image on the display is to
  99. draw directly to the display using a graphics library.  When you are finished,
  100. you can remove the graphics by calling disp_Repaint.   disp_Repaint repaints
  101. the entire C-scape display (all windows and the display background) and
  102. obliterates the graphics image you have drawn.
  103.  
  104. With this approach, OWL knows nothing of the image you have created because it
  105. exists outside of its windowing system.  While the graphical image is on the
  106. display, you should not move or paint any C-scape windows, since the windows
  107. will overwrite the image.
  108.  
  109. demodraw.c is an example which uses this method.  In brief, disp_Init
  110. initializes OWL, the graphics library is initialized, and a clipping rectangle
  111. is established for use with the graphics library routines; next, a C-scape sed
  112. is created, painted, and run; then, a graphical image is drawn on top of the
  113. C-scape window; finally, disp_Repaint restores the C-scape display, removing
  114. the image.
  115.  
  116. 2.2  Writing graphics to a background grwin window
  117.  
  118. Instead of drawing over your C-scape windows and losing the image when those
  119. windows are repainted or moved, you can preserve the image by drawing on a
  120. special C-scape window called the background window.
  121.  
  122. Because the background window is part of C-scape (and automatically managed by
  123. OWL), you can place other windows on top of it and cover it.  When these
  124. windows move or disappear, the graphical image becomes visible again.
  125.  
  126. Each application has one background window, which is the size of the entire
  127. display.  This window has a buffer associated with it that is large enough to
  128. store a display-size image.  When you run a C-scape program with a background
  129. window, the contents of the display are saved in it before any C-scape output
  130. is generated.  This allows you to save the images on the display before your
  131. program starts and use them as a backdrop.  For a graphics applications, the
  132. background window is a graphics window (grwin); in text mode applications, it
  133. is a character map window (cmwin).  Under most circumstances, you don't need a
  134. background window, in which case, you can set it to FNULL.
  135.  
  136. When you call disp_Init, use the function's second argument to create a
  137. background window.  To create a grwin type:
  138.  
  139.    disp_Init(def_ModeGraphics, grwin_Class);
  140.  
  141.  
  142. A grwin is a special version of a pixel map window (pmwin).  Like a pmwin, it
  143. contains a pixmap in which it stores a graphical image.  Unlike a pmwin, it can
  144. save its contents by processing a WINM_SAVE message.  Immediately before any
  145. part of it is obscured, the grwin receives a WINM_SAVE message and saves its
  146. area(s) that are to be covered.  When the obscuring window is moved or closed,
  147. the grwin paints its pixmap to the display, thus restoring the image.
  148.  
  149. If you draw directly to an area of the display where a grwin is exposed, what
  150. you have drawn will overwrite that portion of original pixmap image.  This does
  151. not happen immediately, but when another window is placed on top of the grwin.
  152. At that point, the save message is sent by the Window Manager and the grwin
  153. updates its pixmap.  When you remove the other window, the new graphics image
  154. of the grwin is automatically restored.
  155.  
  156. This method is simple and easy, but has two disadvantages.  Because a
  157. background window is a display-size window, its pmap buffer must be large
  158. enough to store an entire display of data.  This can use a great deal of
  159. memory.  (See the table PC Graphics Modes under OWL, below.)  Also, you cannot
  160. paint to those parts of the background window that are currently obscured, only
  161. those parts that are visible.
  162.  
  163. Refer to demograf.c for an example that uses this technique.
  164.  
  165. 2.3  win_Grab
  166.  
  167. The background grwin is convenient, but uses a great deal of memory.  If you
  168. wish to use an image that is not the size of the entire display, you can use a
  169. smaller window to hold it.  A smaller window means that the associated pixel
  170. map (pmap) buffer occupies less memory.
  171.  
  172. Note that instead of a grwin, we use a pmwin.  Unlike a grwin, a pmwin does not
  173. process the WINM_SAVE messages.  Instead of these, it uses the win_Grab
  174. function, which you must call explicitly.  win_Grab copies the area of the
  175. video display that corresponds to the window into the pmwin's pixmap.
  176.  
  177. To put a graphics into a pmwin, first, create the window with win_Open:
  178.  
  179.    pmwin_type graphwin;
  180.    ocbox box;
  181.  
  182.    /* set up to open a window that is 21 characters wide and 11 tall */
  183.  
  184.    box.xmin = 0;
  185.    box.ymin = 0;
  186.    box.xmax = 20;
  187.    box.ymax = 10;
  188.  
  189.    graphwin = win_Open(pmwin_Class, &box);
  190.  
  191. win_Open takes two arguments: a window class and an ocbox (Oakland Character
  192. BOX).  An ocbox is a structure that holds the maximum and minimum row and
  193. column values for the window you are opening.  Each of its elements is an
  194. integer value; these values hold the absolute coordinates of the window's edges
  195. on the display.
  196.  
  197. Having created the pmwin, put the graphics on the display in the area occupied
  198. by the pmwin.  Before you draw to the screen, call disp_Cache, to remove the
  199. mouse cursor from the display; otherwise, it will be part of the pmwin image.
  200. Draw the image on the display.  Call win_Grab to save the image into the
  201. pmwin's pixmap.  Finally, you can return the mouse cursor to the display with a
  202. call to disp_Flush.
  203.  
  204.    /* hides mouse cursor */
  205.    disp_Cache();
  206.  
  207.    /* ... draw image with graphic library routines over pmwin ... */
  208.  
  209.    /* capture into pmwin's pixmap what we drew */
  210.    win_Grab(graphwin);
  211.  
  212.    /* restore mouse cursor */
  213.    disp_Flush();
  214.  
  215.  
  216. Remember, the pmwin must be completely unobscured when you draw the graphics
  217. over it and grab it; the obscured parts of the window will not be grabbed.  The
  218. size of a pmap is fixed by the size of the window when the window is opened.
  219. If you resize the pmwin, its pmap will not change size to reflect the new
  220. window size.
  221.  
  222. A pmwin can scroll through its pixmap or be resized to be smaller or larger
  223. than the pixmap.  To scroll the window you should attach a border with scroll
  224. bars such as bd_sidebar, bd_mouse or bd_mouse2.  If you make a window larger
  225. than its pixmap, the extra area is filled with the background color of the
  226. window.  You may set this attribute with win_SetAttr (the first argument is a
  227. win_type; the second, a byte attribute).
  228.  
  229. Refer to demograb.c for a sample application that uses this technique.
  230.  
  231. 2.4  Loading PCX file images
  232.  
  233. Every method we have discussed so far involves writing to the screen directly.
  234. C-scape also allows you to use graphical images that are stored in and
  235. retrieved from files; on the PC, C-scape supports the use of PCX files.  The
  236. PCX file image format developed by Z-Soft Corporation is flexible and has
  237. gained wide acceptance.
  238.  
  239. Files in other formats may be converted to PCX format by third party utilities,
  240. which are often available on electronic bulletin boards and networks.  If you
  241. need more information about the details of PCX file format and such utilities,
  242. refer to the file pcxspec.txt on your C-scape disk 1 or contact Z-Soft:
  243.  
  244.    Z-Soft Corporation
  245.    450 Franklin Road, Suite 100
  246.    Marietta, Georgia  30067
  247.  
  248.    (404) 428-0008 telephone
  249.    (404) 427-1150 fax
  250.  
  251.  
  252. To display a PCX file, use a pmwin (pixel map window).  As OWL objects, pmwins
  253. use win_ commands.  (Consult the demonstration program demopcx.c as a guide to
  254. loading and displaying PCX file images.)
  255.  
  256. Before you can use a PCX file, you must initialize the PCX file interface by
  257. calling pmap_IoInit:
  258.  
  259.      void pmap_IoInit()
  260.  
  261.  
  262. Next, call ocolmap_Open.  This creates a color map that can hold the range of
  263. colors that are necessary to create the image.  This routine takes an index, firstpix, and the
  264. number of entries the color map will have, nentries.  It returns a color map
  265. with the entries set to black (or NULL, if the range of the map is outside that
  266. of the system hardware's default palette).
  267.  
  268.      ocolmap_type ocolmap_Open(firstpix, nentries)
  269.         opixval         firstpix;
  270.         unsigned        nentries;
  271.  
  272.  
  273. To load a map from a PCX file opened in "rb" (read binary) mode, call
  274. pmap_Load.  Note that win_Open does not allocate a pmap when it opens a pmwin.
  275. pmap_Load reads the .pcx file, initializes your color map, allocates a pmap,
  276. and loads the pmap with the PCX file image; it returns a pointer to the pmap it
  277. has created.
  278.  
  279.      pmap_type pmap_Load(fp, crange)
  280.         FILE            *fp;
  281.         ocolmap_type    crange;
  282.  
  283.  
  284. After you've loaded the pmap with pmap_Load, you can set the palette, if you so
  285. please.  Having both loaded the pmap and set the palette, you can destroy 
  286. the color map:
  287.  
  288.      void ocolmap_Close(crange)
  289.         ocolmap_type    crange;
  290.  
  291.  
  292. After opening a pmap, attach the pmap to the pmap window with pmwin_SetPmap:
  293.  
  294.      void pmwin_SetPmap(win, pmap)
  295.         win_type        win;
  296.         pmap_type       pmap;
  297.  
  298.  
  299. At this point, you can paint the window to the display with win_Employ.
  300.  
  301. You can refresh the display of a pmap window with win_Paint.  To paint the
  302. border, a shadow, and the window, call bord_Paint.  In general, win_ routines
  303. affect only the window; bord_ routines affect the window and border.  If the
  304. pmwin is a bob, you must call sed_Repaint.
  305.  
  306. The pmap is the pmwin's associated data store that determine what is painted to
  307. the display.  (seds are similar, in that the sed, menu, and field data
  308. structures tell a sed what to paint.)
  309.  
  310. You can alter a pmwin's pmap by writing directly to the display and then
  311. calling win_Grab.  For example, with the routines from a graphics library, you
  312. draw to the video display in the area over a pmwin.  If you then call win_Paint
  313. on the pmwin, the pmap will refresh itself and obliterate the changes to the
  314. display; if you don't call win_Paint and, instead, call win_Grab, the image on
  315. the display (where it falls within the exposed pmap) will be saved into the
  316. window's pmap.  After grabbing, you may move the pmap window and repaint it.
  317. The image you made by drawing over the pmap will then be a permanent part of
  318. the pmap window appearance.
  319.  
  320. When you finish using a pmap, remove it with pmap_Close.  Set the pmwin's
  321. pointer to the map to NULL with the following call:
  322.  
  323.      pmwin_SetPmap(win, NULL)
  324.  
  325.  
  326. Next, destroy the pmwin with win_Close.  win_Close will not deallocate the
  327. associated pmap.  You must call pmap_Close explicitly:
  328.  
  329.      boolean pmap_Close(pmap)
  330.         pmap_type;
  331.  
  332.  
  333. If you have a pmwin and need to get its pmap (to close it, for instance), call
  334. pmwin_GetPmap:
  335.  
  336.      pmwin_GetPmap(win);
  337.  
  338. You can also save the pmap of a pmwin (or a grwin) to a file in PCX format by
  339. calling pmap_Save.  This routine saves the pmap with its configuration of
  340. pixels and planes.  Remember to open the file into which you
  341. are saving the pmap in "wb" (write binary) mode.  You must also pass the
  342. function an ocolmap, for storing the image's color range.
  343.  
  344.    boolean pmap_Save(fp, pmap, cmap)
  345.        FILE *fp;
  346.        pmap_type pmap;
  347.        ocolmap_type cmap;
  348.  
  349. This function returns TRUE if it is successful.
  350.  
  351. 2.5  Multiple device interfaces
  352.  
  353. Occasionally, you may want to run your application's data entry screen in text
  354. mode and switch to graphics mode to show graphical images; for example, this
  355. will make your application more efficient if your graphics hardware is very
  356. slow.
  357.  
  358. To swap between text and graphics modes in a C-scape application, you need to
  359. create two separate device interfaces.  Since only one device interface can be
  360. current at one time, you must call disp_Init for one mode first, save the
  361. current device interface with disp_GetCurrent, and then call disp_Init for the
  362. other mode.  You then swap back and forth between the two device interfaces
  363. with disp_SetCurrent.
  364.  
  365. Each device interface has its own Window Manager and set of windows.  A window
  366. created under one device interface does not exist under the other device
  367. interface.  If you wish to have a similar window under text and graphics modes,
  368. you must create separate copies of the windows for each mode.
  369.  
  370. For example, you would begin by opening the text device interface:
  371.  
  372.     disp_Init(def_ModeText, FNULL);
  373.  
  374.  
  375. Next, save a pointer to the text interface:
  376.  
  377.     VOID *textdisp;
  378.  
  379.     textdisp = disp_GetCurrent();
  380.  
  381.  
  382. disp_GetCurrent shuts down the current interface without closing it.  You
  383. should call it only when you are about to make another interface current.  This
  384. means that you must immediately create the graphics mode interface:
  385.  
  386.     disp_Init(def_ModeGraphics, FNULL);
  387.  
  388.  
  389. To change back to the text interface, save a pointer to the graphics mode
  390. interface and make the text mode interface current again:
  391.  
  392.     VOID *grafdisp;
  393.  
  394.     grafdisp = disp_GetCurrent();
  395.  
  396.     disp_SetCurrent(textdisp);
  397.  
  398.  
  399. We can now use C-scape in text mode.  If we want to put up windows in graphics
  400. mode, we shut down the text interface and set the current device interface to
  401. the graphics interface:
  402.  
  403.     textdisp = disp_GetCurrent();
  404.  
  405.     disp_SetCurrent(grafdisp);
  406.  
  407.  
  408. You can also use this technique to drive two displays at once.  If your PC has
  409. both a graphics and text display, the text interface will communicate with the
  410. text display and the graphics interface will communicate with the graphics
  411. display.
  412.  
  413. Note: This technique is not the best way to mix text and graphics.  Maintaining
  414. two device interfaces requires more memory than running the whole application
  415. in graphics mode.
  416.  
  417. See demoswap.c for an example of this type of application.
  418.  
  419. 2.6  Compiling the demo programs
  420.  
  421. demograf.c, demograb.c, demopcx.c, and demoswap.c use window classes that
  422. contain image maps of video data.  Because these programs need substantial
  423. amounts of memory to store the image data, you must compile these in large
  424. memory model or they will not run.  See the table below for more information
  425. about memory use in the various graphics modes.
  426.  
  427. 2.6.1 democlok.c:
  428.  
  429. democlok.c (for use with the Microsoft C and Borland Turbo C versions of
  430. C-scape 3.2, only[--]their graphics libraries comprise part of the code)
  431. displays a clock with hour, minute and sweep second hands.  The clock is
  432. created using a userwin_Class window.   A userwin allows the application
  433. programmer to control both painting the window and the window's response to
  434. win_Go.  You can move, resize, and top the window; the clock image is scaled to
  435. the window size.
  436.  
  437. You can only run democlok on a system capable of supporting graphics.  You must
  438. have a graphics hardware capabilities and your run-time library must support
  439. your particular graphics hardware.  For example, although C-scape supports the
  440. Hercules card, Microsoft does not.  In this case democlok fails.  Note that on
  441. some CGA systems you may have to run the DOS-supplied utility GRAFTABL.COM to
  442. load the graphics character set.
  443.  
  444. The Turbo version of democlok looks for the Borland .BGI graphics driver files
  445. in the \TC directory and the directory in which you run it.  You can change
  446. this search path by changing the constant BGI_PATH in democlok or by setting
  447. the environment variable "BGIPATH" on the DOS command line.  For example:
  448.  
  449.      set BGIPATH=c:\tc\bgi
  450.  
  451.  
  452. 2.6.2 demodraw.c:
  453.  
  454. demodraw.c (for use with the Microsoft C and Borland Turbo C versions only)
  455. demonstrates a simple way drawing graphics over top of a C-scape window without
  456. opening a graphics window.   It uses either the Microsoft or Turbo graphics
  457. libraries to draw the graphic images.
  458.  
  459. You can only run demodraw on a system capable of supporting graphics.  You must
  460. have graphics hardware capabilities and your run-time library must support your
  461. particular graphics hardware.  Note that on some CGA systems you may have to
  462. run the DOS-supplied utility graftabl.com to load the graphics character set.
  463.  
  464. The Turbo version of demodraw looks for the Borland .BGI graphics driver files
  465. in the \TC directory and the directory in which you run it.  You can change
  466. this search path by changing the constant BGI_PATH in demodraw.c or by setting
  467. the environment variable "BGIPATH" on the DOS command line.  For example:
  468.  
  469.      set BGIPATH=c:\tc\bgi
  470.  
  471.  
  472. 2.6.3 demograf.c:
  473.  
  474. demograf.c (for use with the Microsoft C and Borland Turbo C versions of
  475. C-scape 3.2, only) demonstrates how C-scape screens can be placed on top of
  476. graphics images displayed in a system background window.  It uses either the
  477. Microsoft or Turbo graphics libraries to draw the graphic images.
  478.  
  479. You can only run demograf on a system capable of supporting graphics.  You must
  480. have a graphics hardware capabilities and your run-time library must support
  481. your particular graphics hardware.  For example, although C-scape supports the
  482. Hercules card, Microsoft does not.  In this case demograf would fail.  Note
  483. that on some CGA systems you may have to run the DOS-supplied utility
  484. GRAFTABL.COM to load the graphics character set.
  485.  
  486. The Turbo version of demograf looks for the Borland .BGI graphics driver files
  487. in the \TC directory and the directory in which you run it.  You can change
  488. this search path by changing the constant BGI_PATH in demograf.c or by setting
  489. the environment variable "BGIPATH" on the DOS command line.  For example:
  490.  
  491.      set BGIPATH=c:\tc\bgi
  492.  
  493.  
  494. 2.6.4 demograb.c:
  495.  
  496. demograb.c (for use with the Microsoft C and Borland Turbo C versions of
  497. C-scape 3.2, only) illustrates the use of the win_Grab function to update a
  498. pmap window's PMAP from video display memory.  It uses either the Microsoft or
  499. Borland Turbo C graphics libraries to draw to video display memory.
  500.  
  501. You can only run demograb on a system capable of supporting graphics.  You must
  502. have a graphics hardware capabilities and your run-time library must support
  503. your particular graphics hardware.  For example, although C-scape supports the
  504. Hercules card, Microsoft does not.  In this case demograb would fail.  Note
  505. that on some CGA systems you may have to run the DOS-supplied utility
  506. GRAFTABL.COM to load the graphics character set.
  507.  
  508. The Turbo version of demograb looks for the Borland .BGI graphics driver files
  509. in the \TC directory and the directory in which you run it.  You can change
  510. this search path by changing the constant BGI_PATH in demograb.c or by setting
  511. the environment variable "BGIPATH" on the DOS command line.  For example:
  512.  
  513.      set BGIPATH=c:\tc\bgi
  514.  
  515.  
  516. 2.6.5 demopcx.c:
  517.  
  518. demopcx.c demonstrates loading and displaying graphics images stored on disk
  519. using the PCX file format.  This program uses: ABC.PCX, ART.PCX, FACE.PCX, and
  520. GRAPH.PCX.
  521.  
  522. 2.6.6 demoswap.c:
  523.  
  524. demoswap.c demonstrates changing from text mode to graphics and back.  It uses
  525. disp_GetCurrent and disp_SetCurrent to maintain two device interfaces.
  526.  
  527. SECTION 3:  Background theory
  528.  
  529. C-scape allows you to write applications that run in either text or graphics
  530. mode.   Graphics modes allow you to display graphical images and use
  531. non-standard fonts and colors.  To change an application from text mode to
  532. graphics mode, you need only have the disp_Init function initialize a graphics
  533. display mode instead of a text mode.
  534.  
  535. To help you use graphics images with C-scape, this document provides an
  536. introduction to the elements of graphics under C-scape along with a discussion
  537. of various methods for using graphics images with C-scape.
  538.  
  539. C-scape currently supports graphics on the PC under DOS and on the Apollo.  We
  540. will contact you to announce the addition of graphics functionality to our
  541. other ports.
  542.  
  543. 3.1  PC Graphics Modes under OWL
  544.  
  545. On a personal computer using MS-DOS, many graphics modes are available for use
  546. as part of a C-scape application.  Each of these has its own characteristics in
  547. terms of resolution, available colors, and memory use.  Below is a table
  548. describing the various modes:
  549.  
  550.  
  551.  
  552.  
  553.  Mode           Card        pixels    chars    font    colors    memory use
  554.  
  555.  pc_Mode4       CGA         320x200   40x25    8x8     4         16,000
  556.  
  557.  pc_Mode5       CGA         320x200   40x25    8x8     4         16,000
  558.  
  559.  pc_Mode6       CGA         640x200   80x25    8x8     2         16,000
  560.  
  561.  pc_ModeD       EGA         320x200   40x25    8x8     16        32,000
  562.  
  563.  pc_ModeE       EGA         640x200   80x25    8x8     16        64,000
  564.  
  565.  pc_ModeF       EGA         640x350   80x25    8x14    4         28,000
  566.  
  567.  pc_Mode10      EGA         640x350   80x25    8x14    16        112,000
  568.  
  569.  pc_Mode11      VGA         640x480   80x30    8x16    2         38,400
  570.  
  571.  pc_Mode12      VGA         640x480   80x30    8x16    16        153,600
  572.  
  573.  pc_Mode13      VGA         320x200   40x25    8x8     256       64,000
  574.  
  575.  pc_ModeCpq40   Plasma      640x400   80x25    8x16    2         32,000
  576.  
  577.  pc_ModeHerc    Hercules    720x350   90x25    8x14    2         31,500
  578.  
  579.  
  580.  
  581.  
  582. In this chart, pixels denotes the display width and height in pixel units;
  583. chars, the display width and height in character units (based on the default
  584. font size); font, the default font character cell size (width x height);
  585. colors, the number of available colors (2 is monochrome); and memory use, the
  586. number of bytes of data needed to represent a full-display size image (this is
  587. the size of the buffer allocated when you request a background window of
  588. grwin_Class in the disp_Init).
  589.  
  590. 3.2  def_ModeGraphics
  591.  
  592. When you initialize the display, you can select a particular graphics mode
  593. (such as pc_Mode12 or pc_Mode13 on a PC) or you can allow def_ModeGraphics to
  594. select the highest resolution graphics mode available:
  595.  
  596. On the PC, def_ModeGraphics selects modes in this order: pc_Mode12, pc_ModeF,
  597. pc_Mode10, pc_Mode11, pc_ModeCpq40, pc_ModeHerc, pc_Mode6.  (Mode 12 has
  598. highest priority; mode 6, lowest.)
  599.  
  600. 3.3  High Resolution and non-standard video cards for the PC
  601.  
  602. On the PC, C-scape contains drivers for the standard CGA, EGA and VGA cards.
  603. If you have a CGA, EGA or VGA card that is non-standard or a special
  604. high-resolution video setup you may still be able to use C-scape with it
  605. without having to write a driver yourself.
  606.  
  607. Metagraphics Software Corporation produces a sophisticated graphics library
  608. called MetaWINDOW.  This libray includes drivers for a broad range of output
  609. devices.  Oakland has a version of C-scape that will work with the MetaWINDOW
  610. library to allow you to run on non-standard PC video hardware.  You may contact
  611. Metagraphics for a list of display adapters they support:
  612.  
  613.    Metagraphics Software Corporation
  614.    269 Mount Hermon Road
  615.    P. O. Box 66779
  616.    Scotts Valley, CA 95066
  617.  
  618.    (408) 438-1550 telephone
  619.    (408) 438-5379 fax
  620.  
  621.  
  622. Contact Oakland Group, Inc. for the price and availability of the MetaWINDOW
  623. version of C-scape.
  624.  
  625. 3.4  Additional graphics pages
  626.  
  627. C-scape does not use multiple graphics pages or Extended Memory Support.
  628.  
  629. 3.5  Fonts
  630.  
  631. For PCs, OWL uses only one font of the default font size for a particular
  632. display mode.  disp_Init uses a BIOS call to ascertain the default font table
  633. on the video hardware card.  Thereafter, C-scape forgoes the BIOS and writes
  634. directly to video memory when plotting text; this improves performance, as
  635. direct video writes are faster than BIOS calls.
  636.  
  637. On VGA and EGA cards, C-scape allows you to use a non-standard font (if you
  638. know how to program the card or have a utility to do so); if you change to a
  639. new font from the default prior to disp_Init, C-scape will use the new font
  640. when it calls disp_Init.  With the Hercules card, the fonts that C-scape uses
  641. are hard coded into the assembler files and cannot be changed.
  642.  
  643. Although OWL uses whatever font is on the video card, it assumes that the
  644. character cell size of the font is standard.  (See the table, above, for the
  645. standard character cell sizes for the PC graphics modes supported by OWL.)  If
  646. your card has a non-standard font, then you must inform OWL of the size of the
  647. character cell.  After calling disp_Init, get a pointer to the display mode
  648. font structure and use it to alter the height and width specifications that
  649. will be used when plotting:
  650.  
  651.    ofont_type font;
  652.  
  653.    font = disp_GetDefFont();
  654.    font->real.width = 8;       /* sets the character cell width of font */
  655.    font->real.height = 16; /* sets the character cell height of font*/
  656.  
  657.  
  658. There is no provision in OWL for proportional fonts; it assumes all character
  659. cells of a font are of uniform size.  On PCs, OWL plots graphic text characters
  660. on the nearest byte boundary.  On the more advanced platforms, the graphic
  661. characters are not so constrained, but may be specified with pixel precision.
  662.  
  663. Platforms such as Apollo's Domain and Metagraphics support the simultaneous use
  664. of multiple fonts.  Currently, however, OWL allows only one font per window.
  665.  
  666. 3.6  Coordinate Systems
  667.  
  668. OWL uses coordinate systems to describe both individual windows and the
  669. display.  This allows functions to refer to any position, by using an x and a y
  670. coordinate.
  671.  
  672. The origin (0,0) of the display coordinate system is the upper-left corner of
  673. the physical display.  The origin (0,0) of the window coordinate system is the
  674. upper-left corner of the window.
  675.  
  676. 3.6.1 Character vs. Pixel Coordinates
  677.  
  678. Because the window manager operates in both text and graphics modes, OWL uses
  679. two different coordinate units: one based on characters and one based on
  680. pixels.
  681.  
  682. Character coordinates measure the display in character-sized units.  For
  683. example, a typical display might measure 25 characters tall and 80 characters
  684. wide.
  685.  
  686. Pixel coordinates are based the number of pixels on the display, which depends
  687. on the display's video adaptor and display mode.  A pixel is the smallest
  688. addressable picture element.  For example, a graphics display might measure
  689. 320 pixels wide and 200 pixels tall.
  690.  
  691. Character coordinates are ints while pixel coordinates are opcoords.  opcoords
  692. are an Oakland data type; they are signed integers.
  693.  
  694.  
  695.  Character coordinate function arguments are used in the order (row, col); for
  696.  pixel coordinates, the order is reversed: (x, y).
  697.  
  698.  
  699. Internally, OWL converts everything to pixel coordinates, but its standard
  700. external routines are based on character coordinates:
  701.  
  702.        win_SetPosition(win, row, col);
  703.  
  704.  
  705. Pixel versions of commands are also available:
  706.  
  707.        win_SetPixPosition(win, x, y);
  708.  
  709.  
  710. You can convert from character coordinates to pixel coordinates by multiplying
  711. by the pixel height and width of a single character.  You can determine the
  712. height and width of a character with win_GetFontHeight and
  713. win_GetFontWidthWidth.  For x coordinates, use the font width; for y
  714. coordinates, use the font height:
  715.  
  716.     pixel_xpos = win_GetFontWidth(win) * char_xpos;
  717.     pixel_ypos = win_GetFontHeight(win) * char_ypos;
  718.  
  719.  
  720. You can convert from pixel coordinates to character coordinates by dividing by
  721. the pixel height and width of a single character.  You can determine the
  722. height and width of a character with ofont_GetHeight and ofont_GetWidth.  For
  723. x coordinates, use the font width; for y coordinates, use the font height:
  724.  
  725.     char_xpos = pix_xpos / win_GetFontWidth(win);
  726.     char_ypos = pix_ypos / win_GetFontHeight(win);
  727.  
  728.  
  729. If you convert between pixels and characters (in either direction) on a
  730. text-based display, these functions still work, since a character is
  731. considered to be 1 pixel wide and 1 pixel tall in text mode.  This is
  732. consistent with the notion that a pixel is the smallest addressable element on
  733. the display.
  734.  
  735. 3.6.2 Coordinate Data Structures and Types
  736.  
  737. OWL provides several structures for describing points and screen regions in
  738. both character and pixel coordinates.  The following structures exist: ocbox,
  739. ocsize_struct, ocpos_struct, opbox, opsize_struct, opoint.
  740.  
  741. An ocbox (Oakland Character BOX) describes a rectangle in character
  742. coordinates.  It contains the following elements:
  743.  
  744.     toprow     the top-most row of the rectangle.
  745.  
  746.     leftcol    the left-most column of the rectangle.
  747.  
  748.     botrow     the bottom-most row of the rectangle.
  749.  
  750.     rightcol   the right-most column of the rectangle.
  751.  
  752.  
  753.  
  754. It is defined as follows:
  755.  
  756.     typedef struct {
  757.        int leftcol;
  758.        int rightcol;
  759.        int toprow;
  760.        int botrow;
  761.     } ocbox;
  762.  
  763.  
  764. An opbox (Oakland Pixel BOX) describes a rectangle in pixel coordinates.  It
  765. contains the following elements:
  766.  
  767.     xmin       the left-most edge of the rectangle.
  768.  
  769.     ymin       the top-most edge of the rectangle.
  770.  
  771.     xmax       the right-most edge of the rectangle.
  772.  
  773.     ymax       the bottom-most edge of the rectangle.
  774.  
  775.  
  776.  
  777. It is defined as follows:
  778.  
  779.     typedef struct {
  780.        opcoord xmin;
  781.        opcoord xmax;
  782.        opcoord ymin;
  783.        opcoord ymax;
  784.     } opbox;
  785.  
  786.  
  787. An ocsize_struct (Oakland Character SIZE structure) describes the size of a
  788. rectangle in character coordinates.  It contains the two elements:
  789.  
  790.     height     the height of the rectangle in characters
  791.  
  792.     width      the width of the rectangle in character
  793.  
  794.  
  795.  
  796. It is defined as follows:
  797.  
  798.     typedef struct {
  799.        int height;
  800.        int width;
  801.     } ocsize_struct;
  802.  
  803.  
  804. An ocpos_struct (Oakland Character POSition structure) describes the position
  805. of a point in character coordinates.  It contains the two elements:
  806.  
  807.     row        vertical position relative to the origin (display or window)
  808.  
  809.     col        horizontal position relative to the origin (display or window)
  810.  
  811.  
  812.  
  813. It is defined as follows:
  814.  
  815.     typedef struct {
  816.        int row;
  817.        int col;
  818.     } ocpos_struct;
  819.  
  820.  
  821. An opsize_struct (Oakland Pixel SIZE structure) describes the size of a
  822. rectangle in pixel coordinates.  It contains the two elements:
  823.  
  824.     height     the height of the rectangle in pixels
  825.  
  826.     width      the width of the rectangle in pixels
  827.  
  828.  
  829.  
  830. The values of the height and width are odims, an Oakland data type.  An odim is
  831. an unsigned int used for measuring (in pixels) dimensions of structures and
  832. distances between coordinates.
  833.  
  834. The structure is defined as follows:
  835.  
  836.     typedef struct {
  837.        odim height;
  838.        odim width;
  839.     } opsize_struct;
  840.  
  841.  
  842. An opoint (Oakland POINT) describes the position of a point in pixel
  843. coordinates.  It contains the two elements:
  844.  
  845.     x          the horizontal position of the point, relative to the origin
  846.  
  847.     y          the vertical position of the point, relative to the origin
  848.  
  849.  
  850.  
  851. These values are in opcoords, an Oakland data type.  An opcoord is an int used
  852. for describing signed pixel coordinates.
  853.  
  854. The structure is defined as follows:
  855.  
  856.     typedef struct {
  857.        opcoord x;
  858.        opcoord y;
  859.     } opoint;
  860.  
  861.  
  862. There are functions for manipulating these structures:
  863.  
  864.     pixels            characters        function description
  865.  
  866.     opbox_GetWidth    ocbox_GetWidth    returns the width of the box.
  867.  
  868.     opbox_GetHeight   ocbox_GetHeight   returns the height of the box.
  869.  
  870.     opbox_copy        ocbox_copy        makes a copy of a box.
  871.  
  872.     opbox_trans       ocbox_trans       translates a box vertically and
  873.                                         horizontally.
  874.  
  875.     opbox_equal       ocbox_equal       tests if two boxes are equal.
  876.  
  877.     opbox_set         ocbox_set         sets the positions of the corners of a
  878.                                         box
  879.  
  880.     opoint_copy                         makes a copy of a point.
  881.  
  882. 3.7  Painting
  883.  
  884.  
  885.  
  886. 3.7.1 Paint data
  887.  
  888. A ptd_struct is a paint data structure.  The Window Manager passes it as the
  889. indata argument to a window class function along with a paint message.  It
  890. contains the following elements:
  891.  
  892.     win        The window that holds the area to be painted.
  893.  
  894.     relboxp    A pointer to an opbox that describes the rectangle to be
  895.                painted.  The coordinates of the opbox are relative to the
  896.                window.
  897.  
  898.     emsgdata   Extra message data used by the OWL to handle window scrolling.
  899.  
  900.  
  901.  
  902. Remember that the window manager only asks windows to paint areas of the
  903. display in which they are visible.  This area may include the window's border.
  904.  
  905. A ptd is defined as follows:
  906.  
  907.     typedef struct _ptd {
  908.        obj_type    win;
  909.        opbox       *relboxp;
  910.        VOID        *emsgdata;
  911.     } ptd_struct;
  912.  
  913.  
  914. The paint data structure describes a rectangular area of the display, occupied
  915. by a window, that must be painted.  It is the responsibility of the window
  916. class or the auxiliary function to paint only within this rectangle.
  917.  
  918. The function ptd_Clear clears a ptd rectangle to a specified color.  The
  919. function ptd_SetInner copies and clips the ptd rectangle to exclude any of the
  920. window's border area.  For more information, see the function reference at the
  921. end of this document.
  922.  
  923. 3.7.2 User painting
  924.  
  925. Once you have opened a window, you place it on the display by calling
  926. win_Employ.  This function moves an an unemployed window to the top of the
  927. employed list and paints it to the display.  You can then refresh the window by
  928. calling win_Paint.
  929.  
  930. Both these functions cause the Window Manager to send a message to a window to
  931. paint itself.  The principal difference between win_Employ and win_Paint is
  932. that the latter has no effect on a window that is unemployed.
  933.  
  934. Other actions that affect the display, such as moving, resizing, or topping a
  935. window are handled by the Window Manager.  The Window Manager keeps track of
  936. which areas of which windows are visible on the display.  When you move a
  937. window and obscured windows become exposed or visible ones obscured, the Window
  938. Manager sends the appropriate messages to the windows involved.
  939.  
  940. Fully obscured windows are passed no paint messages.  Partially obscured
  941. windows are painted in several steps.  For example, suppose there are two
  942. employed windows, window1 and window2:
  943.  
  944.  
  945.                                      b
  946.  
  947.       window1->      a
  948.  
  949.  
  950.                                                              <- window2
  951.  
  952.  
  953.  
  954.  
  955. When you call win_Paint on window2, it is completely painted with one call to
  956. its class function.  window1, however, is obscured by window2.  When you call
  957. win_Paint on it,  the Window Manager breaks the window up into two "tiles," a
  958. and b, and sends two paint messages to the window class function, one for tile
  959. a and the other for tile b.  This ensures that any activity within window1 will
  960. not disturb window2.
  961.  
  962. When the Window Manager sends paint message to window's class function, it
  963. passes a pointer to a ptd_struct (paint data structure) as the message indata
  964. parameter.  A ptd_struct contains (1) a pointer, win, to the window being
  965. painted and (2) a pointer, relboxp, to an opbox structure.  The opbox describes
  966. the coordinates (relative to the window) of the rectangular region that the
  967. window class function will paint.
  968.  
  969. There are 2 paint messages that may be sent:  one for painting the normal areas
  970. of the object and one for painting the shadowed areas.
  971.  
  972. Every window object has a user paint flag. If the application programmer has
  973. sets the user paint flag to TRUE with win_SetUserPaint, then the WINA_PAINT and
  974. WINA_SHADOW messages are sent the the object's auxiliary function.  These
  975. messages are sent after the window object has performed its default painting
  976. and before the window border, if any, is painted.
  977.  
  978. All but one object class handles its own painting--the userwin_Class.   By
  979. default, all objects except userwins have their user paint flags off; the
  980. userwin's default setting is on.  Thus, it is entirely up to the userwin's
  981. auxiliary function to paint the window (see the democlock example).
  982.  
  983. 3.8  Attributes and colors
  984.  
  985. When you use C-scape's routines for color handling, you are actually
  986. manipulating pairs of colors, since you are setting or getting a foreground
  987. color and a background color simultaneously.  This pairing of a foreground
  988. color and a background color is called an attribute, which uses a byte's worth
  989. of space.  Each attribute is an index into a table called the attribute map,
  990. which has a fixed size of 256 entries.  Each entry consists of a foreground
  991. color and a background color.
  992.  
  993. The colors in the attribute map come from the hardware palette.  The number of
  994. available colors and their particular hues depends upon the hardware.  (If
  995. C-scape's color representation were to draw directly from the hardware palette,
  996. then the color denotation for red on one system might correspond to blue on
  997. another.)  The attribute map allows OWL to map C-scape colors (in the form of
  998. attributes) to the actual colors provided by the hardware.
  999.  
  1000. OWL keeps a list of the hardware colors that it uses.  This list is called an
  1001. ocolmap (Oakland Color MAP) and represents the hardware palette (or a portion
  1002. of it).  The ocolmap both represents the hardware palette and serves as a
  1003. working space for color map operations.  The number of colors in the map is
  1004. device dependent and limited by the number of available colors on the hardware.
  1005.  
  1006. Within the ocolmap, OWL denotes each color with an unsigned int, mapping each
  1007. color to a red, blue, and green (RGB) triplet.  A color is thus an index into a
  1008. table of RGB values.  The RGB values represent the relative levels of the red,
  1009. green and blue components that determine a color.
  1010.  
  1011. 3.8.1 The attribute map
  1012.  
  1013. When you start an application, OWL creates an attribute map for each device
  1014. interface.  You read from and write to the attribute map with disp_GetMapEntry
  1015. and disp_SetMapEntry.  (Note: The interface to these functions is improperly
  1016. documented in the C-scape Function Reference.  The correct function interface
  1017. for each appears below.  opixval is currently typedef'd to be an unsigned int.)
  1018.  
  1019. To look up a value in an attribute map, use disp_GetMapEntry:
  1020.  
  1021.     void disp_GetMapEntry(byte attr, opixval *bg, opixval *fg);
  1022.  
  1023. This routine takes the value attr; it returns the background and foreground
  1024. colors in the variables bg and fg, respectively.  Note that bg and fg are
  1025. passed by reference.
  1026.  
  1027. To change a value in the attribute map, call disp_SetMapEntry:
  1028.  
  1029.     void disp_SetMapEntry(byte attr, opixval bg, opixval fg);
  1030.  
  1031. This routine sets the entry attr in the attribute map to background color bg
  1032. and foreground color fg.
  1033.  
  1034. disp_GetColors returns the number of colors available on a system.  You can use
  1035. disp_MapMono to adjust the attribute map for a monochrome system (if
  1036. disp_GetColors returns 2L).
  1037.  
  1038.     long disp_GetColors(void);
  1039.  
  1040.     void disp_MapMono(boolean mono);
  1041.  
  1042.  
  1043. If the display is monochrome, then disp_MapMono sets the map appropriately, by
  1044. making a set of calls to disp_SetMapEntry.
  1045.  
  1046. 3.8.2 The ocolmap color map
  1047.  
  1048. A color map is an Oakland data structure used in operations involving the
  1049. system hardware palette of colors.  It represents a range of colors and their
  1050. associated RGB components.  You only want to use a color map when you wish to
  1051. manipulate colors on your hardware.
  1052.  
  1053. These are the elements of the color map:
  1054.  
  1055.     firstpix            The color index of the first color in the map.  The
  1056.                         firstpix color specifies the starting place in the
  1057.                         system hardware palette for the map's range of
  1058.                         colors.  Subsequent entries have contiguous and
  1059.                         sequential index values (the first color has the index
  1060.                         firstpix, the second, firstpix + 1, and so on).
  1061.  
  1062.     nentries            The number of colors represented in the map.
  1063.  
  1064.     rgbs[nentries -1]   An array of RGB (red-green-blue) triplets.  The first
  1065.                         value in the array is zero (in case firstpix has a
  1066.                         value greater than zero).  The triplet for the
  1067.                         firstpix color is rgbs[0]; the triplet for the last
  1068.                         color in the map is rgbs[nentries - 1].
  1069.  
  1070.                         The values of a triplet represent the relative levels
  1071.                         of the red, green, and blue components of a particular
  1072.                         color.
  1073.  
  1074. Each cell of the rgbs array is an orgb_struct structure, which has one member:
  1075. rgb.  rgb is a 3 celled array of bytes: the red component is rgb[ORED], the
  1076. green component is rgb[OGREEN], the blue component is rgb[OBLUE].  See the
  1077. functions below for retrieving and setting the RGB triplet of a color.
  1078.  
  1079. firstpix must be a value greater than or equal to zero and should be less than
  1080. the number of colors available on the system hardware palette.  For example, on
  1081. a PC with VGA video hardware with a palette of 16 colors, valid firstpix values
  1082. range from 0 to 15.  Likewise, firstpix + nentries should not exceed the
  1083. numbers of colors available in the hardware palette.  Again, assuming a VGA
  1084. with 16 colors, a color map with firstpix of 8 and nentries 7 would constitute
  1085. a valid range of colors.  This map could be used to represent the latter half
  1086. of the 16 color range.
  1087.  
  1088. While the attribute table has a fixed size (256 entries), the size of a color
  1089. map is effectively limited only by the size of the hardware palette.
  1090.  
  1091. You can get a copy of the current system palette with disp_GetColMap.  You can
  1092. alter the current system palette (change the hardware palette) with
  1093. disp_SetColMap.  You can get a pointer to the default system palette (i.e., the
  1094. initial values of the palette) with disp_GetDefColMapp.  If you wish to restore
  1095. an altered palette to the default, then call disp_SetColMapDefault.
  1096.  
  1097. If you are using color maps, there are some other functions that may be of use
  1098. to you.
  1099.  
  1100. The ocolmap_Open function allocates a colormap of nentries.  The first color in
  1101. the map has the index firstpix; the last color has the index (firstpix +
  1102. nentries - 1).  A pointer to the color map is returned.
  1103.  
  1104.     ocolmap_type ocolmap_Open(opixval firstpix, unsigned nentries);
  1105.  
  1106.  
  1107. The ocolmap_Close function frees the storage for the given colormap.
  1108.  
  1109.     void ocolmap_Close(ocolmap_type cmap);
  1110.  
  1111.  
  1112. The ocolmap_setpixrgb function sets the RGB values of a specific color ipix in
  1113. the given colormap cmap.  red, green, and blue are the RGB values,
  1114. respectively.  (In the current implementation olevel is type defined to be a
  1115. byte.)  ipix should be greater than or equal to the color map's firstpix and
  1116. less than nentries.
  1117.  
  1118.     void ocolmap_setpixrgb(ocolmap_type cmap, opixval ipix,
  1119.         olevel red, olevel green, olevel blue);
  1120.  
  1121.  
  1122. The ocolmap_entry function allows you to read the RGB triplet for a given
  1123. color.  colmap is the colormap from which you wish to read the colors.  opix is
  1124. the index of the color whose red green and blue values you wish to read.
  1125.  
  1126.     orgb_struct *ocolmap_entry(ocolmap_type colmap, opixval opix);
  1127.  
  1128. The RGB values are returned by a pointer to an orgb_struct, which has one
  1129. member: rgb.  rgb is a 3 celled array of bytes: the red component is rgb[ORED],
  1130. the green component is rgb[OGREEN], the blue component is rgb[OBLUE].  The
  1131. following functions return the red, green, and blue components of the RGB
  1132. triplet for the color ipix:
  1133.  
  1134.      olevel ocolmap_pixred(ocolmap_type cmap, opixval ipix);
  1135.      olevel ocolmap_pixgreen(ocolmap_type cmap, opixval ipix);
  1136.      olevel ocolmap_pixblue(ocolmap_type cmap, opixval ipix);
  1137.  
  1138. The function ocolmap_set copies the source color map scmap into the destination
  1139. map dcmap.  If the source is larger than the destination only the first portion
  1140. of the source equal to the size of the destination is copied.  If the source is
  1141. smaller than the destination map the latter portion of the destination map is
  1142. unaffected.  If either map is NULL or empty, nothing is copied.
  1143.  
  1144.     void ocolmap_set(ocolmap_type dcmap, ocolmap_type scmap);
  1145.  
  1146. The function ocolmap_samecolor compares two colors.  It returns TRUE if the RBG
  1147. values of scolor in the source map scmap is the same as those of dcolor in the
  1148. destination map dcmap; FALSE, otherwise.  dcmap and scmap may be the same map.
  1149.  
  1150.     boolean ocolmap_samecolor(ocolmap_type scmap, opixval scolor, ocolmap_type
  1151.         dcmap, opixval dcolor);
  1152.  
  1153. The ocolmap_getcolor function copies the RBG triplet of a single color scolor
  1154. in the source map scmap to that of the color dcolor in the destination map
  1155. dcmap.  dcmap and scmap may be the same map.  This routine returns TRUE if it
  1156. is able to copy the color; FALSE, otherwise (if the colors were out of range of
  1157. either map, for example).
  1158.  
  1159.     boolean ocolmap_getcolor(ocolmap_type scmap, opixval scolor, ocolmap_type
  1160.         dcmap, opixval dcolor);
  1161.  
  1162. 3.9  All about pixel map windows
  1163.  
  1164. Pixel map windows (pmwins) are windows of the pmwin_Class.  A pixel map (pmap)
  1165. is a bit map image of video ram.
  1166.  
  1167. On the PC, each video mode requires a certain amount of storage (bits) for
  1168. representing a each pixel.  This is the "bits per pixel" count.  On a
  1169. monochrome system, you need only one bit per pixel, since it is either on or
  1170. off.  "On" may be represented as white, while "off" is black.  Systems with
  1171. grey scales or color require additional bits to represent intensity or
  1172. particular colors.
  1173.  
  1174. The storage method for a pixel's bitmap also affects how a pixel appears in
  1175. video memory.  The bits that represent a pixel are either stored contiguously
  1176. or arranged in multiple "planes."  Let's use, as an example, a color system
  1177. that 2 bits per pixel.  For contiguous storage, bits 1 and 2 of pixel 1 appear
  1178. contiguously in memory; they are then followed by bits 1 and 2 of the next
  1179. pixel (and so on).  For storage with multiple planes, bit 1 of pixel 1 is
  1180. followed by bit 1 of pixel 2, and so on, until bit 1 of the last pixel.  After
  1181. this chunk of memory,  the second plane starts; this holds bit 2 of pixel 1,
  1182. bit 2 of pixel 2, and so on.
  1183.  
  1184. OWL supports PCX file images for the following display modes:
  1185.  
  1186.  
  1187.  Mode           Card        bits per    nplanes     ncolors
  1188.                             pixel
  1189.  
  1190.  pc_Mode4       CGA         2           1           4
  1191.  
  1192.  pc_Mode5       CGA         2           1           4
  1193.  
  1194.  pc_Mode6       CGA         1           1           2
  1195.  
  1196.  pc_ModeD       EGA         1           4           16
  1197.  
  1198.  pc_ModeE       EGA         1           4           16
  1199.  
  1200.  pc_ModeF       EGA         1           2           4
  1201.  
  1202.  pc_Mode10      EGA         1           4           16
  1203.  
  1204.  pc_Mode11      VGA         1           1           2
  1205.  
  1206.  pc_Mode12      VGA         1           4           16
  1207.  
  1208.  pc_Mode13      VGA/MCGA    8           1           256
  1209.  
  1210.  pc_ModeCpq40   Plasma      1           1           2
  1211.  
  1212.  pc_ModeHerc    Hercules    1           1           2
  1213.  
  1214.  
  1215.  
  1216.  
  1217. Disparate sizes of pmap and file image
  1218.  
  1219. When you load a PCX file image with the pmap_Load function, the function tries
  1220. to allocate a pmap big enough to hold the image.  If the PCX file image
  1221. requires more than 64k bytes to buffer (the current size limit on a pmap), the
  1222. image is larger than the pmap and is cropped on the right and bottom.  If an
  1223. image is smaller than the pmap, pmap_Load pads the unused areas (the right and
  1224. bottom) with 0s.
  1225.  
  1226. Disparate sizes of pmwin and pmap
  1227.  
  1228. Having loaded an image, use pmwin_SetPmap to attach the pmap to the pmwin
  1229. window.  If the pmwin is smaller than the pmap, attach a mouse-sensitive border
  1230. with scroll bars (such as bd_mouse, bdmouse2, or bd_sidebar) to the window with
  1231. win_SetBorder; this will allow you to scroll through the image.  If the pmap is
  1232. smaller than the pmwin, the "bare" area around the image will have the window's
  1233. background attribute coloring it.
  1234.  
  1235. Using pmap_Open
  1236.  
  1237. If you wish, you can open a pmap by calling pmap_Open instead of pmap_Load.
  1238. However, this method requires you to find your own way of loading an image into
  1239. the pmap.  pmap_Open takes a pixel size specification and creates a pmap
  1240. window.  You are returned the window; or, NULL if it could not be opened.
  1241.  
  1242.      pmap_type pmap_Open(pixwidth, pixheight)
  1243.         odim        pixwidth;       /* this type is currently defined */
  1244.         odim        pixheight;      /* to be an unsigned int */
  1245.  
  1246.  
  1247. SECTION 4:  Functions
  1248.  
  1249. This section describes some common window functions of the OWL.  These
  1250. functions are listed here to help you work with grwins, pmwins, userwins and
  1251. cmwins, but you can also use them on seds and sleds.
  1252.  
  1253. This is because OWL and C-scape are written in an object oriented way.  Objects
  1254. like seds are of a sub-class derived from more basic super-class of objects.  A
  1255. sub-class of objects inherits the both the data and functionality of its
  1256. super-class.
  1257.  
  1258. Quite literally, data is inherited because the data structures for sub-class
  1259. include the data structure of its parent class as its first member.  For
  1260. instance, in the data structure of a sled, the sed data structure is the first
  1261. element, followed by sled-specific data.  In turn, the sed data structure's
  1262. first member is window data and then the sed_specific data; and so on.
  1263.  
  1264. The following diagram shows the relationships among some of the various Oakland
  1265. objects:
  1266.  
  1267.  
  1268.              common   <- object pointer           (lower level object)
  1269.             obj data
  1270.  
  1271.             bob data
  1272.  
  1273.             win data
  1274.  
  1275.              sedwin
  1276.               data
  1277.  
  1278.                                             (higher level, derived
  1279.             sledwin                                            object)
  1280.               data
  1281.  
  1282.  
  1283.  
  1284.  
  1285. The object pointer in the above diagram may be an obj_type, a bob_type, a
  1286. win_type, a sed_type or a sled_type.  They all point to the same root object in
  1287. memory.
  1288.  
  1289. Not only is it useful to visualize the inheritance of data this way, but that
  1290. of an object's functionality.  Just as the data structures of class objects are
  1291. nested, so are the object class functions.  Objects perform actions in response
  1292. to messages sent to the object's class function.  Derived classes process the
  1293. message and then forward it on to their parent class.  The beauty of this is
  1294. that objects are reusable, insular and have a uniform interface.
  1295.  
  1296. When the Window Manager asks an object to paint itself, it does not need to
  1297. worry about what kind of object it is or how the object carries out its task.
  1298. For example, to paint an window, it sends the object the WINM_PAINT message.
  1299. If the object is a sled, the sled performs its sled-specific task and then
  1300. passes the message on up to the sed level and so on.
  1301.  
  1302. Any place you would use a higher level object pointer (like sled_type) you
  1303. could use a lower level pointer (like sed_type, win_type, obj_type).  Functions
  1304. that operate on on lower-level objects can be used on higher-level derived
  1305. objects.  For instance, to name a sed you could use the function sed_SetName or
  1306. obj_SetName.
  1307.  
  1308. However, the converse is not true.  While win_ and obj_ functions are valid on
  1309. seds,  sed_ functions are not valid on windows or other objects.
  1310. sed_GetFieldNo is sed-specific; it does not work on a pmwin.  seds are windows
  1311. but windows are not necessarily seds.
  1312.  
  1313. Here is tree diagram that describes the relationship of the various classes:
  1314.  
  1315.     common
  1316.  
  1317.         border
  1318.  
  1319.             bd_1
  1320.  
  1321.             bd_2
  1322.  
  1323.             (... other borders)
  1324.  
  1325.         bob
  1326.  
  1327.             ufunc
  1328.  
  1329.             win
  1330.  
  1331.                 userwin
  1332.  
  1333.                 cmwin
  1334.  
  1335.                 pmwin
  1336.  
  1337.                     grwin
  1338.  
  1339.                 sed
  1340.  
  1341.                     sled
  1342.  
  1343. The table below lists some common sed operations that have window equivalents.
  1344. If just the OWL function name is given, then the function interface is the same
  1345. as the C-scape function.  If the interface is different or there is no one
  1346. function equivalent then the function prototype is given for each OWL function
  1347. involved.  In some cases, there is no simple OWL equivalent so a short line or
  1348. two of code is provided to show how to achieve the affect.
  1349.  
  1350. Note: You can use the following window functions on objects of sed_type; but
  1351. you cannot use sed functions on objects of win_type.
  1352.  
  1353. C-scape usage            OWL usage
  1354.  
  1355.  
  1356.  
  1357. sed_BorderExists         test the return value of this function:
  1358.  
  1359.                              (win_GetBorderFunc(win) != FNULL)
  1360.  
  1361. sed_BorderPrompt         use this code:
  1362.  
  1363.                              bord_SendMsg(win, BDM_PROMPT, (VOID *)title, NULL);
  1364.  
  1365.                              /*
  1366.                              win is of win_type
  1367.                              BDM_PROMPT is a pre-defined message
  1368.                              title is a character string
  1369.                              */
  1370.  
  1371. sed_Center               win_SetPosition(win, (disp_GetHeight() -
  1372.                              bord_GetHeight(win)) / 2, (disp_GetWidth() -
  1373.                              bord_GetWidth(win)) / 2);
  1374.  
  1375. sed_Close                win_Close
  1376.  
  1377. sed_CreateBob            win_CreateBob
  1378.  
  1379. sed_GetAncestor          bob_GetAncestor
  1380.  
  1381. sed_GetBordCorners       bord_GetTopRow
  1382.                          bord_GetLeftCol
  1383.                          bord_GetBotRow
  1384.                          bord_GetRightCol
  1385.  
  1386. sed_GetBorderColor       bord_GetAttr
  1387.  
  1388. sed_GetBorderHeight      bord_GetHeight
  1389.  
  1390. sed_GetBorderWidth       bord_GetWidth
  1391.  
  1392. sed_GetColors            win_GetAttr
  1393.  
  1394. sed_GetCorners           win_GetPosition
  1395.  
  1396. sed_GetHeight            win_GetHeight
  1397.  
  1398. sed_GetPosition          bord_GetTopRow
  1399.                          bord_GetLeftCol
  1400.  
  1401. sed_GetSize              win_GetHeight
  1402.                          win_GetWidth
  1403.  
  1404. sed_GetWidth             win_GetWidth
  1405.  
  1406. sed_Open                 win_Open
  1407.  
  1408. sed_Pop                  win_Unemploy
  1409.  
  1410. sed_Repaint              win_Employ, win_Paint
  1411.  
  1412. sed_RepaintBorder        bord_Paint
  1413.  
  1414. sed_SetBorder            win_SetBorder
  1415.  
  1416. sed_SetBorderColor       bord_SetAttr
  1417.  
  1418. sed_SetBorderFeature     bord_SetFeature
  1419.  
  1420. sed_SetBorderTitle       use this code:
  1421.  
  1422.                              bord_SendMsg(win, BDM_SETTITLE, (VOID *)title, NULL);
  1423.  
  1424.                              /*
  1425.                              win is of win_type
  1426.                              BDM_SETTITLE is a pre-defined message
  1427.                              title is a character string
  1428.                              */
  1429.  
  1430. sed_SetColors            win_SetAttr
  1431.  
  1432. sed_SetExplode           win_SetExplode
  1433.  
  1434. sed_SetHeight            win_SetSize
  1435.  
  1436. sed_SetMouse             win_SetMouse
  1437.  
  1438. sed_SetMouseCode         disp_SetMouseCode
  1439.  
  1440. sed_SetNextWin           win_SetNextWin
  1441.  
  1442. sed_SetPosition          win_SetPosition
  1443.  
  1444.                          (Note: win_GetPosition has a different interface)
  1445.  
  1446. sed_SetShadow            win_SetShadow
  1447.  
  1448. sed_SetShadowAttr        win_SetShadowAttr
  1449.  
  1450. sed_SetSize              win_SetSize
  1451.  
  1452. sed_SetWidth             win_SetSize
  1453.  
  1454. sed_Top                  win_Top
  1455.  
  1456. sedwin_ClassInit         win_ClassInit
  1457.  
  1458.                          (Note: If you are using sedwin_ClassInit then
  1459.                          this is redundant)
  1460.  
  1461.  
  1462. bord_GetAttr                                           Get a border's attribute
  1463.  
  1464.  
  1465. ---------
  1466.  
  1467. Synopsis
  1468.  
  1469. byte bord_GetAttr(win)
  1470.  
  1471.    win_type win;              /* the window object */
  1472.  
  1473. Description
  1474.  
  1475. This routine gets the attribute of the border associated with window win.  The
  1476. attribute determines the foreground and background colors used to display the
  1477. border, its title, prompt, and any associated parts.  If there is no border
  1478. attached to win, then the attribute 0x00 is returned.
  1479.  
  1480. Return Value
  1481.  
  1482. A byte denoting the border attribute is returned.
  1483.  
  1484. Note
  1485.  
  1486. This routine is implemented as a macro.
  1487.  
  1488. See Also
  1489.  
  1490. bord_SetAttr
  1491.  
  1492.  
  1493.  
  1494. bord_GetBotRow - bord_GetTopRow            Get the position of a border's sides
  1495.  
  1496. ---------
  1497.  
  1498. Synopsis
  1499.  
  1500. int bord_GetBotRow(win)
  1501.  
  1502.    win_type win;              the window object
  1503.  
  1504. int bord_GetLeftCol(win)
  1505.  
  1506.    win_type win;
  1507.  
  1508. int bord_GetRightCol(win)
  1509.  
  1510.    win_type win;
  1511.  
  1512. int bord_GetTopRow(win)
  1513.  
  1514.    win_type win;
  1515.  
  1516. Description
  1517.  
  1518. These functions are used to retrieve the position of the sides of a window's
  1519. border.  The position is specified in display relative character coordinates.
  1520.  
  1521. If the window has no border the position of the window's sides are returned.
  1522.  
  1523. Return Value
  1524.  
  1525. An integer is returned denoting the row or column position of the border's
  1526. side.
  1527.  
  1528.  
  1529.  
  1530. bord_GetHeight                                            Get a border's height
  1531.  
  1532. ---------
  1533.  
  1534. Synopsis
  1535.  
  1536. int bord_GetHeight(border)
  1537.  
  1538.    win_type border;           the window which has the border
  1539.  
  1540. Description
  1541.  
  1542. This routine returns the height of win's border.  The width is specified in
  1543. character coordinates.  If the window has no border the height of the window is
  1544. returned.
  1545.  
  1546. Return Value
  1547.  
  1548. Returns the height of the border.
  1549.  
  1550. See Also
  1551.  
  1552. bord_GetWidth
  1553.  
  1554. Note
  1555.  
  1556. This routine is implemented as a macro.
  1557.  
  1558.  
  1559.  
  1560. bord_GetWidth                                              Get a border's width
  1561.  
  1562. ---------
  1563.  
  1564. Synopsis
  1565.  
  1566. int bord_GetWidth(border)
  1567.  
  1568.    win_type border;           the window which has the border
  1569.  
  1570. Description
  1571.  
  1572. This routine returns the width of win's border.  The width is specified in
  1573. character coordinates.  If the window has no border the height of the window is
  1574. returned.
  1575.  
  1576. Return Value
  1577.  
  1578. Returns the width of the border.
  1579.  
  1580. See Also
  1581.  
  1582. bord_GetHeight
  1583.  
  1584. Note
  1585.  
  1586. This routine is implemented as a macro.
  1587.  
  1588.  
  1589.  
  1590. bord_Paint                                      Repaint a window and its border
  1591.  
  1592. ---------
  1593.  
  1594. Synopsis
  1595.  
  1596. void bord_Paint(win)
  1597.  
  1598.    win_type win;              the window object
  1599.  
  1600. Description
  1601.  
  1602. This function causes all unobscured parts of a window, including its border to
  1603. be repainted on the display.  bord_Paint will no effect if the window has not
  1604. been employed first with win_Employ.
  1605.  
  1606. Return Value
  1607.  
  1608. There is no return value.
  1609.  
  1610. Note
  1611.  
  1612. This routine is implemented as a macro.
  1613.  
  1614. See Also
  1615.  
  1616. win_Paint
  1617.  
  1618.  
  1619.  
  1620. bord_SendMsg                                         Send a message to a border
  1621.  
  1622. ---------
  1623.  
  1624. Synopsis
  1625.  
  1626. void bord_SendMsg(win, msg, indata, outdata)
  1627.  
  1628.    win_type win;              the window object
  1629.    int msg;                the message
  1630.    VOID *indata;              incoming data
  1631.    VOID *outdata;             outgoing data
  1632.  
  1633. Description
  1634.  
  1635. This function sends the msg message to the border associated with win.  indata
  1636. and outdata are used to pass information to and from the border.  Whether
  1637. indata and outdata are used and what type of information is passed is specific
  1638. to the message sent.
  1639.  
  1640. Return Value
  1641.  
  1642. There is no return value.
  1643.  
  1644. Note
  1645.  
  1646. This routine is implemented as a macro.
  1647.  
  1648.  
  1649.  
  1650. bord_SetAttr                             Set the attribute of a window's border
  1651.  
  1652. ---------
  1653.  
  1654. Synopsis
  1655.  
  1656. void bord_SetAttr(win, attr)
  1657.  
  1658.    win_type win;              /* the window object */
  1659.    byte attr;                 /* the attribute of the border to set */
  1660.  
  1661. Description
  1662.  
  1663. This routine sets the window win's border attribute to attr.  The attribute
  1664. determines the foreground and background colors used to display the border, its
  1665. title, prompt, and any associated parts.  If the window has no border this
  1666. function does nothing.
  1667.  
  1668. Return Value
  1669.  
  1670. There is no return value.
  1671.  
  1672. Note
  1673.  
  1674. This routine is implemented as a macro.
  1675.  
  1676. See Also
  1677.  
  1678. bord_GetAttr
  1679.  
  1680.  
  1681.  
  1682. obj_DoAux                                    Call a object's auxiliary function
  1683.  
  1684. ---------
  1685.  
  1686. Synopsis
  1687.  
  1688. int obj_DoAux(obj, msg, indata, outdata);
  1689.  
  1690.    obj_type sed;                    the object
  1691.    int msg;                         the auxiliary message
  1692.    VOID *indata;                    pointer to incoming data
  1693.    VOID *outdata;                   pointer to outgoing data
  1694.  
  1695. Description
  1696.  
  1697. This routine calls the object's auxiliary function.  msg is an integer
  1698. specifying an action for the auxiliary function to perform.  indata is a
  1699. pointer to incoming data to be used by the auxiliary function.  outdata is a
  1700. pointer to outgoing data returned by the auxiliary function.  obj_DoAux does
  1701. nothing if the object has no auxiliary function.
  1702.  
  1703. The auxiliary function provides the programmer with additional control over the
  1704. operations of an object.
  1705.  
  1706. You can use obj_DoAux to send your own custom messages to an auxiliary
  1707. function.  Use the AUX_USER macro to define your message values:
  1708.  
  1709.     #define APPLICATION_AUX_MSG        AUX_USER(1)
  1710.  
  1711.     /* ... */
  1712.  
  1713.     obj_DoAux(obj, APPLICATION_AUX_MSG, NULL, NULL);
  1714.  
  1715.  
  1716. Return Value
  1717.  
  1718. Returns the value returned by the auxiliary function upon its completion.
  1719.  
  1720. See Also
  1721.  
  1722. obj_SetAux
  1723.  
  1724.  
  1725.  
  1726. obj_Find                                                 Find an object by name
  1727.  
  1728. ---------
  1729.  
  1730. Synopsis
  1731.  
  1732. obj_type obj_Find(name);
  1733.  
  1734.    char *name;                 the named object which you are seeking
  1735.  
  1736. Description
  1737.  
  1738. This function finds an object by name.
  1739.  
  1740. obj_Find returns a pointer to the named object, if found; NULL, otherwise.  You
  1741. can assign more that one object the same name but obj_Find returns a pointer to
  1742. only one of them.  If the name is not unique, it returns an object with the
  1743. specified name, but not necessarily any particular one.
  1744.  
  1745. Return Value
  1746.  
  1747. Returns a pointer to the named object, if found; NULL, otherwise.
  1748.  
  1749. Note
  1750.  
  1751.  
  1752.  
  1753. See Also
  1754.  
  1755. obj_SetName, obj_GetName
  1756.  
  1757.  
  1758.  
  1759. obj_SetAux                                  Attach an aux function to an object
  1760.  
  1761. ---------
  1762.  
  1763. Synopsis
  1764.  
  1765. void obj_SetAux(obj, fun);
  1766.  
  1767.    obj_type obj;                    object
  1768.    aux_fptr fun;                    auxiliary function
  1769.  
  1770. Description
  1771.  
  1772. This routine attaches the auxiliary function fun to the given object.  If fun
  1773. is NULL the object will have no auxiliary function.
  1774.  
  1775. The auxiliary function provides the programmer with additional control over the
  1776. operations of an object.
  1777.  
  1778. You can use obj_DoAux to send your own custom messages to an auxiliary
  1779. function.
  1780.  
  1781. All auxiliary functions must have the same form:
  1782.  
  1783. int aux_Sample(obj, msg, indata, outdata)
  1784.    obj_type sed;
  1785.    int msg;
  1786.    VOID *indata;
  1787.    VOID *outdata;
  1788. {
  1789.    switch(msg) {
  1790.          /* ... */
  1791.  
  1792.    }
  1793.  
  1794.    return(1);
  1795. }
  1796.  
  1797. Return Value
  1798.  
  1799. There is no return value.
  1800.  
  1801. Note
  1802.  
  1803. This routine is implemented as a macro.
  1804.  
  1805. See Also
  1806.  
  1807. obj_DoAux
  1808.  
  1809.  
  1810.  
  1811. obj_GetName                                           Get the name of an object
  1812.  
  1813. ---------
  1814.  
  1815. Synopsis
  1816.  
  1817. char *obj_GetName(obj);
  1818.  
  1819.    obj_type obj;                 the object
  1820.  
  1821. Description
  1822.  
  1823. This routine find the name of an object.
  1824.  
  1825. Return Value
  1826.  
  1827. Return a pointer to a null-terminated character arrary denoting the name of the
  1828. object, if found; NULL, if the object could not be found.
  1829.  
  1830. Note
  1831.  
  1832. See Also
  1833.  
  1834. obj_Find, obj_SetName
  1835.  
  1836.  
  1837.  
  1838. obj_SetName                                           Set the name of an object
  1839.  
  1840. ---------
  1841.  
  1842. Synopsis
  1843.  
  1844. void obj_SetName(obj, name);
  1845.  
  1846.    obj_type obj;                 the object to name
  1847.    char *name;                   the name
  1848.  
  1849. Description
  1850.  
  1851. obj_SetName names a object.  Use NULL for name to remove an object's name.
  1852.  
  1853. Note: obj_SetName returns an integer denoting a handle for the name of the
  1854. object.  This handle is an entry in an internal system list and is not
  1855. otherwise needed by the C-scape user.
  1856.  
  1857. Return Value
  1858.  
  1859. Returns a handle to the name in the internal object name list.
  1860.  
  1861. Note
  1862.  
  1863. When you name objects, their names go into an internal symbol list.  This list
  1864. is not closed by disp_Close or obj_Close.  If you want to release the storage
  1865. that this list uses, call the function oak_Close after calling disp_Close.  In
  1866. most cases, you do not need to call oak_Close.  It has the following prototype:
  1867.  
  1868.     void oak_Close(void);
  1869.  
  1870.  
  1871. See Also
  1872.  
  1873. obj_Find, obj_GetName
  1874.  
  1875.  
  1876.  
  1877. ocbox_clippos                              Get the clipping position of a point
  1878.  
  1879. ---------
  1880.  
  1881. Synopsis
  1882.  
  1883. unsigned ocbox_clippos(clipcboxp, rowp, colp);
  1884.  
  1885.    ocbox *clipcboxp;          the character box by which to clip
  1886.    int rowp;                  the point's row position
  1887.    int colp;                  the point's column position
  1888.  
  1889. Description
  1890.  
  1891. This routine returns a Sutherland-type clipcode that denotes where the point,
  1892. at location (rowp, colp), is in relation to the given character box clipcboxp.
  1893.  
  1894. A clipcode of 0 means the point is within the clipping box, i.e., is within or
  1895. on its boundaries.  Values other than 0 mean that the point is outside the
  1896. clipping box.  Further, if the clipcode is non-zero its value indicates to
  1897. which side(s) of the clipping box the point lies:
  1898.  
  1899.  
  1900.                   6               2               3
  1901.  
  1902.               (without,       (without,       (without,
  1903.              above-left)       above)       above-right)
  1904.  
  1905.                   4               0               1
  1906.  
  1907.               (without,       (within)        (without,
  1908.                 left)                          right)
  1909.  
  1910.                  12               8               9
  1911.  
  1912.               (without,       (without,       (without,
  1913.              below-left)       below)       below-right)
  1914.  
  1915.  
  1916.  
  1917. Return Value
  1918.  
  1919. Returns an unsigned integer denoting the point's position relative to the
  1920. character box.
  1921.  
  1922. Note
  1923.  
  1924.  
  1925.  
  1926. See Also
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932. ocbox_copy                                                 Copy a character box
  1933.  
  1934. ---------
  1935.  
  1936. Synopsis
  1937.  
  1938. ocbox *ocbox_copy(dcboxp, scboxp);
  1939.  
  1940.    ocbox *dcboxp;             the destination box (copy)
  1941.    ocbox *scboxp;             the source box (original)
  1942.  
  1943. Description
  1944.  
  1945. This routine copies the contents of scboxp into dcboxp.  Both dcboxp and scboxp
  1946. point to boxes that are declared by the programmer prior to the call.  The
  1947. boxes are specified in character units.
  1948.  
  1949. Return Value
  1950.  
  1951. Returns a pointer to the copy of the character box, dcboxp.
  1952.  
  1953. Note
  1954.  
  1955. This routine is implemented as a macro.
  1956.  
  1957. See Also
  1958.  
  1959. opbox_copy
  1960.  
  1961.  
  1962.  
  1963. ocbox_equal                                         Compare two character boxes
  1964.  
  1965. ---------
  1966.  
  1967. Synopsis
  1968.  
  1969. boolean ocbox_equal(cboxp1, cboxp2);
  1970.  
  1971.    ocbox *cboxp1;             pointer to box specified in character units
  1972.    ocbox *cboxp2;             pointer to box specified in character units
  1973.  
  1974. Description
  1975.  
  1976. This routine compares the two given boxes and determines if they are equal.
  1977. The box is given in character units.  The boxes are equal if the xmin, ymin,
  1978. xmax and ymax of the respective boxes are equal.
  1979.  
  1980. You may use ocbox_equal to determine whether two boxes coincide on the display
  1981. or whether they are simply of the same dimensions.
  1982.  
  1983. Return Value
  1984.  
  1985. Returns TRUE if cboxp1 and cboxp2 are equal; FALSE, otherwise.
  1986.  
  1987. Note
  1988.  
  1989.  
  1990.  
  1991. See Also
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997. ocbox_GetHeight                               Get the height of a character box
  1998.  
  1999. ---------
  2000.  
  2001. Synopsis
  2002.  
  2003. int ocbox_GetHeight(cboxp);
  2004.  
  2005.    ocbox *cboxp;              pointer to box specified in character units
  2006.  
  2007. Description
  2008.  
  2009. This routine returns the height of cboxp.  Both the box and its height are
  2010. specified in character units.
  2011.  
  2012. Return Value
  2013.  
  2014. Returns a integer value denoting the height of the character box.
  2015.  
  2016. Note
  2017.  
  2018. This routine is implemented as a macro.
  2019.  
  2020. See Also
  2021.  
  2022. ocbox_GetWidth, opbox_GetHeight, opbox_GetWidth
  2023.  
  2024.  
  2025.  
  2026. ocbox_GetWidth                                 Get the width of a character box
  2027.  
  2028. ---------
  2029.  
  2030. Synopsis
  2031.  
  2032. int ocbox_GetWidth(cboxp);
  2033.  
  2034.    ocbox *cboxp;              pointer to box specified in character units
  2035.  
  2036. Description
  2037.  
  2038. This routine returns the width of cboxp.  Both the box and its width are
  2039. specified in character units.
  2040.  
  2041. Return Value
  2042.  
  2043. Returns an integer value denoting the width of the character box.
  2044.  
  2045. Note
  2046.  
  2047. This routine is implemented as a macro.
  2048.  
  2049. See Also
  2050.  
  2051. ocbox_GetHeight, opbox_GetWidth, opbox_GetHeight
  2052.  
  2053.  
  2054.  
  2055. ocbox_pixcoords                          Convert a pixel box to a character box
  2056.  
  2057. ---------
  2058.  
  2059. Synopsis
  2060.  
  2061. void ocbox_pixcoords(cboxp, font, boxp);
  2062.  
  2063.    ocbox *cboxp;              the character box to convert
  2064.    ofont_type font;           the font to use in the conversion
  2065.    opbox *boxp;               the pixel box result
  2066.  
  2067. Description
  2068.  
  2069. This routine takes the character box pointed to by cboxp and supplies its pixel
  2070. box equivalent in boxp, given the font.  The font determines the character to
  2071. pixel ratio.
  2072.  
  2073. Both cboxp and boxp are pointers to boxes declared by the programmer prior to
  2074. the call.  The contents of the box to which boxp points will be altered to
  2075. contain the results of the conversion.
  2076.  
  2077. Return Value
  2078.  
  2079. There is no return value.
  2080.  
  2081. Note
  2082.  
  2083.  
  2084.  
  2085. See Also
  2086.  
  2087. win_GetFont, win_GetFontHeight, win_GetFontWidth, opcoord_GetXCol,
  2088. opcoord_GetYRow, opcoord_GridRound
  2089.  
  2090.  
  2091.  
  2092. ocbox_set                                                   Set a character box
  2093.  
  2094. ---------
  2095.  
  2096. Synopsis
  2097.  
  2098. ocbox *ocbox_set(cboxp, toprow, leftcol, bottomrow, rightcol);
  2099.  
  2100.    ocbox *cboxp;              a pointer to the box to set
  2101.    int toprow;                the box position
  2102.    int leftcol;
  2103.    int bottomrow;
  2104.    int rightcol;
  2105.  
  2106. Description
  2107.  
  2108. This routine sets the character box cboxp with the given values toprow,
  2109. leftcol, bottomrow, and rightcol.  cboxp points to a character box declared by
  2110. the programmer prior to the call.  The box delimits a rectangular area by
  2111. defining the location of its four sides.
  2112.  
  2113. Return Value
  2114.  
  2115. Returns a pointer to the box that was set, cboxp.
  2116.  
  2117. Note
  2118.  
  2119. This routine is implemented as a macro.
  2120.  
  2121. See Also
  2122.  
  2123. opbox_set
  2124.  
  2125.  
  2126.  
  2127. ocbox_trans                                           Translate a character box
  2128.  
  2129. ---------
  2130.  
  2131. Synopsis
  2132.  
  2133. ocboxp *ocbox_trans(cboxp, rowd, cold);
  2134.  
  2135.    ocbox *cboxp;              the character box to translate
  2136.    int rowd;                  the row displacement
  2137.    int cold;                  the column displacement
  2138.  
  2139. Description
  2140.  
  2141. This routine translates the character box cboxp by the displacements rowd and
  2142. cold.  The translation reflects a change in the box's position effected by the
  2143. addition of the the displacements to its current position.
  2144.  
  2145. Return Value
  2146.  
  2147. A pointer to a character box is returned - the same pointer passed in as cboxp.
  2148.  
  2149. Note
  2150.  
  2151. This routine is implemented as a macro.
  2152.  
  2153. See Also
  2154.  
  2155. opbox_trans
  2156.  
  2157.  
  2158.  
  2159. opbox_copy                                                     Copy a pixel box
  2160.  
  2161. ---------
  2162.  
  2163. Synopsis
  2164.  
  2165. opbox *opbox_copy (dboxp, sboxp);
  2166.  
  2167.    opbox *dboxp;              the destination box (copy)
  2168.    opbox *sboxp;              the source box (original)
  2169.  
  2170. Description
  2171.  
  2172. This routine copies the contents of sboxp into dboxp.  Both sboxp and dcboxp
  2173. point to boxes that are declared by the programmer prior to the call.  The
  2174. boxes are specified in pixel units.
  2175.  
  2176. Return Value
  2177.  
  2178. Returns a pointer to the copy of the pixel box, dboxp.
  2179.  
  2180. Note
  2181.  
  2182. This routine is implemented as a macro.
  2183.  
  2184. See Also
  2185.  
  2186. ocbox_copy
  2187.  
  2188.  
  2189.  
  2190. opbox_GetHeight                                   Get the height of a pixel box
  2191.  
  2192. ---------
  2193.  
  2194. Synopsis
  2195.  
  2196. opcoord opbox_GetHeight(boxp);
  2197.  
  2198.    oboxp *boxp;               pointer to a pixel box
  2199.  
  2200. Description
  2201.  
  2202. This routine returns the height of boxp.  Both the box and its height are
  2203. specified in pixel units.
  2204.  
  2205. Return Value
  2206.  
  2207. Returns an value denoting the height of the pixel box.
  2208.  
  2209. Note
  2210.  
  2211. This routine is implemented as a macro.
  2212.  
  2213. See Also
  2214.  
  2215. opbox_GetWidth, ocbox_GetHeight, ocbox_GetWidth
  2216.  
  2217.  
  2218.  
  2219. opbox_GetWidth                                     Get the width of a pixel box
  2220.  
  2221. ---------
  2222.  
  2223. Synopsis
  2224.  
  2225. opcoord opbox_GetWidth(boxp)
  2226.  
  2227.    oboxp *boxp;               pointer to a pixel box
  2228.  
  2229. Description
  2230.  
  2231. This routine returns the width of boxp.  Both the box and its width are
  2232. specified in pixel units.
  2233.  
  2234. Return Value
  2235.  
  2236. Returns an value denoting the width of the pixel box.
  2237.  
  2238. Note
  2239.  
  2240. This routine is implemented as a macro.
  2241.  
  2242. See Also
  2243.  
  2244. opbox_GetHeight, ocbox_GetWidth, ocbox_GetHeight
  2245.  
  2246.  
  2247.  
  2248. opbox_set                                                       Set a pixel box
  2249.  
  2250. ---------
  2251.  
  2252. Synopsis
  2253.  
  2254. opbox *opbox_set(boxp, xmin, ymin, xmax, ymax);
  2255.  
  2256.    opbox *boxp;               a  pointer to the box to set
  2257.    opcoord xmin;              the box position
  2258.    opcoord ymin;
  2259.    opcoord xmax;
  2260.    opcoord ymax;
  2261.  
  2262. Description
  2263.  
  2264. This routine sets the pixel box boxp with the given values xmin, ymin, xmax,
  2265. and ymax.  boxp points to a pixel box declared by the programmer prior to th
  2266. call.  The box delimits a rectangular area by defining the location of its four
  2267. sides.
  2268.  
  2269. Return Value
  2270.  
  2271. Returns a pointer to the box that was set, boxp.
  2272.  
  2273. Note
  2274.  
  2275. This routine is implemented as a macro.
  2276.  
  2277. See Also
  2278.  
  2279. ocbox_set
  2280.  
  2281.  
  2282.  
  2283. opbox_trans                                               Translate a pixel box
  2284.  
  2285. ---------
  2286.  
  2287. Synopsis
  2288.  
  2289. opbox *opbox_trans(boxp, xdisp, ydisp);
  2290.  
  2291.    opboxp *boxp;              the pixel box to translate
  2292.    opcoord xdisp;             the x axis displacement
  2293.    opcoord ydisp;             the y axis displacement
  2294.  
  2295. Description
  2296.  
  2297. This routine translates the pixel box boxp by the displacements xdisp and
  2298. ydisp.  The translation reflects a change in the box's position effected by the
  2299. addition of the the displacements to its current position.
  2300.  
  2301. Return Value
  2302.  
  2303. A pointer to a pixel box is returned - the same pointer passed in as boxp.
  2304.  
  2305. Note
  2306.  
  2307. This routine is implemented as a macro.
  2308.  
  2309. See Also
  2310.  
  2311. ocbox_trans
  2312.  
  2313.  
  2314.  
  2315. opcoord_GetXCol                          Get character column for pixel x coord
  2316.  
  2317. ---------
  2318.  
  2319. Synopsis
  2320.  
  2321. int opcoord_GetXCol(x, font);
  2322.  
  2323.    opcoord x;              the pixel x coordinate
  2324.    ofont_type font;        the reference font
  2325.  
  2326. Description
  2327.  
  2328. This routine gets the character column in which the pixel x coordinate lays.
  2329. That is, the pixel coordinate is rounded down to the nearest character
  2330. coordinate, given the font.
  2331.  
  2332. Return Value
  2333.  
  2334. Returns a value denoting a character column position.
  2335.  
  2336. Note
  2337.  
  2338.  
  2339.  
  2340. See Also
  2341.  
  2342. win_GetFont, win_GetFontHeight, win_GetFontWidth, opcoord_GetYRow,
  2343. ocbox_pixcoords
  2344.  
  2345.  
  2346.  
  2347. opcoord_GetYRow                             Get character row for pixel y coord
  2348.  
  2349. ---------
  2350.  
  2351. Synopsis
  2352.  
  2353. int  opcoord_GetYRow(y, font);
  2354.  
  2355.    opcoord y;              the pixel y coordinate
  2356.    ofont_type font;        the reference font
  2357.  
  2358. Description
  2359.  
  2360. This routine gets the character row in which the pixel y coordinate lays.  That
  2361. is, the pixel coordinate is rounded down to the nearest character coordinate,
  2362. given the font.
  2363.  
  2364. Return Value
  2365.  
  2366. Returns a value denoting a character coordinate row position.
  2367.  
  2368. Note
  2369.  
  2370.  
  2371.  
  2372. See Also
  2373.  
  2374. win_GetFont, win_GetFontHeight, win_GetFontWidth, opcoord_GetXCol,
  2375. ocbox_pixcoords
  2376.  
  2377.  
  2378.  
  2379. opcoord_GridRound                        Rounds pixel position to text boundary
  2380.  
  2381. ---------
  2382.  
  2383. Synopsis
  2384.  
  2385. void opcoord_GridRound(xp, yp, font)
  2386.  
  2387.    opcoord *xp;               the pixel x coordinate
  2388.    opcoord *yp;               the pixel y coordinate
  2389.    ofont_type font;           the reference font
  2390.  
  2391. Description
  2392.  
  2393. This routine rounds the pixel coordinates (*xp, *yp) down to the nearest
  2394. character coordinate, given the font.
  2395.  
  2396. Return Value
  2397.  
  2398. There is no return value.
  2399.  
  2400. Note
  2401.  
  2402.  
  2403.  
  2404. See Also
  2405.  
  2406. win_GetFont, win_GetFontHeight, win_GetFontWidth, opcoord_GetXCol,
  2407. opcoord_GetYRow, ocbox_pixcoords
  2408.  
  2409.  
  2410.  
  2411. ptd_Clear                                    Clear a paint rectangle to a color
  2412.  
  2413. ---------
  2414.  
  2415. Synopsis
  2416.  
  2417. void ptd_Clear(ptd, color);
  2418.  
  2419.     ptd_struct *ptd;            paint data
  2420.     opixval color;              color to which to clear
  2421.  
  2422. Description
  2423.  
  2424. This function clears the rectangular area of the display described by the ptd
  2425. to the given color.
  2426.  
  2427. A ptd_struct contains the following elements:
  2428.  
  2429.     win        The window that holds the area to be painted.
  2430.  
  2431.     relboxp    A pointer to an opbox that describes the rectangle to be
  2432.                painted.  The coordinates of the opbox are relative to the
  2433.                window.
  2434.  
  2435.     emsgdata   Extra message data used by the OWL to handle window scrolling.
  2436.  
  2437.  
  2438.  
  2439. Return Value
  2440.  
  2441. There is no return value
  2442.  
  2443. Note
  2444.  
  2445. opixval is an Oakland data type denoting an index into the system (hardware)
  2446. color palette.  It is currently defined to be an unsigned integer.  The
  2447. resulting color is dependent on the palette.
  2448.  
  2449. See Also
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455. ptd_SetInner                                  Clip a ptd to the window interior
  2456.  
  2457. ---------
  2458.  
  2459. Synopsis
  2460.  
  2461. void ptd_SetInner(ptd, inptd, inboxp);
  2462.  
  2463.     ptd_struct *ptd;            paint data
  2464.     ptd_struct *inptd;          inner paint data return argument
  2465.     opbox *inboxp;              clipped box return argument
  2466.  
  2467. Description
  2468.  
  2469. This function clips away any of the border area included in the opbox of ptd to
  2470. within the ptd window's inner box.
  2471.  
  2472. This function copies ptd to inptd and sets inptd->relboxp to inboxp.  The
  2473. inboxp box is clipped the relbox of ptd and places the result in the inboxp
  2474. box.  inptd->relboxp points to inboxp.  The relbox of ptd is unaffected.
  2475.  
  2476. A ptd_struct contains the following elements:
  2477.  
  2478.     win        The window that holds the area to be painted.
  2479.  
  2480.     relboxp    A pointer to an opbox that describes the rectangle to be
  2481.                painted.  The coordinates of the opbox are relative to the
  2482.                window.
  2483.  
  2484.     emsgdata   Extra message data used by the OWL to handle window scrolling.
  2485.  
  2486.  
  2487.  
  2488. Return Value
  2489.  
  2490. Returns FALSE if the resulting relbox is empty; TRUE, otherwise.
  2491.  
  2492. Note
  2493.  
  2494. opixval is an Oakland data type denoting an index into the system (hardware)
  2495. color palette.  It is currently defined to be an unsigned integer.  The
  2496. resulting color is dependent on the palette.
  2497.  
  2498. See Also
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504. win_ClassInit                             Initialize the window request handler
  2505.  
  2506. ---------
  2507.  
  2508. Synopsis
  2509.  
  2510. void win_ClassInit();
  2511.  
  2512. Description
  2513.  
  2514. This routine initializes the request handler for the basic window class to
  2515. enable support for mouse functions.  The handler affects windows of win_Class,
  2516. and all borders.  It permits them to respond to mouse messages that pertain to
  2517. scrolling, re-sizing, and dragging.
  2518.  
  2519. You only need to call this routine if you want to use the mouse with basic
  2520. windows.  It is not necessary if you are not using the mouse--a null handler is
  2521. used by default.
  2522.  
  2523. Please note, if you have called sedwin_ClassInit for use with C-scape seds,
  2524. then you need not call this function.
  2525.  
  2526. Return Value
  2527.  
  2528. There is no return value.
  2529.  
  2530. See Also
  2531.  
  2532. hard_InitMouse
  2533.  
  2534.  
  2535.  
  2536. win_Close                                                        Close a window
  2537.  
  2538. ---------
  2539.  
  2540. Synopsis
  2541.  
  2542. win_type win_Close(winclass);
  2543.    win_type win;                       the window object
  2544.  
  2545. Description
  2546.  
  2547. This routine closes the window and releases any storage it used.  The window
  2548. cannot be used after it has been closed.
  2549.  
  2550. If the window is employed, win_Close fires it and removes the window's image
  2551. from the display.
  2552.  
  2553. win_Close releases all the storage used by the objects attached to the window.
  2554.  
  2555. Return Value
  2556.  
  2557. There is no return value.
  2558.  
  2559. See Also
  2560.  
  2561. win_Open
  2562.  
  2563.  
  2564.  
  2565. win_CreateBob                                            Make a bob of a window
  2566.  
  2567. ---------
  2568.  
  2569. Synopsis
  2570.  
  2571. bob_type win_Open(win, mode);
  2572.    win_type win;                       the window
  2573.    int mode;                       the dependence flag
  2574.  
  2575. Description
  2576.  
  2577. This routine creates a bob object from a window.
  2578.  
  2579. Bobs (basic objects provide a standard interface to a number of different
  2580. objects.  Bobs are create from objects, such as windows, that you can place
  2581. onto the display and activate.
  2582.  
  2583. The mode argument can have one of the following values BOB_DEPENDENT or
  2584. BOB_INDEPENDENT.
  2585.  
  2586. Bobs allow you to create complex screens consisting of various screen types
  2587. working in concert.  This allows you to nest windows (or seds) within seds.
  2588. Any C-scape field can contain a handle to a bob object.
  2589.  
  2590. Once you have created a bob from a window, you can use the bob_ functions to
  2591. control it.
  2592.  
  2593. Return Value
  2594.  
  2595. Returns the bob object created from the window or NULL if the bob object cannot
  2596. be created.
  2597.  
  2598. See Also
  2599.  
  2600. bob_Go, sed_GetFieldBob
  2601.  
  2602.  
  2603.  
  2604. win_Employ                                                      Employ a window
  2605.  
  2606. ---------
  2607.  
  2608. Synopsis
  2609.  
  2610. boolean win_Employ(win);
  2611.    win_type win;                   the window object
  2612.  
  2613. Description
  2614.  
  2615. This routine places an unemployed window win at the top of the employed list
  2616. and paints it to the display.  The display area over which the window will be
  2617. placed is saved if there is a background grwin window.  If the window is
  2618. already employed it does nothing and returns TRUE.
  2619.  
  2620. If the window's user paint flag has been set, the window's auxiliary function
  2621. receives the WINA_PAINT and WINA_SHADOW messages.  These messages are sent to
  2622. the auxiliary function after the object class has performed its normal painting
  2623. action.
  2624.  
  2625. The only window class that performs no default painting is the userwin_Class.
  2626. For this window type, the auxiliary message must handle all painting.
  2627.  
  2628. Return Value
  2629.  
  2630. Returns TRUE if it is successful at employing the window and FALSE if the
  2631. window is NULL.
  2632.  
  2633. See Also
  2634.  
  2635. win_UnEmploy, win_Paint, win_SetUserPaint, win_IsUserPaint
  2636.  
  2637.  
  2638.  
  2639. win_GetAttr                                            Get a window's attribute
  2640.  
  2641. ---------
  2642.  
  2643. Synopsis
  2644.  
  2645. byte win_GetAttr(win)
  2646.  
  2647.    win_type win;              the window object
  2648.  
  2649. Description
  2650.  
  2651. This routine gets the foreground/background color combination attribute
  2652. associated with the given window.
  2653.  
  2654. Return Value
  2655.  
  2656. Returns a byte value denoting the window's foreground/background attribute.
  2657.  
  2658. Note
  2659.  
  2660. This routine is implemented as a macro.
  2661.  
  2662.  
  2663.  
  2664. win_GetBox                                         Get a window's character box
  2665.  
  2666. ---------
  2667.  
  2668. Synopsis
  2669.  
  2670. void win_GetBox(win, cboxp)
  2671.  
  2672.    win_type win;              the window object
  2673.    ocbox *cboxp;              pointer to box specified in character units
  2674.  
  2675. Description
  2676.  
  2677. This routine puts the character coordinates of the box occupied by the given
  2678. window in the character box pointed to by cboxp.  The coordinates are relative
  2679. to the window.
  2680.  
  2681. Return Value
  2682.  
  2683. There is no return value.
  2684.  
  2685. Note
  2686.  
  2687. This routine is implemented as a macro.
  2688.  
  2689. See Also
  2690.  
  2691. win_GetPixBox, win_GetPosition, win_GetPixPosition
  2692.  
  2693.  
  2694.  
  2695. win_GetData                               Get the window's generic data pointer
  2696.  
  2697. ---------
  2698.  
  2699. Synopsis
  2700.  
  2701. VOID *win_GetData(win);
  2702.  
  2703.   win_type win;             the window object
  2704.  
  2705. Description
  2706.  
  2707. This routine returns the window's generic data pointer.  The generic data
  2708. pointer is a VOID * pointer that you can use for attaching program-specific
  2709. data to a window.
  2710.  
  2711. Return Value
  2712.  
  2713. Returns the generic data pointer of the window.  The generic data pointer is a
  2714. VOID * pointer.  Use a type cast to convert it to a different type if
  2715. necessary.
  2716.  
  2717. Note
  2718.  
  2719. This routine is implemented as a macro.
  2720.  
  2721. See Also
  2722.  
  2723. win_SetData
  2724.  
  2725.  
  2726.  
  2727. win_GetFont                                               Get the window's font
  2728.  
  2729. ---------
  2730.  
  2731. Synopsis
  2732.  
  2733. ofont_type win_GetFont(win);
  2734.  
  2735.   win_type win;             the window object
  2736.  
  2737. Description
  2738.  
  2739. This routine gets a pointer to an ofont_struct describing the window's font.
  2740.  
  2741. Return Value
  2742.  
  2743. Returns an ofont_type corrsponding to the window's font.
  2744.  
  2745. Note
  2746.  
  2747. This routine is implemented as a macro.
  2748.  
  2749. See Also
  2750.  
  2751. win_GetFontHeight, win_GetFontWidth, ofont_GetHeight, ofont_GetWidth,
  2752.  
  2753.  
  2754.  
  2755. win_GetExplodeFptr                            Get the window's explode function
  2756.  
  2757. ---------
  2758.  
  2759. Synopsis
  2760.  
  2761. exp_fptr win_GetExplodeFptr(win)
  2762.    win_type win;                   the window object
  2763.  
  2764. Description
  2765.  
  2766. This function retrieves a pointer to the explode function of a window.  If
  2767. there is no explode function it returns FNULL.
  2768.  
  2769. Return Value
  2770.  
  2771. Returns a pointer to the window's explode function; FNULL, if no explode
  2772. function exists.
  2773.  
  2774. Note
  2775.  
  2776. This routine is implemented as a macro.
  2777.  
  2778. See Also
  2779.  
  2780. win_SetExplode
  2781.  
  2782.  
  2783.  
  2784. win_GetFontHeight                                  Get the window's font height
  2785.  
  2786. ---------
  2787.  
  2788. Synopsis
  2789.  
  2790. opcoord win_GetFontHeight(wint);
  2791.  
  2792.    win_type win;              the window object
  2793.  
  2794. Description
  2795.  
  2796. This routine gets the height of the window's font, in pixels.
  2797.  
  2798. Pixel coordinates are based the number of pixels on the display, which depends
  2799. on the display's video adaptor and display mode.  A pixel is the smallest
  2800. addressable picture element.  For example, a graphics display might measure
  2801. 320 pixels wide and 200 pixels tall.  On a text based display, a character is
  2802. considered to be 1 pixel wide and 1 pixel tall.
  2803.  
  2804. Character coordinates are ints while pixel coordinates are opcoords.  opcoords
  2805. are an Oakland data type; they are signed integers.
  2806.  
  2807. Return Value
  2808.  
  2809. Returns of value denoting the height of the given font, in pixels.
  2810.  
  2811. Note
  2812.  
  2813. This routine is implemented as a macro.
  2814.  
  2815. See Also
  2816.  
  2817. win_GetFontWidth
  2818.  
  2819. win_GetFontWidth                                    Get the window's font width
  2820.  
  2821. ---------
  2822.  
  2823. Synopsis
  2824.  
  2825. opcoord win_GetFontWidth(wint);
  2826.  
  2827.    win_type win;              the window object
  2828.  
  2829. Description
  2830.  
  2831. This routine gets the width of the window's font, in pixels.
  2832.  
  2833. Pixel coordinates are based the number of pixels on the display, which depends
  2834. on the display's video adaptor and display mode.  A pixel is the smallest
  2835. addressable picture element.  For example, a graphics display might measure
  2836. 320 pixels wide and 200 pixels tall.  On a text based display, a character is
  2837. considered to be 1 pixel wide and 1 pixel tall.
  2838.  
  2839. Character coordinates are ints while pixel coordinates are opcoords.  opcoords
  2840. are an Oakland data type; they are signed integers.
  2841.  
  2842. Return Value
  2843.  
  2844. Returns of value denoting the width of the given font, in pixels.
  2845.  
  2846. Note
  2847.  
  2848. This routine is implemented as a macro.
  2849.  
  2850. See Also
  2851.  
  2852. win_GetFontHeight
  2853.  
  2854. win_GetHeight                                   Get a window's character height
  2855.  
  2856. ---------
  2857.  
  2858. Synopsis
  2859.  
  2860. int win_GetHeight(win)
  2861.  
  2862.    win_type win;              the window object
  2863.  
  2864. Description
  2865.  
  2866. Gets the height of the given window, measured in character units.
  2867.  
  2868. Return Value
  2869.  
  2870. Returns an integer value denoting height in character units.
  2871.  
  2872. Note
  2873.  
  2874. This routine is implemented as a macro.
  2875.  
  2876. See Also
  2877.  
  2878. win_GetPixHeight, win_GetWidth, win_GetPixWidth
  2879.  
  2880.  
  2881.  
  2882. win_GetPixBox                                        Get the window's pixel box
  2883.  
  2884. ---------
  2885.  
  2886. Synopsis
  2887.  
  2888. void win_GetPixBox(win, boxp)
  2889.  
  2890.    win_type win;              the window object
  2891.    opbox *boxp;               the pixel box we want
  2892.  
  2893. Description
  2894.  
  2895. This routine puts the coordinates of the window's upper left and lower right
  2896. corners in the given box.  The coordinates are relative to the window, i.e.,
  2897. the upper left corner is at (0,0) and are specified in pixel units.
  2898.  
  2899. Return Value
  2900.  
  2901. There is no return value.
  2902.  
  2903. Note
  2904.  
  2905. This routine is implemented as a macro.
  2906.  
  2907. See Also
  2908.  
  2909. win_GetBox, win_GetPosition, win_GetPixPosition
  2910.  
  2911.  
  2912.  
  2913. win_GetPixHeight                                    Get a window's pixel height
  2914.  
  2915. ---------
  2916.  
  2917. Synopsis
  2918.  
  2919. opcoord win_GetPixHeight(win)
  2920.  
  2921.    win_type win;              the window object
  2922.  
  2923. Description
  2924.  
  2925. Gets the height of the given window, measured in pixel units.
  2926.  
  2927. Return Value
  2928.  
  2929. Returns an integer value denoting height in pixel units.
  2930.  
  2931. Note
  2932.  
  2933. This routine is implemented as a macro.
  2934.  
  2935. See Also
  2936.  
  2937. win_GetHeight, win_GetWidth, win_GetPixWidth
  2938.  
  2939.  
  2940.  
  2941. win_GetPixPosition                              Get a window's display position
  2942.  
  2943. ---------
  2944.  
  2945. Synopsis
  2946.  
  2947. void win_GetPixPosition(win, opboxp)
  2948.  
  2949.    win_type win;              the window object
  2950.    opbox *opboxp;             pointer to a box specified in pixel units
  2951.  
  2952. Description
  2953.  
  2954. This routine puts the coordinates of the window's upper left and lower right
  2955. corners in the given box.  The coordinates are relative to the display and are
  2956. specified in pixel units.
  2957.  
  2958. Return Value
  2959.  
  2960. There is no return value.
  2961.  
  2962. Note
  2963.  
  2964.  
  2965.  
  2966. See Also
  2967.  
  2968. win_GetPosition, win_GetBox, win_GetPixBox
  2969.  
  2970.  
  2971.  
  2972. win_GetPixWidth                                      Get a window's pixel width
  2973.  
  2974. ---------
  2975.  
  2976. Synopsis
  2977.  
  2978. opcoord win_GetPixWidth(win)
  2979.  
  2980.    win_type win;              the window object
  2981.  
  2982. Description
  2983.  
  2984. Gets the width of the given window, measured in pixel units.
  2985.  
  2986. Return Value
  2987.  
  2988. Returns an integer value denoting width in pixel units.
  2989.  
  2990. Note
  2991.  
  2992. This routine is implemented as a macro.
  2993.  
  2994. See Also
  2995.  
  2996. win_GetWidth, win_GetHeight, win_GetPixHeight
  2997.  
  2998.  
  2999.  
  3000. win_GetPosition                                 Get a window's display position
  3001.  
  3002. ---------
  3003.  
  3004. Synopsis
  3005.  
  3006. void win_GetPosition(win, cboxp)
  3007.  
  3008.    win_type win;              the window object
  3009.    ocbox *cboxp;              pointer to box specified in character units
  3010.  
  3011. Description
  3012.  
  3013. This routine puts the coordinates of the window's upper left and lower right
  3014. corners in the given box.  The coordinates are relative to the display and are
  3015. specified in character units.
  3016.  
  3017. Return Value
  3018.  
  3019. There is no return value.
  3020.  
  3021. See Also
  3022.  
  3023. win_GetPixPosition, win_GetBox, win_GetPixBox
  3024.  
  3025.  
  3026.  
  3027. win_GetWidth                                     Get a window's character width
  3028.  
  3029. ---------
  3030.  
  3031. Synopsis
  3032.  
  3033. int win_GetWidth(win)
  3034.  
  3035.    win_type win;              the window object
  3036.  
  3037. Description
  3038.  
  3039. Gets the width of the given window, measured in character units.
  3040.  
  3041. Return Value
  3042.  
  3043. Returns an integer value denoting width in character units.
  3044.  
  3045. Note
  3046.  
  3047. This routine is implemented as a macro.
  3048.  
  3049. See Also
  3050.  
  3051. win_GetPixWidth, win_GetHeight, win_GetPixHeight
  3052.  
  3053.  
  3054.  
  3055. win_GetXmax - win_GetYmin                                  Get the window edges
  3056.  
  3057. ---------
  3058.  
  3059. Synopsis
  3060.  
  3061. opcoord win_GetXmax(win)
  3062.  
  3063. opcoord win_GetYmax(win)
  3064.  
  3065. opcoord win_GetXmin(win)
  3066.  
  3067. opcoord win_GetXmax(win)
  3068.  
  3069.    win_type win;              the window object
  3070.  
  3071. Description
  3072.  
  3073. These routines calculate the extent of a window exclusive of its associated
  3074. border, if any, and return a display-relative pixel coordinate for the
  3075. requested edge.
  3076.  
  3077. Return Value
  3078.  
  3079. Returns the coordinate of the appropriate edge of the window.  The coordinate
  3080. reference is relative to the display frame.
  3081.  
  3082. Note
  3083.  
  3084. This routine is implemented as a macro.
  3085.  
  3086. See Also
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092. win_Go                                                           Go on a window
  3093.  
  3094. ---------
  3095.  
  3096. Synopsis
  3097.  
  3098. int win_Go(win)
  3099.  
  3100.    win_type win;              the window object
  3101.  
  3102. Description
  3103.  
  3104. Transfers control the window's user interaction function and any windows to
  3105. which it may pass control.
  3106.  
  3107. seds and sleds have built-in user interaction functions.  Objects of all other
  3108. windows have no built-in function; they send the WINA_GO message to the
  3109. window's auxiliary function, if any, so that the auxiliary function may control
  3110. the interaction.
  3111.  
  3112. Return Value
  3113.  
  3114. Returns an integer value.  This value is determined by the window's go
  3115. function.  For seds, the return value is the sed baton.  For other windows, the
  3116. return value of the auxiliary function that processes the WINA_GO message is
  3117. the return value.
  3118.  
  3119. Note
  3120.  
  3121. This routine is implemented as a macro.
  3122.  
  3123. See Also
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129. win_IsUserPaint                            Get the state of the user paint flag
  3130.  
  3131. ---------
  3132.  
  3133. Synopsis
  3134.  
  3135. boolean void win_IsUserPaint(win);
  3136.  
  3137.     win_type win;               window
  3138.  
  3139. Description
  3140.  
  3141. This routine reports whether the window's user paint flag is set.  If the paint
  3142. flag is set, then the Window Manager window's sends the window's auxiliary
  3143. function WINA_PAINT and WINA_SHADOW messages.
  3144.  
  3145. Only userwins have their user paint flag set by default.  You can alter the
  3146. setting of the flag by calling win_SetUserPaint.
  3147.  
  3148. Return Value
  3149.  
  3150. Returns a TRUE if the the user paint is enabled; FALSE, otherwise.
  3151.  
  3152. Note
  3153.  
  3154. This routine is implemented as a macro.
  3155.  
  3156. See Also
  3157.  
  3158. win_SetUserPaint
  3159.  
  3160.  
  3161.  
  3162. win_Open                                                    Create a new window
  3163.  
  3164. ---------
  3165.  
  3166. Synopsis
  3167.  
  3168. win_type win_Open(winclass, wcboxp);
  3169.    class_fptr winclass;                the window object class
  3170.    ocbox *wcboxp;                      starting size of the window
  3171.  
  3172. Description
  3173.  
  3174. This routine creates a window object of class winclass.  The starting size and
  3175. position (in character-based display coordinates) is specified by the ocbox
  3176. wcboxp.  The window is opened with the default system font.  The window is
  3177. placed in the unemployed window list.  You can employ the window and paint it
  3178. on the display with a call to win_Employ and destroy it with a call to
  3179. win_Close.
  3180.  
  3181. An ocbox is a structure with four members that describes a rectangular area:
  3182. leftcol, rightcol, botrow, toprow.  Each member is an int.
  3183.  
  3184. For windows of cmwin_Class and grwin_Class the ocbox determines the size the
  3185. window's associated cmap or pmap, respectively.  For those of pmwin_Class, the
  3186. ocbox determines only the starting size of the window.  A pmap for a pmwin is
  3187. allocated separately by pmap_Open; attached to the window with pmwin_SetPmap.
  3188.  
  3189. Return Value
  3190.  
  3191. Returns a pointer to the newly created window or NULL if unsuccessful.
  3192.  
  3193. Note
  3194.  
  3195. This routine is implemented as a macro.
  3196.  
  3197. See Also
  3198.  
  3199. win_Close, win_Employ, win_PixOpen
  3200.  
  3201.  
  3202.  
  3203. win_Paint                                                      Repaint a window
  3204.  
  3205. ---------
  3206.  
  3207. Synopsis
  3208.  
  3209. void win_Paint(win);
  3210.    win_type win;              the window object
  3211.  
  3212. Description
  3213.  
  3214. This routine paints all unobscured portions of the given window, excluding its
  3215. border.  win_Paint will no effect if the window has not been employed first
  3216. with win_Employ.
  3217.  
  3218. If the window's user paint flag has been set, the window's auxiliary function
  3219. receives the WINA_PAINT and WINA_SHADOW messages.  These messages are sent to
  3220. the auxiliary function after the object class has performed its normal painting
  3221. action.
  3222.  
  3223. The only window class that performs no default painting is the userwin_Class.
  3224. For this window type, the auxiliary message must handle all painting.
  3225.  
  3226. Return Value
  3227.  
  3228. There is no return value.
  3229.  
  3230. Note
  3231.  
  3232. This routine is implemented as a macro.
  3233.  
  3234. See Also
  3235.  
  3236. bord_Paint, win_Employ, win_SetUserPaint, win_IsUserPaint
  3237.  
  3238.  
  3239.  
  3240. win_SetAttr                                           Sets a window's attribute
  3241.  
  3242. ---------
  3243.  
  3244. Synopsis
  3245.  
  3246. void win_SetAttr(win, attr)
  3247.  
  3248.    win_type win;              the window object
  3249.    byte attr;                 the attribute
  3250.  
  3251. Description
  3252.  
  3253. This routine sets the attribute of the window win to the given attribute attr.
  3254. It subsequently paints all unobscured portions of the window.  Recall that the
  3255. attribute specifies a foreground/background color combination.
  3256.  
  3257. Return Value
  3258.  
  3259. There is no return value.
  3260.  
  3261. See Also
  3262.  
  3263. win_GetAttr
  3264.  
  3265.  
  3266.  
  3267. win_SetBorder                                       Attach a border to a window
  3268.  
  3269. ---------
  3270.  
  3271. Synopsis
  3272.  
  3273. boolean win_SetBorder(win, border_func);
  3274.  
  3275.   win_type win;             the window object
  3276.   bd_fptr border_func;      the border function
  3277.  
  3278. Description
  3279.  
  3280. This routine creates a border from the given border function and sends an
  3281. "open" message to it.  Space is allocated for the border object.
  3282.  
  3283. Once a border has been attached to the window, the other window routines
  3284. automatically incorporate it into their actions.  The display routines
  3285. (win_Employ, bord_Paint) tell the border to paint itself.  The destructor
  3286. routines (win_Close) tell the border to destroy itself.  The size and
  3287. positioning functions compensate for the size of the border when doing their
  3288. calculations.
  3289.  
  3290. If a window already has a border, win_SetBorder destroys the old border and
  3291. replaces it with the new border.
  3292.  
  3293. Some standard border functions are bd_1, bd_2, bd_box, bd_null, bd_plain,
  3294. bd_std, and bd_title.
  3295.  
  3296. Return Value
  3297.  
  3298. Returns TRUE if successful.  If unable to create the border it returns FALSE.
  3299.  
  3300.  
  3301.  
  3302. win_SetData                               Set the window's generic data pointer
  3303.  
  3304. ---------
  3305.  
  3306. Synopsis
  3307.  
  3308. void win_SetData(win, data);
  3309.  
  3310.   win_type win;             the window object
  3311.   VOID *data                the window data
  3312.  
  3313. Description
  3314.  
  3315. This routine sets the window's generic data pointer.  The generic data pointer
  3316. is a VOID * pointer that you can use for attaching program-specific data to a
  3317. window.  You should cast the address of your data to a (VOID *) when you call
  3318. this function.
  3319.  
  3320. Return Value
  3321.  
  3322. There is no return value.
  3323.  
  3324. Note
  3325.  
  3326. This routine is implemented as a macro.
  3327.  
  3328. See Also
  3329.  
  3330. win_GetData
  3331.  
  3332.  
  3333.  
  3334. win_SetExplode                           Attach an explode function to a window
  3335.  
  3336. ---------
  3337.  
  3338. Synopsis
  3339.  
  3340. void win_SetExplode(win, explode);
  3341.  
  3342.   win_type win;             the win
  3343.   exp_fptr explode;         the explode function
  3344.  
  3345. Description
  3346.  
  3347. This routine attaches an explode function to a window.  The window manager
  3348. calls the explode function when the window is initially painted to the
  3349. display.  The explode function paints images to the display before the window
  3350. is painted and is used to create "special effects" when creating windows.
  3351.  
  3352. Some standard explode functions are exp_std and exp_BeamMeUp.
  3353.  
  3354. Return Value
  3355.  
  3356. There is no return value.
  3357.  
  3358. Note
  3359.  
  3360. This routine is implemented as a macro.
  3361.  
  3362.  
  3363.  
  3364. win_SetMouse                                 Attach a mouse handler to a window
  3365.  
  3366. ---------
  3367.  
  3368. Synopsis
  3369.  
  3370. void win_SetMouse(win, handler)
  3371.  
  3372.    win_type win;                   the window object
  3373.    mouhandler_fptr handler;        the mouse handler to attach
  3374.  
  3375. Description
  3376.  
  3377. This routine attaches the mouse handler handler to window win.
  3378.  
  3379. Most of the mouse handlers provided by the library interact with seds.  The
  3380. winmou_Track handler is a generic track handler for windows of other classes,
  3381. such as grwins, cmwins, and userwins.
  3382.  
  3383. winmou_Track automatically communicates with the mouse handlers of other
  3384. windows (including seds) to pass control back and forth.  That is, if its
  3385. window is not the current window and the user moves the mouse from another
  3386. window into the winmou_Track window, winmou_Track accepts the offer to become
  3387. the current window.  Likewise, if it is the current window and the user moves
  3388. the mouse to another window, winmou_Track grants the request to become current
  3389. from another window.
  3390.  
  3391. To become current, a window must also have the capacity to respond to win_Go.
  3392. sed and sleds have this capacity intrinsically; it is part of their class
  3393. functions, sedwin_Class and sledwin_Class.  Windows of other classes (such as
  3394. cmwins, pmwins, and userwins) only gain this capacity when the window has an
  3395. auxiliary function that processes the message WINA_GO.
  3396.  
  3397. Once a window is current, calling kb_Read allows winmou_Track to process mouse
  3398. events for the window.  winmou_Track returns either MOU_THERE or MOU_CLICK from
  3399. kb_Read.
  3400.  
  3401. MOU_THERE means that a mouse event occurred in a another window and that window
  3402. has been granted control.  Your auxiliary function should return immediately.
  3403.  
  3404. MOU_CLICK means that the mouse was clicked in your window.  You can call
  3405. win_MouseCurEvent to get a mev_struct describing the event that occurred.
  3406. Then, you can call win_MouseDblClick, mev_IsButton1Down, mev_IsButton2Down,
  3407. mev_IsButton3Down to tell you whether the click was a double click or single
  3408. click and what button was used.  mev_GetX and mev_GetY tell of the x and y
  3409. pixel position of the event, in window coordinates.  mev_GetRow and mev_GetCol
  3410. tell of the character row and character column of the event, in window
  3411. coordinates.
  3412.  
  3413. Return Value
  3414.  
  3415. There is no return value.
  3416.  
  3417. Note
  3418.  
  3419. This routine is implemented as a macro.
  3420.  
  3421.  
  3422.  
  3423. win_SetNextWin                                   Pass control to another window
  3424.  
  3425. ---------
  3426.  
  3427. Synopsis
  3428.  
  3429. void win_SetNextWin(currwin, nextwin);
  3430.  
  3431.    win_type currwin;                the current window
  3432.    win_type nextwin;                the next window
  3433.  
  3434. Description
  3435.  
  3436. Use this routine if you wish to pass control to another window without leaving
  3437. win_Go.
  3438.  
  3439. If you call win_SetNextWin with a handle to the next window, when you leave
  3440. your window, the window manager will pass control to the nextwin instead of
  3441. returning from win_Go.  If nextwin is NULL the window manager will not pass
  3442. control to another window and win_Go will simply return.
  3443.  
  3444. Typically this function is used by mouse handlers to pass control between
  3445. various windows when they are selected with the mouse.  The next window is
  3446. initially set to NULL.
  3447.  
  3448. Note that nextwin can be a C-scape sed because a sed is a type of window.
  3449.  
  3450. Return Value
  3451.  
  3452. There is no return value.
  3453.  
  3454. See Also
  3455.  
  3456. win_Go
  3457.  
  3458.  
  3459.  
  3460. win_SetPosition                               Set a window's character position
  3461.  
  3462. ---------
  3463.  
  3464. Synopsis
  3465.  
  3466. void win_SetPosition(win, row, col)
  3467.  
  3468.    win_type win;              the window object
  3469.    int row;                the window display row position
  3470.    int col;                the window display column position
  3471.  
  3472. Description
  3473.  
  3474. This routine positions a window at the character coordinate position (col, row)
  3475. and, if the window is employed, repaints the window.  These coordinates are
  3476. relative to the display.
  3477.  
  3478. Return Value
  3479.  
  3480. There is no return value.
  3481.  
  3482. Note
  3483.  
  3484. This routine is implemented as a macro.
  3485.  
  3486. See Also
  3487.  
  3488. win_SetPixPosition, win_GetPosition, win_GetPixPosition
  3489.  
  3490.  
  3491.  
  3492. win_SetShadow                                        Set the window shadow size
  3493.  
  3494. ---------
  3495.  
  3496. Synopsis
  3497.  
  3498. void win_SetShadow(win, shd);
  3499.  
  3500.    win_type win;                    win whose shadow to set
  3501.    int shd;                         size of shadow in characters
  3502.  
  3503. Description
  3504.  
  3505. This routine sets the size of the given window's shadow as specified by shd.
  3506. Note that shadow size is specified in character units.
  3507.  
  3508. A shadow is an extension to the window's border that paints a darkened strip
  3509. along the bottom and right edges of the window to give it a three dimensional
  3510. appearance.  The color of the strip is determined by the shadow attribute of
  3511. the window on which the shadow falls.
  3512.  
  3513. Return Value
  3514.  
  3515. There is no return value.
  3516.  
  3517. Note
  3518.  
  3519. This routine is implemented as a macro.
  3520.  
  3521. See Also
  3522.  
  3523. win_SetShadowAttr
  3524.  
  3525.  
  3526.  
  3527. win_SetShadowAttr                          Set the shadow attribute of a window
  3528.  
  3529. ---------
  3530.  
  3531. Synopsis
  3532.  
  3533. void win_SetShadowAttr(win, attr);
  3534.  
  3535.    win_type win;                    the window
  3536.    byte attr;                       the shadow color attribute
  3537.  
  3538. Description
  3539.  
  3540. This routine sets the window's shadow attribute to the value given by attr.
  3541.  
  3542. The shadow attribute dictates how a shadow (from some other overlapping window
  3543. with a shadow border) will appear as it falls on this given window.  For
  3544. example, if you want black shadows to appear across your window use attribute
  3545. 0x00.  Use a different attribute, such as 0x08, to create shadows that show the
  3546. contents of the window faintly within the shadow.
  3547.  
  3548. Return Value
  3549.  
  3550. There is no return value.
  3551.  
  3552. Note
  3553.  
  3554. This routine is implemented as a macro.
  3555.  
  3556. See Also
  3557.  
  3558. win_SetShadow
  3559.  
  3560.  
  3561.  
  3562. win_SetSize                                 Alter a window's display dimensions
  3563.  
  3564. ---------
  3565.  
  3566. Synopsis
  3567.  
  3568. void win_SetSize(win, rows, cols)
  3569.  
  3570.    win_type win;              the window object
  3571.    int rows;                  the new window height in character rows
  3572.    int cols;                  the new window width in character columns
  3573.  
  3574. Description
  3575.  
  3576. This routine alters a window's dimensions on the display.  It saves any parts
  3577. of the display about to be obscured by expansion; exposes any parts about to be
  3578. unobscured by shrinking; and, paints the whole window in its new size.  It does
  3579. nothing if the window is NULL.
  3580.  
  3581. Return Value
  3582.  
  3583. There is no return value.
  3584.  
  3585. Note
  3586.  
  3587. This routine is implemented as a macro.  And, in this function the assumption
  3588. is made that borders do not need to be saved, and that the window contents need
  3589. to be saved before the border is shrunk to obscure them.
  3590.  
  3591. See Also
  3592.  
  3593. win_SetPixSize, win_GetSize, win_GetPixSize
  3594.  
  3595.  
  3596.  
  3597. win_SetUserPaint                                 Set a window's user paint flag
  3598.  
  3599. ---------
  3600.  
  3601. Synopsis
  3602.  
  3603. void win_SetUserPaint(win, userpaint);
  3604.  
  3605.     win_type win;               window
  3606.     boolean userpaint;          auxiliary paint flag
  3607.  
  3608. Description
  3609.  
  3610. This routine sets or clears the user paint flag of a window.  If the paint flag
  3611. is set, then the Window Manager window's sends the window's auxiliary function
  3612. WINA_PAINT and WINA_SHADOW messages.
  3613.  
  3614. Only userwins have their user paint flag set by default.  You can test the
  3615. state of the flag by calling win_IsUserPaint.
  3616.  
  3617. Return Value
  3618.  
  3619. There is no return value.
  3620.  
  3621. Note
  3622.  
  3623. This routine is implemented as a macro.
  3624.  
  3625. See Also
  3626.  
  3627. win_IsUserPaint
  3628.  
  3629.  
  3630.  
  3631. win_Top                                Bring a window to the top of the display
  3632.  
  3633. ---------
  3634.  
  3635. Synopsis
  3636.  
  3637. void win_Top(win)
  3638.  
  3639.    win_type win;              the window object
  3640.  
  3641. Description
  3642.  
  3643. This routine brings the specified window to the top of the display.
  3644.  
  3645. Return Value
  3646.  
  3647. There is no return value.
  3648.  
  3649. Note
  3650.  
  3651. This routine is implemented as a macro.
  3652.  
  3653.  
  3654.  
  3655. win_UnEmploy                                                      Fire a window
  3656.  
  3657. ---------
  3658.  
  3659. Synopsis
  3660.  
  3661. boolean win_UnEmploy(win)
  3662.  
  3663.    win_type win;              the window object
  3664.  
  3665. Description
  3666.  
  3667. This routine moves a window from its place in the employed window list to the
  3668. unemployed list.  The window is removed from the display and the portions of
  3669. the display that were hidden by the window are repainted.  If the window is
  3670. already in the unemployed list, then this routine does nothing.
  3671.  
  3672. Return Value
  3673.  
  3674. There is no return value.
  3675.  
  3676. See Also
  3677.  
  3678. win_Employ
  3679.  
  3680.  
  3681.