home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-Update.iso / CDROM / Contents / READMEs / Peanuts-2 / Developer / objc / appkit / FrontEndTool.README < prev    next >
Encoding:
Text File  |  1996-11-09  |  3.8 KB  |  79 lines

  1. Introduction:
  2.  
  3.     Programs such as Emacs, Mathematica, Gdb etc on NeXT have a
  4. common feature. They all have an underlying program which runs in
  5. standard Unix environment and a front end which parses the output from
  6. that underlying program with a more attractive presentation usually
  7. conforms to NextStep standard and provides inputs to the program
  8. according to use's actions such as mouse click, mouse move etc. There
  9. are even more programs out there which can be ported to NextStep
  10. environment by providing the front end without rewriting the whole
  11. program or even better, without the source code. What should be done
  12. is simple, by creating channels to communicate with the underlying
  13. program, then that program can be controlled by the front end.
  14.  
  15.     The steps take to do this are as following:
  16. 1. Creating the pty/tty pairs so that front end can communicate with
  17. its program .
  18. 2. Forking a child process and spawning the program.
  19. 3. Parsing the output from the program and translating user's actions
  20. into inputs to the program.
  21.  
  22.     The included toolkit is such a prototype which implements the
  23. basic stuff for you. It will create the pty/tty pair, fork the child
  24. process and spawn the program for you. It also provide two routines,
  25. inputToApp:(char *)in and outputFromApp:(char *)out in EtermHandle
  26. class, so that you can get outputs from the program and provide inputs
  27. to the program. Of couse, how to parse the outputs depends on what the
  28. program does and it's up to the programmer to implement them. Some
  29. basic framework are also there, such as the routine to set up the
  30. DEFAULT.
  31.  
  32.      There is no general mechanism to change the underlying program
  33. during program execution. It is believed that anyone uses this toolkit
  34. intends to rewrite the toolkit to serve specific program. It is
  35. therefore not necessary to change the program from time to time. The
  36. CSH program included is merely an example. No optimization to the
  37. speed nor elegancy to the interface has been done.
  38.  
  39. Usage:
  40.  
  41. 1. Programmer must create a subclass of HandleDeputy which implements
  42. inputToApp:(char *)in and outputToApp:(char *)out. This class can but
  43. not necessarily implement the output parser. inputToApp:(char *)in is
  44. supposed to be called in the program whenever you need to provide
  45. inputs to the program. outputFromApp:(char *)out will be called if
  46. there are outputs from the program. Calling is automatically and the
  47. ouput parser can be called from this program. Appender class can serve
  48. as an example about how these two routines can be implemented.
  49.  
  50. 2. The default framework is in BlackHand class. You might want to
  51. change them if you need any default value to be set.
  52.  
  53. 3. To change the program you want to interface with. Change the
  54. AppsName and ProgName in BlackHand.h. AppsName is the name of the
  55. front end. In addition, you also need to change Csh_main.m, Csh.nib,
  56. Csh.iconheader to AppsName_main.m, AppsName.nib and
  57. AppsName.iconheader and the corresponding file name in IB.proj.
  58. ProgName is the name of underlying program. It must be a full path
  59. file name. Instead of "csh", you should specify it as "/bin/csh".
  60.  
  61. Acknowledgement:
  62.     This toolkit is basically modifications of Emacs by John G. Myers.
  63. Some class names have been renamed to reflect what they do. Some,
  64. however, have the same name as in the original source code.
  65.     The codes to create the pty/tty pair, setup the terminal and fork
  66. and spawn the program comes from the emacs distribution.
  67.     This toolkit carries the same copy right as in Emacs 2.0. Please
  68. see copying.rtf for further information.
  69.  
  70.  
  71.                         Chin Hsiang Wu
  72.                         chin@sg1.chem.upenn.edu
  73.  
  74. P.S. If you find any bug in this toolkit, please let me know and I
  75. will try to debug. If you think the explanation above is not clear
  76. enough and you can do a better job explaning. Do whatever modification
  77. is necessary. Send me a copy of your modification if you want to, but
  78. not required.
  79.