home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / apps / spread / opusprg / opussrc / readme < prev    next >
Text File  |  1988-05-22  |  9KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.        The following describes the source files for Opus and the setup 
  6.        for compilation. A brief description of the interface for 
  7.        accessories also is given.
  8.  
  9.        /***************************************************************/
  10.        /*          Source file and compilation description            */
  11.        /***************************************************************/
  12.  
  13.        The .PAS source files comprise the compilable modules, while the 
  14.        corresponding .DEF files contain the procedure and function 
  15.        definitions only and serve as include files. My compilation setup 
  16.        is as follows, and to place the files in different locations, you 
  17.        will have to alter the include file definitions at the start of 
  18.        every .PAS file to reflect the new pathnames.
  19.  
  20.             Personal Pascal v 2.01 or greater.
  21.             1-meg ST, 20 meg hard drive. The following files are copied 
  22.             to a 320K ramdisk I: root directory.
  23.  
  24.                  1. compiler.prg
  25.                  2. linker.prg
  26.                  3. pasgem
  27.                  4. paslib
  28.                  5. gctv.inc
  29.                  6. gemsubs.def
  30.                  7. globsubs.def
  31.                  8. vdi_aes.def
  32.                  9. auxsubs.def
  33.                 10. opus.i
  34.  
  35.        The remaining files are located in directory "d:\pascal\opus\". 
  36.        You *must* run pascal.prg from this directory in order for the 
  37.        linker to place the .O files here. You also must make sure the 
  38.        pascal.inf file is the one I included. Also, make sure that 
  39.        gemsubs.def and auxsubs.def are the ones I included, *not* the 
  40.        files OSS supplied. A description of the source files follows; 
  41.        they are typically abbreviated, since the linker "additional link 
  42.        files" command line has a very limited length! Note: files 
  43.        preceded by an asterisk contain routines of general interest cited 
  44.        under "Lagniappe" in the article.
  45.  
  46.             Filename  Description
  47.  
  48.             BF.PAS    Block and File routines.
  49.        *    E.PAS     The expression evaluator. Contains my_exp and 
  50.                       my_ln.
  51.             GL.PAS    GLobal subroutines, i.e. commonly needed ones. 
  52.                       Includes procedures for creating and deleting 
  53.                       cells, dependent cell list management.
  54.             GR.PAS    GRaphic display. Screen display routines are found 
  55.                       here.
  56.             M.PAS     Message handler. Routines to handle GEM messages 
  57.                       are found here, including the messages I defined 
  58.                       myself for use with desk accessories.
  59.        *    NC.PAS    Number Conversion routines. real_to_string and
  60.                       string_to_real are found here.
  61.             OPUS.PAS  The main file. Data initialization, main program 
  62.                       loop.
  63.  
  64.  
  65.                                       -1-
  66.  
  67.  
  68.  
  69.  
  70.  
  71.             P.PAS     Printer handling.
  72.             R.PAS     Resource handling. These procedures maintain, 
  73.                       display, and animate dialogs, and most implement 
  74.                       the functions they represent (one exception is 
  75.                       print_spreadsheet, which calls do_print in P.PAS to 
  76.                       do the actual printing).
  77.             S.PAS     Some string utilities.
  78.        *    V.PAS     VDI and AES routines not included in Personal 
  79.                       Pascal. map_tree, set_text, and get_text are found 
  80.                       here as well as lots of other good stuff.
  81.             W.PAS     Window input. Originally a general purpose routine 
  82.                       for input into a window, this has been extensively 
  83.                       modified to be specific to Opus. It animates the 
  84.                       edit area and function menu.
  85.  
  86.             OPUS.I    The resource construction set header.
  87.             GCTV. INC Global Constants, Types and Variables.
  88.  
  89.             The remaining files should be more or less self-explanatory.
  90.  
  91.        /***************************************************************/
  92.        /*           Communication with desk accessories               */
  93.        /***************************************************************/
  94.  
  95.        I've provided the hooks to expand Opus through desk accessories, 
  96.        using the GEM message pipeline. Now, space precludes a detailed 
  97.        discussion, especially since Tom Hudson wrote a great tutorial in 
  98.        the Summer 1987 Start magazine, which served as my reference. So, 
  99.        I ask that you consult this article, and I will give a description 
  100.        of the messages Opus supports. You also will need to include the 
  101.        definitions of any Opus-specific types.
  102.  
  103.        First, the message names and numbers are defined in GCTV.INC. They 
  104.        are handled in M.PAS. Brief descriptions of each follows.
  105.  
  106.        PresentMsg
  107.             An acc can send this message, and if Opus is present, it will 
  108.             reply, returning the current row and column of the active 
  109.             cell in msg[3] and msg[4].
  110.        AssignedMsg
  111.             Tests whether the cell at row and column specified in msg[3] 
  112.             and msg[4] is assigned or not, returning the result in 
  113.             msg[5]. Also returns the address of the cell or NIL in msg[3] 
  114.             (the most significant byte) and msg[4] (the lsb).
  115.        RedrawMsg
  116.             Force Opus to refresh its window(s).
  117.        DataMsg
  118.             Return the address of "data," the sparse matrix and main data 
  119.             structure.
  120.        NewMsg
  121.             Creates a new cell at row and column indicated in msg[3] and 
  122.             msg[4]. Returns address or NIL in msg[3] and msg[4].
  123.        DeleteMsg
  124.             Deletes the cell at row and column indicated by msg[3] and 
  125.             msg[4].
  126.  
  127.  
  128.  
  129.  
  130.  
  131.                                       -2-
  132.  
  133.  
  134.  
  135.  
  136.  
  137.        LocateMsg
  138.             Returns the address of the cell or NIL of the cell at row and 
  139.             column indicated by msg[3] and msg[4], returning the address 
  140.             in msg[3] and msg[4].
  141.        DefRangeMsg
  142.             Returns the start and end rows and columns of a block 
  143.             selected in Opus, or returns 0 in msg[3] if a block isn't 
  144.             selected.
  145.        GetRangeMsg
  146.             Calls the routine which displays the "select range" dialog 
  147.             used by "save block," returning 1 in msg[7] if the user 
  148.             selected OK or 0 in msg[7] if the user chose Cancel. The 
  149.             start and end rows and columns are returned in msg[3..6].
  150.        MfdbAddrMsg
  151.             Returns the addresses of the screen and memory mfdbs, so that 
  152.             the accessory need not define its own. Also allows the acc to 
  153.             use Opus's 32K blit buffer.
  154.        RealToStrMsg
  155.             Allows acc to use real_to_string. The address of the real to 
  156.             be converted should be specified in msg[3] and msg[4], while 
  157.             the address of the string should be placed in msg[5] and 
  158.             msg[6]. msg[7] should contain have the high bit set if the 
  159.             number is to be converted to scientific notation, and should 
  160.             otherwise equal the number of decimal places. 
  161.             ex. msg[7] := $8002 means use sci. not. and 2 decimal places.
  162.        StrToRealMsg
  163.             Allows the acc to use Opus's string_to_real function. The 
  164.             string's address should appear in msg[3] and msg[4], while 
  165.             the address of the real should appear in msg[5] and msg[6].
  166.        TranslateMsg
  167.             Converts a cell reference to row and column numbers, i.e. 
  168.             "B10" yields 10,2. The address of the string should appear in 
  169.             msg[3] and msg[4]. msg[5] will contain 1 if the conversion 
  170.             was successful and 0 otherwise. msg[3] and msg[4] will 
  171.             contain the row and column.
  172.        StringaCellMsg
  173.             Converts row and column specified in msg[3] and msg[4] to the 
  174.             cell reference representation, i.e. 2,3 goes to "C2."
  175.        RecalcMsg
  176.             Recalcs the spreadsheet. 'Nuff said.
  177.        Note that after processing an accessory-generated message, Opus 
  178.        sends a reply to the accessory. The acc should wait for the reply 
  179.        before proceeding.
  180.  
  181.        Well, that's all for now. If you have any questions, feel free to 
  182.        contact me at
  183.  
  184.             Delphi- MedStud
  185.             Compuserve- 72277,2315
  186.             Genie- DougH
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.                                       -3-
  198.  
  199.