home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tvos200.zip / README.OS2 < prev   
Text File  |  1995-04-25  |  10KB  |  199 lines

  1. Turbo Vision 2.0 for OS/2
  2. -------------------------
  3. Author:     F. Jalvingh
  4. CompuServe: 100450,454
  5. Internet:   jalving@ibm.net
  6.  
  7. See changes.log for a list of changes made to the sources (and why).
  8.  
  9. Currently this is a TEST version. The thing compiles with a number of TV
  10. project I have, and runs acceptably. Please report any problems; I'll try
  11. to solve things as they come.
  12.  
  13. This is my FIRST try to get this out into the open. Therefore it is possible
  14. (even very likely) that stuff is missing from this file, or that you have
  15. problems recompiling all of this. If so, please let me know and I'll try to
  16. solve it. Also, the port is still in progress; this is merely ment to give
  17. you an idea of how it will look....
  18.  
  19.  
  20. Legal stuff
  21. -----------
  22. This port is in the public domain, but the Turbo Vision source is not. You
  23. are granted the right to do what you want with the non-Turbo Vision code, but
  24. of course you're still bound to the Turbo Vision licence.
  25. I hold no rights to the code I wrote; do with it what you want. I will not be
  26. responsible for any damage resulting in the use of the code, and I will not
  27. garantuee fitness for any purpose.
  28.  
  29.  
  30. What is it?
  31. -----------
  32. This package allows Turbo Vision programs for OS/2 to be created. It consists
  33. of a DIFF file and some auxiliary files that patch the original Turbo Vision
  34. 2.0 sources, provided with the Borland Powerpack for DOS 1.0.
  35. The resulting package can then be compiled with both Borland C++ or WatCOM
  36. C++ to create an OS/2 native 32-bits version of Turbo Vision. Compiling for
  37. IBM C Set/2 is possible, but I have not yet tested that with this version, so
  38. it will need work.
  39.  
  40.  
  41. What is it not?
  42. ---------------
  43. This port is a rather straightforward port of the original code. This code was
  44. created for a single-tasking DOS machine, and so no special provisions are made
  45. for any OS/2 multithreading. Also, to keep the porting process simple (and the
  46. port compatible) I've tried to make minimal changes to the interface. This was
  47. quite a struggle with my conscience (because it would be much more nice to
  48. create an OS/2 specific Turbo Vision by rewriting all "hardware level" classes)
  49. but the result should allow quite easy porting of applications.
  50.  
  51. The port to OS/2 has the following peculiarities:
  52.  
  53. * It isn't too fast. The basic window rendering algorithm in TV is horrible,
  54.   and was written in Assembler by Borland to provide a reasonable working
  55.   speed. This assembler code is not completely ported yet so I made a C++
  56.   version of the code. Which isn't very fast... I'm still working on porting
  57.   the assembler module, so..
  58.   Even with the assembler module in use, Turbo Vision will probably be still
  59.   quite slow because of the overhead caused by a zillion VIO calls.. I would
  60.   like to rewrite the rendering code to something more reasonable but that
  61.   would mean rewriting large parts of the TGroup and TView base classes, and
  62.   I'm still checking to see whether that would break things.
  63.  
  64. * Shadows are currently not supported. The C++ writeView was slow enough as
  65.   it was, and I didn't want to slow it down even more. Besides, I already had
  66.   haemorrhoids from decoding and implementing the C++ code from the assembly
  67.   code, so there.
  68.  
  69. * TV has at it's base an event loop. When doing nothing at all, a TV process
  70.   is very, very busy checking whether any event has occured and calling the
  71.   idle() call. This causes a CPU utilization of 100% when doing nothing.
  72.  
  73.   The event loop has separate calls to get mouse events and to get keyboard
  74.   events. This sucks, and prevent me from trying to make a "blocking" event
  75.   loop. I'm still working on this; my current thoughts are to make a separate
  76.   thread do the keyboard and mouse reads in blocking mode, and to make the
  77.   main TV thread wait on a semaphore. Calls to idle() would be issued every
  78.   second or so by a semaphore timeout. Any ideas would be welcome..
  79.  
  80. * You can use TV in a multithread program, but ALL calls / references to ANY
  81.   TV class must be made from only ONE thread. No locking is done at ALL within
  82.   the Turbo Vision code, and it would not even help if it did. Making TV
  83.   multithread would really be a lot of work and would very much change the
  84.   way it worked from an application (need "thread anchor blocks" and the like).
  85.  
  86. * My first port of Turbo Vision was for version 1.3. This version took a long
  87.   time to port, not because the porting was difficult but because the original
  88.   code contained a zillion bugs. These surfaced because OS/2 provides memory
  89.   protection. The port of 2.0 worked almost instantly, so I have not currently
  90.   checked what bugs still remained from the original version.
  91.  
  92. * The patched code also changes the interface to Windows NT & dos
  93.   compatibility. I am not working for/with either, so these patches will
  94.   probably cause problems for the DOS and NT versions of TV. Make sure you have
  95.   a backup; and if you have to use both the OS/2 and some other version you'll
  96.   have to do some work yourself.. The main reasons for this are in changes.log.
  97.  
  98. * The Multi-compiler interface still sucks.
  99.  
  100.  
  101. Installing
  102. ----------
  103.  
  104. You'll need the following to make this version:
  105.  
  106. * This package & the stuff to decompress it.
  107.  
  108. * The original Turbo Vision 2.0 source code, as provided with the Borland
  109.   Powerpack for DOS 1.0.
  110.  
  111. * GNU PATCH 2.6. This program will apply the patches specified in the DIFF
  112.   file to the original sources. It can be found on many BBS's or internet
  113.   (hobbes).
  114.  
  115. * Either the Borland C++ compiler or the WatCOM 10.0a compiler. C Set/2 will
  116.   not immediately work.
  117.  
  118. Make a subdirectory 'prj' somewhere. This is the base for all TV projects
  119. (and can already exist in your file structure). This subdirectory MUST be
  120. specified in the INCLUDE paths of your compiler, i.e.
  121. SET INCLUDE=......\prj or -I...prj.
  122.  
  123. Below PRJ, create a TVISION subdirectory and copy the original TV source code
  124. (found in the compiler directory SOURCE\TVISION) here.
  125.  
  126. Copy all TV header files from your compiler's INCLUDE\TVISION directory also
  127. to PRJ\TVISION, so that both sources and headers are in the same directory.
  128.  
  129. Make the PRJ directory the current directory, then pkunzip -D this package. It
  130. will create some new subdirectories (CPL, TVDEMO), and it will expand some
  131. other files into the TV directory.
  132.  
  133. Use the GNU PATCH command to patch the source code. Make PRJ\TVISION the
  134. current directory, then use
  135.  
  136.     patch < patches.dif
  137.  
  138. to patch all files.
  139.  
  140. After this, check for any .REJ files in this directory. If PATCH cannot patch
  141. a file it will generate a .REJ file for this file containing the patch it
  142. could not make. If this happens you're in trouble: you either don't have the
  143. correct source code, an incorrect version of PATCH OR you have a source file
  144. that contains TAB's with some strange expansion size! Either patch by hand or
  145. try again after solving something...
  146.  
  147. Ok, now you should have compilable code. Make yourself some dandy makefile
  148. for the project and go. I do not provide a makefile (I do not use make) but
  149. a list of sources can be found in TV.PPP. Take heed: not all assembler modules
  150. must be used, and the modules Tmenupop.cpp and Smenupop.cpp must not be used
  151. either. Of course you can also use the BC IDE.
  152.  
  153. You can also use the tools in the subdirectory TOOLS, named MKLIB and TCM, to
  154. build the library and to compile programs using the library. To use these,
  155. read the README in the TOOLS directory.
  156.  
  157. The options I've used for the Borland C++ compiler are:
  158.  
  159.     bcc -c -sm -D__32BITS__ -d -N -w-sig -v -k -Od -r -Vo- -o(obj name)
  160.     tasm /s/z/t/ml/p -D__FLAT__
  161.  
  162.     I use the Borland 1.5 compiler; I have not upgraded to 2.0 because Borland
  163.     was so very supportive for it's OS/2 customers.. For this compiler I have
  164.     the following tips:
  165.  
  166.     * Don't use the optimizer! Dont! Really! Lots of trouble I've had with this
  167.       compiler was really the optimizer doing it's best. The only set of
  168.       optimize options I've found to work reasonably well is
  169.  
  170.         -Od -Ob -Oc -Ot -r
  171.  
  172.       Pay special attention to the -r above: don't EVER compile C++ code with
  173.       -r-. One of the effects of compiling with -r- (disable registers) is
  174.       that register variables (ESI, EDI) are not saved in the function prolog.
  175.       This seems logical since they shouldn't be used anyway. But the startup
  176.       code of the Borland C++ 1.5 code uses the ESI register to keep something
  177.       like the "list of constructor lists" when __startup calls all global
  178.       constructors. The result is that when some constructor of a globally
  179.       instanciated class uses ESI the program traps before main() is called.
  180.       This had me completely baffled, more so because the great Borland
  181.       debugger kept dying when this occured. I had to use the WatCOM debugger
  182.       to find this out. I really am getting very fond of the WatCOM compiler!!
  183.  
  184. For the WatCOM compiler the options I use are:
  185.  
  186.     wpp386 -bm -d__32BITS__ -bt=os2 -d2 -e25 -fh -fo=(obj name) -j -mf -5r -w4 -zq
  187.  
  188.     * Currently you'll need TASM to compile the assembler stuff for WatCOM
  189.       because WASM doesn't comprehend some directives in the assembler source.
  190.  
  191. After compiling the library, try to compile and link the TVDEMO sources
  192. provided. They should compile & link without problems. The sources are taken
  193. from the Turbo Vision stuff, but some changes were made for functions that
  194. are not provided with other compilers.
  195.  
  196.  
  197.  
  198.  
  199.